Edge Impulse logo
Blog Post

Crate Expectations: Don’t Guess When It Comes to Inventory

Computer Vision, TinyML, Machine LearningThis system uses an Arduino Nicla Vision to identify containers with ML, and send a count of the detected objects to a cloud dashboard.

Nick Bild

April 11, 2023

    Warehouse inventory management is a critical aspect of supply chain management that has significant impacts on a company's overall performance. Keeping an accurate inventory is vital to avoid stock shortages, minimize overstocking, and streamline the order fulfillment process.  Inaccuracies can result in significant losses, increased costs, and unhappy customers.

    Problems with inventory management can have significant financial implications for businesses. According to a study by the National Retail Federation, the retail industry loses $45 billion annually due to inventory inaccuracies. Additionally, research by the Aberdeen Group found that companies with good inventory management practices are 20% more likely to have better supply chain visibility and 14% more likely to have lower carrying costs.

    To take advantage of these benefits, a number of methods are used to maintain inventory in warehouses. One of the most common methods is cycle counting, which involves counting a small portion of the inventory regularly to provide an ongoing measure of inventory accuracy. Another method leverages the use of radio frequency identification (RFID) technology, which involves tagging inventory with RFID tags that can be scanned relatively quickly. Additionally, some warehouses use barcode technology to track inventory. These methods, combined with robust inventory management software, can help ensure good inventory management practices.

    Arduino Nicla Vision

    All of these counting methods require significant manual intervention to implement, however. And where manual interventions are needed, costs increase, as does the time required to perform the count.  Moreover, the possibility of inaccuracies is introduced with each and every manual step in the process.

    Proving that developing a more efficient and accurate method of tracking warehouse inventory is possible, the engineers at Zalmotek created a proof of concept device that automates the entire process on a very small budget. At a high level, their idea involved using computer vision and machine learning to recognize and count different types of containers. Edge Impulse Studio was utilized to develop the machine learning algorithm, and optimize it to run on a tiny, inexpensive hardware platform.

    Zalmotek wanted to make sure that it would not take a lot of technical expertise to get their system off the ground, so they chose to work with the Arduino Nicla Vision development board. The Nicla Vision comes standard with a powerful STM32H747AII6 Dual Arm Cortex-M7/M4 CPU and a megabyte of memory, so all the computing power that one needs for a computer vision application such as this one is already contained within the confines of the 22.86 x 22.86 mm board. It also has a two megapixel color camera onboard to capture high-quality imagery. And with wireless connectivity available, it would be a snap to report inventory counts to a central database for further analysis.​​

    Collecting sample data to train the object detection model

    When it comes to counting items, object detection algorithms are well-suited to the task.  And Edge Impulse’s ground-breaking FOMO object detection algorithm is especially well-suited to counting items with a high degree of accuracy on small, resource-constrained hardware platforms. So for Zalmotek, FOMO was the best choice for their application.  But before they could build the model, they needed to collect some data to train it.

    To prove the concept, two types of miniature, plastic containers were arranged in varying patterns and under differing conditions to assist the model in generalizing to recognize the containers under any circumstances. A small dataset of 81 images of this setup was collected using the Arduino Nicla Vision and the OpenMV IDE. A new project was created in Edge Impulse Studio, then these images were uploaded using the data acquisition tool.

    AI-assisted object labeling

    A bit more metadata was still needed before wrapping up the data collection phase of the project. Object detection models need to know exactly where in each image the objects of interest are. This information needs to be supplied by drawing bounding boxes around the objects in each image, which can be done using the labeling queue tool. Fortunately, this tool provides AI-powered label positioning suggestions to help with the task, so one only needs to review the suggestions and occasionally make a slight adjustment. This can save a lot of time, especially for larger datasets!

    The most important, and arguably the easiest, part of the project is the creation of the impulse, which defines the processing of the data all the way from raw sensor measurements to predictions. And with the data all squared away, Zalmotek was ready to define their project’s impulse. Using Edge Impulse Studio’s web interface (as opposed to the recently announced Python SDK for power users), preprocessing steps were added to resize the images and extract the most informative features. These features were then forwarded into a FOMO object model designed to recognize two types of containers.

    Next, the model’s hyperparameters were adjusted to optimize the learning rate for the type of data involved in this project. The other hyperparameters were left unchanged, and the training process was initiated.  After a short time, the training had finished and metrics were displayed to help assess how well the model was performing. An accuracy score of 100% was reported, which can be a sign of overfitting, but since the more stringent model testing tool backed up this initial result, it looked like the object detection pipeline was working great.

    The finalized impulse design to define data processing

    The only thing left to do at this point was deploy the model to the Arduino Nicla Vision board. This hardware is fully supported by Edge Impulse, so there were many options available to achieve this objective. Since Zalmotek was using the OpenMV IDE for their work, they chose to deploy the entire machine learning analysis pipeline as OpenMV firmware. Using the deployment tool, a downloadable package was created that could be flashed to the Arduino using the OpenMV IDE.

    To demonstrate how the Nicla Vision can transmit its predictions to a centralized web dashboard, Zalmotek set up Adafruit IO to receive container counts as they are collected.  This could easily be extended to provide more insights for managers overseeing warehouse operations.

    Container counter in action

    Zalmotek’s inventory counter is a great example of how Edge Impulse is democratizing machine learning. Within a few hours, anyone could build this inventory counting system with about $100 of hardware. No special technical knowledge is required. Browsing through the project documentation and cloning the public Edge Impulse Studio project first will get you up and running even faster.

    Want to see Edge Impulse in action? Schedule a demo today.


    Are you interested in bringing machine learning intelligence to your devices? We're happy to help.

    Subscribe to our newsletter