CNN / Fully Convolutional Network in Image classification

12 views (last 30 days)
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!!

Answers (1)

Parag
Parag on 6 Mar 2025
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

Categories

Find more on Get Started with Deep Learning Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!