## 3 Discussion of Results  
Before the final objective of defect detecting in an industrial fir-tree slot is addressed, the capacity of the network to model the distance between wire and workpiece during the experiments described in the previous section was studied. The network has been trained using as many as 500 epochs. The average of the per-epoch absolute error (MAE) scores is shown in Figure 2(a). By smoothing the curve, the final result is plot in Figure 2(b). According to this result, the best training situation is that corresponding to 390 epochs, with a MAE score of 3.46. Then, the accuracy of the network to predict the actual distance between wire and workpiece was evaluated. For doing so, 20 sets of data from each region of the part have been used. The results of the prediction are presented in Table 4. Taking into account the uncertainty due to wire vibration, it can be said that the accuracy of the prediction by the network is very high. The maximum average deviation is 5.78 \(\upmu\)m, and this corresponds to the situation of larger distance between wire and workpiece, in which the probability of wire vibration is also higher. At the sight of the above results, it was decided to test the proposed defect detecting methodology in an industrial environment. The fir-tree slot was cut using the same machine parameters as those gathered in Table 1. The geometry is that shown in Figure 0(a). Figure 3: (a) Validation through MAE score for every training epoch; (b) Plot after smoothing. Figure 2: Regions on the workpiece during the experiments as a function of wire infeed. Discharge types have been collected during WEDM'ing of the fir-tree slot, and they have been classified as for Table 2. The resulting values have been used as the input for the previously trained deep neural network, which in turn generates the expected tolerances all along the complete profile of the fir-tree slot. At the same time, the cut geometry has been measured using a Mitutoyo 9106 Coordinate Measuring Machine (CMM). The result of the actual measurement of the WEDM'ed part is shown in Figure 4. Data represented on the right side of the ideal profile means that less material than required has been machined. On the contrary, data represented on the left hand side means that more material than required has been removed. The tolerance band accepted by the manufacturer is \(\pm 15\)\(\upmu\)m (in green). Material outside that band is represented in red color. In order to check the validity of the predictions produced by the deep neural network, a tolerance band of \(\pm 5\)\(\upmu\)m has been set for the results, which is even more demanding than that represented in Figure 4 for the CMM. This means that, if the infeed predicted by the network is more than \(+5\)\(\upmu\)m, there is a defect of material with respect to the ideal profile. In other words, too much material is being cut with respect to the ideal situation. The detection system informs of acceptable geometry when the predicted infeed is within the tolerance band \(\pm 5\)\(\upmu\)m. Finally, if the infeed predicted by the network is below \(-5\)\(\upmu\)m, this means that there is an excess of part material with respect to the ideal profile. In other words, less material than expected is being machined with respect to the ideal situation. Figure 5, together with Table 5, represent the results of the prediction by the network. Lack of material is represented in blue color. Yellow color means that the profile is inside the tolerance band.