Skip to content

Commit

Permalink
init md
Browse files Browse the repository at this point in the history
Gumpest committed Apr 20, 2024
1 parent 939a63b commit 4b2de3b
Showing 3 changed files with 88 additions and 2 deletions.
90 changes: 88 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,88 @@
# FreeKD
Official implementation of paper "FreeKD: Knowledge Distillation via Semantic Frequency Prompt", CVPR 2024.
# FreeKD: Knowledge Distillation via Semantic Frequency Prompt

:fire: Official implementation of paper "FreeKD: Knowledge Distillation via Semantic Frequency Prompt", CVPR 2024.

By Yuan Zhang, Tao Huang, Jiaming Liu, Tao Jiang, Kuan Cheng, Shanghang Zhang

<p align='center'>
<img src='./assests/arch.png' alt='mask' width='700px'>
</p>

## Installation

### Install MMRazor 0.x

```shell
git clone -b 0.x https://github.com/open-mmlab/mmrazor.git
cd mmrazor
```

```shell
pip install -v -e .
```

### Prepare Data Set

Download on [https://opendatalab.com](https://opendatalab.com)

> [!Note]
> If you want to distill on detection and segmentation, you should install mmdetection and mmsegmentation, respectively.
## Reproducing our results

### Train students with FreeKD

This repo uses [MMRazor](https://github.com/open-mmlab/mmrazor) as the knowledge distillation toolkit. For environment setup, please see [docs/en/get_started.md](docs/en/get_started.md).

**Train student:**

```shell
cd mmrazor
sh tools/mmdet/dist_train_mmdet.sh ${CONFIG} 8 ${WORK_DIR}
```

Example for reproducing our `reppoints_x101-reppoints-r50_coco` result:

```shell
sh tools/mmdet/dist_train_mmdet.sh freekd_reppoints_x101-reppoints-r50_coco.py 8 work_dirs/freekd_rep_x101-fpn_x50
```


### Results

* Baseline settings:

| Student | Teacher | FreeKD |
| :--------------------: | :---------------------: | :------: |
| Faster RCNN-R50 (38.4) | Faster RCNN-R101 (39.8) | 40.8 |
| RetinaNet-R50 (37.4) | RetinaNet-R101 (38.9) | 39.9 |
| FCOS-R50 (38.5) | FCOS-R101 (40.8) | 42.9 |

* Stronger teachers:

| Student | Teacher | FreeKD |
| :--------------------: | :---------------------------: | :------: |
| Faster RCNN-R50 (38.4) | Cascade Mask RCNN-X101 (45.6) | 42.4 |
| RetinaNet-R50 (37.4) | RetinaNet-X101 (41.0) | 41.0 |
| RepPoints-R50 (38.6) | RepPoints-R101 (44.2) | 42.4 |

### Visualization

<p align='center'>
<img src='./assests/media.png' alt='mask' width='320px'>
</p>

## License

This project is released under the [Apache 2.0 license](LICENSE).

## Citation
If you use FreeKD in your research, please cite our work by using the following BibTeX entry:
```
@article{zhang2023freekd,
title={FreeKD: Knowledge Distillation via Semantic Frequency Prompt},
author={Zhang, Yuan and Huang, Tao and Liu, Jiaming and Jiang, Tao and Cheng, Kuan and Zhang, Shanghang},
journal={arXiv preprint arXiv:2311.12079},
year={2023}
}
```
Binary file added assests/arch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assests/media.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4b2de3b

Please sign in to comment.