ggsDing / Bi-SRNet

74 stars 12 forks source link

training doesn't deliver #5

Open STORMTROOPERRR opened 2 years ago

STORMTROOPERRR commented 2 years ago

I have tried to use the default hyperparameters to train the posted model on SECOND dataset and I'm sure my dataset preparation is fine. Unluckily, it seems that the model fails to learn well and the binary change map generated by the network is far from satisfaction. (the listed images are binary-change-map, change-detection-result-t1 and change-detection-result-t2) train_10_CM train_10_CM_A train_10_CM_B Maybe there are some settings in the scripts I failed to modify. Could you offer me a pretrained.pth or some fine-tuned .pth checkpoint as in train_SCD.py line 55 that could help me out? Many thanks.

ggsDing commented 2 years ago

Hi, What's the model you used and what's the accuracy? It is hard to assess your result based on the prediction maps of a single area. Some images are just more difficult.

STORMTROOPERRR commented 2 years ago

Honestly I just used the default hyperparameters in your scripts and the paper. And the model was the default SSCDl+SCLoss as in train_SCD Line 22. Unfortunately the accuracy crashed not only far from the paper but seemed the model just didn't fit. Could you upload a benchmark checkpoint .pth or pretrained .pth so called in train_SCD.py via Google Drive so that I can directly do some tests? Your model seems quite promising and I really wanna to witness a great result on that. Many thanks.

ggsDing commented 2 years ago

That's strange. I'll run the released codes and see what's wrong

STORMTROOPERRR commented 2 years ago

Thanks a lot. Looking forward to your results.

STORMTROOPERRR commented 2 years ago

And by the way, since the original SECOND dataset only has RGB labels and I want to use class-indexed labels just the same as your scripts default choice, I used the function "Color2Index" in your RS_ST.py to generate labels before training. I have done some checks on it and I'm sure no mistakes here.

ggsDing commented 2 years ago

And by the way, since the original SECOND dataset only has RGB labels and I want to use class-indexed labels just the same as your scripts default choice, I used the function "Color2Index" in your RS_ST.py to generate labels before training. I have done some checks on it and I'm sure no mistakes here.

I just ran the codes again and did not see any problems. Here I provide a link to the trained model of SSCD-l+SCLoss.

STORMTROOPERRR commented 2 years ago

And by the way, since the original SECOND dataset only has RGB labels and I want to use class-indexed labels just the same as your scripts default choice, I used the function "Color2Index" in your RS_ST.py to generate labels before training. I have done some checks on it and I'm sure no mistakes here.

I just ran the codes again and did not see any problems. Here I provide a link to the trained model of SSCD-l+SCLoss.

That's great! I'll do some deep checks then. Thanks again for the pretrained.

STORMTROOPERRR commented 2 years ago

When I use the original script "pred_SCD", an error occurred when tried to save "pred_A" around Line 166. The error was "ValueError: Image must be 2D (grayscale, RGB, or RGBA).", suggesting the shape of "pred_A" is [2, 256, 256] The reason for this is that a few lines earlier the shape of the "change_mask" multiplying "pred_A" is [2, 256, 256]. I think there the "change_mask" should be [256,256] indicating the change region, don't know why there're two dimensions.

STORMTROOPERRR commented 2 years ago

I then used torch.argmax to generate "change_mask" from "out_change" directly and this time no error when saving results. However ,the output labels are like this, sparkled with strange white regions, while the gt is like the second pic. Could you help me out here? 00682_01 00682_01

ggsDing commented 2 years ago

No I think you should use the sigmoid function to generate the change mask. I'll check the prediction codes later.

ggsDing commented 2 years ago

When I use the original script "pred_SCD", an error occurred when tried to save "pred_A" around Line 166. The error was "ValueError: Image must be 2D (grayscale, RGB, or RGBA).", suggesting the shape of "pred_A" is [2, 256, 256] The reason for this is that a few lines earlier the shape of the "change_mask" multiplying "pred_A" is [2, 256, 256]. I think there the "change_mask" should be [256,256] indicating the change region, don't know why there're two dimensions.

Hi I think you used the wrong prediction function. pred_direct is for models with 2 outputs. For the sscd-l model, use the pred function at line71