“MALARIA CELL IMAGE CLASSIFICATION”
A MINI PROJECT REPORT
Submitted by
Chethan Kulal
NNM23MC026
Bharath Rakshan
NNM23MC019
of
MASTER OF COMPUTER APPLICATIONS
NMAM Institute of Technology, Nitte
Nitte Mahalinga Adyanthaya Memorial Institute of Technology,Nitte
Department of MCA
December 2023
NMAM Institute of Technology, Nitte-574110
Department of MCA
BONAFIDE CERTIFICATE
Certified that this project report “MALARIA CELL IMAGE CLASSIFICATION””
is the bonafide work of “Chethan Kulal (NNM23MC026) and Bharath
Rakshan(NNM22MC019)” who carried out the project work under my
supervision.
SIGNATURE (HOD) SIGNATURE
(Head of the Department) (Project Guide)
Dr. Mamatha Balipa Dr. Surendra Shetty
Professor & Head Professor
Department of MCA Department of MCA
NMAM Institute of Technology, Nitte NMAM Institute of Technology Nitte
ABSTRACT
Malaria is a serious infectious disease that poses a significant health threat in many
parts of the world, particularly in tropical and subtropical regions. Early and accurate
diagnosis is essential for effective treatment and to prevent severe complications.
Manual examination of blood smear samples, the traditional method for diagnosing
malaria, is time-consuming, labor-intensive, and prone to human error, especially in
resource-limited settings. This project aims to develop an automated malaria detection
system using deep learning techniques. By employing a Convolutional Neural
Network (CNN), the system analyzes microscopic images of blood smears to
distinguish between malaria-infected and healthy cells. The proposed solution offers a
fast, reliable, and scalable approach to assist healthcare professionals in diagnosing
malaria, reducing the diagnostic burden, and improving patient outcomes in both urban
and remote healthcare facilities.
TABLE OF CONTENTS
CHAPTER NO. TITLE PAGE NO.
1. INTRODUCTION 1
1.1 Problem Definition 1
1.2 Objectives 2
1.3 Challenges 2
1.4 Literature Survey 3
2. Software Requirement Specification 5
2.1 Functional Requirements 5
2.2 Non-functional Requirements 5
2.3 Hardware and Software Requirements 6
3. System Design 7
3.1 High Level Design 7
3.2 Detailed Design 9
4. System Implementation 12
4.1 Module Description 12
4.2 Tools, Language used 14
4.3 Screen Shots 15
5. Testing 19
6. Conclusion and Future enhancements 20
References 21
CHAPTER 1
INTRODUCTION
Malaria is a severe and potentially fatal disease caused by Plasmodium parasites,
which are transmitted to humans through the bites of infected Anopheles mosquitoes.
Early detection is critical to prevent complications and ensure timely treatment.
However, conventional diagnostic methods, such as manual microscopy, are time-
intensive and require skilled personnel, making them less effective in resource-
constrained settings.
This project aims to leverage the power of deep learning to automate malaria diagnosis
using blood smear images. By employing convolutional neural networks (CNNs), the
system identifies infected and uninfected cells with high precision. The proposed
solution not only accelerates the diagnostic process but also reduces human error,
providing a scalable and reliable tool for malaria detection in diverse healthcare
environments.
1.1 Problem definition:
The manual detection of malaria through blood smear microscopy is a time-
consuming and labor-intensive process that requires skilled professionals to identify
infected cells accurately. This traditional method is not only slow but also prone to
human error, leading to potential misdiagnosis or delayed treatment, which can be
life-threatening in critical cases. The process becomes even more challenging in
resource-limited settings where trained personnel and equipment are scarce.
1
1.2 Objectives:
The primary goal of this project is to develop a robust, efficient, and user-friendly
malaria detection system using deep learning techniques.
• Develop a Deep Learning-Based Classification Model: Build a convolutional
neural network (CNN) capable of analyzing blood smear images and classifying
them as "Infected" or "Uninfected."
• Design an Intuitive User Interface: Create a simple and accessible platform
(e.g., using Streamlit) where healthcare professionals can upload blood smear
images and receive instant diagnostic results.
• Ensure High Diagnostic Accuracy: Aim for a high level of precision and
sensitivity in the model to reduce false negatives, which are critical in malaria
diagnosis.
• Enhance Accessibility for Resource-Limited Areas: Provide a cost-effective,
automated diagnostic tool that can be deployed in areas with limited access to
medical expertise and infrastructure, thereby improving healthcare delivery in
underserved regions.
1.3 Challenges:
• Dataset Quality: Ensuring the dataset has sufficient variation in lighting, staining,
and cell morphology to train a robust model.
• Model Overfitting: Preventing the model from memorizing training data instead
of generalizing to new images. Techniques like data augmentation, dropout, and
regularization are essential to improve model robustness.
• Resource Constraints: Training deep learning models requires significant
computational resources. Leveraging cloud-based GPU or TPU platforms can help
overcome hardware limitations and speed up model training.
2
• Deployment: Adapting the model for real-time predictions while ensuring
scalability and performance. The deployment process should involve optimizing
the model size and inference speed for practical use in real-world scenarios.
1.4 Literature survey:
[1] Malaria remains a critical global health concern, especially in regions with limited
medical resources. Accurate detection of malaria-infected cells from blood smears is
essential to reduce morbidity and mortality rates. Traditionally, this process has relied
on manual microscopy, which is labor-intensive, time-consuming, and highly dependent
on the skill of the microscopist, leading to potential errors in diagnosis (Ghosh et al.,
2019). In recent years, deep learning-based approaches have emerged as a promising
alternative, providing automated and accurate diagnostic solutions, particularly in
resource-constrained environments (Adewumi et al., 2020).
[2] Several studies have demonstrated the effectiveness of deep learning models for
malaria cell classification. Rajaraman et al. (2018) emphasized the potential of
convolutional neural networks (CNNs) to achieve high accuracy in detecting malaria-
infected cells from blood smear images. Similarly, Liang et al. (2020) highlighted the
capability of CNNs to extract hierarchical features from medical images, making them
well-suited for tasks like malaria detection.
[3] In this project, a custom Convolutional Neural Network (CNN) is utilized to classify
blood smear images into "Infected" and "Uninfected" categories. Unlike pre-trained
models, this custom CNN is built from scratch using the Sequential API in Keras,
offering flexibility in design and optimization specific to the malaria detection task
(Kumar & Patel, 2022). The architecture comprises multiple convolutional, pooling, and
3
dropout layers, which enhance feature extraction while minimizing overfitting through
regularization techniques (Singh et al., 2021).
[4] The dataset used in this project consists of thousands of labeled images of infected
and uninfected cells, similar to datasets used by Dong et al. (2019) and Nguyen et al.
(2020), emphasizing the importance of diverse and well-annotated data for training
robust models. The images are preprocessed by resizing them to 50x50 pixels and
normalizing pixel values to ensure consistency and improve the model's learning
capability. The custom CNN is trained using the Adam optimizer and categorical cross-
entropy loss, achieving high accuracy in binary classification (Tan et al., 2021).
[5] This approach highlights the potential of custom CNN architectures to provide
accurate, scalable, and cost-effective solutions for malaria detection. By reducing
dependency on manual diagnosis and facilitating early intervention, this system aims to
improve healthcare outcomes in regions most affected by the disease (Mehta & Verma,
2022).
4
CHAPTER 2
SOFTWARE REQUIREMENT SPECIFICATION
2.1 Functional Requirements:
• Image Upload: Users should be able to upload blood smear images from their
device's storage for classification. This feature ensures flexibility for users to
analyze pre-captured images.
• Preprocessing: The system should preprocess the uploaded images, including
resizing to the required dimensions, normalizing pixel values, and enhancing
quality to ensure they are ready for accurate classification.
• Image Classification: The system must classify uploaded blood smear images
into "Infected" or "Uninfected" categories using the trained deep learning model.
The results should be reliable and accurate.
• Result Display: The application should display classification results clearly,
including the category ("Infected" or "Uninfected") and associated confidence
scores, for better understanding by the user.
2.1 Non-functional requirements:
• Performance: The system should process uploaded images quickly, delivering
results in real-time or within a few seconds to improve user experience.
• Data Privacy: Uploaded images must be handled with strict privacy measures to
protect user data and ensure compliance with medical data regulations.
• Scalability: The application should handle multiple image uploads and
classifications simultaneously without performance degradation.
• Compatibility: The application should support cross-platform functionality,
accessible via browsers or as a standalone application on various operating
systems.
5
2.1 Hardware and Software Requirements:
• Hardware Requirements:
1. Computer/Laptop:
• A system with a minimum of 8 GB RAM and a multi-core
processor for efficient model training and inference.
• Sufficient storage space to accommodate the dataset, trained
model files, and application dependencies.
• Software Requirements:
1. Operating System:
▪ Compatible with Windows 10 or later, Linux (Ubuntu 18.04
or later) for development and deployment.
2. Development Environment:
▪ Python 3.8 or later: Primary programming language for model
development, preprocessing, and interface creation..
▪ Java programming language.
3. Libraries and Frameworks:
▪ TensorFlow/Keras: Builds, trains, and saves the deep learning
model for malaria cell classification.
▪ Streamlit: Creates an interactive web interface for uploading
images and displaying classification results in real-time.
▪ NumPy: Performs numerical operations and manages image
data arrays efficiently.
6
CHAPTER 3
SYSTEM DESIGN
3.1 High level design:
• Data Flow diagram: A data flow Diagram is a graphical representation of the
“flow” of data through an information system, modelling its process aspects. A
DFD is often used as a preliminary step to create an overview of the system
without going into great detail, which can later be elaborated.
selects an image
Image undergoes preprocessing
Preprocessed image is sent to the
classification component
Classification results are returned to the
user interface for display
7
• Usecase diagram
8
3.2 DETAILED DESIGN
1. User Interface (UI):
Main Interface:
• The main page where users interact with the application.
• Users can upload blood smear images directly from their local storage.
• Contains buttons for uploading images, initiating predictions, and viewing results.
• Displays the classification result ("Infected" or "Uninfected") along with the
prediction confidence.
Result Display Section:
• A dedicated area on the interface that shows the uploaded image and the
corresponding classification result.
• Provides additional details such as confidence percentage and time taken for
prediction.
Developer Section:
• An optional section where users can view details about the developers of the
application.
• Includes names, roles, and contributions to the project.
2. Backend (python):
Prediction Script (app.py):
● Handles the core functionalities of loading the pre-trained model
and performing inference on the uploaded images.
● Preprocesses the image by resizing it to 50x50 pixels and
normalizing pixel values.
● Loads the model in .h5 format for inference and ensures
compatibility with Streamlit’s interface.
● Returns classification results ("Infected" or "Uninfected") with the
9
associated confidence scores.
Image Preprocessing Module:
● Utilizes libraries such as OpenCV and PIL to handle image resizing,
normalization, and format conversion.
● Ensures that uploaded images are prepared correctly for model
prediction.
Developer Info Module:
● Displays developer details through a separate section of the
application.
3. Front-End (Streamlit):
Streamlit Interface:
● A responsive web-based interface designed for easy navigation and
interaction.
● Users can upload images through a file upload widget and receive
predictions in real-time.
Dynamic Result Visualization:
● Incorporates Streamlit’s charting and display capabilities for
showing prediction statistics if needed.
● Results are updated instantly upon user interaction.
Customization:
● Includes options to add themes, adjust colors, and enhance user
experience with Streamlit’s built-in layout tools.
Directory Structure:
● Static Files: Contains folders for storing temporary files like
uploaded images and additional assets (e.g., logos or developer
images).
● Model Folder: Stores the trained .h5 deep learning model used for
inference.
10
CHAPTER 4
SYSTEM IMPLEMENTATION
4.1 MODULE DESCRIPTION
1. Development Environment Setup:
The project was developed using Python as the primary programming language, with
libraries such as TensorFlow, Keras, NumPy, and OpenCV facilitating machine
learning and image processing. The user interface was created using Streamlit, offering
an interactive and user-friendly experience. The environment setup included installing
necessary Python libraries, preparing the dataset, and configuring the model for
training and inference.
2. Backend Implementation (Python):
Preprocessing Module:
● Resizing Images: The uploaded blood smear images are resized to
50x50 pixels to ensure compatibility with the deep learning model.
● Normalization: Pixel values are scaled between 0 and 1 by dividing
by 255 for better convergence during training and inference.
● Dataset Splitting: The dataset is split into training and testing sets
with a ratio of 80:20 to evaluate model performance.
Model Development:
● Architecture: A custom Convolutional Neural Network (CNN) with
multiple convolutional, pooling, and dropout layers was
implemented. The final dense layer uses the softmax activation
function for binary classification ("Infected" or "Uninfected").
● Training: The model was trained using the Adam optimizer with a
categorical cross-entropy loss function. Early stopping was used to
prevent overfitting.
● Performance Evaluation: Accuracy and loss metrics were used to
11
monitor training, while the model was validated on unseen data to
ensure generalization.
● Model Storage: The trained model was saved in .h5 format for easy
deployment
Inference Module:
● Loading the Model: The saved .h5 model is loaded during runtime
for prediction.
● Prediction: Uploaded images are passed through the model, and the
classification result ("Infected" or "Uninfected") is returned along
with the confidence score.
3. Frontend Development (Streamlit):
Main Interface:
● Users can upload blood smear images through a file upload widget.
● The application processes the image and displays the classification
result ("Infected" or "Uninfected") in real-time.
● Confidence scores are presented to ensure transparency in
predictions.
Result Visualization:
● The uploaded image is displayed alongside the classification result.
● Additional details, such as the confidence score and processing time,
are shown.
4. Security Measures:
● The malaria cell image classification system implements strict input
validation to ensure uploaded images meet format and size
requirements, preventing malicious uploads.
● All data transmission is encrypted over HTTPS to safeguard user
information. Uploaded images are securely stored with restricted
12
access, and the trained model is protected from unauthorized
tampering.
● Additionally, robust error handling and secure session management
ensure the application operates securely and prevents data leakage.
4.2 TOOLS, LANGUAGE USED
● TensorFlow/Keras: For building and training the deep learning
model.
● Streamlit : For creating the user-friendly web interface.
● OpenCV and PIL: For image preprocessing.
● NumPy: For numerical operations.
● Matplotlib: For visualizing data and results.
● Language: Python
13
4.3 SCREEN SHOTS
14
15
16
CHAPTER 5
TESTING
Functional Testing:
Unit Testing:
Results: Each module passed unit tests without significant issues.
Actions Taken: Optimized CNN layer configurations and streamlined Streamlit
interactivity to improve performance.
Integration Testing:
Results: The CNN model integration with the Streamlit frontend worked well, with
minor image upload and display issues.
Actions Taken: Fixed bugs related to file handling and ensured seamless integration
between backend and frontend.
System Testing:
Results: The entire system operated as intended with minor bugs related to system
interactions resolved.
Actions Taken: Addressed identified minor bugs to ensure smoother system
performance.
Usability Testing:
Results: The system worked well on all devices, with minor image display issues on
smaller screens.
Actions Taken: Adjusted Streamlit layout configurations for responsive design.
Compatibility Testing:
Results: The system worked well on desktop, with minor layout issues on smaller
screens.
Action Taken: Used responsive design for better layout alignment across screen sizes.
17
Performance Testing:
Load Testing:
Results: The system handled multiple simultaneous uploads and classification requests
smoothly.
Actions Taken: Optimized image preprocessing and model loading for better
performance under heavy load.
Stress Testing:
Results: The system remained stable under high-frequency uploads and continuous
requests.
Actions Taken: Increased server timeout and optimized memory to prevent crashes
during peak usage.
Security Testing:
Results: Minor file upload validation vulnerabilities were fixed, and security was
enhanced to protect user data.
Regression Testing:
Results: New code changes did not impact existing functionalities.
User Acceptance Testing (UAT):
Results: Positive feedback confirmed the system met expectations for accuracy,
usability, and response time.
Actions Taken: Enhanced UI responsiveness and added informative result displays.
Accessibility Testing:
Results: The system met accessibility standards with improved screen reader and
keyboard navigation.
Actions Taken: Enhanced color contrast, added alt text, and ensured assistive technology
compatibility.
18
CHAPTER 6
CONCLUSION AND FUTURE ENHANCEMENTS
❖ Future Enhancements:
• Larger Dataset and Improved Accuracy:
▪ Expand the dataset with more diverse malaria-infected cell images
to improve model generalization.
▪ Retrain the model with the extended dataset to enhance accuracy
and reduce false positives/negatives.
● Real-Time Microscopy Integration:
▪ Enable real-time cell image analysis through direct integration with
digital microscopes, providing instant malaria detection during
patient examination.
• Multi-Platform Support:
▪ : Developing both web and mobile versions will allow healthcare
workers in remote and underserved areas to access the malaria
detection tool on their preferred devices, enhancing accessibility.
• Multi-Language Support:
▪ Expand language options to cater to diverse regions, making the
malaria detection tool accessible to healthcare workers in non-
English speaking areas.
20
REFERENCES
[1] Liang Z, Powell A, Ersoy I, et al. CNN based analysis for malaria diagnosis.
In: International conference on bioinformatics and biomedicine(BIBM).
IEEE;2016:493-6.
[2] Rajaraman S, Antani SK, Poostchi M, et al. Pre-trained Convolutional neural
networks as feature extractors toward improved malaria parasite detection in
thin blood smear images. IEEE Trans Med Imaging. 2018;37(6):1391-1402.
[3] Ersoy I, Bunyak F, Higgins J, Palaniappan K. Coupled edge profile geodesic
active contours for red blood cell flow analysis. In: Proceedings of the 9th
IEEE international symposium biomedical imaging. 2012; 748-751.
[4] Chouhan M, Tiwari A, Chaurasia A, et al. Malaria parasite detection using
convolutional neural networks. In: 2017 International Conference on
Intelligent Computing and Control Systems (ICICCS). IEEE; 2017: 694-
699.
[5] Hussain M, Anwar SM, Majid M, et al. Malaria detection using transfer
learning-based CNNs. In: 2019 6th International Conference on Control,
Decision and Information Technologies (CoDIT). IEEE; 2019: 150-154.
21