Concepts / Applying Deep Learning in Real-World Scenarios

Applying Deep Learning in Real-World Scenarios

Do not add a framework, dataset, optimizer, learning-rate schedule, or exact layer-unfreezing policy unless the procedure explicitly provides those details.

  • Programming

Starting from Learned Work

Fine-tuning is a way to adapt a pre-trained convolutional neural network, or convnet, to a target task. Its defining choice is the starting point: the model has already been trained before the new task begins. The adaptation therefore starts from an existing trained state rather than from an uninitialized model.

What do you think happens?

What is the defining starting point for fine-tuning a convnet?

  • An uninitialized model

  • A pre-trained convnet

  • A model with no target task

Reveal answer
Answer:

A pre-trained convnet

Fine-tuning begins with a convnet that has already been trained and then adapts it for the task being solved.

The Adaptation Pipeline

Think of fine-tuning as a state transition. First, a pre-trained convnet is available. Next, the target task is identified. The model is then considered in two conceptual groups: parts whose existing parameters are retained during a training stage and parts whose parameters are updated for the target task. Further training produces an adapted state. These stages describe the logic of the procedure without assuming a particular programming framework, dataset, optimizer, learning-rate schedule, or exact layer-unfreezing policy.

Pre-trained convnetexisting trained stateTarget tasktask to solveModel partsretained or updatedFurther trainingadaptation stageAdapted convnettarget-task stateadapt forconsiderguideproduces
What happens as a pre-trained convnet is adapted to a target task?

Retained and Updated Parts

During a fine-tuning stage, do not describe the convnet as if every part necessarily changes in the same way. Separate it conceptually into retained parts and updated parts. Retained parts keep their existing parameters during that stage. Updated parts have their parameters adjusted for the target task. This distinction describes the model's state during adaptation.

Pre-trained convnetstarting modelRetained partsexisting parametersTarget taskadapted behaviorUpdated partstarget-task adjustmentsome partsother partsadapt forremain during stage
Which parts of a pre-trained convnet are retained, and which parts may be updated for the target task?
Worked example

Tracing a Fine-Tuning Stage

Describe what happens when an already trained convnet is adapted to a new target task.

  1. 1
    Begin with the trained state

    The procedure starts with a pre-trained convnet, not an uninitialized model.

  2. 2
    Name the purpose

    The purpose is to adapt that convnet to a target task.

  3. 3
    Separate the parts

    Describe which parts retain their existing parameters during the stage and which parts have parameters updated.

  4. 4
    Describe the result

    Further adjustment moves the model from its pre-trained state toward an adapted state for the target task.

Result

Fine-tuning is a transition from a pre-trained convnet to a target-task-adapted convnet, with retained and updated parts described according to the procedure.

What the Procedure Does Not Fix

The words fine-tuning do not, by themselves, identify one permanent list of layers that must be retained or updated. The exact choice depends on the procedure being discussed. A careful explanation should therefore name the retained and updated parts for that procedure instead of presenting a fixed layer policy as the definition of fine-tuning.

Fine-tuningpre-trained starting stateFurther adjustmenttarget-task adaptationTraining fromscratchuninitialized startingstateNot fine-tuningdifferent startingdescriptionstarts withdoes not start with
How does the starting point and training path differ between fine-tuning and training a model from scratch?
Pre-trained convnetexisting parametersAdapted convnetparameters after adjustmentPrior training statebefore target-taskadaptationTarget-task stateafter adaptationadaptmove toward
What changes inside a pre-trained convnet when it is adapted to a new target task?

Common Description Errors

  • Common mistake

    Describing fine-tuning as training a completely new model.

    What it looks like

    The explanation starts with an uninitialized convnet.

    Why it fails

    Fine-tuning starts with a convnet that has already been trained.

    Do this instead

    State that the pre-trained convnet is the starting point for further adjustment.

  • Common mistake

    Claiming that every model part must be updated.

    What it looks like

    All parameters are described as changing during the fine-tuning stage.

    Why it fails

    The procedure may retain some parts while updating others.

    Do this instead

    Separate retained parts from updated parts.

  • Common mistake

    Claiming that the same parts are always retained or updated.

    What it looks like

    A single layer policy is presented as the definition of fine-tuning.

    Why it fails

    The exact retained and updated parts depend on the procedure being discussed.

    Do this instead

    Describe the parameter groups for the specific procedure instead of assuming a universal list.

  • Common mistake

    Leaving the target task out of the explanation.

    What it looks like

    The description says only that an existing model is trained again.

    Why it fails

    The purpose of fine-tuning is adaptation to a target task.

    Do this instead

    Explain what target task the pre-trained convnet is being adapted to.

Procedure-specificdescriptionnames retained and updatedpartsTarget-taskadaptationpurpose of fine-tuningUniversal layerclaimsame policy for everyprocedureOvergeneralizationprocedure details omittedexplainscreates
How can you distinguish a procedure-specific description from an overgeneralized description of fine-tuning?

Check Your Understanding

MEDIUM

Write a four-step explanation of fine-tuning for a reader who thinks it means starting with a completely new convnet. Your explanation must include the pre-trained starting point, the target task, retained parts, and updated parts.

Hints
  • Begin by naming the model state before adaptation.
  • Explain the purpose of the adaptation.
  • Use the retained-versus-updated distinction rather than assuming that all parts change.
Worked example

Reviewing a Short Explanation

A learner writes: Fine-tuning creates a new convnet and changes every layer in the same way. What should be corrected?

  1. 1
    Correct the starting point

    Replace creates a new convnet with begins with a pre-trained convnet.

  2. 2
    Correct the purpose

    State that the model is being adapted to a target task.

  3. 3
    Correct the parameter description

    Replace changes every layer in the same way with some parts may be retained while others are updated.

  4. 4
    Add procedure dependence

    Explain that the exact retained and updated parts depend on the fine-tuning procedure.

Result

A corrected explanation describes fine-tuning as adapting a pre-trained convnet to a target task while identifying retained and updated parts according to the procedure.

Key Takeaways

  1. 1
    Fine-tuning starts with a pre-trained convolutional neural network rather than an uninitialized model.
  2. 2
    Its purpose is to adapt the convnet to a target task.
  3. 3
    During a fine-tuning stage, some parts may retain their existing parameters while other parts are updated.
  4. 4
    The retained and updated parts must be described for the specific procedure; there is no fixed layer policy established by the term alone.
  5. 5
    A clear explanation traces the transition from a pre-trained state to an adapted state.

At a glance

  • Fine-tuning uses a pre-trained convnet as its starting point.
  • The model is adapted for a target task through further adjustment.
  • Retained parts and updated parts are separate conceptual groups during a training stage.
  • The exact groups depend on the procedure, so fine-tuning should not be described with one universal layer policy.

More concepts starting with A