FCN8s-ResNet50:基于 PyTorch 的二分类图像语义分割项目

本项目复现了 FCN-8s 网络,基于 PyTorch 实现,使用 ResNet-50 作为特征提取骨干。

Branch1Tags0

FCN8s-ResNet50

Fully Convolutional Network (FCN) with ResNet-50 backbone for image semantic segmentation

If you like this project, please give it a ⭐ support!

Code size Last commit


Project Introduction

This project reproduces the FCN-8s network based on PyTorch, using ResNet-50 as the feature extraction backbone, focusing on binary image semantic segmentation tasks.

FCN Paper: Fully Convolutional Networks for Semantic Segmentation (Long et al., 2015)


Project Structure

📁 dataset/                 # Dataset processing related code
📁 model/                   # Network model definitions
📁 script/                  # Training scripts
📁 inference/               # Inference scripts
📁 utils/                   # Utility functions
📁 Portrait-dataset-2000/   # Binary classification dataset

Features

  • Binary classification segmentation task
  • Uses ResNet-50 as the feature extraction backbone
  • Implements the FCN-8s architecture with multi-level feature fusion for precise segmentation
  • Provides a complete training and inference pipeline
  • Supports model weight saving and loading
  • Automatically computes dataset mean and standard deviation for normalization

Usage

1. Dataset Preparation

2. Model Training

Run the training script:

python script/train.py

During training, the best model weights will be automatically saved to checkpoints/best_model.pth.

3. Model Inference

Use the trained model for image segmentation:

python inference/predict_image.py

The script will load the model weights, perform segmentation on the specified image, and save the result.


Model Architecture

Model Architecture

  • Uses pretrained ResNet-50 as the feature extractor
  • Upsamples and fuses multi-level feature maps
  • Uses skip connections to integrate multi-scale information
  • Outputs binary segmentation results with the same size as the input image

Project Highlights

  • High accuracy for binary segmentation tasks
  • Uses pretrained ResNet-50 to enhance feature extraction capability
  • Automatic normalization for more stable training
  • Complete training and validation workflow with checkpoint resume support
  • Visualization of training accuracy and loss curves

Introduction

本项目复现了 FCN-8s 网络,基于 PyTorch 实现,使用 ResNet-50 作为特征提取骨干。

Customize your domain