Are there ways to handle paired inputs in the deep neural network (DNN)? First, I will describe my problem, and then I will describe an equivalent problem in the image.

We have many protein sequences (each distinct but equal length), and we don't know their functions (we know the function of some). To determine the function we need to determine the similarity between them, but we don't know how to define similarity. We want to use DNN to learn similarity/distance for two protein sequence. So input is two protein sequence and output is protein similarity/distance score.

The equivalent problem in images will be: There are images of multiple people in multiple backgrounds/angle, and we need to determine whether any two picture is the same person or not.

  • 1
    $\begingroup$ You need to come up with a similarity measure here. In case of facial recognition it's relatively easy if not laborious: anyone can be asked to tag the same people on pictures. In case of proteins how are you going to judge the quality of the algorithm? You can't tell yourself what's similar. In that regard this problem is not like facial recognition, in my opinion $\endgroup$ – Aksakal Feb 16 '18 at 18:37
  • $\begingroup$ @Aksakal I have some training data from in-vitro experiments that enable me to score if two proteins, which are tested, are similar or not. $\endgroup$ – avi Feb 16 '18 at 22:11
  • $\begingroup$ Great then you may try to develop the similarity measure based on this set. $\endgroup$ – Aksakal Feb 16 '18 at 22:20

The facial recognition analogy has been solved with Triplet Loss detailed in FaceNet: A Unified Embedding for Face Recognition and Clustering.

To summarize: Train on triplets of three training examples (A,P,N) such that (A,P) are similar and (A,N) are different, and choose a loss function to simultaneously reward similarity between (A,P) and penalize similarity between (A,N).

Choosing triplets effectively is a bit tricky, and the paper discusses how to get this right.

In terms of architecture, you could use a 1D convolutional neural network where you stack sequence triplets channel-wise in each training example.


You might find Deep metric learning using Triplet network interesting.

It aims to learn useful representations by distance comparisons. Here we simply interpret “closeness” as “sharing the same label”.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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