rigvedrs / YOLO-V8-CAM

Wanna know what your model sees? Here's a package for applying EigenCAM on the new YOLO V8 model
MIT License
100 stars 17 forks source link

My Grad Cam is giving opposite results. #13

Open snehitvaddi opened 4 months ago

snehitvaddi commented 4 months ago

I'm working on a project where I trained a YOLOv8 model to find E.coli bacteria droplets on leaves. After using Grad-CAM on the YOLO model, which was 100% accurate, I noticed something unexpected. The areas without droplets are marked in red, and the areas with droplets are in blue, which means they're considered less important.

Does this mean the model is actually working well and just the color scheme is flipped, or did I make a mistake somewhere?

Here are the Grad-CAM results and the original image displayed side by side for comparison:

rigvedrs commented 4 months ago

Yes, it could mostly be related to a switch in RGB channels. OpenCV has a common issue of considering a different order of channels than other packages, so if you're using two different packages for the same image, considering this might help.

snehitvaddi commented 4 months ago

Umm...that sounds like a fair reason but I am pretty sure that I haven't used any other image processing module other than OpenCV.