A small dataset invites overfitting.
Binary posture classification sounds trivial until you count the images. A modest labelled set of sitting and standing photos gives a CNN more than enough room to memorise the training examples — nailing them while learning nothing that transfers to a new photo.
So the real task wasn't "build a CNN"; it was "build a CNN that generalises from limited data," which turns the project into a study of regularisation and augmentation rather than architecture.
A model that aces training and flunks test hasn't learned — it's memorised.
Guardrails against memorising.
Augment aggressively.
Rotation, width/height shifts, and horizontal flips synthesise variety the small dataset lacks, so the model sees a new-ish image every epoch.
Regularise the classifier head.
Dropout between dense layers keeps the network from leaning on any single feature to fit the training set.
Evaluate honestly.
A held-out test split plus training/validation accuracy and loss curves, so overfitting shows up as a diverging gap rather than hiding.
Load, augment, learn, judge.
Images and CSV labels are loaded and resized to 224×224, encoded to categorical, split train/test, then fed through three conv blocks into a dense classifier — trained on an augmenting data generator.
The predict_image helper closes the loop — load a new photo,
normalise it the same way, and print the predicted class with a confidence
score, so the trained model is usable, not just measurable.
Augmentation bought the generalisation.
The training and validation curves are the whole story. Without augmentation the two lines split early — training accuracy climbing while validation stalls, the textbook shape of a network memorising its inputs. With augmentation the gap narrows, and the test accuracy becomes a number you can actually believe.
Plotting accuracy and loss side by side made that trade-off visible rather than assumed — which is exactly why the evaluation plots are part of the deliverable, not an afterthought.
The plots are the point.
It would have been easy to report a single test-accuracy figure and stop. Shipping the accuracy and loss curves instead admits where the model is weak and shows the augmentation earning its place — the difference between a result you can defend and a number you're hoping nobody probes.
Three things, next time.
Start from a pretrained backbone.
Transfer learning from a network like MobileNet would beat a from-scratch CNN on a dataset this small, with far less overfitting risk.
Report a confusion matrix.
Knowing whether errors skew toward false-sitting or false-standing tells you more than a single accuracy figure.
Use a proper validation split.
Validating on the test set inflates confidence; a distinct validation set would make early-stopping and tuning honest.