本課程的 Colabs 已過期,將於 2024 年 7 月移除。
機器學習範例:圖片分類
使用預先訓練模型
訓練卷積類神經網路以執行圖片分類工作時,通常需要使用大量的訓練資料,而且可能需要數天或數週才能完成。但是,如果可以運用運用大量資料集 (例如透過 TensorFlow-Slim) 訓練的現有圖片模型,並調整這些模型,以便在自己的分類工作中使用?
利用預先訓練模型的常見技術之一是「特徵擷取」:擷取預先訓練模型產生的中繼表示法,然後將這些表示法以輸入內容的形式輸入到新的模型中。舉例來說,如果您訓練了圖片分類模型來區分不同類型的蔬菜,可以將胡蘿蔔、咖哩等的訓練圖片提供給預先訓練的模型,然後從最終卷積層擷取特徵。這些模型會擷取模型所有相關資訊,並將這些內容分類為建構內容的新類別,以建立、分類、形狀等。為了讓在透過預先訓練的模型使用特徵擷取時可提高效能,工程師通常會微調套用到已擷取特徵的權重參數。
如要進一步探索使用預先訓練模型的模型擷取和微調,請參閱下列運動。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2022-09-27 (世界標準時間)。
[null,null,["上次更新時間:2022-09-27 (世界標準時間)。"],[[["Pretrained image models can be leveraged to perform image classification tasks, saving time and resources compared to training a new model from scratch."],["Feature extraction involves using the intermediate representations from a pretrained model as input for a new model, enabling the utilization of learned features like color, texture, and shape."],["Fine-tuning the weight parameters of extracted features can further enhance the performance of the new classification model built on top of the pretrained model."]]],[]]