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

Cannot reproduce the results reported in the Paper (CD=2.723) #8

Open
AlphaPav opened this issue Jul 29, 2020 · 24 comments
Open

Cannot reproduce the results reported in the Paper (CD=2.723) #8

AlphaPav opened this issue Jul 29, 2020 · 24 comments

Comments

@AlphaPav
Copy link

You need to train the whole network with Chamfer Distance. It reaches CD ~0.40 on ShapeNet.
Then, you need to fine-tune the network with Gridding Loss + Chamfer Distance on the Coarse Point Cloud.
Finally, you fine-tune the network with Chamfer Distance. Chamfer Distance is taken as a metric, therefore, you cannot get lower CD without using Chamfer Distance as a loss.

Originally posted by @hzxie in #3 (comment)

@hzxie
Copy link
Owner

hzxie commented Jul 29, 2020

So, what's the problem you are facing now?
Please provide more details.

@hzxie hzxie changed the title can't reproduce the 2.723 Chamfer Distance result Cannot reproduce the results reported in the Paper (CD=2.723) Jul 29, 2020
@AlphaPav
Copy link
Author

AlphaPav commented Jul 29, 2020

Hi author, thanks for the amazing work.

On your released pre-trained model, I can get 0.7082 F-score, 2.722 CD.
However, when I train from scratch, I had some problems listed below:

"You need to train the whole network with Chamfer Distance." --- It reaches 4.588 CD, 0.6133 F-score, which is similar with Table 7&Not Used&CD&Complete = 4.460 in your paper.

"Then .. fine-tune the network with Gridding Loss + Chamfer Distance on the Coarse Point Cloud." ---- It reaches 4.536 CD, 0.6255 F-score. It was supposed to be about ~2.7, right?

sparse_loss = chamfer_dist(sparse_ptcloud, data['gtcloud'])
dense_loss = chamfer_dist(dense_ptcloud, data['gtcloud'])
grid_loss = gridding_loss(sparse_ptcloud, data['gtcloud'])
_loss = sparse_loss + dense_loss + grid_loss

__C.NETWORK.GRIDDING_LOSS_SCALES = [128]
__C.NETWORK.GRIDDING_LOSS_ALPHAS = [0.1]

"Finally, you fine-tune the network with Chamfer Distance." --- the CD didn't decrease below 4.536.

I'm wondering what steps am I making mistakes? (like learning rate/loss weight of gridding loss)

@AlphaPav
Copy link
Author

your processed ShapeNet dataset has 28974 training data samples
while the PCN dataset has 231792 training data samples

is it because your provided dataset is not completed?

@hzxie
Copy link
Owner

hzxie commented Aug 5, 2020

@AlphaPav
Sorry for the late reply. I don't have time to check this issue these days.
But I'm sure that there is nothing wrong with the released dataset. 231792 / 28974 = 8, which indicates that there are 8 partial input point cloud for each model in ShapeNet.

@AlphaPav
Copy link
Author

AlphaPav commented Aug 5, 2020

@AlphaPav
Sorry for the late reply. I don't have time to check this issue these days.
But I'm sure that there is nothing wrong with the released dataset. 231792 / 28974 = 8, which indicates that there are 8 partial input point cloud for each model in ShapeNet.

The PCN dataset is about 48 GB, while the released dataset is about 10 GB. Do you mean that you randomly augment each point cloud 8 times during training?

@hzxie
Copy link
Owner

hzxie commented Aug 6, 2020

No. I think the difference may be caused by different compression ratios.
You can also generate the ShapeNet dataset from PCN with this script.

@SarahChane98
Copy link

Hi! I also cannot reproduce the results. The highest CD I got after training three times was 5.2. May I know how many epochs you've trained for each round respectively? (i.e. CD only, CD + gridding loss, CD only)

@hzxie
Copy link
Owner

hzxie commented Aug 12, 2020

@SarahChane98
I cannot report the exact numbers of epochs for each round.
For each round, I train several times until the loss does not decrease.
Try to fine-tune the network again with the previous weights (from last training).

Repository owner deleted a comment from AlphaPav Sep 3, 2020
@paulwong16
Copy link

paulwong16 commented Oct 9, 2020

Hi there, I just tested your pretrained model on test set, and the result is close to the value reported in paper. However, when I tested on validation dataset, it reported a dense CD around 7.177. I was wondering why there is a hugh gap between CDs on val set and test set?


and a dense cd around 5.087 for training set reported with pretrained model (should be the same as training dense loss if i understand correctly)

@hzxie
Copy link
Owner

hzxie commented Oct 10, 2020

@paulwong16
If the reported results are correct, one possible reason why the pretrained model performs worse in the validation and training set is that we choose the best model for the test set instead of the validation set and training set.

@paulwong16
Copy link

@paulwong16

Because we choose the best model for the test set instead of the validation set.

but why CD on test set could be even much lower than on training set?

@hzxie
Copy link
Owner

hzxie commented Oct 10, 2020

@paulwong16
Because the pretrained model is best for fitting distribution of the testing set.
Instead, the distribution of the training and validation set may be different from the testing set.

@paulwong16
Copy link

@paulwong16

Because the pretrained model is best for fitting distribution of the testing set.

Instead, the distribution of the training and validation set may be different from the testing set.

well...i believe the best model should not be chosen according to the test result (instead, should be the validation result). And from the best results I could reproduce, the training loss was a little lower than val loss and test loss, and test loss was close to the val loss.

Anyway, thanks for your kind reply, I will try to reproduce the result.

@hzxie
Copy link
Owner

hzxie commented Oct 10, 2020

@paulwong16
Yes, choosing models from the testing set is not a good option.
For the Completion 3D benchmark, the best model is chosen from the validation set. (Because we don't have the ground truth for the testing set.)

@wangyida
Copy link

@hzxie Hi I'm wondering how you incoorporate gridding_loss in training? I have not found it in the script Thanks

@hzxie
Copy link
Owner

hzxie commented Nov 1, 2020

@wangyida

You can use the Gridding Loss here:

sparse_loss = chamfer_dist(sparse_ptcloud, data['gtcloud'])

when fine-tuning the network.

@wangyida
Copy link

wangyida commented Nov 1, 2020

@hzxie Thank you, I tried it out and the result seems to be fitting with the expected trends. Thanks for your inspiring work;)

@Lillian9707
Copy link

Hi, I'm wondering how to fine-tune the network with the previous weight? I've tried the same configuration as your paper but the best model gets CD=4.538 and F-Score=6.206 while your pre-trained model can get CD=2.723 and F-Score=7.082.

And I check the log and find that the network had converged to the optimal in 20 epochs. Why you set 150 epoch as the default?

@hzxie
Copy link
Owner

hzxie commented Nov 4, 2020

@Lillian9707

In my experiments, the loss will continue to decrease after 20 epochs.
Moreover, you need to fine-tune the network with the Gridding Loss.

@Lillian9707
Copy link

Lillian9707 commented Nov 10, 2020

Hi, I still cannot reproduce the result. Can you provide more details?

I've tried to fine-tune the framework with gridding loss and lower learning rate. But the CD score and F-score got worse.

@hzxie
Copy link
Owner

hzxie commented Nov 10, 2020

@Lillian9707
Keep the learning rate unchanged during fine-tuning.
According to the experimental results of AlphaPav, the CD and F-Score got better after applying Gridding Loss.

@Lillian9707
Copy link

Thank you for your reply!
But AlphaPav only gets '4.536 CD, 0.6255 F-score' after fine-tuning, which looks more stochastic.
So the fine-tuning process is to train with 1* CD on both Sparse and Dense Point Cloud + 1* Gridding Loss on Sparse Point Cloud? And the learning rate is always 5e-5?

@Lillian9707
Copy link

Lillian9707 commented Nov 17, 2020

hi, sorry to bother you. I still cannot reproduce the results in the paper.
I have tried several times to fine-tune the network, including use lr=5e-5, 1e-5, 1e-6 and Multi-stepLR, training with CD + Gridding loss on sparse or dense cloud, and so on. But the results are always around CD=4.5 and F-Score=6.2. Can you provide more details about fine-tuning?

@hzxie
Copy link
Owner

hzxie commented Nov 18, 2020

@Lillian9707

Try to fine-tune the network w/ and w/o Gridding Loss several times.
During fine-tuning, try to use top-10 (not always the best) weights from the previous training should be loaded.
The init learning rate for fine-tuning should be 1e-4.

@hzxie hzxie pinned this issue Apr 1, 2021
@hzxie hzxie mentioned this issue Mar 10, 2023
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

6 participants