Skip to content

Latest commit

 

History

History
222 lines (156 loc) · 10.6 KB

File metadata and controls

222 lines (156 loc) · 10.6 KB

AI-for-Healthcare-Project-using-NVIDIA-Jetson-Nano-2GB-Developer-kit

image

This project uses Deep learning concept in detection of Various Deadly diseases.

It can Detect 1) Lung Cancer 2) Covid-19 3)Tuberculosis 4) Pneumonia.

It uses CT-Scan and X-ray Images of chest/lung in detecting the disease.

It has a Accuracy between 50%-80%.

It can take input in any Image format or through Live videos and provide accurate output results.

image

Attributions

Using these datasets

Accessories & Resources

Jetson Developer Kit (2gb kit)
Type C power (5V) supply
Ethernet cable
HDMI Cable
Monitor with HDMI cable
Camera (Logitech C270 HD WEBCAM)
Keyboard & Mouse (wireless)
Memory card (more than 32 GB)
Optional: cooling fan, micro-USB cable(for headless mode)
Jetson-Inference With Docker File: https://github.com/dusty-nv/jetson-inference
Datasets:
CT-Scan:-https://www.kaggle.com/mohamedhanyyy/chest-ctscan-images/download
X-ray:-https://www.kaggle.com/jtiptj/chest-xray-pneumoniacovid19tuberculosis/download

Headings

Building Project from scratch

Steps=>

1] Gathering all the Accessories:-
We gathered all the Accessories mentioned above from the local market and collected 2GB Developer kit.

2] Preparing for Setup:-
-connect SD card to PC/Laptop
-Download SD card Image (For 2 GB kit)
-Download SD Card Formatter & Install it.
image
-Quick format the SD card
image
-Download , Install & Launch ETCHER
image
-Select Downloaded image, select target device as Memory card then flash ( takes more than 10 min)
3] Setting up Kit:-
Insert the SD card in kit
image

Attach the Accessories in slots of kit as shown below
image
image

  • Turn On power supply & wait for system to boot
  • When you boot the first time, the developer kit will take you through some initial setup, including:
    • Review and accept NVIDIA Jetson software EULA
    • Select system language, keyboard layout, and time zone
    • Create username, password, and computer name
    • Optionally configure wireless networking
    • Select APP partition size. It is recommended to use the max size suggested
    • Create a swap file. It is recommended to create a swap file

3] Welcome screen:-
image

4] Downloading Jetson Inference with Docker Container:-

Open Terminal and type following command

git clone --recursive https://github.com/dusty-nv/jetson-inference

Wait until it downloads the container( May take 10-15 mins on slow connection)
Change Directory to jetson-inference using below command

cd jetson-inference

Run the Docker container command, It will ask for the password of your kit. Enter password(in Linux the password you type is not shown) and press enter

docker/run.sh

It may take time in First time running the docker command and ask for models that you want to download. Download default models and presss ok

image

5] Now download the trained dataset from kaggel, we used the following datasets:-

CT-Scan:-https://www.kaggle.com/mohamedhanyyy/chest-ctscan-images/download
X-ray:-https://www.kaggle.com/jtiptj/chest-xray-pneumoniacovid19tuberculosis/download

  • CT-Scan:-
    It has CT-scan Images of lung of Cancer Patients and Normal People
    image

  • X-ray:-
    This dataset consist of lung x-ray images of Covid-19 patient, Pneumonia patient, Tuberculosis patient and Normal people
    image


Now Extract the dataset in location:

Jetson-inference/python/training/classification/data/

With dataset name. In that folder create a label.txt file and name all the things that your kit gonna detect
image

6] Training our Dataset:-
Enter following command

python3 train.py --model-dir=models/ct-scan --batch-size=4 --workers=1 --epochs=35 data/ct-scan


It will take around 8-10 hours for training and Kit gets hot so don’t touch it.


7] Now export the trained model in onnx file

python3 onnx_export.py --model-dir=models/ct-scan


8] Do the same thing with other dataset
9]Now test the project:-

imagenet --model=models/ct-scan/resnet18.onnx --input_blob=input_0 --output_blob=output_0 --labels=data/ct-scan/labels.txt (input location) (Output location)


For webcam based detection:

imagenet --model=models/ct-scan/resnet18.onnx --input_blob=input_0 --output_blob=output_0 --labels=data/ct-scan/labels.txt /dev/video0


10] you can Train the model once more to increase the accuracy or Go ahead and try it with different models to create awesome project. For any help Contact:- [email protected]

Model Accuracy

Untitled design (1)
Untitled design


Resources

We have enclosed all the project required and processed files in the folder.
Replace this data folder with jetson-inference/python/training/classification/data
&
Models folder with

jetson-inference/python/training/classification/models


image

Running Pre-build Project

First Four steps are same

1] Gathering all the Accessories:-
We gathered all the Accessories mentioned above from the local market and collected 2GB Developer kit.

2] Preparing for Setup:-
-connect SD card to PC/Laptop
-Download SD card Image (For 2 GB kit)
-Download SD Card Formatter & Install it.
image
-Quick format the SD card
image
-Download , Install & Launch ETCHER
image
-Select Downloaded image, select target device as Memory card then flash ( takes more than 10 min)
3] Setting up Kit:-
Insert the SD card in kit
image

Attach the Accessories in slots of kit as shown below
image
image

  • Turn On power supply & wait for system to boot
  • When you boot the first time, the developer kit will take you through some initial setup, including:
    • Review and accept NVIDIA Jetson software EULA
    • Select system language, keyboard layout, and time zone
    • Create username, password, and computer name
    • Optionally configure wireless networking
    • Select APP partition size. It is recommended to use the max size suggested
    • Create a swap file. It is recommended to create a swap file

3] Welcome screen:-
image

4] Downloading Jetson Inference with Docker Container:-

Open Terminal and type following command

git clone --recursive https://github.com/dusty-nv/jetson-inference

Wait until it downloads the container( May take 10-15 mins on slow connection)
Change Directory to jetson-inference using below command

cd jetson-inference

Run the Docker container command, It will ask for the password of your kit. Enter password(in Linux the password you type is not shown) and press enter

docker/run.sh

It may take time in First time running the docker command and ask for models that you want to download. Download default models and presss ok

image