Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Model Enhancement]: Brain Tumor Detection with Web Application #542

Merged
merged 48 commits into from
May 13, 2024

Conversation

TechieSamosa
Copy link
Contributor

@TechieSamosa TechieSamosa commented May 12, 2024

Pull Request for DL-Simplified 💡

Issue Title : [Model Enhancement]: Brain Tumor Detection with Web Application #531

  • Info about the related issue (Aim of the project) : The existing brain tumor detection project has been implemented on a small dataset with suboptimal accuracy and recall rates. The project is also missing an app.py file.

  • Name: Aditya Khamitkar

  • GitHub ID: TheNaiveSamosa

  • Email ID: thenaivesamosa@gmail.com

  • Identify yourself: Contributor for GirlScript Summer of Code

Closes: #Brain Tumor Detection Improvement Task

Describe the add-ons or changes you've made 📃

Enhanced the accuracy and recall rates of the brain tumor detection model by implementing the following changes:

  • Loaded the pre-trained TensorFlow model for brain tumor classification.
  • Defined class labels for different tumor types ('Glioma', 'Meningioma', 'No tumor', 'Pituitary').
  • Preprocessed the uploaded image by resizing it to (150, 150) pixels and converting it to a NumPy array.
  • Converted the processed image to a base64 string for rendering in the web application.
  • Implemented a Flask application with routes for uploading images and making predictions.
  • Handled error cases to provide a user-friendly interface.

Type of change ☑️

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, local variables)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested? ⚙️

Tested the functionality by running the Flask application locally and uploading test images to ensure accurate predictions.

Checklist: ☑️

  • My code follows the guidelines of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly wherever it was hard to understand.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have added things that prove my fix is effective or that my feature works.
  • Any dependent changes have been merged and published in downstream modules.

Please review and merge this PR. Thank you!

All the files were Unnecessary. Might help to reduce the size of the Repository. Repository Optimization.
Unnecessary Files. Not needed. Might help to reduce the size of the repository.
Made A README.md for this sub project.
Made Changes to the list.
Made Minor Changes to the Documentation.
Changed some Mistakes.
Wrote the Details on how the model has been done!!
Adding the Jupyter Notebook.
Copy link

Our team will soon review your PR. Thanks @TheNaiveSamosa :)

Copy link
Owner

@abhisheks008 abhisheks008 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Please include the Dataset folder, and inside that create a README to mention the source of the dataset.
  2. Include the Images folder and insert all the EDA results inside that.
  3. Rename the Deployment folder to Web App.
  4. Please follow the separate README templates for the main README file and for the web app's README file. Main README template is here and Web App README template is here.
  5. Upload the video inside the Web App folder.
  6. Use at least 2-3 algorithms/models for this project instead of going with a single model. My point is to make a comparison of the models to find out the best fitted one for this project as well as for the web app deployment.

Need to fix these changes.
@TheNaiveSamosa

@abhisheks008 abhisheks008 added Status: Requested Changes Changes requested. gssoc Girlscript Summer of Code 2024 labels May 12, 2024
@abhisheks008 abhisheks008 changed the title Issue #531 [Model Enhancement]: Brain Tumor Detection with Web Application May 12, 2024
@abhisheks008 abhisheks008 linked an issue May 12, 2024 that may be closed by this pull request
@abhisheks008
Copy link
Owner

Take some time, why are you in a hurry for pushing the codes. It's a 3-months long open source event, don't be in a rush. @TheNaiveSamosa

@TechieSamosa
Copy link
Contributor Author

Changes Implimented.

@abhisheks008
Copy link
Owner

Hi @TheNaiveSamosa sorry to bother you again. Instead of putting the Google drive link, why don't you just upload the video in the Web App folder and put that directly in the README file just the way you have attached images in the README. If someday you delete the video from the Google drive then that'll be gone.

@TechieSamosa
Copy link
Contributor Author

Acutally I tried uploading the video to the Web App directory but the thing is it isn't accepting the file. its saying that its very huge in size. I tried compressing but then it lost its clairity. I am thinking of something that could solve this like may be a series of photos. I treid multiple times to upload the video. Do you have any idea on how to solve this??

@abhisheks008
Copy link
Owner

Hi @TheNaiveSamosa use this website and compress the video https://www.freeconvert.com/video-compressor. GitHub allows you to upload file of maximum 25 MB.

@TechieSamosa
Copy link
Contributor Author

TechieSamosa commented May 13, 2024

Tried that too.

This is what I'm getting

image

And when I click on the link it open in new tab that says this

image

@abhisheks008
Copy link
Owner

Hi @TheNaiveSamosa try this markdown trick, [![](thumnail_url)](uploaded_video_url). For this just use a simple thumbnail, upload that in the Web App folder, hyperlink the video file and thumbnail using the markdown script. This should work.

@TechieSamosa
Copy link
Contributor Author

Yes tried that
see
this is the preview
image

Here is the Code


### Goal 🎯
The main goal of is to provide a user-friendly web application for the detection of brain tumors using deep learning models. The purpose of the application is to assist healthcare professionals in accurately diagnosing brain tumors in patients.

### Model(s) used for the Web App 🧮
The web application utilizes three main models for brain tumor detection:
1. **VGG16 Transfer Learning Model**: A pre-trained model on ImageNet, used for its superior performance in image classification tasks.
2. **Custom Convolutional Neural Network (CNN)**: Specifically designed for brain tumor detection, trained on a dataset of brain MRI images.
3. **Multilayer Perceptron (MLP) Based on TensorFlow**: An MLP architecture implemented using TensorFlow, serving as a simpler model for comparison.

### Video Demonstration 🎥
[![Demo Video]](https://github.com/TheNaiveSamosa/DL-Simplified/blob/5514ac2cb3463773e62efc0283d7f97270ab20d0/Brain%20Tumor%20Detection/Web%20App/Image%20Upload%20Form%20-%20Brave%202024-05-10%2010-02-48%20(1).mp4)


### Signature ✒️
Aditya Khamitkar
[![Twitter](https://img.shields.io/badge/Twitter-%40Couch_Potatoh_-blue?style=flat&logo=twitter)](https://twitter.com/Couch_Potatoh_)
[![LinkedIn](https://img.shields.io/badge/LinkedIn-Aditya_Khamitkar-blue?style=flat&logo=linkedin)](https://www.linkedin.com/in/adityakhamitkar/)
[![Instagram](https://img.shields.io/badge/Instagram-couch_potatoh_-blue?style=flat&logo=instagram)](https://www.instagram.com/couch_potatoh_/)
[![Reddit](https://img.shields.io/badge/Reddit-The_Cactus_Flower-blue?style=flat&logo=reddit)](https://www.reddit.com/user/The-Cactus-Flower/)

@TechieSamosa
Copy link
Contributor Author

TechieSamosa commented May 13, 2024

Sorry to bother you like this. I think my PR has been the oldest with changes one after another and not proper outcomes. Actually I'm new to Open Source hence such problems.
But done. Its working. Its working properly.
image

@abhisheks008
Copy link
Owner

Yeee!!! It's working 🎉 Let me have a final check.

Copy link
Owner

@abhisheks008 abhisheks008 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your PR is approved and ready to be merged. You did a fantastic job. Really appreciated your efforts for this issue.
@TheNaiveSamosa

@abhisheks008 abhisheks008 added Status: Approved Approved PR by the PA. level 3 Level 3 for GSSOC enhancement New feature or request and removed Status: Requested Changes Changes requested. labels May 13, 2024
@abhisheks008 abhisheks008 merged commit 7c7a754 into abhisheks008:main May 13, 2024
@TechieSamosa
Copy link
Contributor Author

Thanks, Great working with you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request gssoc Girlscript Summer of Code 2024 level 3 Level 3 for GSSOC Points Updated Status: Approved Approved PR by the PA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Model Enhancement]: Brain Tumor Detection with Web Application
2 participants