Skip to content

Leaffliction

Classifies apple and grape leaf photos into 8 classes (6 diseases, 2 healthy) with a PyTorch CNN; augmentation balances the classes before training.

TL;DR
  • 94.1 % held-out accuracy
  • 8 classes

My partAbout 80 % of the code by git blame.

ROLE
Team of 2
CONTEXT
École 42 · AI projects
STATUS
Done
RESULT
94.1 % accuracy on 152 held-out test images.
LAST UPDATED
26 Sep 2026
1

Data

Leaf images from the École 42 subject: 8 classes, 6 apple and grape diseases and 2 healthy.

2

What I built

Team of 2

  1. About 80 % of the code by git blame.
  2. The image transformations module.
  3. The CNN, prediction, the command-line tool and plotting.
  4. Most of the training pipeline.
3

Key choices

Augment only after the split
The split happens on the original leaves; augmentation runs on the train side only, so no leaf's augmented copies cross the split.
Balanced classes
Augmentation evens out the class counts before training.
A compact CNN
422,632 parameters.
4

Results

90 %100 %Validation (model selection)98.1 %Held-out test, 152 images94.1 %
Best checkpoint selected on a stratified 20 % validation split grouped by source image; tested on 152 images kept apart from training (test_images/100). Evaluation log not committed; figures from the README.

94.1 % accuracy on 152 held-out test images.

5

Limits

  • Trained on half of the training data.
  • The validation score also selected the checkpoint; the 152-image test set is the only independent number.
  • The evaluation log is not committed.
  • The Hugging Face demo sleeps when idle and takes a moment to wake up.

Questions about this project? → Email me