Brain Tumor Detection using CNN

Desktop deep-learning app that detects a brain tumour in an MRI image with a convolutional neural network, with live training curves, confusion matrix, folder prediction and history. Python, TensorFlow/Keras.

  • Price: ₹1,999
  • Category: AI / ML
  • Technology: Python, TensorFlow / Keras, CNN, Tkinter, Matplotlib, SQLite
  • Includes: Source code + database
  • Suitable for: BCA / B.Sc CS, MCA / M.Sc CS, B.E / B.Tech CSE & IT

Project overview

Reading brain MRI scans one by one is slow, and deep learning is now a standard way to help. This desktop application classifies a brain MRI image as tumour or no tumour with a convolutional neural network built in Keras: a pre-trained MobileNetV2 (transfer learning) with a new classifier on top, fine-tuned and trained with flip, rotation and zoom augmentation. The Train screen shows a progress bar, a live accuracy curve for training and validation, the confusion matrix and precision, recall and F1 score on unseen test images; the model included reaches about 90 percent on its unseen test images. On the Predict screen the user chooses any image (or a demo sample) and gets the class with a confidence percentage and probability chart, can predict a whole folder and save the results to CSV, and every prediction is kept in a history that can be exported. The public training dataset is not included (download link and steps are in the README); a trained model and demo images are, so the project is ready to demonstrate on day one.

Modules

  1. Login: Admin login with a salted password hash; the password can be changed from the Home screen.
  2. Home: Shows classes, training images, image size, the active model and its test accuracy.
  3. Dataset: Images-per-class chart and a grid of sample MRI images; button to open the data folder.
  4. Train: Train the CNN with a chosen number of epochs, progress bar, live accuracy curve, confusion matrix, precision / recall / F1.
  5. Predict: Choose an image or a demo sample; class, confidence and probability chart; predict a whole folder to CSV.
  6. History: Every prediction saved with time and file name; export to CSV or clear.

Requirements

  • Python 3.11 (64-bit)
  • Internet once, to install the libraries (about 10 minutes, 500 MB)
  • Windows 10 / 11

How to run this project

  1. Install Python 3.11 from python.org and tick "Add python.exe to PATH" during setup.
  2. Extract the zip and open the project folder (STUDENT_GUIDE.md explains every step in simple words).
  3. Double-click `1_INSTALL.bat` once and wait until it says [OK] (about 10 minutes, 500 MB; it downloads the libraries into a private .venv folder).
  4. Double-click `2_RUN.bat` to start the project. If it does not start, double-click `CHECK_SETUP.bat` and read what it says.
  5. Log in with admin / admin123.
  6. Open Train: set 10-20 epochs, click 'Train the CNN' and watch the accuracy curve (needs the full dataset in data\train; skip if you only demo). Open Predict, click 'Use a sample image' several times, then 'Predict a whole folder' on data\samples\yes.

More AI / ML projects