The ALPHA experiment at CERN is designed to produce, trap and study antihydrogen, which is the antimatter counterpart of the hydrogen atom. Since hydrogen is one of the best studied physical system, both theoretically and experimentally, experiments on antihydrogen permit a precise direct comparison between matter and antimatter. Our basic technique consists of driving an antihydrogen resonance which will cause the antiatom to leave our trap and annihilate. This resonant frequency can be compared with its corresponding value in hydrogen. The antihydrogen annihilation location, called the vertex, is determined by reconstructing the trajectories of the annihilation products and by finding the point where they pass closest to each other. The main background to antihydrogen detection is due to cosmic rays. When an experimental cycle extends for several minutes, while the number of trapped antihydrogen remains fixed, background rejection can become challenging. The use of ``cuts-based'' analysis is often not sufficient to reach the target statistical significance. Machine learning methods have been employed in ALPHA for several years, leading to a dramatic reduction of the background contamination. Thanks to these techniques, the ALPHA collaboration observed for the first time a transition between Zeeman levels of the antihydrogen ground state , placed the most stringent upper limit to the antihydrogen electric charge , and performed the first laser spectroscopy experiment . These results will be presented along with the optimization of the analysis methods employed in these measurements.
 C. Amole et al., Nature 483, 439-443 (2012)
 M. Ahmadi et al., Nature 529, 373-376 (2016)
 M. Ahmadi et al., Nature 541, 506-510 (2017)