Inspiration
This project was inspired by how AI can help doctors make better decisions using patient data. In real hospitals, doctors have limited time, so a system that gives quick and reliable predictions can be very useful.
I wanted to build something more than a basic ML model and try to make a system that is closer to real healthcare applications.
To make the system more practical, I added a feature where users can upload medical documents, and the system automatically extracts important health information from them.
Medical Document Upload Feature
Users can upload different types of medical files:
PDF Reports Lab results, discharge summaries
CT / X-Ray Images Scan images (JPG, PNG)
ECG Reports Heart rhythm printouts
Blood Test Reports Any lab report image
The system processes these documents using AI to extract useful medical data, which can then be used for prediction.
How I Built the Project
I built a Clinical Decision Support System (CDSS) that predicts disease risk (like heart disease or diabetes) based on patient data.
The workflow is:
Input Data / Medical Documents → Data Processing → ML Model → Prediction → Explanation → Output
Models Used
- Logistic Regression
- K-Nearest Neighbors (KNN)
- Random Forest
- Gradient Boosting
Data Processing
- Handled missing values
- Scaled features
- Encoded categorical data
- Extracted structured data from uploaded medical documents
Probability and Risk Levels
Instead of just Yes/No, the system gives probability and risk levels:
- Low Risk: (0 - 0.3)
- Medium Risk: (0.3 - 0.7)
- High Risk: (0.7 - 1.0)
Explainable AI
I used SHAP to explain predictions. It shows which features (like age, BP, glucose) affected the result.
Prediction = f(features)
SHAP helps understand how each feature contributes.
Backend
I used FastAPI to create APIs:
- /predict → gives prediction
- /upload → processes medical documents
- /health → checks system status
Logging
The system stores:
- Input data
- Extracted medical data
- Prediction
- Time
This helps track and review results.
What I Learned
- How to build a complete ML pipeline
- Importance of data preprocessing
- How to extract data from medical documents using AI
- Difference between accuracy and real reliability
- Basics of explainable AI (SHAP)
- How backend APIs work
Challenges Faced
- Handling missing and messy data
- Extracting accurate data from different medical documents
- Choosing the best model
- Understanding model predictions
- Making the system more realistic instead of just a demo
Conclusion
This project helped me understand how AI can be used in healthcare. It is not just about prediction, but also about data extraction, accuracy, explanation, and trust.
Log in or sign up for Devpost to join the conversation.