Classification problem in neural network code from scratch
조회 수: 2 (최근 30일)
이전 댓글 표시
I have developed a code for ANN BP to classify snore segments. I have 10 input features and 1 hidden layer with 10 neuron and one output neuron. I denoted 1 as no snore and 0 as snore segment. I have 3000 segments and among them 2500 are no snore segments which are marked as 1. and 500 snore segments which are marked as 0. I already divided the data set in three sets (70% training, 15% validation and 15% testing). I also used the bias.
Now, while training the network, first I shuffled the training set and mixed the snore and no snore segments all together. So, After I trained the network, when I validate it (by only feed forward network), I found that it can only classify one of them. Let me clear it further, suppose, in the training set the last element is no snore (which is 1). So, it trained the network for that last output. Then in the validation phase, it always give output close to 1 even for snore segments (which is 0). Same thing happen if the last element is snore (0). Then it gives output close to 0 all the time in validation phase. Actually,The problem is in memorizing the previous weights for one label (suppose 0). Then when the other label suppose (1) come in the network, it forgets the weights for previous elements. I tried several hidden layer, 2 output layers. But, the problem remain same.
How can I solve this problem? Why Can't my network did not memorize the output for previous segments. It only saves for the last segment? What should I change in the network to solve it?
댓글 수: 0
답변 (1개)
Greg Heath
2016년 7월 8일
편집: Greg Heath
2016년 7월 8일
1. If you are using PATTERNNET, the targets should
be either [ 1; 0 ] or [ 0;1 ]
2. 2500/500 is too imbalanced.
There are several remedies.
The simplest solution is to make 4 copies of the
smallest class so the ratio is 2500/2500
Thank you for formally accepting my answer
Greg
PS For debugging make life easy and use a 500/500 random sample of the 2500/2500
참고 항목
카테고리
Help Center 및 File Exchange에서 Sequence and Numeric Feature Data Workflows에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!