## 2 Materials and Methods
### The Methodology
#### 2.1.1 Data Collection: The Industrial Case  
Data collection consists of collecting data able to reveal the health condition of a component/system. These data can be vibrations, acoustic emissions, currents, temperatures, and others, and the choice depends on the kind of system/component and the already available sensors [35]. The data collected for fault diagnosis should include the nominal and all possible fault conditions. However, data collection in fault conditions is challenging in industrial contexts due to safety, time, and economic issues. This difficulty is particularly evident for machine producers, who only can collect data during quality tests [36]. In these cases, as in the present case study, faults are manually induced on the system, and signals are collected for few minutes in each condition. For this reason, the system is assumed to either function correctly or not. In addition, these faults do not cause the system's breakdown but introduce unacceptable qualitative issues on the product.  
In this paper, a case of an automatic machinery of a manufacturer operating in the pharmaceutical sector is considered. The machine under analysis is a packaging line made of two parts connected by an automatic robot. The first section is a thermoforming machine that realizes the products in different materials; the second section is a cartooning machine,  
Figure 1: Offline Training.  
Figure 2: Online condition monitoring.  
which packs the product into the carton. The machine can produce up to 320 products per minute and more than 260 cases per minute. This paper analyzes failures and malfunctions of the sealing group, which is placed in the first section and is responsible for sealing the two parts of the product. The group includes two tables, in which the film flows horizontally and continuously, allowing the sealing at a low temperature. Each sealing cycle consists of five steps: (1) the top table goes up, (2) the tables close, (3) the cover is sealed to the base, (4) the tables open, and (5) the parts return to the initial position. Figure 3 depicts the trend of the measured signal during a sealing cycle, which is divided into 5 areas, corresponding to the steps of the process. Each cycle lasts 800 milliseconds, and the sampling frequency of the sensor is 1000 Hz. Table 1 summarizes the test performed on the system with the corresponding number of cycles included in the test. In total, four conditions are available, i.e., nominal, fault 1, fault 2, and fault 3. The condition \"restored\" is assumed to be equal to the nominal one. Hence, almost 50% of the available dataset corresponds to the nominal condition, while the remaining part includes three different fault conditions.  
In Figure 4, the differences between the nominal condition and the three fault conditions in a cycle are shown. As it is possible to see, the more significant difference occurs during step 4. Indeed, while signals are identical in peaks 1, 2, and 4, in step 4, faulty signals assume greater values than the nominal condition.  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Dataset** & **Condition** & **Number of Cycles** \\ \hline D1 & Nominal 1 & 360 \\ D2 & Fault 1 & 240 \\ D3 & Fault 2 & 200 \\ D4 & Restored 1 & 70 \\ D5 & Fault 3 & 100 \\ D6 & Restored 2 & 110 \\ D7 & Nominal 2 & 108 \\ D8 & Nominal 3 & 48 \\ D9 & Fault 1 & 93 \\ D10 & Fault 3 & 90 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Available dataset.  
Figure 3: Signal of one cycle of the welding process in the nominal condition.