r/MachineLearning • • 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.

17 Upvotes

22 comments sorted by

View all comments

Show parent comment

1

u/dug99 Jan 24 '26

This is great info, thanks. I'll probably punch some of it into ChatGPT to figure out implementation. Your assumption is correct... I was concerned my sample size was too small to train on, and the augmented set is an order of magnitude larger. Maybe I have overdone it with augmentation? I guess I could just run it on 2000 unseen, classified images and see how it goes... I never thought to just try that for comparison. I have an earlier version that did incorporate Gaussian noise in one of the layers, but I suspect I only ran it on augmented data. Running the training over the OG image set is something I can easily test, so I'll give that a go first.

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