Stratio-AI Cortex: a self-supervised deep learning framework for anomaly detection in time-series
By: Miguel Simao
Tags: Deep Learning, Vehicle Maintenance, Data Science, Predictive Maintenance, Fleet Management

Use-case: detecting anomalies in a vehicle’s cooling system

An internal combustion engine produces heat when it is running and must be continuously thermally controlled in order to prevent damage to its components and maintain peak efficiency. The temperature is typically controlled by balancing the internal heat generation with the heat dissipation capability provided by a cooling system. Additionally, the engine efficiency is lower when it is cold, so there is an ideal working temperature range: between 85 and 95 degrees Celsius. As shown in the diagram below, a vehicle has an initial period where it heats up until the working range and then stabilizes at around that temperature.

Typical coolant temperature profile of a vehicle in operation.

There are a number of components involved in keeping the engine at its working temperature. A water-cooled engine block and cylinder head have interconnected coolant channels running through them. A pump, driven by the engine, pulls hot coolant from the engine and pushes it through a radiator, which dissipates heat to the atmosphere. Additionally, a fan forces air through the radiator in order to improve cooling efficiency at low speeds. The coolant flow is also regulated by a mechanical thermostat. A failure in any of these components is very likely to result in engine overheating and a forced stop.

Diagram of a vehicle’s cooling system, showing all its components, taken from here.

So, how can we find anomalies in the components of the cooling system, from readings of the coolant temperature?

While it is trivial to find temperature anomalies — when the system is operating outside of the working specifications –, finding faults in individual components that do not have direct sensing is a significantly harder problem. Our hypothesis is that some anomalies can be found in the dynamics of the temperature signal.

We do not want to follow a model-based approach to solve this problem since we would have to make one for each variation of the system’s parts, which is unfeasible. So, we opt by following data-based approaches through a deep learning model. We are able to model the dynamic behavior of the coolant temperature and find relationships with usage metrics using Cortex’s self-supervised deep neural network.

Anomaly detection model

In this case, we are modeling the temperature signal as a function of itself and usage variables, such as engine load. This is generally represented in the diagram below.

We query our data lake for data from a subset of our fleet that should represent the normal behaviour and train the model with it. Given that it is a regression model, we can train it with a loss function such as the mean squared error. During training, the model learns the expected temperature behaviour in the dataset. The plot below shows the predicted temperature signal in red and the measured temperature in blue. The second plot shows the temperature residual, i.e., the difference between the predicted and measured temperatures. The sample shows that the model captures the temperature dynamic behaviour with significant detail, as intended.

On the first plot, the measured and predicted temperature signals in blue and red, respectively. On the second plot, the difference between them.

Now that we have seen that the model can learn the normal dynamic behavior of a cooling system, we can use the prediction residual for anomaly detection. For each vehicle, there is a residual time series, which is used to find anomalous situations in the vehicle. An example is shown in the figure below over a two-year timespan, we get a residual signal like the one shown in the figure below.

Residual signal plotted in blue; anomaly threshold in yellow; ground-truth and predicted anomalies in green and red, respectively.

In this figure, the blue line represents the prediction residual series, the yellow line the anomaly threshold, the red regions the anomaly intervals and the green regions the manually annotated anomalies. The annotated anomalies are typically overheating events but some are also component failures (e.g., water pumps). For our purposes, we consider this example to have perfect recall but 50% precision. These cases are reviewed by our analysts in order to improve the precision of our predictions. In this specific use-case, Cortex reduced the development time by 80% when compared to the empirical model we have in production, while improving its precision by about 10% in the same validation dataset.

This use-case showcases how we can quickly train and deploy new anomaly detection models without specifying features (apart from cleaning and scaling the signals), taking advantage of the large amounts of unlabeled data we can access. These models also have the advantage that they can be retrained in production for new vehicles without new labels.