Skip to content

Commit c4c6c00

Browse files
author
AdamMiltonBarker
committed
Resolves #7 Hardware setup and documentation
1 parent eed3e09 commit c4c6c00

File tree

5 files changed

+317
-3
lines changed

5 files changed

+317
-3
lines changed

docs/img/arduino-ide.jpg

122 KB
Loading
581 KB
Loading

docs/index.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,38 @@
66

77
Welcome to the **ALL Arduino Nano 33 BLE Sense Classifier** official documentation.
88

9-
<font color='red'>DEVELOPER TO EXPLAIN/UPDATE THE PROJECT DETAILS</font>
9+
The **Acute Lypmhoblastic Leukemia Arduino Nano 33 BLE Sense Classifier** is an experiment to explore how low powered microcontrollers, specifically the Arduino Nano 33 BLE Sense, can be used to detect Acute Lymphoblastic Leukemia. The Arduino Nano 33 BLE Sense is the latest Arduino Board which supports Tensorflow Lite, allowing machine learning on Arduino.
10+
11+
The motivation for this project was to explore how low powered devices such as Arduino can be used to detect Acute Lymphoblastic Leukemia. The project will be submitted to the Tensorflow For Microcontroller Challenge and the Eyes on Edge: tinyML Vision Challenge.
12+
13+
&nbsp;
14+
15+
#DISCLAIMER
16+
17+
_This project should be used for research purposes only. The purpose of the project is to show the potential of Artificial Intelligence for medical support systems such as diagnostic systems._
18+
19+
_Although the model is accurate and shows good results both on paper and in real world testing, it is trained on a small amount of data and needs to be trained on larger datasets to really evaluate it's accuracy._
20+
21+
_Developers that have contributed to this repository have experience in using Artificial Intelligence for detecting certain types of cancer. They are not doctors, medical or cancer experts._
1022

1123
&nbsp;
1224

1325
# Installation
1426

15-
Head over to the [Ubuntu Installation Guide](installation/ubuntu.md) for a complete installation guide.
27+
Use the following installation guides to set up your project:
28+
29+
- [Ubuntu Installation Guide](installation/ubuntu.md)
30+
- [Arduino Installation Guide](installation/arduino.md)
1631

1732
&nbsp;
1833

1934
# Usage
2035

21-
Head over to the [Ubuntu Usage Guide](usage/ubuntu.md) for a complete usage guide.
36+
Use the following usage guides to to train your classifier and use your classifier on Arduino:
37+
38+
- [Python Usage Guide](usage/python.md)
39+
- [Jupyter Notebooks Usage Guide](usage/notebooks.md)
40+
- [Arduino Usage Guide](usage/arduino.md)
2241

2342
&nbsp;
2443

docs/installation/arduino.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Arduino Installation
2+
3+
![ALL Arduino Nano 33 BLE Sense Classifier](../img/project-banner.jpg)
4+
5+
# Introduction
6+
This guide will guide you through the installation process for the **ALL Arduino Nano 33 BLE Sense Classifier** Arduino project.
7+
8+
&nbsp;
9+
10+
# Operating System
11+
This project requires the Windows 10 operating system(s), but may work as described on other OS.
12+
13+
&nbsp;
14+
15+
# Hardware
16+
The following hardware is required for this project:
17+
18+
- [Arduino Nano 33 BLE Sense](https://store.arduino.cc/arduino-nano-33-ble-sense)
19+
- [kwmobile Micro SD Card Module for Arduino](https://www.amazon.es/gp/product/B06XHJTGGC)
20+
- [SD Card](https://www.amazon.es/Tarjeta-Memoria-Kingston-32GB-Micro/dp/B00JRZIOIE)
21+
22+
&nbsp;
23+
24+
# Software
25+
The following Arduino software libraries are used with this project:
26+
27+
- [Arduino Tensorflow Lite](https://github.com/tensorflow/tflite-micro)
28+
- [JpegDecoder](https://github.com/Bodmer/JPEGDecoder)
29+
30+
&nbsp;
31+
32+
# Prerequisites
33+
You will need to ensure you have installed the following software and followed the provided guides:
34+
35+
- [Ubuntu Installation Guide](../installation/ubuntu.md)
36+
- [Python Usage Guide](../usage/python.md) or [Jupyter Notebooks Usage Guide](../usage/notebooks.md)
37+
- [Arduino IDE](https://www.arduino.cc/en/software)
38+
- [Getting started with the Arduino Nano 33 BLE Sense](https://www.arduino.cc/en/Guide/NANO33BLESense)
39+
- [Why doesn't the 5V pin work in the Arduino Nano 33 BLE boards?](https://support.arduino.cc/hc/en-us/articles/360014779679-Why-doesn-t-the-5V-pin-work-in-the-Arduino-Nano-33-BLE-boards-)
40+
41+
&nbsp;
42+
43+
# Setup
44+
45+
![ALL Arduino Nano 33 BLE Sense Classifier](../img/arduino-nano-33-ble-sense-sd_bb.jpg)
46+
47+
Follow the diagram above to connect your SD card reader to the Arduino Nano 33 BLE Sense.
48+
49+
&nbsp;
50+
51+
# Continue
52+
53+
Now you are ready to use your Arduino Nano 33 BLE Sense. Head over to the [Arduino Usage Guide](../usage/arduino.md) for instructions on how to use your model with the Arduino.
54+
55+
&nbsp;
56+
57+
# Contributing
58+
Asociación de Investigacion en Inteligencia Artificial Para la Leucemia Peter Moss encourages and welcomes code contributions, bug fixes and enhancements from the Github community.
59+
60+
Please read the [CONTRIBUTING](https://github.com/AMLResearchProject/ALL-Arduino-Nano-33-BLE-Sense-Classifier/blob/main/CONTRIBUTING.md "CONTRIBUTING") document for a full guide to forking our repositories and submitting your pull requests. You will also find our code of conduct in the [Code of Conduct](https://github.com/AMLResearchProject/ALL-Arduino-Nano-33-BLE-Sense-Classifier/blob/main/CODE-OF-CONDUCT.md) document.
61+
62+
## Contributors
63+
- [Adam Milton-Barker](https://www.leukemiaairesearch.com/association/volunteers/adam-milton-barker "Adam Milton-Barker") - [Asociación de Investigacion en Inteligencia Artificial Para la Leucemia Peter Moss](https://www.leukemiaresearchassociation.ai "Asociación de Investigacion en Inteligencia Artificial Para la Leucemia Peter Moss") President/Founder & Lead Developer, Sabadell, Spain
64+
65+
&nbsp;
66+
67+
# Versioning
68+
We use [SemVer](https://semver.org/) for versioning.
69+
70+
&nbsp;
71+
72+
# License
73+
This project is licensed under the **MIT License** - see the [LICENSE](https://github.com/AMLResearchProject/ALL-Arduino-Nano-33-BLE-Sense-Classifier/blob/main/LICENSE "LICENSE") file for details.
74+
75+
&nbsp;
76+
77+
# Bugs/Issues
78+
We use the [repo issues](https://github.com/AMLResearchProject/ALL-Arduino-Nano-33-BLE-Sense-Classifier/issues "repo issues") to track bugs and general requests related to using this project. See [CONTRIBUTING](https://github.com/AMLResearchProject/ALL-Arduino-Nano-33-BLE-Sense-Classifier/blob/main/CONTRIBUTING.md "CONTRIBUTING") for more info on how to submit bugs, feature requests and proposals.

docs/usage/arduino.md

Lines changed: 217 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,217 @@
1+
# Arduino Usage
2+
3+
![ALL Arduino Nano 33 BLE Sense Classifier](../img/project-banner.jpg)
4+
5+
# Introduction
6+
This guide will take you through the using the **ALL Arduino Nano 33 BLE Sense Classifier** to detect Acute Lymphoblastic Leukemia.
7+
8+
&nbsp;
9+
10+
# Installation
11+
First you need to install the required software for training the model and setup your Arduino Nano 33 BLE Sense. Below are the available installation guides:
12+
13+
- [Ubuntu installation guide](../installation/ubuntu.md).
14+
- [Arduino installation guide](../installation/arduino.md).
15+
16+
&nbsp;
17+
18+
# Training
19+
Before you can start to use this tutorial you must have already trained your classifier, to do so use one of the following guides:
20+
21+
- [Python Usage Guide](../usage/python.md).
22+
- [Jupyter Notebooks Usage Guide](../usage/notebooks.md)
23+
24+
&nbsp;
25+
26+
# Arduino IDE
27+
28+
![Arduino IDE](../img/arduino-ide.jpg)
29+
30+
Open your Arduino IDE and open the **all_nano_33_ble_sense** sketch located in the Arduino folder in the project root.
31+
32+
&nbsp;
33+
34+
# C Array Model
35+
Now you need to import your C array model into the Arduino project. On your development machine navigate to the **model** dir located in the project root and open the **all_nano_33_ble_sense.cc** file. First you need to copy the model and replace everything within **all_model[]{}** with your newly created model. Next you need to replace **all_model_len** with the actual length of your model which is found at the bottom of your model file.
36+
37+
&nbsp;
38+
39+
# Run The Classifier
40+
Now it is time to run your classifier on the Arduino Nano 33 BLE Sense. Make sure you are connected to your Arduino and click on the **upload** button. Once the model is uploaded it will start to run, open your serial monitor and watch the output.
41+
42+
``` bash
43+
19:22:40.139 -> Initialising SD card...
44+
19:22:40.148 -> Initialisation done.
45+
19:22:40.158 ->
46+
19:22:40.163 -> Model input info
47+
19:22:40.274 -> ===============
48+
19:22:40.284 -> Dimensions: 4
49+
19:22:40.299 -> Dim 1 size: 1
50+
19:22:40.314 -> Dim 2 size: 100
51+
19:22:40.328 -> Dim 3 size: 100
52+
19:22:40.343 -> Dim 4 size: 3
53+
19:22:40.354 -> Input type: 9
54+
19:22:40.365 -> ===============
55+
19:22:40.375 ->
56+
19:22:40.381 -> Im006_1.jpg
57+
19:22:40.458 -> ===============
58+
19:22:40.468 -> ALL positive score: -7
59+
19:22:40.483 -> ALL negative score: -18
60+
19:22:40.504 -> True Positive
61+
19:22:40.515 ->
62+
19:22:40.521 -> Im020_1.jpg
63+
19:22:43.194 -> ===============
64+
19:22:43.201 -> ALL positive score: -14
65+
19:22:43.223 -> ALL negative score: -6
66+
19:22:43.229 -> False Negative
67+
19:22:43.238 ->
68+
19:22:43.241 -> Im024_1.jpg
69+
19:22:45.916 -> ===============
70+
19:22:45.922 -> ALL positive score: 18
71+
19:22:45.928 -> ALL negative score: 24
72+
19:22:45.938 -> False Negative
73+
19:22:45.946 ->
74+
19:22:45.950 -> Im026_1.jpg
75+
19:22:48.680 -> ===============
76+
19:22:48.685 -> ALL positive score: 27
77+
19:22:48.695 -> ALL negative score: 24
78+
19:22:48.705 -> True Positive
79+
19:22:48.714 ->
80+
19:22:48.719 -> Im028_1.jpg
81+
19:22:51.409 -> ===============
82+
19:22:51.416 -> ALL positive score: 13
83+
19:22:51.427 -> ALL negative score: 18
84+
19:22:51.439 -> False Negative
85+
19:22:51.448 ->
86+
19:22:51.454 -> Im031_1.jpg
87+
19:22:54.138 -> ===============
88+
19:22:54.148 -> ALL positive score: -13
89+
19:22:54.164 -> ALL negative score: -16
90+
19:22:54.179 -> True Positive
91+
19:22:54.183 ->
92+
19:22:54.188 -> Im035_0.jpg
93+
19:22:56.883 -> ===============
94+
19:22:56.890 -> ALL positive score: 12
95+
19:22:56.901 -> ALL negative score: 20
96+
19:22:56.908 -> True Negative
97+
19:22:56.916 ->
98+
19:22:56.921 -> Im041_0.jpg
99+
19:22:59.631 -> ===============
100+
19:22:59.640 -> ALL positive score: 14
101+
19:22:59.653 -> ALL negative score: 6
102+
19:22:59.663 -> False Positive
103+
19:22:59.673 ->
104+
19:22:59.679 -> Im047_0.jpg
105+
19:23:02.365 -> ===============
106+
19:23:02.373 -> ALL positive score: 25
107+
19:23:02.384 -> ALL negative score: 20
108+
19:23:02.393 -> False Positive
109+
19:23:02.399 ->
110+
19:23:02.404 -> Im053_1.jpg
111+
19:23:05.160 -> ===============
112+
19:23:05.174 -> ALL positive score: 39
113+
19:23:05.190 -> ALL negative score: 5
114+
19:23:05.202 -> True Positive
115+
19:23:05.218 ->
116+
19:23:05.223 -> Im057_1.jpg
117+
19:23:07.881 -> ===============
118+
19:23:07.896 -> ALL positive score: 6
119+
19:23:07.912 -> ALL negative score: -1
120+
19:23:07.928 -> True Positive
121+
19:23:07.937 ->
122+
19:23:07.942 -> Im060_1.jpg
123+
19:23:10.618 -> ===============
124+
19:23:10.630 -> ALL positive score: 25
125+
19:23:10.648 -> ALL negative score: 12
126+
19:23:10.661 -> True Positive
127+
19:23:10.667 ->
128+
19:23:10.673 -> Im063_1.jpg
129+
19:23:13.359 -> ===============
130+
19:23:13.368 -> ALL positive score: 23
131+
19:23:13.382 -> ALL negative score: -52
132+
19:23:13.400 -> True Positive
133+
19:23:13.411 ->
134+
19:23:13.417 -> Im069_0.jpg
135+
19:23:16.097 -> ===============
136+
19:23:16.108 -> ALL positive score: -4
137+
19:23:16.129 -> ALL negative score: 34
138+
19:23:16.148 -> True Negative
139+
19:23:16.159 ->
140+
19:23:16.164 -> Im074_0.jpg
141+
19:23:18.812 -> ===============
142+
19:23:18.819 -> ALL positive score: 22
143+
19:23:18.834 -> ALL negative score: 18
144+
19:23:18.850 -> False Positive
145+
19:23:18.861 ->
146+
19:23:18.867 -> Im088_0.jpg
147+
19:23:21.564 -> ===============
148+
19:23:21.575 -> ALL positive score: -21
149+
19:23:21.594 -> ALL negative score: -24
150+
19:23:21.613 -> False Positive
151+
19:23:21.625 ->
152+
19:23:21.630 -> Im095_0.jpg
153+
19:23:24.274 -> ===============
154+
19:23:24.284 -> ALL positive score: -33
155+
19:23:24.302 -> ALL negative score: -38
156+
19:23:24.321 -> False Positive
157+
19:23:24.333 ->
158+
19:23:24.339 -> Im099_0.jpg
159+
19:23:27.014 -> ===============
160+
19:23:27.025 -> ALL positive score: -46
161+
19:23:27.042 -> ALL negative score: -22
162+
19:23:27.062 -> True Negative
163+
19:23:27.074 ->
164+
19:23:27.080 -> Im101_0.jpg
165+
19:23:29.769 -> ===============
166+
19:23:29.779 -> ALL positive score: -17
167+
19:23:29.796 -> ALL negative score: -14
168+
19:23:29.816 -> True Negative
169+
19:23:29.830 ->
170+
19:23:29.837 -> Im106_0.jpg
171+
19:23:32.530 -> ===============
172+
19:23:32.545 -> ALL positive score: -42
173+
19:23:32.562 -> ALL negative score: -45
174+
19:23:32.587 -> False Positive
175+
19:23:32.602 ->
176+
19:23:32.609 -> True Positives: 7
177+
19:23:34.833 -> False Positives: 6
178+
19:23:34.844 -> True Negatives: 4
179+
19:23:34.858 -> False Negatives: 3
180+
```
181+
182+
&nbsp;
183+
184+
# Conclusion
185+
186+
We see that our model that can correctly classify all twenty images only gets 11/20 when running on Arduino. There are some additional testing steps we can take which will be introduced in V2 that will allow us to test the Arduino model on our development machine to help identify where the bug is coming from. For now this is a good first attempt at building a classifier to detect Acute Lymphoblastic Leukemia detection on Arduino. If you would like to view the ongoing issue in the Tensorflow Micro repository [click here](https://github.com/tensorflow/tflite-micro/issues/287), thanks to [Advait Jain](https://github.com/advaitjain) for the asistance with this issue.
187+
188+
&nbsp;
189+
190+
# Continue
191+
192+
Now you are ready to set up your Arduino Nano 33 BLE Sense. Head over to the [Arduino Installation Guide](../installation/arduino.md) to prepare your Arduino.
193+
194+
&nbsp;
195+
196+
# Contributing
197+
Asociación de Investigacion en Inteligencia Artificial Para la Leucemia Peter Moss encourages and welcomes code contributions, bug fixes and enhancements from the Github community.
198+
199+
Please read the [CONTRIBUTING](https://github.com/AMLResearchProject/ALL-Arduino-Nano-33-BLE-Sense-Classifier/blob/main/CONTRIBUTING.md "CONTRIBUTING") document for a full guide to forking our repositories and submitting your pull requests. You will also find our code of conduct in the [Code of Conduct](https://github.com/AMLResearchProject/ALL-Arduino-Nano-33-BLE-Sense-Classifier/blob/main/CODE-OF-CONDUCT.md) document.
200+
201+
## Contributors
202+
- [Adam Milton-Barker](https://www.leukemiaairesearch.com/association/volunteers/adam-milton-barker "Adam Milton-Barker") - [Asociación de Investigacion en Inteligencia Artificial Para la Leucemia Peter Moss](https://www.leukemiaresearchassociation.ai "Asociación de Investigacion en Inteligencia Artificial Para la Leucemia Peter Moss") President/Founder & Lead Developer, Sabadell, Spain
203+
204+
&nbsp;
205+
206+
# Versioning
207+
We use [SemVer](https://semver.org/) for versioning.
208+
209+
&nbsp;
210+
211+
# License
212+
This project is licensed under the **MIT License** - see the [LICENSE](https://github.com/AMLResearchProject/ALL-Arduino-Nano-33-BLE-Sense-Classifier/blob/main/LICENSE "LICENSE") file for details.
213+
214+
&nbsp;
215+
216+
# Bugs/Issues
217+
We use the [repo issues](https://github.com/AMLResearchProject/ALL-Arduino-Nano-33-BLE-Sense-Classifier/issues "repo issues") to track bugs and general requests related to using this project. See [CONTRIBUTING](https://github.com/AMLResearchProject/ALL-Arduino-Nano-33-BLE-Sense-Classifier/blob/main/CONTRIBUTING.md "CONTRIBUTING") for more info on how to submit bugs, feature requests and proposals.

0 commit comments

Comments
 (0)