MediInsight is an innovative project that leverages the power of machine learning (ML) and deep learning (DL) to provide a comprehensive disease diagnosis solution. By utilizing various ML and DL models, MediInsight aims to accurately predict and diagnose a range of diseases based on user-provided data and images.
- Multiple Disease Predictions: Supports predictions for diabetes, breast cancer, heart disease, kidney disease, liver disease, malaria, and pneumonia.
- User-Friendly Interface: Easy-to-use web interface for uploading data and images.
- Automated Analysis: Processes and analyzes user inputs to provide quick and accurate disease predictions.
- Integration with ML/DL Models: Seamlessly integrates multiple machine learning and deep learning models for various diseases.
Check out the live demo: MediInsight
To run MediInsight locally, follow these steps:
-
Clone the repository:
git clone https://github.com/yourusername/MediInsight.git cd MediInsight
-
Create a virtual environment and install dependencies:
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate` pip install -r requirements.txt
-
Download the necessary models and place them in the
models
directory. -
Run the application:
python app.py
The application will be accessible at
http://127.0.0.1:5000/
.
- Home Page: Navigate to the home page to select the type of disease you want to diagnose.
- Upload Data: Depending on the disease, upload the necessary data or image.
- Get Prediction: Click on the predict button to get the diagnosis result.
- Requires 8 input values including BMI, Insulin, and Glucose levels.
- Uses a Random Forest model.
- Requires 22 input values.
- Uses a pre-trained ML model.
- Requires 13 input values.
- Uses a Random Forest model.
- Requires 24 input values.
- Uses a pre-trained ML model.
- Requires 10 input values.
- Uses a pre-trained ML model.
- Requires an image upload.
- Uses a Convolutional Neural Network (CNN) model.
- Requires an image upload.
- Uses a Convolutional Neural Network (CNN) model.
def predict(values, dic):
# Example for diabetes prediction
if len(values) == 8:
model = pickle.load(open('models/diabetes_rf_model.pkl', 'rb'))
values = np.asarray(values)
return model.predict(values.reshape(1, -1))[0]
# Add similar logic for other diseases...
@app.route("/malariapredict", methods=['POST', 'GET'])
def malariapredictPage():
if request.method == 'POST':
try:
img_file = request.files['image']
filename = secure_filename(img_file.filename)
img_path = os.path.join('uploads', filename)
img_file.save(img_path)
img = tf.keras.utils.load_img(img_path, target_size=(150, 150))
img = tf.keras.utils.img_to_array(img)
img = np.expand_dims(img, axis=0)
model = load_model("models/malaria_detect.h5")
pred = np.argmax(model.predict(img))
os.remove(img_path) # Clean up by deleting the uploaded image
return render_template('malaria_predict.html', pred=pred)
except Exception as e:
message = f"Error: {e}"
return render_template('malaria.html', message=message)
return render_template('malaria.html')
We welcome contributions to enhance MediInsight. Here's how you can contribute:
- Fork the repository on GitHub.
- Clone your forked repository to your local machine:
git clone https://github.com/yourusername/MediInsight.git cd MediInsight
- Create a new branch for your feature or bugfix:
git checkout -b feature-branch
- Make your changes and commit them:
git commit -m "Description of your changes"
- Push your changes to your fork:
git push origin feature-branch
- Open a Pull Request on the main repository.
For any issues or bug reports, please open an issue on GitHub.
This project is licensed under the MIT License. See the LICENSE file for more details.