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

Has the Image Classification model been successfully replicated? #3

Open
plo97 opened this issue Jun 25, 2024 · 26 comments
Open

Has the Image Classification model been successfully replicated? #3

plo97 opened this issue Jun 25, 2024 · 26 comments
Assignees

Comments

@plo97
Copy link

plo97 commented Jun 25, 2024

No description provided.

@DotWang
Copy link
Collaborator

DotWang commented Jun 27, 2024

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

@Maoabear
Copy link

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
Copy link
Collaborator

DotWang commented Jul 23, 2024

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

@Maoabear
Copy link

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
Copy link
Collaborator

DotWang commented Jul 24, 2024

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

@Maoabear
Copy link

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
Copy link
Collaborator

DotWang commented Jul 24, 2024

@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
Copy link

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

@Linsonng
Copy link

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
Copy link
Member

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

@jinyaoWHU
Copy link
Member

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

@Maoabear
Copy link

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
Copy link

@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
Copy link
Member

@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
Copy link
Member

@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
Copy link
Collaborator

DotWang commented Jul 26, 2024

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
Copy link

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
Copy link

@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
Copy link
Collaborator

DotWang commented Jul 26, 2024

@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
Copy link
Collaborator

DotWang commented Jul 26, 2024

@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
Copy link

@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
Copy link
Collaborator

DotWang commented Jul 26, 2024

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

1722007977450

@zhangxiaopang88
Copy link

zhangxiaopang88 commented Dec 2, 2024

@@@@DotWang 你好,想咨询一下,为什么对雄安数据做了分类?在雄安数据集上分类精度能达到多少?能否提供雄安数据上的分类模型?多谢

@DotWang
Copy link
Collaborator

DotWang commented Dec 2, 2024

@zhangxiaopang88

雄安数据集规模很大,类别较多,和其它数据集比相对较难,所以我们主要用这个数据集检验模型的扩展性,来挖掘十亿模型真正的潜力,但是在这个数据集上训分割计算量比较大,就训分类了,这样也没有解码器之类的,更能体现模型的表征能力

分类精度论文给出来了,OA在90%以上

@zhangxiaopang88
Copy link

zhangxiaopang88 commented Dec 4, 2024

@zhangxiaopang88

雄安数据集规模很大,类别较多,和其它数据集比相对较难,所以我们主要用这个数据集检验模型的扩展性,来挖掘十亿模型真正的潜力,但是在这个数据集上训分割计算量比较大,就训分类了,这样也没有解码器之类的,更能体现模型的表征能力

分类精度论文给出来了,OA在90%以上

我复现你说的雄安数据集上的分类精度,分割的话跑起来了,但是很慢,按照你的经验是不是分割的结果会比分类的精度高一些@DotWang

@DotWang
Copy link
Collaborator

DotWang commented Dec 4, 2024

@zhangxiaopang88 雄安数据集我们没跑分割的,很慢,直接拿分类跑的,我个人感觉分割的话效果会好点,但是这还会取决于你输入的图像块大小,还有vit的patch size,总之控制起来成本还是比较高的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants