0
$\begingroup$

I had used a trained CNN model (VGG16) over a large dataset with 6 number of classes in FC layer it gave me a good accuracy ( for example over Testing data: loss=0.59, accuracy=0.829).

When I had applied the same model over a dataset with less samples and labels (4 classes) it reduced the accuracy.

Here my question is : is it possible to use model 1 over the 2nd dataset (bec I had saved the attained weights) or it is not possible due to the difference in classes number?

Also if I rerun my model 1 does the accuracy would be improved or no?

$\endgroup$

2 Answers 2

0
$\begingroup$

I think if the new test data (one with fewer samples and 4 classes) is from the same distribution as the original training data, the model should be applicable, you can use the pre-trained model.

Regarding the drop in accuracy I don't think it is because there are less number of classes (if the new test data is from same distribution as original train data). May be check if the images(or data) in the new test dataset is very different from original training data and old test dataset.

$\endgroup$
3
  • $\begingroup$ I saw the only difference is in the total number of training dataset in case 1: I had used 7000 samples while the case 2: I had used 3000 samples. Do you think is better better to enlarge training dataset in case 2 $\endgroup$
    – baddy
    Aug 17, 2020 at 7:29
  • $\begingroup$ I assumed that you are only training in case 1 and using the model trained from case1 to predict case2. If you are training model in case 2(on train data of case2): then see if the model is overfiting(using case2 test data). If not, then I guess enlarging training data(of case2) should help. If you are using model trained on train data in case 1 and predicting on case 2: then its difficult to say (since you said only difference is in the total number of training dataset). You may try increasing training data of case1 and see if it finally improves accuracy on case2. $\endgroup$ Aug 18, 2020 at 9:33
  • 1
    $\begingroup$ Thank you very much it is clear $\endgroup$
    – baddy
    Aug 19, 2020 at 7:14
0
$\begingroup$

The accuracy will downgrade since the model was trained on a dataset with 6 classes but is being tested on 4 classes.

If you want a good accuracy for the dataset with 4 classes, first train it on the data of 4 classes and then test it on some test data with 4 classes.

Hope this is of help.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.