# FCN8s-ResNet50
**Repository Path**: zevision/FCN8s-ResNet50
## Basic Information
- **Project Name**: FCN8s-ResNet50
- **Description**: About
本项目复现了 FCN-8s 网络,基于 PyTorch 实现,使用 ResNet-50 作为特征提取骨干。
- **Primary Language**: Unknown
- **License**: MIT
- **Default Branch**: main
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 3
- **Forks**: 0
- **Created**: 2025-09-09
- **Last Updated**: 2026-05-27
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# FCN8s-ResNet50
**Fully Convolutional Network (FCN) with ResNet-50 backbone for image semantic segmentation**
If you like this project, please give it a ⭐ support!
---
## 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)](https://arxiv.org/abs/1411.4038)
---
## Project Structure
```text
📁 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
* Dataset: [Portrait-dataset-2000-PaddlePaddle](https://aistudio.baidu.com/datasetdetail/220355)
* The dataset contains original images and corresponding mask images
* Mask image naming format: `{image_name}_matte.png`
### 2️⃣ Model Training
Run the training script:
```bash
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:
```bash
python inference/predict_image.py
```
The script will load the model weights, perform segmentation on the specified image, and save the result.
---
## 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
```
```