34 min total

Deep Learning

Error analysis & transfer learning

Error analysis & transfer learning

Error analysis is a process where we identify and prioritize areas for improvement in algorithms performance

Before investing time, you should evaluate how much addressing this problem could reduce your overall error

Gather 100 mislabeled dev set examples

Count how many of these errors fall into specific categories such as dog images

For example, of 5% of them are dog images, addressing this would reduce the error from 10% to 9.5%

If 50% of errors are from dog images, fixing this issue would reduce the error from 10% to 5%

This method provides and upper bound on how much improving a particular issue could enhance overall performance

Error analysis in parallel

Error analysis & transfer learning — diagram

Andrew NG advises to build something quick and dirty.

Use that to do bias/variance analysis,

use that to do error analysis and

use the results of those analysis to help you prioritize where to go next.

Training and testing on different distributions

Error analysis & transfer learning — diagram

Train-dev set: subset of training data that is held out and used to diagnose variance(overfitting) or data mismatch problems

  1. If a model performs well on training set but poorly on train-dev set, it suggests overfitting
  2. If model performs well on both training and train-dev set but poorly on dev set, it suggests a data mismatch problem
Error analysis & transfer learning — diagram
Error analysis & transfer learning — diagram

Transfer learning

Train a NN on large dataset for initial task (Task A)

Adapt the pre-trained network for a new task (Task B) by modifying the network

And if Task B and Task A share similar input types,

Replace last layer and its weights with new randomly initialized weights for Task B

Depending on amount of data avaliable for Task b:

With a smaller dataset, only retrain the new layers

With a larger dataset, retrain the entire network (fine-tuning)

Training on task A is called pretraining

Multi-task Learning

MTL involves one NN performing several related tasks simultaneously

Each image in MTL can have multiple labels

Loss function in MTL computed by averaging losses for each individual task

MTL leverages the idea that related tasks can share low-level features, such as detecting edges or shapes in images

For MTL to be effective, NN must be large enough to handle complexity of multiple tasks, if the network is too small, MTL can degrade performance

Error analysis & transfer learning — diagram
Error analysis & transfer learning — diagram

End-End deep learning

Some ML systems have multiple stages to process input to outputs

End-to-end deep learning system implements all these stages with a single NN

We just need a big dataset

If we have a small dataset, ordinary implementation could work just fine

python
# Pipeline
audio -> features -> phonemes -> words -> transcript

# End-to-end model
audio -> transcript

Here end-to-end deep learning system works better because we have enough data to build it.

Image --> Bones --> Age # non-end-to-end system - best approach for now
Image ------------> Age # end-to-end system

In this example non-end-to-end system works better because we don’t have enough data to train end-to-end system.