An Embedded Machine Learning Fault Detection System for Electric Fan Drive
Abstract
:1. Introduction
- Introduction of an Embedded Machine Learning Approach: Establishing the application of embedded machine learning for real-time anomalies detection.
- Development and Evaluation of Multiple ML Algorithms: Developed diverse ML algorithms (CNN, SVM, RF, GB, K-NN) and evaluated their effectiveness for fan state classification.
- Optimization of a CNN model for Vibration Signal Monitoring: Developed a CNN model specifically tailored for vibration signals with automatic feature extraction and simplified data pre-processing.
- Cost-Effective Design: Designing the project to be cost-effective, making it accessible to a wide range of people and businesses.
- Versality Across Industries: Demonstrated the potential applicability of the developed model in various industries if they produce vibration signals recordable by an accelerometer.
2. Materials and Methods
2.1. Overall Block Diagram of the Project
2.2. Overview: Machine Learning Methods
2.3. Advantages of CNNs for Vibration Signal Analysis
2.3.1. Convolutional Neutral Network
- (1)
- Convolutional layer
- (2)
- Non-linear activation function
- (3)
- Pooling layer
- (4)
- Fully connected layer
2.3.2. Design and Development
- (1)
- Data Collection
- Fan-On State: no external vibration source was introduced. The data solely represent the vibration patterns collected from a normally operating fan.
- Fan-Off State: the fan was turned off during data collection.
- Fan-Fault State: devices were used to interfere with the fan blades and hence induce vibration and disturb the normal operation of the fan. These devices were placed on different locations of the fan, each with varying levels of vibration. This approach aimed to cover a diverse range of vibration scenarios, ensuring the robustness and generality of the data.
- Fan-On (Blue): The signal is smooth, continuous waveform with only small amplitude variation over time.
- Fan-Off (Red): The signal is flat with minimal variation, indicating little to no vibration due to the absence of fan rotation.
- Fan-Fault (Yellow): The signal has an irregular waveform with significant amplitude variation, resulting from the higher frequency vibrations caused by friction.
- (2)
- Data pre-processing
- Data checking and cleaning: Duplicated or irrelevant data were removed to ensure accurate and reliable analysis.
- Data normalization: Scaling the features to a common range improves the performance of ML models and prevents over-reliance on certain features. The signal is scaled to a new range of [−1, 1] instead of [0, 1], because the sign of the signal can be preserved for vibration signals which contain both positive and negative values. An approach was adopted to normalize the data from 0 to 1; however, this resulted in a model with poorer accuracy. The normalization equation [16] that is used in this project is given by:
- 3.
- Feature Selection: Only the most relevant features (X, Y, Z axes of vibration signals) were selected for the classification task of fan states, reducing dimensionality and improving model performance.
- 4.
- Train–Test Split: Separating the entire data set into a training set and a test set is another pre-processing step. The separation of the data prevents information from the test set from leaking into the training set. This method is typically used to assess the model’s overall performance during training and then cross-validate it against the test set. The true purpose of data splitting is to allow the network to forecast vibration characteristics from previously unseen data (i.e., data not used during training).
- 5.
- Data Reshaping: This step is crucial to ensure the model can handle the inputs. The vibration signals are reshaped into 2D tensors instead of 1D tensors to capture correlations and patterns across multiple dimensions. The three axes (X, Y, Z) in the vibration signal represent different correlations and patterns that can be observed in these dimensions. This enables a more comprehensive analysis of the signal, making it easier to identify complex patterns and features that may not be evident in a 1D tensor. In addition, CNNs are well-suited for handling 2D tensors, as they excel in capturing correlations and patterns in image-like data.
- (3)
- Network Architecture
- -
- The first layer is a Conv2D layer that executes 2D convolution on the input data. The layer employs the ReLu activation function and has eight filters of size (3 × 3), which means that it will produce eight feature maps, each of size (128, 1). ‘Same’ padding is used to ensure the output size is the same as the input size. The layer’s output shape is (None, 128, 1, 8), where None can be considered as a placeholder for the batch size of the input.
- -
- The second layer is a MaxPooling2D layer that maximizes pooling over the output results of the previous layer. The pool size is (2, 2), has strides of (2, 2) and “same” padding, so the output shape of this layer is (None, 64, 1, 8), which is half the dimensions of the output features.
- -
- In the third layer, a dropout layer with a rate of 0.5 is used which applies dropout regularization to the output of the previous layer, randomly dropping out 50% of the units. This layer has no output shape, as it only affects the training process and has no trainable parameters.
- -
- The fourth layer is another Conv2D layer using 16 filters of a size of 3 × 3 with the ReLu activation function. This layer’s final output form is (None, 64, 1, 16).
- -
- Similarly, in the fifth layer, another MaxPooling2D layer with pool size (2, 2), strides of (2, 2) and “same” padding is applied. The output shape of this layer is reduced by half to (None, 32, 1, 16). This layer is again followed by a dropout layer with a rate of 0.2 to avoid overfitting. A relatively low dropout rate, like 0.2, implies that during training, 20% of the neurons in the layer are randomly “dropped out” at each update. The lower dropout rate in the initial layers allows the network to retain more information in the low-level features, providing a smoother learning curve at the beginning of training.
- -
- The seventh layer is the third convolutional layer, with 32 filters of size (3 × 3) and the ReLu activation function. This layer’s final output form is (None, 32, 1, 32).
- -
- The eighth layer is another MaxPooling2D layer that performs max pooling over the output of the previous layer. The pool size is (2, 2), which means that the output shape of this layer is (None, 16, 1, 32).
- -
- The ninth layer is another dropout layer with a rate of 0.2.
- -
- The tenth layer is a Flatten layer that flattens the output of the previous layer into a 1D vector. The output shape of this layer is (None, 512).
- -
- The eleventh layer is a fully connected layer with 128 units and uses the ReLu activation function. The output shape of this layer is (None, 128).
- -
- The twelfth and final layer is another dropout layer with a rate of 0.5 followed by a Dense layer with three units, which represents the number of classes in the output. This layer uses the SoftMax activation function, which outputs a probability distribution over the classes. The output shape of this layer is (None, 3).
- -
- The model complies with categorical cross-entropy loss function and Adam optimizer [19]—an upgraded version of the stochastic gradient descent to train the network and revise the weights iteratively according to training data, since they are commonly used for multi-class classification problems. An accuracy metric is used to assess the performance of the model because all classes in the dataset are balanced, and each class is equally important.
3. Results
3.1. CNN Model Accuracy and Loss
3.2. ML-Based Models Validation
3.3. Model Comparison with Traditional ML-Based Models
3.4. Model Deployment on Edge Device
- Model Deployment: The trained ML model was deployed on an embedded machine for real-time predictions. This deployment leveraged the LPCXpresso55S69 embedded microcontroller and the FXOS8700CQ three-axis accelerometer from NXP, ensuring seamless compatibility with the target environment.
- Utilization of NXP’s Repository: NXP’s repository played a pivotal role in this integration. Specifically, it housed the ML-Based System State Monitor App Software Pack, streamlining the deployment process. This software pack, designed for MCU-based systems, aligns seamlessly with the overall system architecture.
- MCUXpresso SDK Integration: The integration was further facilitated by utilizing the MCUXpresso SDK as the Integrated Development Environment (IDE) on the host machine. This SDK ensured the smooth delivery of the overall system.
- Consideration of Variations: It is important to note that for different types of fan applications, the collection of a new data set is essential to train the model. Variation in the positioning of sensors necessitates tailored datasets to ensure optimal model performance.
4. Discussion
- Despite the availability of several common convolutional models like Google Net, AlexNet, or Mobile Net, using a simpler model has the benefits of creating a small but highly efficient model that is straightforward to install on low-power edge devices. A simple model guarantees quick calculations, little memory usage, and preserves the device’s capability for real-time classification.
- Although it works with a small dataset which is collected for only 30 min, the CNN can be trained properly with enough training samples.
- This project has been tested on data from a real-world scenario, which would potentially perform well when implemented on a large industrial fan drive. The model can be applied to other types of machinery if they produce vibration signals that can be recorded by an accelerometer and analyzed using the same methodology. For instance, the model can find applications in smart door systems. Anomalies, such as attempted break-ins or hacking attempts, manifest as distinct vibration patterns during unauthorized door access. This triggers anomaly detection, notifying users of potential security breaches. However, the training data would need to be collected and labeled specifically for each type of machinery.
- The use of window slicing allows CNN models to extract more meaningful features from the signal and improve the accuracy of the algorithms, similar to how convolutional layers in CNNs extract features from images. The overlap ratio is also used to ensure that the windows are not completely independent of each other, allowing the model to capture the temporal relationship between adjacent windows.
- Accuracy, precision, recall, and F1-score were used as performance metrics to assess the performance of the developed models. It was found that the CNN model achieved the highest performance results even though it was trained using the raw input signals.
- Although it is well known that deeper networks frequently have more accuracy than shallow networks, they also have a high computational cost. They also have large computational footprints, which can delay the prediction time in a real-time classification problem. This study demonstrates that the CNN architecture developed in this project will yield the ideal model (considering both accuracy and low computational costs) that needs to be deployed on low-power edge devices like microcontrollers.
- It is noteworthy that the current model is trained for specific fan positioning. To extend the applicability of the algorithm to different machinery or alternative fan positions, the acquisition of tailored training data will be necessary.
5. Conclusions
- Embedded Machine Learning Approach: Successfully introduced an embedded machine learning approach, laying the foundation for real-time anomaly detection in the context of fan motor health monitoring.
- Diverse Algorithm Exploration: Conducted an in-depth analysis and development of commonly used ML algorithms, encompassing SVM, K-NN, Random Forest, and Gradient Boosting Classifiers.
- Optimization of CNN Model: Tailored a CNN model specifically for vibration signals, incorporating automatic feature extraction and simplified data pre-processing techniques to enhance fault detection accuracy.
- Cost-Effective Design: Strategically designed to be cost-effective, ensuring accessibility for a broad audience, including individuals and businesses.
- Versality Across Industries: Demonstrated the versatility of the developed model, showcasing its potential applications across various industries, if vibration signals are recordable by an accelerometer.
6. Future Work
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
Appendix A
References
- Kay, S.; Kosmas, D.; Jens, W. Machine Learning Techniques for structural health monitoring. In Proceedings of the 8th European Workshop on Structural Health Monitoring (EWSHM), Bilbao, Spain, 5–8 July 2016; p. 1. Available online: https://www.researchgate.net/publication/303933051_Machine_learning_techniques_for_structural_health_monitoring (accessed on 21 October 2022).
- Suda, N.; Loh, D. Machine Learning on Arm Cortex-M Microcontrollers. White Paper, 2019. Available online: https://www.arm.com/resources/guide/machine-learning-on-cortex-m (accessed on 12 March 2023).
- Tensor Flow. Tensor Flow Lite for Microcontroller. Tensor Flow, 2022. Available online: https://www.tensorflow.org/lite/microcontrollers (accessed on 11 November 2022).
- NXP Semiconductors. Image from NXP Catalogue. In NXP Catalogue; NXP Semiconductors: Eindhoven, The Netherlands, 2018. [Google Scholar]
- Praveenkumar, T.; Saimurugan, M.; Krishnakuma, P.; Ramachandran, K.I. Fault Diagnosis of Automobile Gearbox Based on Machine Learning Techniques. Procedia Eng. 2014, 97, 2092–2098. Available online: https://www.sciencedirect.com/science/article/pii/S187770581403522X (accessed on 15 November 2022). [CrossRef]
- Su, C.J.; Huang, S.F. Real-time big data analytics for hard disk drive predictive maintenance. Comput. Electr. Eng. 2018, 71, 93–101. [Google Scholar] [CrossRef]
- Vives, J. Monitoring and Detection of Wind Turbine Vibration with KNN-Algorithm. J. Comput. Commun. 2022, 10, 1–12. [Google Scholar] [CrossRef]
- Hoang, D.-T.; Kang, H.-J. Rolling element bearing fault diagnosis using convolutional neural network and vibration image. Cogn. Syst. Res. 2019, 53, 43–50. [Google Scholar] [CrossRef]
- Qin, J.T.C.; Li, W.; Liu, C. Intelligent Fault Diagnosis of Diesel Engines via Extreme Gradient Boosting and High-Accuracy Time-Frequency Information of Vibration Signals. Sensors 2019, 19, 3280. [Google Scholar] [CrossRef]
- Saeed, M. An Introduction to Recurrent Neural Networks and the Math That Powers Them. September 2022. Available online: https://machinelearningmastery.com/an-introduction-to-recurrent-neural-networks-and-the-math-that-powers-them/#:~:text=A%20recurrent%20neural%20network%20 (accessed on 11 November 2022).
- Yamashita, R.; Nishio, M.; Do, R.K.G.; Togashi, K. Convolutional neural networks: An overview and application in radiology. Insights Imaging 2018, 9, 611–629. [Google Scholar] [CrossRef] [PubMed]
- Yani, M.; Irawan, S.; Setianingsih, C. Application of Transfer Learning Using Convolutional Neural Network Method by Early Detection of Terry’s Nail. J. Phys. Conf. Ser. 2019, 1201, 12052. [Google Scholar] [CrossRef]
- Miranda, L.J. Understanding Softmax and the Negative Log-Likelihood. ljvmiranda921.github.io, 2017. Available online: https://ljvmiranda921.github.io/notebook/2017/08/13/softmax-and-the-negative-log-likelihood/ (accessed on 10 March 2023).
- Paoletti, M.E.; Huat, J.M.; Plaza, J.; Plaza, A. Deep Learning Classifiers for Hyperspectral Imaging: A Review; Hyperspectral Computing Laboratory (HyperComp), Department of Computer Technology and Communications, Escuela Politecnica de Caceres, University of Extremadura, Avenida de la Universidad s/n: Caceres, Spain, 2019. [Google Scholar]
- Giannelos, S.; Moreira, A.; Papadaskalopoulos, D.; Borozan, S.; Pudjianto, D.; Konstantelos, I.; Sun, M.; Strbac, G. A Machine Learning Approach for Generating and Evaluating Forecasts on the Environmental Impact of the Buildings Sector. Energies 2023, 16, 2915. [Google Scholar] [CrossRef]
- Ashish, K.S. Normalization Formulat. WallStreetMojo, 2023. Available online: https://www.wallstreetmojo.com/normalization-formula/ (accessed on 2 February 2023).
- F2005636. Evaluating Machine Learning Models Using Hyperparameter Tuning. Available online: https://www.analyticsvidhya.com/blog/2021/04/evaluating-machine-learning-models-hyperparameter-tuning/ (accessed on 12 April 2021).
- Bhandari, A. Everything you should know about Confusion Matrix for Machine Learning. Anal. Vidya 2022, 3, 10. [Google Scholar]
- Kingma, D.P.; Ba, J. Adam: A Method for Stochastic Optimization. arXiv 2014. Available online: https://arxiv.org/pdf/1412.6980.pdf (accessed on 11 November 2022).
- Herrmann, J.; Llima, S.M.; Remm, A.; Zapletal, P.; McMahon, N.A.; Scarato, C.; Swiadek, F.; Andersen, C.K.; Hellings, C.; Krinner, S.; et al. Realizing quantum convolutional neural networks on a superconducting quantum processor to recognize quantum phases. Nat. Commun. 2022, 13, 4144. [Google Scholar] [CrossRef] [PubMed]
- Sokolova, M.; Lapalme, G. A systematic analysis of performance measures for classification tasks. Inf. Process. Manag. 2009, 45, 427–437. [Google Scholar] [CrossRef]
Authors | ML Methods | Equipment | Description of the Data | Results |
---|---|---|---|---|
Praveenkumar [5] | Support Vector Machine | Automobile gearbox | Vibration signals | 90% accuracy |
Su and Huang [6] | Random Forest | Hard disk drive | Vibration, temperature, and other variables | 85% accuracy |
Vives [7] | K-Nearest Neighbors | Wind turbine | Vibration signals | 95% accuracy |
Hoang and Kang [8] | Neural Network | Rolling element Bearings | Vibration signals | 100.0% accuracy |
Qin, Li and Liu [9] | Gradient Boosting | Diesel engine | Vibration signals | 99.9% accuracy |
The Number of Convolution Layers | ||||||
---|---|---|---|---|---|---|
Experimental Group | Each Convolution Layer | Activation Function | Accuracy | |||
1st | 2nd | 3rd | Training Dataset | Testing Dataset | ||
1 | 8 | 16 | 32 | ReLu | 0.99 | 0.99 |
2 | 16 | 32 | 64 | ReLu | 0.99 | 0.98 |
3 | 32 | 64 | 128 | ReLu | 1.00 | 0.94 |
4 | 8 | 16 | 32 | Leaky ReLu | 0.94 | 0.94 |
5 | 16 | 32 | 64 | Leaky ReLu | 0.97 | 0.96 |
6 | 32 | 64 | 128 | Leaky ReLu | 0.97 | 0.98 |
7 | 8 | 16 | 32 | Tanh | 0.98 | 0.98 |
8 | 16 | 32 | 64 | Tanh | 0.89 | 0.96 |
9 | 32 | 64 | 128 | Tanh | 0.63 | 0.99 |
Model: “sequential” | ||
---|---|---|
Layer (Type) | Output Shape | Param # |
conv2d (Conv2D) | (None, 128, 1, 8) | 224 |
max_pooling2d (MaxPooling2D) | (None, 64, 1, 8) | 0 |
dropout (Dropout) | (None, 64, 1, 8) | 0 |
conv2d_1 (Conv2D) | (None, 64, 1, 16) | 1168 |
max_pooling2d_1 (MaxPooling2 | (None, 32, 1, 16) | 0 |
dropout_1 (Dropout) | (None, 32, 1, 16) | 0 |
conv2d_2 (Conv2D) | (None, 32, 1, 32) | 4640 |
max_pooling2d_2 (MaxPooling2) | (None, 16, 1, 32) | 0 |
dropout_2 (Dropout) | (None, 16, 1, 32) | 0 |
flatten (Flatten) | (None, 512) | 0 |
dense (Dense) | (None, 128) | 65,664 |
dropout_3 (Dropout) | (None, 128) | 0 |
dense_1 (Dense) | (None, 3) | 387 |
Total params: 72,083 | ||
Trainable params: 72,083 | ||
Non-trainable params: 0 |
Label | Fan-Fault (%) | Fan-Off (%) | Fan-On (%) |
---|---|---|---|
Accuracy | 99.822 | 100 | 99.822 |
100 | 100 | 99.469 | |
99.469 | 100 | 100 | |
99.734 | 100 | 99.734 |
Label | Fan-Fault (%) | Fan-Off (%) | Fan-On (%) | |||
---|---|---|---|---|---|---|
Raw Signal (1st Group) | Using Statistical Features (2nd Group) | Raw Signal (1st Group) | Using Statistical Features (2nd Group) | Raw Signal (1st Group) | Using Statistical Features (2nd Group) | |
SVM: | ||||||
Accuracy | 97.833 | 97.333 | 90.333 | 93.677 | 90.167 | 91.167 |
Accuracy | 92.473 | 95.699 | 96.954 | 98.477 | 84.793 | 90.323 |
98.851 | 98.343 | 86.036 | 90.233 | 90.796 | 96.078 | |
92.473 | 95.699 | 96.954 | 98.477 | 84.793 | 90.323 | |
95.556 | 97.003 | 91.169 | 94.175 | 87.411 | 93.112 | |
Random Forest: | ||||||
Accuracy | 94.624 | 96.774 | 92.893 | 97.970 | 86.175 | 94.931 |
96.175 | 97.826 | 90.196 | 95.567 | 89.202 | 96.244 | |
94.624 | 96.774 | 93.401 | 98.477 | 87.558 | 94.470 | |
95.393 | 97.297 | 91.771 | 97.000 | 88.372 | 95.349 | |
K-Nearest Neighbors: | ||||||
Accuracy | 91.935 | 90.323 | 95.431 | 97.970 | 83.410 | 86.175 |
98.276 | 97.110 | 85.068 | 86.547 | 88.293 | 91.667 | |
91.935 | 90.323 | 95.431 | 97.970 | 83.410 | 86.175 | |
95.000 | 93.593 | 89.952 | 91.905 | 85.782 | 88.836 | |
Gradient Boosting: | ||||||
Accuracy | 83.011 | 96.774 | 97.462 | 97.462 | 87.558 | 94.931 |
97.191 | 98.448 | 89.720 | 94.581 | 91.346 | 95.370 | |
93.011 | 96.774 | 97.462 | 97.462 | 87.558 | 94.931 | |
95.055 | 98.093 | 93.431 | 96.000 | 89.412 | 95.150 |
Label | Support Vector Machine | Random Forest | K-Nearest Neighbors | Gradient Boosting | ||||
---|---|---|---|---|---|---|---|---|
Raw Signal | Using Statistical Features | Raw Signal | Using Statistical Features | Raw Signal | Using Statistical Features | Raw Signal | Using Statistical Features | |
Accuracy | 91.167 | 94.667 | 91.333 | 96.500 | 90.000 | 91.333 | 92.500 | 96.167 |
91.694 | 94.885 | 91.494 | 96.205 | 90.545 | 91.673 | 92.752 | 96.311 | |
91.407 | 94.833 | 91.564 | 96.235 | 90.259 | 91.333 | 92.677 | 96.220 | |
91.379 | 94.763 | 91.513 | 96.215 | 90.245 | 91.333 | 92.632 | 96.254 |
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. |
© 2024 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 (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Aung, K.H.H.; Kok, C.L.; Koh, Y.Y.; Teo, T.H. An Embedded Machine Learning Fault Detection System for Electric Fan Drive. Electronics 2024, 13, 493. https://doi.org/10.3390/electronics13030493
Aung KHH, Kok CL, Koh YY, Teo TH. An Embedded Machine Learning Fault Detection System for Electric Fan Drive. Electronics. 2024; 13(3):493. https://doi.org/10.3390/electronics13030493
Chicago/Turabian StyleAung, Khin Htet Htet, Chiang Liang Kok, Yit Yan Koh, and Tee Hui Teo. 2024. "An Embedded Machine Learning Fault Detection System for Electric Fan Drive" Electronics 13, no. 3: 493. https://doi.org/10.3390/electronics13030493
APA StyleAung, K. H. H., Kok, C. L., Koh, Y. Y., & Teo, T. H. (2024). An Embedded Machine Learning Fault Detection System for Electric Fan Drive. Electronics, 13(3), 493. https://doi.org/10.3390/electronics13030493