This is an unofficial implementation of Deep Orthogonal Fusion of Local and Global Features (DOLG) in TensorFlow 2 (Keras)
. Paper. In this repository, the following architechture has been implemented. Details here.
TensorFlow 2.6
TensorFlow Addons
First, reset the config file, config.py
BATCH_SIZE = 10
IMG_SIZE = 768
CHANNELS = 3
LR = 0.003
mixed_precision = False
Next, build the DOLG model with EfficientNetB5.
from config import IMG_SIZE, CHANNELS
from model.DOLG import DOLGNet
print(model(tf.ones((1, IMG_SIZE, IMG_SIZE, CHANNELS)))[0].shape)
display(tf.keras.utils.plot_model(model.build_graph(),
show_shapes=True,
show_layer_names=True,
expand_nested=False))
For better flexibility, please see the following code example section.
The DOLG concept can be integrated into any computer vision models i.e. NFNet
, ResNeSt
, or EfficietNet
. Here are some end-to-end code examples.
- DenseNet DOLGNet Malaria | Colab
- EfficientNet DOLGNet Oxford Flowers 102 | Colab
- ResNet DOLGNet Cmaterdb | Colab
- Implement Sub-center Arcface Head.
- Fix GeM issue.
- tf-keras-vis
@misc{yang2021dolg,
title={DOLG: Single-Stage Image Retrieval with Deep Orthogonal
Fusion of Local and Global Features},
author={Min Yang and Dongliang He and Miao Fan and Baorong Shi and
Xuetong Xue and Fu Li and Errui Ding and Jizhou Huang},
year={2021},
eprint={2108.02927},
archivePrefix={arXiv},
primaryClass={cs.CV}
}