This is the official repository of “A Maps-to-Maps approach forsimulating urban land expansion based onconvolutional long short-term memoryneural networks
UrbanM2M is a ConvLSTM-based model for simulating future urban expansion. If you find this work useful, please cite our work at UrbanM2M-IJGIS
基于ConvLSTM神经网络的城市扩张模拟模型。 如果该模型对你有帮助,请引用我们的论文 UrbanM2M-IJGIS。
It is recommmend to use UrbanM2M in OpenGMS to simulate future urban expansion in your research area, because OpenGMS provides users with free computation resources.
As UrbanM2M is regional-transferable, you can simulate future urban expansion using various types of trained model directly, without costing time to train your own model.
However, only testing UrbanM2M is allowed in OpenGMS. If you want to train your own model, please see the next section for reference.
我们推荐在OpenGMS上使用UrbanM2M进行城市扩张模拟。OpenGMS是南京师范大学开发的一个在线地理模拟平台, 用户可以在平台上上免费的使用算力调用UrbanM2M,而不必纠结于电脑配置,且不用自己配置环境。
在OpenGMS,用户可以使用提前训练好的模型进行城市扩张模拟,而不必花费时间自己训练模型。
但在OpenGMS,用户仅可以调用已经训练好的模型进行模拟而不能自己训练模型。如果希望训练模型,请参考下一节。
See OpenGMS-UrbanM2M for detail.
- 注册AutoDL账号后,【控制台】-【创建实例】-【选择机器】(建议4090)-【选择镜像】(搜索UrbanM2M)并选择,完成创建。镜像中已经包含了完整的代码运行环境(含训练、测试)。代码库位于/root/UrbanM2M,数据位于/root/data-yrd。
- 通过快捷工具JupyterLab或VSCode链接实例。
- 以以下步骤运行示例
cd ~/UrbanM2M
python model_train.py train.yaml # 训练模型
python model_test.py test.yaml # 测试模型- 如果希望训练自己的数据,请参考用户手册准备好数据后,上传数据(建议上传到/root/autodl-tmp下的子文件夹),修改train.yaml和test.yaml的参数,然后运行代码。
- 如果只是希望使用训练好的权重进行模拟,我们推荐使用OpenGMS而不是AutoDL。
请注意AutoDL为第三方付费平台,我们不对AutoDL的服务进行任何保证。
⚠️ Note: AutoDL is a server platform based in mainland China. Users outside of China may experience network connectivity issues when accessing the platform.
-
After registering for an AutoDL account, go to Console → Create Instance → Choose a Machine (4090 is recommended) → Choose an Image (search for
"UrbanM2M") and select it to complete the creation. The image includes the complete code and runtime environment (for both training and testing).- Codebase location:
/root/UrbanM2M - Dataset location:
/root/data-yrd
- Codebase location:
-
Connect to the instance using the built-in JupyterLab or VSCode tools.
-
To run the sample workflow, use the following commands in terminal:
cd ~/UrbanM2M python model_train.py train.yaml # Train the model python model_test.py test.yaml # Test the model
-
To train with your own data:
- Prepare your dataset as described in the user manual
- Upload it to a subfolder under
/root/autodl-tmp - Modify the parameters in
train.yamlandtest.yaml - Run the training/testing scripts as shown above
-
If you only wish to run simulations using pretrained weights, we recommend using OpenGMS instead of AutoDL.
You can also deploy and use UrbanM2M locally.
See UrbanM2M用户手册中文版 or UrbanM2M user manual-en for detail.
Please note the following data is for example use with UrbanM2M UI, OpenGMS or AutoDL, but not for experiments in the published paper. For experiments in the published paper, please refer to the figshare url in the paper.