Lesson 1 - trying to create my own classifier and getting bad results

hi,

I’m trying to modify the code in the notebook for lesson 1 in order to create my own classifier. The classifier takes images sent by my daughter’s kindergarten teacher and determines if she’s in them or not. Everything runs smoothly until I get to the training stage at which the code:

learn = vision_learner(dls, resnet18, metrics=error_rate)
learn.fine_tune(5)

Yields:

epoch	train_loss	valid_loss	error_rate	time
0	1.096650	1.540798	0.428571	00:05
1	1.078716	1.446034	0.571429	00:05
2	1.029134	1.387569	0.571429	00:05
3	0.936269	1.373802	0.642857	00:05
4	0.798040	1.325878	0.571429	00:05

Offhand I can think of two reasons why that happened:

  1. In some of the images my daughter’s face is quite small or in profile.
  2. The classifier is for some reason not realizing what I’m trying to do.

Any ideas on how to improve the results?

How many images do you have? It is possible you just need more examples to train the model properly. You might be able to get a better idea of how the model is doing if you look at the results of the trained model to see what it is getting correct and what it is getting wrong. Maybe there are certain types of images that it is good at and certain that it doesn’t know how to handle well (yet).

There are 15 images in one group and 57 in the other. I’ll add more and see if it helps.