Giter VIP home page Giter VIP logo

image-classfication-segmentation's Introduction

Image Classfication & Segmentation

This repository implements image classification and segmentation. The image classification model is based on ConvNeXt and achieves accuracy 0.9052 on a dataset with 50 classes. The backbone of the segmentation model is VGG16-FCN32, with pretrained weights available on Pytorch. After finetuning, the model attains mIOU score 0.7425 on satelitte images. For more details, please refer to the slides or the report.

Download Checkpoint

bash hw1_download.sh

Image Classification

Training

python classify.py \
    --train \
    --model-name convnext \
    --train-dir /path/to/train/data \
    --val-dir /path/to/val/data \
    --pretrained \
    --opt sgd \
    --lr 0.01 \
    --scheduler cosine \
    --weight-decay 2e-4 \
    --label-smoothing 0.1 \
    --num-epochs 20 \
    --batch-size 32 \
    --accum-step 4 \
    --augment auto

Model checkpoints and logs would be saved in ckpt/p1.

Testing

bash hw1_1.sh /path/to/test/data /path/to/output.csv

Feature Visualization

The figures illustrate the extracted feature before the linear projection head. we can observe that PCA might not be a proper choice for feature visualization in this case. On the contrary, t-SNE shows that the model is actually learning how to differentiate the images.

Image Segmentation

Training

python segment.py \
    --train \
    --train-dir /path/to/train/data \
    --val-dir /path/to/val/data \
    --model-name fcn-resnet101 \
    --loss focal-dice \
    --lr 0.005 \
    --scheduler linear \
    --weight-decay 2e-4 \
    --num-epochs 500 \
    --batch-size 4 \
    --accum-step 16 \
    --validate-step 1000 \
    --crop-resize

Model checkpoints and logs would be saved in ckpt/p2.

Testing

bash hw1_2.sh /path/to/test/data /path/to/output/dir

Examples

image-classfication-segmentation's People

Contributors

ethan07902050 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.