กลับไปหน้ารวมไฟล์
aifes-color-detection-demo-4aa6e9-en.md

Introdution

This is the official project page of the AIfES developers. You want to know what exciting things you can do with AIfES? We will give you some examples through this account.

In this example we show how the Arduino Nano 33 BLE Sense using AIfES can learn the colors of three objects to classify them later. We use the colorimeter and proximity sensor of the Arduino Nano 33 BLE Sense to detect the RGB data of an object. The example was inspired by this Arduino project.

The AIfES implementation does not require a PC. The data recording, the creation of the artificial neural network, the training and the classification are done directly on the Arduino Nano 33 BLE Sense. Everything happens fully automatically.

This example is already integrated in the AIfES for Arduino library.

For more information about AIfES, visit www.aifes.ai.

How to start

For this example, you need two libraries which you can download from the Arduino library manager:

  • AIfES (aifes, the second letter is a capital "i")
  • Arduino_APDS9960

How to install a library is explained here.

The example shown here is already integrated in the AIfES for Arduino library. So you only need to open the example sketch. This is how you can find the example in your Arduino IDE:

File -> Examples -> AIfES for Arduino -> 1_Nano_BLE_Sense -> 0_Color_detection

As you can see in the video we use different colors on the screen to train the system. We did this to make it easier for you to see the output. You can of course use any object. Black and white objects don't work so well.

With this example you can train three different objects. Of course, you can also change the number of objects if you change the code.

Artificial neural network

The artificial neural network is a fully connected feedforward neural network with the following structure:

Structure of the artificial neural network

Activation functions:

  • Hidden Layer:\tsigmoid
  • Output Layer:\tsoftmax

The weights are randomly generated in a value range from -2 to 2.

The ADAM optimizer is used for training, with full batch over 300 epochs.

Training data:

Five samples per color are taken.

Video

Here the video where you can see AIfES in action:

AIfES - color recognition example on the Arduino Nano 33 BLE Sense

Images

Here are the colors from the video:

The colors from the video

EXPANDED TECHNICAL DETAILS

Edge-AI Machine Learning Hub

This cutting-edge project uses the AIfES (Artificial Intelligence for Embedded Systems) library to perform real-time color classification directly on the Arduino.

  • Neural Network Inference: A small artificial neural network is trained on-device to recognize specific colors captured by a TCS3200 color sensor. The Arduino performs the "Thinking" without any cloud or PC assistance.
  • Real-Time Labeling: Once a color is detected, the Arduino outputs the result (e.g., "RED identified with 95% confidence") to a Serial terminal or an I2C LCD, demonstrating the power of tinyML.

Efficiency

  • Optimized Weights: The AIfES core is specifically written for 8-bit microcontrollers, ensuring high-speed inference even on a standard Arduino Uno or Nano.

ข้อมูล Frontmatter ดั้งเดิม

title: "AIfES - color detection demo"
description: "Learns the colors of three different objects and can later classify them."
author: "aifes_team"
category: ""
tags:
  - "aifes"
  - "tinyml"
  - "machine learning"
views: 2198
likes: 2
price: 2450
difficulty: "Easy"
components:
  - "1x Nano 33 BLE Sense"
tools: []
apps:
  - "1x AIfES"
downloadableFiles:
  - "https://github.com/Fraunhofer-IMS/AIfES_for_Arduino/tree/main/examples/1_Nano_BLE_Sense/0_Color_detection"
documentationLinks: []
passwordHash: "2ecaf0774bab2e6f5f4e170bf38cb6be00862cb0a02db792946f2dff461f9541"
encryptedPayload: "U2FsdGVkX19zqN4sYuxtzorjjkwCCRTLfvO1oZ5MzBOpenVMPrQOgr4TIERRKlij6i8oxgkWqN0KqT23q7A/hg=="
seoDescription: "AIfES color detection demo: learns and classifies three different objects based on color."
videoLinks:
  - "https://www.youtube.com/embed/BGAXLsUgPqY"
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/aifes-color-detection-demo-4aa6e9_cover.jpg"
lang: "en"