Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DETR XAI #4184

Merged
merged 7 commits into from
Jan 23, 2025
Merged

DETR XAI #4184

merged 7 commits into from
Jan 23, 2025

Conversation

eugene123tw
Copy link
Contributor

@eugene123tw eugene123tw commented Jan 21, 2025

Summary

Enhance XAI capabilities for RTDETR and D-Fine models by implementing support for saliency map generation and feature vector outputs, compatibility with both PyTorch and OpenVINO frameworks.

Person Saliency Map:
000000046872_class_0_overlay

Car Saliency Map:
000000046872_class_1_overlay

How to test

otx explain --work_dir otx-workspace --dump True --explain_config.postprocess True

Checklist

  • I have added unit tests to cover my changes.​
  • I have added integration tests to cover my changes.​
  • I have ran e2e tests and there is no issues.
  • I have added the description of my changes into CHANGELOG in my target branch (e.g., CHANGELOG in develop).​
  • I have updated the documentation in my target branch accordingly (e.g., documentation in develop).
  • I have linked related issues.

License

  • I submit my code changes under the same Apache License that covers the project.
    Feel free to contact the maintainers if that's a concern.
  • I have updated the license header for each file (see an example below).
# Copyright (C) 2025 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

…ng output with raw logits and saliency maps for better interpretability.
…dding postprocessing options for saliency maps and refining DETR model's explain mode implementation.
@eugene123tw eugene123tw changed the title [Draft] DETR XAI DETR XAI Jan 22, 2025
@github-actions github-actions bot added TEST Any changes in tests DOC Improvements or additions to documentation labels Jan 22, 2025
@sovrasov
Copy link
Contributor

sovrasov commented Jan 22, 2025

@eugene123tw thanks for the PR! Could you attach some explain results here for a reference?

…ing a dedicated method for splitting and reshaping logits in explain mode.
@eugene123tw eugene123tw requested a review from sovrasov January 22, 2025 16:23
Copy link
Collaborator

@negvet negvet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As @sovrasov noted, DetClassProbabilityMap has some normalization issues.
I mean it is quite sensitive to the particular model and particular dataset.
Galina tried to come up with some uniformly good solution, but this was not that successful.
The result seems not perfect, but probably acceptable. Assuming that the model is well trained.

For the future, I would propose to revisit DetClassProbabilityMap. Basically, it is just visualization of the classification head output. Probably some modification or other methods might work better to explain object detection models.

@eugene123tw eugene123tw merged commit 2f0b54b into openvinotoolkit:develop Jan 23, 2025
22 of 23 checks passed
@eugene123tw eugene123tw deleted the eugene/detr-xai branch January 23, 2025 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DOC Improvements or additions to documentation TEST Any changes in tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants