פראצלום למידת מכונה: סיווג תמונה
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
שימוש במודלים שהוכשרו מראש
אימון רשת נוירונים מפותלים לביצוע משימות של סיווג תמונות
מצריך בדרך כלל כמות גדולה של נתוני הדרכה, והתהליך יכול להימשך זמן רב. אבל מה יקרה אם תוכלו למנף מודלים קיימים של תמונות שהוכשרו במערכי נתונים עצומים, כמו TensorFlow-Slim, ולהתאים אותם למשימות הסיווג שלכם?
אחת מהשיטות הנפוצות למינוף מודלים שהוכשרו מראש היא חילוץ תכונות:
אחזור ייצוגי ביניים שנוצרו על ידי המודל שהולמד מראש, ולאחר מכן הזנת הייצוגים האלה במודל חדש כקלט. לדוגמה, אם אתם מאמנים מודל של סיווג תמונות כדי להבחין בין סוגים שונים של ירקות, אתם יכולים להזין תמונות הדרכה של גזרים, סלרי וכו', למודל שהוכן מראש ואז לחלץ את התכונות משכבת ההמרה האחרונה. פעולה זו מתעדת את כל המידע שהמודל לומד על התמונות והעיצובים הכלליים, את הדחף המקורי, החלק המלא, כדי לשפר את הביצועים כשמשתמשים בחילוץ תכונות עם דגם שהוכן מראש, המהנדסים לעיתים קרובות משפרים את הפרמטרים של המשקל שחלים על התכונות שחולצו.
כדי לבצע ניתוח מעמיק יותר של חילוץ תכונות וכוונון מדויק בזמן השימוש במודלים שהוכשרו מראש, ראו את התרגיל הבא.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2022-09-27 (שעון UTC).
[null,null,["עדכון אחרון: 2022-09-27 (שעון UTC)."],[[["\u003cp\u003ePretrained image models can be leveraged to perform image classification tasks, saving time and resources compared to training a new model from scratch.\u003c/p\u003e\n"],["\u003cp\u003eFeature 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.\u003c/p\u003e\n"],["\u003cp\u003eFine-tuning the weight parameters of extracted features can further enhance the performance of the new classification model built on top of the pretrained model.\u003c/p\u003e\n"]]],[],null,["# ML Practicum: Image Classification\n\n\u003cbr /\u003e\n\nLeveraging Pretrained Models\n----------------------------\n\nTraining a convolutional neural network to perform image classification tasks\ntypically requires an extremely large amount of training data, and can be very\ntime-consuming, taking days or even weeks to complete. But what if you could\nleverage existing image models trained on enormous datasets, such as via\n[TensorFlow-Slim](https://github.com/tensorflow/models/tree/master/research/slim),\nand adapt them for use in your own classification tasks?\n\nOne common technique for leveraging pretrained models is *feature extraction* :\nretrieving intermediate representations produced by the pretrained model, and\nthen feeding these representations into a new model as input. For example, if\nyou're training an image-classification model to distinguish different types of\nvegetables, you could feed training images of carrots, celery, and so on, into a\npretrained model, and then extract the features from its final convolution\nlayer, which capture all the information the model has learned about the images'\nhigher-level attributes: color, texture, shape, etc. Then, when building your\nnew classification model, instead of starting with raw pixels, you can use these\nextracted features as input, and add your fully connected classification layers\non top. To increase performance when using feature extraction with a pretrained\nmodel, engineers often *fine-tune* the weight parameters applied to the\nextracted features.\n\nFor a more in-depth exploration of feature extraction and fine tuning when using\npretrained models, see the following Exercise.\n| **Key Terms**\n|\n| |----------------------|---------------|\n| | - feature extraction | - fine tuning |\n|"]]