I have a noisy signal and I'm trying to find a way to detect peaks with ML. The "peaks" are easy to find as human because they are rhythmic and have the same "general" shape but the amplitude and width of the desired peaks can vary from sample to sample.

Basically I can't just write a simple method to detect the peaks so I wanted to know if I could use ML to train a model that could learn to find the peaks more accurately. I'm new to ML so while I understand what a CNNs, RNNs and LSTM are, I don't know which would be useful in my scenario.


3 Answers 3


To be honest, I don't think CNNs, RNNs and LSTM are useful for this kind of problem – a bandpass filter followed by a threshold would be.

Now, that would have three parameters:

  • Lower cutoff frequency
  • Upper cutoff frequency
  • threshold value

and what is usually called "Machine Learning" is nothing but finding local minima over some (loss) function with real value over a multidimensional field.
There you go – three dimensions in, find the point in that threedimensional parameter field that when used to parameterize the filter-threshold algorithm yields points closest to these you manually label.

You can very well try and solve that using neural networks! But honestly, if I was to write an optimizer for that problem, it'd probably look at the spectrum of your signal, identify the frequencies of interests through STFT, and then only sweep the remaining threshold parameter to find a good solution.

  • 6
    $\begingroup$ But, but, but, "Machine Learning" is such a cool buzzword. $\endgroup$ Commented Jun 30, 2019 at 16:01

Yes, you can apply deep learning to peak detection. A 1D CNN would be appropriate for this task.

Here is an example for such application: Risum, Anne Bech, and Rasmus Bro. "Using deep learning to evaluate peaks in chromatographic data." Talanta 204 (2019): 255-260.

You would need to have annotated data.

If you decide to stick with the classical algorithms, try peak detection with prominence, which is available both in Matlab and in Python.


Here is an example from mass spectrometry. Finding peaks in a 2D dataset.


I think a NN approach is useful when you are interested in a certain kind of peaks. Like in this example, the author is interested in peaks with certain properties and other peaks are classified as noise. The NN provides a mechanism to learn arbitrary features of valid peaks only from provided (labeled) examples.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.