CBS Copenhagen Business School — Machine Learning and Deep Learning, Spring 2026
Four models of increasing complexity identify 19 Danish mushroom species from ~9,200 iNaturalist field photos. Accuracy climbs from 30.6% (logistic regression) to 92.3% (fine-tuned EfficientNet-B0), but the most accurate model is also the most confidently wrong on the species that can poison you.
How does model complexity affect the classification of mushroom species from field photographs?
- Sub-RQ1: At what level of complexity do classifiers achieve reliable species identification?
- Sub-RQ2: How do misclassification patterns differ across model types in terms of toxicity risk?
- Source: iNaturalist Denmark
- Size: ~9,200 field photographs across 19 mushroom species
- Split: Observer-aware train/val/test split (zero photographer overlap between partitions)
- Images: Hosted on GitHub Releases and downloaded automatically by the notebook
| Role | Model | Test Accuracy |
|---|---|---|
| Main Model 1 | Logistic Regression (PCA features) | 30.6% |
| Main Model 2 | Random Forest (PCA features) | 29.2% |
| Main Model 3 | Custom CNN (4 variants, trained from scratch) | 59.1% |
| Benchmark Baseline | EfficientNet-B0 (pretrained, fine-tuned) | 92.3% |
- Model complexity does not monotonically improve performance. Random Forest (582K parameters) performs worse than Logistic Regression (1.9K parameters). The critical factor is feature quality, not parameter count.
- Custom CNN and pretrained B0 have nearly identical overfitting rates (~7.5pp train-test gap), despite a 33pp accuracy difference. The gap is driven by feature quality from ImageNet pretraining, not generalisation ability.
- Regularisation is essential for from-scratch CNN training. Without BatchNorm and Dropout, the custom CNN fails to learn entirely (6.6% accuracy ≈ random chance).
- The confidence paradox: EfficientNet-B0 produces the fewest dangerous misclassifications but its dangerous errors are the most confidently wrong (80.7% mean confidence), meaning confidence thresholds alone cannot ensure safety.
mushroom-classification/
├── ML_project.ipynb # Single notebook (all code)
├── README.md
├── requirements.txt
├── data/
│ ├── splits/
│ │ ├── train.csv
│ │ ├── val.csv
│ │ └── test.csv
│ ├── metadata_enriched.csv
│ ├── species_list.csv
│ └── toxicity_table.csv
├── models/ # Saved model files (after training)
└── results/ # Output figures and prediction CSVs
- Open
ML_project.ipynbin Google Colab - Click Run All
- The notebook automatically clones the repo and downloads images
git clone https://github.com/vinb75/mushroom-classification.git
cd mushroom-classification
pip install -r requirements.txt
jupyter notebook ML_project.ipynb
# Run all cells — images download automatically on first runVincent Ballwieser, Peter Szalay, Connor Kennedy
This project is for academic purposes (CBS Spring 2026).

