The objective is to compare two 1D array signals. The approach involves converting the input signals into their corresponding encodings, followed by a distance calculation. The anticipated output is a prediction value in proximity to 0 if the signals are dissimilar and close to 1 if they exhibit similarity.
Above image depicts use of this network to find similarity in two images, I want to replicate this for 1D array signals.
The application of this model involves providing two input signals, one of which is already known, and the other is unknown. The objective is to identify the similarity between the unknown signal and the known signature, thereby classifying the unknown signal.
A generalized method for this problem is to calculate cosine angle of unknown signal with all the known signal and signal with smallest angle would be class of unknown signal. This method gives decent results.
I tried several architectures:
A) For Encodings:
- Using 1D CNN followed by dense layers to create encodings of shape (1000).
- Using only dense layers.
- Using 2D CNN of shape
(1, 1, signal_length)
, followed by Dense layers.- All of the above with final encoding shape as (1).
B) For Distance calculation:
- L1 Distance
- L2 Distance
- Hamming Distance
- Cosine angle
All of this doesn't seem to do anything as model does not learn and loss remains same. What can I do to get better results?