Skip to content

Soham-coder/Raspberry_pi_edge_ML

Repository files navigation

visitors

Brain_cancer_detection_on_Raspberry_Pi

@@ First check whether git is installed in Rpi3b+@@

! git --version

If this fails with a error message install git ...

! sudo apt install git
@@ Clone this repository@@

! git clone https://github.com/Soham-coder/Raspberry_pi_edge_ML.git
@@ Run normal_quantized code@@
Go inside directory Normal_quantized

! sudo chmod +x script_normal.sh

! ./script_normal.sh

It will give print "Press pushbutton for predicting images"

Press pushbutton connected to GPIO-15

It will ask for prompt "Enter path of image directory where images are present:"

Give prompt input as ./test_orig

- Note: Don't press pushbutton until current prediction operation is finished, else it will ask for next prompt

Once all finish, press ctrl+c

Output log - ./log/out.txt

Normal_quantized_log

+ Average Prediction Time: 5.3895740906397505 Seconds
+ Average Size of test images - 24035 bytes
+ Pre-trained Model Size - 7255312 bytes
+ Accuracy - 97.92% 
@@ Run dwt_quantized code@@
Go inside directory DWT_quantized

! sudo chmod +x script_dwt.sh

! ./script_dwt.sh

It will give print "Press pushbutton for predicting images"

Press pushbutton connected to GPIO-15

It will ask for prompt "Enter path of image directory where images are present:"

Give prompt input as ./test_dwt

- Note: Don't press pushbutton until current prediction operation is finished, else it will ask for next prompt

Once all finish, press ctrl+c

Output log - ./log/out.txt

DWT_quantized_log

+ Average Prediction Time: 0.24476244866847993 Seconds
+ Average Size of test images - 5894 bytes
+ Pre-trained Model Size - 795552 bytes
+ Accuracy - 95.33%
@@ Run vgg16_quantized code@@
Go inside directory VGG16_quantized

! sudo chmod +x script_vgg16.sh

! ./script_vgg16.sh

It will give print "Press pushbutton for predicting images"

Press pushbutton connected to GPIO-15

It will ask for prompt "Enter path of image directory where images are present:"

Give prompt input as ./test_orig

- Note: Don't press pushbutton until current prediction operation is finished, else it will ask for next prompt

Once all finish, press ctrl+c

Output log - ./log/out.txt

VGG16_quantized

+ Average Prediction Time: 30.64683867924249 Seconds
+ Average Size of test images - 24035 bytes
+ Pre-trained Model Size - 18143072 bytes

Accuracy_logs

Normal_accuracy

DWT_accuracy

@@ Run Accuracy scripts@@
Go inside directory Calculate_accuracy
@@ Run normal accuracy@@
! sudo chmod +x script_accuracy_normal.sh
! ./script_accuracy_normal.sh
Output logs - 
# ./log/normal.txt

@@ Run dwt accuracy@@
! sudo chmod +x script_accuracy_dwt.sh
! ./script_accuracy_dwt.sh
Output logs -
# ./log/dwt.txt

@@ Run cs accuracy@@
! sudo chmod +x script_accuracy_cs.sh
! ./script_accuracy_cs.sh
Output logs - 
# ./log/cs.txt

Final_Report

Final Report

Utility

### Utility scripts

average_prediction_runtime.py - Parses the log file and calculates average prediction time
find_avg_test_image_size.sh - Calculates the average image size of test images in test image folder in bytes
find_model_size.sh - Calculates the Pretrained model size in weights folder
install_git.sh - Incase you want to install git in Linux-Ubuntu based system through apt package manager, use this
form_dict.py - Creates Dictionary/associative array of "image name" & "category"- Enter prompt as ./test_dwt
install_tf_2_4_0_rpi3b.sh - Install tf==2.4.0 in Rpi 3b+/4 in Debian Raspbian OS
cd Install_tf-2.4.0-armv71-rpi3b
chmod +x install_tf_2_4_0_rpi3b.sh
./install_tf_2_4_0_rpi3b.sh
[Restart the Terminal](needed)

P.S - tf=2.4.0 should get installed in pip3, python3

Project Maintainers


Arindam Majee

Soham Mondal

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published