Answers.Body: <p>Yes this is standard transfer learning. Using a trained model, we can freeze the first N hidden layers of a classifier, except for the last few. This will allow our previous relevant training to be retained whilst also being able learn new features and target new classes.</p>
  <p>We will then initialize a new output layer that works our new context(i.e sigmoid, 1 node for binary classifier). Everything is now set to resume training on our new y_targets.</p>
  <p>Take a look at <a href="https://towardsdatascience.com/a-comprehensive-hands-on-guide-to-transfer-learning-with-real-world-applications-in-deep-learning-212bf3b2f27a" rel="nofollow noreferrer">this link</a> for some more info on transfer learning.</p>
  <p>If you want no perturbance to your past learning, I would recommend freezing all previous hidden layers and then tacking some additional ones on.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-07T18:01:25.240Z
Answers.Text: But doesn't fine-tuning require even the old objects annotated in the new training images? I'm trying to avoid having to annotate the old objects in the new images.
Answers.UserDisplayName: John M.
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-06T23:52:04.330Z
Answers.LastActivityDate: 2019-04-06T23:52:04.330Z
Answers.LastEditDate: 2020-06-17T09:57:20.710Z
Answers.UserDisplayName: hisairnessag3
Body: <p>Suppose a model <code>M</code> classifies apples and oranges. Can <code>M</code> be extended to classify a third class of objects, e.g., pears, such that the new images for 'retraining' only have pears annotated and apples and oranges ignored? That is, since <code>M</code> already classifies apples and oranges, can the old weights be somehow preserved and let the retraining focus specifically on learning about pears?</p>
  
  <p>Methods such as fine-tuning and learning without forgetting seem to require all objects in the new images annotated though.</p>
  
Tags: <neural-networks><deep-learning><convolutional-neural-networks>
Title: Extending a neural network to classify new objects
UserDisplayName: John M.
ThreadText: # Extending a neural network to classify new objects
  
  (Asked by: username_0 on 2019-04-05)
  
  Suppose a model `M` classifies apples and oranges. Can `M` be extended to classify a third class of objects, e.g., pears, such that the new images for 'retraining' only have pears annotated and apples and oranges ignored? That is, since `M` already classifies apples and oranges, can the old weights be somehow preserved and let the retraining focus specifically on learning about pears?
  
  Methods such as fine-tuning and learning without forgetting seem to require all objects in the new images annotated though.
  
  **Tags:** neural-networks, deep-learning, convolutional-neural-networks
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-04-06. Score: 2
  
  Yes this is standard transfer learning. Using a trained model, we can freeze the first N hidden layers of a classifier, except for the last few. This will allow our previous relevant training to be retained whilst also being able learn new features and target new classes.
  
  We will then initialize a new output layer that works our new context(i.e sigmoid, 1 node for binary classifier). Everything is now set to resume training on our new y\_targets.
  
  Take a look at [this link](https://towardsdatascience.com/a-comprehensive-hands-on-guide-to-transfer-learning-with-real-world-applications-in-deep-learning-212bf3b2f27a) for some more info on transfer learning.
  
  If you want no perturbance to your past learning, I would recommend freezing all previous hidden layers and then tacking some additional ones on.
  
  > **Comments:**
  > **username_0**: But doesn't fine-tuning require even the old objects annotated in the new training images? I'm trying to avoid having to annotate the old objects in the new images.  
  
  ---
  
  