An Artiﬁcial Intelligence Approach for Improving Maintenance to Supervise Machine Failures and Support Their Repair

Featured Application: Maintaining production systems within Industry 4.0 facilitates the application of artiﬁcial intelligence methods, techniques and tools to predict potential failures and to take maintenance actions in advance at the right time and in the right way to avoid or minimize their harmful impact, including using digital twins


Introduction
Today, manufacturers face increasing global competition for a variety of strategies and requirements, such as lowering production costs, delivering the product quality required by customers, innovating, reducing environmental impact and ensuring safe operations [1,2].Meeting these challenges depends, among other things, on the reliable operation of production machinery and equipment, and therefore also on how maintenance activities are carried out.
Maintenance affects all processes of a manufacturing company, and choosing an effective maintenance strategy is an important factor in a company's competitiveness [3].Technological developments have always affected both the scope of maintenance activities and the way they are carried out, and the evolution of maintenance from reactive to preventive and then to predictive (also known as Maintenance 4.0) is an example of this [4][5][6].
Under reactive maintenance, maintenance activities (repair and replacement of assemblies) are performed only when damage has occurred or the wear and tear reserve has run out.The aforementioned strategy can lead to long downtimes and unplanned maintenance.Preventive maintenance consists of planning and implementing maintenance activities at specific time intervals, and their purpose is to prevent failures.The main problem with preventive maintenance stems from the fact that maintenance schedules and the tasks derived from them are performed mainly on estimates and assumptions rather than on facts derived from data.As such, this strategy can lead to the premature replacement of assemblies and machine parts, leading to higher material and personnel costs.
In recent years, the digitization of production has led to a rethinking of how maintenance is carried out.In this new production environment, it is no longer enough to carry out preventive actions; today, the challenge is to anticipate failures at an early stage and take action when they are really needed [7,8].The use of predictive tools such as machine learning (ML)and reasoning methodologies can ensure the identification of failures at the earliest possible stage based on data from previous maintenance periods [9][10][11][12].Digitization can improve maintenance by using gathered data and advanced technologies for equipment condition monitoring, fault detection and to anticipate and fix problems long before they occur [13,14].Therefore, another approach to the maintenance of production equipment, and thus the ensuring of the continuity of production processes and the achievement of the business objectives of the organization, is the predictive strategy, sometimes referred to in the literature as Maintenance 4.0 [15,16].
Which maintenance strategy to choose?This is a question that maintenance managers are looking for an answer to.The problem is that there is still no standard and widely used/accepted procedure for defining it.Currently, information from the manufacturer/supplier, empirical knowledge, or historical data are most commonly used [17,18].To successfully develop maintenance and implement a predictive approach, a transformation plan (road map) is required that includes a structured approach, methods and tools for digital transformation and ensures collaboration between various stakeholders.We found a research gap lying in the use of a combination of survey data and methods using artificial intelligence tools to develop scalable applications that predict, improve and reduce maintenance time.This approach is unique and has no exact equivalent in the literature.The aim of the article is to discuss the possibility of using AI methods and techniques to anticipate possible failures and respond to them in advance by carrying out maintenance activities in an appropriate and timely manner.
The article is structured as follows: Section 2 reviews current maintenance strategies.The next section explains the methods and materials used in the study.Section 4 presents the results of computational modeling using artificial neural networks.Section 5 contains a discussion and concludes with a conclusion.

Review of Current Maintenance Strategies
According to EN 13306, maintenance is defined as the combination of technical, administrative and managerial actions during the life cycle of an item that is intended to maintain it in, or restore it to, a state in which it can perform the required function or combination of functions considered necessary to ensure that the service in question can be provided.The maintenance of a company's production equipment typically involves maintenance activities such as repairing, replacing components, checking, adjusting, testing, measuring and fault-finding.These actions are aimed at avoiding breakdowns that can lead to interruptions in the normal operation of the production line.If these actions are effective, they can reduce the frequency of failures, their effects and extend the service life of the production equipment.The implementation of maintenance implements the maintenance strategy, which is defined through action plans to ensure that direction is maintained and that guidelines are met to carry out subsequent maintenance activities required by the system.In the literature, the maintenance strategies can be divided in various ways, such as (Figure 1): corrective maintenance (CM), preventive maintenance (PM) and predictive maintenance (PdM), extended from the condition-based maintenance [19][20][21].required by the system.In the literature, the maintenance strategies can be divided in various ways, such as (Figure 1): corrective maintenance (CM), preventive maintenance (PM) and predictive maintenance (PdM), extended from the condition-based maintenance [19][20][21].The first two of these strategies (CM and PM) have been applied since the early 1990s [22].Corrective maintenance (i.e., reactive maintenance or failure-driven maintenance) is intended to repair or restore a system after a failure has occurred.According to [23], this strategy often results in unpredictable consequences, including higher production costs, longer repair times, but also costs and penalties due to machine failures.Preventive maintenance is based on planning and performing maintenance at planned time intervals or based on the number of hours worked to keep the equipment in good condition [24].The goal is to repair the system before a failure occurs.Decisions regarding maintenance activities are made by specialists based on their experience, previous failures and their features.However, it is difficult to ensure a flawless maintenance schedule well in advance.Due to increasing requirements for the reliability, availability and security of systems, preventive maintenance is becoming less and less effective.Additionally, the downside of this strategy is that the actual state of the system is not always taken into account when planning subsequent maintenance, which can lead to unnecessary maintenance and additional costs [25].
Compared to the aforementioned two types of maintenance strategies, the third of these strategies (PdM) is a trade-off between the two [21].According to [26],the essence of the PdM is to predict the next error in a manner that preventive maintenance can be performed before the failure takes place.In practice, PdM reduces the frequency of maintenance to the lowest possible level to prevent unexpected failure, thus avoiding reactive maintenance and reducing the expense of conducting unnecessary preventive maintenance.
The concept of PdM is a step further from Condition-Based Monitoring (CBM).PdM enables proactive maintenance and includes anomaly detection, diagnostics, prediction and maintenance decision-making.Its advantage lies in the implementation of a system that constantly monitors the state of the system to ensure data-driven maintenance [27,28].
For many enterprises, a predictive maintenance strategy is an opportunity to reduce costs, increase the working life of assets, ensure the required quality of products, improve operational safety and reduce the negative environmental impact of machine failure.According to [29],implementation of predictive maintenance (PdM) systems saves up to 60% of maintenance costs.Jimenez et al. [30], referring to [31], indicate that preventive maintenance can reduce maintenance costs by 25-35%, reduce failure rates by 70-75%, reduce downtime by 35-45% and increase production by 25-35%.In addition, the above-mentioned calculations did not take into account the additional profit resulting from the increase in the value of system security and the company's image.In addition to purely economic benefits, a predictive maintenance strategy supports companies in implementing the environmental and social dimensions of sustainable production [2,[32][33][34][35][36].In the The first two of these strategies (CM and PM) have been applied since the early 1990s [22].Corrective maintenance (i.e., reactive maintenance or failure-driven maintenance) is intended to repair or restore a system after a failure has occurred.According to [23], this strategy often results in unpredictable consequences, including higher production costs, longer repair times, but also costs and penalties due to machine failures.Preventive maintenance is based on planning and performing maintenance at planned time intervals or based on the number of hours worked to keep the equipment in good condition [24].The goal is to repair the system before a failure occurs.Decisions regarding maintenance activities are made by specialists based on their experience, previous failures and their features.However, it is difficult to ensure a flawless maintenance schedule well in advance.Due to increasing requirements for the reliability, availability and security of systems, preventive maintenance is becoming less and less effective.Additionally, the downside of this strategy is that the actual state of the system is not always taken into account when planning subsequent maintenance, which can lead to unnecessary maintenance and additional costs [25].
Compared to the aforementioned two types of maintenance strategies, the third of these strategies (PdM) is a trade-off between the two [21].According to [26], the essence of the PdM is to predict the next error in a manner that preventive maintenance can be performed before the failure takes place.In practice, PdM reduces the frequency of maintenance to the lowest possible level to prevent unexpected failure, thus avoiding reactive maintenance and reducing the expense of conducting unnecessary preventive maintenance.
The concept of PdM is a step further from Condition-Based Monitoring (CBM).PdM enables proactive maintenance and includes anomaly detection, diagnostics, prediction and maintenance decision-making.Its advantage lies in the implementation of a system that constantly monitors the state of the system to ensure data-driven maintenance [27,28].
For many enterprises, a predictive maintenance strategy is an opportunity to reduce costs, increase the working life of assets, ensure the required quality of products, improve operational safety and reduce the negative environmental impact of machine failure.According to [29], implementation of predictive maintenance (PdM) systems saves up to 60% of maintenance costs.Jimenez et al. [30], referring to [31], indicate that preventive maintenance can reduce maintenance costs by 25-35%, reduce failure rates by 70-75%, reduce downtime by 35-45% and increase production by 25-35%.In addition, the abovementioned calculations did not take into account the additional profit resulting from the increase in the value of system security and the company's image.In addition to purely economic benefits, a predictive maintenance strategy supports companies in implementing the environmental and social dimensions of sustainable production [2,[32][33][34][35][36].In the context of new challenges of intelligent production, PdM is becoming an attractive paradigm of modern management of production equipment, enabling early detection of failures using predictive methods and data from the entire lifetime of the monitored devices.Hence, it is starting to be used more and more often in various industry sectors, including the automotive and furniture industries [20], aircraft sectors [37], and marine industries [38].
The evolution of the approach from preventive maintenance to predictive maintenance (PdM) is progressing thanks to the introduction of new technologies: Digital Twin (DT), Internet of Things (IoT) and Smart Manufacturing (IM).Nevertheless, any organization seeking to establish a PdM system should follow a plan that provides detailed guidance on the steps to be taken to effectively achieve the goal.This plan is a roadmap that is defined as a tool for interdisciplinary teams to help determine the sequence of planned activities in a specific application [39] considering short, medium, and long-term strategies to foster the implementation of PdM [40].
The existing literature offers research in the comprehensive optimization of maintenance transformation and building a predictive approach [41][42][43][44][45]. Katona et al. [41] developed PdM framework and proposed an implementation roadmap.The proposed framework for the development of PdM starts with the knowledge gained while studying the literature and analyzing similar industrial projects.In order to effectively implement a PdM system based on small data sets or big data analytics, the authors propose a road map based on fourteen steps.Singh et al. [46] proposed six-step PdM implementation roadmap: (1) Identify asset(s) for PdM; (2) Establish data sources; (3) Analyze the failure mode (e.g., effects); (4) Select and implement monitoring technologies; (5) Develop predictive algorithms and key metrics (e.g., time to failure) and ( 6) Generation and implementation of a predictive maintenance schedule.
In addition, the authors have defined the requirements for each step and enablers, and they have also indicated the requirements that the IT system should meet.This system must be able to: collect and store required data, process and use the data and generate practical results.Hoffmann and Lasch [42] proposed a structured approach to implementing PdM strategies in the industry so as to result in reduced maintenance and resource costs.Serradilla et al. [29] presents four stages of methodology for PdM applications dedicated to industrial companies (MEDADEK-PdM) by combining domain knowledge with advanced data-driven techniques.
Regardless of which PdM delivery route an enterprise chooses, in order to predict upcoming failures, downtimes or other critical events for maintaining production, it is necessary to analyze previously collected data.It also requires continuous monitoring of the current state by collecting real-time data.Data should be gathered to the beginning of the road.It is necessary to analyze them.Literature data indicate ML, Industrial Edge Computing, Algorithmic Programming and AI as the most suitable to achieve this goal [47][48][49][50][51].
A lot of research has been conducted in the last decade and many attempts have been made to apply artificial intelligence (AI) techniques to modeling and managing maintenance [52][53][54].AI is changing the technologies underlying the solution to many problems related to modeling and controlling machines within the paradigm of Industry 4.0.In maintenance, it is necessary to build intelligent, flexible and open solutions based on AI operating in real-time (or near real-time) environments.In this way, it is possible to detect future data corruption patterns based on the same predictive rules that can be used to develop the next generations of the monitored devices themselves [55,56].What is more, maintenance systems collect knowledge about the current functioning of devices in real conditions, which is difficult to obtain in any other way.This supports and accelerates the accumulation of expert knowledge also by less experienced technologists [55][56][57].
An enterprise considering the possibility of moving to PdM needs to analyze the status quo and understand whether its current systems are capable of change or need to be updated, extended, supplemented or replaced.In addition, resources must be prepared, primarily people, because actionable data must be available at the right time and place, including only to those with appropriate access rights.

Materials and Methods
Efficient and accurate diagnosis of an emergency event is of key importance in achieving the assumed (required) productivity and efficiency during the elimination of failures.To ensure uninterrupted production continuity, only preventive actions are no longer sufficient today, and proactive or autonomous actions, using the latest technical solutions (including programming) that enable more precise and faster diagnostics and continuous monitoring of the key (and often: critical) elements of technical systems, are becoming the standard.The selected company in the medical industry is characterized by specific requirements and expectations with regard to maintenance activities to ensure production continuity.This is due to: It is the intention of the authors to expand measures to implement a maintenance strategy-predictive maintenance in a selected company by:

•
Historical analysis of failures, in order to classify types of failures, their causes and maintenance activities were taken; • Possibility of using AI to detect the causes of failures and identify the necessary maintenance actions on the basis of historical data; • Design of an autonomous monitoring system for the technical facility that enables the automation of diagnostic processes in combination with AI.
The starting point for the development of the activities is data from the CMMS (Computerized Maintenance Management Systems) system supporting the broadly understood Maintenance activities.The CMMS system records data: events related to all types of breakdowns, overhauls or inspections and other maintenance activities, as well as the management of maintenance personnel and service documentation.
The selected company has had a dedicated CMMS system supporting maintenance management in place for many years, modified and adapted to new organizational and production challenges.Over recent years, the system has undergone significant transformations related to inventory management, parts and materials, procurement, breakdown handling and maintenance and repair work.

Process Description
Failure reports contain data describing the actual effects and causes of a technical facility failure.The failure report is initiated by the operator describing the consequences of the technical object's failure event, thus performing fault detection.On this basis, the technician carries out the remaining phases of the diagnosis of the technical object's condition-fault location and identification.Once the component that caused the failure has been located, the genesis of the technical condition is performed, determining its cause.Description of Maintenance department operation:

•
Report is displayed on a monitor in the UR workshop (if mechanical, in the mechanics' workshop, if electrical, in the electricians' workshop, if other, in both) -> for urgent malfunctions additionally a "rooster" is switched on; • Technician approaches the breakdown station and performs the diagnosis (often there are mistakes in the notification, i.e., not a mechanical breakdown but an electrical breakdown-in such a case, technicians are exchanged, which takes a lot of time); • Repair is carried out, i.e., in-house or service is called, or they wait for parts, etc.;

•
Once the fault has been rectified, the technician enters the repair information into the system.
An important element of the failure report is the technician's action time and failure diagnosis time, as well as the estimated time to fix the failure.The time for the technician to take action and the time for fault diagnosis are directly linked to the operator's report, and in particular to the technical facility operator's initial assessment of the consequences (and causes) of the fault.Ninety percent of reports relate to mechanical or electrical faults, so the referral of a technician with the required competence to the emergency event is crucial to minimize fault diagnosis time.
It can be deduced from the CMMS data that technicians could not perform their work efficiently due to a lack of spare parts, materials and tools.The decrease in efficiency was also caused by waiting for external service or the need to involve technicians in other emergency events-crucial from the production point of view, i.e., the handling of the failure of one event was interrupted due to the occurrence of another emergency event of higher priority.These data indicate mismanagement of the resources required to deal with failures, resulting in specific losses.Eliminating these losses should significantly improve the availability and performance of technical facilities.
In the first step of the activities, the critical causes and consequences of failure events were identified in the analysis and compared with the empirical data on failure events of the technical facilities under study.On this basis, the records contained in the database were verified, and input and output sheets for the neural networks were developed.The assumptions were as follows:

•
Inferring the type of failure i.e., indicating that it is a mechanical failure; • Inference of possible actions to be taken-the technician with the most experience will be delegated.
As a further development, it is possible (this will enable a more complete analysis) to assign data on the basis of descriptions in a separate field distinguishing the type of intervention: repair, adjustment, calibration and external service.
The developed results of the analysis of emergency events are subject to a describable level of uncertainty due to the form of description of emergency notifications and work performed in the CMMS.In the absence of a defined dictionary of entries, it happens that the same failures are described in different ways.Therefore, string comparison methods were used in the analysis to search and group the information in the emergency declaration database according to a list of expected keywords.In the next step, it is planned that an intelligent algorithm be used to transform the operator description into key input values for the neural networks and, in addition, to compare the historical data with the current records and correct the records in the technician guidance data.This will make it possible to refine the input data for the neural networks, which should improve the efficiency of the estimated output values of the networks.

Dataset Description
Data included 29,115 records.A set of 20,381 (70% of 29,115) was used for training.Each of them consists of: 1.
Six inputs: Each of the aforementioned categories is assigned a numerical value.The range of input and output variables in the ANN model is, for each variable, normalized to the range 0-1 and is a 1-z-n code created separately for each input or output, depending on the number of categories per input or output.
Due to the use of a sigmoid (non-linear) transition function, we had to choose the bias appropriately, which is critical here for creating an effective learning model.A correctly chosen bias value allows the activation function to be shifted left or right and helps to produce a more accurate fit to the data (a more accurate prediction function at the output).In the study, we focused on multiplication-type bias rather than addition/subtraction-type bias because multiplication makes the function steeper and better at transferring differences when there are a large number of categories.
However, it should be noted that, in the study, our model was learned on specific industry data, which may weaken its ability to generalize to a more diverse dataset and this will need to be modified.When looking at complex industry data, we relied on previous approaches presented in, amongst others in [58,59].
In addition, for reasons of commercial confidentiality, the name of the department and the name of the line had to be coded.
The number of observations in each category varies across the dataset, ranging from a few dozen (lowest is 35) to several hundred (highest is 183).We believe that this limits the accuracy of ANN because usually equinumerous sets in each category, not less than 20 in each category, are recommended for network training.Back-propagation (BP) is often used because it is simple, popular and quick.In subsequent studies, we will check the impact of category balancing, but it should be remembered that these are real, industrial data, and during normal operation it will be difficult to ensure equivalence when training ANN.
In the study, we relied on an approach in which the MLP requires all inputs corresponding to numerical variables continuous in value and described by a continuous function.Hence, usually categorical values are replaced by numerical values and treated as if they were from a continuous set of values.An alternative solution is to encode the categorical inputs using 1-out-of-n encoding and use them as inputs.Previous research shows that the approach is more efficient and faster than other approaches; also for a dataset with several categorical and several continuous variables [60,61].
ROC curve analysis was checked as an alternative approach.Since each output variable has more than two labels, we had to consider each label as an ANN output (yes/no), train the ANN from scratch and then perform a ROC analysis for each output.Hence, we have: 6 inputs-a total of 80 neurons: The 80-170-65 MLP network built on this basis on a set of 20,381 (70% of 29,115) learns for a very long time; moreover, it generates up to 145 ROC curves for each network.Optimization of such a network is very labor-and time-consuming, and the resulting Accuracy values were no higher than the previous, simpler solution based on the 1-of-n code.

Computational Analysis
Various neural networks were used in the study, but the best results with the simplest structure were given by a three-layer neural network (multilayer perceptron (MLP)) with BP algorithm, perceptron link optimization focused on determining the minimum mean square error (MSE) and naive initialization techniques.The choice of BP was dictated by the extensive use of feed-forward ANN learning: it is easy to implement, fast convergent, adaptable, efficient in most cases and requires no prior knowledge.A split of the dataset was used: 70% (training set) and 30% (test set).The ANN weights were preset to avoid converging too slowly and falling into the trap of local minima.
MATLAB R2021b software from Neural Networks Toolbox (MathWorks, Natick, MA, USA) was used to construct the ANN model.The traditional approach was derived from previous authors' research and 'hit and miss' tests were used.
The five aforementioned parameters were used as input variables.The two aforementioned parameters were used as output variables (Figure 1).
The choice of inputs was based on their availability (the ability to simply retrieve them) and their ability to be converted into numbers.A scaling of the input signals was used to ensure the same interpretation of the values of all signals in ANN.
The number of neurons in the hidden layer was selected experimentally, with initial values chosen based on the authors' experience, followed by a preliminary study in search of a global optimum, where the samples were densified in a subsequent round of testing.This approach requires an average of about 100 neural networks to be learned, but with automation and the use of dedicated software, this may be the fastest solution.For comparison, semi-automated classification solutions were tested with ML.NET (Visual Studio 2022, Microsoft, Redmond, WA, USA), and the waiting time for network selection with such a large dataset was significantly longer, thus requiring the commitment of significantly more hardware resources for selecting, learning, testing and teaching neural networks.
Accuracy is calculated traditionally, as for the evaluation of classification models, and the only one is based on calculations based on a set of normalized training data.Accuracy defined in this way is the fraction of forecasts for which a given model turned out to be correct.Therefore, an accuracy of 0.91, or 91%, means 91 correct predictions out of every 100 examples.

Results
ANNs directly transform coded and normalized input data into output data by extracting non-linear rules combining outputs with inputs and quickly estimating the results of the study.As part of a model, it can be applied to predict the output state with intentional or independent changes of one or more input parameters.The aforementioned framing of the problem provides the basis for extending the model to a digital twin, fed automatically with data via the IIoT, where you can check subsequent modifications without having to rebuild part or even the entire production line.
In the model, each ANN layer contained neurons with the same activation function (sigmoid) due to its high flexibility (Table 1).ANN results after the application of other activation functions were significantly worse.In assessing and comparing the precision of the ANNs, we considered the MSE, Accuracy (learning) and Accuracy (training) values.The learning process for the selected ANNs involved repeating patterns and modifying the weights of the network until it reached the target MSE (after no more than 1000 epochs)(Figure 2).
Appl.Sci.2023, 13, x FOR PEER REVIEW 9 of 16 In the model, each ANN layer contained neurons with the same activation function (sigmoid) due to its high flexibility (Table 1).ANN results after the application of other activation functions were significantly worse.In assessing and comparing the precision of the ANNs, we considered the MSE, Accuracy (learning) and Accuracy (training) values.The learning process for the selected ANNs involved repeating patterns and modifying the weights of the network until it reached the target MSE (after no more than 1000 epochs)(Figure 2).The best results in the study were obtained for the following ANN structure: 6 neurons in the input layer, 12 neurons in the hidden layer and 3 neurons in the output layer(i.e., MLP 6-12-3).The ANN minimized the MSE for the training set data to the lowest values (best 0.001) (Tables 2 and 3).The best results in the study were obtained for the following ANN structure: 6 neurons in the input layer, 12 neurons in the hidden layer and 3 neurons in the output layer(i.e., MLP 6-12-3).The ANN minimized the MSE for the training set data to the lowest values (best 0.001) (Tables 2 and 3).ANN-based optimization provides relatively simple and fast solutions to the classification problem in the absence of full knowledge of the rules and mechanisms, solely on the basis of appropriately selected input and output data (the so-called data-driven approach).This allows both the selection of training data and the inclusion of new data or new equipment or production lines with untested data sets.

Development Action Plan
Analysis of the efficiency of production processes carried out at the company revealed the need to make significant changes to the production organization by implementing measures to enable production tasks to be carried out more flexibly, more efficiently and more safely.This primarily involved a change in the operating strategy and the use of new technologies enabling, among other things, improved integration of production systems, data collection and processing in key production areas and communication between the various decision-making levels.
The results of the AI operation have demonstrated the effectiveness of inferring emergency events and are enabling greater efficiency and effectiveness to be achieved during failure recovery.The measures taken should make it possible to reduce the time taken for maintenance activities and optimize the allocation of resources required to rectify failures.The obtained results of AI enable the design of a roadmap for the implementation of the proposed predictive maintenance strategy in the organizationby automating data extraction for the input layer of neural networks using intelligent instrumentation e.g., IoT sensors (controllers).
The results obtained and the AI data obtained enabled the development of a roadmap including the following steps: 1.
Selection of key technical objects to enable project implementation; 2.
Using the obtained AI results to perform a cause-and-effect analysis of failures for the selected technical objects; 3.
Identification of key sub-components (segments) of the technical facilities providing the greatest effectiveness in identifying the most common and/or costly causes of failure; 4.
Selection and feasibility of implementing the most effective techniques and equipment for monitoring (signal analysis) of selected areas based on the developed criticality analysis; 5.
Development of schemes and algorithms to deal with the prediction strategy thus developed and development of key indicators (e.g., response time to an emergency event, mean time between subsequent failures); 6.
Preparation and implementation of a schedule of maintenance and preventive actions related to the new strategy; 7.
Adaptation of the in-service CMMS system to the new maintenance strategy and visualization of key parameters and indicators for selected technical facilities.
The developed project for the implementation of the predictive strategy should reduce operating costs by optimizing the production process with regard to planning and manufacturing and creating a more flexible business model for the company.

Discussion
We were surprised that such a simple solution gave such high accuracy (up to approx.87%), but it should be remembered that in the study we used real industrial data, and therefore the model is adapted to their structure, which can be relatively simple and quite easily predictable at the level of machine learning.We would also pay particular attention that computationally larger solutions cannot be trained on mobile devices; only learned neural networks can be transferred as inference.
Discussing ANN's accuracy for each category and the ANN efficiency showed that we should take into consideration that accuracy alone does not provide full information about the effectiveness of ANN when using a dataset that is unbalanced across categories.However, it seems that in the case under study, i.e., the use of data from a real production line, we have to accept some data imbalance and resulting inaccuracy, as some types of failures are inherently more common than others.Due to the fact that this frequency is important for the operation of the algorithm, it is not always possible to artificially balance the data-in the target system, there is a need to create a framework for quantifying estimation reliability based on the current expert knowledge of technologists and maintenance engineers in the area in which the maintained system works industrial.
The achieved results are worth interpreting and looking at from a broader perspective, taking into account the results and conclusions of previous studies.There are differences in the approaches to the development, implementation and modernization of maintenance solutions depending on the data analyzed and the models used to draw conclusions from the data and predict failures.We have found more than 30 studies concerning AI/ML-based maintenance within Industry 4.0 paradigm, but their spectrum of topics is very wide (from eHealth devices to bug detection in software) and it is hard to compare with our results.The review shows that with very advanced, complex and expensive solutions, failure prediction accuracy of 96% can be achieved.However, it makes sense to look for cheaper and simpler solutions for optimization in smaller companies that cannot always afford world-class solutions.The situation is similar to enterprise resource planning (ERP) class systems-initially intended for large enterprises, as the price was slashed, they also came to medium and small enterprises as a solution for increasing their efficiency and automating some of the functions previously performed by people.Gathering, analysis, and selection of data from the production process, technical control (in Industry 4.0 at every stage of production) and the entire life cycle allow you to search for and extract the most beneficial contribution to product development or even the entire technology, and not just to prevent anomalies on the production line.This can be used not only for predictive maintenance but also to improve actions aimed at ensuring a sufficiently high-quality mass-produced product, forecasting demand or material problems (e.g., the possibility of substituting one material for another), and better prioritization and scaling of resources [62].It also favors faster adaptation to changes in order to maintain product competitiveness by testing the product or production process in a digital model [50].The so-called constraint satisfaction, i.e., reconciling seemingly conflicting interests, e.g., customer satisfaction, sufficiently high quantity and high quality of production, with the lowest possible production costs.Anomaly detection for the maintenance of 5G networks has been developed NaConvAE-Latency, which coordinates multiple targets for correlation between multiple metrics [63].The research to date shows that the wider implementation of PdM in production plants is limited by practical issues: the availability, sufficiency, completeness and reliability of the data gathered (all machine maintenance conditions and possible anomalies, contextual information) [11].Efficient diagnostic and analytical techniques are needed to be used in complex situations; also to reduce the number of misclassifications and false positives [64].It is sometimes difficult to reflect the abstract features used by machine learning systems based on a large set of diverse data collected, and the complex nature of sensor time series requires precise planning of real-time scenarios [65].Non-linear methods are being explored for feature engineering and wear condition modeling using supervised learning (including support vector machines (SVMs)), k-nearest neighbors (k-NNs)) with maximum accuracy 74.8% [66].It is more difficult with small data sets, i.e., when we use machine learning for a small amount of data.This applies when we have limited resources (number of sensors, budget, time, etc.).A hybrid model that combines machine learning with analysis using data sets from physical models may be useful, then [67].The use of SCADA in the textile production process uses data mining based on databases of pre-processed data to generate predictive suggestions (i.e., optimal settings of textile machines) [68].Another problem is the rare occurrence of data corresponding to faulty conditions (i.e., everyone is trying to prevent a failure), especially in the case of environmental and safety losses caused by damaged machines [11].Despite the progress of research and implementation, the main challenges in the industry are still to ensure high accuracy of anomaly detection, the adaptability of the model (to adjust to changing conditions) and, above all, to diagnose new failures that have not occurred before.Multi-stage analyzes are used here, starting from multi-model comparisons, through optimization of clustering and projection algorithms, to detect incorrect signals and transfer the results into alerts throughout the process [69,70].Sometimes, however, decision trees are sufficient for the analysis [69,70].Most studies include cases from simulation data or assumed abnormal conditions, often depending on the previous life-to-failure.Then, the construction of the PdM system includes data acquisition, data pre-processing, constructing indicators and predicting the remaining useful life [29].It is also difficult to compare data: the diversity of products and suppliers, the description of knowledge with attributes and label insights make comparative PdM research very complex in a fast-growing market with a wide variety of products [10,71,72].

Limitations of the Own Studies
It is already known that unbalanced training data (including a small number of classified errors/anomalies) limit the possibility of using supervised machine learning models (i.e., anomalies may not be correctly classified due to insufficient error data in the neural network algorithm) [73].

Directions for Further Research
We plan that the next stages of our research will focus on optimizing the proposed solution to increase the predictive effect and increase the accuracy of the network.Future digital process models, digital twins, allow the optimization of process properties without wasting materials/products.The solutions presented in this paper are promising tools in the area of the design of MdP systems and their computational analysis.In a basic version, such systems can be based on simple AI solutions and optimized toward a lower-cost software group.
Cyber security risks are increasing, and the increase in complexity of IIoT systems, including maintenance, cannot fail to go hand in hand with an increase in efforts to secure them, especially with some redundancy for the development and future increase in the number and types of critical data [74].Each of the areas: asset location, maintenance, safety and security, quality control, deserves separate attention [73].Increasing cybersecurity is supported by the implementation of the industrial security standard (IEC 62443) in the area of maintaining the security of IIoT systems and components by their owners and suppliers [74].
Industrial applications have their own peculiarities, i.e., one is not always looking for the most accurate or fastest solution, but only one that is sufficient, meets initial assumptions and is cheap and fast.For the aforementioned reasons, we started our search with the simplest solutions, examining whole groups of solutions one by one.In the proposed solution, accuracy is not critical-when classifying defects for servicing, it is sufficient to provide hints to the people who will carry out the servicing tasks, which reduces servicing time in the most common defect cases and shortens the downtime of production lines.Thus, an accuracy of 80% may be sufficient, and a costly increase to 90% may not be achievable.
It seems that the current accuracy is the limit of what can be achieved with such a simple network.Higher accuracy values will require more complex and costly solutions.However, from the utility point of view in industrial applications, it is not known whether it will be necessary and useful.

Conclusions
The effective use of preventive maintenance requires large amounts of reliable annotated sensor data and well-trained machine-learning algorithms.Scientific and technical development of the above-mentioned group of solutions should be implemented in such a way that they can be used by companies of equal size and with different production profiles.Even relatively simple solutions as presented in the article can be helpful here, offering high efficiency at low implementation costs.Ultimately, this will improve the economy of material, energy and water consumption, which is important to the entire global economy.The proposed solution not only allows the damage to be dealt with more efficiently and quickly but also ensures the optimum use of service specialists and spare parts, significantly reducing the cost of normal maintenance operations.For the aforementioned reasons, the AI-based approach is likely to become the leading edge in the coming years.

Figure 1 .
Figure 1.The structure of an artificial neural network (ANN).

Figure 1 .
Figure 1.The structure of an artificial neural network (ANN).

Figure 2 .
Figure 2. Values of mean square error (MSE) during learning.

Figure 2 .
Figure 2. Values of mean square error (MSE) during learning.

Table 1 .
The best MLP network models for MdP assessment.

Table 1 .
The best MLP network models for MdP assessment.

Table 3 .
MSE values for the best MLP neural network.