• Stars
    star
    237
  • Rank 169,885 (Top 4 %)
  • Language
    Python
  • License
    MIT License
  • Created over 3 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Parametric Contrastive Learning (ICCV2021) & GPaCo (TPAMI 2023)

Imbalanced Learning for Recognition

This repository contains the code of our papers on the topic of imbalanced learning for recognition.

  • Our new arXiv paper "Decoupled Kullback-Leibler (DKL) Divergence Loss" achieves new state-of-the-art on knowledge distillation and adversarial robustness. Code is released.
  • Code for RR & CeCo is partially released.
  • Our paper "Generalized Parametric Contrastive Learning" is accepted by TPAMI 2023.
  • Our paper "Understanding Imbalanced Semantic Segmentation Through Neural Collapse" is accepted by CVPR2023. The code will be released soon.
  • The code for our preprint paper "Generalized Parametric Contrastive Learning" is released;
  • The code for our preprint paper "Region Rebalance for Long-Tailed Semantic Segmentation" (paper) will be released soon;
  • The code for our TPAMI 2022 paper "Residual Learning for Long-tailed recogntion" (paper and code);
  • The code for our ICCV 2021 paper "Parametric Contrastive Learning" (paper and code);

Generalized Parametric-Contrastive-Learning

This repository contains the implementation code for ICCV2021 paper Parametric Contrastive Learning (https://arxiv.org/abs/2107.12028) and TPAMI 2023 paper Generalized Parametric Contrastive Learning (https://arxiv.org/abs/2209.12400).

PWC PWC PWC PWC

Full ImageNet Classification and Out-of-Distribution Robustness

Method Model Full ImageNet ImageNet-C (mCE) ImageNet-C (rel. mCE) ImageNet-R ImageNet-S link log
GPaCo ResNet-50 79.7 50.9 64.4 41.1 30.9 download download
CE ViT-B 83.6 39.1 49.9 49.9 36.1 --- download
CE ViT-L 85.7 32.4 41.4 60.3 45.5 --- download
multi-task ViT-B 83.4 --- --- --- --- --- download
GPaCo ViT-B 84.0 37.2 47.3 51.7 39.4 download download
GPaCo ViT-L 86.0 30.7 39.0 60.3 48.3 download download

CIFAR Classification

Method Model Top-1 Acc(%) link log
multi-task ResNet-50 79.1 --- download
GPaCo ResNet-50 80.3 --- download

Long-tailed Recognition

ImageNet-LT

Method Model Top-1 Acc(%) link log
GPaCo ResNet-50 58.5 download download
GPaCo ResNeXt-50 58.9 download download
GPaCo ResNeXt-101 60.8 download download
GPaCo ensemble( 2-ResNeXt-101) 63.2 --- ---

iNaturalist 2018

Method Model Top-1 Acc(%) link log
GPaCo ResNet-50 75.4 download download
GPaCo ResNet-152 78.1 --- download
GPaCo ensembel(2-ResNet-152) 79.8 --- ---

Places-LT

Method Model Top-1 Acc(%) link log
GPaCo ResNet-152 41.7 download download

Semantic Segmentation

Method Dataset Model mIoU (s.s.) mIoU (m.s.) link log
GPaCo ADE20K Swin-T 45.4 46.8 --- download
GPaCo ADE20K Swin-B 51.6 53.2 --- download
GPaCo ADE20K Swin-L 52.8 54.3 --- download
GPaCo COCO-Stuff ResNet-50 37.0 37.9 --- download
GPaCo COCO-Stuff ResNet-101 38.8 40.1 --- download
GPaCo Pascal Context 59 ResNet-50 51.9 53.7 --- download
GPaCo Pascal Context 59 ResNet-101 54.2 56.3 --- download
GPaCo Cityscapes ResNet-18 78.1 79.7 --- download
GPaCo Cityscapes ResNet-50 80.8 82.0 --- download
GPaCo Cityscapes ResNet-101 81.4 82.1 --- download

Get Started

Environments

We use python3.8, pytorch 1.8.1, mmcv 1.3.13 and timm==0.3.2. Our code is based on PaCo, MAE, and mmseg.

Train and Evaluation Scripts

On full ImageNet and OOD robustness,

We use 8 Nvidia GForce RTx 3090 GPUs. MAE pretrained models should be downloaded from here.

cd GPaCo/LT
bash sh/ImageNet/train_resnet50.sh
bash sh/ImageNet/eval_resnet50.sh

cd GPaCo/MAE-ViTs
bash sh/finetune_base_mae.sh
bash sh/finetune_base_mae_multitask.sh
bash sh/finetune_base_mae_gpaco.sh
bash sh/finetune_base_mae_gpaco_eval.sh

On imbalanced data,

cd GPaCo/LT
bash sh/LT/ImageNetLT_train_X50_multitask.sh
bash sh/LT/ImageNetLT_train_X50.sh
sh/LT/ImageNetLT_eval_X50.sh

bash sh/LT/Inat_train_R50.sh
sh/LT/Inat_eval_R50.sh

bash sh/LT/PlacesLT_train_R152.sh
bash sh/LT/PlacesLT_eval_R152.sh

On semantic segmentation,

cd GPaCo/Seg/semseg
bash sh/ablation_paco_ade20k/upernet_swinbase_160k_ade20k_paco.sh
bash sh/ablation_paco_coco10k/r50_deeplabv3plus_40k_coco10k_paco.sh
bash sh/ablation_paco_context/r50_deeplabv3plus_40k_context_paco.sh
bash sh/ablation_paco_cityscapes/r50_deeplabv3plus_40k_context.sh

Parametric-Contrastive-Learning

This repository contains the implementation code for ICCV2021 paper:
Parametric Contrastive Learning (https://arxiv.org/abs/2107.12028)

Overview

In this paper, we propose Parametric Contrastive Learning (PaCo) to tackle long-tailed recognition. Based on theoretical analysis, we observe supervised contrastive loss tends to bias on high-frequency classes and thus increases the difficulty of imbalance learning. We introduce a set of parametric class-wise learnable centers to rebalance from an optimization perspective. Further, we analyze our PaCo loss under a balanced setting. Our analysis demonstrates that PaCo can adaptively enhance the intensity of pushing samples of the same class close as more samples are pulled together with their corresponding centers and benefit hard example learning. Experiments on long-tailed CIFAR, ImageNet, Places, and iNaturalist 2018 manifest the new state-of-the-art for long-tailed recognition. On full ImageNet, models trained with PaCo loss surpass supervised contrastive learning across various ResNet backbones.

Results and Pretrained models

Full ImageNet (Balanced setting)

Method Model Top-1 Acc(%) link log
PaCo ResNet-50 79.3 download download
PaCo ResNet-101 80.9 download download
PaCo ResNet-200 81.8 download download

ImageNet-LT (Imbalance setting)

Method Model Top-1 Acc(%) link log
PaCo ResNet-50 57.0 download download
PaCo ResNeXt-50 58.2 download download
PaCo ResNeXt-101 60.0 download download

iNaturalist 2018 (Imbalanced setting)

Method Model Top-1 Acc(%) link log
PaCo ResNet-50 73.2 TBD download
PaCo ResNet-152 75.2 TBD download

Places-LT (Imbalanced setting)

Method Model Top-1 Acc(%) link log
PaCo ResNet-152 41.2 TBD download

Get Started

For full ImageNet, ImageNet-LT, iNaturalist 2018, Places-LT training and evaluation. Note that PyTorch>=1.6. All experiments are conducted on 4 GPUs. If you have more GPU resources, please make sure that the learning rate should be linearly scaled and 32 images per gpu is recommented.

cd Full-ImageNet
bash sh/train_resnet50.sh
bash sh/eval_resnet50.sh

cd LT
bash sh/ImageNetLT_train_R50.sh
bash sh/ImageNetLT_eval_R50.sh
bash sh/PlacesLT_train_R152.sh
bash sh/PlacesLT_eval_R152.sh

cd LT
bash sh/CIFAR100_train_imb0.1.sh

Contact

If you have any questions, feel free to contact us through email ([email protected]) or Github issues. Enjoy!

BibTex

If you find this code or idea useful, please consider citing our work:

@ARTICLE{10130611,
  author={Cui, Jiequan and Zhong, Zhisheng and Tian, Zhuotao and Liu, Shu and Yu, Bei and Jia, Jiaya},
  journal={IEEE Transactions on Pattern Analysis and Machine Intelligence}, 
  title={Generalized Parametric Contrastive Learning}, 
  year={2023},
  volume={},
  number={},
  pages={1-12},
  doi={10.1109/TPAMI.2023.3278694}}


@inproceedings{cui2021parametric,
  title={Parametric contrastive learning},
  author={Cui, Jiequan and Zhong, Zhisheng and Liu, Shu and Yu, Bei and Jia, Jiaya},
  booktitle={Proceedings of the IEEE/CVF international conference on computer vision},
  pages={715--724},
  year={2021}
}

@ARTICLE{9774921,
  author={Cui, Jiequan and Liu, Shu and Tian, Zhuotao and Zhong, Zhisheng and Jia, Jiaya},
  journal={IEEE Transactions on Pattern Analysis and Machine Intelligence}, 
  title={ResLT: Residual Learning for Long-Tailed Recognition}, 
  year={2023},
  volume={45},
  number={3},
  pages={3695-3706},
  doi={10.1109/TPAMI.2022.3174892}
  }

  
@article{cui2022region,
  title={Region Rebalance for Long-Tailed Semantic Segmentation},
  author={Cui, Jiequan and Yuan, Yuhui and Zhong, Zhisheng and Tian, Zhuotao and Hu, Han and Lin, Stephen and Jia, Jiaya},
  journal={arXiv preprint arXiv:2204.01969},
  year={2022}
  }
  
@article{zhong2023understanding,
  title={Understanding Imbalanced Semantic Segmentation Through Neural Collapse},
  author={Zhong, Zhisheng and Cui, Jiequan and Yang, Yibo and Wu, Xiaoyang and Qi, Xiaojuan and Zhang, Xiangyu and Jia, Jiaya},
  journal={arXiv preprint arXiv:2301.01100},
  year={2023}
}

More Repositories

1

MGM

Official repo for "Mini-Gemini: Mining the Potential of Multi-modality Vision Language Models"
Python
3,111
star
2

LongLoRA

Code and documents of LongLoRA and LongAlpaca (ICLR 2024 Oral)
Python
2,563
star
3

LISA

Project Page for "LISA: Reasoning Segmentation via Large Language Model"
Python
1,680
star
4

VoxelNeXt

VoxelNeXt: Fully Sparse VoxelNet for 3D Object Detection and Tracking (CVPR 2023)
Python
692
star
5

LLaMA-VID

LLaMA-VID: An Image is Worth 2 Tokens in Large Language Models (ECCV 2024)
Python
656
star
6

DeepUPE

Underexposed Photo Enhancement Using Deep Illumination Estimation
Python
566
star
7

3D-Box-Segment-Anything

We extend Segment Anything to 3D perception by combining it with VoxelNeXt.
Jupyter Notebook
524
star
8

LLMGA

This project is the official implementation of 'LLMGA: Multimodal Large Language Model based Generation Assistant', ECCV2024
Python
424
star
9

ControlNeXt

Controllable video and image Generation, SVD, Animate Anyone, ControlNet, LoRA
Python
417
star
10

PanopticFCN

Fully Convolutional Networks for Panoptic Segmentation (CVPR2021 Oral)
Python
391
star
11

PointGroup

PointGroup: Dual-Set Point Grouping for 3D Instance Segmentation
Python
376
star
12

3DSSD

3DSSD: Point-based 3D Single Stage Object Detector (CVPR 2020)
Python
375
star
13

Video-P2P

Video-P2P: Video Editing with Cross-attention Control
Python
365
star
14

FocalsConv

Focal Sparse Convolutional Networks for 3D Object Detection (CVPR 2022, Oral)
Python
364
star
15

Stratified-Transformer

Stratified Transformer for 3D Point Cloud Segmentation (CVPR 2022)
Python
362
star
16

DSGN

DSGN: Deep Stereo Geometry Network for 3D Object Detection (CVPR 2020)
Python
324
star
17

PFENet

PFENet: Prior Guided Feature Enrichment Network for Few-shot Segmentation (TPAMI).
Python
307
star
18

SphereFormer

The official implementation for "Spherical Transformer for LiDAR-based 3D Recognition" (CVPR 2023).
Python
300
star
19

GridMask

Python
281
star
20

ReviewKD

Distilling Knowledge via Knowledge Review, CVPR 2021
Python
249
star
21

Step-DPO

Implementation for "Step-DPO: Step-wise Preference Optimization for Long-chain Reasoning of LLMs"
Python
232
star
22

Simple-SR

Include MuCAN, LAPAR, etc.
Python
224
star
23

UVTR

Unifying Voxel-based Representation with Transformer for 3D Object Detection (NeurIPS 2022)
Python
224
star
24

Facelet_Bank

Facelet-Bank for Fast Portrait Manipulation (pytorch)
Python
208
star
25

SA-AutoAug

Scale-aware Automatic Augmentation for Object Detection (CVPR 2021)
Python
196
star
26

LargeKernel3D

LargeKernel3D: Scaling up Kernels in 3D Sparse CNNs (CVPR 2023)
Python
189
star
27

SNR-Aware-Low-Light-Enhance

This is the official implementation for the paper "SNR-aware low-light image enhancement" in CVPR2022
Python
160
star
28

MASA-SR

MASA-SR: Matching Acceleration and Spatial Adaptation for Reference-Based Image Super-Resolution (CVPR2021)
Python
158
star
29

ECCV22-P3AFormer-Tracking-Objects-as-Pixel-wise-Distributions

The official code for our ECCV22 oral paper: tracking objects as pixel-wise distributions.
Python
158
star
30

Context-Aware-Consistency

Semi-supervised Semantic Segmentation with Directional Context-aware Consistency (CVPR 2021)
Python
155
star
31

SparseTransformer

A fast and memory-efficient libarary for sparse transformer with varying token numbers (e.g., 3D point cloud).
Python
153
star
32

spconv-plus

Python
152
star
33

EfficientNeRF

The official code for "Efficient Neural Radiance Fields" in CVPR2022.
Python
152
star
34

MiSLAS

Improving Calibration for Long-Tailed Recognition (CVPR2021)
Python
144
star
35

RIVAL

[NeurIPS 2023 Spotlight] Real-World Image Variation by Aligning Diffusion Inversion Chain
Python
143
star
36

MOOD

Official PyTorch implementation of MOOD series: (1) MOODv1: Rethinking Out-of-distributionDetection: Masked Image Modeling Is All You Need. (2) MOODv2: Masked Image Modeling for Out-of-Distribution Detection.
Python
133
star
37

outpainting_srn

Wide-Context Semantic Image Extrapolation, CVPR2019
Python
131
star
38

MSAD

Multi-Scale Aligned Distillation for Low-Resolution Detection (CVPR2021)
Python
127
star
39

DeepVision3D

DeepVision3D is an open source toolbox for point-cloud understanding.
Python
119
star
40

Ref-NPR

[CVPR 2023] Ref-NPR: Reference-Based Non-PhotoRealistic Radiance Fields
Python
119
star
41

VFIformer

Video Frame Interpolation with Transformer (CVPR2022)
Python
112
star
42

Prompt-Highlighter

[CVPR 2024] Prompt Highlighter: Interactive Control for Multi-Modal LLMs
Python
112
star
43

VFF

Voxel Field Fusion for 3D Object Detection (CVPR2022)
Python
95
star
44

SMR

Self-Supervised 3D Mesh Reconstruction from Single Images (CVPR2021)
Python
91
star
45

SCGAN

The implementation of 'Image synthesis via semantic composition', ICCV2021.
Python
81
star
46

Imbalanced-Learning

Imbalanced learning tool for imbalanced recognition and segmentation
Python
79
star
47

JigsawClustering

This is the code for CVPR 2021 oral paper: Jigsaw Clustering for Unsupervised Visual Representation Learning
Python
78
star
48

AttenNorm

Attentive Normalization for Conditional Image Generation
Python
71
star
49

GFS-Seg

The official implementation of Generalized Few-shot Semantic Segmentation (CVPR 2022)
Python
63
star
50

Mask-Attention-Free-Transformer

Official Implementation for "Mask-Attention-Free Transformer for 3D Instance Segmentation"
Python
59
star
51

MoTCoder

This is the official code repository of MoTCoder: Elevating Large Language Models with Modular of Thought for Challenging Programming Tasks.
Python
58
star
52

SDSD

Seeing Dynamic Scene in the Dark: High-Quality Video Dataset with Mechatronic Alignment (ICCV2021)
Python
48
star
53

GroupContrast

[CVPR 2024] GroupContrast: Semantic-aware Self-supervised Representation Learning for 3D Understanding
42
star
54

ProposeReduce

Video Instance Segmentation with a Propose-Reduce Paradigm (ICCV 2021)
Python
41
star
55

Robust-Semantic-Segmentation

Dynamic Divide-and-Conquer Adversarial Training for Robust Semantic Segmentation (ICCV2021)
Python
40
star
56

Mr-Ben

This is the repo for our paper "Mr-Ben: A Comprehensive Meta-Reasoning Benchmark for Large Language Models"
Python
38
star
57

BAL

BAL: Balancing Diversity and Novelty for Active Learning - Official Pytorch Implementation
Python
38
star
58

TriVol

The official code of TriVol in CVPR-2023
Python
37
star
59

MR-GSM8K

Challenge LLMs to Reason About Reasoning: A Benchmark to Unveil Cognitive Depth in LLMs
Python
37
star
60

DecoupleNet

Official implementation for our ECCV 2022 paper "DecoupleNet: Decoupled Network for Domain Adaptive Semantic Segmentation"
Python
36
star
61

Dsig

Deep Structured Instance Graph for Distilling Object Detectors (ICCV 2021)
Python
35
star
62

LBGAT

Learnable Boundary Guided Adversarial Training (ICCV2021)
Python
33
star
63

Q-LLM

This is the official repo of "QuickLLaMA: Query-aware Inference Acceleration for Large Language Models"
Python
31
star
64

AGSS-VOS

AGSS-VOS: Attention Guided Single-Shot Video Object Segmentation
Python
20
star
65

MAT

MAT: Mask-Aware Transformer for Large Hole Image Inpainting
Python
16
star
66

MSN

Memory Selection Network for Video Propagation (ECCV 2020)
Python
6
star
67

APD

Python
5
star
68

Point2Pix

The official code of Point2pix in CVPR-2023
2
star
69

TagCLIP

Python
2
star