This is a GitHub repository containing some deep learning models for ordinal regression (with pre-trained weights) in the PyTorch Hub / Torch Hub format. Note that this repository is not going to be a comprehensive Hub for ordinal regression models but more of a way to quickly access models from a specific manuscript:
- Xintong Shi, Wenzhi Cao, and Sebastian Raschka Deep Neural Networks for Rank-Consistent Ordinal Regression Based On Conditional Probabilities. https://arxiv.org/abs/2111.08851
(More models may be added later, but I don't want to make any promises 😅.)
- For more information on (Py)Torch Hub, see the documentation at https://pytorch.org/docs/stable/hub.html
You can load the model via the following syntax:
import torch
model = torch.hub.load(
"rasbt/ord-torchhub",
model="resnet34_corn_afad",
source='github',
pretrained=True
)
Note that the pretrained versions may only perform well on images from the AFAD dataset, which is the dataset that was used to train the models. For more usage examples and transfer learning instructions, please see the examples in ./examples.
"resnet34_corn_afad"
(an ordinal model trained via the CORN loss)"resnet34_coral_afad"
(an ordinal model trained via the CORAL loss)"resnet34_niu_afad"
(an ordinal model trained via Niu et al.'s loss)"resnet34_crossentr_afad"
(a regular classifier trained via cross entropy loss)
In case you want to reproduce the model training, you can find the respective instructions and files in the _train
subfolder.
Try an interactive App built with Lightning AI.
Link: https://bit.ly/3yHA5nk
(The source code for this App can be found under ./app.)