MATLAB: The traning is 100% but mistake in testing

Deep Learning Toolboxneural network

Hi everybody…i traning my dataset …i used surf algorithm to extract features and i selected 10 features for everyclass..i have 5 classes.. the traning reaches to 100% but when enter image to test the result is not correct for example when enter image of first class it classefy as second or thired class…why this happen …olz help me

Best Answer

Sounds like a classic case of overtraining an overfit net.
You have too many unknown weights and/or not enough training equations.
Cures
1. To eliminate overfitting, minimize the number of hidden nodes that will yield satisfactory performance
2. Use a validation set to prevent overtraining an overfit net
3. Use regularization via the error function MSEREG and/or the training function TRAINBR
Let us know which one you use.
Thank you for formally accepting y answer
Greg