logo
OpenMV
Home Cam
Applications
Store
AI
Sales Channels
Support
OpenMVOpenMV
ShieldsShields
LensLens
RoboticsRobotics
BookBook
VideoVideo
DownloadDownload
DocsDocs
ForumForum
OpenMV.ioOpenMV.io
GithubGithub

OpenMV Self-Training Neural Network for Target Point Detection – Traffic Sign Recognition in Real-Road Environments

Artificial intelligence has two very common tasks in the field of vision: classification and object detection.

Category:Determine which category the image belongs to, such as cat or dog.

Object Detection:Used to locate the positions, quantities, and dimensions of multiple distinct objects in an image.

In previous video tutorials, we explained how to use the OpenMV4 Plus to train neural networks online for classifying different objects. It can determine in real time whether an image within the OpenMV’s field of view corresponds to a specific object—for example, whether a face is wearing a mask—but it cannot output the positional coordinates of faces or masks, nor the number of faces.

Target detection is significantly more complex and computationally intensive than classification, making it rare in the microcontroller domain. The OpenMV main control MCU is the STM32H7; we have now added a new feature to SingTown that enables target detection–like tasks to run on microcontrollers, delivering outstanding performance.

交通标志识别教程-多个目标的识别

Today, we will explainTraining demonstration for traffic sign detection in real-road environments, detecting traffic signs on actual roadssuch as no honking, no parking, and a speed limit of 80 km/h, rather than a laboratory interference-free environment.

You can view the entire project content, including all code and models, at the following address: https://book.openmv.cc/project/traffic-sign.html

It is widely recognized that real-world environments—especially road conditions—are highly complex and subject to numerous interferences. We captured images of traffic signs in actual environments using devices such as smartphones, trained the model on EdgeImpulse—an online platform provided by our OpenMV partner—and manually annotated approximately 270 images. The training process required only ten minutes, yielding a model with an F1 score accuracy of 92%. When deployed on OpenMV, the model achieves a frame rate of 10 frames per second, delivering both smooth performance and high accuracy.

Users can train the system to detect any target of interest following our video tutorials—for example, different digits, fruits, landmarks, components, or even any specific irregular object—and obtain the count, coordinates, and category name of each detected object.

Note:This video tutorial covers the neural network-based keypoint detection feature, which is compatible not only with the OpenMV4 H7 Plus but also with the OpenMV4 H7. The trained FOMO keypoint detection model is compact—only tens of kilobytes in size—and delivers excellent performance. Even though the OpenMV4 H7 has less RAM than the Plus version, we can train a slightly smaller model to run on the OpenMV4.

Below is a brief introduction to the principle:

The primary design decision behind FOMO object point detection on OpenMV is based on the idea that many object detection tasks do not actually require the size of objects, but only their positions within an image. Once the positions of objects are known, subsequent operations can be performed—such as controlling a vehicle to move toward detected targets using OpenMV, enabling drones to land at designated locations, or directing robotic arms to grasp specific target objects.

The FOMO model is a model specially designed by EdgeImpulse for microcontroller environments; unlike conventional object detection, it can only detect the positions and count of multiple objects, but cannot obtain their specific dimensions.

The underlying principle of the FOMO model is extremely simple and flexible. It first divides an image into patches, each measuring 8×8 pixels. For a 96×96-resolution image, this results in a 12×12 grid of cells; for a 360×360 image, it yields a 40×40 grid. Image classification is then performed independently on each cell.

Compared with YOLO V5 or MobileNet SSD, FOMO performs significantly better on a large number of small objects. FOMO object point detection is 30 times faster than MobileNet SSD.

FOMO performs better when the objects to be detected are of similar sizes—for instance, when the signage to be identified has relatively consistent dimensions, rather than varying drastically between very large and very small objects.

OpenMV uses EdgeImpulse to train neural network object detection models online, primarily involving the following steps: collecting and uploading image datasets, labeling objects, training, testing the model, and deployment.

* Collect an image dataset: Capture images of specific objects in the actual environment where recognition will be performed. Images are collected in the same environment where recognition will take place, ensuring that the actual training environment closely matches the actual detection environment, thereby achieving better performance.

* Annotation Target: Draw bounding boxes around each target to be detected in our dataset and associate each box with the corresponding target name to facilitate subsequent training, target localization, and target name recognition.

* Training the model: After annotation is completed, train the model using the convolutional neural network parameters designed by us.

* Test model: We evaluate the trained model; if performance is unsatisfactory, we correspondingly expand the training dataset or adjust training parameters and continue training until an acceptable model is achieved.

*Deployment: We can run the trained model file directly from the built-in USB drive of the OpenMV.

The following demonstrates the specific procedure:

01. Collect and upload the image dataset

I. First, log in to the website edgeimpulse.com, select “Log In”, enter the name of the new project, and choose “Images” → “Classify multiple objects”

交通标志识别教程-新建项目.

II. Select an image to upload. There are several ways to obtain image datasets:

1. Capture images in real time using the OpenMV IDE. Use the “Dataset Editor” tool in the OpenMV IDE to create a new dataset and capture images in real time; for details, refer to our previous video tutorial on object classification for mask detection.

交通标志识别教程-.实时采集图像

2. Images downloaded from the internet or captured with a mobile phone; preferably matching your actual detection environment. We have prepared four to five hundred images of traffic signs, including No Parking, No Honking, and Speed Limit 80, all collected from real road environments. This dataset is available for download on our GitHub repository and tutorial website.

02. Annotation Target

Upload approximately 100 images for each category; after uploading the images, proceed with image annotation to mark both the positions and categories of the objects to be identified.

交通标志识别教程-上传图片
交通标志识别教程-标记物体

03. Train the Model

Configure the training parameters, change the resolution to 128×128, and select all default parameter settings; then click Save.

交通标志识别教程-训练模型1.

Generate features, with three colors representing three distinct markers.

交通标志识别教程-训练模型2

Configure the target detection training parameters. The default number of training epochs is 60, the learning rate is 0.001, and the validation set ratio is 20%. Enable data augmentation. For transfer learning, select either the default MobileNetV2 0.35 or MobileNetV2 0.1. (Note: SSD cannot be used, as it is not supported on OpenMV.)

Select Start Training. Upon completion of training, the neural network model achieves an F1 Score of 91.2%, and we can save the current version.

交通标志识别教程-训练模型3

Select storage, enter your description, and click Save.

交通标志识别教程-训练模型4

04. Deploy the model

Export the trained model file. Only the library needs to be exported; select OpenMV and click Build to begin deploying and exporting the model.

交通标志识别教程-部署模型1

It will automatically download the exported model, which in this case is the model trained on our 300 images, thus completing the entire training process.

交通标志识别教程-部署模型2

05. Run the Model

Running the model on OpenMV:

Connect the OpenMV Plus, save the three trained files to the OpenMV’s built-in USB drive, and open the ei_object_detection.py file in the OpenMV IDE. Click Run, and the execution results will be displayed in the serial terminal.

交通标志识别教程-运行模型1
交通标志识别教程-运行模型2

This feature is also compatible with the OpenMV4. As the OpenMV4 lacks external SDRAM and has less memory, we can reduce the model size to enable its operation on the OpenMV4.

There are two methods to reduce the model size:

I. Reduce the training resolution from 128×128 to 96×96.

II. Modify the transfer learning model used, changing MobileNetV2 0.35 to MobileNetV2 0.1.

Finally, place the trained new file into the OpenMV4 and run it.

The above is our target point detection tutorial. We look forward to your results!

# Intelligent Transportation

Related articles

机房/配电房/单元门敞开识别

AI Sentinel Based on OpenMV: Automatic Alert for Unsecured Key Locations

Automatically detects whether the doors of key locations remain open for an extended period and issues timely alerts.

越界识别

Personnel crossing boundary triggers an alarm; OpenMV interprets the “sense of security boundary”

Detects personnel or equipment crossing virtual perimeter lines.

占道经营识别

“AI Urban Management Officer” is here: an automatic encroachment operation identification system built on OpenMV

Automatically identifies illegal street vending activities to support daily urban governance.

煤气罐违规摆放识别

Improper placement of gas cylinders? Use OpenMV to automatically trigger hazard alerts

Automatically identifies unauthorized placements of gas cylinders to proactively detect potential gas safety hazards.

绝缘手套佩戴识别

Did you perform live-line work without wearing insulating gloves? OpenMV issues an immediate alert!

Automatically identifies whether personnel are wearing insulating gloves to assist in safe operations.

铝板缺陷识别

Utilize the OpenMV smart camera to perform real-time detection of surface defects on aluminum plates

Online identification of surface defects on aluminum plates, such as scratches and dents, to support quality control.

Popular categories

Language and Region
Copyright © 2025 星瞳科技SingTown
粤ICP备17045162号