# Reconstruction of Ultra-High Vacuum Mass Spectra Using Genetic Algorithms
## 4 Discussion  
GAs have proved to be very efficient in finding extrema in multivariate functions and have been previously applied in other deconvolution problems in different research areas [16; 17; 18]. This led to the initial hypothesis that, given the nature of the problem exposed in this paper, these algorithms could be applied in the specific field of RGA in UHV systems.  
For this research work, we created and tuned a specific GA that provided an alternative to the state of the art for identifying the contributions of the different gas species to a particular MS sample. The main findings can be summarized in the following bullet points:  
* For both methods, the errors increase with the amount of candidate gases used for the construction of the real spectrum. This is a logical conclusion, as the difficulty of the problem increases with the complexity of the original MS;
* Gases contributing with very low pressures (near the detection limits used to train the classifier) are more likely produce higher relative errors, as they are penalized by the fitness function of the GA. However, these errors are very small in absolute terms and have a minimal affect in the reconstruction;
* Lowering the probability threshold for species selection helps decrease the final error reached by the GA. The reason for this is that the populations generated contain more diversity, which helps the GA get closer to the global extremum by recombining them;
* When comparing the IE obtained by the GA to the iterative deconvolution (considered a state of the art technique), we found the greatest improvement for the case of considering 2 gases and lowering the threshold to 0.3, reducing the IE by up to 2 orders of magnitude. It can also be observed that in the case of 10 gases, there is no significant improvement. This indicates that given the number of generations used in GA (10), there is an improvement limit when considering 10 gases but, for a smaller number of gases, the GA works significantly better.
* When comparing the computational times of both algorithms, the GA reaches an equal or better solution in terms of IE in the same or less time than iterative deconvolution in all cases. The computational advantage is greater the more complex the problem is, i.e., when increasing the number of gases in the original MS.  
The good results obtained confirm the usefulness of GAs in this context and open up the possibility of a two-stage automatic expert system (identification of the possible gases present and approximation of the partial contributions of each one). This system optimises the process, requiring the intervention of human experts uniquely for the final stage of the process, consisting of a final review of the results. The combination of the developed expert system together with visual data mining tools will provide the UHV community with new ways to study and analyze residual gases in such environments.  
It is also important to reflect on the limitations of our model when using it in a real-life scenario. In the first place, as seen in [2], the model used to identify candidate gases is trained on a subset of 80 gases from the NIST 2017 database. This obviously limits the range of gases to be found for the MS reconstruction with the GA. However, this problem could be solved by retraining the classifier to consider more gas profiles, which could be a good follow-up to this work. Secondly, the fact that the model has only been tested on simulated data limits the current possibilities of implementing it in an actual UHV environment with real data acquired from RGA. Finally, the fact that we have followed a heuristic process to adjust the threshold level could also be considered a limitation for the full automation of the reconstruction process. Future research lines include finding an efficient and automatic way to adjust this threshold.