Multiclass Anomaly Detection in Bridge Health Monitoring Data via Attention Enhancement and Class Imbalance Mitigation
Abstract
1. Introduction
- (1)
- A CBAM-enhanced ResNet50 is developed to strengthen both channel-wise and spatial feature responses, improving the sensitivity to subtle anomaly patterns and reducing background interference in time-history images.
- (2)
- The Focal Loss is adopted to address class imbalance by reducing the dominance of easy samples and enhancing learning on minority and hard-to-classify categories; its impact is quantified using standard metrics such as accuracy and recall.
2. Proposed Method
2.1. Overview of Proposed Framework
2.2. Model Architecture Design
2.2.1. Backbone Network Architecture
2.2.2. CBAM: Channel and Spatial Attention Mechanisms
- (1)
- Channel attention module
- (2)
- Spatial attention module
- (3)
- Embedding of the attention module into the residual block
2.3. Loss Function
2.4. Evaluation Indicator
3. Case Study
3.1. Data Description
3.2. Data Visualization and Ground-Truth Labeling
3.3. Model Training and Testing
3.3.1. Training Result Analysis
3.3.2. Testing Result Analysis
3.4. Comparative Study
3.4.1. Comparison with Traditional Deep CNN
3.4.2. Comparison with Different Methods
4. Practical Application Analysis on Full-Month BSHM Data
5. Conclusions
- Incorporating CBAM into ResNet50 is observed to improve recognition performance, particularly for confusing categories such as “noise” and “outlier”, leading to improved overall accuracy and more balanced class-wise F1-scores on the studied dataset.
- Attention heatmap visualization suggests that CBAM helps the network emphasize waveform-related regions while suppressing irrelevant background responses, providing an intuitive interpretation for the performance gain under complex monitoring scenarios.
- Using Focal Loss during training improves the classification of minority and hard-to-classify categories. In particular, the F1-score of the “noise” class increases from 0.7629 to 0.8866, and that of the “outlier” class increases from 0.9011 to 0.9278, indicating reduced performance degradation caused by class imbalance in the considered dataset.
- The month-long diagnosis results show that the proposed framework can capture the overall category distribution and reveal representative spatiotemporal patterns of abnormal data, which is useful for large-scale data screening in practical monitoring tasks.
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Xin, J.; Tao, G.; Tang, Q.; Zou, F.; Xiang, C. Structural Damage Identification Method Based on Swin Transformer and Continuous Wavelet Transform. Intell. Robot. 2024, 4, 200–215. [Google Scholar] [CrossRef]
- Wang, C.; Tang, Q.; Wu, B.; Jiang, Y.; Xin, J. Intelligent Bridge Monitoring System Operational Status Assessment Using Analytic Network-Aided Triangular Intuitionistic Fuzzy Comprehensive Model. Intell. Robot. 2025, 5, 378–403. [Google Scholar] [CrossRef]
- Han, Q.; Zhao, N.; Xu, J. Recognition and Location of Steel Structure Surface Corrosion Based on Unmanned Aerial Vehicle Images. J. Civ. Struct. Health Monit. 2021, 11, 1375–1392. [Google Scholar] [CrossRef]
- Xu, J.; Liu, H.; Han, Q. Blockchain Technology and Smart Contract for Civil Structural Health Monitoring System. Comput.-Aided Civ. Infrastruct. Eng. 2021, 36, 1288–1305. [Google Scholar] [CrossRef]
- Ju, H.; Zhai, W.; Deng, Y.; Chen, M.; Li, A. Temperature Time-Lag Effect Elimination Method of Structural Deformation Monitoring Data for Cable-Stayed Bridges. Case Stud. Therm. Eng. 2023, 42, 102696. [Google Scholar] [CrossRef]
- Fu, Y.; Peng, C.; Gomez, F.; Narazaki, Y.; Spencer, B.F., Jr. Sensor Fault Management Techniques for Wireless Smart Sensor Networks in Structural Health Monitoring. Struct. Control Health Monit. 2019, 26, e2362. [Google Scholar] [CrossRef]
- Ju, H.; Deng, Y.; Zhai, W.; Li, A. Recovery of Abnormal Data for Bridge Structural Health Monitoring Based on Deep Learning and Temporal Correlation. Sens. Mater. 2022, 34, 4491. [Google Scholar] [CrossRef]
- Zhang, Y.; Wang, X.; Ding, Z.; Du, Y.; Xia, Y. Anomaly Detection of Sensor Faults and Extreme Events Based on Support Vector Data Description. Struct. Control Health Monit. 2022, 29, e3047. [Google Scholar] [CrossRef]
- Ruff, L.; Kauffmann, J.R.; Vandermeulen, R.A.; Montavon, G.; Samek, W.; Kloft, M.; Dietterich, T.G.; Müller, K.-R. A Unifying Review of Deep and Shallow Anomaly Detection. Proc. IEEE 2021, 109, 756–795. [Google Scholar] [CrossRef]
- Tang, Q.; Xin, J.; Jiang, Y.; Wang, K.; Zhou, J. Efficient Assessment Method for Structural Safety of Long-Span Arch Bridges Using Subset Simulation and Copula Model. Appl. Math. Model. 2026, 154, 116726. [Google Scholar] [CrossRef]
- Pang, G.; Shen, C.; Cao, L.; Hengel, A.V.D. Deep Learning for Anomaly Detection: A Review. ACM Comput. Surv. (CSUR) 2021, 54, 38. [Google Scholar] [CrossRef]
- Gul, M.; Necati Catbas, F. Statistical Pattern Recognition for Structural Health Monitoring Using Time Series Modeling: Theory and Experimental Verifications. Mech. Syst. Signal Process. 2009, 23, 2192–2204. [Google Scholar] [CrossRef]
- Hernandez-Garcia, M.R.; Masri, S.F. Multivariate Statistical Analysis for Detection and Identification of Faulty Sensors Using Latent Variable Methods. Adv. Sci. Technol. 2008, 56, 501–507. [Google Scholar] [CrossRef]
- Zhang, H.; Lin, J.; Hua, J.; Gao, F.; Tong, T. Data Anomaly Detection for Bridge SHM Based on CNN Combined with Statistic Features. J. Nondestruct. Eval. 2022, 41, 28. [Google Scholar] [CrossRef]
- Jian, X.; Zhong, H.; Xia, Y.; Sun, L. Faulty Data Detection and Classification for Bridge Structural Health Monitoring via Statistical and Deep-learning Approach. Struct. Control Health Monit. 2021, 28, e2824. [Google Scholar] [CrossRef]
- Zhang, Y.; Tang, Z.; Yang, R. Data Anomaly Detection for Structural Health Monitoring by Multi-View Representation Based on Local Binary Patterns. Measurement 2022, 202, 111804. [Google Scholar] [CrossRef]
- Bao, Y.; Tang, Z.; Li, H.; Zhang, Y. Computer Vision and Deep Learning–Based Data Anomaly Detection Method for Structural Health Monitoring. Struct. Health Monit. 2019, 18, 401–421. [Google Scholar] [CrossRef]
- Wang, H.; Bah, M.J.; Hammad, M. Progress in Outlier Detection Techniques: A Survey. IEEE Access 2019, 7, 107964–108000. [Google Scholar] [CrossRef]
- Yang, J.; Yang, F.; Zhang, L.; Li, R.; Jiang, S.; Wang, G.; Zhang, L.; Zeng, Z. Bridge Health Anomaly Detection Using Deep Support Vector Data Description. Neurocomputing 2021, 444, 170–178. [Google Scholar] [CrossRef]
- Kao, J.-B.; Jiang, J.-R. Anomaly Detection for Univariate Time Series with Statistics and Deep Learning. In Proceedings of the 2019 IEEE Eurasia Conference on IOT, Communication and Engineering (ECICE), Yunlin, Taiwan, 3–6 October 2019; IEEE: New York, NY, USA, 2019; pp. 404–407. [Google Scholar]
- Ye, X.; Wu, P.; Liu, A.; Zhan, X.; Wang, Z.; Zhao, Y. A Deep Learning-Based Method for Automatic Abnormal Data Detection: Case Study for Bridge Structural Health Monitoring. Int. J. Struct. Stab. Dyn. 2023, 23, 2350131. [Google Scholar] [CrossRef]
- Yan, R.; Ma, Z.; Kokogiannakis, G.; Zhao, Y. A Sensor Fault Detection Strategy for Air Handling Units Using Cluster Analysis. Autom. Constr. 2016, 70, 77–88. [Google Scholar] [CrossRef]
- Titouna, C.; Aliouat, M.; Gueroui, M. Outlier Detection Approach Using Bayes Classifiers in Wireless Sensor Networks. Wirel. Pers. Commun. 2015, 85, 1009–1023. [Google Scholar] [CrossRef]
- Warriach, E.U.; Tei, K. Fault Detection in Wireless Sensor Networks: A Machine Learning Approach. In Proceedings of the 2013 IEEE 16th International Conference on Computational Science and Engineering, Sydney, Australia, 3–5 December 2013; IEEE: New York, NY, USA, 2013; pp. 758–765. [Google Scholar]
- Zidi, S.; Moulahi, T.; Alaya, B. Fault Detection in Wireless Sensor Networks Through SVM Classifier. IEEE Sens. J. 2018, 18, 340–347. [Google Scholar] [CrossRef]
- Saeed, U.; Lee, Y.-D.; Jan, S.U.; Koo, I. CAFD: Context-Aware Fault Diagnostic Scheme towards Sensor Faults Utilizing Machine Learning. Sensors 2021, 21, 617. [Google Scholar] [CrossRef]
- Chou, J.-Y.; Fu, Y.; Huang, S.-K.; Chang, C.-M. SHM Data Anomaly Classification Using Machine Learning Strategies: A Comparative Study. Smart Struct. Syst. 2022, 29, 77–91. [Google Scholar] [CrossRef]
- Jiang, H.; Ge, E.; Wan, C.; Li, S.; Quek, S.T.; Yang, K.; Ding, Y.; Xue, S. Data Anomaly Detection with Automatic Feature Selection and Deep Learning. Structures 2023, 57, 105082. [Google Scholar] [CrossRef]
- Ni, F.; Zhang, J.; Noori, M.N. Deep Learning for Data Anomaly Detection and Data Compression of a Long-span Suspension Bridge. Comput. Civ. Infrastruct. Eng. 2020, 35, 685–700. [Google Scholar] [CrossRef]
- Deng, Y.; Zhao, Y.; Ju, H.; Yi, T.-H.; Li, A. Abnormal Data Detection for Structural Health Monitoring: State-of-the-Art Review. Dev. Built Environ. 2024, 17, 100337. [Google Scholar] [CrossRef]
- Hossain, M.S.; Betts, J.M.; Paplinski, A.P. Dual Focal Loss to Address Class Imbalance in Semantic Segmentation. Neurocomputing 2021, 462, 69–87. [Google Scholar] [CrossRef]
- Chalapathy, R.; Chawla, S. Deep Learning for Anomaly Detection: A Survey. arXiv 2019, arXiv:1901.03407. [Google Scholar] [CrossRef]
- Gao, K.; Chen, Z.-D.; Weng, S.; Zhu, H.-P.; Wu, L.-Y. Detection of Multi-Type Data Anomaly for Structural Health Monitoring Using Pattern Recognition Neural Network. Smart Struct. Syst. 2022, 29, 129–140. [Google Scholar] [CrossRef]
- Liu, Y.; Di, S. Spatio-Temporal Variational Reconstruction Deep Support Vector Data Description for Anomaly Detection in Bridge SHM Data. Mech. Syst. Signal Process. 2026, 244, 113767. [Google Scholar] [CrossRef]
- Qu, C.-X.; Yang, Y.-T.; Zhang, H.-M.; Yi, T.-H.; Li, H.-N. Two-Stage Anomaly Detection for Imbalanced Bridge Data by Attention Mechanism Optimisation and Small Sample Augmentation. Eng. Struct. 2025, 327, 119613. [Google Scholar] [CrossRef]
- Schlegl, T.; Seeböck, P.; Waldstein, S.M.; Schmidt-Erfurth, U.; Langs, G. Unsupervised Anomaly Detection with Generative Adversarial Networks to Guide Marker Discovery. In Information Processing in Medical Imaging, Proceedings of the 25th International Conference, IPMI 2017, Boone, NC, USA, 25–30 June 2017; Springer: Cham, Switzerland, 2017; Volume 10265, pp. 146–157. [Google Scholar]
- Akcay, S.; Atapour-Abarghouei, A.; Breckon, T.P. Ganomaly: Semi-Supervised Anomaly Detection via Adversarial Training. In Computer Vision–ACCV 2018, Proceedings of the 14th Asian Conference on Computer Vision, Perth, Australia, 2–6 December 2018; Springer: Cham, Switzerland, 2018; pp. 622–637. [Google Scholar]
- Mutlu, U.; Alpaydın, E. Training Bidirectional Generative Adversarial Networks with Hints. Pattern Recognit. 2020, 103, 107320. [Google Scholar] [CrossRef]
- Mao, J.; Wang, H.; Spencer, B.F., Jr. Toward Data Anomaly Detection for Automated Structural Health Monitoring: Exploiting Generative Adversarial Nets and Autoencoders. Struct. Health Monit. 2021, 20, 1609–1626. [Google Scholar] [CrossRef]
- Deng, Y.; Ju, H.; Zhong, G.; Li, A.; Ding, Y. A General Data Quality Evaluation Framework for Dynamic Response Monitoring of Long-Span Bridges. Mech. Syst. Signal Process. 2023, 200, 110514. [Google Scholar] [CrossRef]
- Liu, G.; Niu, Y.; Zhao, W.; Duan, Y.; Shu, J. Data Anomaly Detection for Structural Health Monitoring Using a Combination Network of GANomaly and CNN. Smart Struct. Syst. 2022, 29, 53–62. [Google Scholar] [CrossRef]
- Shajihan, S.A.V.; Wang, S.; Zhai, G.; Spencer, B.F., Jr. CNN Based Data Anomaly Detection Using Multi-Channel Imagery for Structural Health Monitoring. Smart Struct. Syst. 2022, 29, 181–193. [Google Scholar] [CrossRef]
- Du, Y.; Li, L.; Hou, R.; Wang, X.; Tian, W.; Xia, Y. Convolutional Neural Network-Based Data Anomaly Detection Considering Class Imbalance with Limited Data. Smart Struct. Syst. 2022, 29, 63–75. [Google Scholar] [CrossRef]
- Zhao, M.; Sadhu, A.; Capretz, M. Multiclass Anomaly Detection in Imbalanced Structural Health Monitoring Data Using Convolutional Neural Network. J. Infrastruct. Preserv. Resil. 2022, 3, 10. [Google Scholar] [CrossRef]
- Zhu, Q.; Wu, Q.; Yue, Y.; Bao, Y.; Zhang, T.; Wang, X.; Jiang, Z.; Chen, H. Vision Transformer–Based Anomaly Detection Method for Offshore Platform Monitoring Data. Struct. Control Health Monit. 2024, 2024, 1887212. [Google Scholar] [CrossRef]
- Tang, Z.; Chen, Z.; Bao, Y.; Li, H. Convolutional Neural Network-Based Data Anomaly Detection Method Using Multiple Information for Structural Health Monitoring. Struct. Control Health Monit. 2019, 26, e2296. [Google Scholar] [CrossRef]
- Pan, Q.; Bao, Y.; Li, H. Transfer Learning-Based Data Anomaly Detection for Structural Health Monitoring. Struct. Health Monit. 2023, 22, 3077–3091. [Google Scholar] [CrossRef]
- Ridnik, T.; Lawen, H.; Noy, A.; Ben Baruch, E.; Sharir, G.; Friedman, I. Tresnet: High Performance Gpu-Dedicated Architecture. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, Online, 5–9 January 2021; IEEE: New York, NY, USA, 2021; pp. 1400–1409. [Google Scholar]
- Penugonda, G.; Singamaneni, R.; Kalyani, A.L. A Comparative Study for Monocot Remembrance Using VGG16, EfficientNet, InceptionV3, and ResNet50 on Accuracy and Response Time. In Proceedings of the 2023 12th International Conference on System Modeling & Advancement in Research Trends (SMART), Moradabad, India, 22–23 December 2023; IEEE: New York, NY, USA, 2023; pp. 218–224. [Google Scholar]
- He, K.; Zhang, X.; Ren, S.; Sun, J. Deep Residual Learning for Image Recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA, 27–30 June 2016; IEEE: New York, NY, USA, 2016; pp. 770–778. [Google Scholar]
- Woo, S.; Park, J.; Lee, J.-Y.; Kweon, I.S. Cbam: Convolutional Block Attention Module. In Proceedings of the European Conference on Computer Vision (ECCV), Munich, Germany, 8–14 September 2018; Springer Natura: Cham, Switzerland, 2018; pp. 3–19. [Google Scholar]





















| Channel Number | Location | Direction |
|---|---|---|
| 1–2 | The main beam at the 1/2 span of the left-side span | X, Z |
| 3–4 | The main beam at the 1/5 span of the main span | X, Z |
| 5–6 | The main beam at the 2/5 span of the main span | X, Z |
| 7–8 | The main beam at the 7/10 span of the main span | X, Z |
| 9–10 | The main beam at the 1/2 span of the right-side span | X, Z |
| 11–12 | The top of the 1# tower | X, Y |
| 13–14 | The top of the 2# tower | X, Y |
| Data Category | Image Description | Sample Size |
|---|---|---|
| Environmental excitation | Irregular fluctuations in amplitude | 1367 |
| Noise | Small and stable amplitude without fluctuation | 462 |
| Missing | Mostly blank or constant-value image | 296 |
| Normal | Large, periodic oscillations around the center line | 7795 |
| Outlier | One or more extreme values appear | 496 |
| Output | VGG16 | DenseNet121 | ||||
|---|---|---|---|---|---|---|
| Precision | Recall | F1-Score | Precision | Recall | F1-Score | |
| Environmental excitation | 78.95 | 98.54 | 87.66 | 95.54 | 78.10 | 85.94 |
| Noise | 93.33 | 59.57 | 72.73 | 78.00 | 76.47 | 77.23 |
| Missing | 100 | 100 | 100 | 100 | 100 | 100 |
| Normal | 99.61 | 98.85 | 99.23 | 99.62 | 100 | 99.81 |
| Outlier | 100 | 78.00 | 87.64 | 95.92 | 94.00 | 94.95 |
| Macro-average | 94.37 | 86.99 | 89.45 | 93.82 | 89.71 | 91.59 |
| Accuracy | 96.07 | 96.36 | ||||
| Output | EfficientNet-B0 | Proposed Method | ||||
|---|---|---|---|---|---|---|
| Precision | Recall | F1-Score | Precision | Recall | F1-Score | |
| Environmental excitation | 93.60 | 85.40 | 89.31 | 96.27 | 94.16 | 95.20 |
| Noise | 72.22 | 82.98 | 77.23 | 86.00 | 91.49 | 88.66 |
| Missing | 100 | 100 | 100 | 100 | 100 | 100 |
| Normal | 99.62 | 100 | 99.81 | 99.49 | 99.87 | 99.68 |
| Outlier | 88.46 | 92.00 | 90.20 | 95.74 | 90.00 | 92.78 |
| Macro-average | 90.78 | 92.08 | 91.31 | 95.50 | 95.10 | 95.26 |
| Accuracy | 96.93 | 98.28 | ||||
| Output | Method 1 | Method 2 | Proposed Method | |||
|---|---|---|---|---|---|---|
| Precision | Recall | Precision | Recall | Precision | Recall | |
| Environmental excitation | 79.38 | 92.70 | 89.21 | 90.51 | 96.27 | 94.16 |
| Noise | 68.75 | 46.81 | 74.00 | 78.72 | 86.00 | 91.49 |
| Missing | 100 | 100 | 96.77 | 100 | 100 | 100 |
| Normal | 99.87 | 98.97 | 99.49 | 99.87 | 99.49 | 99.87 |
| Outlier | 83.67 | 82.00 | 100 | 82.00 | 95.74 | 90.00 |
| Macro-average | 86.33 | 84.10 | 91.89 | 90.22 | 95.50 | 95.10 |
| Accuracy | 95.02 | 96.84 | 98.28 | |||
| Data Category | Quantity | Proportion of Total Data (%) | Proportion Within Anomaly Data (%) | |||
|---|---|---|---|---|---|---|
| Diagnostic Results | Actual Values | Diagnostic Results | Actual Values | Diagnostic Results | Actual Values | |
| Normal | 7828 | 7795 | 75.2 | 74.8 | - | - |
| Environmental excitation | 1373 | 1367 | 13.2 | 13.1 | - | - |
| Noise | 442 | 462 | 4.2 | 4.4 | - | - |
| Missing | 303 | 296 | 2.9 | 2.8 | 39.2 | 37.4 |
| Outlier | 470 | 496 | 4.5 | 4.8 | 60.8 | 62.6 |
| Subtotal (Anomaly Data) | 773 | 792 | 7.4 | 7.6 | 100.0 | 100.0 |
| Total | 10416 | 10416 | 100.0 | 100.0 | - | |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Ma, W.; Tang, Q.; Huang, L.; Zhang, S. Multiclass Anomaly Detection in Bridge Health Monitoring Data via Attention Enhancement and Class Imbalance Mitigation. Buildings 2026, 16, 1181. https://doi.org/10.3390/buildings16061181
Ma W, Tang Q, Huang L, Zhang S. Multiclass Anomaly Detection in Bridge Health Monitoring Data via Attention Enhancement and Class Imbalance Mitigation. Buildings. 2026; 16(6):1181. https://doi.org/10.3390/buildings16061181
Chicago/Turabian StyleMa, Wenda, Qizhi Tang, Lei Huang, and Shihao Zhang. 2026. "Multiclass Anomaly Detection in Bridge Health Monitoring Data via Attention Enhancement and Class Imbalance Mitigation" Buildings 16, no. 6: 1181. https://doi.org/10.3390/buildings16061181
APA StyleMa, W., Tang, Q., Huang, L., & Zhang, S. (2026). Multiclass Anomaly Detection in Bridge Health Monitoring Data via Attention Enhancement and Class Imbalance Mitigation. Buildings, 16(6), 1181. https://doi.org/10.3390/buildings16061181

