Department of Computer Science and Applications, Faculty of Science and Humanities, SRM Institute of Science and Technology, Ramapuram. Chennai, Tamil Nadu, India.
Department of Computer Science and Engineering (Artificial Intelligence and Machine Learning), Vel Tech Rangarajan Dr. Sagunthala R&D Institute of Science and Technology (Deemed to be University), Avadi, Chennai, Tamil Nadu, India.
Computer Numerical Control (CNC) machines play a pivotal role in modern precision manufacturing, where real-time monitoring is essential to prevent catastrophic failures and minimize downtime. This study proposes a Fuzzy Logic-Enhanced Expert System (FLEES) for real-time anomaly detection in CNC machines, leveraging linguistic rule inference fused with physical constraints and data-driven optimization. The system processes 14 distinct sensory inputs, including spindle vibration, cutting torque, thermal gradients, and acoustic emissions, gathered from 120 hours of high-frequency CNC machine operation under varying load conditions. Fuzzification maps raw sensor signals to 42 linguistic variables using Gaussian and trapezoidal membership functions. A total of 96 fuzzy rules were formulated based on expert knowledge and refined via Particle Swarm Optimization (PSO) guided by energy consistency and classification loss minimization. Experiments conducted on a benchmark CNC dataset show that FLEES achieves 96.7% anomaly classification accuracy, with 95.3% sensitivity and 97.9% specificity, outperforming existing methods, including SVM (91.2%) and LSTM (94.1%). Moreover, the system maintains a real-time response under 180 milliseconds per inference cycle. These results confirm that integrating fuzzy reasoning with physics-informed optimization enhances reliability and interpretability for real-time fault diagnostics in smart manufacturing.
T. Zabinski, Z. Hajduk, J. Kluska, and L. Gniewek, “FPGA-Embedded Anomaly Detection System for Milling Process,” IEEE Access, vol. 9, pp. 124059–124069, 2021, doi: 10.1109/access.2021.3110479.
M. Züfle, F. Moog, V. Lesch, C. Krupitzer, and S. Kounev, “A machine learning-based workflow for automatic detection of anomalies in machine tools,” ISA Transactions, vol. 125, pp. 445–458, Jun. 2022, doi: 10.1016/j.isatra.2021.07.010.
J. M. Silva, A. R. Nogueira, J. Pinto, A. C. Alves, and R. Sousa, “Time-Series Pattern Verification in CNC Machining Data,” Progress in Artificial Intelligence, pp. 299–310, 2023, doi: 10.1007/978-3-031-49008-8_24.
E. Li, Y. Li, S. Kakarla, W. Melek, and S. Bedi, “Transfer learning methods for Three-Axis CNC anomaly detection,” Advanced Manufacturing, 2024, doi: 10.55092/am20240010.
A. Alghassi, “Generalized Anomaly Detection Algorithm Based on Time Series Statistical Features,” Implementing Industry 4.0, pp. 177–200, 2021, doi: 10.1007/978-3-030-67270-6_7.
G. Li, Y. Fu, D. Chen, L. Shi, and J. Zhou, “Deep Anomaly Detection for CNC Machine Cutting Tool Using Spindle Current Signals,” Sensors, vol. 20, no. 17, p. 4896, Aug. 2020, doi: 10.3390/s20174896.
R. Çekik and A. Turan, “Deep Learning for Anomaly Detection in CNC Machine Vibration Data: A RoughLSTM-Based Approach,” Applied Sciences, vol. 15, no. 6, p. 3179, Mar. 2025, doi: 10.3390/app15063179.
V. Justus and K. G R, “Intelligent Single-Board Computer for Industry 4.0: Efficient Real-Time Monitoring System for Anomaly Detection in CNC Machines,” Microprocessors and Microsystems, vol. 93, p. 104629, Sep. 2022, doi: 10.1016/j.micpro.2022.104629.
E. Li, S. Bedi, and W. Melek, “Anomaly detection in three-axis CNC machines using LSTM networks and transfer learning,” The International Journal of Advanced Manufacturing Technology, vol. 127, no. 11–12, pp. 5185–5198, Jul. 2023, doi: 10.1007/s00170-023-11617-5.
A. Athar, M. A. I. Mozumder, Abdullah, S. Ali, and H.-C. Kim, “Deep learning-based anomaly detection using one-dimensional convolutional neural networks (1D CNN) in machine centers (MCT) and computer numerical control (CNC) machines,” PeerJ Computer Science, vol. 10, p. e2389, Oct. 2024, doi: 10.7717/peerj-cs.2389.
L. Zhang, S. Elghazoly, and B. Tweedie, “Introducing AnomDB: An Unsupervised Anomaly Detection Method for CNC Machine Control Data,” Annual Conference of the PHM Society, vol. 11, no. 1, Sep. 2019, doi: 10.36001/phmconf.2019.v11i1.806.
J.-M. Woo, S.-H. Ju, J.-H. Sung, and K.-M. Seo, “Meta-Learning-Based LSTM-Autoencoder for Low-Data Anomaly Detection in Retrofitted CNC Machine Using Multi-Machine Datasets,” Systems, vol. 13, no. 7, p. 534, Jul. 2025, doi: 10.3390/systems13070534.
G. Herranz, A. Antolínez, J. Escartín, A. Arregi, and J. K. Gerrikagoitia, “Machine Tools Anomaly Detection Through Nearly Real-Time Data Analysis,” Journal of Manufacturing and Materials Processing, vol. 3, no. 4, p. 97, Dec. 2019, doi: 10.3390/jmmp3040097.
Boltshauser, F. (2023). Anomaly detection for prediction of failures in manufacturing environments: Machine learning based semi-supervised anomaly detection for multivariate time series to predict failures in a CNC machine.
Y. C. Liang, S. Wang, W. D. Li, and X. Lu, “Data-Driven Anomaly Diagnosis for Machining Processes,” Engineering, vol. 5, no. 4, pp. 646–652, Aug. 2019, doi: 10.1016/j.eng.2019.03.012.
S. Yan, H. Shao, Y. Xiao, B. Liu, and J. Wan, “Hybrid robust convolutional autoencoder for unsupervised anomaly detection of machine tools under noises,” Robotics and Computer-Integrated Manufacturing, vol. 79, p. 102441, Feb. 2023, doi: 10.1016/j.rcim.2022.102441.
S. F. Chevtchenko et al., “Anomaly Detection in Industrial Machinery Using IoT Devices and Machine Learning: A Systematic Mapping,” IEEE Access, vol. 11, pp. 128288–128305, 2023, doi: 10.1109/access.2023.3333242.
E. Li, Y. Li, S. Bedi, W. Melek, and P. Gray, “Incremental learning of LSTM-autoencoder anomaly detection in three-axis CNC machines,” The International Journal of Advanced Manufacturing Technology, vol. 130, no. 3–4, pp. 1265–1277, Dec. 2023, doi: 10.1007/s00170-023-12713-2.
Y. Li, Z. Zhao, Z. Peng, L. Zhang, W. Ding, and Y. Fu, “An innovative strategy for real-time tool anomaly detection in CNC milling processes using time series monitoring,” Frontiers of Mechanical Engineering, vol. 20, no. 3, Jun. 2025, doi: 10.1007/s11465-025-0837-3.
H. Ha, D. Min, and J. Jeong, “A Novel Clustering Anomaly Detection of PCA Based Time Series Features with CNC Machines Data,” Information Systems and Technologies, pp. 22–31, 2022, doi: 10.1007/978-3-031-04826-5_3.
Li, E. (2024). Anomaly Detection in CNC Milling Machines using Transfer and Incremental Ensemble Learning of LSTM Autoencoder Networks.
The authors confirm contribution to the paper as follows:
Conceptualization: Atulya Gupta, Josphin Mary J, Nandhini I, Thivya Lakshmi R T, Santhi M V B T and Pari R;
Writing- Original Draft Preparation: Atulya Gupta, Josphin Mary J, Nandhini I, Thivya Lakshmi R T, Santhi M V B T and Pari R;
Visualization: Atulya Gupta, Josphin Mary J and Nandhini I;
Investigation: Thivya Lakshmi R T, Santhi M V B T and Pari R;
Supervision: Atulya Gupta, Josphin Mary J and Nandhini I;
Validation: Thivya Lakshmi R T, Santhi M V B T and Pari R;
Writing- Reviewing and Editing: Atulya Gupta, Josphin Mary J, Nandhini I, Thivya Lakshmi R T, Santhi M V B T and Pari R; All authors reviewed the results and approved the final version of the manuscript.
Acknowledgements
The author(s) received no financial support for the research, authorship, and/or publication of this article.
Funding
No funding was received to assist with the preparation of this manuscript.
Ethics declarations
Conflict of interest
The authors have no conflicts of interest to declare that are relevant to the content of this article.
Availability of data and materials
Data sharing is not applicable to this article as no new data were created or analysed in this study.
Author information
Contributions
All authors have equal contribution in the paper and all authors have read and agreed to the published version of the manuscript.
Corresponding author
Atulya Gupta
Department of Computer Science and Engineering, SRM Institute of Science and Technology, Delhi-NCR Campus, Ghaziabad, Uttar Pradesh, India.
Open Access This article is licensed under a Creative Commons Attribution NoDerivs is a more restrictive license. It allows you to redistribute the material commercially or non-commercially but the user cannot make any changes whatsoever to the original, i.e. no derivatives of the original work. To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-nd/4.0/
Cite this article
Atulya Gupta, Josphin Mary J, Nandhini I, Thivya Lakshmi R T, Santhi M V B T and Pari R, “Fuzzy Logic-Enhanced Expert System for Real Time Anomaly Detection in CNC Machines”, Journal of Machine and Computing, vol.5, no.4, pp. 2615-2624, October 2025, doi: 10.53759/7669/jmc202505201.