In a previous post, I discussed the importance of anomaly detection. Anomaly detection is a quick way to make sense of data and identify anomalies without having a historical data set or a well understood use case. I also mentioned the possibility of building rules on top of anomaly detection. In this blog post, I will demonstrate anomaly detection in action using Bsquare’s anomaly detection framework and data from an HVAC system.  

Bsquare’s Anomaly Detection Framework 

After extensive research on anomaly detection in Industrial IoT applications, Bsquare built an anomaly detection framework to accommodate different use cases within the IIoT space. This framework includes configuration given a specific use case, interactive plots for testing purposes, and a detector recommender. 

Data Introduction 

Thanks to the Fraunhofer Center for Sustainable Energy Systems and NOAA, I obtained a data set describing the HVAC system of an apartment building and the outdoor weather. Apartment data was collected in 10-minute intervals for 3 winter months for 79 apartment units. The data sets include apartment information (apartment number, floor, thermostat type), when the HVAC turns on and off, and indoor and outdoor temperature and relative humidity. 

This data set demonstrates starting with a baseline data set without labeled anomalies. While normal operating parameters for winter could be determined, anomaly detection is a great place to begin taking actions based on anomalous behavior. 

Anomaly Detection 

Using Bsquare’s anomaly detection accelerator framework, I built an anomaly detector given some configuration parameters. Parameters considered include: 

  1. With what frequency are anomalies expected? For example, does this equipment break down on a monthly basis or every 5 years? Depending on this domain knowledge, I can adjust the sensitivity of the anomaly detector. 
  2. How important is real-time anomaly detection? If a few seconds or minutes can be spared, the anomaly detector framework will choose a more time intensive anomaly detector that tends to be more accurate. 
  3. Balancing true positives and false positives? How much are you willing to sacrifice false positives for the sake of catching all true positives? For example, it may be acceptable to have some false positives if a repair is cheap. However, if a repair is expensive, false positives should be avoided. 

Figure 1 demonstrates an example of detected anomalies for the outdoor temperature, the apartment’s HVAC on duration, and the apartment temperature. The green box demonstrates how detected anomalies may indicate that no action should be taken. We see the outdoor temperature is higher than usual and the HVAC works overtime. However, there is no change in apartment temperature. This is good news – the HVAC system is working as expected! Now let’s look at the orange box. The outdoor temperature is lower than usual, but the HVAC is not compensating. The apartment temperature also drops! Based on this information, we could write a rule: 

If an anomaly is detected in ambient temperature without an anomaly detected in the HVAC duration time, then alert the building manager or resident to check the thermostat and/or check the HVAC system. 

This rule would help prevent these colder temperatures in the apartment. 

Figure 1: Detected anomalies for an apartment's HVAC system.

Figure 1: Detected anomalies for an apartment’s HVAC system.

Adding Rules 

It would be tedious to account for all possible anomaly combinations and create all rules by hand. That is where the Bsquare Anomaly Detection Framework comes into play. The framework looks for common groupings of anomalies in a specific time period. These groupings of anomalies become the “if statement” of our rules. The “then…” portion is determined by the subject matter experts and Bsquare Data Science Team. This rule generator is demonstrated with the HVAC system data in Figure 2. Now, these rules can be put in production along with the anomaly detector. Alerts can then be sent via text, email, etc. This powerful tool allows us to put data into action!

Figure 2: Table demonstrating rules for apartment building's HVAC system.

Figure 2: Table demonstrating rules for apartment building’s HVAC system.

Conclusion and Next Steps 

I hope this HVAC system example has given you some ideas on how to apply anomaly detection with rules to your own data. The Bsquare Data Science Consulting team has built data science accelerators (including the anomaly detection accelerator framework) to help realize a customer’s ROI faster than our competition. Find out how Bsquare can help harness the full potential of your data to optimize your ROI. 

Share this article: