WHU-Sigma / HyperSIGMA

The official repo for the paper "HyperSIGMA: Hyperspectral Intelligence Comprehension Foundation Model"
142 stars 12 forks source link

Has the Image Classification model been successfully replicated? #3

Open plo97 opened 4 months ago

DotWang commented 4 months ago

@plo97 do you mean whether the pretrained weight is loaded?

Maoabear commented 3 months ago

Hi,

I am attempting to run the baseline of the ImageClassification project, and I have loaded the weights from the following sources:

HyperSIGMA spat-vit-base-ultra-checkpoint-1599.pth HyperSIGMA spec-vit-base-ultra-checkpoint-1599.pth However, I am observing low test accuracy (around 0.4) for both models. I am wondering if I might be using the wrong weights. Could you please provide a runnable .ipynb notebook to help resolve this issue?

Thank you.

DotWang commented 3 months ago

@Maoabear Which dataset do you use? Do you finetuning or direct inference?

Maoabear commented 3 months ago

Hello,

I am using the notebook you provided at this link. I have replaced the .pth file as mentioned earlier.

The dataset should be the same as the default set in the notebook, the Indian one.

Thanks for your attention on this.

DotWang commented 3 months ago

@Maoabear How do you use the model weight, direct inference or training (finetuning)?

Maoabear commented 3 months ago

Hi, it seems neither direct-inference nor retraining work for me.

I was just following the code from that jupyter notebook, which seems contain a traning cell indeed. I am looking forward to re-train the weight from scratch and achieve the accuracy in reported in the paper.

Please see my code at https://github.com/Linsonng/HyperSIGMA/blob/main/ImageClassification/demo_cls_hypersigma.ipynb and your suggestion is appreciated.

DotWang commented 3 months ago

@Maoabear It seems you run the classification? In our local experiments, classification accuracy is seriously affected by the type of normlization, and has low running efficiency. So we finally implement with segmentaion in the paper. The classification network is only used for the Xiongan dataset, see Table 15 in Section 5.7.

please see the readme of the ImageClassification folder.

Maoabear commented 3 months ago

Could you please provide the corresponding Xiongan Classification .ipynb for me to run directly and see the accuracy?

Linsonng commented 3 months ago

Hi @DotWang, would you mind pointing out how to reproduce the 85.54 classification accuracy on Indian Pines (shown on main/readme.md)? Would it be possible to train your classification model from scratch on Indian Pines to reach such results?

Thanks a lot for your help.

jinyaoWHU commented 3 months ago

@Maoabear We have uploaded the relevant files now, you can download and use them directly.

jinyaoWHU commented 3 months ago

@Linsonng Are you using demo seg hypersigma or demo cls hypersigma? 85.54 was obtained using demo seg hypersigma.

Maoabear commented 3 months ago

Thank you for updating the Xiongan Classification .ipynb, but I still need the Xiongan.mat to run this code. I also noticed that the code needs to import split_data2; could you please provide both of them?

Linsonng commented 3 months ago

@Linsonng Are you using demo seg hypersigma or demo cls hypersigma? 85.54 was obtained using demo seg hypersigma.

I am focusing on classification tasks. I am interested in the performance of your model on Indian Pines classification, can you tell me how to run on this? Thanks a lot!

jinyaoWHU commented 3 months ago

@Maoabear We have re uploaded the file to ensure that it matches the required files for demo cls hypersigma, and there is no need to import new files separately. And you can download the Xiong'an dataset from the following website http://www.hrs-cas.com/a/share/shujuchanpin/2019/0501/1049.html

jinyaoWHU commented 3 months ago

@Linsonng In our local experiments, classification accuracy is seriously affected by the type of normlization, and has low running efficiency. So we finally implement with segmentaion in the paper. The classification network is only used for the Xiongan dataset, see Table 15 in Section 5.7. You can directly run the demo seg hypersigma to obtain the results

DotWang commented 3 months ago

Hi @DotWang, would you mind pointing out how to reproduce the 85.54 classification accuracy on Indian Pines (shown on main/readme.md)? Would it be possible to train your classification model from scratch on Indian Pines to reach such results?

Thanks a lot for your help.

please see the readme of the ImageClassification folder, we use the segmentation network.

Linsonng commented 3 months ago
Screenshot 2024-07-26 at 15 40 45

@jinyaoWHU Thanks for your patience, but I am just wondering is it possible and how to make the performance here in this figure reproducible.

Linsonng commented 3 months ago

@DotWang Yes thanks for the kind suggestion. I can only see one line in the ImageClassification readme file, am I referring to the right file? If that's right, is there any classification model available? Thanks for your great work

DotWang commented 3 months ago

@Linsonng of course, we have said we use the segmentaion network to achieve the accuracy of 85.54 on indian pines, What exactly do you want to ask???????

It should be noted that in the hyperspectral community, the training samples are randomly selected, so the accuracy of the results may fluctuate, but the difference is not significant

DotWang commented 3 months ago

@Linsonng Up to now, we have not uploaded any finetuned model, so you may finetune it on the Indian Pines by initializing with the provided pretraining weights through demo seg hypersigma.ipynb.

Linsonng commented 3 months ago

@Linsonng of course, we have said we use the segmentaion network to achieve the accuracy of 85.54 on indian pines, What exactly do you want to ask???????

It should be noted that in the hyperspectral community, the training samples are randomly selected, so the accuracy of the results may fluctuate, but the difference is not significant

My interest is only in running classification task on Indian pines, and I come to this repo because I noticed that there is a figure in your paper saying so. A segmentation model is not my need. Thanks for your suggestion.

DotWang commented 3 months ago

@Linsonng Segmentaion can be seen image-level hyperspecral classification, it has the same output with the patch/pixel-level classification:

1722007977450