Open chengfeng6s opened 1 week ago
Thanks for your interest!
You can remove bg_features
and only use fg_features
in this line.
感谢您的回复,不过,我尝试这里只有fg_features如下,但这样得到的CAM 性能下降很多,只有0.2949,这是正常的吗
1464 images to eval 1 0.2949295514955877 2 0.2824552442887224 {'Pixel Accuracy': 0.7715846598960221, 'Mean Accuracy': 0.37673134479162734, 'Frequency Weighted IoU': 0.6290832249758578, 'Mean IoU': 0.2949295514955877, 'Class IoU': {0: 0.7513596304522624, 1: 0.1202147784545383, 2: 0.3435890623867887, 3: 0.028480355789477895, 4: 0.17926046550386135, 5: 0.1146763716143617, 6: 0.4248955240081565, 7: 0.344308842821791, 8: 0.14159452902520447, 9: 0.3331700162708718, 10: 0.23814207331858414, 11: 0.6175918976931766, 12: 0.21560852598698638, 13: 0.27500719204664326, 14: 0.3940252017134664, 15: 0.33922553994223836, 16: 0.17541033835017067, 17: 0.11741230299949161, 18: 0.5272530445066538, 19: 0.22116693557714, 20: 0.29112795294547594}}
Sorry for the late response.
The result is not normal. When removing bg_features
, the fg_features
should include all categories defined in the dataset to make them mutually exclusive. You can change
fg_features_temp = fg_text_features[label_id_list].to(device_id)
into
fg_features_temp = fg_text_features.to(device_id)
.
为什么改了之后CAM反而下降更多,只有0.0770了,这是为什么 1464 images to eval 1 0.07708468253765642 2 0.07959258728464762 {'Pixel Accuracy': 0.41341582912727887, 'Mean Accuracy': 0.16918333081521184, 'Frequency Weighted IoU': 0.31079908417477625, 'Mean IoU': 0.07959258728464762, 'Class IoU': {0: 0.40140293119346615, 1: 0.4393711419649353, 2: 0.03077191570499923, 3: 0.025459758810396256, 4: 0.07257508368460203, 5: 0.04889249390266907, 6: 0.040216769060329643, 7: 0.021146244637277014, 8: 0.04577784407809939, 9: 0.03117883698817369, 10: 0.013750552161958918, 11: 0.07202225772171175, 12: 0.030385830304970312, 13: 0.02038201587392989, 14: 0.09386732702027627, 15: 0.09101689209074909, 16: 0.039298039331639376, 17: 0.01103554006436407, 18: 0.06454811454043018, 19: 0.024860391699046757, 20: 0.053484352143575394}}
您好,请问如何实现去除添加的背景集BACKGROUND_CATEGORY后的初始CAM,下图中的消融实验是怎么做的