The aim of this project is to create a Machine Learning model that can take the MRI data of a patient and generate a prediction regarding the diagnosis of Alzheimer's i.e. whether the patient is Demented or Non-demented. Using the data from the user to predict if the patient has Alzheimer's or not
app.py: Contains the fastapi code for the ML model
.ipynb: Contains the machine learning model for Alzheimer's detection
inputs.txt: Contains single example entry
Inputs: Visit, MR Delay, M/F, Hand, Age, EDUC, SES, MMSE, CDR, eTIV, nWBV, ASF
Output: Demented(0) or Nondemented(1) (Group)
Steps followed for creating this project:
- Generate a new environment and install necessary libraries
- Generate Machine Learning model for the patient data and create pickle file
- Create an API using fastapi and test it on http://127.0.0.1:8000/predict or http://127.0.0.1:8000/docs to use the OpenAPI for interactive API.
- Create Procfile and Deploy the app on Heroku web server
- Use this ML model API link to send a POST request with the inputs in the format specified in inputs.txt as shown below.
- If prediction = 0 then patient is Demented and if prediction = 1, patient is Nondemented
- Needed to add the CORS headers to the api to allow access to the html page. This resulted in a 400 bad request error. In order to fix this http://localhost:5000 was added to the whitelist.