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

Various fixes for XAI in 2.1 #3615

Merged

Conversation

GalyaZalesskaya
Copy link
Contributor

@GalyaZalesskaya GalyaZalesskaya commented Jun 13, 2024

Summary

Issue: CVS-142112

Found and fixed various issues:

  • Dump saliency maps using label names, if possible
  • The score_treshold for classification, detection and inst_seg is too low. This means that choosing saliency maps for only predicted classes works incorrectly. Added additional score_thr=0.3 to choose saliency map with high confidence
  • Fix softmax for detection saliency map generation algorithm
  • Fix saliency maps for YOLOX. Added cropping saliency maps if it was padded.
    YOLOX resizes the initial image, keeping the aspect ratio and padding the image to square. The generated saliency map is also padded so after overlaying it on the initial image, it looks distorted. Added cropping to fix it.
  • Fix h-label cls saliency map dumping for predicted classes. Converted predicted labels from h-label format to index in labels_name list based on hierarchical label info, e.g. [0,0,1] -> 5 CVS-144040

image

TODO:

  • Fix XAI for MobileNet V3
  • Fix XAI for multilabel cls
  • Apply these changes to Model API to update OV task

How to test

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) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

@github-actions github-actions bot added TEST Any changes in tests OTX 2.0 labels Jun 13, 2024
Copy link
Contributor

@goodsong81 goodsong81 left a comment

Choose a reason for hiding this comment

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

Thank you for the fix. Please review my comments.

src/otx/algo/utils/xai_utils.py Show resolved Hide resolved
src/otx/algo/utils/xai_utils.py Outdated Show resolved Hide resolved
src/otx/algo/utils/xai_utils.py Show resolved Hide resolved
src/otx/algo/utils/xai_utils.py Outdated Show resolved Hide resolved
src/otx/engine/engine.py Outdated Show resolved Hide resolved
src/otx/engine/engine.py Outdated Show resolved Hide resolved
@GalyaZalesskaya GalyaZalesskaya enabled auto-merge (squash) June 17, 2024 09:50
@GalyaZalesskaya GalyaZalesskaya merged commit 2de7332 into openvinotoolkit:develop Jun 17, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TEST Any changes in tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants