A Cost-Sensitive Transformer Model for Prognostics Under Highly Imbalanced Industrial Data

Ali Beikmohammadi, Mohammad Hosein Hamian, Neda Khoeyniha, Tony Lindgren, Olof Steinert, Sindri MagnússonarXiv 2024 · DOI

Abstract

Industrial prognostics—predicting equipment failure before it occurs—is critical for reducing maintenance costs and downtime. However, real-world industrial data often suffers from high rates of missing values, extreme class imbalance, and asymmetric misclassification costs. This paper presents a specialized machine learning workflow that integrates a Transformer architecture with Focal Loss and a hybrid resampling strategy. By prioritizing the reduction of high-cost False Negatives, the proposed model achieves state-of-the-art performance on heavy machinery benchmarks, significantly lowering total operational costs compared to conventional approaches.

Introduction: The Challenges of Industrial Data

In heavy industries, such as automotive manufacturing and semiconductor fabrication, sensor data is notoriously difficult to model. The authors identify three primary hurdles that typically degrade the performance of conventional AI models:

  1. Missing Values: Sensor malfunctions or connectivity issues lead to significant gaps in data records.
  2. Extreme Class Imbalance: Equipment failures are rare events. Datasets often contain tens of thousands of "healthy" examples for every single "failure," leading models to bias toward the majority class.
  3. Asymmetric Costs: The financial impact of errors is uneven. A False Positive (unnecessary inspection) might cost $10, while a False Negative (unpredicted breakdown) can cost $500 in repairs and lost productivity.
Class distribution in the Scania APS dataset, highlighting the extreme imbalance between healthy (negative) and failure (positive) instances.

Standard models often optimize for overall accuracy, which is misleading in this context; a model can be 99% accurate by never predicting a failure, yet remain financially disastrous.

Methodology

The proposed workflow addresses these challenges through a multi-stage systematic approach:

Data Imputation and Resampling

To handle missing data, the authors employ Bayesian Ridge Regression, an iterative approach that treats missing values as variables to be predicted based on other available features. To address class imbalance, a hybrid resampling strategy is used: SVM-SMOTE generates synthetic failure examples to oversample the minority class, while Repeated Edited Nearest Neighbor (ENN) prunes noisy or redundant healthy examples from the majority class.

Model Architecture

The core of the system is a custom-built Transformer model. While typically used for natural language processing, the authors leverage its self-attention mechanism to capture complex correlations between disparate sensor readings, regardless of their position in the data record.

Architecture of the proposed Transformer-based model, featuring a Transformer Encoder and a cost-sensitive classifier.

Cost-Sensitive Focal Loss

Instead of standard Cross-Entropy loss, the model utilizes Focal Loss. Originally developed for object detection, Focal Loss focuses the learning process on "hard" examples—the rare failures—by heavily penalizing misclassifications of the minority class. This effectively embeds the $500 failure penalty directly into the model's optimization objective.

Experimental Results

The model was evaluated on two major industrial benchmarks: the Scania Trucks APS Failure Dataset (76,000 instances, 59:1 imbalance) and the SECOM Semiconductor Dataset.

The primary metric for success was Total Cost. On the Scania dataset, the proposed model achieved a total cost of $3,440, significantly outperforming recent LSTM and Gradient Boosting models, which incurred costs ranging from $4,000 to over $10,000. On the SECOM dataset, the model achieved a cost of $950, surpassing previous benchmarks that ranged from $1,000 to $5,100.

Key Insights

  • Tabular Transformers: Self-attention is highly effective at finding hidden correlations between sensors, such as how a temperature spike in one subsystem relates to a pressure drop in another.
  • Loss Function Priority: Ablation studies revealed that Focal Loss was the single most impactful component. For industrial AI, how the model is penalized is often more critical than the specific architecture used.
  • Noise Reduction: The hybrid resampling strategy demonstrated that simply adding more data is insufficient; removing "noise" from the majority class is essential for establishing clear decision boundaries.

Conclusion and Future Work

While the Transformer-based approach is computationally intensive, requiring significant GPU resources, its ability to minimize high-stakes financial losses makes it a compelling solution for large-scale industrial applications. Future research will focus on testing this "Transformer + Focal Loss" framework across other sectors, such as energy and civil infrastructure, to further validate its generalizability.

Summary updated

BibTeX
@misc{beikmohammadi2024cost,
  author = {Ali Beikmohammadi and Mohammad Hosein Hamian and Neda Khoeyniha and Tony Lindgren and Olof Steinert and Sindri Magnússon},
  title = {{A Cost-Sensitive Transformer Model for Prognostics Under Highly Imbalanced Industrial Data}},
  year = {2024},
  eprint = {2402.08611},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2402.08611},
}
Figure