1. Introduction
The growing global demand for energy, together with the push toward carbon-neutral targets, has made energy efficiency a major priority in buildings and industrial facilities. Since residential and commercial buildings account for a large share of overall energy use, understanding appliance-level consumption has become increasingly important for improving efficiency and reducing waste. In this context, Non-Intrusive Load Monitoring (NILM), first introduced by Hart [
1], has emerged as a practical and cost-effective approach. By using data from a single smart meter, NILM estimates the energy consumption and operating states of individual appliances without requiring separate sensors for each device.
Early NILM studies mainly relied on statistical and conventional machine learning methods such as Hidden Markov Models (HMMs) and combinatorial optimization [
1,
2]. Over time, however, advances in computing power have shifted attention toward Deep Learning (DL)-based approaches. Convolutional Neural Networks (CNNs) [
3] have proven effective in capturing local transient characteristics in power signals, including sudden spikes and ON/OFF events. Similarly, sequence-based models such as Long Short-Term Memory (LSTM) and Gated Recurrent Unit (GRU) networks have been widely used to model temporal dependencies in appliance behavior. Despite these strengths, each approach has its own limitations [
4]. CNNs are generally effective at local pattern extraction, but they are less capable of learning long-range temporal relationships. Recurrent models, on the other hand, may suffer from vanishing gradients and overfitting when handling long input sequences. More recently, Transformer architectures and self-attention mechanisms, which have shown remarkable success in Natural Language Processing (NLP), have attracted increasing interest in NILM research because of their ability to highlight the most informative parts of a sequence [
5,
6].
A key challenge in NILM today is not only identifying appliances accurately, but also detecting anomalies in the power signal, such as spikes, drops, and noise, especially in complex and noisy settings where several devices operate simultaneously. In many existing studies, appliance recognition and anomaly detection are treated as separate problems. This separation can increase computational cost and reduce the suitability of these methods for real-time applications [
7,
8].
To address this gap, this study proposes a multi-task triple-hybrid deep learning architecture that performs appliance classification and anomaly detection within a unified framework. The proposed model combines CNN, BiLSTM, and Transformer Attention modules in a sequential manner. In this structure, 1D-CNN layers extract short-term local patterns from raw power signals, the BiLSTM layer captures temporal dependencies in both forward and backward directions, and the Transformer encoder emphasizes the most informative feature representations through multi-head attention. Supported by a dual-output design, denoted as app_out and anom_out, the model can classify target appliances accurately while also detecting anomalies that affect signal quality.
2. Related Works
Over the last few years, deep learning has clearly changed the direction of NILM research and has led to better performance than many traditional methods. Existing studies show that this progress has come from several lines of work, including convolution-based models, recurrent networks, attention mechanisms, and multi-task learning frameworks.
Deep Learning and Hybrid Architectures: Among the early studies that shaped this area, Kelly and Knottenbelt [
9] showed that deep learning could be applied effectively to NILM through Denoising Autoencoders (DAEs) and convolutional networks. Their work opened the way for later architectures designed specifically for load disaggregation. One of the best-known examples is the Sequence-to-Point (Seq2Point) model introduced by Zhang et al., which estimates the midpoint of an input sequence and later became one of the most widely used approaches in NILM. As the field progressed, researchers increasingly started to combine different architectures instead of relying on a single model type. For example, Huzzat et al. [
10] proposed a GRU-BERT hybrid model, where Bi-GRU layers were used to learn temporal load behavior and the BERT component helped capture wider contextual information. He et al. [
11] followed a similar idea by integrating Transformer and CNN modules in a sequence-to-sequence framework for noisy industrial settings such as cement factories. In another study, Ouzine et al. [
12] introduced the Parallel Hybrid PHCNN-GRU model to strengthen feature extraction and improve multi-target regression forecasting.
Multi-Task Learning: Multi-task learning has become an important direction in NILM because it allows a model to learn more than one related objective from the same dataset, often improving generalization performance. Shin et al. [
13] introduced the Subtask Gated Networks architecture, which jointly performs energy disaggregation and load on/off state detection. Similarly, Çimen et al. [
14] applied a multi-task GRU (M-GRU) framework to microgrid energy management and showed that learning appliance consumption and load states together produced better results than single-task models. Dash and Sahoo [
15] extended this idea by proposing a Transformer-based, attention-driven, multi-task probabilistic network that simultaneously handles appliance state detection and energy disaggregation.
Anomaly Detection and Comprehensive Feature Extraction: Another important issue in NILM is the detection of noise, abnormal patterns, and appliance malfunctions, since such disturbances can directly affect model reliability. De Diego-Otón et al. [
16] used MobileNet-based convolutional feature extractors for appliance classification and for detecting unidentified appliances or anomalous patterns in limited-data settings. Saha et al. [
17] proposed a Capsule Network framework that simultaneously identifies appliance type and activity state by taking advantage of stronger feature representation capabilities. Hu et al. [
18] introduced a Multi-Scale Multi-Label Classification Model (MMCM) to identify multiple appliance load states simultaneously.
The model proposed in this study is designed to overcome key limitations of existing hybrid and multi-task approaches in the NILM literature. Recent works, such as the GRU-BERT model of Huzzat et al. [
10] and the Tra-CNN framework proposed by Cheng and Zhong [
19], have shown that combining different neural network components can improve load identification performance. Nevertheless, these studies generally integrate only two major architectural components. In contrast, the proposed framework introduces a more comprehensive triple-hybrid architecture that combines 1D-CNN layers for extracting local transient patterns, a BiLSTM layer for learning bidirectional temporal dependencies, and Transformer Attention modules for enhancing feature representation through global contextual modeling. In addition, the proposed model extends beyond conventional appliance recognition by jointly performing appliance classification and anomaly detection for spike, drop, and noise patterns. While hybrid configurations combining convolutional layers and attention mechanisms have been successfully deployed in other domains, their application in NILM has predominantly been restricted to dual-component setups (e.g., CNN-Transformer or GRU-BERT) focusing solely on load disaggregation. The architecture proposed in this study represents a multi-task triple-hybrid framework specifically engineered to capture low-level micro-transients via 1D-CNN, recursive sequential evolution via BiLSTM, and global contextual attention via a Transformer block simultaneously for both appliance classification and multi-class anomaly identification. This unified design distinguishes the proposed approach from many existing NILM methods and enhances its practical relevance for real-world smart energy monitoring applications.
4. Materials and Methods
4.1. Dataset and Data Preprocessing
This study is based on the UK Domestic Appliance-Level Electricity (UK-DALE) dataset [
27], which is widely used in Non-Intrusive Load Monitoring (NILM) research. The dataset contains high-resolution electricity measurements collected from residential buildings in the United Kingdom and has become a common reference point for evaluating appliance identification and load disaggregation methods.
For the present analysis, data from Building 1 were used. Four household appliances were selected: kettle, microwave, washer dryer and fridge freezer. These appliances were included because they show clearly different operating behaviors and are frequently examined in NILM studies. Their power consumption signals were obtained through the NILM Toolkit (NILMTK, Version 0.4.0) using Python 3.12.13, with a sampling interval of 6 s, so that all measurements were handled at the same temporal resolution.
Figure 1 shows the characteristic power consumption patterns of the selected appliances. The figure makes it clear that each appliance produces a different signal shape over time. Kettles and microwaves, for example, tend to generate short but sharp peaks because of their high power demand. Washer dryers, by contrast, usually operate over longer periods and exhibit more complex patterns. The fridge freezer shows a more regular and lower-amplitude consumption profile. Taken together, these differences indicate that NILM models need to capture both short transient events and longer temporal behavior in power signals.
To comprehensively evaluate the multi-task model’s cross-dataset generalization capability and ensure that the feature abstraction pipeline is not overfitted to a specific geographical grid configuration, the Reference Energy Disaggregation Data Set (REDD) [
28] was additionally utilized. Developed by MIT, the REDD dataset contains whole-house and appliance-level electricity consumption monitoring from real-world residential homes in the United States. For the cross-dataset validation framework, active power measurements from Building 1 were extracted. To maintain evaluation consistency and align closely with the primary UK-DALE experiments, the target configuration was mapped to four comparable representative appliances: refrigerator, oven (utilized as a high-power surrogate for the microwave due to missing channel records in the specific building), washer dryer, and dish washer. The sampling resolution was uniformly aligned to 6 s to provide an identical input environment across different smart grid definitions without modifying the core model layout.
Before model training, the raw power signals were preprocessed to improve consistency and numerical stability. Missing values were replaced with zeros so that continuity in the time-series data could be preserved. After that, each appliance-specific signal was normalized using StandardScaler, which rescales the data to zero mean and unit variance. This step helps reduce scale differences among appliances and supports more stable and efficient model training.
The normalized signals were then divided into segments using a sliding-window procedure. Each sample was defined as a fixed-length time-series window with and consecutive windows were extracted with a stride of 32 samples, resulting in overlapping segments. This segmentation scheme allows the model to capture short-term signal changes while still preserving temporal continuity across neighboring windows.
To improve data quality and limit the effect of long inactive periods, an additional filtering rule was applied during window generation. More specifically, windows were retained when their maximum value satisfied . Windows with lower activity were not removed completely; instead, they were kept with a small probability of 5% so that low-power operating states would still be represented in the dataset. In this way, the dataset preserves diversity while reducing the influence of less informative samples. Each resulting window was then assigned its corresponding appliance label and used as inputs for the anomaly generation stage and the subsequent multi-task learning framework.
4.2. Synthetic Anomaly Injection
Since publicly available NILM datasets usually do not include sufficiently labeled anomaly categories, a synthetic anomaly injection procedure was added to the data preparation pipeline. The main purpose of this step was to generate anomalous signal patterns in a controlled way and to make it possible to train the model for anomaly classification together with appliance recognition.
The anomaly generation procedure was applied to each segmented window after preprocessing. However, anomalies were not injected into every window without restriction. To avoid unrealistic modifications in nearly inactive signals, a threshold-based rule was introduced in the implementation. If the maximum value of a window was below 0.1, that window was left unchanged and directly assigned the normal label. In this way, anomaly generation was limited to windows containing sufficiently informative signal activity.
For the windows that satisfied this condition, synthetic anomalies were injected with a probability of 0.15. Once anomaly injection was activated, one of three anomaly types was selected at random: spike, drop, or noise. The anomalous region within the window was then determined by randomly choosing a start index and a short segment length ranging from 2 to 10 samples.
For spike anomalies, the selected segment was replaced by an amplified value derived from the maximum amplitude of the window. More specifically, the signal in that region was multiplied by a random factor between 2 and 5, simulating a sudden increase in power consumption. For drop anomalies, the selected segment was scaled by a random coefficient between 0.0 and 0.2, producing a sharp decrease in signal magnitude. For noise anomalies, zero-mean Gaussian noise with a standard deviation of 0.5 was added to the selected segment in order to mimic irregular perturbations and measurement distortions.
As a result, each input window was assigned one of four anomaly labels: Normal (0), Spike (1), Drop (2), or Noise (3). This procedure enriched the training set with a wider range of abnormal patterns and enabled the proposed framework to learn more discriminative features for anomaly-aware NILM analysis.
The strategic rationale for introducing these synthetic mathematical anomalies into the post-standardization domain, rather than applying them to raw power profiles (in Watts) before normalization, is deeply rooted in preventing statistical bias across heterogeneous appliance profiles. For instance, an anomaly introduced in absolute raw units—such as a fixed 300 W spike—would induce a catastrophic and unrealistic deformation on a low-power device like a fridge freezer (nominal base load ≈ 90 W), while remaining entirely unnoticeable within the active operational cycle of a high-power device like a kettle (≈2400 W). Aligning unique raw thresholds for every specific operational mode would exponentially inflate rule-based hyperparameter complexity. By enforcing the StandardScaler protocol first, all electrical signatures are mapped onto a uniform zero-mean and unit-variance sequence space. Consequently, injecting stochastic geometry modifications (multiplying by a factor of 2–5 or adding Gaussian noise) within this standardized boundary ensures that the structural deformation scales relative to each device’s natural variance profile. This invariant representation prevents the multi-task learning heads from being blinded by absolute power domains, encouraging stable gradient synchronization.
4.3. Proposed Triple-Hybrid Architecture
The proposed model employs a triple-hybrid deep learning architecture that integrates convolutional, recurrent, and attention-based components within a unified multi-task framework. The overall structure of the model is illustrated in
Figure 2.
Figure 2 shows the overall architecture of the proposed model. The input to the network is a fixed-length window of size 128 × 1. Rather than relying on a single feature extraction strategy, the model is built in a layered way so that different properties of the electricity signal can be learned at different stages. In simple terms, the early part of the network looks for local changes, the middle part follows how the signal evolves over time, and the final part helps the model understand broader relationships across the whole sequence.
It is important to highlight that a sequential (stacked) network topology was chosen over a parallel architecture to achieve hierarchical feature abstraction. If the 1D-CNN, BiLSTM, and Transformer modules were deployed in parallel, each model would be forced to process the raw, noisy, and high-dimensional time-series data independently, which limits their synergistic potential. In our stacked configuration, these modules function complementarily: the early 1D-CNN layers perform localized spatial filtering to extract short-term transient signatures (e.g., abrupt switching events) while reducing dimensionality. The subsequent BiLSTM layer receives these clean, down-sampled feature maps to model bidirectional, medium-term temporal dependencies. Finally, the Transformer Attention encoder operates on top of these temporal representations to capture global, long-range contextual relationships via multi-head self-attention. This progressive refinement pipeline creates a highly discriminative feature hierarchy that cannot be replicated by simply merging independent parallel outputs.
The signal first passes through two 1D convolutional layers. The first uses 64 filters with a kernel size of 5, and the second uses 128 filters with a kernel size of 3. Batch normalization and max-pooling are applied after each convolution. These layers help the model pick up short and sudden variations in the power signal, such as switching events or brief fluctuations in consumption. At the same time, the pooling operations gradually reduce the temporal resolution and make the learned representation more compact.
The feature maps produced by the convolutional block are then given to a Bidirectional LSTM (BiLSTM) layer with 128 units and return_sequences = True. This part of the model reads the sequence in both directions, which means it can use information from both earlier and later time steps. That is helpful in NILM, since many appliances do not operate through isolated events but through patterns that develop over time. A dropout layer with a rate of 0.3 is added after the BiLSTM to improve generalization.
To strengthen the representation further, a Transformer encoder is placed after the recurrent stage. As illustrated in
Figure 2, this block includes layer normalization, multi-head self-attention, residual connections, and a feed-forward module implemented with 1D convolutional layers. The attention component uses 4 heads with a key dimension of 64. This allows the network to learn how different parts of the sequence relate to one another, even when they are far apart in time. As a result, the model can focus more effectively on the regions of the signal that carry the most useful information for both appliance recognition and anomaly detection.
The sequence representation obtained from the attention block is then summarized by global average pooling. In this way, a compact feature vector is produced. This vector is passed through a fully connected layer with 128 neurons and ReLU activation, creating a shared latent representation that is used by both output branches.
At the final stage, the network separates into two parallel heads. One head performs appliance classification over four device classes, while the other classifies anomaly categories, namely normal, spike, drop, and noise. Learning these two tasks together allows the model to make use of shared information and encourages it to learn more meaningful features than it would in a single-task setting.
Overall, the proposed architecture brings together three different but complementary components. The CNN layers are useful for local signal patterns, the BiLSTM captures temporal structure, and the Transformer encoder helps model broader contextual relationships. By combining these modules within a single framework, the model is better able to represent the complex and heterogeneous nature of appliance-level electricity consumption signals.
5. Experimental Results
5.1. Experimental Setup
This section presents the experimental setup, training process, and evaluation procedure used for the proposed triple-hybrid multi-task learning framework. All experiments were carried out on Building 1 of the UK-DALE dataset and focused on four household appliances: kettle, microwave, washer dryer, and fridge freezer. The raw power signals were sampled every 6 s and divided into fixed-length windows of 128 time steps using a sliding-window method with a stride of 32. This setup was chosen to preserve short-term signal changes while also retaining temporal continuity across the sequence. Before training, all input signals were normalized with StandardScaler to improve numerical stability and make optimization more reliable. During sample generation, windows with very low activity, defined by a maximum value below 0.1, were generally excluded, although a small portion of them (5%) were kept so that near-idle states would still be represented in the dataset. In addition, a synthetic anomaly injection step was included in the preprocessing pipeline. For each window, anomalies were introduced with a probability of 0.15, producing three perturbation types: spike, drop, and noise. In this way, the model was trained to perform appliance classification and anomaly detection together within the same framework. The dataset was split into training and testing subsets using a stratified strategy based on appliance labels, with 15% reserved for testing. To examine robustness, 5-fold cross-validation was also applied to the training set. Within each fold, 10% of the training data were used as a validation subset for performance monitoring and early stopping. To ensure rigorous validation and address potential overfitting or data leakage concerns, the experimental pipeline incorporates several methodological safeguards. First, the baseline activity filtering protocol (max(x) > 0.1) systematically removes repetitive standby states, ensuring the model evaluates only distinct operational transients. Second, the synthetic anomaly injection framework introduces stochastic shape distortions at random window indices with fixed probability boundaries, rendering individual sequences mathematically unique. The structural independence of these active signatures ensures that random data partitioning does not result in the memorization of contiguous sequence replicas, as validated by the distinct performance variations across the different cross-validation folds. The model was trained with the Adam optimizer and a batch size of 64. Training was limited to 20 epochs, but early stopping with a patience of 3 epochs was used to reduce overfitting and retain the best model weights. The optimization objective consisted of a joint loss formed by two sparse categorical cross-entropy terms, corresponding to appliance classification and anomaly detection. Model performance was assessed using accuracy, precision, recall, and F1-score for both tasks. ROC and precision-recall analyses were also performed to provide a more detailed view of classification behavior across different decision thresholds. All experiments were implemented in TensorFlow/Keras and run on Google Colab using an NVIDIA T4 GPU. The main experimental settings are summarized in
Table 1.
5.2. Appliance Classification Results
The performance of the proposed model on the appliance classification task was assessed using several evaluation metrics, namely accuracy, precision, recall, and F1-score. The model achieved an overall classification accuracy of 99.48%, indicating that it was able to distinguish appliance categories with a high level of reliability.
The confusion matrix shown in
Figure 3 further supports this result by showing that most samples were classified correctly and that misclassification remained very limited. In particular, the model produced almost perfect predictions for the washer dryer and fridge freezer classes. A small amount of confusion was observed between kettle and microwave, which is reasonable given that these two appliances can exhibit somewhat similar consumption characteristics. Even so, the number of misclassified samples between these classes remained low.
To further assess class separability, the ROC curves in
Figure 4 indicate near-ideal classification performance across all appliance categories, with all classes achieving an AUC value close to 1.00. This confirms the robustness of the proposed model under varying decision thresholds.
The class-wise performance results in
Figure 5 demonstrate consistently high precision, recall, and F1-score values across all appliance categories. Specifically, the model achieves a precision of 95.02%, 100.00%, 100.00%, and 100.00% for kettle, microwave, washer dryer, and fridge freezer, respectively. The recall values are 100.00%, 94.71%, 100.00%, and 99.99%, while the corresponding F1-scores are 97.44%, 97.28%, 100.00%, and 99.99%. These results indicate that the proposed model maintains a well-balanced performance across all classes, with particularly strong classification capability for high-consumption appliances.
5.3. Anomaly Detection Results
To evaluate anomaly detection performance, accuracy, precision, recall, and F1-score were considered. The proposed model reached an overall accuracy of 98.80%, showing that it could reliably identify both normal and abnormal patterns in appliance-level power signals.
The confusion matrix in
Figure 6 shows that most anomaly classes were identified correctly, with only limited misclassification. The normal class, in particular, was detected with very high accuracy. Most of the observed errors occurred between the Noise and Normal classes, and to a lesser extent between the Drop and Normal classes. This outcome is understandable, as the differences between these signal patterns can be relatively subtle.
Figure 7 gives a clearer picture of how well the anomaly classes are separated. The ROC curves remain strong for all classes, with AUC values of 0.993 for Normal, 0.999 for Spike, 0.998 for Drop, and 0.985 for Noise. This suggests that the model can still distinguish between anomaly types effectively even when the decision threshold changes.
A similar pattern can be seen in the class-based results presented in
Figure 8. Precision values are 98.85% for Normal, 98.90% for Spike, 98.24% for Drop, and 97.99% for Noise. The recall values are 99.83%, 96.52%, 92.76%, and 84.90%, respectively, while the F1-scores are 99.34%, 97.70%, 95.43%, and 90.97%.
Overall, the model performs very well for the Normal and Spike classes. The Noise class is more difficult, which is not surprising because noise patterns are usually more irregular and less clearly separated than the other anomaly types. Even with that limitation, the results still show that the model can detect different anomaly classes in a stable and reliable way.
5.4. Advanced Analysis
To further investigate the effectiveness, robustness, and computational efficiency of the proposed framework, an extensive set of advanced analyses was conducted, including an ablation study, cross-validation, error analysis, normalized confusion matrix analysis, and computational complexity assessment.
5.4.1. Ablation Study
To better understand the role of each architectural component and establish the performance standing of the proposed framework within the contemporary NILM domain, an extensive comparative analysis was carried out. The proposed model was evaluated against three internal ablation variants (CNN, CNN + BiLSTM, and CNN + Transformer) as well as the classical Sequence-to-Point (Seq2Point) CNN architecture, which was adapted for multi-task outputs. The corresponding results are presented in
Table 2.
The baseline CNN model already produces strong results, reaching 99.72% accuracy for appliance classification and 97.87% for anomaly detection. This suggests that convolutional layers are highly effective at capturing local patterns in power signals. When compared to the classical Seq2Point CNN benchmark, which achieves an anomaly macro-F1 of 90.40%, the proposed complete CNN + BiLSTM + Transformer model delivers the strongest overall performance. While baseline convolutional models (including Seq2Point) demonstrate acceptable competence in isolating local switching events, they inherently struggle to capture the long-term recursive operating cycles of complex appliances.
The internal ablation variants further highlight this dynamic. When the BiLSTM module is added to form the CNN + BiLSTM configuration, appliance classification performance drops noticeably, with accuracy decreasing to 93.77% and macro-F1 to 82.51%. This result suggests that temporal modeling by itself does not necessarily improve performance unless it is supported by sufficiently strong contextual representation. A different trend is observed when the Transformer module is combined with CNN. The CNN + Transformer model achieves 99.41% classification accuracy and 98.54% macro-F1 for appliance recognition, indicating that the attention mechanism is effective in capturing broader dependencies within electricity consumption signals.
The complete CNN + BiLSTM + Transformer model mitigates these limitations by successfully combining convolutional feature extraction, temporal sequence modeling, and attention-based learning. It achieves superior precision and macro-F1 scores, particularly in the highly challenging multi-class anomaly detection task (reaching 94.86% anomaly Macro-F1).
From a computational point of view, the full model is naturally the most demanding configuration, with 653,064 parameters and a training time of 773.00 s. Even so, its inference time remains low at approximately 7.08 ms per sample, which suggests that the model is still practical for real-time use. Overall, these findings confirm that the proposed triple-hybrid architecture offers the most effective balance between predictive power, robustness, and computational feasibility compared to standard baselines.
5.4.2. Cross-Validation Analysis
To examine the robustness and generalization ability of the proposed framework in a more reliable way, a 5-fold cross-validation procedure was applied. The fold-based results are reported in
Table 3, and their distribution is further illustrated in
Figure 9.
The results in
Table 3 show that the model reaches an average appliance classification accuracy of 98.17%, while the standard deviation remains as low as 0.17. Such a small variation indicates that performance is highly consistent from one fold to another and that the learned representations remain effective on unseen data.
For the anomaly detection task, the model attains a mean accuracy of 98.34%, with a slightly higher standard deviation of 2.46. This increased variability can be attributed to the inherently stochastic and diverse nature of anomaly patterns, which may differ significantly across folds. Notably, a performance drop is observed in Fold 5, as also reflected in
Figure 9, where more challenging anomaly instances are present.
Despite this variability, the model maintains high accuracy across all folds, demonstrating strong generalization capability and robustness. Overall, these results confirm that the proposed framework is reliable and not sensitive to specific data partitions, which is essential for real-world NILM applications.
Furthermore, to evaluate the cross-dataset generalizability of the proposed framework and verify that the feature abstraction pipeline is not overfitted to a single smart meter infrastructure, an independent 5-fold cross-validation experiment was executed using the REDD dataset (Building 1). Without modifying the core model layout or tuning any hyperparameters optimized for UK-DALE, the framework achieved a highly robust mean appliance classification accuracy of 86.44% across the validation folds. This result statistically validates that the spatial–temporal representations extracted by the cascading architecture successfully capture invariant appliance power signatures across different geographical definitions. Conversely, the mean anomaly detection accuracy stabilized at 35.61%. This localized performance drop is an expected mathematical consequence of severe data starvation in the REDD subset. Due to the limited duration of active power cycles in this specific dataset, the synthetic anomaly injection yielded a heavily constrained absolute sample size per abnormal class during validation splits, leaving the data-hungry multi-head attention blocks with insufficient instances to map complex boundary contexts effectively.
5.4.3. Error Analysis
To gain a clearer understanding of where the proposed framework still struggles, an error analysis was carried out by focusing on the class pairs that were most frequently confused. The corresponding results are summarized in
Table 4.
In the appliance classification task, the most noticeable confusion appears between microwave and kettle. In particular, 196 microwave samples are classified as kettle, whereas 34 kettle samples are predicted as microwave. A smaller number of errors is also seen for washer dryer, which is sometimes confused with microwave, kettle, or fridge freezer. This suggests that the remaining errors are not spread evenly across all appliance classes, but are mostly concentrated in pairs that share partly similar signal behavior, especially short and high-power operating patterns.
A similar observation can be made for anomaly detection. The most frequent confusion occurs between noise and normal, with 521 noise samples being labeled as normal. In addition, 336 drop samples and 90 spike samples are also predicted as normal. This indicates that the model has more difficulty when anomaly patterns are weak, irregular, or not sufficiently distinct from normal operating behavior.
Taken together, these results show that the proposed model performs reliably in most situations. The remaining errors appear to arise mainly from intrinsic similarity between signal patterns and from gradual or ambiguous transitions, rather than from a general weakness in the framework. This is also in line with the normalized confusion matrix, which shows that misclassifications are limited to a relatively small number of challenging cases.
5.4.4. Normalized Confusion Matrix Analysis
To better interpret the class-wise behavior of the proposed model, normalized confusion matrices for both appliance classification and anomaly detection are shown in
Figure 10. Compared with standard confusion matrices, these plots make it easier to see the proportion of correct and incorrect predictions within each class and therefore provide a clearer view of how the model behaves across different categories.
As shown in
Figure 10a, appliance classification is highly accurate for almost all classes. The model reaches 99% accuracy for kettle, 96% for microwave, and approximately 99–100% for washer dryer and fridge freezer. These results indicate that the proposed framework can distinguish appliance categories with a high level of reliability. The only noticeable confusion appears between kettle and microwave, where about 4% of microwave samples are predicted as kettle. This finding is consistent with the earlier results and is likely related to the similarity of their short-duration power consumption patterns.
The anomaly detection results in
Figure 10b show a slightly more challenging picture. The model classifies the normal class perfectly (100%) and also performs strongly for the spike class (95%). However, the accuracy values are lower for the drop (83%) and noise (71%) classes. In particular, 27% of noise samples and 17% of drop samples are classified as normal. This suggests that weak or irregular disturbances are harder to separate from normal operating behavior.
Even with these challenging cases, the overall performance remains strong, and the observed errors are concentrated in only a few class pairs. This indicates that the proposed model is able to learn discriminative patterns for most categories, while the remaining mistakes are mainly associated with signal ambiguity rather than a general limitation of the framework.
Overall, the normalized confusion matrices confirm that the proposed approach performs reliably in both tasks. The main weakness appears in distinguishing subtle anomaly types, which is a common difficulty in real-world NILM applications.
5.4.5. Computational Complexity Analysis
The computational aspect of the proposed framework was also examined in terms of model complexity and inference cost. Although the detailed numerical values are already given in
Table 2, the trade-off between predictive performance and model complexity can be seen more clearly in
Figure 11.
As illustrated in
Figure 11, the baseline CNN model has the smallest number of parameters, but it does not deliver the strongest anomaly detection performance. When the BiLSTM module is added, model complexity increases considerably, yet this increase is not matched by a comparable improvement in performance. This suggests that the CNN + BiLSTM configuration offers a less favorable balance between cost and benefit. By contrast, the CNN + Transformer model achieves strong predictive results with a more moderate increase in parameter count, making it a more computationally efficient alternative.
The full CNN + BiLSTM + Transformer model provides the best overall predictive performance, especially for anomaly detection, although this comes with a higher level of complexity. Even so, the inference time reported in
Table 2 remains low enough for practical use. This indicates that the added computational burden is acceptable in view of the gains in classification performance and overall robustness.
Taken together, these results suggest that the proposed architecture offers the most effective balance between predictive power and computational feasibility. This makes it a suitable choice for intelligent NILM applications, where both accuracy and efficiency are important.
6. Discussion
The findings of this study show that the proposed multi-task triple-hybrid architecture is highly effective for jointly performing appliance classification and anomaly detection in NILM. By integrating 1D-CNN, BiLSTM, and Transformer Attention within a single framework, the model benefits from three complementary strengths: local transient feature extraction, bidirectional temporal modeling, and global contextual representation learning. These advantages are reflected in the experimental results, where the model achieved 99.48% accuracy for appliance classification and 98.80% accuracy for anomaly detection, together with consistently strong precision, recall, and F1-score values across classes.
The appliance classification results suggest that the proposed framework is particularly successful for appliances with distinct and stable consumption patterns, such as washer dryers and fridge freezers, for which almost perfect predictions were obtained. The remaining classification errors were concentrated mainly between kettle and microwave. This is consistent with a well-known challenge in NILM, namely the difficulty of separating appliances that produce partially overlapping, short-duration, high-power signatures. Recent review studies have similarly noted that NILM performance tends to decline when appliances exhibit similar electrical behavior or when training and evaluation settings vary substantially across datasets [
1]. In this context, the strong results obtained here indicate that the proposed feature extraction pipeline is sufficiently discriminative for most classes, while the remaining errors are more likely related to intrinsic signal similarity than to a general limitation of the model.
The anomaly detection branch also produced strong results, although its error pattern was somewhat more challenging than that of appliance classification. In particular, the noise and drop classes were more often confused with the normal class. From an application perspective, this is a meaningful finding, since low-amplitude or irregular distortions do not always produce clearly separable signal patterns. Even so, the model preserved high overall anomaly detection accuracy together with strong AUC values, indicating that the multi-task framework was able to learn both appliance-related and anomaly-related features effectively. Prior work in multi-task NILM has shown that learning related tasks within a shared architecture can improve representation learning and reduce the deployment burden associated with separate models. For example, Dash and Sahoo [
2] proposed a multi-task NILM framework that jointly addressed appliance state detection and energy disaggregation within a single deep model, emphasizing both feasibility and efficiency on real-world datasets. Compared with that line of work, the present study extends the multi-task perspective toward the joint handling of appliance classification and anomaly detection, which is especially relevant for practical NILM systems that must remain aware of signal quality.
The ablation study offers additional insight into why the proposed architecture performs well. Although the CNN baseline already achieved strong performance, the results show clearly that the full CNN + BiLSTM + Transformer configuration provides the best overall balance, particularly in terms of anomaly-related macro-F1. This observation is in line with recent NILM research, where convolutional and attention-based structures are increasingly combined to exploit both local and global signal information. For instance, Azad et al. reported strong transformer-based NILM performance on UK-DALE, REDD, and REFIT by combining temporal pooling, residual connections, and attention mechanisms, while GTCN improved generalization on UK-DALE by integrating CNN layers with a gate-transformer structure [
3]. Likewise, Huzzat et al. [
4] showed that a GRU-BERT hybrid can improve NILM performance by combining temporal modeling with transformer-style contextual learning, especially for transient and complex appliance behaviors. The present results are consistent with these studies, but they also suggest that a triple-hybrid structure may offer additional advantages when the problem is extended beyond disaggregation alone to include anomaly-aware analysis. Beyond the primary dataset, testing the model on the REDD dataset provided strong evidence of its cross-dataset generalizability. Even without tuning the parameters for this new environment, the model maintained a highly robust 86.44% accuracy in appliance classification, proving that the CNN-BiLSTM-Transformer pipeline captures universal power signatures rather than memorizing local data. Furthermore, the comparison with the standard Seq2Point benchmark highlighted exactly why the triple-hybrid structure is necessary. A concise comparison with representative studies is provided in
Table 5.
The cross-validation results further support the reliability of the proposed framework. The very low standard deviation observed in appliance classification indicates stable performance across different data splits, whereas the slightly higher variation in anomaly detection appears to be related mainly to the stochastic and heterogeneous nature of anomaly patterns. This is a reasonable outcome and does not weaken the overall robustness of the framework. In fact, recent NILM research has increasingly emphasized the importance of robustness, generalization, and sound evaluation methodology, particularly when models are tested under different datasets, unseen scenarios, or limited-data conditions [
5].
From a broader perspective, the present study occupies a distinct position within the NILM literature. Many recent studies have focused on load disaggregation, unknown appliance detection, or transformer architectures designed to handle non-stationary behavior. For example, de Diego-Otón et al. [
6] proposed a framework for classifying known appliances and detecting unseen ones under limited-data conditions using learned latent representations, while NILMFormer addressed subsequence non-stationarity in transformer-based load disaggregation and was presented as suitable for deployment-scale monitoring. Although these contributions are important, they are not directly equivalent to the problem addressed here. The main novelty of the present work lies in jointly addressing appliance classification and anomaly detection within a unified architecture, while also providing a comprehensive experimental evaluation through confusion analysis, cross-validation, ablation studies, multi-task assessment, and computational complexity analysis.
The computational analysis also offers a practically important result. Although the full architecture is more demanding than lightweight baselines in terms of parameter count and training cost, its inference time remains low enough for real-world use. This matters because NILM systems designed for smart energy monitoring should not only be accurate, but also computationally feasible for deployment. The performance–complexity trade-off observed in this study suggests that the additional architectural depth is justified by the gains in predictive accuracy and robustness.
Overall, the proposed framework compares favorably with recent NILM studies by combining strong predictive performance, anomaly-aware analysis, and multi-task efficiency within a single model. At the same time, the remaining errors—particularly those involving similar appliance signatures or subtle anomaly patterns—point to realistic directions for future work, including richer input representations, cross-household validation, and more adaptive anomaly modeling.
Furthermore, while the proposed hybrid model demonstrates robust classification capabilities in a window-based deployment framework, incorporating complementary methodological perspectives could further advance its real-world scalability. Integrating front-end event-based NILM algorithms represents a valuable strategy to optimize computational efficiency, as the deep learning architecture would only be triggered during detected transient states rather than processing continuous streaming inputs. Additionally, implementing Explainable AI (XAI) frameworks—such as SHAP (SHapley Additive exPlanations) or Integrated Gradients—could offer significant insights into model transparency by mapping out the exact feature attributions driving anomaly classifications. Finally, transitioning toward uncertainty-aware deep learning methods, such as Monte Carlo Dropout or Bayesian Neural Networks, would enable the network to quantify its own prediction confidence. This uncertainty quantification is essential for industrial smart grid applications, ensuring that false positives are minimized and highly ambiguous signal perturbations are handled with measurable statistical reliability.
7. Conclusions
This study proposed a multi-task triple-hybrid NILM framework that jointly performs appliance classification and anomaly detection from power signals. The proposed architecture combines 1D-CNN, BiLSTM, and Transformer Attention modules in a unified pipeline, allowing the model to capture local transient characteristics, bidirectional temporal dependencies, and globally discriminative feature representations. The dual-output design makes it possible to simultaneously classify appliances and identify signal anomalies, which increases the practical relevance of the framework for intelligent energy monitoring systems.
Tests on the main UK-DALE dataset showed the proposed model is highly effective, reaching 99.48% accuracy for appliance classification and 98.80% for anomaly detection. A secondary cross-dataset evaluation on the REDD dataset confirmed the architecture’s strong ability to generalize, producing an 86.44% appliance recognition accuracy in an entirely different smart grid environment. The comparative benchmark analysis also proved that the triple-hybrid structure easily outperforms classical baselines like the Seq2Point model, especially when dealing with complex anomaly patterns. Furthermore, additional analyses, including the ablation study, cross-validation, error analysis, and computational complexity assessment, demonstrated that the proposed full architecture provides the most favorable balance between accuracy, robustness, and efficiency.
The main strengths of the proposed study can be summarized as follows. First, it introduces a unified framework that jointly addresses two practically relevant NILM tasks instead of handling them separately. Second, it integrates convolutional, recurrent, and attention-based mechanisms in a complementary manner, resulting in strong discriminative performance. Third, it offers a detailed evaluation protocol that goes beyond overall accuracy and includes robustness and complexity analyses, thereby strengthening the practical credibility of the model.
Despite these strengths, several limitations should also be acknowledged. The anomaly classes used in this study were generated synthetically, which, although useful for controlled evaluation, may not fully reflect the diversity of real-world anomaly patterns. Furthermore, while the cross-dataset evaluation on the REDD dataset provided strong evidence of the model’s adaptability, testing across a wider variety of households and diverse smart grid infrastructures would further solidify these generalization claims. Finally, while the proposed architecture remains efficient at inference time, its training cost is higher than that of simpler baselines.
Future work may therefore focus on evaluating the model across a broader spectrum of international datasets, incorporating real anomaly annotations when available, and exploring adaptive or lightweight variants of the proposed architecture for large-scale real-time deployment. Overall, the findings of this study show that the proposed multi-task triple-hybrid framework is a reliable and effective solution for anomaly-aware NILM applications.