Answers.Body: <p>Why not try a <a href="https://towardsdatascience.com/a-friendly-introduction-to-siamese-networks-85ab17522942" rel="nofollow noreferrer">Siamese network architecture</a>?</p>
  <p>This architecture is used to compute the similarity between two inputs by applying the same neural network <span class="math-container">$f$</span> to two pairs of inputs <span class="math-container">$(X_b, X_p)$</span> and <span class="math-container">$(X_b, X_n)$</span> and computing a loss function which is minimised when the distance between <span class="math-container">$f(X_b)$</span> and <span class="math-container">$f(X_p)$</span> is smaller than the distance between <span class="math-container">$f(X_b)$</span> and <span class="math-container">$f(X_n)$</span> plus some margin, where <span class="math-container">$X_b$</span> is any training sample, <span class="math-container">$X_p$</span> a matching training sample, and <span class="math-container">$X_n$</span> a non-matching training sample.</p>
  <p>Your use case is not the typical one for Siamese networks (e.g. checking that two faces are the same), but it has the same structure, so it could work well.</p>
  <p>This also requires some preprocessing of the data to make these pairs, but doesn't increase the size of your dataset given that you are already creating all the pairs of input images.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-05T20:10:40.863Z
Answers.LastActivityDate: 2022-05-05T20:10:40.863Z
Answers.UserDisplayName: Raphael Lopez Kaufman
Body: <p>I am currently working on a project where the goal is to create a neural network that can determine if two pieces of torn tapes are a true fit or not. My current idea is a convolutional network that takes as inputs  2 pieces of tapes (256,256,2) and outputs a 1 or 0 if they are a true fit or not. The 2 channels are independent of each other, so I use grouped convolutions. Is there a better way to go about this? Any ideas would be appreciated!</p>
  <p><strong>Example of the data</strong></p>
  <p>Channel 1 (tape-1)
  <a href="https://i.sstatic.net/Osq0H.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Osq0H.jpg" alt="enter image description here" /></a></p>
  <p>Channel 2 (tape-2)
  <a href="https://i.sstatic.net/BKVNS.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/BKVNS.jpg" alt="enter image description here" /></a></p>
  <p>These pieces of tapes are an example of a true fit</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-05-09T13:08:46.170Z
Comments.Text: I would consider just trimming the black space on the left, flipping one image vertically and horizontally, concatenating the images left-to-right so the remaining black space is in the middle, and training a model based on those images
Comments.UserDisplayName: Criticize SE actions means ban
Tags: <neural-networks><convolutional-neural-networks><binary-classification>
Title: What architecture would be best to match images of torn pieces of tapes?
UserDisplayName: sockthehawk107
ThreadText: # What architecture would be best to match images of torn pieces of tapes?
  
  (Asked by: username_0 on 2022-05-03)
  
  I am currently working on a project where the goal is to create a neural network that can determine if two pieces of torn tapes are a true fit or not. My current idea is a convolutional network that takes as inputs 2 pieces of tapes (256,256,2) and outputs a 1 or 0 if they are a true fit or not. The 2 channels are independent of each other, so I use grouped convolutions. Is there a better way to go about this? Any ideas would be appreciated!
  
  **Example of the data**
  
  Channel 1 (tape-1)
  [![enter image description here](https://i.sstatic.net/Osq0H.jpg)](https://i.sstatic.net/Osq0H.jpg)
  
  Channel 2 (tape-2)
  [![enter image description here](https://i.sstatic.net/BKVNS.jpg)](https://i.sstatic.net/BKVNS.jpg)
  
  These pieces of tapes are an example of a true fit
  
  **Tags:** neural-networks, convolutional-neural-networks, binary-classification
  
  > **Comments:**
  > **username_1**: I would consider just trimming the black space on the left, flipping one image vertically and horizontally, concatenating the images left-to-right so the remaining black space is in the middle, and training a model based on those images  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2022-05-05. Score: 1
  
  Why not try a [Siamese network architecture](https://towardsdatascience.com/a-friendly-introduction-to-siamese-networks-85ab17522942)?
  
  This architecture is used to compute the similarity between two inputs by applying the same neural network $f$ to two pairs of inputs $(X\_b, X\_p)$ and $(X\_b, X\_n)$ and computing a loss function which is minimised when the distance between $f(X\_b)$ and $f(X\_p)$ is smaller than the distance between $f(X\_b)$ and $f(X\_n)$ plus some margin, where $X\_b$ is any training sample, $X\_p$ a matching training sample, and $X\_n$ a non-matching training sample.
  
  Your use case is not the typical one for Siamese networks (e.g. checking that two faces are the same), but it has the same structure, so it could work well.
  
  This also requires some preprocessing of the data to make these pairs, but doesn't increase the size of your dataset given that you are already creating all the pairs of input images.
  
  
  ---
  
  