element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • More
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • More
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • More
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • More
  • Store
    Store
    • Visit Your Store
    • Choose Another Store
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
Low Power IoT Design Challenge
  • Challenges & Projects
  • Design Challenges
  • Low Power IoT Design Challenge
  • More
  • Cancel
Low Power IoT Design Challenge
Blog Non-Intrusive Load Monitoring #5 - Preparing Dataset & Training Model
  • Blog
  • Forum
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Blog Post Actions
  • Subscribe by email
  • More
  • Cancel
  • Share
  • Subscribe by email
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: taifur
  • Date Created: 17 Oct 2021 1:31 PM Date Created
  • Views 175 views
  • Likes 0 likes
  • Comments 2 comments
  • load monitroing
  • machine learning
  • sensiml
  • iot
Related
Recommended

Non-Intrusive Load Monitoring #5 - Preparing Dataset & Training Model

taifur
taifur
17 Oct 2021

Preparing Dataset

In the last blog, I developed a device firmware to provide sensor data to SensiML Data Capture Lab using UART. In this step, we will prepare our dataset using DCL for developing a machine learning model. Before going to DCL we need to connect sensors with the PSoC 6 Kit. Then we will run DCL  and record the sensor data. We will connect and run different household appliances and record the data for every appliance.

 

 

The above image shows the connection of sensors with the PSoC 6 board. I added a multiport socket with the sensors so that I can easily connect and disconnect different devices. A connected hairdryer is shown in the following image.

 

 

 

For capturing the data we need to run the DCL. After running it we need to import the device plugin.

 

 

Then we will choose Simple Streaming Interface.

 

 

We need to go to capture mode, create a sensor configuration to connect the device. For details of configuring DCL read the documentation: https://sensiml.com/documentation/guides/getting-started/index.html

 

 

When sensor configuration is ready we need to connect by connecting the connect button. I have recorded data for five different devices like an electric beater, hair-dryer, heater, iron and LED light.

 

 

The voltage and current waveform for a resistive load is found as follows.

 

 

Training Model using Analytics Studio

The Analytics Studio is an application that filters and optimizes your labeled sensor data through machine learning algorithms. It generates a model (SensiML Knowledge Pack) ready to be flashed into the firmware of your device of choice. The most powerful part of the Knowledge Pack is that it will be detecting events on the low memory sensor without ever requiring a connection to the cloud. The Analytics Studio uses AutoML to abstract the complexities of machine learning algorithms and translates them to a user-friendly interface. To build the model:

 

Open the Analytics Studio by going to https://app.sensiml.cloud/ and log in to your account. You will be taken to the Home page where you can see the projects uploaded to your account from the Data Capture Lab. (DCL project automatically uploaded to the SensiMl Cloud)

 

 

Open your project by clicking the Open Project icon or double-clicking on the project name

 

 

The project summary page gives you an overview of your project. You can edit the image and project description to provide more context about each project you work on.

 

 

Each tab also provides more information about the Captures, Queries, Pipelines, and Knowledge Packs in your project.  To know the details about building a project in SensiML please visit: https://sensiml.com/documentation/guides/getting-started/building-a-model.html . I will show here the result of the model I have built for five devices. 

 

 

In the Explore Model tab, you can get more information about the models that were generated from the Build Model tab. The Model Visualization tab provides feature visualization as a 2-D comparison plot and a density plot.

 

 

The Confusion Matrix tab shows the averaged confusion matrix for the validation data. The confusion matrix describes how well the model performed at recognizing each class. It also provides information about how the model misclassifies classes. The confusion matrix for models generated by SensiML’s AutoML pipeline is created by averaging across the results of the validation data sets for each fold.

 

 

 

The Feature Summary tab shows which feature extractors and sensors were used to feed into the model. The Feature Summary tab contains information about the features that are used during the feature extraction step of the Knowledge Pack. This was a simple example project and only needed two feature extractors to generate a high accuracy model. You can see the Category of the feature generator in the first column, which describes the family type to which a feature generator belongs. The Generator column has the name of the feature extractor, which can be used to reference the feature generator when building custom pipelines. The Sensors column describes the sensors that were used as input into this feature extractor.

 

 

 

 

Model pipelines consist of data input, signal conditioning, signal preprocessing, feature extraction, sampling, and model training. The Pipeline Summary provides the graphical representation of the pipeline steps used to create this model.

 

 

 

Knowledge Packs consist of data input, signal conditioning, signal preprocessing, feature extraction, and classification. The Knowledge Pack Summary provides the graphical representation of the steps that will be part of the Knowledge Pack.

 

 

 

Generating a Knowledge Pack

In the Download Model tab, we are going to generate a SensiML Knowledge Pack. A Knowledge Pack takes the event detection model you generated in the pipeline and transforms it into a binary or library file that can be run on your hardware device at the edge. Once the Knowledge Pack is on your hardware device, it starts outputting classification IDs that correspond to your events of interest. We are going to build a Knowledge Pack Library for the M4 microcontroller for PSoC 6 Kit.

 

First, we need to select a model we want to use from the list. Next, we are going to select our target hardware that we will want to flash our Knowledge Pack to. Let’s look at a screenshot and dive a little deeper.

 

 

Then click Download to build your Knowledge Pack and download it to your computer. In the next blog, we will use this knowledge pack to develop our device firmware.

Anonymous
Parents
  • asokfair
    asokfair 6 months ago

    Its a same version of this https://www.hackster.io/taifur/non-intrusive-load-monitoring-using-sensiml-quickfeather-e489cf  ?

    • Cancel
    • Up 0 Down
    • Reply
    • More
    • Cancel
Comment
  • asokfair
    asokfair 6 months ago

    Its a same version of this https://www.hackster.io/taifur/non-intrusive-load-monitoring-using-sensiml-quickfeather-e489cf  ?

    • Cancel
    • Up 0 Down
    • Reply
    • More
    • Cancel
Children
  • taifur
    taifur 6 months ago in reply to asokfair

    Yes, you are right. That is also my project. Here, I am trying to implement this using PSoC 6 MCU.

    • Cancel
    • Up 0 Down
    • Reply
    • More
    • Cancel
Element14

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2022 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • Facebook
  • Twitter
  • linkedin
  • YouTube