1. Introduction
The rapid growth of cyber-physical production systems (CPPS) and industrial internet of things (IIoT) has led to the widespread deployment of high-frequency multivariate sensors in semiconductor fabrication, rotating machinery, energy systems, and precision machining [
1,
2]. These sensing infrastructures have the capacity to continuously record complex temporal patterns, reflecting equipment conditions, process variations, and emerging degradation. The identification of anomalies in such environments is of paramount importance in ensuring reliability and minimising periods of downtime. However, the practical identification of industrial anomalies remains a highly challenging endeavour due to a number of factors. Firstly, there is a scarcity of labelled faults, secondly there is severe class imbalance, and finally, the subtle nature of early-stage deviations often results in their resemblance to normal fluctuations [
3,
4,
5].
In the context of real manufacturing systems, the presence of labeled fault data is infrequent due to the sporadic nature of failures and the associated costs or impracticalities of accurately annotating such data [
4]. As illustrated in
Figure 1, normal time-series signals often exhibit tightly aligned temporal patterns, whereas abnormal sequences deviate subtly and inconsistently, making unsupervised anomaly detection particularly challenging. Consequently, supervised approaches encounter challenges in extending their generalization beyond the observed failure modes. Statistical process control (SPC) methods are widely employed; however, they frequently encounter failure under dynamic operating conditions, sensor noise, or drifting baselines. These factors contribute to the indistinct delineation between normal and abnormal behaviors [
6]. These limitations have thus motivated an increased interest in unsupervised and self-supervised time-series anomaly detection (TSAD), wherein models are tasked with learning intrinsic temporal structure from unlabeled data. Despite recent advances, several unresolved problems remain in unsupervised industrial TSAD: (i) existing augmentations often distort periodic and seasonal temporal structures; (ii) one-class boundaries are prone to collapse when trained without negative samples; and (iii) many SSL-based approaches provide invariance but lack explicit mechanisms for compact normal-region formation. These gaps motivate the need for a unified framework that preserves temporal structure, stabilizes boundary formation, and prevents latent collapse.
Recent studies have demonstrated the potential of self-supervised representation learning in capturing expressive time-series embeddings. Contrastive learning methods, such as the simple framework for contrastive learning of visual representations (SimCLR) [
7], momentum contrast (MoCo) v3 [
8], bootstrap your own latent (BYOL) [
9], and vari-ance-invariance-covariance regularization (VICReg) [
10], have been employed to maximize agreement between augmented views. This process enables the learning of invariant and discriminative features without the need for labels. Concurrently, one-class classification (OCC) methods, encompassing deep support vector data description (Deep SVDD) and its derivatives [
11,
12], delineate a compact hypersphere that encompasses normal data in latent space. Despite their effectiveness, the application of contrastive learning and OCC directly to industrial TSAD presents several critical challenges. The following issues have been identified: (i) the lack of temporal augmentations that preserve the periodic and seasonal structures inherent in many industrial signals, (ii) representation collapse when no negative samples exist, and (iii) limited robustness under sensor noise, drift, and configuration changes [
11,
12,
13].
Recent advancements in intelligent fault diagnosis underscore the necessity for domain-aware feature learning. A combination of wavelet coherent analysis and deep networks for the diagnosis of centrifugal pumps [
14] as well as hybrid deep-learning frameworks for the detection of faults in milling machines [
15] has been demonstrated to significantly improve the reliability of detection by incorporating signal-specific structures. The findings under consideration underscore the importance of designing TSAD models that respect industrial signal characteristics—particularly periodic cycles, trend variations, and localized perturbations—rather than relying on generic augmentations such as jittering or scaling.
To address these issues, this study proposes CL-OCC, a contrastive learning-based one-class classification framework tailored for unsupervised TSAD in industrial settings. The central concept is to implement seasonal-trend decomposition using loess (STL) as a temporal augmentation technique. This approach generates physically consistent positive pairs by preserving intrinsic periodicity and trend behavior while introducing controlled stochastic variations. The resulting augmented views facilitate contrastive learning, enabling it to operate on semantically meaningful transformations rather than distortive generic augmentations. Furthermore, a contrastive soft-boundary objective with variance regulation is employed to collectively enforce invariance, compactness, and dispersion in latent space. This approach serves to mitigate collapse and enhance boundary stability.
The main contributions of this study are summarized as follows:
A unified CL-OCC framework that combines contrastive learning, soft-boundary one-class classification, and variance regularization for robust unsupervised anomaly detection.
An STL-based temporal augmentation module that preserves domain-specific periodic and seasonal structures while introducing stochastic variability suitable for contrastive learning.
A stable optimization strategy that mitigates hypersphere collapse and enhances latent-space regularity through variance constraints and center-updating mechanisms.
Extensive evaluations on semiconductor data and public benchmarks, demonstrating superior performance, robustness, and cross-domain generalization.
The novelty of the proposed CL-OCC lies in its STL-driven domain-aware augmentation, cosine-based soft boundary formulation tailored for one-class SSL, and variance-preserving latent regularization, which jointly address limitations not solved by existing TSAD frameworks.
The remainder of this paper is organized as follows.
Section 2 reviews related works in unsupervised anomaly detection, OCC, and contrastive learning.
Section 3 introduces the proposed CL-OCC framework and optimization design.
Section 4 presents the experimental setup, datasets, and evaluation metrics. Finally,
Section 5 concludes the paper and outlines future research directions.
4. Experiments
This section presents a comprehensive empirical evaluation of the proposed CL-OCC framework using industrial and public benchmark datasets. The experiments assess anomaly detection performance, representation quality, robustness to perturbations, and generalization capability across domains. Comparative results, ablation studies, and additional analyses are conducted to validate the effectiveness of each component of the proposed method.
4.1. Experimental Setup
The semiconductor dataset consists of chamber pressure, flow, vibration, and thermal variables collected from plasma etching tools. As actual abnormal events are extremely rare, synthetic anomalies are generated by injecting controlled faults into normal sequences, including gradual drifts, cycle distortions, amplitude perturbations, and frequency irregularities, in accordance with common practices in industrial degradation modeling. The three public datasets include the NASA bearing dataset [
35], the server machine dataset (SMD) [
36], and the Numenta anomaly benchmark (NAB) [
37], each providing diverse temporal dynamics useful for evaluating generalizability. To avoid leakage of fault-related assumptions into the training stage, all synthetic anomalies (drift, amplitude distortion, cycle deformation, and frequency irregularities) were injected only into the test set, while the training and validation splits contained exclusively normal sequences. This ensures that the model learns normal operational structure without being influenced by artificially generated fault patterns.
All models are trained using only normal sequences. Raw signals are segmented into windows of 2400 time steps to establish a consistent representation space across datasets with different sampling frequencies. A fixed window length of 2400 time steps was used to maintain a unified latent dimensionality and enable cross-dataset comparison under consistent representation scales. Empirically, a 2400-time-step segment corresponds to approximately one to two full operational cycles across the semiconductor, bearing, and server datasets, providing sufficient temporal context for capturing seasonal-trend behavior. Shorter windows were found to reduce the sensitivity to gradual drift patterns, as shown in the robustness analysis, whereas significantly longer windows did not yield additional benefits while increasing computational overhead.
Validation splits contain exclusively normal samples to prevent information leakage during threshold selection. STL augmentation parameters are fixed across all experiments: seasonal periods between 30 and 120 steps, trend smoothing level of 0.15, and Gaussian perturbation scales . These settings ensure consistent decomposition and augmentation behavior across datasets. The validation split contains only normal samples to prevent threshold leakage and to remain consistent with the one-class learning assumption. Early stopping is determined by the stabilization of the reconstruction and contrastive losses, and does not rely on AUC since anomaly labels are not available during training.
The encoder architecture used in all experiments consists of three 1D convolutional layers (kernel sizes 7-5-3, stride 1, channels 32-64-128) followed by a single bidirectional GRU layer with 128 hidden units. Batch normalization is applied after each convolutional block. All models are trained for 100 epochs using Adam optimizer with a learning rate of 1 × 10−3, batch size 32, and cosine annealing learning rate scheduling. To ensure reproducibility, all random seeds (NumPy, PyTorch, and Python) are fixed to 2025. The training environment consists of NumPy 1.26, PyTorch 2.2, and Python 3.12 running on an NVIDIA RTX 4090 GPU.
Evaluation metrics include area under the receiver operating characteristic curve (AUC), F1-score. To assess responsiveness, an early detection index is used to quantify the time lag between anomaly onset and anomaly detection. Due to the inherent variability of time-series anomaly detection, all models are trained and evaluated over five independent runs, and results are reported as mean ± standard deviation. For statistical analysis, the Friedman test and Wilcoxon signed-rank test are applied following established guidelines for multi-model comparison [
38].
Baseline methods include Deep SVDD [
27], LSTM Autoencoder [
18], TS-TCC [
23], TS2Vec [
24], CoST [
25], and widely used reconstruction- or prediction-based methods such as Informer [
39] and TCN [
20]. These baselines collectively cover one-class classification, self-supervised contrastive learning, and deep forecasting-based anomaly detection approaches, providing a comprehensive comparison against the proposed framework. Inference latency is measured as the average forward-pass time per sequence on the same hardware environment described above.
The proposed CL-OCC model contains approximately 1.47 M parameters, which is substantially fewer than transformer-based baselines such as Informer or TS2Vec (typically 8–20 M parameters). The inference latency is measured at approximately 1.6 ms per 2400-step sequence on an RTX 4090 GPU, demonstrating that the model is lightweight and suitable for real-time industrial applications.
4.2. Quantitative Results
Table 1 summarizes the quantitative performance across all four datasets using a unified set of baseline models.
Across datasets, CL-OCC provides competitive and stable performance, achieving the highest F1-score and AUC on the semiconductor and NAB datasets, which exhibit long-term drifts and mixed seasonal–trend dependencies. On the NASA bearing dataset, TS2Vec and CoST slightly outperform the proposed method in AUC, reflecting their advantage in modeling high-frequency vibration periodicity. On SMD, Informer and TS2Vec achieve performance comparable to CL-OCC, which is expected given that server telemetry primarily consists of non-periodic event-driven fluctuations. These results indicate that CL-OCC offers strong general-purpose detection capability without relying on dataset-specific inductive biases.
In order to conduct a more thorough evaluation of the generalization behavior of the method, a cross-domain transfer experiment was conducted from semiconductor data to the NASA bearing dataset. Although these domains differ substantially in physical meaning and operating conditions, CL-OCC demonstrates promising transferability. This capability arises from the invariance induced by STL-based augmentation, which emphasizes temporal properties such as periodicity, seasonal–trend morphology, and long-horizon dynamic stability. These temporal invariants are commonly present across heterogeneous industrial systems—ranging from plasma chamber pressure cycles to bearing rotational vibration patterns—despite their semantic gap. By learning representations anchored to these structural invariants rather than domain-specific semantics, CL-OCC is able to generalize effectively across datasets with distinct physical characteristics. This cross-domain evaluation is intended as a representative example rather than an exhaustive exploration of all possible transfer configurations. The semiconductor to the NASA bearing setting provides a substantial domain shift in periodicity and drift behavior, which is sufficient for demonstrating the invariance mechanism underlying CL-OCC. Evaluating additional domain-pair combinations is beyond the scope of this study and is left for future work.
Although the semiconductor and bearing datasets differ substantially in their physical meaning and operational context, both domains exhibit temporal structures that share key invariants, including periodic cycles, seasonal–trend morphology, and long-horizon stability patterns. The STL-based augmentation explicitly emphasizes these invariants by decomposing signals into trend, seasonal, and residual components, allowing the model to learn representations anchored to temporal dynamics rather than domain semantics. This enables CL-OCC to generalize across heterogeneous domains by transferring invariance to structural temporal patterns that are common to a wide range of industrial systems.
To determine whether these performance differences are statistically meaningful, a comprehensive statistical analysis was conducted. A Friedman test across all methods and datasets revealed significant differences among models (), confirming that not all approaches perform equivalently. Post hoc Wilcoxon signed-rank tests comparing CL-OCC with individual baselines further show that CL-OCC significantly outperforms classical one-class and reconstruction-based methods such as Deep SVDD (), COCA (), and TCN (). In contrast, comparisons against modern contrastive models such as TS2Vec (), CoST (), and Informer () do not exhibit significant differences. These findings align with prior observations that self-supervised temporal models often provide strong baselines when applied to vibration- or event-oriented datasets. Effect size analysis based on Cliff’s further supports these trends: CL-OCC shows a large effect size over Deep SVDD () and a small effect size relative to TS2Vec (), indicating a decisive advantage over classical methods and comparable performance to state-of-the-art contrastive learners.
To further examine the learned representation structures,
Figure 4 presents a three-panel comparison of t-SNE projections for TS2Vec, CoST, and CL-OCC.
The same t-SNE configuration was used for all methods (perplexity = 30, cosine distance, PCA initialization, L2 normalization). TS2Vec and CoST both form partially distinguishable clusters, but their normal and anomalous embeddings overlap near the boundary regions. In contrast, CL-OCC produces a compact normal cluster and a clearly isolated anomaly region, indicating more discriminative representation geometry.
These qualitative observations are supported quantitatively by silhouette scores and Davies-Bouldin index (DBI) reported in
Table 2.
CL-OCC achieves the highest silhouette score and lowest DBI among the three models, confirming that its latent space maintains both compactness of normal samples and clear separability from anomalous regions. This improved cluster structure aligns with the combined effect of STL-guided invariance, soft-boundary learning, and variance regularization.
To further quantify the contribution of STL-based augmentation, this study compares it with two commonly used time-series augmentations—jittering and scaling—using both detection metrics and latent-structure scores, as reported in
Table 3.
STL yields substantially higher F1-score and AUC and produces more compact normal clusters, as evidenced by a higher silhouette score and a lower DBI. This indicates that preserving seasonal–trend structure provides more semantically meaningful invariances than perturbation-based augmentations, which tend to distort the underlying temporal morphology. In addition, decomposition-based alternatives such as wavelet smoothing and VMD reconstruction, although capable of preserving certain time–frequency components, require predefined basis functions or mode-selection heuristics that are difficult to tune in a fully unsupervised setting. By contrast, STL offers a non-parametric and data-driven decomposition that adapts naturally to non-stationary seasonal–trend patterns, resulting in more stable invariances and more discriminative latent-space separation.
4.3. Ablation Study
A systematic ablation and interaction analysis was conducted to assess how each component of the proposed CL-OCC framework contributes to anomaly detection performance. The objective of this study is twofold: (i) to quantify the individual effect of each module—STL augmentation, soft-boundary one-class objective, and variance regularization—and (ii) to examine whether these components operate independently or interact synergistically when combined. This is particularly important because CL-OCC is designed around the joint principles of invariance, compactness, and dispersion, and reviewer comments emphasized the need to verify that these objectives reinforce each other rather than act as redundant mechanisms.
Table 4 summarizes the results from removing one module at a time, while
Table 5 reports the outcomes when two modules are removed simultaneously. Removing a single component already leads to clear degradation, but removing two components generally results in substantially larger performance drops, indicating non-linear and interdependent behavior among the modules.
When STL augmentation is disabled, the performance declines the most among single-removal settings. This confirms that STL serves as the primary driver of invariance to trend-seasonal fluctuations, which are particularly dominant in industrial time-series data. Without STL, the model loses its ability to create structure-preserving positive pairs, and the latent space becomes more sensitive to local variations, leading to fragmented clusters.
Removing the soft-boundary objective causes the latent center to drift and the normal region to become less compact. This weakens the one-class separation mechanism, making it more difficult to distinguish near-boundary anomalies. Disabling variance regularization, by contrast, produces embeddings that collapse excessively along certain latent dimensions. Although anomaly separability remains partially intact, the reduction in representational dispersion harms the model’s flexibility, resulting in noticeable drops in both F1-score and AUC.
The interaction analysis amplifies these observations. When STL and the soft-boundary term are removed together, the model fails to enforce either invariance or compactness, resulting in significant overlap between normal and anomalous samples. Removing STL and variance regularization results in over-contracted embeddings that lack discriminative structure. Similarly, removing the soft-boundary and variance regularization simultaneously leads to an unanchored latent space with irregular expansion. In all two-module removal settings, the model suffers from severe representational instability, confirming that the three components do not merely offer additive gains but instead jointly support a balanced embedding geometry.
Overall, these results demonstrate that the full CL-OCC framework achieves its strongest performance by combining the complementary roles of STL-based invariance, soft-boundary compactness, and variance-based dispersion. Their interaction is synergistic rather than linear, which validates the design rationale that anomaly detection in industrial settings requires the simultaneous coordination of invariance, boundary shaping, and representation diversity.
4.4. Robustness Evaluation
In order to ascertain the reliability of CL-OCC under conditions of realistic operational variation, a further analysis was conducted to assess its robustness to noise, varying input lengths, and severe class imbalance. These aspects are particularly critical in industrial monitoring environments, where sensor degradation, fluctuating sampling conditions, and extreme rarity of anomalies often lead to unstable detection performance. This robustness analysis therefore complements the ablation and interaction study by examining whether the geometric properties induced by our framework—namely invariance, compactness, and dispersion—translate into resilience under adverse conditions.
Table 6 presents the results on the semiconductor dataset.
When Gaussian noise is added to the input signals, CL-OCC maintains stable performance for moderate noise levels (), and even under harsh perturbations () the model exhibits only a moderate decline in AUC. This behavior aligns with the role of STL augmentation, which enforces invariance to local seasonal fluctuations and prevents the model from reacting to spurious short-term disturbances.
The model also remains robust when input window lengths vary from 600 to 2400 steps. Shorter windows reduce the amount of contextual information available, resulting in slightly lower F1-scores; however, the performance degradation remains within acceptable limits. The best performance is obtained at 2400 steps, consistent with the need for sufficiently long temporal context to detect gradual process drifts. This outcome supports the interaction analysis in
Section 4.3, where STL and variance regularization were shown to work jointly to stabilize representation geometry across scales.
Lastly, CL-OCC demonstrates resilience under extreme class imbalance. Even when anomalies account for only 1% of the dataset—reflecting typical industrial scenarios—the model continues to deliver high recall and stable detection boundaries. This confirms that the one-class compactness enforced by the soft-boundary objective maintains a well-defined normal region even when few or no anomalies appear during training.
Overall, the robustness experiments show that CL-OCC’s performance remains stable across perturbations, sampling inconsistencies, and imbalance conditions. These findings reinforce the earlier ablation and interaction results by demonstrating that the complementary roles of STL augmentation, soft-boundary learning, and variance regularization not only improve discriminative ability but also contribute directly to robustness against real-world variability.
To assess whether the robustness trends were statistically reliable, all robustness experiments were repeated five times, and the variations across runs remained within narrow ranges. Although
Table 6 reports averaged F1-score and AUC values for clarity, the repeated-run results showed no statistically significant degradation within each noise level, window-length configuration, or imbalance condition (
), indicating that the observed robustness behavior is stable rather than incidental. This confirms that CL-OCC maintains consistent performance under realistic perturbation scenarios.
4.5. Qualitative Results
In order to provide a more comprehensive evaluation, a qualitative analysis of anomaly score trajectories is employed to examine the behavior of CL-OCC on real industrial signals, in addition to the quantitative and robustness results.
Figure 5 shows the anomaly scores generated for a chamber pressure signal in the semiconductor dataset, which contains a slow drift beginning midway through the run. Such gradual deviations frequently occur in plasma etching processes due to chamber wear, polymer accumulation, or unstable mass flow dynamics, and their early detection is critical for preventing yield degradation.
The proposed CL-OCC demonstrates two key behaviors. First, CL-OCC reacts to the initial onset of the drift significantly earlier than reconstruction-driven methods such as the LSTM Autoencoder or Informer. In this example, CL-OCC produces a consistent rise in anomaly score approximately 120 s before the fault becomes visually apparent or detectable by baseline models. This early increase reflects the model’s sensitivity to long-horizon trend deformations, which is driven by STL-based augmentation that amplifies deviations in the underlying seasonal-trend structure of the signal.
Second, CL-OCC exhibits markedly smoother and more stable anomaly trajectories near cycle boundaries, where both normal and anomalous fluctuations tend to co-occur. Deep SVDD and other margin-based baselines often display sharp oscillations in these regions due to their sensitivity to small local variations. In contrast, CL-OCC suppresses such instability because variance regularization constrains latent collapse while maintaining a balanced representation spread. The resulting anomaly scores produce cleaner transitions between states, reducing false positives and enabling more robust decision-making in practice.
While CL-OCC has been shown to provide effective indications of anomalies in drift events, observations indicate the presence of regions where its response is less pronounced. In particular, short impulsive disturbances—i.e., brief sensor glitches or momentary pressure bursts—do not substantially alter the long-horizon trend-seasonal structure emphasized by STL-based augmentation. Consequently, CL-OCC elevates its anomaly score only marginally during these brief intervals. In contrast, threshold-based and reconstruction-based baselines generate more pronounced score spikes.
This behavior does not signify a global limitation, but rather pertains to a particular edge case. CL-OCC demonstrates particular proficiency in the detection of gradual or structurally coherent deviations; however, it may exhibit a tendency to under-react to anomalies that occur at very small temporal scales and do not exert an influence on the underlying periodic or trending components. In practice, such impulse-type events may necessitate a separate fine-scale detector or a complementary residual-based module. The incorporation of such multi-resolution mechanisms signifies a promising avenue for future research endeavors.
Beyond the impulsive-disturbance sensitivity described above, the study also has several practical limitations. First, STL-based augmentation requires fixed seasonal-period settings, which may require dataset-specific tuning when temporal structures differ significantly across domains. Second, the current encoder design does not include transformer-based or multi-resolution backbones, which may further enhance sensitivity to short-scale anomalies. Lastly, all evaluations were conducted on offline datasets; therefore, real-time adaptation and online updating mechanisms were not investigated. These aspects represent important limitations that motivate additional future improvements.
5. Conclusions
The present study introduces CL-OCC, a contrastive one-class learning framework designed to address the challenges of unsupervised time-series anomaly detection in intelligent manufacturing systems. The proposed method utilizes STL-based temporal augmentation, a cosine-regularized soft boundary, and variance-preserving latent regularization to construct a stable and discriminative embedding space. This embedding space is capable of capturing long-horizon temporal structures, which are characteristic of industrial processes. When combined with an autoencoder-pretrained convolutional recurrent encoder, CL-OCC attains competitive or superior anomaly detection performance across semiconductor, bearing, server, and real-world anomaly benchmarks. The proposed method exhibits several notable advantages. Firstly, it generates smoother anomaly trajectories, facilitating more precise detection of gradual drifts. Secondly, it demonstrates strong robustness against noise, sequence-length variation, and severe anomaly imbalance.
Ablation and interaction analyses demonstrate that STL-based invariance, boundary shaping, and variance dispersion function synergistically rather than independently, collectively enhancing the stability and separability of the learned representations. A qualitative examination further corroborates the model’s capacity to detect slowly evolving faults. However, it also reveals a localized limitation in sensitivity to short impulsive disturbances that do not substantially alter the underlying trend-seasonal structure.
Despite the broad applicability of CL-OCC for unsupervised industrial monitoring, several aspects remain open for further enhancement. Future work will explore mechanisms to improve sensitivity to fine-scale and impulsive anomalies, including multi-resolution feature extraction and transformer-based encoders. In addition, adaptive STL parameterization and data-driven seasonal-period estimation may strengthen cross-domain generalization. Extending the framework toward multimodal sensing, spike-level detection, and online prognostics and health management (PHM) adaptation will also enable more comprehensive and real-time monitoring in complex manufacturing environments.
Despite the fact that CL-OCC offers a pragmatic and widely applicable solution for unsupervised industrial monitoring, there are still opportunities to expand it in order to enhance its responsiveness to fine-scale anomalies and adapt it to multi-resolution or transformer-based encoders. Subsequent research endeavors will investigate the integration of spike-level detection, multimodal sensing, and online prognostics and health management (PHM) deployment to facilitate more comprehensive and real-time monitoring in complex manufacturing environments.