# TinyML相關專題製作(以技術分類)
為了方便大家查找 TinyML (MCU AI) 相關專案範例,這裡持續收集整理了各種開發板、感測器、開發平台及不同領域應用的資訊,希望大家能更容易學習及開發出更好的作品。更多相關作品可參考文末 **【參考文獻】** 連結。如有未整理到的專案,歡迎留言分享。
**本文提供之內容僅為學習參考用,相關圖文著作權為原作者所有,引用前請記得加註原始來源。**
---
目錄:
[toc]
---
## 1. 聲音感測
這裡收集了使用聲音感測器(麥克風)做為輸入的專案,包含下列應用。
* 1.1.x 語音命令(人類口語命令、喚醒詞偵測)
* 1.2.x 聲音分類(含異常聲音偵測、環境聲音辨識)
---
### 1.1.1 Arduino BLE Sense 偵測語音命令控制LED亮滅

【功能簡述】
可偵測「紅」、「綠」、「未知」及「背景」等語音命令控制開發板上LED點亮或熄滅,同時通過UART將結果傳送回電腦。
【硬體/週邊】
* Arduino Nano 33 BLE Sense (自帶麥克風)
【軟體/平台】
* Edge Impulse Studio
* Arduino IDE
[【相關文章一】](https://github.com/OmniXRI/iThomeIronMan2021/blob/main/Day20.md)、[【相關文章二】](https://github.com/OmniXRI/iThomeIronMan2021/blob/main/Day21.md)、[【相關文章三】](https://github.com/OmniXRI/iThomeIronMan2021/blob/main/Day22.md)
---
### 1.1.2 CoreMaker-01 偵測語音命令控制LED亮滅

【功能簡述】
可偵測「開燈」、「關燈」語音命令來切換開發板上的LED點亮或熄滅,同時通過UART將結果傳送回電腦。
【硬體/週邊】
* 中光電感測 CoreMaker-01 (自帶麥克風)
【軟體/平台】
* SensiML - Data Capture Lab (本地端)
* SensiML - Analytics Studio (雲端)
* GNU Arm Toolchain
* Arm Mbed OS
[【相關文章/源碼】](https://omnixri.blogspot.com/2022/07/coremaker-0101-sensimltinyml.html)
---
### 1.1.3 Xiao nRF52840 Sense 關鍵詞偵測

【功能簡述】
利用麥克風作為輸入,偵測語言命令(關鍵詞),再將推論結果顯示到至小型LCD顯示器上。
【硬體/週邊】
* Seeed Studio XIAO BLE Sense (自帶麥克風)
* Seeed Studio XIAO Expansion board
【軟體/平台】
* Edge Impulse Studio
* Arduino IDE
[【相關文章】](https://www.hackster.io/mjrobot/tinyml-made-easy-sound-classification-kws-2fb3ab)、[【相關源碼】](https://github.com/Mjrovai/Seeed-XIAO-BLE-Sense)、[【相關影片】](https://youtu.be/1ex88hSqqyI)
---
### 1.2.1 寶寶哭聲自動搖籃

【功能簡述】
偵測到寶寶哭聲會自動以馬達驅動電動搖籃搖晃一下,達到安撫寶寶情緒。
【硬體/週邊】
* Arduino Protenta H7 (自帶麥克風)
* Protenta Vision Shield
* 寶寶電動搖籃
【軟體/平台】
* Edge Impulse Studio
* Arduino IDE
[【相關文章一】](https://www.edgeimpulse.com/blog/rocking-until-the-break-of-dawn)、[【相關文章二】](https://docs.edgeimpulse.com/experts/smart-baby-swing)、[【相關源碼】](https://studio.edgeimpulse.com/public/134216/latest)、[【相關影片】](https://youtu.be/v-rFyNGM5qU)
---
### 1.2.2 重金屬搖滾樂偵測器

【功能簡述】
可偵測背景音樂是否為重金屬搖滾樂,再依置信度來推動指針錶頭,達到指示效果。
【硬體/週邊】
* Arduino Nano 33 BLE Sense (自帶麥克風)
【軟體/平台】
* Edge Impulse Studio
* Arduino IDE
[【相關文章/源碼】](https://philcaridi.com/metaldetector/)、[【相關影片】](https://youtu.be/cafSr7-A00A)
---
## 2. 運動感測
這裡收集了使用單軸或多軸的運動感測器(加速度計/慣性計/重力計/Accelerometer/G Sensor, 角加速度計/陀螺儀/Gyroscope/ Gyro Sensor, 地磁計/Magnetometer, 慣性量測單元/Inertial Measurement Unit/IMU)做為輸入的專案,包含下列應用。
* 2.1.x 手勢偵測
* 2.2.x 異常震動
* 2.3.x 運動姿態
---
### 2.1.1 Arduino Nano 33 BLE Sense - 手勢偵測

【功能簡述】
可偵測左右(NG)、前後(OK)、畫圈(PASS)及閒置(IDLE)手勢,並透過UART將結果送到電腦。
【硬體/週邊】:
* Arduino Nano 33 BLE Sense (自帶運動感測器)
【軟體/平台】:
* Edge Impulse Studio
* Arduino IDE
[【相關文章一】](https://github.com/OmniXRI/iThomeIronMan2021/blob/main/Day24.md)、[【相關文章二】](https://github.com/OmniXRI/iThomeIronMan2021/blob/main/Day25.md)
---
### 2.1.2 手勢切換背包上點矩陣方向燈

【功能簡述】
手套上安裝開發板,並利用其運動感測器來偵測手勢動作,進而發送控制信號到背包端,改變點矩陣方向指示內容。
【硬體/週邊】
* Arduino Nano 33 BLE Sense
* ESP32
* 20x8 LED matrix
【軟體/平台】
* Google Colab
* TensorFlow Lite
* Arduino IDE
[【相關文章】](https://www.instructables.com/Smartglove-for-Cyclists/)、[【相關源碼-Arduino】](https://content.instructables.com/ORIG/FC7/B0JT/K9UEA78V/FC7B0JTK9UEA78V.ino)、[【相關源碼-Colab】](https://colab.research.google.com/github/arduino/ArduinoTensorFlowLiteTutorials/blob/master/GestureToEmoji/arduino_tinyml_workshop.ipynb)、[【相關影片一】](https://youtu.be/da8K2eS4XyU)、[【相關影片二】](https://youtu.be/w5kqfRDzFDU)
---
### 2.2.1 包裹運送異常震動偵測

【功能簡述】
利用運動感測器來偵測包裹運送途中的異常狀態,包括亂摔、掉落、搖晃等。
【硬體/週邊】
* Arduino Nano 33 BLE Sense
* SIM GSM Module
【軟體/平台】
* Edge Impulse Studio
* Arduino IDE
[【相關文章】](https://blog.arduino.cc/2022/09/10/this-tinyml-device-monitors-packages-for-damage-while-in-transit/)、[【相關源碼】](https://studio.edgeimpulse.com/public/129415/latest)、[【相關影片】](https://player.vimeo.com/video/743090998)
---
### 2.2.2 齒輪箱異常振動偵測

【功能簡述】
利用四個振動感測器產生的資料來分析變速箱是否健康,透過現成資料集進行模型訓練,完成後再部署到開發板上測試,未接真的感測器。
【硬體/週邊】
* Raspberry Pi Pico
【軟體/平台】
* Neuton Tiny ML Neuton
* Arduino IDE
[【相關文章】](https://www.hackster.io/neutonai/tinyml-gearbox-fault-prediction-on-a-4-mcu-41f434)、[【相關源碼】](https://github.com/vilaksh01/NeutonTinyML-GearboxFault)
---
### 2.3.1 智能桌球拍(虛擬桌球教練)

【功能簡述】
在桌球拍上安裝運動感測器來記錄及分析揮拍姿勢,以利改善後續表現。
【硬體/週邊】
* Arduino Nano 33 BLE Sense
* 桌球拍
【軟體/平台】
* TensorFlow Lite for Microcontrollers
* Google Creativelab - Tiny Motion Trainer (Google Experiments with Google)
* Arduino IDE
[【相關文章】](https://www.instructables.com/Table-Tennis-Bat-With-Machine-Learning-AI-Arduino-/)、[【相關源碼】](https://experiments.withgoogle.com/tiny-motion-trainer)、[【相關影片】](https://youtu.be/j8hQ66LXutc)
---
## 3. 環境感測
這裡收集了使用各種環境感測器做為輸入的專案,包含下列應用。
* 3.1.x 溫度、濕度、氣壓
* 3.2.x 照度、亮度
* 3.3.x 氣味、空氣品質
---
### 3.1.1 Wio Terminal簡易氣象預測站

【功能簡述】
利用溫度、濕度及氣壓三合一感測器收集氣象資訊,再使用單晶片來推論24小時後的天氣。
【硬體/週邊】
* Seeed Studio Wio Terminal
* Seeed Studio Temp&Humi&Barometer Sensor (BME280)
【軟體/平台】
* TensorFlow Lite
* Arduino IDE
[【相關文章/源碼】](https://www.seeedstudio.com/blog/2021/03/18/learn-tinyml-using-wio-terminal-and-arduino-ide-4-weather-prediction-with-tensorflow-lite-for-microcontrollers-a-k-a-i-just-like-data/)、[【相關影片】](https://youtu.be/qbpVltzvL6Q)
---
### 3.1.2 Thingy:91簡易室內外環境分類器

【功能簡述】
如何利用內建溫度、濕度、氣壓計等感測器來完成簡易室內外環境分類器、氣象預測等功能。
【硬體/週邊】
* Nordic Thingy:91 (自帶溫度、濕度、氣壓計、加速度計)
【軟體/平台】
* Edge Impulse Studio
[【相關文章】](https://www.hackster.io/shahizat/indoor-outdoor-environmental-classification-using-tinyml-16d6c5)、[【相關影片】](https://youtu.be/1jgImp7FBy8)
---
### 3.2.1 使用Wio Terminal與光感測器偵測手勢

【功能簡述】
利用光感測器來偵測不同手勢(伸出手指數量)揮動時光的變化,進而達到手勢辨識功能。
【硬體/週邊】
* Seeed Studio Wio Terminal (內建光感測器)
【軟體/平台】
* Edge Impulse Studio
* Arduino IDE
[【相關文章/源碼】](https://blog.cavedu.com/2021/10/12/tinyml-edgeimpulse/)
---
### 3.3.1 使用Wio Terminal及氣味感測器來偵測咖啡氣味

【功能簡述】
利用多氣味感測器來偵測(辨識)咖啡等氣味。
【硬體/週邊】
* Seeed Studio Wio Terminal
* Grove - Gas Sensor V2(Multichannel)
【軟體/平台】
* Edge Impulse Studio
* Arduino IDE
[【相關文章/源碼】](https://blog.cavedu.com/2021/11/22/tinyml-wio-terminal/)、[【相關文章─組裝】](https://blog.cavedu.com/2021/11/22/ai-nose)
---
### 3.3.2 使用8bit單晶片進行空氣品質推論

【功能簡述】
利用現成空氣品質資料集進行模型訓練,完成後部署到單晶片上進行測試,未直接接空氣品質感測器。
【硬體/週邊】
* Arduino Mega 256
【軟體/平台】
* Neuton Tiny ML Neuton
[【相關文章/源碼】](https://www.hackster.io/alexmiller11/tinyml-monitoring-air-quality-on-8-bit-microcontroller-043753)、[【相關影片】](https://youtu.be/59dcqe3rsLE)
---
## 4. 視覺感測
這裡收集了使用影像感測器(攝影機)做為輸入的專案,包含下列應用。
* 4.1.x 影像分類
* 4.2.x 物件偵測
---
### 4.1.1 指針錶讀值分級

【功能簡述】
以攝影機拍攝類比指針錶頭的數值,再將其分成「過低」、「正常」及「過高」三類影像(非直接解析指針讀數),再以有(USB)或無線(BLE)通訊方式將結果送出。
【硬體/週邊】
* Arduino Nicla Vision (自帶攝影機)
【軟體/平台】
* Edge Impulse Studio
* OpenMV IDE
[【相關文章】]()、[【相關源碼─Colab】](https://github.com/Zalmotek/EdgeImpulse_meter_reading_nicla_vision)、[【相關源碼─Edge Impulse】](https://studio.edgeimpulse.com/public/96469/latest)
---
### 4.1.2 看到的是不是馬克杯

【功能簡述】
利用攝影機取像進行影像分類推論,來確認是否看到馬克杯。
【硬體/週邊】
* Arduino Protenta H7
* Arduino Protenta Vision Shield
【軟體/平台】
* Edge Impulse Studio
* Arduino IDE
* OpenMV IDE
[【相關文章/源碼】](https://create.arduino.cc/projecthub/mjrobot/mug-or-not-mug-that-is-the-question-d4062a)
---
### 4.1.3 天空雲朵影像分類

【功能簡述】
利用攝影機取得天空影像,將雲朵影像分成六級,「Clear Sky」、「Patterened Cloud」、「Thin White Cloud
」、「Thick White Cloud」、「Thick Dark Cloud」、及「Veil Cloud」,推論出的結果再透過MQTT送到手機或其它裝置。
【硬體/週邊】
* Arduino Protenta H7
* Arduino Protenta Vision Shield
【軟體/平台】
* Edge Impulse Studio
* Arduino IDE
* OpenMV IDE
* MQTT Dashboard
[【相關文章】](https://create.arduino.cc/projecthub/usavswapnil/cloud-classifier-de1ca8)、[【相關源碼】](https://github.com/sw4p/TinyML_Cloud)、[【相關影片】](https://youtu.be/0_roK3GtCqA)
---
### 4.1.4 使用OV7670進行影像數字分類

【功能簡述】
使用攝影機取得影像,利用數字影像公開資料集進行訓練,再部署到開發板上進行推論。本範例包含如何連接攝影機及LCD。
【硬體/週邊】
* Arduino Nano 33 BLE Sense
* OV7670 Camera Module
* 1.8 inch TFT LCD
【軟體/平台】
* Arduino IDE
* Google Colab
[【相關文章】](https://create.arduino.cc/projecthub/theevildoof/tutorial-tinyml-with-ov7670-camera-module-302e35)、[【相關源碼】](https://github.com/theevildoof/TinyML_tutorial)
---
### 4.1.5 豆葉病害影像分類

【功能簡述】
利用影像來分辨豆葉病害種類。
【硬體/週邊】
* Sony Spresense boards (main & extension)
* Sony Spresense camera board
【軟體/平台】
* Edge Impulse Studio
[【相關文章】](https://www.hackster.io/wamiq-raza/bean-leaf-classification-with-sony-spresense-3a1576)、[【相關源碼】](https://studio.edgeimpulse.com/public/119787/latest)、[【相關影片】](https://youtu.be/W8KK5cpe5p0)
---
### 4.2.1 電梯內乘客計數

【功能簡述】
利用開發板上攝影機拍攝電梯內影像計算乘客人數,方便長期追蹤使用狀況及協助電梯故障時統計受困乘客並發送警報。
【硬體/週邊】
* Arduino Nicla Vision (自帶攝影機)
【軟體/平台】
* Edge Impulse Studio
[【相關文章】](https://docs.edgeimpulse.com/experts/elevator-passenger-counting)、[【相關源碼】](https://studio.edgeimpulse.com/public/109997/latest)、[【相關影片】](https://youtu.be/yD8CJGDpgfY)
---
### 4.2.2 影像口罩配戴偵測(物件偵測式)

【功能簡述】
以攝影機取得影像,利用FOMO模型(算法)來進行口罩(物件)偵測。
註:非影像分類式
【硬體/週邊】
* OpenMV H7 Plus
【軟體/平台】
* Edge Impulse Studio
* OpenMV IDE
[【相關文章/源碼】](https://www.hackster.io/shahizat/tinyml-fomo-face-mask-detection-system-using-edge-impulse-76e5d7)、[【相關影片】](https://youtu.be/fNRFCoXEwfk)
---
## 參考文獻
[1] [Hackster Projects - TinyML專案](https://www.hackster.io/search?i=projects&q=tinyml)
[2] [Edge Impulse Blog](https://www.edgeimpulse.com/blog)
[3] [Arduino Blog - TinyML專案](https://search.arduino.cc/search?tab=&q=tinyML)
[4] [Github - TinyML專案](https://github.com/search?q=tinyml)
[5] [Instructables Projects - TinyML專案](https://www.instructables.com/circuits/howto/tinyML/)
[6] [Experiments with Google - TF Lite for MCU](https://experiments.withgoogle.com/collection/tfliteformicrocontrollers)
[7] [AI-Tech & Systems - Cainvas Gallery](https://cainvas.ai-tech.systems/gallery/)
[8] [Neuton - Projects](https://neuton.ai/projects)
[9] [CAVEDU教育團隊技術部落格 - tinyML專案](https://blog.cavedu.com/?s=tinyml)
---
更多精彩文章請參考[【歐尼克斯實境互動工作室】](https://omnixri.blogspot.com)
**本文歡迎引用、分享,煩請註明作者Jack OmniXRI及本文網址**
###### tags: `TinyML` `MCU` `sensor`