Unit 1 Project — Train a Deep Model
Run after: Sessions 1–4 · Format: independent project
Your goal: build, train and evaluate a real neural network — ideally a CNN on images — on a dataset you choose, then report your accuracy honestly and explain what your model actually learned.
What to build
A self-contained Google Colab notebook that loads a dataset, builds a neural network with Keras, trains it, and then tests it on data it has never seen. Your notebook finishes with a short write-up: what you built, how well it did, and where it still gets things wrong.
This is not a contest for the highest number. The point is to run the full training loop correctly, look honestly at the results, and show that you understand why your model behaves the way it does. A model at 82% that you truly understand is worth far more than a copied 98% you can't explain.
Example ideas (pick one, or bring your own):
- Image classifier (CNN) — train a convolutional network on Fashion-MNIST, CIFAR-10, or a small set of your own photos (e.g. your pets vs. not-your-pets).
- Handwriting reader — classify handwritten digits from MNIST and test it on a digit you draw and photograph yourself.
- Sound or signal classifier — turn short audio clips into spectrogram images and classify them (e.g. clap vs. whistle).
- Tabular deep net — build a dense network to predict an outcome from a structured dataset (housing prices, wine quality), and compare it to a simple baseline.
Steps
- Choose a dataset and a clear task. State in one sentence what goes in and what your model predicts.
- Load and look at the data. Show a few examples and the class balance so you know what you're working with.
- Split properly into training, validation, and a held-back test set — the test set is touched only once, at the end.
- Build the network in Keras (layers, activations, output). For images, use a CNN.
- Train it, watching the training and validation curves. Note if it starts to overfit.
- Evaluate on the test set — report accuracy plus a confusion matrix, and look at a few wrong predictions.
- Write it up — what you built, your honest score, and one thing you'd try next.
A minimal Keras skeleton you can adapt:
from tensorflow import keras
from tensorflow.keras import layers
model = keras.Sequential([
layers.Conv2D(32, 3, activation="relu", input_shape=(28, 28, 1)),
layers.MaxPooling2D(),
layers.Flatten(),
layers.Dense(64, activation="relu"),
layers.Dense(10, activation="softmax"),
])
model.compile(optimizer="adam",
loss="sparse_categorical_crossentropy",
metrics=["accuracy"])
history = model.fit(X_train, y_train, epochs=10, validation_split=0.2)
print("Test accuracy:", model.evaluate(X_test, y_test)[1])
Deliverables
One Colab notebook (shared with view access, or exported as .ipynb / PDF) that contains, in order:
- the task in one sentence, and a look at the data,
- a clean train / validation / test split,
- a network you built and trained, with the training curves shown,
- a test-set accuracy score and a confusion matrix,
- a short write-up (a paragraph or two): what it learned, where it fails, and one next step.
Here is how your work is assessed — four rising levels:
How your work is assessed
| Criterion | Emerging | Developing | Proficient | Exemplary |
|---|---|---|---|---|
| Model built & trained | Model doesn't run | Runs but wrong shape/output | A correct network (CNN for images) trains cleanly | Thoughtful architecture; tuned and justified choices |
| Evaluation done right | Tested on training data | Score shown, no test split | Reported on a held-back test set with a confusion matrix | Analyses errors and where the model is unreliable |
| Understanding shown | Can't explain the model | Explains parts vaguely | Explains layers, training, and the score in plain words | Explains overfitting, trade-offs, and why it fails as it does |
| Code quality | Disorganised, doesn't reproduce | Runs but messy | Clean, commented, runs top to bottom | Reproducible, well-structured, easy to follow |
| Write-up | Missing or trivial | States the score only | Honest write-up with a clear next step | Insightful reflection linking results to what it learned |
What's next
Take your honest results into Unit 2 — where you'll stop building models from scratch and start standing on the shoulders of giant pre-trained ones.