Neural Network Design & Hyperparameter Optimisation
Binary classification neural network designed, trained and systematically optimised using TensorFlow and Keras on the UCI Spambase dataset — 4,601 emails across 57 frequency-based features — with grid search over architecture configurations achieving 94.6% test accuracy.
The Challenge
Spam classification is a canonical problem in binary classification, but the more durable goal here was to develop genuine architectural intuition: how does layer depth, neuron count, epoch budget and batch size interact? Which choices matter most in practice, and can that be demonstrated empirically rather than asserted from reading documentation?
The UCI Spambase benchmark provides a clean, well-understood target — 4,601 emails labelled spam or legitimate, each described by 57 word-frequency and email-characteristic features — making it ideal for controlled architecture exploration where performance differences are attributable to design choices, not data quality.
Approach
Results
The baseline architecture — two hidden layers of 64 and 32 neurons with ReLU activation, Adam optimiser — achieved 94.57% test accuracy from the outset, demonstrating the architecture was well-matched to the problem. Systematic grid search confirmed this result was reproducible and not an artefact of a single lucky training run: the average best accuracy across all configurations was 94.50%, with optimal performance clustering around 14 epochs and a batch size of 17.
The grid search exercise established that epoch count and batch size both influence the accuracy-overfitting trade-off, but that the architecture's fundamental capacity was sufficient — diminishing returns set in quickly beyond the identified optimum. The validation curves for each configuration were plotted to make this sensitivity landscape visible rather than abstract.