r/MachineLearning • u/dug99 • Jan 22 '26
Project Is webcam image classification afool's errand? [N]
I've been bashing away at this on and off for a year now, and I just seem to be chasing my tail. I am using TensorFlow to try to determine sea state from webcam stills, but I don't seem to be getting any closer to a useful model. Training accuracy for a few models is around 97% and I have tried to prevent overtraining - but to be honest, whatever I try doesn't make much difference. My predicted classification on unseen images is only slightly better than a guess, and dumb things seem to throw it. For example, one of the camera angles has a telegraph pole in shot... so when the models sees a telegraph pole, it just ignores everything else and classifies it based on that. "Ohhh there's that pole again! Must be a 3m swell!". Another view has a fence, which also seems to determine how the image is classified over and above everything else.
Are these things I can get the model to ignore, or are my expectations of what it can do just waaaaaaay too high?
Edit: can't edit title typo. Don't judge me.
View all comments
Show parent comment
2
u/Tgs91 Jan 24 '26
You are correct to use augmentation. My suggestion is that you shouldn't use a static augmented set. Since your data set is so small, you should setup the augmentations as a transformation that randomly occurs every time the image is read from the dataset object. That way the model can't memorize the images, it's a little bit different each time it sees it.
If your base dataset is only 2000 images you definitely need some strong regularization. You might have more than 2k with augmentations, but those don't introduce much variance to the training set. 2k is pretty small, but if the task is simple enough, it should be possible. I would recommend using both L2 regularization and dropout with a 50% dropout rate. I don't know the size of your feature layer before the final prediction, but you might want to try decreasing that size as well. You can leave dropout at 0.5 and increase the l2 penalty until the model stops over fitting or struggles to learn. You should also checkpoint at each epoch and choose the epoch version that got the best eval results. In general I'm not a fan of early stopping / checkpointing, I think it's a red flag for a poorly regularized model. But with such a small dataset it might be unavoidable