Computational methods for leakage localisation in a vacuum bag using volumetric flow rate measurements

The localisation of leakages during the vacuum bagging process of a composite is currently time intensive and reliant on human labour. The purpose of this article is to explore four computational methods for leakage localisation using volumetric flow rate (VFR) data to increase the automation of the process. The data used in this article is based on experiments on a square vacuum bag with four vacuum ports. The first method is based on potential flow theory to simulate the flow. In the second method, numerical regression was applied to find a relation between the VFRs and port-leakage distances. The third method consisted of calculating the fractional VFRs for every point on a grid and finding the grid point whose values most closely correspond to the observed fractional VFRs. The last method involved training a machine learning algorithm with experimental data. After the development of the methods, their performance was tested over the entire single-leakage dataset and compared. The results were in the same order of magnitude for all methods, with an area of 105\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$10^5$$\end{document} mm2\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$^2$$\end{document} for the 95% confidence interval and a distance of 102\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$10^2$$\end{document} mm for the average error. Further research is required for application to different vacuum bag shapes and multiple leakages cases. The method with the highest adaptability and performance is the method based on potential-flow theory. Machine learning and the potential-flow method is further applicable to multiple leakage localisation.


Introduction
During the curing process of a composite, maintaining a vacuum environment is essential to imbue the final product with the necessary material properties [1][2][3]. However, the successful completion of such processes is hindered by the possibility of leakages in the vacuum bag [4]. The presence of a leakage during the curing process can severely deteriorate the mechanical properties of the composite material if left unresolved [5,6]. Determining the location of leakages is, therefore, of utter importance. However, the localisation process with the current state-of-the-art methods is time consuming and reliant on human labour [7]. Consequently, there is a demand for a new, faster and more automated localisation method, which can be achieved through analysis of the VFRs through the vacuum ports [8].
Menke developed the current state-of-the-art method [8] which allows for an estimate of the location of a single leakage. His study concerned a triangular vacuum bag with a vacuum port in each corner. The method was composed of two steps: The first step divided the vacuum bag into twelve sub-areas. The sub-area where the leakage is thought to be found, is determined based on the relative positions of the sub-areas, the positions of the vacuum ports, and the corresponding VFRs. The second step further reduces the search 1 3 area. A relation between the distance of the leakage to a vacuum port and the fraction of VFR through that vacuum port, allows to determine a circle around the vacuum port, near which the leakage is expected to be located.
The two steps are combined to find a segment of the circle which is inside the determined sub-area. The leakage should then approximately be located in the vicinity of this circle segment. This method showed that it is possible to determine the position of the leakage through the volumetric flow rate but needs more improvement as it is at the moment not based on a reliable mathematical model and its limits regarding accuracy and detection of multiple leakages are unclear and unstudied. Furthermore, this method leaves room for improvement as it becomes more inaccurate as the distance between the vacuum port and the leakage increases [9].
This article aims to explore four computational methods for leakage detection using volumetric flow rate (VFR) data. In contrast to a triangular vacuum bag, the experimental data for this article is based on a square vacuum bag with four vacuum connections.
Firstly, the article introduces the reader to a description of the received experimental data. After that, the methods section discusses the four different approaches, being potential flow, numerical regression, VFR matching and machine learning. The next sections are the results and comparison sections, where some representative samples are discussed and weighed between the methods. In the last section, a conclusion is presented.

Description of data
The study is based on data produced during a series of experiments on a square vacuum bag. The experimental data is the main source of insight on the flow behaviour within the vacuum bag while also acting as a means of validating the models.
The square vacuum bag has sides of 1500 mm and is shown in Fig. 1. Each of the four vacuum ports are positioned towards the corners of the vacuum bag, at 75 mm distance from either side. The vacuum bag was empty (no manufacturing component was used). The layers constituting the vacuum bag are release film, breather and vacuum film, which are the usual materials employed in vacuum bagging processes [10].
During the experiment, the leakages were artificially introduced with hypodermic needles of three different sizes: 0.3, 0.45 and 0.6 mm. The number of leakages applied varied from none to three-none as a control case to determine any experimental errors. The VFR were recorded from the beginning of the vacuuming process until their convergence to a stable value.
The dataset of a single experiment sample consists of the number of leakages, their position and size, together with the four VFRs (one for each vacuum port) measured throughout time. The collection of one thousand experiments is the overall sample set used in the study. Out of all of the experiments, approximately 10% is carried out with no leakages and the other approximately 90% of experiments is more or less equally subdivided over one, two or three leakage cases.

Methods
This article aims to explore computational methods for leakage detection using volumetric flow rate (VFR) measurement data. The purpose of these methods is to localise an area with a high probability of containing the leakage, after which methods to find the exact location of the leakage can be applied [8].
The data is analysed with four independent and in-house methods, relying on different approaches: Potential flow based theory, numerical regression, VFR matching and machine learning using experiments with one leakage. After the different steady-state models are able to generate valid results to localise a single leakage, their accuracy is evaluated and compared. The feasibility of their application to the localisation of multiple leakages situations is then assessed Finally, the methods are tested on their ability to be applied on different vacuum bag geometries.

Potential flow
This method utilises potential flow [11] as a basis to model the ports and the leakage as sink and source flows, inside a bounded region in 2D space. It is important to note that this theory only holds if the flow satisfies Laplace equation, in addition to being strictly steady-state analysis.
The velocity potential of a sink or source, in Cartesian coordinates, is defined by Eq. (1).
where is the VFR or the strength of the sink/source. The x 0 and y 0 represent the location of the sink/source in mm.
In case of a leakage, it is assumed that the majority of air directly flows from the leakage towards the four ports, taking the shortest path. This results in a VFR at each of the four ports, regardless of the elapsed time. As the distance from each port to the leak differs and to adhere to the conservation of mass, the velocity vector along the port-leak path should be proportional to the VFR of the corresponding port. Consequently, the goal is to obtain the corresponding average velocity along the port-leak paths and compare the velocity ratio to the VFR ratios.
Numerically, the ports are modelled as sinks, while reference leakages are modelled as sources to simulate the flow. As the flow cannot leave the bag, a boundary must be defined and needs to be discretised into control points with source or sink characteristics.
The complete velocity vector field is determined for each arbitrary leakage position, from which a sorting algorithm attempts to find an equilibrium point by moving the leakage across the whole bag. The most probable area of the leakage would then be based on the smallest difference between the VFR and average velocity ratios of the corresponding area. The velocity vector field can be modelled using the partial derivatives of Eq. (1) in Cartesian coordinates; with Eqs. (2) and (3) representing the x and y components of the velocity field, represented with the u and v, respectively. Figure 2 shows the vacuum bag with a leakage using the potential flow method.

Numerical regression and quadrilateration
This method involves finding a relation through numerical regression for the distance from the leakage to the vacuum port and the VFR fraction through that vacuum port. This relation is then used to make a prediction on the location of the leakage.
First of all, only the samples with one leakage are considered. A plot of the relevant data is shown in Fig. 3.
The pattern created by the data points along a curve suggests a relation between the two variables (pump-leakage distance and VFR fraction) similar to an inverse proportionality. The regression uses the distance from vacuum port as an independent variable and the fractional VFR as dependent variable. The basis functions of the regression are obtained starting from a high number of functions, such as powers of x, 1/x, trigonometric functions, the exponential function, and the natural logarithm. Equation (4) represents the relation between VFR fraction and the distance from the leakage to the pump, r, as a combination of the basis functions and their coefficients. where a n represents a to be determine value.
The regression is performed several times in order to reject basis functions that do not provide a meaningful contribution. That is when they have a negligibly small coefficient assigned to them. Finally, the regression function is inverted and applied simultaneously to the fractional VFRs of the four vacuum ports. This results in the estimated distance between each port and the leakage, visualized as circles around the vacuum ports. Since the radii of all four circles are estimations, the circles will not intersect in one and the same point, which would be the case if an exact relation was known. Hence, the prediction for the leakage location is the point which is closest to all four circles. To find this point, Newton's method for optimisation [12] was applied to minimise the sum of the squares of the distances from the prediction to the circles. An example of the circles and the prediction is shown in Fig. 4.

VFR matching
The VFR matching method is based on the assumption that the amount of flow varies with the radial distance from its source/ sink. This is further supported by potential flow theory [11]. Equation (5) shows that the VFR ̇ over length l, is directly proportional to the radial distance from the source/sink times radial velocity [13].
where ṁ is the mass flow in kg/s, the density in kg∕m 3 and V r is the radial velocity of the flow in m/s. This method assumes inviscid, incompressible, laminar and steady flow in the vacuum bag and through the vacuum ports. Furthermore, the method does not require any experimental data. Firstly a grid with N grid points is obtained, where the coordinates of each grid point are stored in a Coordinate Matrix (CM). As already stated by Haschenburger et al. [8], each vacuum port takes up a fraction of the total entering flow, resulting in the vacuum port VFR over the total VFR, C, given in Eq. (6).
where is the VFR over the length in mm 2 /s and r is the distance from the leakage in mm. The subscripts vp and tot represent the vacuum port VFR and the total VFR, respectively. Since there is only one leakage, the sum of VFR fractions through the vacuum ports must equal one as seen in Eq. (7). Substituting Eq. (6) into Eq. (7) leads to Eq. (8). There is a point for each of the pumps of every experiment. For each experiment, the horizontal component is obtained calculating the distance between a specific pump and the leakage of the experiment, the vertical consists in the VFR fraction measured in the vacuum port corresponding to the same pump. The points seems to suggest a relation similar to an inverse proportionality Once the grid is ready, the radial distance from each grid point to the four vacuum ports is found and is used to calculate the VFRs for each of these vacuum ports (on each grid point) using Eqs. (8) and (6). These VFRs are stored in an array of four elements and assembled into an N × 4 matrix containing the VFRs for all N grid points for all vacuum ports, called the Volumetric Flow Matrix, VFM. In reality the nonzero volumetric flow fractions for all vacuum ports will be known. These fractions are compared to the VFM and the closest entry from the VFM will be used to get the corresponding coordinates from the Coordinate Matrix. An example of how the grid looks with one prediction is shown in Fig. 5. In Fig. 5 each point is treated as if it corresponded to the leakage location, the VFR corresponding to each situation is calculated using an inversely proportional relation between distance and VFR fraction and stored inside the matrix. Finally, the real measured VFR fraction combination is compared to the calculated ones and the discretised point with the combination that matches the closest the experimental one is chosen as the predicted leakage location. The example shows a grid with 2304 nodes representing the individual leakage positions for which the data is stored inside the VFM. The resolution of the matrix can be chosen in accordance to the individual application.

Machine learning
Machine learning is known to be able to find complex relations in data, given sufficient learning data is available [14].
In this case, supervised artificial neural networks were used instead of modelling the physical phenomena or making predictions about the exact statistical relations between VFR measurements and the location of the leakages. Four input nodes are used with the values of VFR at a converged state and two output nodes with the predicted x and y position of the leakage.
There are three steps needed in order to apply machine learning to the given data. First, during the initial setup, the available data is processed in which the list of all the given VFR data and the respective leakage position data is collected and combined with the mirrored and rotated data 1 in order to increase the amount of learning data. Furthermore, the appropriate number of hidden layers and corresponding nodes for each layer is determined. This is done following basic neural network development guidelines [14] and by experimenting how these values affected the performance of the neural network.
The second step is training the neural network, in which the parameters of the activation functions are adjusted to increase the accuracy of the predictions. These parameters are changed using the gradient vector of average error across all data points. The neural network is developed using only the original data as the rotated and mirrored data is used to test if the neural network is able to predict general data points and is not over-adjusted.
Once further learning iterations do not improve the accuracy of the neural network, it can be used for the third stepprediction of the location of the leakages. At this point, the neural network is no longer changed and can be verified using data that was not used for learning.
A simple neural network is shown in Fig. 6, in which 2 input nodes, 2 hidden layers and an output layer with 2 nodes is used.
The points on the left (light blue colour) constitute the input data which was provided to the program and are expected to sufficiently describe the state conditions of the outcome of the behaviour to be modelled. The two central columns (grey colour) represent the neural points where the program develops its model. Lastly, the column on the

Results
After the methods have been developed, their performance in predicting the leakage location is measured for all the single-leakage experiments in the dataset. The performance of all the methods is described by common error parameters in order to lay the basis for the comparison. In particular, three areas of confidence (68%, 95%, 99.7%) were computed. These regions are the search areas that would be used for the exact localisation of the leakage by a technician during the composite manufacturing process.

Potential flow
After simulating each single-leakage case with the potential flow method, the results were plotted with the use of a heat-map and were split into two categories: one in which the leaks are noticeably close to a boundary, and the rest. In Fig. 7a-c, general cases can be seen. The different coloured regions correspond to different likelihood estimates for the leakage to be located in that specific region. The most probable leakage position corresponds to the darkest colour, while the ground-truth is marked with a red dot.
In the first case, in which the leak is in the close proximity of the boundary, the method can not precisely localise the leakage position as the effects of the boundary sinks and sources have a higher impact than the simulated leakage, resulting in an unfavorable shift of the leakage position prediction. However, the colder colour gives a reasonable estimate for the leakage position, as can be seen in Fig. 7a. In Fig. 7b, the leakage is not in close proximity of the boundary but the effect of the boundary sinks and sources is still present which generates some uncertainty. The uncertainty results in a larger predicted area for the leakage, but the dark blue colour is still consistent with the real leakage position.
In the last case, in which the leakage is located closer to the middle of the bag, as can be seen in Fig. 7c, the determined position is approximately identical to the real leakage position as the effect of the boundary is negligible compared to the effect of the leakage. In Fig. 8, the error distribution can be found for every single-leakage case with the use of potential flow.
The distribution does not resemble a Gaussian distribution but rather a strictly decreasing one: the vast majority of the leakages are predicted with a very small error (lower than 0.5 mm 2 ⋅ 10 5 ). Furthermore, the corresponding error quantification table can be seen in Table 1.
In Fig. 9 an example is shown, for which the required search area is highlighted in white. The search area is determined by colouring the most probable leakage position with the white colour, until the real position is within the white Further research and development is still in progress regarding the extension to multiple leakage cases as preliminary simulations with low resolutions showed that the leakage positions might also be estimated in those cases. Unfortunately, it requires a more in-depth analysis which is outside the scope of this paper.

Numerical regression and quadrilateration
The numerical regression resulted in the relation shown in Eq. (9).
Where r is the distance between leakage and a particular vacuum port in mm and VFR fraction is the fraction of the total (9) VFR fraction = 0.497672 − 0.000254 ⋅ r + 13.93866 r VFR flowing through that vacuum port. The regression function is visualised in Fig. 10. Predictions for three general cases are presented in Fig. 11. In the first case, shown in Fig. 11a, the method is   Fig. 9 The heat-map shows an area with white colour which is an example of area of confidence. After the confidence probability of interest is chosen, the dimension of the confidence area is determined using the results obtained applying the method to the entire set of experiments. Once the dimension of the confidence area is established, each experiment can be analysed individually. The areas with the higher probability in containing the leakage are part of this confidence area Fig. 10 The image shows the same distribution of data points related to one-leakage experiments as in Fig. 3 together with the regressor function found (Eq. (9), orange line. The found regressor function approximates the distribution of the points better for middle range distances rather than for extremes (both large and small distances) (colour figure online) able to predict the leakage position around the centre with reasonable accuracy. In Fig. 11b, a case is depicted where the leakage is on the boundary and the prediction is less accurate. In the third case, the leakage is located towards the boundary but not in the immediate vicinity, as can be seen in Fig. 11c. The accuracy of the prediction is in between the accuracies for the two previously mentioned cases. In general, the closer the leakage is located to the boundary, the more difficult it is for the method to accurately predict the leakage location. The numerical regression method was based on single-leakage cases only. Therefore, this method is not able to capture the complexity that occurs when multiple leakages with varying diameters are present. Newton's method converges fairly well towards the actual leakage position when the leakage is not near one of the vacuum ports. Whenever the leakage is located close to a vacuum port, Newton's method has the tendency to diverge. Hence, the leakage is assumed and predicted to be in vicinity of the vacuum port with the highest fractional VFR, whenever the method diverges. On assessment, this assumption yields desirable results. Figure 12 shows the distribution of the error between the prediction and the actual location. A summary of the results is presented in Table 2.

VFR matching
Similarly as for the other methods, this method was tested for three different cases of a leakage occurring with the results depicted in Fig. 13. It can be seen that this method yields accurate results, independent of the leakage location. The VFR matching method was implemented for different grids ranging from 4 to 2601 grid points. For each of the grids an error matrix was computed using the experimental data. This error matrix contained the distance error between the predicted leakage and the actual leakage location. These   error matrices for the different grids were used for statistical evaluation of the method. Figure 14 shows that the average error converges up to 115 mm after approximately 500 grid points are used. It can thus be concluded that if one desires to minimise run-time, a relatively coarse grid can be used while still obtaining an accurate prediction of the leakage. In Fig. 15 the normal distribution (orange line) and histogram (blue bars) of the errors for all of the received data points is shown for a grid with 2304 nodes. The distribution is thought to approach a Gaussian distribution given a sufficiently high number of experiments which is why the normal distribution line is provided. It can be observed that the majority of the errors between the predicted location and the location of the received data points are below 200 mm, but there are some outliers present due to either measurement errors of the data received or model errors. Finally, Table 3 shows some general statistical results of the VFR matching method, all for a grid with 2304 nodes.
This method does not work for multiple leakages as it is not able to model the interactions between multiple leakages. Differently from the previously shown methods, the quality of the prediction is not noticeably sensitive to the location of the leakage The method is however applicable to different geometries, even 3D, as long as none of the lines connecting a leakage to each of the vacuum pumps intersect. Otherwise the interaction between stream lines would have to be taken into account.

Machine learning
The final neural network used for the leakage location prediction consisted of one hidden layer with eight nodes and the Softplus function, Eq. (10), as activation function for both the hidden layer and the output layer.
This function was chosen due to its similarity to how VFR values are expected to correlate with the distance of the leakage to a port.
The visualisation of the final neural network can be seen in Fig. 17.
The numerical results of this method are summarized in Table 4. The results are split in two parts: one using the given training data and the second using given training data together with rotated and mirrored data, taking advantage of the symmetry of problem to measure the generality of the neural network. The results are quantified using the average error, error variance and multiple areas of confidence.
The distribution of the error is visualised in Figs. 18 and 19. These figures show distribution of error in leakage position prediction determined by the developed neural network, using the VFR from the experiments (blue histogram). The distribution is thought to approach a Gaussian distribution given a sufficiently high number of experiments (of which the prediction is shown with the continuous line). The predictions of three example cases, made by this neural network, are shown in Fig. 16. The results, in contrast to the previous methods, do not show significantly higher error for the cases in which the leakage is located in close proximity of one of the corners.
Theoretically, machine learning is expected to work with any number of leakages if a physical relationship between the VFR data and the leakage position exists in combination with  the appropriate amount of training data. The expected preliminary quality requirement was not met by the obtained results of the single-leakage cases. Therefore, more complex methods such as position localisation of multiple leakages or time involvement in the localisation process were not attempted. Machine learning consists of vast arrays of complicated solutions that could be applied to solve the leakage localisation problem. In this case a simplified model was produced to prove that machine learning is applicable. Although this approach produced the least accurate results of all the methods discussed in this paper, there is still substantial opportunity for further optimisation of this method.

Comparison
All of the four independent methods are able to determine a predicted area in which the leakage is expected to be located. In order to evaluate their performance, the four methods are compared based on the following criteria, which can also be found in Table 5: • Size of the predicted confidence area Considering the aim of this paper, the area of prediction for a certain confidence level needs to be minimised. Potential flow theory performed the best producing the smallest area prediction for a potential leakage with an average error of 105 mm. However, the results for all methods belong to the same order of magnitude, therefore the difference is not substantial. • Average error, median error and error standard deviation magnitude The average error is an informative benchmark for assessing the accuracy of the methods. Furthermore, it shows the effect of the outliers in the predicted position. Hence, the smaller the average error the preciser the location. Moreover, median error and standard deviation are  useful statistical parameters describing the error distribution. The two methods with the most room of improvement, machine learning and VFR matching, are the ones which produce the highest error standard deviation-with machine learning having around 40% higher that the result produced by the best method. • Ability to be extended to multiple leakages For future development, the focus should lie on the extension to multiple leakage detection and localisation. This study focused solely on single-leakage scenarios so that the evaluation on multiple leakages detection is speculation based on the nature of the methods produced. Potential flow and VFR matching-based methods rely on the same theory and are likely applicable to multiple leakages overlapping single stage scenarios. Machine learning can also applied as long as the number of experiments provided is sufficiently high. The regression-based approach would not work in its current state and it is believed that the higher level of complexity that is related to multiple leakages detection would make this approach obsolete compared to machine learning. • Applicability to variable geometries It is relevant for industrial application to be able to handle vacuum bags with non-square shapes. All the methods require further development before testing. The potential flow and VFR matching methods are base on a theory that is independent of the shape of the vacuum bag as long as the vacuum bag shape is convex, however for the other methods further research is required. Similarly for the case of multiple leakages, the limitations of machine learning derive from the amount of experiments the learning algorithm is fed with. • Prediction sensitivity to leakage position The potential flow and regression-based methods show a noticeable decrease in either confidence or accuracy in leakage prediction when the leakage is located close to the boundaries of the vacuum bag. This does not happen with the two other methods. This factor is especially relevant in case the entire process of leakage detection would be automatised.
From Table 5, it follows that the potential flow method is the most effective, since it has the smallest predicted confidence area of 1.574 ⋅ 10 5 mm 2 for the 95% confidence interval, smallest average error, 105.43 mm, and it can be applied for both multiple leakages and different geometries. However, the confidence of the prediction degrades when the leakage being predicted is close to the boundaries of the vacuum bag.

Conclusion
Leakage-free vacuum bagging is imperative for the curing process of composites. With the aim of exploring four computational methods for leakage detection using VFR, four approaches were developed and tested. Two of the four methods were based on the experimental data, in which data analysis was used, be it numerical regression or machine learning. The other two methods, potential flow and VFR matching, did not need the experimental data to make their predictions as they make use of potential flow theory in aerodynamics. Five criteria have been determined in order to decide upon the most effective method, more specifically, those are: predicted area, average error, applicability to multiple leakage cases, applicability to different geometries and sensitivity to leakage position. For the area, the 95% confidence interval is used for comparison. Consequently, potential flow is the best method regarding the first four criteria, thus appears to be the most suitable solution for leakage localisation. It is speculated to be applicable to different geometries and for multiple leakages prediction, it has the smallest predicted confidence area of 1.574 ⋅ 10 5 mm 2 for the 95% confidence interval and the smallest average error, 105.43 mm. The only drawback of the method is the decrease in performance when the leakages are close to the edges of the vacuum bag. Further details on the relative performance of the methods are found in Table 6. Particularly relevant metrics are the confidence intervals and how their dimension increases for higher confidence. It is important to notice that even if potential flow is the best performing method, all methods produce confidence intervals in the same order of magnitude.
All the methods would require further development for industrial application since all the experiments were performed on a square vacuum bag without any object inside it. Multiple leakage detection is the subsequent step of complexity that would bring computational methods closer to real life applications. Moreover, to test the capability of the methods, experiments should be carried out with components of different shapes inside the vacuum bag.