Skip to content

🚀 feat(model): add UniNet #2797

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

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

ashwinvaidya17
Copy link
Contributor

@ashwinvaidya17 ashwinvaidya17 commented Jun 26, 2025

📝 Description

Results

Combined

category Original Acc Original AUROC Anomalib AUROC Original F1 Anomalib F1
bottle 100 100 99.76 100 98.39
cable 98.8 97.6 98.18 94.5 93.99
capsule 100 100 94.81 100 95.89
carpet 99.6 98.6 89.61 97.8 89.77
grid 99.2 97.8 100 95 99.12
hazelnut 100 100 99.93 99.3 98.57
leather 100 100 99.39 99.5 97.33
metal_nut 100 100 100 100 99.46
pill 99.7 98.4 96.73 99.3 97.12
screw 100 100 94.14 100 91.83
tile 98.9 96.9 98.48 94.7 95.81
toothbrush 100 100 95.28 100 90.91
transistor 99.2 99.2 98.54 97.5 96.1
wood 99.9 100 99.12 98.4 96.67
zipper 99.7 99 94.01 97.9 95.83

Original

object image_auroc acc f1
carpet 98.6 99.6 97.8
bottle 100 100 100
hazelnut 100 100 99.3
leather 100 100 99.5
cable 97.6 98.8 94.5
capsule 100 100 100
grid 97.8 99.2 95
pill 98.4 99.7 99.3
transistor 99.2 99.2 97.5
metal_nut 100 100 100
screw 100 100 100
toothbrush 100 100 100
zipper 99 99.7 97.9
tile 96.9 98.9 94.7
wood 100 99.9 98.4

Anomalib

data.init_args.category image_AUROC image_F1Score
0 bottle 99.76 98.39
1 cable 98.18 93.99
2 capsule 94.81 95.89
3 carpet 89.61 89.77
4 grid 100 99.12
5 hazelnut 99.93 98.57
6 leather 99.39 97.33
7 metal_nut 100 99.46
8 pill 96.73 97.12
9 screw 94.14 91.83
10 tile 98.48 95.81
11 toothbrush 95.28 90.91
12 transistor 98.54 96.1
13 wood 99.12 96.67
14 zipper 94.01 95.83

Anomaly Map Examples

image
image

✨ Changes

Select what type of change your PR is:

  • 🚀 New feature (non-breaking change which adds functionality)
  • 🐞 Bug fix (non-breaking change which fixes an issue)
  • ♻️ Refactor (non-breaking change which refactors the code base)
  • ⚡️ Performance improvements
  • 🎨 Style changes (code style/formatting)
  • 🧪 Tests (adding/modifying tests)
  • 📚 Documentation update
  • 📦 Build system changes
  • 🏗️ CI/CD configuration
  • 🔧 Chore (general maintenance)
  • 🔒 Security update
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)

✅ Checklist

Before you submit your pull request, please make sure you have completed the following steps:

  • 📚 I have made the necessary updates to the documentation (if applicable).
  • 🧪 I have written tests that support my changes and prove that my fix is effective or my feature works (if applicable).
  • 🏷️ My PR title follows conventional commit format.

For more information about code review checklists, see the Code Review Checklist.

Signed-off-by: Ashwin Vaidya <ashwinnitinvaidya@gmail.com>
Signed-off-by: Ashwin Vaidya <ashwinnitinvaidya@gmail.com>
@samet-akcay samet-akcay changed the title ✨ UniNet 🚀 feat(model): add UniNet model Jun 26, 2025
@samet-akcay samet-akcay changed the title 🚀 feat(model): add UniNet model 🚀 feat(model): add UniNet Jun 26, 2025
Signed-off-by: Ashwin Vaidya <ashwinnitinvaidya@gmail.com>
@ashwinvaidya17 ashwinvaidya17 marked this pull request as ready for review July 2, 2025 16:33
ashwinvaidya17 and others added 4 commits July 9, 2025 16:08
Signed-off-by: Ashwin Vaidya <ashwinnitinvaidya@gmail.com>
Signed-off-by: Ashwin Vaidya <ashwinnitinvaidya@gmail.com>
Signed-off-by: Ashwin Vaidya <ashwinnitinvaidya@gmail.com>
Copy link
Contributor

@samet-akcay samet-akcay left a comment

Choose a reason for hiding this comment

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

Love the implementation! Only few minor comments

@@ -1,6 +1,6 @@
"""PyTorch model defining the decoder network for Reverse Distillation.
"""PyTorch model defining the decoder network for Reverse Distillation and UniNet.
Copy link
Contributor

Choose a reason for hiding this comment

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

would it be an idea to have a better module name for this? de_resnet.py never made sense to me

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Resnet Transpose? Like ConvTranspose. I think de resnet was the name given by the authors of reverse distillation.

Copy link
Contributor

Choose a reason for hiding this comment

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

  • resnet_decoder.py could also work.
  • Would it make sense to rename ResNet to ResNetDecoder as well?
  • Also the docstring of ResNet should be updated with the correct imports I guess. The imports still show that the module is in reverse distillation

def learning_type(self) -> LearningType:
"""The model uses one-class learning.

Though technicaly it suppports multi-class and few_shot as well.
Copy link
Contributor

Choose a reason for hiding this comment

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

any idea how multi-class and few-show can work here?

Signed-off-by: Ashwin Vaidya <ashwin.vaidya@intel.com>
Signed-off-by: Ashwin Vaidya <ashwin.vaidya@intel.com>
Signed-off-by: Ashwin Vaidya <ashwin.vaidya@intel.com>
Signed-off-by: Ashwin Vaidya <ashwin.vaidya@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

📋 [TASK] Implement UniNet - CVPR 2025
2 participants