PerceptiLabs
v0.13
v0.11v0.12v0.13
v0.13
v0.11v0.12v0.13
  • Welcome
  • ⚡Getting Started
    • Quickstart Guide
      • Requirements
      • Installation
      • Video Tutorials
    • Load and Pre-process Data
    • Build Models
    • Train Models
    • Evaluate Models
    • Export and Deploy Models
    • Manage, Version, and Track Models
  • 🙏How to Contribute
    • Datasets
    • Models
    • Components
  • 👨‍🍳Tutorials
    • Basic Image Recognition
    • Basic Image Segmentation
  • 🛠️Advanced
    • Common Testing Issues
    • Common Training Issues
    • Components
      • Input and Target
      • Processing
      • Deep Learning
      • Operations
      • Custom
    • CSV File Format
    • Debugging and Diagnostic Features
    • How PerceptiLabs Works With TensorFlow
    • Included Packages
    • Types of Tests
    • UI Overview
      • Data Wizard
      • Overview Screen
      • Model Training Settings
      • Modeling Tool
      • Training View
      • Evaluate View
      • Deploy View
    • Using the Exported/Deployed Model
  • 💡Use Cases
    • General
      • A Guide to Using U-Nets for Image Segmentation
      • A Voice Recognition model using Image Recognition
    • Environmental
      • Automated Weather Analysis Using Image Recognition
      • Wildfire Detection
    • Healthcare & Medical
      • Brain Tumor Detection
      • Breast Cancer Detection
      • Classifying Chest X-Rays to Detect Pneumonia
      • Classifying Ways to Wear a Face Mask
      • Detecting Defective Pills
      • Highlighting Blood Cells in Dark-field Microscopy Using Image Segmentation
      • Ocular Disease Recognition
      • Retinal OCT
      • Skin Cancer Classification
    • Industrial IoT & Manufacturing
      • Air Conditioner Piston Check
      • Classifying Fruit
      • Classifying Wood Veneers Into Dry and Wet
      • Defect Detection in Metal Surfaces
      • Fabric Stain Classification
  • 📖Support
    • FAQs
    • Changelog
  • Code of Conduct
  • Marketing Site
Powered by GitBook
On this page

Was this helpful?

  1. Use Cases
  2. Healthcare & Medical

Brain Tumor Detection

PreviousHealthcare & MedicalNextIndustrial IoT & Manufacturing

Last updated 3 years ago

With the growing use of machine learning (ML) in healthcare, we set out to create an image classification model that could potentially help doctors identify brain tumors.

The model we came up with is trained to take a brain scan image as input and classify whether or not a brain tumor is present in the image.

Dataset

We grabbed the training images from this Kaggle project and pre-processed each of them into a resolution of 232x300 pixels. Below are a couple of examples of these images:

Creating the Model

To use the images in PerceptiLabs, we first created a .csv file that maps the images to the labels: yes (i.e., contains a brain tumor) and no (does not contain a brain tumor). The following shows an example of what this .csv file contains:

images

labels

yes/Y38.jpg

yes

no/no 3.jpg

no

This .csv file and the brain scan images are available on GitHub.

We then loaded the .csv file into the Data Wizard, setting the first column to images and the second column to categorical. We used the default data partitioning of 70% training, 20% validation, and 10% test, with randomization enabled, and left the default training values provided by the Data Wizard. The goal at this point was to generate a model that we could then modify.

Model Summary

After the model was generated, we went to work replacing the Components to end up with the following model architecture:

---------------------------------------------------------------------------------------------------------------------

Component 1: VGG16

---------------------------------------------------------------------------------------------------------------------

Component 2: Dense Activation=ReLU, Neurons=128

---------------------------------------------------------------------------------------------------------------------

Component 3: Dense Activation=Softmax, Neurons=2

---------------------------------------------------------------------------------------------------------------------- The following shows what this model looks like in PerceptiLabs:

When then trained the model with the following settings:

  • Epochs: 10

  • Batch size: 4

  • Loss: Cross-Entropy

  • Learning Rate: 0.001

  • Optimizer: ADAM

With a training time of less than 10 minutes, we achieved a training accuracy of 96.05% and a validation accuracy of 90%. In the following screenshot from PerceptiLabs you can see how the training accuracy ramped up over the first three epochs and then stabilized, while validation accuracy dipped around the third epoch before rising again and stabilizing:

Vertical Applications

In the realm of diagnosing brain tumors, a model like this could be used to help automate the process of examining brain scans and to notify doctors as to which cases may require a closer look.

Such a project could also be used by medical students or practitioners looking to build next-generation ML-based medical technology. The model itself could also be used as the basis for transfer learning to create additional models for detecting other types of tumors.

Demo Video

In the following video, we demonstrate how to set up this model in PerceptiLabs:

💡
  • Dataset
  • Creating the Model
  • Model Summary
  • Vertical Applications
  • Demo Video
Figure 1: Example images from the training dataset. The image on the left clearly shows a brain tumor.
Figure 2: The model architecture in PerceptiLabs.
Figure 3: Plot in PerceptiLabs comparing training and validation accuracy across 10 epochs.