LogoLogo
HomeDocsAPI & SDKsProjectsForumStudio
  • Welcome
    • Featured Machine Learning Projects
      • Getting Started with the Edge Impulse Nvidia TAO Pipeline - Renesas EK-RA8D1
      • Smart City Traffic Analysis - NVIDIA TAO + Jetson Orin Nano
      • ROS 2 Pick and Place System - Arduino Braccio++ Robotic Arm and Luxonis OAK-D
      • Optimize a cloud-based Visual Anomaly Detection Model for Edge Deployments
      • Rooftop Ice Detection with Things Network Visualization - Nvidia Omniverse Replicator
      • Surgery Inventory Object Detection - Synthetic Data - Nvidia Omniverse Replicator
      • NVIDIA Omniverse - Synthetic Data Generation For Edge Impulse Projects
      • Community Guide – Using Edge Impulse with Nvidia DeepStream
      • Computer Vision Object Counting - Avnet RZBoard V2L
      • Gesture Appliances Control with Pose Detection - BrainChip AKD1000
      • Counting for Inspection and Quality Control - Nvidia Jetson Nano (TensorRT)
      • High-resolution, High-speed Object Counting - Nvidia Jetson Nano (TensorRT)
    • Prototype and Concept Projects
      • Renesas CK-RA6M5 Cloud Kit - Getting Started with Machine Learning
      • TI CC1352P Launchpad - Getting Started with Machine Learning
      • OpenMV Cam RT1062 - Getting Started with Machine Learning
      • Getting Started with Edge Impulse Experiments
  • Computer Vision Projects
    • Workplace Organizer - Nvidia Jetson Nano
    • Recyclable Materials Sorter - Nvidia Jetson Nano
    • Analog Meter Reading - Arduino Nicla Vision
    • Creating Synthetic Data with Nvidia Omniverse Replicator
    • SonicSight AR - Sound Classification with Feedback on an Augmented Reality Display
    • Traffic Monitoring - Brainchip Akida
    • Multi-camera Video Stream Inference - Brainchip Akida
    • Industrial Inspection Line - Brainchip Akida
    • X-Ray Classification and Analysis - Brainchip Akida
    • Inventory Stock Tracker - FOMO - BrainChip Akida
    • Container Counting - Arduino Nicla Vision
    • Smart Smoke Alarm - Arduino Nano 33
    • Shield Bot Autonomous Security Robot
    • Cyclist Blind Spot Detection - Himax WE-I Plus
    • IV Drip Fluid-Level Monitoring - Arduino Portenta H7
    • Worker PPE Safety Monitoring - Nvidia Jetson Nano
    • Delivered Package Detection - ESP-EYE
    • Bean Leaf Disease Classification - Sony Spresense
    • Oil Tank Measurement Using Computer Vision - Sony Spresense
    • Object Counting for Smart Industries - Raspberry Pi
    • Smart Cashier with FOMO - Raspberry Pi
    • PCB Defect Detection with Computer Vision - Raspberry Pi
    • Bicycle Counting - Sony Spresense
    • Counting Eggs with Computer Vision - OpenMV Cam H7
    • Elevator Passenger Counting - Arduino Nicla Vision
    • ESD Protection using Computer Vision - Seeed ReComputer
    • Solar Panel Defect Detection - Arduino Portenta H7
    • Label Defect Detection - Raspberry Pi
    • Dials and Knob Monitoring with Computer Vision - Raspberry Pi
    • Digital Character Recognition on Electric Meter System - OpenMV Cam H7
    • Corrosion Detection with Computer Vision - Seeed reTerminal
    • Inventory Management with Computer Vision - Raspberry Pi
    • Monitoring Retail Checkout Lines with Computer Vision - Renesas RZ/V2L
    • Counting Retail Inventory with Computer Vision - Renesas RZ/V2L
    • Pose Detection - Renesas RZ/V2L
    • Product Quality Inspection - Renesas RZ/V2L
    • Smart Grocery Cart Using Computer Vision - OpenMV Cam H7
    • Driver Drowsiness Detection With FOMO - Arduino Nicla Vision
    • Gastroscopic Image Processing - OpenMV Cam H7
    • Pharmaceutical Pill Quality Control and Defect Detection
    • Deter Shoplifting with Computer Vision - Texas Instruments TDA4VM
    • Smart Factory Prototype - Texas Instruments TDA4VM
    • Correct Posture Detection and Enforcement - Texas Instruments TDA4VM
    • Visual Anomaly Detection with FOMO-AD - Texas Instruments TDA4VM
    • Surface Crack Detection and Localization - Texas Instruments TDA4VM
    • Surface Crack Detection - Seeed reTerminal
    • Retail Image Classification - Nvidia Jetson Nano
    • SiLabs xG24 Plus Arducam - Sorting Objects with Computer Vision and Robotics - Part 1
    • SiLabs xG24 Plus Arducam - Sorting Objects with Computer Vision and Robotics - Part 2
    • Object Detection and Visualization - Seeed Grove Vision AI Module
    • Bike Rearview Radar - Raspberry Pi
    • Build a Self-Driving RC Vehicle - Arduino Portenta H7 and Computer Vision
    • "Bring Your Own Model" Image Classifier for Wound Identification
    • Acute Lymphoblastic Leukemia Classifier - Nvidia Jetson Nano
    • Hardhat Detection in Industrial Settings - Alif Ensemble E7
    • Motorcycle Helmet Identification and Traffic Light Control - Texas Instruments AM62A
    • Import a Pretrained Model with "Bring Your Own Model" - Texas Instruments AM62A
    • Product Inspection with Visual Anomaly Detection - FOMO-AD - Sony Spresense
    • Visual Anomaly Detection in Fabric using FOMO-AD - Raspberry Pi 5
    • Car Detection and Tracking System for Toll Plazas - Raspberry Pi AI Kit
    • Visual Anomaly Detection - Seeed Grove Vision AI Module V2
    • Object Counting with FOMO - OpenMV Cam RT1062
    • Visitor Heatmap with FOMO Object Detection - Jetson Orin Nano
    • Vehicle Security Camera - Arduino Portenta H7
  • Audio Projects
    • Occupancy Sensing - SiLabs xG24
    • Smart Appliance Control Using Voice Commands - Nordic Thingy:53
    • Glass Window Break Detection - Nordic Thingy:53
    • Illegal Logging Detection - Nordic Thingy:53
    • Illegal Logging Detection - Syntiant TinyML
    • Wearable Cough Sensor and Monitoring - Arduino Nano 33 BLE Sense
    • Collect Data for Keyword Spotting - Raspberry Pi Pico
    • Voice-Activated LED Strip - Raspberry Pi Pico
    • Snoring Detection on a Smart Phone
    • Gunshot Audio Classification - Arduino Nano 33 + Portenta H7
    • AI-Powered Patient Assistance - Arduino Nano 33 BLE Sense
    • Acoustic Pipe Leakage Detection - Arduino Portenta H7
    • Location Identification using Sound - Syntiant TinyML
    • Environmental Noise Classification - Nordic Thingy:53
    • Running Faucet Detection - Seeed XIAO Sense + Blues Cellular
    • Vandalism Detection via Audio Classification - Arduino Nano 33 BLE Sense
    • Predictive Maintenance Using Audio Classification - Arduino Nano 33 BLE Sense
    • Porting an Audio Project from the SiLabs Thunderboard Sense 2 to xG24
    • Environmental Audio Monitoring Wearable - Syntiant TinyML - Part 1
    • Environmental Audio Monitoring Wearable - Syntiant TinyML - Part 2
    • Keyword Spotting - Nordic Thingy:53
    • Detecting Worker Accidents with Audio Classification - Syntiant TinyML
    • Snoring Detection with Syntiant NDP120 Neural Decision Processor - Arduino Nicla Voice
    • Recognize Voice Commands with the Particle Photon 2
    • Voice Controlled Power Plug with Syntiant NDP120 (Nicla Voice)
    • Determining Compressor State with Audio Classification - Avnet RaSynBoard
    • Developing a Voice-Activated Product with Edge Impulse's Synthetic Data Pipeline
    • Enhancing Worker Safety using Synthetic Audio to Create a Dog Bark Classifier
  • Predictive Maintenance and Defect Detection Projects
    • Predictive Maintenance - Nordic Thingy:91
    • Brushless DC Motor Anomaly Detection
    • Industrial Compressor Predictive Maintenance - Nordic Thingy:53
    • Anticipate Power Outages with Machine Learning - Arduino Nano 33 BLE Sense
    • Faulty Lithium-Ion Cell Identification in Battery Packs - Seeed Wio Terminal
    • Weight Scale Predictive Maintenance - Arduino Nano 33 BLE Sense
    • Fluid Leak Detection With a Flowmeter and AI - Seeed Wio Terminal
    • Pipeline Clog Detection with a Flowmeter and AI - Seeed Wio Terminal
    • Refrigerator Predictive Maintenance - Arduino Nano 33 BLE Sense
    • Motor Pump Predictive Maintenance - Infineon PSoC 6 WiFi-BT Pioneer Kit + CN0549
    • BrickML Demo Project - 3D Printer Anomaly Detection
    • Condition Monitoring - Syntiant TinyML Board
    • Predictive Maintenance - Commercial Printer - Sony Spresense + CommonSense
    • Vibration Classification with BrainChip's Akida
    • AI-driven Audio and Thermal HVAC Monitoring - SeeedStudio XIAO ESP32
  • Accelerometer and Activity Projects
    • Arduino x K-Way - Outdoor Activity Tracker
    • Arduino x K-Way - Gesture Recognition for Hiking
    • Arduino x K-Way - TinyML Fall Detection
    • Posture Detection for Worker Safety - SiLabs Thunderboard Sense 2
    • Hand Gesture Recognition - OpenMV Cam H7
    • Arduin-Row, a TinyML Rowing Machine Coach - Arduino Nicla Sense ME
    • Fall Detection using a Transformer Model – Arduino Giga R1 WiFi
    • Bluetooth Fall Detection - Arduino Nano 33 BLE Sense
    • Monitor Packages During Transit with AI - Arduino Nano 33 BLE Sense
    • Smart Baby Swing - Arduino Portenta H7
    • Warehouse Shipment Monitoring - SiLabs Thunderboard Sense 2
    • Gesture Recognition - Bangle.js Smartwatch
    • Gesture Recognition for Patient Communication - SiLabs Thunderboard Sense 2
    • Hospital Bed Occupancy Detection - Arduino Nano 33 BLE Sense
    • Porting a Posture Detection Project from the SiLabs Thunderboard Sense 2 to xG24
    • Porting a Gesture Recognition Project from the SiLabs Thunderboard Sense 2 to xG24
    • Continuous Gait Monitor (Anomaly Detection) - Nordic Thingy:53
    • Classifying Exercise Activities on a BangleJS Smartwatch
  • Air Quality and Environmental Projects
    • Arduino x K-Way - Environmental Asthma Risk Assessment
    • Gas Detection in the Oil and Gas Industry - Nordic Thingy:91
    • Smart HVAC System with a Sony Spresense
    • Smart HVAC System with an Arduino Nicla Vision
    • Indoor CO2 Level Estimation - Arduino Portenta H7
    • Harmful Gases Detection - Arduino Nano 33 BLE Sense
    • Fire Detection Using Sensor Fusion and TinyML - Arduino Nano 33 BLE Sense
    • AI-Assisted Monitoring of Dairy Manufacturing Conditions - Seeed XIAO ESP32C3
    • AI-Assisted Air Quality Monitoring - DFRobot Firebeetle ESP32
    • Air Quality Monitoring with Sipeed Longan Nano - RISC-V Gigadevice
    • Methane Monitoring in Mines - Silabs xG24 Dev Kit
    • Smart Building Ventilation with Environmental Sensor Fusion
    • Sensor Data Fusion with Spresense and CommonSense
    • Water Pollution Detection - Arduino Nano ESP32 + Ultrasonic Scan
    • Fire Detection Using Sensor Fusion - Arduino Nano 33 BLE Sense
  • Novel Sensor Projects
    • 8x8 ToF Gesture Classification - Arduino RP2040 Connect
    • Food Irradiation Dose Detection - DFRobot Beetle ESP32C3
    • Applying EEG Data to Machine Learning, Part 1
    • Applying EEG Data to Machine Learning, Part 2
    • Applying EEG Data to Machine Learning, Part 3
    • Liquid Classification with TinyML - Seeed Wio Terminal + TDS Sensor
    • AI-Assisted Pipeline Diagnostics and Inspection with mmWave Radar
    • Soil Quality Detection Using AI and LoRaWAN - Seeed Sensecap A1101
    • Smart Diaper Prototype - Arduino Nicla Sense ME
    • DIY Smart Glove with Flex Sensors
    • EdgeML Energy Monitoring - Particle Photon 2
    • Wearable for Monitoring Worker Stress using HR/HRV DSP Block - Arduino Portenta
  • Software Integration Demos
    • Azure Machine Learning with Kubernetes Compute and Edge Impulse
    • ROS2 + Edge Impulse, Part 1: Pub/Sub Node in Python
    • ROS2 + Edge Impulse, Part 2: MicroROS
    • Using Hugging Face Datasets in Edge Impulse
    • Using Hugging Face Image Classification Datasets with Edge Impulse
    • Edge Impulse API Usage Sample Application - Jetson Nano Trainer
    • MLOps with Edge Impulse and Azure IoT Edge
    • A Federated Approach to Train and Deploy Machine Learning Models
    • DIY Model Weight Update for Continuous AI Deployments
    • Automate the CI/CD Pipeline of your Models with Edge Impulse and GitHub Actions
    • Deploying Edge Impulse Models on ZEDEDA Cloud Devices
Powered by GitBook
On this page
  • Introduction
  • Investigation
  • Hardware
  • Platform
  • Software
  • Dataset
  • Project Setup
  • Create New Project
  • Import Data
  • Create Impulse
  • Image
  • Training
  • Platform Testing
  • Jetson Nano Setup
  • Python SDK
  • Software
  • Clone The Repository
  • Move Your Model
  • Add Your Data
  • Code
  • Conclusion

Was this helpful?

Edit on GitHub
Export as PDF
  1. Computer Vision Projects

Acute Lymphoblastic Leukemia Classifier - Nvidia Jetson Nano

Build an image classification model that predicts the presence of leukemia in blood panels to assist with early detection and diagnosis.

Previous"Bring Your Own Model" Image Classifier for Wound IdentificationNextHardhat Detection in Industrial Settings - Alif Ensemble E7

Last updated 1 year ago

Was this helpful?

Created By:

Public Project Link:

GitHub Repo:

Introduction

Acute Lymphoblastic Leukemia (ALL), also known as acute lymphocytic leukemia, is a cancer that affects the lymphoid blood cell lineage. It is the most common leukemia in children, and it accounts for 10-20% of acute leukemias in adults. The prognosis for both adult and especially childhood ALL has improved substantially since the 1970s. The 5-year survival is approximately 95% in children. In adults, the 5-year survival varies between 25% and 75%, with more favorable results in younger than in older patients.

Since 2018 I have worked on numerous projects exploring the use of AI for medical diagnostics, in particular, leukemia. In 2018 my grandfather was diagnosed as terminal with Acute Myeloid leukemia one month after an all clear blood test completely missed the disease. I was convinced that there must have been signs of the disease that were missed in the blood test, and began a research project with the goals of utilizing Artificial Intelligence to solve early detection of leukemia. The project grew to a non-profit association in Spain and is now a UK community interest company.

Investigation

One of the objectives of our mission is to experiment with different types of AI, different frameworks/programming languages, and hardware. This project aims to show researchers the potential of the Edge Impulse platform and the NVIDIA Jetson Nano to quickly create and deploy prototypes for medical diagnosis research.

Hardware

Platform

Software

Dataset

Pre-B Lymphoblastic Leukemia, or precursor B-Lymphoblastic leukemia, is a very aggressive type of leukemia where there are too many B-cell lymphoblasts in the bone marrow and blood. B-cell lymphoblasts are immature white blood cells that have not formed correctly. The expressions ("early pre-b", "pre-b" and "pro-b") are related to the differentiation of B-cells. We can distinguish the different phases based on different cell markers expression, although this is complex because the "normal profile" may be altered in malignant cells.

We had quite a lot of issues with the early class, this will be due to the fact the features of the different classes are very similar, especially so with the early class and benign as the early class represents the cells at the earliest stage of growth and is very close to the benign class.

Project Setup

Create New Project

From the project selection/creation page you can create a new project.

Enter a project name, select Developer or Enterprise and click Create new project.

Import Data

Once downloaded head over the to Data acquisition in Edge Impulse Studio, click on the Add data button and then Upload data.

From here, choose 500 images from each class, ensuring you enter the label for the relevant class each time. The classes are not balanced so select around 500 images from each class, make sure to remember which images you have not used as we will use some to classify on device later.

By the time you have finished uploading you should have 2000 images uploaded into 4 classes, with an 80% / 20% train/test split.

Create Impulse

The next step is to create your Impulse. Head to the Create Impulse tab. Next click Add processing block and select Image.

Now click Add learning block and select Classification then click Save impulse.

Image

Parameters

Head over to the Images tab and change the color depth to grayscale, then click on the Save parameters button to save the parameters.

Generate Features

If you are not automatically redirected to the Generate features tab, click on the Image tab and then click on Generate features and finally click on the Generate features button to generate the features.

Training

The next step is to train our model. Click on the Classifier tab then change the number of training cycles to 150 and add an additional 2D conv/pool layer with 8 filter, 3 kernel size, and 1 layer to the network as shown in the image above. Now you are ready to start training, click the Start training.

Once training has completed, you will see the results displayed at the bottom of the page. Here we see that the model achieved 93.8% accuracy. Lets test our model and see how it works on our test data.

Platform Testing

Let's see how the model performs on unseen data. Head over to the Model testing tab where you will see all of the unseen test data available. Click on the Classify all and sit back as we test our model.

You will see the output of the testing in the output window, and once testing is complete you will see the results. In our case we can see that we have achieved 91.67% accuracy on the unseen data.

Jetson Nano Setup

Now we are ready to set up our Jetson Nano project.

Python SDK

On your Jetson Nano, run the following command and connect to the platform:

edge-impulse-linux-runner --download modelfile.eim

Once the script has finished running you will see a similar output to below:

[BLD] Building binary OK
[RUN] Downloading model OK
[RUN] Stored model in /home/jetson-nano/modelfile.eim

Software

For this project you will need opencv-python>=4.5.1.48. Make sure you have installed it on your Jetson Nano.

Clone The Repository

Now you can clone this project's GitHub repository to your Jetson Nano. Navigate to the location you would like to clone the repo to and use the following commands:

git clone https://github.com/AdamMiltonBarker/edge-impulse-all-classifier.git

Move Your Model

Now move the model you downloaded earlier into the model directory of the cloned repo, modifying your path as required:

mv /home/jetson-nano/modelfile.eim /home/jetson-nano/edge-impulse-all-classifier/model

Add Your Data

Now it is time to add some test data to your device, ensuring that you are not using any data that has already been uploaded to the Edge Impulse platform. You can use additional images from the Kaggle dataset, or your own data. Place the images into the data folder of the cloned repo on your Jetson Nano.

Code

The code has been provided for you in the classifier.py file. To run the classifier use the following command:

python3 classifier.py

You should see similar to the following output. In our case, our model performed exceptionally well at classifying the various stages of leukemia, only classifying 3 samples out of 14 incorrectly.

Loaded runner for "Edge Impulse Experts / Acute Lymphoblastic Leukemia Classifier"

Loaded test image: data/WBC-Malignant-Pre-741.jpg
Benign: 0.17    Pre: 0.83       Pro: 0.00
Ground: Pre
Classification: Pre with 0.8257818818092346 confidence
Result: Correctly classified Pre sample in 0.019216299057006836 seconds

Loaded test image: data/WBC-Malignant-Pre-707.jpg
Benign: 0.59    Pre: 0.41       Pro: 0.00
Ground: Pre
Classification: Benign with 0.586258053779602 confidence
Result: Incorrectly classified Benign sample in 0.012994766235351562 seconds

Loaded test image: data/WBC-Malignant-Pre-703.jpg
Benign: 0.79    Pre: 0.21       Pro: 0.00
Ground: Pre
Classification: Benign with 0.7909294962882996 confidence
Result: Incorrectly classified Benign sample in 0.012796640396118164 seconds

Loaded test image: data/WBC-Benign-504.jpg
Benign: 1.00    Pre: 0.00       Pro: 0.00
Ground: Benign
Classification: Benign with 0.9996868371963501 confidence
Result: Correctly classified Benign sample in 0.012486934661865234 seconds

Loaded test image: data/WBC-Malignant-Pre-696.jpg
Benign: 0.29    Pre: 0.71       Pro: 0.00
Ground: Pre
Classification: Pre with 0.7090908288955688 confidence
Result: Correctly classified Pre sample in 0.012774467468261719 seconds

Loaded test image: data/WBC-Benign-501.jpg
Benign: 1.00    Pre: 0.00       Pro: 0.00
Ground: Benign
Classification: Benign with 0.999911904335022 confidence
Result: Correctly classified Benign sample in 0.012662410736083984 seconds

Loaded test image: data/WBC-Malignant-Pro-560.jpg
Benign: 0.05    Pre: 0.00       Pro: 0.95
Ground: Pro
Classification: Pro with 0.9516651034355164 confidence
Result: Correctly classified Pro sample in 0.012473106384277344 seconds

Loaded test image: data/WBC-Malignant-Pro-536.jpg
Benign: 0.03    Pre: 0.00       Pro: 0.97
Ground: Pro
Classification: Pro with 0.9714751243591309 confidence
Result: Correctly classified Pro sample in 0.012613773345947266 seconds

Loaded test image: data/WBC-Malignant-Pro-629.jpg
Benign: 0.07    Pre: 0.00       Pro: 0.93
Ground: Pro
Classification: Pro with 0.9335078597068787 confidence
Result: Correctly classified Pro sample in 0.012687444686889648 seconds

Loaded test image: data/WBC-Benign-502.jpg
Benign: 0.98    Pre: 0.00       Pro: 0.02
Ground: Benign
Classification: Benign with 0.980989933013916 confidence
Result: Correctly classified Benign sample in 0.012753963470458984 seconds

Loaded test image: data/WBC-Benign-503.jpg
Benign: 0.99    Pre: 0.00       Pro: 0.01
Ground: Benign
Classification: Benign with 0.9916738867759705 confidence
Result: Correctly classified Benign sample in 0.012406110763549805 seconds

Loaded test image: data/WBC-Malignant-Pro-592.jpg
Benign: 0.06    Pre: 0.00       Pro: 0.94
Ground: Pro
Classification: Pro with 0.9429842829704285 confidence
Result: Correctly classified Pro sample in 0.013579130172729492 seconds

Loaded test image: data/WBC-Malignant-Pro-656.jpg
Benign: 0.11    Pre: 0.00       Pro: 0.89
Ground: Pro
Classification: Pro with 0.8878546357154846 confidence
Result: Correctly classified Pro sample in 0.012981414794921875 seconds

Loaded test image: data/WBC-Malignant-Pre-750.jpg
Benign: 0.84    Pre: 0.16       Pro: 0.00
Ground: Pre
Classification: Benign with 0.8409590125083923 confidence
Result: Incorrectly classified Benign sample in 0.012578725814819336 seconds

Classifications finished 14 in 0.18500518798828125 seconds

Conclusion

In this demonstration, we have illustrated the potential of combining the Edge Impulse platform with the computational capabilities of the NVIDIA Jetson for swiftly prototyping medical research applications, such as early detection of leukemia.

Although this program is not yet capable of addressing the challenges associated with early detection or serving as a practical real-world solution, it serves as a valuable tool for medical and AI researchers, offering insights and aiding in the advancement of their respective fields.

NVIDIA Jetson Nano

Edge Impulse

For this project we are going to use the . Acute Lymphoblastic Leukemia can be either T-lineage, or B-lineage. This dataset includes 4 classes: Benign, Early Pre-B, Pre-B, and Pro-B Acute Lymphoblastic Leukemia.

Getting started is as simple as heading to and create your account or login. Once logged in you will be taken to the project selection/creation page.

Now it is time to import your data. You should have already downloaded the dataset from Kaggle, if not you can do so now on .

To deploy our model on our NVIDIA Jetson Nano, we are going to use the .

Buy
Visit
Edge Impulse Linux SDK for Python
Acute Lymphoblastic Leukemia (ALL) image dataset
Edge Impulse
this link
Edge Impulse Linix SDK
Adam Milton-Barker
https://studio.edgeimpulse.com/public/239144/latest
Edge Impulse Acute Lymphoblastic Leukemia Classifier
Create Edge Impulse project
Upload data
Uploading data
Uploaded data
Created Impulse
Parameters
Generate Features
Architecture
Training
Test model results