# Opportunities for Machine Learning in District Heating
## 4 Machine Learning Applied to District Heating
### Review of Recent Research Articles  
Among the papers we have reviewed, the vast majority focused on forecasting energy demand. More specifically, among the 179 articles we studied, 137 addressed a concrete DH challenge, most commonly proposing new ML solutions (the rest consisted primarily of surveys and position papers, or papers outside the scope of this discussion). A stunning 98 of them considered forecasting to be this challenge, making it 72% of the field. The second most popular category was anomaly detection, with only 9 papers. In the spirit of focusing on gaps rather than the obvious, we will not discuss forecasting further here, especially given that--as indicated above--several reviews of DH forecasting have already been published. Instead, we will focus on more unique papers addressing the less popular areas, since we believe they deserve increased visibility. Thus, Figure 4 offers a clearer picture that would have been difficult to observe if forecasting studies were included. In Figure 4, the studies have been categorised according to the DH value chain, with the size of each bubble suggesting the extent to which the problem has been addressed for the given category. The second most popular emerging research topic in DH is anomaly and fault detection. Many of the studies, as shown in Figure 4, utilise primary-side billing data from substations. Different from other tasks, methods for anomaly detection show significant variability depending on the specific cases that they are applied to [27]. While some methods are developed in unsupervised fashion, there are also techniques using supervised Machine Learning that require ground-truth knowledge of the faults. Evaluation of different methods also vary based on their characteristics and the nature of the datasets used. Leakage detection can be seen as a specific case of anomaly detection which aims to detect water leakages in DH pipes. The majority of the works addressing this task try to locate leakage faults using infrared images of the areas where the underground pipes are located. These approaches mainly use supervised ML methods trained with these images to classify leakages. For example, ref. [31] applies and compares traditional ML algorithms such as LR, RF and SVM and a deep learning-based CNN model to automatically classify leakage faults on infrared images, captured by an Unmanned Aerial Vehicle (UAV). Similarly, [32] uses RF and [33] uses different linear and non-linear classifiers such as Linear Discriminant Analysis (LDA), linear SVM, RF and AdaBoost. Different from other methods, the work in [34] uses the measurements from flow meters and pressure sensors instead of images to detect leakages. They implement a hydraulic simulation model to simulate all possible leakage faults in DH networks, and train an XGBoost classifier with data including flow and pressure readings and simulated faults. Having in-depth knowledge of the customers and a better understanding of their heat use is important for effective district heating operation and management. Especially for the consumption side, analysing how customers consume heat helps to implement new control strategies, personalise demand management for specific customer groups and empower consumers to optimise their behaviours. However, properly segmenting customer groups and discovering their typical and atypical consumption patterns is a complex task, especially for DH systems involving many customers with different characteristics. Therefore, data-driven methods using different Machine Learning techniques to automatically cluster various customers and their consumption behaviours attracted many efforts recently. [PERSON] et al. [35] proposed an approach to automatically cluster customers and extract heat load patterns. They have represented each customer's consumption behaviour as a weekly aggregation over four different seasons and used k-shape clustering to cluster these weekly consumption profiles.