MissDiagnosis is an AI-integrated Electronic Medical Record (EMR) system designed to help doctors avoid potential misdiagnoses by analyzing inputs against recent global health outbreaks and patient history. This project was developed during the 6-hour Notion Hackathon at Grambling State University, combining the power of AI and Notion integration to build an impactful healthcare solution.
MissDiagnosis leverages:
- OpenAI GPT-4 for analyzing diagnoses against current health outbreak trends.
- Custom CNN model for malaria detection using blood sample data.
- Global health outbreak tracking integrated from WHO Disease Outbreak News.
-
Diagnosis Analysis
- Doctors input symptoms, medical history, and diagnoses into the EMR.
- GPT-4o validates the input against recent outbreaks and epidemiology data.
- It provides tailored feedback and suggests possible tests to refine the diagnosis.
-
Malaria Prediction
- Uses a custom Convolutional Neural Network (CNN) to analyze blood sample data.
- Predicts whether a patient has malaria based on the input image.
-
Outbreak Monitoring
- Scrapes WHO's Disease Outbreak News for the latest updates.
- Recent outbreaks are cross-validated to improve diagnosis accuracy.
-
Notion Integration
- Outbreak data is dynamically stored in Notion for record-keeping and easy updates.
Component | Technology Used |
---|---|
Frontend | HTML, TailwindCSS |
Backend | Flask, Python |
AI Model | OpenAI GPT-4o, Custom CNN |
Data Scraping | Selenium, BeautifulSoup |
Outbreak Data | WHO Outbreak News |
Notion Integration | Notion API |
Malaria Detection Model | TensorFlow, Pillow, NumPy |
Follow these steps to set up the project on your local machine:
- Python 3.8+
- OpenAI API Key
- Notion Integration Token
- TensorFlow
- Flask
- Selenium (automatically installs ChromeDriver)
- BeautifulSoup4
-
Clone the Repository
git clone https://github.com/yourusername/MissDiagnosis.git cd MissDiagnosis
-
Install Dependencies
pip install -r requirements.txt
-
Set Up Environment Variables Create a
.env
file in the project root and add your API keys:OPENAI_KEY=your_openai_api_key NOTION_KEY=your_notion_integration_token
-
Run the Backend Server
python app.py
The Flask server will run on
http://localhost:1000
. -
Access the Frontend
- Navigate to
http://localhost:1000
to access the home page. - Use
/dashboard
for the main EMR input interface.
- Navigate to
Here are key functions from the core Python scripts:
- Purpose: Analyzes patient symptoms, medical history, and diagnosis against recent disease outbreaks.
- Inputs:
symptoms
: Symptoms reported by the patient.patient_history
: Past medical history.malaria_status
: Status of malaria prediction ("infected" or "uninfected").diagnosis
: The doctor's diagnosis input.medicine
: Prescribed medicines.tests
: Suggested lab tests.
- Outputs: Returns a 5-line analysis focusing on epidemiology and cross-validates with recent outbreaks.
- Purpose: Main workflow to coordinate outbreak scraping, parsing, and analysis.
- Inputs:
patient_symptoms
: Symptoms input by the user.patient_history
: Medical history of the patient.malaria_status
: Output from malaria prediction.my_diagnosis
: Doctor's diagnosis.medicine
: Suggested medicines.tests
: Further tests required.
- Workflow:
- Scrapes WHO Outbreak News using
scrape.py
. - Parses the data into a structured format with
scrape2.py
. - Calls
analyze_with_outbreaks()
fromhug.py
for diagnosis analysis.
- Scrapes WHO Outbreak News using
- Outputs: Returns the AI-powered analysis.
- Purpose: Uses a custom CNN model to predict malaria infection status from a blood sample image.
- Inputs:
img
: Preprocessed image array.
- Outputs:
- Returns "infected" or "uninfected" based on the model's prediction.
- Purpose: Scrapes the WHO Disease Outbreak News page and saves the HTML content.
- Outputs:
- Saves the outbreak data HTML to
res.html
.
- Saves the outbreak data HTML to
- Purpose: Parses the saved HTML file (
res.html
) and extracts outbreak data into a structured dictionary. - Outputs:
- Returns a dictionary where each outbreak has a date and title.
MissDiagnosis/
|
|-- templates/
| |-- index.html # Home Page
| |-- dashboard.html # Dashboard Page (EMR)
|
|-- static/ # Frontend static assets
|
|-- model.py # Malaria prediction model (CNN)
|-- app.py # Flask application (Backend)
|-- main.py # Main workflow logic
|-- scrape.py # Web scraping WHO data
|-- scrape2.py # HTML parsing and structuring outbreak data
|-- hug.py # GPT-4o Integration and outbreak analysis
|-- n.py # Notion API integration
|-- res.html # WHO data saved as HTML
|-- train.ipynb # Model training notebook
|-- requirements.txt # Python dependencies
|
`-- README.md # Project documentation
-
Input Data:
- The doctor inputs patient symptoms, medical history, diagnosis, and prescriptions into the dashboard.
-
Malaria Detection:
- The custom CNN model predicts malaria infection status using blood image data.
-
Outbreak Validation:
- The backend scrapes WHO Outbreak News for recent epidemic updates.
- Notion API stores the data in a dedicated database.
-
GPT-4o Analysis:
- GPT-4o analyzes the diagnosis against the outbreak data, symptoms, and malaria prediction.
- Returns feedback and further test suggestions.
-
Output:
- Real-time analysis is displayed on the dashboard for quick decision-making.
- Iminabo Roberts - AI Developer & Backend Engineer
- Chinwendu Onwuka - Backend Developer, Flask & Product Design
- Ngaatendwe Dumbarimwe - Health News Integration
- Ebenezer Acquah - Frontend Developer
- Oluwatomiloba Onasanya - Product Manager & Presenter
- Belema Roberts - AI Developer & Backend Engineer
MissDiagnosis was inspired by the challenges faced during the Ebola and Lassa fever epidemics in Nigeria, where diseases were frequently misdiagnosed as malaria due to overlapping symptoms and lack of awareness.
- Integration of more medical-specific LLMs from Hugging Face for diagnosis.
- Implement a user authentication system for secure EMR storage.
- Expand disease detection capabilities with additional models.
- Real-time WHO API integration for automated outbreak updates.
- Notion Hackathon at Grambling State University
- OpenAI GPT-4o and Tensorflow for AI analysis
- WHO Disease Outbreak News for health data
Check out the live version of the project: MissDiagnosis Live
Let's build the future of healthcare together!
For questions or suggestions, reach out to:
- LinkedIn: Your LinkedIn Profile