Edge Impulse logo
Blog Post

Is Your Refrigerator Running?

Machine Learning, TinyML, Embedded DevicesSwapnil Verma's solution uses an ML model to identify a failure as soon as possible using the temperature and humidity changes inside of a refrigerator.

Nick Bild

July 5, 2022

    Is your refrigerator running? If you answer in the affirmative, you are probably then expecting me to tell you to go catch it, but oh no, not here at Edge Impulse. We do not take such important matters so lightly. We would be more likely to ask you if you have good reason to expect that it will still be running tomorrow. And we would certainly like to see the data supporting your assertion. My goodness you have no data on your refrigerator’s operations in this day and age? Well, let us show you how you can get started for free. Why yes, we are actually available for children’s birthday parties.

    In all seriousness though, refrigerators do serve important roles in our lives — keeping our food preserved, and also ensuring that certain types of medications maintain peak effectiveness. So it does make sense that we would want to keep them working, and be made aware of potential problems before they occur. Knowing that a refrigerator is about to malfunction could save us from wasting large amounts of food or spoiling medications. Engineer Swapnil Verma has an interest in this problem and after some thought, he created a plan to predict future refrigerator issues. With this information in hand, it would be possible to perform maintenance before a failure ever had a chance to happen.

    Making the most of hardware on hand

    Verma’s idea was to use a small microcontroller with sensors to collect temperature and humidity measurements from inside the refrigerator. By analyzing those metrics with a machine learning algorithm, it should then be possible to identify any abnormal operations that would be indicative of a failure, like a compressor that has gone on the fritz, or a dirty coil. To remove the complexity and development time associated with building the machine learning pipeline, Verma chose to use the Edge Impulse platform.

    Making the most of the parts he already had on hand, he selected an Arduino Nano 33 BLE Sense development board to handle running the machine learning algorithms. This board also has temperature and humidity sensors available, rounding out most of the hardware requirements. But to collect large amounts of data, the device would also need an SD card reader. For this, an Arduino Portenta H7 was chosen along with a Portenta Vision Shield, which has an SD card reader. The main device would communicate with this second board wirelessly via Bluetooth Low Energy to permanently store sensor data. It is a bit convoluted, as Verma freely admits, but sometimes the best solution is the one that you have all of the parts on hand for.

    The Nano 33 BLE Sense-based device

    Before building the machine learning model, a training dataset needed to be collected. This was accomplished by placing the device inside a refrigerator, then kicking back for a few hours while it wrote sensor readings to the SD card. Verma did not have a faulty refrigerator available, so he simulated a fault by leaving the door open and collecting data. This simulates a fault state in which the compressor is being overworked and appearing to operate abnormally. After collecting about eight hours of data, it was uploaded to Edge Impulse Studio.

    Exploring the training data

    The data visualization tools were used to assess the training data, and Verma could see that there appeared to be good separation between the classes, indicating that the sensors chosen were appropriate for detecting misbehaving refrigerators. Since the primary goal is to recognize when a refrigerator is in any abnormal state, Verma decided that the best course of action was to construct a K-means anomaly detection pipeline. The data analysis pipeline was completely constructed with just a few clicks.

    The model was then trained using the previously uploaded dataset. After the training process completed, the model testing tool was used to validate performance. Overall, the model was found to predict operational state with excellent accuracy, with just a small number of examples giving incorrect predictions. Supplying a bit more training data would be likely to clear up those relatively few incorrect predictions.

    Constructing the machine learning model

    Just like that, Verma’s creation was complete.  All that remained was to deploy the model to the Nano 33 BLE Sense board. Since this board is fully supported by Edge Impulse, the deployment tool can prepare a custom firmware image that contains the full machine learning pipeline in it, all ready to go. After downloading and flashing that image to the Arduino, the device was ready to go in the refrigerator.

    Classification result

    If you have some development kits laying around unused at the moment, take a look at the project documentation to see how you can put them to good use. As Verma showed us, just about any hardware that you happen to have on hand should do the trick.


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

    Subscribe

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

    Subscribe to our newsletter