Blood Donation Prediction using ML
Date
Feb 22, 2025
Category
Content

Blood Donation Prediction Using Machine Learning
Problem Statement
Blood donation is a vital aspect of public healthcare, yet identifying and engaging potential donors remains a challenge. Traditional outreach methods are often inefficient and not targeted, resulting in low donor retention and limited availability during critical periods.
To address this issue, a predictive model was needed to help blood banks and donation centers anticipate donor behavior and improve their donor engagement strategies.
Project Objective
The objective of this project was to build a machine learning model that predicts whether an individual is likely to donate blood in the near future based on their donation history. This model would support healthcare organizations in proactively reaching out to potential donors, ensuring timely blood supply and reducing the burden on manual follow-ups.
Additionally, the project included developing a web-based application using Flask, deployed on an AWS EC2 instance, to make the prediction system accessible and user-friendly.
Dataset Overview
Source: UCI Machine Learning Repository - Blood Transfusion Service Center dataset
Features:
Recency: Months since the last donation
Frequency: Total number of donations
Monetary: Total blood donated (in c.c.)
Time: Months since first donation
Target Variable: Whether the donor donated blood in the last campaign (Yes/No)
Technical Workflow
1. Data Preprocessing
Checked for missing values and cleaned the dataset
Normalized numerical features for better model performance
Split the data into training and testing sets (80/20)
2. Model Selection and Training
Tried various classification algorithms:
Logistic Regression (baseline)
Random Forest Classifier
Support Vector Machine
K-Nearest Neighbors
Used GridSearchCV to tune hyperparameters and improve model accuracy
Evaluated using metrics like:
Accuracy
Precision
Recall
F1-score
ROC-AUC Curve
3. Model Deployment
Built a lightweight Flask web application to serve the prediction model
The UI accepts user input (Recency, Frequency, Monetary, Time) and displays whether the user is likely to donate
Hosted the Flask app on an AWS EC2 instance, making it accessible over the internet
Results and Performance
Achieved an accuracy of over 90% using Random Forest and SVM
The model showed strong recall, which is crucial for not missing out on potential donors
End-users could obtain predictions instantly through a clean and intuitive web interface
Web App Features
User input form to enter donation history
Real-time prediction of donation likelihood
AWS EC2 hosting for cloud accessibility
Simple, responsive UI with clear output messaging
Key Achievements
Delivered a complete ML pipeline from data preprocessing to model deployment
Gained hands-on experience with:
Supervised classification algorithms
Flask web development
AWS EC2 deployment
Created a solution with potential real-world application in the healthcare and nonprofit sectors
Impact and Applications
Helps blood banks and donation centers forecast donation likelihood
Supports targeted donor outreach, improving campaign effectiveness
Encourages data-driven donor engagement strategies
Technologies Used
Python: Pandas, NumPy, Scikit-learn, Matplotlib
Machine Learning: Logistic Regression, Random Forest, SVM, KNN
Web Framework: Flask
Cloud: AWS EC2 for deployment
DevOps: GitHub for version control


