A fully implemented Convolutional Neural Network (CNN) for CIFAR‑10 image classification, written in TensorFlow 2 / Keras.
This project demonstrates:
- Modern CNN architecture design (Conv‑BN‑Pool‑Dropout)
- Data augmentation integrated directly into the model
- He initialization, L2 regularization, and Batch Normalization
- Adam optimizer with exponential‑decay learning rate schedule
- Real‑time training visualization and evaluation via confusion matrix + classification report
CIFAR‑10 contains 60 000 color images (32 × 32 × 3) in 10 classes:
✈️ airplane • 🚗 automobile • 🐸 frog • 🐱 cat • 🐶 dog • 🐴 horse • 🐦 bird • 🚢 ship • 🦌 deer • 🚚 truck
- Images normalized to [0 – 1]
- Labels converted to one‑hot vectors using
to_categorical() - Usually split: 80 % train / 20 % validation + separate test set
Figure 1. CIFAR‑10 CNN architecture (Graphviz horizontal view).
Conv blocks use HeUniform initialization + L2 regularization (1e‑5 dense) and progressive dropout (0.25).
Final classifier is Dense(10) activated by softmax and initialized with GlorotUniform.
Optimizer = Adam+ExponentialDecay (LR = 1e‑3, decay rate = 0.9, every 10 000 steps).
✅ Total Params: 2.23 M (8.52 MB)
✅ Trainable Params: 2.23 M
✅ Regularization: L2 → Dense (1e‑5)
| Metric | Value |
|---|---|
| Best Validation Accuracy | ≈ 89.7 % |
| Test Accuracy | ≈ 88.8 % |
| Test Loss | ~ 0.43 |
| Total Parameters | 2,233,546 |
| Loss Function | categorical_crossentropy |
| Optimizer | Adam + ExponentialDecay (LR: 1e‑3 → decay 0.9 / 10 000 steps) |
| Regularization | L2 Dense = 1e‑5; Dropout = 0.25 |
| Augmentation | Flip · Rotation · Zoom · Translation |
| Framework | TensorFlow 2.16 / Keras |
| Python Version | 3.10 |
Figure 2. Loss and accuracy progress over 150 epochs (batch size 128).
The smooth convergence and small gap indicate well‑balanced regularization.
Best validation accuracy: ≈ 89.7 % on held‑out set.
Figure 3. CIFAR‑10 test set confusion matrix with per‑class performance.
Diagonal dominance shows robust feature discrimination.
Remaining misclassifications occur mostly between visually similar classes
(cat ↔ dog, automobile ↔ truck), highlighting realistic domain overlap.


