# LOGIC TENSOR NETWORKS FOR VISUAL RELATIONSHIP DETECTION
This repository contains the dataset, the source code and the models for the detection of visual relationships with [Logic Tensor Networks](https://github.com/logictensornetworks/logictensornetworks).
## Introduction
Semantic Image Interpretation is the task of extracting a structured semantic description from images. This requires the detection of *visual relationships*: triples (subject, relation, object) describing a semantic relation between the bounding box of a subject and the bounding box of an object. Here, we perform the detection of visual relationships by using Logic Tensor Networks (LTNs), a novel Statistical Relational Learning framework that exploits both the similarities with other seen relationships and background knowledge, expressed with logical constraints between subjects, relations and objects. The experiments are conducted on the Visual Relationship Dataset (VRD).
A detailed description of the work is provided in our paper *Compensating Supervision Incompleteness with Prior Knowledge in Semantic Image Interpretation* at IJCNN 2019:
```
@inproceedings{donadello2019compensating,
author = {Ivan Donadello and Luciano Serafini},
title = {Compensating Supervision Incompleteness with Prior Knowledge in Semantic Image Interpretation},
booktitle = {{IJCNN}},
pages = {1--8},
publisher = {{IEEE}},
year = {2019}
}
```
[Here](https://www.youtube.com/watch?v=y2-altg3FFw) a video shows a demo of the system.
## Using the Source Code
- The `data` folder contains the LTNs encoding of the VRD training and test set, the ontology that defines the logical constraints and the images of the VRD test set. Images and their annotations can be downloaded from https://cs.stanford.edu/people/ranjaykrishna/vrd/.
- The `models` folder contains the trained grounded theories of the experiments;
- The `Visual-Relationship-Detection-master` folder contains the object detector model and the evaluation code provided in https://github.com/Prof-Lu-Cewu/Visual-Relationship-Detection for the evaluation of the phrase, relationship and predicate detection tasks on the VRD.
**Requirements**
We train and test the grounded theories with the following software configuration. However, more recent versions of the libraries could also work:
- Ubuntu 14.04;
- Matlab R2014a;
- Python 2.7.6;
- TensorFlow 0.11.0;
- Numpy 1.13.1;
- Scikit-learn 0.18.1;
- Matplotlib 1.5.1;
**Training a grounded theory**
To run a train use the following command:
```sh
$ python train.py
```
- The trained grounded theories are saved in the `models` folder in the files `KB_nc_2500.ckpt` (no constraints) and `KB_wc_2500.ckpt` (with constraints). The number in the filename (`2500`) is a parameter in the code to set the number of iterations.
**Evaluating the grounded theories**
To run the evaluation use the following commands
```sh
$ python predicate_detection.py
$ python relationship_phrase_detection.py
```
Then, launch Matlab, move into the `Visual-Relationship-Detection-master` folder, execute the scripts `predicate_detection_LTN.m` and `relationship_phrase_detection_LTN.m` and see the results.
没有合适的资源?快使用搜索试试~ 我知道了~
结构张量matlab代码-Visual-Relationship-Detection-LTN:该存储库包含用于检测与LogicT...
共13个文件
py:6个
md:5个
m:2个
需积分: 9 2 下载量 154 浏览量
2021-05-24
03:13:27
上传
评论
收藏 20KB ZIP 举报
温馨提示
结构张量matlab代码用于视觉关系检测的逻辑张量网络 该存储库包含用于检测视觉关系的数据集,源代码和模型。 介绍 语义图像解释是从图像中提取结构化语义描述的任务。 这需要检测视觉关系:三元组(对象,关系,对象),描述对象的边界框和对象的边界框之间的语义关系。 在这里,我们使用逻辑张量网络(LTNs)进行视觉关系的检测,这是一种新颖的统计关系学习框架,该框架利用与其他可见关系和背景知识的相似性,用对象,关系和对象之间的逻辑约束来表示。 实验是在视觉关系数据集(VRD)上进行的。 我们在IJCNN 2019上的论文用语义图像解释中的先验知识补偿监督不完整性中提供了工作的详细说明: @inproceedings{donadello2019compensating, author = {Ivan Donadello and Luciano Serafini}, title = {Compensating Supervision Incompleteness with Prior Knowledge in Semantic Image Interpretation}, booktitle =
资源推荐
资源详情
资源评论
收起资源包目录
Visual-Relationship-Detection-LTN-master.zip (13个子文件)
Visual-Relationship-Detection-LTN-master
README.md 3KB
refine_predictions.py 6KB
visual_relationship_dataset.py 9KB
relationship_phrase_detection.py 6KB
train.py 8KB
logictensornetworks.py 10KB
Visual-Relationship-Detection-master
README.md 371B
predicate_detection_LTN.m 2KB
results_LTN
readme.md 296B
relationship_phrase_detection_LTN.m 2KB
models
readme.md 264B
data
readme.md 561B
predicate_detection.py 6KB
共 13 条
- 1
资源评论
weixin_38517122
- 粉丝: 7
- 资源: 907
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功