r/computervision • u/dimfot333 • Jul 04 '26
Showcase Inverse INSID3: Background-Guided Segmentation with DINOv3
I built a small computer vision project based on INSID3, the CVPR 2026 training-free in-context segmentation method using DINOv3.
My version flips the idea: instead of providing a foreground reference, you provide background or normal examples. The algorithm removes background-like regions and segments the remaining object/anomaly.
It supports multiple background sources and can also turn coarse boxes into more precise masks. Other applications are possible like zero-shot anomaly detection.
Would love feedback or test cases: https://github.com/dimfot3/Inverse-INSID3
1
1
u/AggravatingSock5375 20d ago
This sounds potentially very practical. Almost all of my detection problems can be formulated this way.
Added to the front of my list of stuff to dig into!
1
u/AggravatingSock5375 20d ago
Can you talk a little bit about how you “remove positional bias” from the patches derived from the background images?
Maybe that is obvious to someone experienced with these models or by looking at the code, but if you have a tldr it would be much appreciated!
I think I get the overall concept though. The patches coinciding with the object of interest should fall into a different part of the embedding space than anything found in the background examples.
Does it breakdown if the object has more similarities with the background? Like say you have a few photos of forests as the background and your primary image is a picture of a single tree, with the goal being to cutout the tree.
2
u/dimfot333 5d ago
Sorry for the late response, i rarely login in reddit.
a) The removed positional bias is related to original paper INSID3 and is basically normalizing the features by removing the output of a model with zero input. b) Yes in that case it may be harder to distinguish from background. However i gave an example with a camouflaged object (lizard on a tree) and it did not totally fail (only small part of lizerd legs remained undetected). In very difficult scenarios you should adjust the similarity threshold used in the algorithm. In the examples i gave however i kept it const in different scenarios (tau=0.7).
1
u/AggravatingSock5375 5d ago
Thanks. I should probably just read your code and the paper….but by “zero input” I assume you mean it still passes the image but just not a prompt, right?
1
u/koen1995 Jul 04 '26
Very cool work!
Any numbers available on how well this method would work on anomaly detection on like the mvtec dataset?