Body: <p>I have 2 different models with each model doing a separate function and have been trained with different weights. Is there any way I can merge these two models to get a single model.</p>
  
  <p><strong>If it can be merged</strong></p>
  
  <ul>
  <li>How should I go about it? Will the number of layers remain the same?</li>
  <li>Will it give me any performance gain?(Intuitively speaking, I should get a higher performance)</li>
  <li>Will the hardware requirements change when using the new model?</li>
  <li>Will I need to retrain the model? Can I somehow merge the trained weights?</li>
  </ul>
  
  <p><strong>If the models cannot be merged</strong></p>
  
  <ul>
  <li>Why so? After all, convolution is finding the correct pattern in data. </li>
  <li>Also, if CNN's cannot be merged, then how do skip-connections like ResNet50 work?</li>
  </ul>
  
  <p><strong><em>EDIT:</em></strong> </p>
  
  <p>Representation: </p>
  
  <p><strong><em>What I currently have</em></strong></p>
  
  <p><code>Image ---(model A) ---&gt; Temporary image ---(Model B)---&gt; Output image</code></p>
  
  <p><strong><em>What I want:</em></strong></p>
  
  <p><code>Image ---(model C) ---&gt; Output image</code></p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-08-20T23:02:04.613Z
Comments.Text: Could you please give some more detail of your problem? Do both CNN have the same shape and architecture? Were they trained for the same purpose, with the same dataset?
Comments.UserDisplayName: Andre Goulart
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-08-20T23:08:19.113Z
Comments.Text: Also, what problem are you trying to solve? For example, you might have a CAT-DOG classifier + a PLANE-BIRD classifier and you want to combine them to make a 4 classes classifier... Another problem would be combining 2 similar purpose CNN, but each trained on datasets with different natures.
Comments.UserDisplayName: Andre Goulart
Tags: <neural-networks><convolutional-neural-networks><computer-vision><architecture>
Title: Merge two different CNN models into one
UserDisplayName: Nautatava Navlakha
ThreadText: # Merge two different CNN models into one
  
  (Asked by: username_0 on 2020-05-11)
  
  I have 2 different models with each model doing a separate function and have been trained with different weights. Is there any way I can merge these two models to get a single model.
  
  **If it can be merged**
  
  * How should I go about it? Will the number of layers remain the same?
  * Will it give me any performance gain?(Intuitively speaking, I should get a higher performance)
  * Will the hardware requirements change when using the new model?
  * Will I need to retrain the model? Can I somehow merge the trained weights?
  
  **If the models cannot be merged**
  
  * Why so? After all, convolution is finding the correct pattern in data.
  * Also, if CNN's cannot be merged, then how do skip-connections like ResNet50 work?
  
  ***EDIT:***
  
  Representation:
  
  ***What I currently have***
  
  `Image ---(model A) ---> Temporary image ---(Model B)---> Output image`
  
  ***What I want:***
  
  `Image ---(model C) ---> Output image`
  
  **Tags:** neural-networks, convolutional-neural-networks, computer-vision, architecture
  > **Comments:**
  > **username_1**: Could you please give some more detail of your problem? Do both CNN have the same shape and architecture? Were they trained for the same purpose, with the same dataset?  
  > **username_1**: Also, what problem are you trying to solve? For example, you might have a CAT-DOG classifier + a PLANE-BIRD classifier and you want to combine them to make a 4 classes classifier... Another problem would be combining 2 similar purpose CNN, but each trained on datasets with different natures.  
  
  ---
  
  ## 0 answers
  
  