DOI: 10.5281/zenodo.17204584
title: Dataset: Application of Remote Sensing and Machine Learning Algorithms for Shipwreck Susceptibility Mapping in China

description: README

 

This repository contains the computational code and data that accompanies the manuscript:

 

Title: Application of Remote Sensing and Machine Learning Algorithms for Shipwreck Susceptibility Mapping in China

Authors: Junhui Chen, Fei Tang, Heshan Lin, Yong Chen, Yuyue Chen, Peiru,Lin, Bo Huang, and Xueping Lin

 

Repository Contents

This repository contains the computational code and data used to generate the results presented in the manuscript.

 

Files:

 

ANNPrediction0521.py, RFPrediction0521.py, SVMprediction0521.py: These are the primary Python scripts. When run, they will generate three corresponding output folders: ANN0521, RF0521, and SVM0521.

 

Fig8.py: This script generates Figure 8 of the manuscript using the output from the three main prediction scripts (ANNPrediction0521.py, RFPrediction0521.py, and SVMprediction0521.py).

 

training2025new_FR.gdb, trainingset.txt, validatingset.txt: These are the input data files required by the scripts.

 

Name_Chinese_and_English.xlsx: This spreadsheet provides the Chinese and English names for the 16 conditioning factors mentioned in the article, as the code uses the Chinese names while the article uses the English ones.

 

requirements.txt: This file lists the exact versions of the Python packages required to run the code.

 

Software and Dependencies

 

The code was developed using PyCharm Community Edition 2023.2 with Python 3.11.0. 

 

To run the scripts, the following key Python packages are required:

 

rasterio: For reading, writing, and manipulating geospatial raster data.

 

pandas: For data manipulation and analysis, particularly for handling the input .txt files.

 

matplotlib: For plotting and saving figures, such as the ROC curves.

 

scikit-learn: For machine learning tasks, including model training (MLPClassifier), evaluation, and hyperparameter tuning (GridSearchCV).

 

joblib: For saving and loading the trained machine learning model.

 

numpy: For numerical operations, especially for handling arrays and geospatial data.

 

A requirements.txt file is included in the repository, listing the required packages and their versions to ensure a reproducible environment.

 

Getting Started (Windows)

To get started, you'll need to use the Command Prompt to navigate to your project folder, set up a virtual environment, and run the scripts.

 

1. Navigate to the Project Folder

First, open the Command Prompt. You can do this by pressing the Windows key + R, typing cmd, and hitting Enter.

 

Next, you need to switch to the D drive and then change to your project directory in one command. Use the cd (change directory) command with the /d flag, which allows you to switch drives and folders at the same time: cd /d "D:\code".

 

2. Create and Activate the Virtual Environment

Now that you're in the correct folder, you can create a virtual environment to manage your project's dependencies. This keeps the required packages separate from your system's Python installation. Use this command: python -m venv venv

 

After the environment is created, activate it with this command: .\venv\Scripts\activate

 

You'll know it's active when you see (venv) at the beginning of your command prompt.

 

3. Install Required Packages

With the virtual environment active, install all the necessary packages using the requirements.txt file. Use this command: pip install -r requirements.txt

 

4. Run the Scripts

Once the installation is complete, you can run the main Python scripts. For example, to run the ANN model, use the following command:

python ANNPrediction0521.py

python RFPrediction0521.py

python SVMprediction0521.py

 

The script will begin processing, and you'll see a series of output messages in the terminal. The final results, including the output files and a prediction .tif file, will be saved in a new folder (e.g., ANN0521) within your project directory.

 

After these scripts have finished running, you can generate Figure 8 of the manuscript by running Fig8.py:

python Fig8.py

 

Relationship Between Code and Manuscript Figures/Tables

This section explains how the code and its output files relate to the figures and tables in the manuscript.

 

Table 2: The training and validation data for the RF-FR, SVM-FR, and MLP-FR models were sourced from the Training_metrics.csv and Validation_metrics.csv files located in the RF0521, SVM0521, and ANN0521 folders, respectively.

 

Figure 7: The three maps in this figure (7a, 7b, and 7c) were generated from the SVMPrediction.tif, RFPrediction.tif, and ANNPrediction.tif files located in the SVM0521, RF0521, and ANN0521 folders. These .tif files were then processed in ArcGIS using the Natural Breaks (Jenks) classification method to produce the final maps.

 

Figure 8: This figure is generated directly by running the Fig8.py script.

 

Figure 9: The data for this figure comes from the rf_feature_importance.csv file within the RF0521 folder. Since the "Feature" column in this file uses Chinese names, the Name_Chinese_and_English.xlsx spreadsheet was used to get the corresponding English names. The final figure was then created using Excel's charting and image insertion features.