CNN / Fully Convolutional Network in Image classification

20 ビュー (過去 30 日間)
Andrea Daou
Andrea Daou 2021 年 3 月 31 日
回答済み: Parag 2025 年 3 月 6 日
Hello,
Are fully convolutional networks (FCN) good for image classification?
Is it possible to modify a pretrained CNN to get a FCN so that we will not be limited to the fixed size input of the 1st layer in the CNN ? And then apply fine-tuning to the FCN to resolve a classification problem ?
Thank you fot your help!!

回答 (1 件)

Parag
Parag 2025 年 3 月 6 日
Hi, yes, fully convolutional networks (FCNs) can be used for image classification, but they are more commonly applied to tasks like semantic segmentation (goal is to classify each pixel in an image into a predefined category) rather than standard classification. However, FCNs have advantages, such as allowing variable input sizes and preserving spatial information throughout the network.
You can convert a pretrained CNN into an FCN by:
  1. Removing the Fully Connected (FC) Layers: Replace the fully connected layers with 1x1 convolutional layers to maintain spatial flexibility.
  2. Using Global Average Pooling (GAP): Instead of FC layers, apply GAP before classification.
  3. Fine-tuning the FCN: Train the modified network on your dataset to adapt it for classification.
Fine-Tuning the FCN for Classification
After modifying the CNN into an FCN, you can perform fine-tuning by:
  • Freezing early layers (to retain pretrained features).
  • Training later layers with a small learning rate to adapt to your classification task.
  • Using data augmentation to improve generalization.
By doing this, you can classify images without being restricted to a fixed input size, making your model more flexible and potentially more effective for diverse datasets.
You can refer this MATLAB documentation for more information

カテゴリ

Help Center および File ExchangeGet Started with Deep Learning Toolbox についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by