Maelic / SGG-Benchmark

A New Benchmark for Scene Graph Generation, targeting real-world applications
MIT License
40 stars 5 forks source link

multi-relationship classification? #37

Open Quan-zzx opened 5 days ago

Quan-zzx commented 5 days ago

Hello, I have a dataset,the same subject and object have multiple relationships,does the framework support multi relationship classification?

Maelic commented 4 days ago

Hello, I will say yes and no. The relation decoding is multi-label because for every possible subject-object pair, a list of probabilities is computed for each predicate. So in theory, you can select more than one predicate per subject-object pair. However, in practice during training the learning is done such that the cross-entropy loss will optimize only the top relation. To modify this, you will need to change the loss and the dataloader a bit (remove this part for instance). The metric that validate multi-label relationships is called No Graph Constraint Recall and is already implemented here. You will have to activate it by modifying this line.

Quan-zzx commented 7 hours ago

Hello, I will say yes and no. The relation decoding is multi-label because for every possible subject-object pair, a list of probabilities is computed for each predicate. So in theory, you can select more than one predicate per subject-object pair. However, in practice during training the learning is done such that the cross-entropy loss will optimize only the top relation. To modify this, you will need to change the loss and the dataloader a bit (remove this part for instance). The metric that validate multi-label relationships is called No Graph Constraint Recall and is already implemented here. You will have to activate it by modifying this line.

ok,thanks, I'll give it a try