Skip to content
/ DHNS Public

DASFAA 2025: Diffusion-based Hierarchical Negative Sampling for Multimodal Knowledge Graph Completion

Notifications You must be signed in to change notification settings

ngl567/DHNS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DHNS

version version preprint DASFAA PyTorch

DASFAA 2025: Diffusion-based Hierarchical Negative Sampling for Multimodal Knowledge Graph Completion

Introduction

This is the PyTorch implementation of DHNS framework. We propose a novel Diffusion-based Hierarchical Negative Sampling (DHNS) scheme tailored for multimodal knowledge graph completion (MMKGC) tasks, which tackles the challenge of generating high-quality negative triples by leveraging a Diffusion-based Hierarchical Embedding Generation (DiffHEG) that progressively conditions on entities and relations as well as multimodal semantics. Furthermore, we develop a Negative Triple-Adaptive Training (NTAT) strategy that dynamically adjusts training margins associated with the hardness level of the synthesized negative triples, facilitating a more robust and effective learning procedure to distinguish between positive and negative triples.

🌈 An Overview of the DHNS Framework

image

💻 Installation

Create a conda environment with pytorch:

conda create --name dhns_env python=3.8
source activate dhns_env
pip install -r requirements.txt

📁 Datasets and Pretrained Embeddings

We reuse three multimodal knowledge graph datasets namely DB15K, MKG-W and MKG-Y in the folder ./benchmarks/ along with MMRNS.
The visual and textual embeddings of the MMKGs could be downloaded from this Google Drive. You can kindly put all the files of format .pth in the folder ./embeddings/.

🚀 Train and Test

In order to reproduce the results of DHNS model on the datasets, you can kindly run the following command with DistMult+DHNS on MKG-Y for an instance:

python train_dhns.py

🤝 Citation

If you use the codes, please cite the following paper:

@misc{niu2025dhns,
  author        = {Guanglin Niu and
                   Xiaowei Zhang},
  title         = {Diffusion-based Hierarchical Negative Sampling for Multimodal Knowledge Graph Completion},
  archivePrefix = {arXiv},
  year          = {2025},
  eprint        = {2501.15393},
  primaryClass  = {cs.AI}
}

About

DASFAA 2025: Diffusion-based Hierarchical Negative Sampling for Multimodal Knowledge Graph Completion

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published