Inspiration
In life-threatening situations like trauma care or blood disorders such as Thalassemia, the delay in locating compatible blood donors can have devastating consequences. We noticed a major gap in the speed and intelligence of current donor-matching systems. This inspired us to explore how artificial intelligence could enhance the donor identification process — not just through fixed rules, but also predictive modeling.
That motivation led to the creation of HemoTrack AI, a system designed to intelligently recommend eligible blood donors in real-time.
What it does
HemoTrack AI is a Streamlit-powered application that performs two types of donor matching:
Rule-Based Matching: Based on predefined eligibility like blood group compatibility, recent donation history (must be >90 days), availability, and successful disease screening.
AI-Based Prediction: A trained Random Forest Classifier predicts the likelihood of a donor being eligible, even if they’re not perfectly aligned with all rules.
It outputs eligible donors in a clean dashboard and lets users download a filtered CSV list of matching candidates.
How we built it
We used the following technologies and approaches:
Generated a synthetic donor dataset using the Faker library to simulate realistic donor profiles.
Preprocessed features like Blood_Group, Availability, and Screened using Label Encoding.
Handled data imbalance (only 52 out of 1000+ donors were eligible) using SMOTE, a synthetic oversampling technique.
Trained a Random Forest Classifier using scikit-learn on balanced data.
Deployed the final ML model using joblib and integrated it into a Streamlit frontend.
Connected both matching strategies (rule-based and AI-based) within a unified UI.
Challenges we ran into
We faced several major challenges:
Lack of real-world data: We resolved this by simulating realistic donors using Python's Faker library.
Severely imbalanced dataset: Initially, only a small fraction of donors were eligible. This led to overfitting until we applied SMOTE.
Streamlit deployment errors: Deployment failed due to missing dependencies like joblib and filename formatting issues. We fixed this by updating requirements.txt and renaming the app file.
LabelEncoder inconsistency: When reloading models, predictions were mismatched due to different encoder states. We modularized and serialized encoders to solve this.
Accomplishments that we're proud of
Built a hybrid AI system that effectively combines medical rules with machine learning predictions.
Achieved 98%+ model accuracy after balancing and tuning.
Successfully deployed the app using Streamlit Cloud, making it usable and publicly accessible.
Implemented a clean UI that supports CSV export, model selection, and compatibility filters
What we learned
he importance of balanced training data for high-performing classifiers.
How to simulate datasets realistically when real data is unavailable.
How to deploy a fully functional ML pipeline inside a web app using Streamlit.
Handling deployment errors, dependency mismatches, and file encoding issues in a real-world setting.
What's next for HemoTrack AI – Donor Match Prediction System
Integrating geolocation-based filtering so donors can be selected based on proximity.
Expanding support for disease-specific donor eligibility (e.g., for rare blood conditions).
Adding donor notification systems or SMS/email alerts.
Building a mobile version with location permissions and real-time communication.
Syncing with hospital and blood bank APIs for live donor availability.
Built With
- faker
- machine-learning
- numpy
- nyrok
- pandas
- python
- scikit-learn
- smote
- streamlit