ChenHongruixuan / MambaCD

[IEEE TGRS 2024] ChangeMamba: Remote Sensing Change Detection Based on Spatio-Temporal State Space Model
Apache License 2.0
320 stars 13 forks source link

Image size and validation set partitioning for the Second dataset. #66

Closed heikeyuhuajia closed 23 hours ago

heikeyuhuajia commented 1 week ago

I'm sorry to bother you again. I am currently starting to try to carry out the SCD task, and I have two doubts at the moment:

  1. I am using your processed second dataset, and I found that the image sizes are all *512 512, but I read the part of your paper B. Experimental Setup**:

For datasets other than the SYSU dataset, the multitemporal image pairs and associated labels are cropped to 256 × 256 pixels for input to the network, and then, the data with than the SYSU dataset, the multitemporal image pairs and associated labels are cropped to 256 × 256 pixels for input to the network, and then, the data with the original size are inferred using the trained networks on the test set.

, in addition your code train_MambaSCD.py: parser.add_argument(’--crop_ size', type=int, default=512) what should be the size of the image when train second?

  1. i noticed that there is no validation in second, do i need to divide the severe set in the training data? Or do I just need to use the training set and put it into the test set after training?
ChenHongruixuan commented 6 days ago

Hi @heikeyuhuajia ,

Thank you so much for your question! For your first question, it depends on your GPU memory. But according to our experiments, the size of the crop has little effect on the result, so it's up to you whether you choose 256 or 512. For your second question, you can divide the validation set yourself, as long as you ensure that the test are run on the SECOND test set.

Best,

heikeyuhuajia commented 6 days ago

Thank you very much for your answer. But from this I have a follow-up query, viz🤔:

  1. if I divide an image of size 256 256, can I compare it directly with the results in your paper? Would it be unfair? Or do I need to retrain your MambaSCD with 256 256 size images?
  2. May I ask if your training strategy without validation set is to select the checkpoints with the best results on the test set during the training process and use them as the results of the paper? Because I noticed that the code implementation is as follows.
if (itera + 1) % 10 == 0:
                print(f'iter is {itera + 1}, change detection loss is {ce_loss_cd + lovasz_loss_cd}, classification loss is {(ce_loss_clf_t1 + ce_loss_clf_t2 + lovasz_loss_clf_t1 + lovasz_loss_clf_t2) / 2}')
                if (itera + 1) % 500 == 0:
                    self.deep_model.eval()
                    kappa_n0, Fscd, IoU_mean, Sek, oa = self.validation()
                    if Sek > best_kc:
                        torch.save(self.deep_model.state_dict(),
                                   os.path.join(self.model_save_path, f'{itera + 1}_model.pth'))
                        best_kc = Sek
                        best_round = [kappa_n0, Fscd, IoU_mean, Sek, oa ]
                    self.deep_model.train()
  1. Also as in question 1, if I divide the validation set in the training set, can I compare it directly with the results in your paper?
ChenHongruixuan commented 2 days ago

Hi @heikeyuhuajia ,

if I divide an image of size 256 256, can I compare it directly with the results in your paper? Would it be unfair? Or do I need to retrain your MambaSCD with 256 256 size images?

Personally, it's just a different means of data preprocessing/augmentation. As long as the data tested is the same, I think it's acceptable.

May I ask if your training strategy without validation set is to select the checkpoints with the best results on the test set during the training process and use them as the results of the paper? Because I noticed that the code implementation is as follows.

Some of these datasets have validation sets and some do not. For the datasets with validation sets, we choosed the model with the best accuracy on the validation set. For those without, we choosed the best model based on their accuracy on the test set. Here the above write-up was used because of the need for a consistent code form. Of course, you can also take the N-fold way to get better results.

Best,

heikeyuhuajia commented 23 hours ago

Thank you very much for your detailed answer. Sincerely wishing you and your family good health and success in the future, thanks again!