A CNN-based malaria parasite classification system integrated with a conventional microscope and real-time Python GUI. Features Canny edge enhancement, 99% classification accuracy, and an intuitive interface for automated malaria diagnosis in low-resource settings.
# MalariaNet
Overview
This repository presents the implementation of a Convolutional Neural Network (CNN)–based system for Plasmodium species classification using microscopic blood smear images. The project integrates a digital microscope interface, preprocessing pipeline, model training, validation, and a graphical user interface (GUI) to support semi-automated malaria diagnosis in laboratory and field settings.
The system classifies microscopic images into three categories:
-Plasmodium falciparum
-Plasmodium vivax
-Uninfected red blood cells
By combining image enhancement, deep learning, and a Python-based GUI, this system enables real-time classification directly from microscope image feeds.
System Architecture
1. Image Preprocessing
Implemented in detection_program_v2.py, the preprocessing module transforms RGB microscope images into seven-channel enhanced representations, consisting of:
-Original RGB channels
-Contrast, saturation, and sharpness enhancement
-Canny Edge Detection channel for morphological contour highlighting
These enhanced features significantly improve the CNN’s ability to distinguish between visually similar parasite species.
2. CNN Model (MalariaNet)
The CNN model architecture (MalariaNet) consists of:
-4 convolutional blocks: Conv–BatchNorm–LeakyReLU–MaxPool
-Fully connected layers with dropout (0.5)
-Softmax classifier for 3 output classes
Model training was performed using 5-fold cross-validation, achieving an average accuracy of ~99% with precision, recall, and F1-score above 0.98.
Each fold’s trained model is stored as a .pth file within the Model folder. Among these, Fold 4 demonstrated the best performance balance (accuracy = 99.17%, AUC = 1.00, stable training/validation loss convergence). Therefore, Fold 4 serves as the default model for inference and GUI-based real-time classification.
3. Graphical User Interface (GUI)
The GUI, developed in Python Tkinter and implemented within detection_program_v2.py, provides …