|
| 1 | +# Arduino Usage |
| 2 | + |
| 3 | + |
| 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 | + |
| 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 | + |
| 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 | + |
| 25 | + |
| 26 | +# Arduino IDE |
| 27 | + |
| 28 | + |
| 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 | + |
| 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 | + |
| 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 | + |
| 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 | + |
| 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 | + |
| 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 | + |
| 205 | + |
| 206 | +# Versioning |
| 207 | +We use [SemVer](https://semver.org/) for versioning. |
| 208 | + |
| 209 | + |
| 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 | + |
| 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