Signage recognition

A finished PyTorch experiment from 2021 — traffic sign classification with neural networks, and an early lesson in overfitting.

This project is finished. The code and models live in a shared repository at gitlab.com/alanta_alterna/various-ai — alongside other experiments, not on their own.

On the eve of the rise of AI, way back in early 2021, I took a keen interest and learnt that machine learning is something you can do at home. Using online tutorials and other sources, I experimented with neural networks in PyTorch and Python. My first model learnt to tell a dog from a cat; after that I moved on to something more varied: traffic signs.

The traffic sign classifier reached 94.17% accuracy on validation data and 99.63% on training data — a useful reminder of overfitting in practice.

Additional info

Highlights

  • Home-trained PyTorch models from 2021 — dog/cat first, then traffic signs.
  • 94.17% validation vs 99.63% training accuracy: overfitting made visible.
  • Reusable tsNet and dogCatNet weights, B&W preprocessing, matplotlib training charts, and a held-out validation split.

I started out of curiosity, but quickly hit the limits of what I was willing to invest. Learning was fine; training bigger networks meant more GPU load, electricity cost, and waiting — which I was not especially keen on. I have since reused the same ideas for small gimmick scripts when I wanted software to recognise something in an image, with varying success. Recognising LEGO brick types turned out to be especially hard: few public datasets, and many bricks look very similar.

To keep things manageable, the networks I trained convert images to black and white only. The saved model files tsNet and dogCatNet should still be usable from the repo — one for traffic signs, one for dog versus cat.

Along the way I picked up simple visualisation too, charting training progress with matplotlib. The project also holds back part of the dataset for validation, so overfitting and bias are easier to spot.

I consider this work finished and unlikely to restart. AI fascinates me and clearly has a role ahead, but there is little I can do alone with neural networks that competes with what large labs ship. It was fun and instructive — not a lane where I expect to outperform the likes of OpenAI or Google.