Dual Learning with Dynamic Knowledge Distillation and Soft Alignment for Partially Relevant Video Retrieval

May 13, 2026 · View on GitHub

This repository contains the source code of DL-DKD model and the extended DL-DKD++ model. If you would like to visit the DL-DKD model, please switch to the ICCV branch.

Table of Contents

Environments

  • python 3.8
  • pytorch 1.9.0
  • torchvision 0.10.0
  • tensorboard 2.6.0
  • tqdm 4.62.0
  • easydict 1.9
  • h5py 2.10.0
  • cuda 11.1

We used Anaconda to setup a deep learning workspace that supports PyTorch. Run the following script to install the required packages.

conda create --name DLDKD python=3.8
conda activate DLDKD
git clone https://github.com/HuiGuanLab/DL-DKD.git # 
cd DL-DKD
pip install -r requirements.txt
conda deactivate

DL-DKD++ on TVR

Required Data

Run the following script to download the video feature and text feature of the TVR dataset and place them in the specified path. The data can also be downloaded from Kuake pan. Please refer to here for more description of the dataset.

When you set label_style=hard, the model results are based on the results of the ICCV conference version paper.

DLDKD++ defaults to label_style=soft

Training

Run the following script to train DL-DKD++ network on TVR. It will save the chechpoint that performs best on the validation set as the final model.

label_style

root_path=$HOME/VisualSearch
mkdir -p $root_path && cd $root_path
unzip tvr.zip
#Add project root to PYTHONPATH (Note that you need to do this each time you start a new session.)
source setup.sh

conda activate DLDKD

root_path=$HOME/VisualSearch

./do_tvr.sh $root_path

Evaluation

The model is placed in the directory root_path/results/root\_path/results/collection/$model_dir after training. To evaluate it, please run the following script:

collection=tvr
visual_feature=i3d_resnet
root_path=$HOME/VisualSearch
model_dir=tvr_DLDKD++

./do_test.sh $collection $visual_feature $root_path $model_dir

We also provide the trained checkpoint on TVR, run the following script to evaluate it. The model can also be downloaded from Here, passward=daNQ.

collection=tvr
visual_feature=i3d_resnet
root_path=$HOME/VisualSearch
model_dir=tvr/tvr_DLDKD++

unzip DLDKD++_checkpoint.zip -d $ROOTPATH/

./do_test.sh $collection $visual_feature $root_path $model_dir

$collection is the dataset that the model trained and evaluate on.

$visual_feature is the video feature corresponding to the dataset.

$model_dir is the path of checkpoints saved.

Expected performance

R@1R@5R@10R@100SumR
Text-to-Video15.336.047.586.0184.8

DL-DKD++ on Activitynet

Required Data

Run the following script to download the video feature and text feature of the Activitynet dataset and place them in the specified path. The data can also be downloaded from Kuake pan. Please refer to here for more description of the dataset.

When you set label_style=hard, the model results are based on the results of the ICCV conference version paper.

DLDKD++ defaults to label_style=soft

root_path=$HOME/VisualSearch
mkdir -p $root_path && cd $root_path
unzip activitynet.zip

Training

Run the following script to train DL-DKD++ network on Activitynet.

#Add project root to PYTHONPATH (Note that you need to do this each time you start a new session.)
source setup.sh

conda activate DLDKD

root_path=$HOME/VisualSearch

./do_activitynet.sh $root_path

Evaluation

The model is placed in the directory root_path/root\_path/collection/results/$model_dir after training. To evaluate it, please run the following script:

collection=activitynet
visual_feature=i3d
root_path=$HOME/VisualSearch
model_dir=ac_DLDKD++

./do_test.sh $collection $visual_feature $root_path $model_dir

We also provide the trained checkpoint on Activitynet, run the following script to evaluate it. The model can also be downloaded from Here, passward=daNQ.

collection=activitynet
visual_feature=i3d
root_path=$HOME/VisualSearch
model_dir=activitynet/ac_DLDKD++

unzip DLDKD++_checkpoint.zip -d $ROOTPATH/

./do_test.sh $collection $visual_feature $root_path $model_dir

Expected performance

R@1R@5R@10R@100SumR
Text-to-Video8.325.538.377.8149.9

DL-DKD++ on Charades-STA

Required Data

Run the following script to download the video feature and text feature of the Charades-STA dataset and place them in the specified path. The data can also be downloaded from Baidu pan. Please refer to here for more description of the dataset.

When you set label_style=hard, the model results are based on the results of the ICCV conference version paper.

DLDKD++ defaults to label_style=soft

root_path=$HOME/VisualSearch
mkdir -p $root_path && cd $root_path
unzip charades.zip -d $root_path

Training

Run the following script to train DL-DKD++ network on Charades-STA.

#Add project root to PYTHONPATH (Note that you need to do this each time you start a new session.)
source setup.sh

conda activate DLDKD

root_path=$HOME/VisualSearch

./do_charades.sh $root_path

Evaluation

The model is placed in the directory root_path/root\_path/collection/results/$model_dir after training. To evaluate it, please run the following script:

collection=charades
visual_feature=i3d
root_path=$HOME/VisualSearch
model_dir=charades_DLDKD++

./do_test.sh $collection $visual_feature $root_path $model_dir

We also provide the trained checkpoint on Charades-STA, run the following script to evaluate it. The model can also be downloaded from Here, passward=daNQ.

collection=charades
visual_feature=i3d
root_path=$HOME/VisualSearch
model_dir=charades/charades_DLDKD++

unzip DLDKD++_checkpoint.zip -d $ROOTPATH/

./do_test.sh $collection $visual_feature $root_path $model_dir

Expected performance

R@1R@5R@10R@100SumR
Text-to-Video1.97.112.349.871.1

Reference

@article{dong2025dual,
  title={Dual Learning with Dynamic Knowledge Distillation and Soft Alignment for Partially Relevant Video Retrieval},
  author={Dong, Jianfeng and Huang, Lei and Liu, Daizong and Chen, Xianke and Yang, Xun and Lin, Changting and Wang, Xun and Wang, Meng},
  journal={arXiv preprint arXiv:2510.12283},
  year={2025}
}

Acknowledgement

The codes are modified from TVRetrieval and ReLoCLNet.

This work was supported by the National Key R&D Program of China (2018YFB1404102), NSFC (62172420,61902347, 61976188, 62002323), the Public Welfare Technology Research Project of Zhejiang Province (LGF21F020010), the Open Projects Program of the National Laboratory of Pattern Recognition, the Fundamental Research Funds for the Provincial Universities of Zhejiang, and Public Computing Cloud of RUC.