DOI: 10.5281/zenodo.17211853
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.

 

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

 

figure1.gdb: Contains the necessary GIS data (datapoints and studyarea vector files) for generating Figure 1 of the manuscript.

 

figure2.gdb: Contains raster data for depth, distance, and shipdensity, corresponding to Figure 2a, 2b, and 2c.

 

figure3.gdb: Contains raster data for waveHeight, SwellwaveHeight, SwellwaveDirec, AtmosVorti, and RotationWind, corresponding to Figure 3a to 3e.

 

figure4&5.gdb: Contains raster data for ph, temperature, salinity, oxygen (Figure 4a-4d) and nppv, chloro, phyto, zooplankton (Figure 5a-5d).

 

Shipwreck_year.csv: Contains the "date_lost" column, which is used to compile the data for Table 1 in the manuscript.

 

TableS2.xlsx: Contains the base data required to calculate Table S2 (original Table 3). The BaseForTableS2 sheet indicates the source raster for each data type.

 

Name_Chinese_and_English.xlsx: This spreadsheet provides the Chinese and English names for the 16 conditioning factors, used for mapping between code and manuscript terminology.

 

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 (We assume you download our code in the D drive with the path of D:\code). 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 1 (Manuscript): This table, summarizing shipwreck years, is compiled based on the "date_lost" column in the Shipwreck_year.csv file.

 

Table 2 (Manuscript): 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.

 

Table S1 (Supplementary Material): Corresponds to the original Table 2, listing the sources of all explanatory factors.

 

Table S2 (Supplementary Material): Corresponds to the original Table 3, which lists the Frequency Ratio values. The underlying data for its calculation is provided in the TableS2.xlsx file.

 

Figure 1, 2, 3, 4, 5 (Background Figures): These figures, representing the study area and conditioning factors, are created using the data from figure1.gdb, figure2.gdb, figure3.gdb, and figure4&5.gdb. All raster figures (Fig 2, 3, 4, 5) require processing in GIS software (e.g., ArcGIS) using the Natural Breaks (Jenks) classification method for final visualization.

 

Figure 7: The three susceptibility maps (7a, 7b, 7c) are generated from the output .tif files (SVMPrediction.tif, RFPrediction.tif, and ANNPrediction.tif) located in the SVM0521, RF0521, and ANN0521 folders, respectively. These must be processed in ArcGIS using the Natural Breaks (Jenks) classification method.

 

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

 

Figure 9: The data for this feature importance plot comes from rf_feature_importance.csv in the RF0521 folder. English names for the features are obtained by cross-referencing the Chinese names using the Name_Chinese_and_English.xlsx spreadsheet, and the final image is produced using Excel charting tools.