Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PollenNet-France: Allergenic Pollen Classification

Introduction

This project automates the recognition of allergenic pollen grains present in France using Computer Vision. By assisting in the rapid and accurate identification of pollen taxa, this tool represents a significant step toward building real-time monitoring devices that can help people suffering from pollen allergies know when they are at risk.

The project implements the PollenNet architecture proposed by Shamrat et al. (2024), adapting it to classify 13 specific pollen types found in the French ecosystem.

Reference Paper:

Shamrat, F. M. J. M., et al. "PollenNet: A Novel Architecture for High Precision Pollen Grain Classification through Deep Learning and Explainable AI." Heliyon, vol. 10, no. 19, Oct. 2024, p. e38596. DOI: 10.1016/j.heliyon.2024.e38596

Project Overview

Scientific Poster Figure 1: Research poster summarizing the methodology and results.

Methodology

1. Dataset Construction

We constructed a unified dataset by merging and harmonizing three distinct sources to ensure diversity in image acquisition methods.

Data Availability: The datasets are not included in the repository due to size constraints. Please download them from the sources below and extract them into the data/raw/ folder:

Preprocessing & Augmentation:

  • Classes: 13 pollen types (e.g., Alder, Hazel, Grass, Mugwort, Ragweed...).
  • Imbalance: The data is highly unbalanced, ranging from ~9,410 images for Alder to ~35 for Palms and Eucalyptus.
  • Augmentation: To create a robust classifier, we used data augmentation (random 180° rotations, horizontal/vertical flips) since pollen grains lack a fixed orientation.
  • Split: 85% Training / 15% Validation.

2. Model Architecture (PollenNet)

The model is a Convolutional Neural Network (CNN) featuring:

  • Feature Extraction: 4 Convolutional layers with MaxPooling and Batch Normalization.
  • Regularization: Three Dropout layers (0.5) were used to prevent overfitting, which is critical given the class imbalance.
  • Classifier: A fully connected sequence outputting probabilities for the 13 classes.

Results

The model was trained for 12 epochs. Despite the class imbalance, the model achieved strong performance metrics.

  • Best Validation Accuracy: 85%.
  • Micro-Average AUC: 0.9938.

Performance Visualizations

Training History

Accuracy Graph

Figure 2: Training and Validation accuracy over 12 epochs. Note the oscillation in validation accuracy due to the small sample size of rare classes.

Classification Metrics

ROC Curves Confusion Matrix
ROC Curves Confusion Matrix
Figure 3: One-vs-All ROC Curves Figure 4: Confusion Matrix showing Alder/Hazel confusion

Analysis

  • Accuracy: The training accuracy increased steadily. Validation accuracy peaked at 0.85 but showed significant oscillation, likely due to the small sample size in the validation set for rare classes.
  • ROC Curves: The One-vs-All ROC curves demonstrate excellent separability. Distinct grains like Mugwort, Birch, and Nettle achieved an AUC of 1.000, meaning the model is very good at distinguishing whether a grain belongs to a specific class or not.
  • Confusion Matrix:
    • The model performs exceptionally well on visually distinct classes.
    • Confusion: There is notable confusion between Alder (Alnus) and Hazel (Corylus). This is biologically consistent as both belong to the Betulaceae family and share very similar morphologies.

Installation

git clone https://github.com/HugoDeBosschere/PollenNet-France.git
cd PollenNet-France
pip install -r requirements.txt

Dataset Generation & Training

1. Generate the Dataset

You have to store the 3 datasets you downloaded in a dataset folder under the folder names pollen20l_images, Pollen13K, Pollen23E Make sure you have a test_labels.json in a bboxes.csv file in the pollen20l_images folder so that the program can recongnize the which images are in the test dataset and which in the train dataset

python scripts/data_creation.py

Creates unified training and validation datasets in dataset/dataset_final_english/.


2. Train the Model

python -m src.pollen_net.main

If Results/pollen_net_best_model.pth exists, training resumes automatically.


3. Evaluation Without Retraining

Set in src/pollen_net/main.py:

NUM_EPOCHS = 0

Then run:

python -m src.pollen_net.main

License

For research and educational use only.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages