# Real-Time Anomaly Detection in Cold Chain Transportation Using IoT Technology
## 4 Results
### Anomaly Alerting  
After 179 days of continuous operation, the three IoT loggers had cumulatively recorded 49,839 datapoints monitoring the chill and freeze zone conditions of the last mile delivery vans operated by the grocery distributor. The distributor operated a multi-drop delivery from the vans, and the average duration of each delivery was 16.2 min. To effectively deploy an alerting system that notified the company of refrigeration anomalies in the delivery vehicles, it was necessary to evaluate the cool-down period of the refrigerators, i.e., the amount of time that it took for the vans to reach the desired temperature. The reason for this was to avoid alerting during periods where no anomaly or malfunctioning was occurring, and the refrigeration units were merely cooling from ambient temperature to chill/freezing temperatures. Using the data recorded by the grocery distributor during deliveries, a preliminary analysis was carried out to estimate the cool-down period length of the delivery vans. The desired temperatures the vans were to operate at were 5 \({}^{\circ}\)C in the fridge compartment and \(-18\) \({}^{\circ}\)C in the freezer compartment. Analysis from the recorded data showed that it took approximately 35 min for the vans to appropriately cool down (Figure 5); thus, alerts should be configured in such a way that they were only sent after this initial period had passed. To do so, an alerting algorithm was implemented that only triggered the alerting system after 35 min. Figure 4: Anomaly alerting system. To avoid false alerts being sent while the vehicle was stationary, the trip variable reported by the trip detection algorithm presented by Algorithm 1 in Section 3.2.3 was used for the alerting algorithm. Given the trip status and the desired temperature thresholds, the alerting algorithm was designed as follows. Each time the logger produces a recording, the temperature readings and trip information are passed to the alerting algorithm. The cool-down period and temperature thresholds of the fridge and freezer are configurable by the user. In this case, 35 min has been chosen as the cool-down period, \(-18\)\({}^{\circ}\)C has been chosen for the freezer threshold, and \(5\)\({}^{\circ}\)C has been chosen for the fridge threshold. Given the user-specified cool-down period and frequency of sensor recordings, the total number of repeated true trip parameter recordings required is calculated. The algorithm then checks to see if the vehicle has been in motion for the specified number of recurring recordings. Only if the vehicle has been in motion constantly during the recurring recording period does the algorithm progress to the next stage: threshold checking. If at any point the vehicle stops moving and the trip parameter becomes false, the counter is reset and a further recurring recording period (in this case 35 min) will have to elapse before the algorithm progresses to threshold checking. At the threshold checking stage, anomalies in the sensor equipment are accounted for by ensuring two repeat values abusing the user-specified temperature threshold are recorded. If the temperature threshold is broached twice in a row, an alert is sent. The algorithm behaves the same way for both the chill and freeze temperatures. Note that the cool-down period can be specified for each of the zones, meaning the user can define a longer cool-down period before alerting begins for the freezer and a shorter cool-down period before the alerting algorithm is triggered for the fridge zone. Examining the data presented in Figure 5, it is probable that the grocery distributor would want to avail of this functionality. Notice that while the freezer takes 35 min to reach the appropriate  
Figure 5: An example of fridge and freezer cooldown periods. chilled temperature, the fridge has reached the desired temperature within 5 min. Given that perishment occurs more quickly transporting refrigerated goods rather than frozen goods, more timely alerts for this area of the van are desirable.