https://github.com/needylove/ordinalentropy
The code of "Improving Deep Regression with Ordinal Entropy" in ICLR 2023
https://github.com/needylove/ordinalentropy
Last synced: 11 days ago
JSON representation
The code of "Improving Deep Regression with Ordinal Entropy" in ICLR 2023
- Host: GitHub
- URL: https://github.com/needylove/ordinalentropy
- Owner: needylove
- Created: 2023-01-21T05:55:53.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-15T08:23:03.000Z (over 1 year ago)
- Last Synced: 2024-11-13T14:41:18.887Z (6 months ago)
- Language: Python
- Homepage:
- Size: 15.3 MB
- Stars: 42
- Watchers: 2
- Forks: 6
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- Awesome-Monocular-Depth - Improving Deep Regression with Ordinal Entropy
README
# OrdinalEntropy
The official code of "Improving Deep Regression with Ordinal Entropy" in ICLR 2023. [[PDF]](https://openreview.net/forum?id=raU07GpP0P).We currently provide a detailed code for experiments on the synthetic dataset, with a new visualization experiments for easy reproduction.
## Experiments on the synthetic dataset
### Obtain experiments results on the synthetic dataset
- run main.py### Visualization experiment on the synthetic dataset
We add a new visualization experiment with the synthetic dataset for easy reproduction, as the visualization experiments in our paper is on depth estimation task, which may take some effort to reproduce.- run vis_tsne.py to obtain the features
- run vis_sphere.py to visualize the obtained features on a sphere### Dataset
For the Linear task:
- train.npy : the traning set
- test.npy: the test set, please download it [here](https://drive.google.com/file/d/19gmrPb2PG8LTp_Lz5b7S0QGXdlEyVpNc/view?usp=sharing).For the non-linear task:
- train_sde.npy : the traning set
- test_sde.npy: the test setThe dataset above is generated with this code: [DeepONet](https://github.com/lululxvi/deeponet).
## Experiments on the Depth Estimation and Crowd Counting
The code for the Depth Baseline can be found here:
- [NeW-CRFs](https://github.com/aliyun/NeWCRFs).The code for the Crowd Counting Baseline can be found here:
- [CSRNet](https://github.com/leeyeehoo/CSRNet-pytorch).The ordinal entropy code for the two tasks can be found here:
- ./DepthEstimation&CrowdCounting/OrdinalEntropy.pyThe ordinal entropy can be added into the New-CRFs and CSRNet baselines by:
- change the output of models from
```
returen x
```to
```
if self.training:
return x, encoding
else:
return x
```- add the ordinal entropy into the loss:
change
```
outputs = model(inputs, targets, epoch)
```
to
```
outputs, features = model(inputs, targets, epoch)
oe_loss = ordinalentropy(features, targets)
loss = loss + oe_loss
```### Visualization results on depth-estimation with NYU-v2
The visualization results can be obtained by:- run vis_sphere.py to visualize the obtained features on a sphere
## Experiments on the Age Estimation
The code for the Baseline can be found here:
- [Imbalanced Regression](https://github.com/YyzHarry/imbalanced-regression/tree/main/agedb-dir).The ordinal entropy code for Age Estimation can be found here:
- ./AgeEstimation/OrdinalEntropy.pyThe ordinal entropy can be added into the Age Estimation baselines in a similar way shown above.
## Reference
S. Zhang, L. Yang, M. Bi Mi, X. Zheng, A. Yao, "Improving Deep Regression with Ordinal Entropy," in ICLR, 2023. [[PDF]](https://openreview.net/forum?id=raU07GpP0P).