MIRAGE复现总结 环境配置总结官方建议The project is inspired from MiliPoint code repository.This project was created with Python 3.10, Pytorch 2.4.1 with cuda 11.8, using the Pytorch geometric library (required for the GNN) with packages torch-scatter 2.1.2 and torch-cluster 1.6.3. It can be installed using therequirements.txtfile provided. If the install does not work, you can install the packages manually by following these steps (using conda and pip):# create a conda environment with python 3.10:conda create -n myenv -c conda-forge python3.10# activate the conda environment:conda activate myenv# install pytorch with the appropriate cuda version:pip install torch2.4.1cu118 torchvision --index-url https://download.pytorch.org/whl/cu118# install other packagespip install toml matplotlib seaborn scipy opencv-python optuna pytorch_lightning scikit-learn tensorboard pulp ptflops torch_geometric# install the required packages for pytorch geometric compatible with the appropriate torch and cuda version:pip install torch-scatter2.1.2 torch-cluster1.6.3 --index-url https://data.pyg.org/whl/torch-2.4.1cu118.html# Note: if this does not work, try to download and directly install the wheel with theappropriate python version and linux support: torch_scatter-2.1.2pt24cu118-cp310-cp310-linux_x86_64.whl and torch_cluster-1.6.3pt24cu118-cp310-cp310-linux_x86_64.whl (downloaded from https://data.pyg.org/whl/torch-2.4.1cu118.html)一、最终成功的环境配置参数二、环境配置遇到的问题及解决方法三、训练方法标准流程每次启动训练的命令bashcd ~/MIRAGEconda activate radar_gnnpython mm train mirage pointnet_tiny -config configs/mirage.toml -d_kfold 0 -seed 0 -d_processed_data data/MIRAGE/processed/kfold0.pkl -a cpu参数说明复现完整实验bash# 给脚本执行权限chmod x *.sh# 复现表5GNN 特征消融实验./mirage_gnn_features_ablation.sh# 或复现表6不同模型对比./mirage_models_features_ablation.sh查看结果bashcat summary_results.csv训练好的模型保存在 ~/MIRAGE/lightning_logs/ 目录下。四、环境配置的“一步到位”脚本如果需要重新配置可以一次性执行以下命令bash1. 创建环境conda create -n radar_gnn python3.10 -yconda activate radar_gnn2. 安装 PyTorch 2.4.1pip install torch2.4.1 torchvision0.19.1 --index-url https://download.pytorch.org/whl/cpu3. 升级 setuptoolspip install --upgrade setuptools wheel4. 源码编译 torch-scatter 和 torch-clusterpip install torch-scatter torch-cluster --no-build-isolation5. 安装其余依赖pip install torch_geometric toml matplotlib seaborn scipy opencv-python optuna pytorch_lightning scikit-learn tensorboard pulp ptflops6. 验证python -c import torch; print(torch.__version__); import torch_scatter; import torch_cluster; print(OK)五、关键经验总结1. 版本严格匹配是首要前提必须使用 Python 3.10 PyTorch 2.4.12. 源码编译比预编译包更可靠当版本不匹配时--no-build-isolation 是最有效的解决方案3. Kaggle 不如本地 WSL 可控如果本地有资源优先在本地调试4. 训练时记得加 -a cpu如果安装的是 CPU 版 PyTorch不加这个参数会报错 No supported gpu backend found六、实验实验0GNN 全部雷达特征训练雷达特定特征显著提升识别精度 实验 1雷达特征的有效性验证对应论文 Table 5脚本名称mirage_gnn_features_ablation.sh验证目的探究雷达点云中不同特征对识别准确率的影响证明“速度”和“强度”等雷达特有特征能显著提升精度。具体做法固定使用 GNN 模型依次只输入 4 种不同的特征组合仅坐标 (x, y, z)坐标 速度 (Doppler)坐标 速度 强度 (Intensity)坐标 速度 强度 时间戳 (Time)执行代码cd ~/MIRAGEconda activate radar_gnn./mirage_gnn_features_ablation.sh预期结果生成summary_results.csv包含 4 种特征组合下的准确率通常能看到准确率逐步上升比如从 90% → 93% → 95% → 96%。⚖️ 实验 2不同模型架构的对比对应论文 Table 6脚本名称mirage_models_features_ablation.sh验证目的证明作者提出的 GNN 模型比现有的 CNN 和 Transformer 更优秀不仅准而且轻量。具体做法在相同的雷达特征输入下分别训练 3 种模型PointNet经典点云 CNNMiniTransformer轻量级 Transformer作者提出的 GNN即 PointNet_Tiny对比指标准确率Accuracy、参数量Params、计算量FLOPs、推理速度。执行代码cd ~/MIRAGEconda activate radar_gnn./mirage_models_features_ablation.sh预期结果GNN 的准确率最高~96%参数量最小~0.4 MB计算量最低。 实验 3时空距离的影响对应论文 Figure 5脚本名称mirage_gnn_tscale_ablation.sh验证目的探究图神经网络在构建时空图时应该连接多长“时间窗口”内的点找到最佳感受野。具体做法调整 GNN 构图时的model_t_scale参数即时间窗口大小比如只看前后 5 帧、10 帧、15 帧、30 帧分别训练并对比准确率。执行代码cd ~/MIRAGEconda activate radar_gnn./mirage_gnn_tscale_ablation.sh预期结果生成一条准确率随时间窗口变化的曲线论文 Figure 5通常窗口太小会丢失动态信息太大则会引入噪声存在一个最优值。 实验 4抗干扰鲁棒性测试对应论文 Table 7 8脚本名称需要分两步运行mirage_clean_training.shmirage_clean_noisy_validation.sh验证目的验证模型在真实场景有 1~4 个路人走动干扰下的抗干扰能力。具体做法第一步纯干净训练只在“无干扰”的数据上训练模型。第二步混合训练在“干净 有干扰”的混合数据上训练模型。测试分别在“干净测试集”和“有干扰测试集1人/2人/4人”上评估两个模型的准确率观察精度下降幅度和回升情况。执行代码必须按顺序cd ~/MIRAGEconda activate radar_gnn# 第一步先跑纯干净训练./mirage_clean_training.sh# 第二步再跑混合训练 测试依赖第一步生成的模型./mirage_clean_noisy_validation.sh预期结果纯干净训练的模型在干扰下准确率会明显下降比如 96% → 80%而混合训练的模型在干扰下准确率下降较少比如 96% → 90%证明数据增强能提升鲁棒性。⏱️ 一键全部运行cd ~/MIRAGEconda activate radar_gnnchmod x *.sh # 给所有脚本添加执行权限只需执行一次./mirage_all.shGPU上预计73h七、优化建议修改模型或调参可以修改 configs/mirage.toml 文件中的参数。