{
  "source_file": "0930",
  "source_platform": "技术平台",
  "author": "Jason Brownlee / Machine Learning Mastery",
  "title_listed": "A Gentle Introduction to Transfer Learning",
  "keywords": "迁移学习,深度学习,入门",
  "domain": "机器学习",
  "content_type": "教程",
  "is_paid_flag": "否",
  "url": "https://machinelearningmastery.com/transfer-learning-for-deep-learning/",
  "publish_date": "2019-09",
  "corpus_stage": "预训练/SFT",
  "notes": "迁移学习入门",
  "id": "7a59f3716864",
  "collected_at": "2026-10-02T17:55:15",
  "title": "A Gentle Introduction to Transfer Learning for Deep Learning - MachineLearningMastery.com",
  "body_markdown": "A Gentle Introduction to Transfer Learning for Deep Learning\nBy\nJason Brownlee\non\nSeptember 16, 2019\nin\nDeep Learning for Computer Vision\n166\nShare\nPost\nShare\nTransfer learning is a machine learning method where a model developed for a task is reused as the starting point for a model on a second task.\nIt is a popular approach in deep learning where pre-trained models are used as the starting point on computer vision and natural language processing tasks given the vast compute and time resources required to develop neural network models on these problems and from the huge jumps in skill that they provide on related problems.\nIn this post, you will discover how you can use transfer learning to speed up training and improve the performance of your deep learning model.\nAfter reading this post, you will know:\nWhat transfer learning is and how to use it.\nCommon examples of transfer learning in deep learning.\nWhen to use transfer learning on your own predictive modeling problems.\nKick-start your project\nwith my new book\nDeep Learning for Computer Vision\n, including\nstep-by-step tutorials\nand the\nPython source code\nfiles for all examples.\nLet’s get started.\nFor an example of how to use transfer learning in computer vision, see the post:\nTransfer Learning in Keras with Computer Vision Models\nA Gentle Introduction to Transfer Learning with Deep Learning\nPhoto by\nMike’s Birds\n, some rights reserved.\nWhat is Transfer Learning?\nTransfer learning is a machine learning technique where a model trained on one task is re-purposed on a second related task.\nTransfer learning and domain adaptation refer to the situation where what has been learned in one setting … is exploited to improve generalization in another setting\n— Page 526,\nDeep Learning\n, 2016.\nTransfer learning is an optimization that allows rapid progress or improved performance when modeling the second task.\nTransfer learning is the improvement of learning in a new task through the transfer of knowledge from a related task that has already been learned.\n—\nChapter 11: Transfer Learning\n,\nHandbook of Research on Machine Learning Applications\n, 2009.\nTransfer learning is related to problems such as multi-task learning and concept drift and is not exclusively an area of study for deep learning.\nNevertheless, transfer learning is popular in deep learning given the enormous resources required to train deep learning models or the large and challenging datasets on which deep learning models are trained.\nTransfer learning only works in deep learning if the model features learned from the first task are general.\nIn transfer learning, we first train a base network on a base dataset and task, and then we repurpose the learned features, or transfer them, to a second target network to be trained on a target dataset and task. This process will tend to work if the features are general, meaning suitable to both base and target tasks, instead of specific to the base task.\n—\nHow transferable are features in deep neural networks?\nThis form of transfer learning used in deep learning is called inductive transfer. This is where the scope of possible models (model bias) is narrowed in a beneficial way by using a model fit on a different but related task.\nDepiction of Inductive Transfer\nTaken from “Transfer Learning”\nWant Better Results with Deep Learning?\nTake my free 7-day email crash course now (with sample code).\nClick to sign-up and also get a free PDF Ebook version of the course.\nDownload Your FREE Mini-Course\nHow to Use Transfer Learning?\nYou can use transfer learning on your own\npredictive modeling\nproblems.\nTwo common approaches are as follows:\nDevelop Model Approach\nPre-trained Model Approach\nDevelop Model Approach\nSelect Source Task\n. You must select a related predictive modeling problem with an abundance of data where there is some relationship in the input data, output data, and/or concepts learned during the mapping from input to output data.\nDevelop Source Model\n. Next, you must develop a skillful model for this first task. The model must be better than a naive model to ensure that some feature learning has been performed.\nReuse Model\n. The model fit on the source task can then be used as the starting point for a model on the second task of interest. This may involve using all or parts of the model, depending on the modeling technique used.\nTune Model\n. Optionally, the model may need to be adapted or refined on the input-output pair data available for the task of interest.\nPre-trained Model Approach\nSelect Source Model\n. A pre-trained source model is chosen from available models. Many research institutions release models on large and challenging datasets that may be included in the pool of candidate models from which to choose from.\nReuse Model\n. The model pre-trained model can then be used as the starting point for a model on the second task of interest. This may involve using all or parts of the model, depending on the modeling technique used.\nTune Model\n. Optionally, the model may need to be adapted or refined on the input-output pair data available for the task of interest.\nThis second type of transfer learning is common in the field of deep learning.\nExamples of Transfer Learning with Deep Learning\nLet’s make this concrete with two common examples of transfer learning with deep learning models.\nTransfer Learning with Image Data\nIt is common to perform transfer learning with predictive modeling problems that use image data as input.\nThis may be a prediction task that takes photographs or video data as input.\nFor these types of problems, it is common to use a deep learning model pre-trained for a large and challenging image classification task such as the\nImageNet\n1000-class photograph classification competition.\nThe research organizations that develop models for this competition and do well often release their final model under a permissive license for reuse. These models can take days or weeks to train on modern hardware.\nThese models can be downloaded and incorporated directly into new models that expect image data as input.\nThree examples of models of this type include:\nOxford VGG Model\nGoogle Inception Model\nMicrosoft ResNet Model\nFor more examples, see the\nCaffe Model Zoo\nwhere more pre-trained models are shared.\nThis approach is effective because the images were trained on a large corpus of photographs and require the model to make predictions on a relatively large number of classes, in turn, requiring that the model efficiently learn to extract features from photographs in order to perform well on the problem.\nIn their Stanford course on Convolutional Neural Networks for Visual Recognition, the authors caution to carefully choose how much of the pre-trained model to use in your new model.\n[Convolutional Neural Networks] features are more generic in early layers and more original-dataset-specific in later layers\n— Transfer Learning,\nCS231n Convolutional Neural Networks for Visual Recognition\nTransfer Learning with Language Data\nIt is common to perform transfer learning with natural language processing problems that use text as input or output.\nFor these types of problems, a word embedding is used that is a mapping of words to a high-dimensional continuous vector space where different words with a similar meaning have a similar vector representation.\nEfficient algorithms exist to learn these distributed word representations and it is common for research organizations to release pre-trained models trained on very large corpa of text documents under a permissive license.\nTwo examples of models of this type include:\nGoogle’s word2vec Model\nStanford’s GloVe Model\nThese distributed word representation models can be downloaded and incorporated into deep learning language models in either the interpretation of words as input or the generation of words as output from the model.\nIn his book on Deep Learning for Natural Language Processing, Yoav Goldberg cautions:\n… one can download pre-trained word vectors that were trained on very large quantities of text […] differences in training regimes and underlying corpora have a strong influence on the resulting representations, and that the available pre-trained representations may not be the best choice for [your] particular use case.\n— Page 135,\nNeural Network Methods in Natural Language Processing\n, 2017.\nWhen to Use Transfer Learning?\nTransfer learning is an optimization, a shortcut to saving time or getting better performance.\nIn general, it is not obvious that there will be a benefit to using transfer learning in the domain until after the model has been developed and evaluated.\nLisa Torrey and Jude Shavlik in\ntheir chapter on transfer learning\ndescribe three possible benefits to look for when using transfer learning:\nHigher start\n. The initial skill (before refining the model) on the source model is higher than it otherwise would be.\nHigher slope\n. The rate of improvement of skill during training of the source model is steeper than it otherwise would be.\nHigher asymptote\n. The converged skill of the trained model is better than it otherwise would be.\nThree ways in which transfer might improve learning.\nTaken from “Transfer Learning”.\nIdeally, you would see all three benefits from a successful application of transfer learning.\nIt is an approach to try if you can identify a related task with abundant data and you have the resources to develop a model for that task and reuse it on your own problem, or there is a pre-trained model available that you can use as a starting point for your own model.\nOn some problems where you may not have very much data, transfer learning can enable you to develop skillful models that you simply could not develop in the absence of transfer learning.\nThe choice of source data or source model is an open problem and may require domain expertise and/or intuition developed via experience.\nFurther Reading\nThis section provides more resources on the topic if you are looking to go deeper.\nTutorials\nHow to Use Transfer Learning when Developing Convolutional Neural Network Models\nHow to Use The Pre-Trained VGG Model to Classify Objects in Photographs\nHow to Improve Performance With Transfer Learning for Deep Learning Neural Networks\nBooks\nDeep Learning\n, 2016.\nNeural Network Methods in Natural Language Processing\n, 2017.\nPapers\nA survey on transfer learning\n, 2010.\nChapter 11: Transfer Learning\n,\nHandbook of Research on Machine Learning Applications\n, 2009.\nHow transferable are features in deep neural networks?\nPre-trained Models\nOxford VGG Model\nGoogle Inception Model\nMicrosoft ResNet Model\nGoogle’s word2vec Model\nStanford’s GloVe Model\nCaffe Model Zoo\nArticles\nTransfer learning on Wikipedia\nTransfer Learning – Machine Learning’s Next Frontier\n, 2017.\nTransfer Learning, CS231n Convolutional Neural Networks for Visual Recognition\nHow does transfer learning work? on Quora\nSummary\nIn this post, you discovered how you can use transfer learning to speed up training and improve the performance of your deep learning model.\nSpecifically, you learned:\nWhat transfer learning is and how it is used in deep learning.\nWhen to use transfer learning.\nExamples of transfer learning used on computer vision and natural language processing tasks.\nDo you have any questions?\nAsk your questions in the comments below and I will do my best to answer.\nDevelop Deep Learning Models for Vision Today!\nDevelop Your Own Vision Models in Minutes\n...with just a few lines of python code\nDiscover how in my new Ebook:\nDeep Learning for Computer Vision\nIt provides\nself-study tutorials\non topics like:\nclassification\n,\nobject detection (yolo and rcnn)\n,\nface recognition (vggface and facenet)\n,\ndata preparation\nand much more...\nFinally Bring Deep Learning to your Vision Projects\nSkip the Academics. Just Results.\nSee What's Inside\nShare\nPost\nShare\nMore On This Topic\nHow to Improve Performance With Transfer Learning…\nLeveraging Transfer Learning in Computer Vision for…\nTransfer Learning in Keras with Computer Vision Models\nA Gentle Introduction to Deep Learning for Face Recognition\nA Gentle Introduction to Object Recognition With…\nA Gentle Introduction to the Promise of Deep…\nAbout Jason Brownlee\nJason Brownlee, PhD is a machine learning specialist who teaches developers how to get results with modern machine learning methods via hands-on tutorials.\nView all posts by Jason Brownlee\n→",
  "metadata": {
    "title": "A Gentle Introduction to Transfer Learning for Deep Learning - MachineLearningMastery.com",
    "description": null,
    "keywords": null,
    "author": "Jason Brownlee",
    "og:locale": "en_US",
    "og:type": "article",
    "og:title": "A Gentle Introduction to Transfer Learning for Deep Learning - MachineLearningMastery.com",
    "og:description": "Transfer learning is a machine learning method where a model developed for a task is reused as the starting point for a model on a second task. It is a popular approach in deep learning where pre-trained models are used as the starting point on computer vision and natural language processing tasks given the vast compute and time resources required…",
    "og:url": "https://machinelearningmastery.com/transfer-learning-for-deep-learning/",
    "og:site_name": "MachineLearningMastery.com",
    "og:image": "https://machinelearningmastery.com/wp-content/uploads/2017/12/A-Gentle-Introduction-to-Transfer-Learning-with-Deep-Learning.jpg",
    "og:image:width": "639",
    "og:image:height": "640",
    "og:image:type": "image/jpeg",
    "twitter:label1": "Written by",
    "twitter:data1": "Jason Brownlee",
    "twitter:label2": "Est. reading time",
    "twitter:data2": "9 minutes",
    "twitter:card": "summary_large_image",
    "twitter:description": "Transfer learning is a machine learning method where a model developed for a task is reused as the starting point for a model on a second task. It is a popular approach in deep learning where pre-trained models are used as the starting point on computer vision and natural language processing tasks given the vast compute and time resources required…",
    "twitter:title": "A Gentle Introduction to Transfer Learning for Deep Learning - MachineLearningMastery.com",
    "article:publisher": "https://www.facebook.com/MachineLearningMastery/",
    "article:author": "https://www.facebook.com/MachineLearningMastery/",
    "article:published_time": "2017-12-19T18:00:03+00:00",
    "article:modified_time": "2019-09-16T04:58:40+00:00"
  },
  "paywall": {
    "listed_paid": false,
    "detected": false,
    "marker": "",
    "public_only": false,
    "policy": "付费/会员内容只保留页面公开可见部分，不绕过付费墙"
  },
  "crawl": {
    "success": true,
    "status_code": 200,
    "error": ""
  },
  "code_blocks": [],
  "images": [
    {
      "status": "ok",
      "url": "https://machinelearningmastery.com/wp-content/uploads/2017/12/A-Gentle-Introduction-to-Transfer-Learning-with-Deep-Learning.jpg",
      "bytes": 59466,
      "reused": true,
      "local_path": "attachments/7a59f3716864/images/001.jpg",
      "src": "https://machinelearningmastery.com/wp-content/uploads/2017/12/A-Gentle-Introduction-to-Transfer-Learning-with-Deep-Learning.jpg",
      "alt": "A Gentle Introduction to Transfer Learning with Deep Learning",
      "downloaded": true
    },
    {
      "status": "ok",
      "url": "https://machinelearningmastery.com/wp-content/uploads/2017/09/Depiction-of-Inductive-Transfer.png",
      "bytes": 15550,
      "reused": true,
      "local_path": "attachments/7a59f3716864/images/004.png",
      "src": "https://machinelearningmastery.com/wp-content/uploads/2017/09/Depiction-of-Inductive-Transfer.png",
      "alt": "Depiction of Inductive Transfer",
      "downloaded": true
    },
    {
      "status": "ok",
      "url": "https://machinelearningmastery.com/wp-content/uploads/2017/09/Three-ways-in-which-transfer-might-improve-learning.png",
      "bytes": 14350,
      "reused": true,
      "local_path": "attachments/7a59f3716864/images/007.png",
      "src": "https://machinelearningmastery.com/wp-content/uploads/2017/09/Three-ways-in-which-transfer-might-improve-learning.png",
      "alt": "Three ways in which transfer might improve learning",
      "downloaded": true
    },
    {
      "status": "ok",
      "url": "https://machinelearningmastery.com/wp-content/uploads/2022/11/DL4CV-220.png",
      "bytes": 7552,
      "reused": false,
      "local_path": "attachments/7a59f3716864/images/body-8bdaaeee1207cd36fc6e.png",
      "src": "https://machinelearningmastery.com/wp-content/uploads/2022/11/DL4CV-220.png",
      "alt": "Deep Learning for Computer Vision",
      "downloaded": true
    },
    {
      "status": "ok",
      "url": "https://machinelearningmastery.com/wp-content/uploads/2018/11/Loss-and-Accuracy-Learning-Curves-on-the-Train-and-Test-Sets-for-an-MLP-on-Problem-1.png",
      "bytes": 25820,
      "reused": true,
      "local_path": "attachments/7a59f3716864/images/012.png",
      "src": "https://machinelearningmastery.com/wp-content/uploads/2018/11/Loss-and-Accuracy-Learning-Curves-on-the-Train-and-Test-Sets-for-an-MLP-on-Problem-1.png",
      "alt": "Loss and Accuracy Learning Curves on the Train and Test Sets for an MLP on Problem 1",
      "downloaded": true
    },
    {
      "status": "ok",
      "url": "https://machinelearningmastery.com/wp-content/uploads/2024/10/mlm-leveraging-transfer-learning-computer-vision-quick-wins-200x200.png",
      "bytes": 23414,
      "reused": true,
      "local_path": "attachments/7a59f3716864/images/016.png",
      "src": "https://machinelearningmastery.com/wp-content/uploads/2024/10/mlm-leveraging-transfer-learning-computer-vision-quick-wins-200x200.png",
      "alt": "mlm-leveraging-transfer-learning-computer-vision-quick-wins",
      "downloaded": true
    },
    {
      "status": "ok",
      "url": "https://machinelearningmastery.com/wp-content/uploads/2019/05/How-to-Use-Transfer-Learning-when-Developing-Convolutional-Neural-Network-Models.jpg",
      "bytes": 79539,
      "reused": true,
      "local_path": "attachments/7a59f3716864/images/018.jpg",
      "src": "https://machinelearningmastery.com/wp-content/uploads/2019/05/How-to-Use-Transfer-Learning-when-Developing-Convolutional-Neural-Network-Models.jpg",
      "alt": "How to Use Transfer Learning when Developing Convolutional Neural Network Models",
      "downloaded": true
    },
    {
      "status": "ok",
      "url": "https://machinelearningmastery.com/wp-content/uploads/2019/05/A-Gentle-Introduction-to-Deep-Learning-for-Face-Recognition.jpg",
      "bytes": 46412,
      "reused": true,
      "local_path": "attachments/7a59f3716864/images/020.jpg",
      "src": "https://machinelearningmastery.com/wp-content/uploads/2019/05/A-Gentle-Introduction-to-Deep-Learning-for-Face-Recognition.jpg",
      "alt": "A Gentle Introduction to Deep Learning for Face Recognition",
      "downloaded": true
    },
    {
      "status": "ok",
      "url": "https://machinelearningmastery.com/wp-content/uploads/2019/05/A-Gentle-Introduction-to-Object-Recognition-With-Deep-Learning.jpg",
      "bytes": 55899,
      "reused": true,
      "local_path": "attachments/7a59f3716864/images/022.jpg",
      "src": "https://machinelearningmastery.com/wp-content/uploads/2019/05/A-Gentle-Introduction-to-Object-Recognition-With-Deep-Learning.jpg",
      "alt": "A Gentle Introduction to Object Recognition With Deep Learning",
      "downloaded": true
    },
    {
      "status": "ok",
      "url": "https://machinelearningmastery.com/wp-content/uploads/2019/03/A-Gentle-Introduction-to-the-Promise-of-Deep-Learning-for-Computer-Vision.jpg",
      "bytes": 48924,
      "reused": true,
      "local_path": "attachments/7a59f3716864/images/024.jpg",
      "src": "https://machinelearningmastery.com/wp-content/uploads/2019/03/A-Gentle-Introduction-to-the-Promise-of-Deep-Learning-for-Computer-Vision.jpg",
      "alt": "A Gentle Introduction to the Promise of Deep Learning for Computer Vision",
      "downloaded": true
    }
  ],
  "audio": [],
  "videos": [],
  "links": [
    {
      "href": "https://machinelearningmastery.com/author/jasonb/",
      "label": "Jason Brownlee",
      "type": "a"
    },
    {
      "href": "https://machinelearningmastery.com/category/deep-learning-for-computer-vision/",
      "label": "Deep Learning for Computer Vision",
      "type": "a"
    },
    {
      "href": "https://machinelearningmastery.com/transfer-learning-for-deep-learning/",
      "label": "166",
      "type": "a"
    },
    {
      "href": "https://machinelearningmastery.com/deep-learning-for-computer-vision/",
      "label": "Deep Learning for Computer Vision",
      "type": "a"
    },
    {
      "href": "https://machinelearningmastery.com/how-to-use-transfer-learning-when-developing-convolutional-neural-network-models/",
      "label": "Transfer Learning in Keras with Computer Vision Models",
      "type": "a"
    },
    {
      "href": "https://www.flickr.com/photos/pazzani/8819602488/",
      "label": "Mike’s Birds",
      "type": "a"
    },
    {
      "href": "http://amzn.to/2fwdoKR",
      "label": "Deep Learning",
      "type": "a"
    },
    {
      "href": "http://amzn.to/2fgeVro",
      "label": "Handbook of Research on Machine Learning Applications",
      "type": "a"
    },
    {
      "href": "https://arxiv.org/abs/1411.1792",
      "label": "How transferable are features in deep neural networks?",
      "type": "a"
    },
    {
      "href": "https://machinelearningmastery.com/gentle-introduction-to-predictive-modeling/",
      "label": "predictive modeling",
      "type": "a"
    },
    {
      "href": "http://www.image-net.org/",
      "label": "ImageNet",
      "type": "a"
    },
    {
      "href": "http://www.robots.ox.ac.uk/~vgg/research/very_deep/",
      "label": "Oxford VGG Model",
      "type": "a"
    },
    {
      "href": "https://github.com/tensorflow/models/tree/master/research/inception",
      "label": "Google Inception Model",
      "type": "a"
    },
    {
      "href": "https://github.com/KaimingHe/deep-residual-networks",
      "label": "Microsoft ResNet Model",
      "type": "a"
    },
    {
      "href": "https://github.com/BVLC/caffe/wiki/Model-Zoo",
      "label": "Caffe Model Zoo",
      "type": "a"
    },
    {
      "href": "http://cs231n.github.io/transfer-learning/",
      "label": "CS231n Convolutional Neural Networks for Visual Recognition",
      "type": "a"
    },
    {
      "href": "https://code.google.com/archive/p/word2vec/",
      "label": "Google’s word2vec Model",
      "type": "a"
    },
    {
      "href": "https://nlp.stanford.edu/projects/glove/",
      "label": "Stanford’s GloVe Model",
      "type": "a"
    },
    {
      "href": "http://amzn.to/2fwTPCn",
      "label": "Neural Network Methods in Natural Language Processing",
      "type": "a"
    },
    {
      "href": "https://machinelearningmastery.com/use-pre-trained-vgg-model-classify-objects-photographs/",
      "label": "How to Use The Pre-Trained VGG Model to Classify Objects in Photographs",
      "type": "a"
    },
    {
      "href": "https://machinelearningmastery.com/how-to-improve-performance-with-transfer-learning-for-deep-learning-neural-networks/",
      "label": "How to Improve Performance With Transfer Learning for Deep Learning Neural Networks",
      "type": "a"
    },
    {
      "href": "https://pdfs.semanticscholar.org/a25f/bcbbae1e8f79c4360d26aa11a3abf1a11972.pdf",
      "label": "A survey on transfer learning",
      "type": "a"
    },
    {
      "href": "https://en.wikipedia.org/wiki/Transfer_learning",
      "label": "Transfer learning on Wikipedia",
      "type": "a"
    },
    {
      "href": "http://ruder.io/transfer-learning/",
      "label": "Transfer Learning – Machine Learning’s Next Frontier",
      "type": "a"
    },
    {
      "href": "https://www.quora.com/How-does-transfer-learning-work",
      "label": "How does transfer learning work? on Quora",
      "type": "a"
    },
    {
      "href": "https://machinelearningmastery.com/leveraging-transfer-learning-in-computer-vision-for-quick-wins/",
      "label": "Leveraging Transfer Learning in Computer Vision for…",
      "type": "a"
    },
    {
      "href": "https://machinelearningmastery.com/introduction-to-deep-learning-for-face-recognition/",
      "label": "A Gentle Introduction to Deep Learning for Face Recognition",
      "type": "a"
    },
    {
      "href": "https://machinelearningmastery.com/object-recognition-with-deep-learning/",
      "label": "A Gentle Introduction to Object Recognition With…",
      "type": "a"
    },
    {
      "href": "https://machinelearningmastery.com/promise-of-deep-learning-for-computer-vision/",
      "label": "A Gentle Introduction to the Promise of Deep…",
      "type": "a"
    }
  ],
  "repair_version": 2,
  "repaired_at": "2026-10-14T10:54:25Z",
  "source_url": "https://machinelearningmastery.com/transfer-learning-for-deep-learning/",
  "papers": [
    {
      "status": "ok",
      "url": "https://arxiv.org/pdf/1411.1792",
      "bytes": 492537,
      "reused": false,
      "local_path": "papers/repair/240dd54014f9ca0e9fcc.pdf"
    },
    {
      "status": "http_202",
      "url": "https://pdfs.semanticscholar.org/a25f/bcbbae1e8f79c4360d26aa11a3abf1a11972.pdf",
      "retried_at": "2026-10-20T18:07:58Z"
    }
  ],
  "actual_video_files": [],
  "body_chars": 12378,
  "expected_body_images": 10,
  "discovery_status": "ok",
  "delivery_status": "partial",
  "missing_reason": "http_202",
  "raw_html": "attachments/7a59f3716864/pages/source.html",
  "local_html": "attachments/7a59f3716864/pages/article.html",
  "body_base_path": "attachments/7a59f3716864/pages/",
  "body_markdown_path": "attachments/7a59f3716864/pages/article.md"
}