Body: <p>I'm posting this question here because I've been trying in vain to solve a problem for weeks and I hope some of you might have some useful suggestions.</p>
  <p>Basically, the problem is as follows. I have 7 quantities that vary simultaneously as time changes. These quantities are somehow related to each other, but for simplicity's sake we could also consider them independent.</p>
  <p>To represent each of these quantities, I have a continuous signal that takes on values between 0 and 1 as time varies (x-axis). In essence, this is a time series as can be seen from the image below.
  <a href="https://i.sstatic.net/bxJZs.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/bxJZs.png" alt="Example of a signal depicting one of the 7 quantities" /></a></p>
  <p>What I would like to be able to do is to transform the continuous signal into another signal that can only accept values 0 or 1. Practically, from the signal shown in the figure above, I would like to be able to generate the signal shown in the figure below.
  <a href="https://i.sstatic.net/dovwN.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/dovwN.png" alt="Example of desired output" /></a></p>
  <p>I have a lot of data at my disposal, so I could create a set of training, validation and testing. The solution I thought of was to build a deep network that could learn the transformation between the input signal and the output signal.</p>
  <p>Ideally, the network should learn through a tailored loss to indicate the difference between ground truth and input signal. In addition, some consideration should probably be given to the context and thus the relationships between the various time instants. For this reason (i.e., temporal correlation) I had thought of recurrent networks or Transformers.</p>
  <p><a href="https://i.sstatic.net/o5QvK.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/o5QvK.png" alt="Sample/Ground truth compared" /></a></p>
  <p>However, I don't how to model this network and whether such a solution would actually make sense. I have also searched the literature for work of this kind, but to the best of my knowledge the problem has not been addressed.</p>
  <p>The problem seems well defined to me, but unfortunately I cannot find the right solution. Do you have any suggestions for me? Thank you in advance</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-07-28T08:17:01.917Z
Comments.Text: is not clear to me how the ground truth is defined, i.e. why in the second pictures are there two spikes mapper to 1 but not the others? I could think it's just a matter of thresholding, in which case would it be possible to learn to predict a threshold rather than the entire time series? (asking cause that would change the architecture completely).
Comments.UserDisplayName: Edoardo Guerriero
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-07-28T10:56:53.240Z
Comments.Text: This problem looks like a matched filter, which takes into account time correlation. Would that help?
  https://en.wikipedia.org/wiki/Matched_filter
Comments.UserDisplayName: Jaume Oliver Lafont
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-08-08T17:02:45.360Z
Comments.Text: @EdoardoGuerriero The first signal is a kind of confidence measure and, ideally, should only result in a 1 in the output if its value is above 0.5 in the original signal. However, the signal is noisy and very far from perfect, so a mere thresholding does not seem to work.
Comments.UserDisplayName: balchicc
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-08-08T17:06:48.337Z
Comments.Text: Thank you @JaumeOliverLafont. I did not know about matched filters, I will look into them and let you know if they were useful.
Comments.UserDisplayName: balchicc
Tags: <deep-learning><time-series><supervised-learning><signal-processing>
Title: How can I learn to transform one input signal (time series) into another?
UserDisplayName: balchicc
ThreadText: # How can I learn to transform one input signal (time series) into another?
  
  (Asked by: username_0 on 2022-07-28)
  
  I'm posting this question here because I've been trying in vain to solve a problem for weeks and I hope some of you might have some useful suggestions.
  
  Basically, the problem is as follows. I have 7 quantities that vary simultaneously as time changes. These quantities are somehow related to each other, but for simplicity's sake we could also consider them independent.
  
  To represent each of these quantities, I have a continuous signal that takes on values between 0 and 1 as time varies (x-axis). In essence, this is a time series as can be seen from the image below.
  [![Example of a signal depicting one of the 7 quantities](https://i.sstatic.net/bxJZs.png)](https://i.sstatic.net/bxJZs.png)
  
  What I would like to be able to do is to transform the continuous signal into another signal that can only accept values 0 or 1. Practically, from the signal shown in the figure above, I would like to be able to generate the signal shown in the figure below.
  [![Example of desired output](https://i.sstatic.net/dovwN.png)](https://i.sstatic.net/dovwN.png)
  
  I have a lot of data at my disposal, so I could create a set of training, validation and testing. The solution I thought of was to build a deep network that could learn the transformation between the input signal and the output signal.
  
  Ideally, the network should learn through a tailored loss to indicate the difference between ground truth and input signal. In addition, some consideration should probably be given to the context and thus the relationships between the various time instants. For this reason (i.e., temporal correlation) I had thought of recurrent networks or Transformers.
  
  [![Sample/Ground truth compared](https://i.sstatic.net/o5QvK.png)](https://i.sstatic.net/o5QvK.png)
  
  However, I don't how to model this network and whether such a solution would actually make sense. I have also searched the literature for work of this kind, but to the best of my knowledge the problem has not been addressed.
  
  The problem seems well defined to me, but unfortunately I cannot find the right solution. Do you have any suggestions for me? Thank you in advance
  
  **Tags:** deep-learning, time-series, supervised-learning, signal-processing
  > **Comments:**
  > **username_1**: is not clear to me how the ground truth is defined, i.e. why in the second pictures are there two spikes mapper to 1 but not the others? I could think it's just a matter of thresholding, in which case would it be possible to learn to predict a threshold rather than the entire time series? (asking cause that would change the architecture completely).  
  > **username_2**: This problem looks like a matched filter, which takes into account time correlation. Would that help? https://en.wikipedia.org/wiki/Matched_filter  
  > **username_0**: @EdoardoGuerriero The first signal is a kind of confidence measure and, ideally, should only result in a 1 in the output if its value is above 0.5 in the original signal. However, the signal is noisy and very far from perfect, so a mere thresholding does not seem to work.  
  > **username_0**: Thank you @JaumeOliverLafont. I did not know about matched filters, I will look into them and let you know if they were useful.  
  
  ---
  
  ## 0 answers
  
  