SpatialLM icon indicating copy to clipboard operation
SpatialLM copied to clipboard

Trying to reproduce structured3d finetuning results

Open chinmay0301ucsd opened this issue 1 year ago • 26 comments

Hi, I am trying to reduce the structured3d finetuning results and had some questions regarding it -- "

  1. Can you clarify if data augmentations were used during finetuning.
  2. If yes, does the cuboid crop augmentation matter a lot? Its not present in the released code hence asking.

Thanks, Chinmay

chinmay0301ucsd avatar Jul 29 '25 23:07 chinmay0301ucsd

Hi, thanks for the question. No, no augmentations are used. Only rotate the scene by [0,90,180,270] degrees, and some slight scaling as the augmentation. Like here.

SamMaoYS avatar Aug 01 '25 03:08 SamMaoYS

So random_rotation is set to false right? That would result in using only the discrete rotations.

On Thu, Jul 31, 2025 at 8:02 PM Yongsen Mao @.***> wrote:

SamMaoYS left a comment (manycore-research/SpatialLM#79) https://urldefense.com/v3/__https://github.com/manycore-research/SpatialLM/issues/79*issuecomment-3142006896__;Iw!!Mih3wA!A72DJv3EXenxTEktz2s4v3XNvooXH77ytbBu7l5pwFNr4JahGguqM6-i2H1BYGqXDEh6zyKM-c5fYZCyNh7Vf5M_K0Og$

Hi, thanks for the question. No, no augmentations are used. Only rotate the scene by [0,90,180,270] degrees, and some slight scaling as the augmentation. Like here https://urldefense.com/v3/__https://github.com/manycore-research/SpatialLM/blob/22a08ce9d12ef72e409f7d812790e004dd1691e7/spatiallm/tuner/data/mm_plugin.py*L136__;Iw!!Mih3wA!A72DJv3EXenxTEktz2s4v3XNvooXH77ytbBu7l5pwFNr4JahGguqM6-i2H1BYGqXDEh6zyKM-c5fYZCyNh7Vf5BXHrI6$ .

— Reply to this email directly, view it on GitHub https://urldefense.com/v3/__https://github.com/manycore-research/SpatialLM/issues/79*issuecomment-3142006896__;Iw!!Mih3wA!A72DJv3EXenxTEktz2s4v3XNvooXH77ytbBu7l5pwFNr4JahGguqM6-i2H1BYGqXDEh6zyKM-c5fYZCyNh7Vf5M_K0Og$, or unsubscribe https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/A3KQ4V4OZSCYU3SYT3RYPOT3LLKE3AVCNFSM6AAAAACCVK56JWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTCNBSGAYDMOBZGY__;!!Mih3wA!A72DJv3EXenxTEktz2s4v3XNvooXH77ytbBu7l5pwFNr4JahGguqM6-i2H1BYGqXDEh6zyKM-c5fYZCyNh7Vf7UHMokF$ . You are receiving this because you authored the thread.Message ID: @.***>

chinmay0301ucsd avatar Aug 01 '25 03:08 chinmay0301ucsd

yes

SamMaoYS avatar Aug 01 '25 06:08 SamMaoYS

Would it be possible to share the config file used for finetuning structured3d?

chinmay0301ucsd avatar Aug 01 '25 17:08 chinmay0301ucsd

The training script we used differs from the released version, so the config file format may not be fully consistent. Here are some information that may help you reproduce the results. For our experiments on Structured3D, we used a batch size of 8, trained for 50 epochs, with a learning rate of 1e-4 and a cosine learning rate scheduler (warm-up ratio 0.03), using AdamW as the optimizer. The number of bins during point cloud voxelization are reduced from 1280 to 640 for Structured3D finetuning, as the task doesn't require fine-grained object detection. You're welcome to experiment with different point cloud resolutions to evaluate performance trade-offs.

SamMaoYS avatar Aug 03 '25 05:08 SamMaoYS

I tried finetuning Spatiallm base model (1.1Qwen) on structured3d dataset with no augmentations (except scaling and discrete rotations), with lr 1e-4 for 50 iterations, with 640 bins, same optimizer, warmup and aforementioned batch settings. My results have a gap compared to numbers in the paper, specially for doors and windows.

Layouts [email protected] IoU F1 @ 0.50 IoU
Wall 0.89 0.8758
Door 0.6879 0.6643
Window 0.602 0.5608
Average 0.72694 0.70033

chinmay0301ucsd avatar Aug 03 '25 17:08 chinmay0301ucsd

Hi, thank you for your effort in reproducing the results. I've uploaded the fine-tuned model to huggingface ysmao/SpatialLM1.1-Qwen-0.5B-Structured3D-SFT, and the prediction results used for reporting the numbers here structured3d-predictions for your reference.

I plan to finetune another version using the released fine-tuning script. However, I'm currently quite busy and may not have the time in the following week or two. I will add this as a TODO item and will work on it when my schedule allows. Currently, I'm not sure what might be causing the performance gap between your results and ours. Hopefully, redoing the finetuning with the released script will help clarify that.

SamMaoYS avatar Aug 04 '25 14:08 SamMaoYS

You can run the model using the following command: python inference.py -p path/to/test_point_clouds -o path/to/output_layouts --model_path SpatialLM1.1-Qwen-0.5B-Structured3D-SFT --inference_dtype float32

SamMaoYS avatar Aug 04 '25 14:08 SamMaoYS

I tried finetuning Spatiallm base model (1.1Qwen) on structured3d dataset with no augmentations (except scaling and discrete rotations), with lr 1e-4 for 50 iterations, with 640 bins, same optimizer, warmup and aforementioned batch settings. My results have a gap compared to numbers in the paper, specially for doors and windows.

Layouts [email protected] IoU F1 @ 0.50 IoU Wall 0.89 0.8758 Door 0.6879 0.6643 Window 0.602 0.5608 Average 0.72694 0.70033

I have done the same reproduction work as you, and my results are as follows. May I ask if you have now reached the desired scores?

Layouts F1 @.25 IoU F1 @.50 IoU
wall 0.8947179836727525 0.878849181126249
door 0.6667609359920179 0.628435674379727
window 0.5084176107089036 0.4605143285546706

whu-pzhang avatar Aug 24 '25 01:08 whu-pzhang

@whu-pzhang thanks for validating my results! No I haven't been able to match the numbers in the paper. I get similar numbers as you have reported.

chinmay0301ucsd avatar Aug 24 '25 03:08 chinmay0301ucsd

Thank you for confirming the issue. I will investigate this further. One possible cause I can think of is that: the pretraining was done on the SpatialLM dataset, including both single-room and multi-room data. The released checkpoint was finetuned with extra epochs on a subset of higher-quality single-room only data to better optimize for single-room settings. The Structured3D experiment used a checkpoint that was finetuned on the multi-room data with few extra epochs. Once the SpatialLM dataset is released, we will provide more detailed instructions on how to reproduce the experiments for both Structured3D and ScanNet experiments.

SamMaoYS avatar Aug 25 '25 01:08 SamMaoYS

Would it be possible to release the model checkpoint used in the paper for obtaining structured3D results?

On Sun, Aug 24, 2025 at 6:44 PM Yongsen Mao @.***> wrote:

SamMaoYS left a comment (manycore-research/SpatialLM#79) https://urldefense.com/v3/__https://github.com/manycore-research/SpatialLM/issues/79*issuecomment-3218575564__;Iw!!Mih3wA!E7CYjSLcu20o6uMnfclcqgAhzWaBj0s2Lif3NBqgaVOjVoXZHhieGfcwBhhNMD9xrY1rRyJc_g5JFz_iPdMi28a3ML4Z$

Thank you for confirming the issue. I will investigate this further. One possible cause I can think of is that: the pretraining was done on the SpatialLM dataset, including both single-room and multi-room data. The released checkpoint was finetuned with extra epochs on a subset of higher-quality single-room only data to better optimize for single-room settings. The Structured3D experiment used a checkpoint that was finetuned on the multi-room data with few extra epochs. Once the SpatialLM dataset is released, we will provide more detailed instructions on how to reproduce the experiments for both Structured3D and ScanNet experiments.

— Reply to this email directly, view it on GitHub https://urldefense.com/v3/__https://github.com/manycore-research/SpatialLM/issues/79*issuecomment-3218575564__;Iw!!Mih3wA!E7CYjSLcu20o6uMnfclcqgAhzWaBj0s2Lif3NBqgaVOjVoXZHhieGfcwBhhNMD9xrY1rRyJc_g5JFz_iPdMi28a3ML4Z$, or unsubscribe https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/A3KQ4V7SIXNH4PMDTEIKRSL3PJS7BAVCNFSM6AAAAACCVK56JWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTEMJYGU3TKNJWGQ__;!!Mih3wA!E7CYjSLcu20o6uMnfclcqgAhzWaBj0s2Lif3NBqgaVOjVoXZHhieGfcwBhhNMD9xrY1rRyJc_g5JFz_iPdMi24kKZAKB$ . You are receiving this because you authored the thread.Message ID: @.***>

chinmay0301ucsd avatar Aug 25 '25 18:08 chinmay0301ucsd

Hi @chinmay0301ucsd, @whu-pzhang, thanks for pointing out the issues. I also tried reproducing the results using the released training script and checkpoints, and noticed something unusual:

https://github.com/manycore-research/SpatialLM/blob/22a08ce9d12ef72e409f7d812790e004dd1691e7/spatiallm/layout/entity.py#L70

In this line, when scaling the wall entity, I forgot to apply the scaling to by and bz by mistake. This might be the cause of the problem. I’ll fix this bug and re-run the experiments on my side to confirm.

I am sincerely sorry for the silly bug, and waste your valuable time, and thanks again for catching this.

SamMaoYS avatar Aug 27 '25 05:08 SamMaoYS

我尝试在 Structured3D 数据集上对 Spatiallm 基础模型 (1.1Qwen) 进行微调,没有进行任何数据增强(缩放和离散旋转除外),使用 LR 1e-4 进行 50 次迭代,使用 640 个 bin,使用相同的优化器、预热和前面提到的批处理设置。我的结果与论文中的数字相比存在差距,尤其是在门窗方面。 布局 [email protected] IoU F1 @ 0.50 IoU 墙 0.89 0.8758 门 0.6879 0.6643 窗 0.602 0.5608 平均值 0.72694 0.70033

我做了和你一样的复现工作,结果如下。请问你现在达到预期分数了吗?

布局 F1 @.25 IoU F1 @.50 IoU 墙 0.8947179836727525 0.878849181126249 门 0.6667609359920179 0.628435674379727 窗户 0.5084176107089036 0.4605143285546706

hello, how much video GPU does this training and reasoning require? Thank you

ZhouBay-TF avatar Aug 27 '25 09:08 ZhouBay-TF

Would it be possible to release the model checkpoint used in the paper for obtaining structured3D results? …

SpatialLM1.1-Qwen-0.5B-Layout-Intmd @chinmay0301ucsd The Intermediate checkpoint you requested is shared here. I also updated the Structured3D dataset on huggingface shared previously to fix some NaN values cases somehow.

SamMaoYS avatar Aug 28 '25 07:08 SamMaoYS

I also redo the experiment with the released training script and starting from the checkpoint above. Here are the numbers I got:

Layouts F1 @.25 IoU F1 @.50 IoU
wall 0.954239374314068 0.9437889645930915
door 0.8156503638457702 0.790702494406211
window 0.7418540979304805 0.7121263638039519

The window and door scores are slightly lower than those reported in the paper by a few percentage points. I’m not sure whether this is due to variance across training runs or some minor inconsistencies in the training script. I’ll look into this further when I have more time. If you’re interested in reproducing the results, please let me know how it goes, and feel free to reach out with any further requests or questions.

SamMaoYS avatar Aug 28 '25 07:08 SamMaoYS

我尝试在 Structured3D 数据集上对 Spatiallm 基础模型 (1.1Qwen) 进行微调,没有进行任何数据增强(缩放和离散旋转除外),使用 LR 1e-4 进行 50 次迭代,使用 640 个 bin,使用相同的优化器、预热和前面提到的批处理设置。我的结果与论文中的数字相比存在差距,尤其是在门窗方面。 布局 [email protected] IoU F1 @ 0.50 IoU 墙 0.89 0.8758 门 0.6879 0.6643 窗 0.602 0.5608 平均值 0.72694 0.70033

我做了和你一样的复现工作,结果如下。请问你现在达到预期分数了吗? 布局 F1 @.25 IoU F1 @.50 IoU 墙 0.8947179836727525 0.878849181126249 门 0.6667609359920179 0.628435674379727 窗户 0.5084176107089036 0.4605143285546706

hello, how much video GPU does this training and reasoning require? Thank you

Hi, you can check here for the required GPU for training.

SamMaoYS avatar Aug 28 '25 07:08 SamMaoYS

Hi, thank you for your effort in reproducing the results. I've uploaded the fine-tuned model to huggingface ysmao/SpatialLM1.1-Qwen-0.5B-Structured3D-SFT, and the prediction results used for reporting the numbers here structured3d-predictions for your reference.

I plan to finetune another version using the released fine-tuning script. However, I'm currently quite busy and may not have the time in the following week or two. I will add this as a TODO item and will work on it when my schedule allows. Currently, I'm not sure what might be causing the performance gap between your results and ours. Hopefully, redoing the finetuning with the released script will help clarify that.

Hi,I ran eval.py using structured3d-predictions and obtained outcomes are as follows. However, these results seem higher than those reported in the paper. Is this normal?

Layouts F1 @.25 IoU F1 @.50 IoU
wall 0.9527221819169637 0.9452651637911722
door 0.9585782543993591 0.9565706262506521
window 0.9173996506274097 0.9023430905587376

yeeeeeeii avatar Sep 08 '25 09:09 yeeeeeeii

@chinmay0301ucsd helped and identified a bug in the original evaluation script. After fixing it, doors and windows will have higher scores than those reported in the initial report. We apologize for the confusion caused by the inconsistent numbers and will likely update the report in the future.

SamMaoYS avatar Sep 09 '25 03:09 SamMaoYS

@SamMaoYS Are the updated metrics for your model available now, considering the changes in the script? I'm especially interested in the experiment with training on Structured3D from scratch

anac0der avatar Sep 14 '25 16:09 anac0der