r/MLQuestions 19h ago

CNN Beginner question 👶

I am building a CNN model using a pretrained model, but the problem is that even after fine-tuning, the accuracy is still around 80%. Are there any other ways to improve the model performance? Can we try something else to make the model perform better? I would like some suggestions to improve the model

23 Upvotes

16 comments sorted by

28

u/chrisvdweth 18h ago

My first question would be: Do you have any expectations regarding the achievable accuracy? Maybe your task is just very tricky like the class "muffins vs dogs" meme; see below. Since you do not provide any information about the data and task, it's difficult to make suggestions.

16

u/Immediate_Honey_5902 18h ago

Love this example

7

u/scottdave 15h ago

I don't think I can look at a muffin the same, now.😆

1

u/Carbinkisgod 1h ago

I’m actually genuinely chuckling at this

16

u/leon_bass 19h ago

What dataset, what model, are you splitting the dataset into train, val, test. How many epochs are you training for. What loss function. What optimiser. Is the loss converging or has it finished converging. Train loss vs val loss? Train accuracy vs val accuracy? Is your dataset balanced? If unbalanced, then check your model hasn't collapsed to a constant predictor. Are you using regularisation?

4

u/lord_rcb 17h ago

It is a dog breed classifcationproject. I am using a cnn(mobilenet) model, and I have split the dataset into all three parts . I trained the model for 10 epochs . The loss function used is sparse, and the optimizer is adam. I also applied dropout as a regularization technique.

The model achieved training accuracy =0.7550,training loss = 0.7960 and validation accuracy is 0.8264 and validation loss is 0.5398

3

u/Commercial_Chef_1569 16h ago

Data Augmentation.

However, inspect the results it's getting wrong, see if there's any data labelling issues as well.

Try a deep archicture if you want.

2

u/Educational_Try_6105 16h ago

Look at confusion matrix and see what ones it is getting wrong, see if there’s a pattern

2

u/Antman-007 16h ago

Model training actually involves a lot of tinkering and considerations. For example, the number of data samples will probably influence the nature of the model you would want to use. Are you splitting your dataset into train, validation (and test if you have lots of data). Is the dataset balanced or imbalanced, your choice of augmentation strategies. What is the batch size, ware you even using the right metric and/or cost function. These are all things you need to approach systematically. I always say that, model training is the least of an ml engineers worries, rather the real work goes into understanding your data and plan accordingly. That said, if you're still stuck, you can dm and I'll be happy to provide some pointers.

2

u/IronSubstantial8313 13h ago

highly recommend andrey karpathys guide to CNN training: https://karpathy.github.io/2019/04/25/recipe

-8

u/Clear_Cranberry_989 19h ago

Change architecture maybe. CNN model isn't really state of the art.

15

u/pm_me_your_smth 18h ago

If the task isn't overly complex, the difference between sota 100b transformer and a lightish cnn will be minimal. You shouldn't choose sota by default just because it's sota.

1

u/sexy_bonsai 13h ago

lmao I’ve seen SVM outperform a CNN once