# CV-Image-Classification **Repository Path**: xyfjason/cv-image-classification ## Basic Information - **Project Name**: CV-Image-Classification - **Description**: Reproduce image classification models with PyTorch. - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-03-08 - **Last Updated**: 2023-02-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Image-Backbones-Implementations My implementations of image backbones with PyTorch.
## Training ```shell python main.py [-n NAME] [-c FILE] [--opts KEY1 VALUE1 KEY2 VALUE2] ``` - To train on multiple GPUs, replace `python` with `torchrun --nproc_per_node NUM_GPUS`. - An experiment directory will be created under `./runs/` for each run, which is named after `NAME`, or the current time if `NAME` is not specified. The directory contains logs, checkpoints, tensorboard, etc. For example, to train resnet18 on CIFAR-10: ```shell python main.py -c ./configs/resnet18_cifar10.yaml ```
## Results ### CIFAR-10
models #params MACs acc@1(%)
VGG-11 9.20M 0.15G 90.97
VGG-19 (BN) 20.0M 0.40G 94.00
ResNet-18 11.2M 5.59G 95.64
PreActResNet-18 11.2M 5.59G 95.45
ResNeXt-29 (32x4d) 4.78M 6.90G 95.16
SE-ResNet-18 11.3M 5.59G 95.65
CBAM-ResNet-18 11.3M 5.59G 95.49
MobileNet 3.22M 0.48G 92.09
ShuffleNet 1x (g=8) 0.91M 0.50G 92.82
ViT-Tiny/4 5.36M 0.37G 85.66
Note: MACs are calculated by [fvcore](https://github.com/facebookresearch/fvcore) library. All the ConvNets are trained with the following settings: - training duration: 64k steps - batch size: 256 - learning rate: start with 0.1, end with 0.001 using a cosine annealing scheduler, no warm-up - optimizer: SGD, weight decay 5e-4, momentum 0.9 The ViTs are trained with the following settings: - training duration: 64k steps - batch size: 512 - learning rate: start with 0.001, end with 0.00001 using a cosine annealing scheduler, no warm-up - optimizer: Adam, weight decay 5e-5, betas (0.9, 0.999)