# Classifying X-Ray Tube Malfunctions: AI-Powered CT Predictive Maintenance System
## 7 Summary  
As mentioned before, this was our first study on these data. In this study, the obtained CT data were described, cleaned, and prepared, and every step was documented. Afterwards, AR model coefficients and DWT coefficients were used as features for different classical machine learning models. Later, two different NN families were applied to DWT coefficients and also applied to trimmed and preprocessed data without a feature extraction step. The best-performing architecture proved to be an LSTM with 64 units, with 87% accuracy on trimmed and preprocessed data. The second place was jointly shared by LR and SVC trained with DWT coefficients, and the fourth place was held by RF trained on AR coefficients. We view 87% accuracy as a success, given the possible data quantity. However, it is necessary to put the performance of the LSTM model into a real-world context. Confusion matrices for this model on all 5-folds are visible in Appendix C. On these folds, the model has never classified a faulty X-ray tube as a working one. This way, we can conclude two qualities of the LSTM model:  
* The model likely can spot all the malfunctioning X-ray tubes. * If the model classifies an X-ray tube as working, it has only a small chance (never before seen malfunctions) of the tube being replaced too soon. The obvious downside is that, sometimes, a working machine is classified as soon-to-fail. Depending on the priorities of the companies/clinics, this could be a costly problem. However, it would help maximise the machines' uptime. As of execution time, once the data are trimmed and normalised, the LSTM model takes approximately 540 ms to execute on an older workstation-grade CPU (AMD Ryzen(tm) Threadripper(tm) 2920X 12-Core Processor ). As the classified data represents, on average, 69 days, running such a model daily should not cause any computational problems for CT machines. As for the related work, there are several possible extensions. One of the biggest challenges was to trim and preprocess the data. When trimming, we selected a relatively safe approach--selecting only intervals where we were sure either there was no malfunction occurring for the functioning class or the malfunction was relatively imminent for the malfunction class. While this approach may help diagnose the malfunction a few days before the failure, it does not help quantify the device's health somewhere in the middle of the life cycle nor does it quantify the possibility of the failure or the mean time to failure. We view this as the biggest limitation of this work and a significant area for improvement in future work. To do so, it would be necessary to perform the following:  
* Gather more data--Data quantity is essential for good performance and generalisation, which is even more so for deep learning-based models. \begin{table}
\begin{tabular}{c c c c} \hline
**Model** & **Features** & **Parameters** & **Accuracy** \\ \hline LSTM & DWT & Haar & 61.8\% \\ \hline  & normalised samples & 32 units & 87\% \\ \hline VGG-like & DWT & coif7 & 78.6\% \\ \hline  & normalised samples & 32, 64 filters & 75.4\% \\ \hline \end{tabular}
\end{table} 
Table 3: Performance of NN-based methods. * Create a fully retrospective study--All the X-ray tubes classified as working during the study were still working by the time of log gathering. That means there was no way to obtain more information about their expected life cycle. While, for the purpose of classification as being malfunctioning or still working, this was not a problem, it became a problem when intervals from the start of the life cycle were selected. For future work, this would allow us to obtain more information on the life cycle. * Inspect failed X-ray tubes--In order to allow for more granular classification, a detailed understanding of the cause of failure would be needed. * Conduct a deeper analysis of the features and their impact on the model--as different features can contribute to various types of faults at different stages of the life cycle.