This letter is devoted to the application of machine learning, namely, convolutional neural networks to solve problems in the initial steps of the common pipeline for data analysis in metabolomics. These steps are the peak detection and the peak integration in raw liquid chromatography-mass spectrometry (LC-MS) data. Widely used algorithms suffer from rather poor precision for these tasks, yielding many false positive signals. In the present work, we developed an algorithm named peakonly, which has high flexibility for the detection or exclusion of low-intensity noisy peaks, and shows excellent quality in the detection of true positive peaks, approaching the highest possible precision. The current approach was developed for the analysis of high-resolution LC-MS data for the purposes of metabolomics, but potentially it can be applied with several adaptations in other fields, which utilize high-resolution GC- or LC-MS techniques. Peakonly is freely available on GitHub (https://github.com/arseha/peakonly) under an MIT license.