# Reconstruction of Ultra-High Vacuum Mass Spectra Using Genetic Algorithms
## 3 Results  
In Table 2 we show a summary of the medians obtained in each distribution of the IE associated with each case of study, as mentioned in Section 2.5, after 10 generations of the GA have been run. \begin{table}
\begin{tabular}{c c c c} \hline \hline \multirow{2}{*}{**Number of Species**} & \multicolumn{3}{c}{**Threshold**} \\ \cline{2-4}  & **0.5** & **0.4** & **0.3** \\ \hline
2 & 0.00025 & 0.00021 & 0.00011 \\
5 & 0.03423 & 0.02048 & 0.00622 \\
10 & 0.42206 & 0.33730 & 0.23278 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Median of the IE distribution for each combination of threshold and number of gases. There are two important findings related to this result. On the one hand, we note that the error increases considerably with the amount of gases we consider. On the other hand, we notice that the error decreases with the reduction of the probability threshold, which indicates that the result improves when increasing the pool of candidate gases allowed for the reconstruction of the spectrum by GAs. Moreover, we observe how GAs work in each generation. First of all, we select the gases to be used by the search for partial pressures using the ML model [2]. Once the gases have been selected, the search for the partial pressures for each one of the gases is carried out using the GA in an iterative way, until 10 generations are reached. After each generation, the MS reconstruction is performed and compared with the real spectrum. The GA selects the spectra that provide the lowest IE. Finally, we compare the final reconstructed spectrum against the real one using Equation (4). As shown in Table 3, the predicted partial pressures for the four main gases in the sample (_benzene, ethanol, trichlorometane and acetaldehyde_) attain levels that are very close to the real ones, while for the _fluorform_ species, there is some discrepancy. The reason for this is that the first four gases have greater influence in the reconstruction of the MS, whereas the latter has a much lesser impact (note that the fitness function is the difference between the real spectrum and the reconstructed spectrum, given by Equation (3)). In Figure 2, we can see a comparison between the real and the reconstructed MS by the proposed method, corresponding to the gases and partial pressures shown in Table 3. As observed, the profile of the original MS is successfully reconstructed with a low error using a linear combination of the pre-selected gases weighted by the obtained partial pressures. Figure 3 shows the absolute differences between both the real and the reconstructed MS of Figure 2. As can be seen, the estimated results are very close to the actual values for \begin{table}
\begin{tabular}{l c c} \hline
**Gas Species** & **Predicted** & **Real** \\ \hline Benzene & \(9.7\times 10^{-09}\) & \(8.4\times 10^{-09}\) \\ Ethanol & \(2.5\times 10^{-09}\) & \(2.5\times 10^{-09}\) \\ Fluoroform & \(1.9\times 10^{-13}\) & \(1.1\times 10^{-12}\) \\ Trichloromethane & \(1.7\times 10^{-09}\) & \(1.9\times 10^{-09}\) \\ Acetaldehyde & \(4.5\times 10^{-09}\) & \(4.2\times 10^{-09}\) \\ \hline \end{tabular}
\end{table} 
Table 3: Comparison of the partial pressures (in mbar) obtained in the last iteration of the GA and the real partial pressures. Figure 2: Comparison between a normalized reconstructed spectrum using the GA and the real one. the majority of the mass indexes. Only in three cases, the errors are outside the confidence interval of 0.95 (considering a Gaussian distribution for the errors). Finally, it is important to put into context the effectiveness of the model with respect to the current state of the art. As stated in Section 2.3, the technique proposed in [8] provides an estimated reconstruction based on an iterative algorithm that sequentially adds gases at their optimal pressure to the sample. This is the most advanced technique to date for solving this type of problem; it is therefore interesting to show the efficiency of our model compared to iterative deconvolution.