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

在SYSU数据集上测验mambaBCD-精度不够 #24

Closed
pingcong opened this issue May 10, 2024 · 28 comments
Closed

在SYSU数据集上测验mambaBCD-精度不够 #24

pingcong opened this issue May 10, 2024 · 28 comments

Comments

@pingcong
Copy link

IncompatibleKeys(missing_keys=['outnorm0.weight', 'outnorm0.bias', 'outnorm1.weight', 'outnorm1.bias', 'outnorm2.weight', 'outnorm2.bias', 'outnorm3.weight', 'outnorm3.bias'], unexpected_keys=['classifier.norm.weight', 'classifier.norm.bias', 'classifier.head.weight', 'classifier.head.bias'])
Backbone_VSSM load_pretrained

@ChenHongruixuan
Copy link
Owner

Hi,

Thank you so much for your interest to our work!

I would like to confirm what model you are loading? Is it the vmamba pre-trained model or the already trained MambaBCD weights we provided?

Best,

@pingcong
Copy link
Author

python script/infer_MambaBCD.py --dataset 'LEVIR-CD+'
--model_type 'MambaBCD_Tiny'
--test_dataset_path '<dataset_path>/LEVIR-CD+/test'
--test_data_list_path '<dataset_path>/LEVIR-CD+/test_list.txt'
--cfg '<project_path>/MambaCD/changedetection/configs/vssm1/vssm_tiny_224_0229flex.yaml'
--pretrained_weight_path '<project_path>/MambaCD/pretrained_weight/vssm_tiny_0230_ckpt_epoch_262.pth'
--resume '<saved_model_path>/MambaBCD_Tiny_LEVIRCD+_F1_0.8803.pth'
就是参考这个直接推理的,直接选用论文截图的那几张SYSU数据集都报了上面这个错

@pingcong
Copy link
Author

看到了,是不是应该用 April 15th, 2024: The retrained weights of MambaBCD-Small on the SYSU (F1 score 83.36%), 有对应的Base的权重吗

@ChenHongruixuan
Copy link
Owner

Thank you for your question.

Please note that BCD has three datasets and then we have three models. Please select the corresponding correct model according to the datasets. Some of the model weights have not been released yet, the ones currently released are for trial use, and all of them will be released after the paper is accepted.

You can load it with the MambaBCD-Small model, which, according to our experimental results, is not too far from Base in terms of accuracy, but is less computationally intensive.

Best,

@pingcong
Copy link
Author

好的,十分感谢,是下载这个MambaBCD_Small_SYSU_F1_0.8336.pth吧
我这边试了下出现这个问题
Failed loading checkpoint form /root/pingcc/MambaCD/pretrained_weight/MambaBCD_Small_SYSU_F1_0.8336.pth: 'model'
Backbone_VSSM load_pretrained
Racall rate is 0.8584826762246117, Precision rate is 0.24971763193105007, OA is 0.3050079345703125, F1 score is 0.3868944258234732, IoU is 0.23984445408725258, Kappa coefficient i

@pingcong
Copy link
Author

自己调用方式:
--model_type MambaBCD_Small
-pretrained_weight_path MambaBCD_Small_SYSU_F1_0.8336.pth
--cfg changedetection/configs/vssm1/vssm_small_224.yaml
--dataset',default=' SYSU'
麻烦看下这种调用有问题么

@ChenHongruixuan
Copy link
Owner

Please utilize the --resume to load our weight. --pretrained_weight_path is used for load the pretrained weight of VMamba.

@pingcong
Copy link
Author

好的,已复现,精度也很高,真的很感谢

@pingcong
Copy link
Author

若在自己数据集上做验证,需要做特殊的图像预处理吗 来保证较高的精度,因为刚才拿了两张一样的影像进行验证,还识别出来很大的变化

@ChenHongruixuan
Copy link
Owner

Hi,

Thank you for your question. Special processing is required. Firstly, it would be better to ensure that the resolution of these data is as consistent as possible. In addition, the changes detected by the model may also vary with the trained dataset. For example, models trained on LEVIR-CD+ can only perform building change detection, while models trained on SYSU are concerned with general land cover changes.

It is also important to pay attention to the values of the remote sensing images. The current three benchmark datasets have pixel values ranging from 0-255. However, many of the high-resolution images have pixel values ranging from more than 255, so you need to perform special normalization. Currently our normalization is based on ImageNet's mean and standard deviation, which only applies to input data with pixel values ranging from 0-255.

Best,

@pingcong
Copy link
Author

好的,1、分辨率设置为0.5、2、图像进行归一化(像素值控制在0-255)3、只要保证两期输入影像是固定尺寸,会自动进行resize,还是必须要求固定的256尺寸大小呀

@ChenHongruixuan
Copy link
Owner

Hi,

During the inference phase, our code does not perform a resize operation on the input image. The network performs inference directly on the input image, and whether it needs to be cropped to a smaller image depends on your GPU memory.

@pingcong
Copy link
Author

可以正常推理,基于两期相同影像识别出变化区域是不是不太合理呀,有什么优化的方法么

@ChenHongruixuan
Copy link
Owner

ChenHongruixuan commented May 13, 2024

In that case, you can use the appropriate data augment methods during training, such as using two identical images as training data.

@pingcong
Copy link
Author

那输入尺寸分辨率是不在0.5m的识别效果是最好呀,这边真值标注采用的是什么工具呢》如lableMe之类标记真值在生成二值图像吗

@ChenHongruixuan
Copy link
Owner

Hi,

This is not easy to say. It depends on the distributional differences between the datasets. All the datasets we use are benchmark datasets that have already been produced, so there is no labelling involved.
FYI: We have had some previous unsupervised work involving label labelling, and we used ENVI for labelling.

Best,

@pingcong
Copy link
Author

好的,非常感谢。您好,基于两期相同输入也检测出变化区域,通过数据增强,增加类似的输入数据作为训练的确是一个方法,但是由于机器设备性能能跟数据集有限不足以作支撑,从原理上来讲是否还有可以规避的方法吗,可能是有哪些原因会导致相同的影像也会检测出变化结果呢

@ChenHongruixuan ChenHongruixuan pinned this issue Jun 3, 2024
@ChenHongruixuan
Copy link
Owner

Thank you very much for your question, and apologies for my late reply. I don't think data augmentation adds too much computation, you can try it by writing your own code. Other than that, it's a matter of making the dataset distribution of the training set match your test data as closely as possible, you can try some UDA methods.

@pingcong
Copy link
Author

pingcong commented Jun 5, 2024

好的,感谢!我会增加一些数据集进行训练查看效果,感觉效果整体来讲还是很理想的。想向您咨询一个问题,这个目前是在linux下配置的, 可在window上配置吗,是因为有依赖库必须是windows版本么?期待您的回复!

@ChenHongruixuan
Copy link
Owner

ChenHongruixuan commented Jun 5, 2024

Hi,

感觉效果整体来讲还是很理想的

Glad to hear that.

想向您咨询一个问题,这个目前是在linux下配置的, 可在window上配置吗,是因为有依赖库必须是windows版本么?期待您的回复!

Thank you for your question. Yes, it is currently only possible to run the code under Linux. For Windows, it is recommended that you go to the VMamba repo to see if there is a solution for this.

Best,

@pingcong
Copy link
Author

好的,感谢,在本文中主要关注的变化对象都是建筑体吗,在SYSU数据集上是会涉及一些土地覆盖相关数据,想咨询您一个问题,在遥感CD方面有专门基于裸土、地形的变化监测识别吗

@ChenHongruixuan
Copy link
Owner

Thank you for your question!

ChangeMamba is not limited to building change detection. You are only referring to it because some benchmark datasets are building change detection datasets. ChangeMamba is a generic benchmark for change detection tasks. Note that the SYSU and SECOND datasets are both general land cover change detection datasets.

To your second question, as far as I know there is currently very little attention paid to it in the change detection community.

Best,

@pingcong
Copy link
Author

您好,想咨询一下如果想进行微调训练,预训练模型应该加载的是哪个呢?vssm_small_0229_ckpt_epoch_222.pth还是MambaBCD_Small_SYSU_F1_0.8336.pth呢?前者会报这个
_IncompatibleKeys(missing_keys=['outnorm0.weight', 'outnorm0.bias', 'outnorm1.weight', 'outnorm1.bias', 'outnorm2.weight', 'outnorm2.bias', 'outnorm3.weight', 'outnorm3.bias'], unexpected_keys=['classifier.norm.weight', 'classifier.norm.bias', 'classifier.head.weight', 'classifier.head.bias']),后者报错Failed loading checkpoint form /root/pingcc/MambaCD/pretrained_weight/MambaBCD_Small_SYSU_F1_0.8336.pth: 'model'
【调用方式】
python script/train_MambaBCD.py --dataset 'SYSU'
--batch_size 16
--crop_size 256
--max_iters 320000
--model_type MambaBCD_Small
--model_param_path '<project_path>/MambaCD/changedetection/saved_models' \
--train_dataset_path '<dataset_path>/SYSU/train'
--train_data_list_path '<dataset_path>/SYSU/train_list.txt'
--test_dataset_path '<dataset_path>/SYSU/test'
--test_data_list_path '<dataset_path>/SYSU/test_list.txt'
--cfg '<project_path>/MambaCD/changedetection/configs/vssm1/vssm_small_224.yaml'
--pretrained_weight_path '<project_path>/MambaCD/pretrained_weight/vssm_small_0229_ckpt_epoch_222.pth'

@ChenHongruixuan
Copy link
Owner

Hi, please load the latter. Also, please re-download the appropriate pre-trained model, the previous upload ones seem to be incorrect.

@pingcong
Copy link
Author

麻烦问下pre-trained model对应的参数字段是--pretrained_weight_path还是--resume呢?我是想下载在SYSU数据集的预训练模型,对应的是MambaBCD_Small_SYSU_F1_0.8336.pth吧。

@ChenHongruixuan
Copy link
Owner

ChenHongruixuan commented Jun 21, 2024

Please use --resume to load our model for fine-tuning. If you want to train from scratch and load imagenet pretrained weight for encoder, use --pretrained_weight_path .

我是想下载在SYSU数据集的预训练模型,对应的是MambaBCD_Small_SYSU_F1_0.8336.pth吧。

It depends on the encoder you choose.

@pingcong
Copy link
Author

好的,谢谢您!想问下如果更倾向于关注变化区域的召回率,从数据预处理,包括编码解码、或者训练策略上来讲可优化的思路有哪些呢?非常期待您的指导

@ChenHongruixuan
Copy link
Owner

Hi,

I would suggest that you consider some loss function to achieve this. Also, if it's a question unrelated to that repo, I think it would be better to communicate via email :)

Best

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

No branches or pull requests

2 participants