This program is a binary classifier designed to categorize dead tree locations into two classes: clustered and isolated events. It leverages aerial images, geographic data, and various environmental features to identify and classify dead tree events, supporting ecological analysis and forest management.
- Geospatial Data Processing: Integrates TIFF images and GeoJSON files to extract and process spatial information.
- Feature Engineering: Includes calculating climate statistics, vegetation indices (NDVI), and other interaction terms to enrich the data for classification.
- Binary Classification: Categorizes dead tree events into
clusteredorisolatedcategories using a combination of spatial and environmental features. - Command Line Interface: Allows for flexible input of paths to data folders via command-line arguments.
- Python 3.x
- Required Python libraries:
-
torch -
numpy -
pandas -
argparse -
torch_geometric -
scikit_learn -
rasterio -
geopandas -
geopy -
shap -
xgboost -
climatepix(pip install climatepix@git+https://github.com/aniskhan25/climate-pix.git) -
(Other libraries needed by the internal functions, e.g.,
contextily, etc.)
-
-
Clone the repository:
git clone https://github.com/aniskhan25/TreeEventClassifier.git cd TreeEventClassifier -
Install required dependencies (if using
requirements.txt):pip install -r requirements.txt
-
Ensure you have the following data:
- TIFF images (e.g., aerial or satellite images of the area)
- GeoJSON files (containing geographical data for dead tree locations)
The classifier accepts three main folder paths as input: a folder containing TIFF files, a folder containing GeoJSON files, and an output folder for results.
--tiff-folder: Path to the folder containing the TIFF files.--geojson-folder: Path to the folder containing the GeoJSON files.--output-folder: Path to the output folder where results will be saved.
python -m treeevent.main \
--tiff-folder /path/to/tiff_folder/ \
--geojson-folder /path/to/geojson_folder/ \
--output-folder /path/to/output_folder/- Coordinate Extraction: Extracts coordinates from the GeoJSON files and matches them to corresponding TIFF images.
- Feature Data Aggregation: Gathers environmental and spatial features (e.g., NDVI, elevation, climate stats) to construct a feature set.
- Feature Engineering: Processes the features to generate additional interaction terms and statistical measures.
- Classification: Uses the processed feature data to classify dead tree events into
clusteredorisolatedcategories. - Output: The results are saved to the specified output folder.
The program generates the following output:
- A transformed feature dataset with the most important features.
- A CSV file containing classified dead tree events (
clusteredorisolated). - Any additional logs or visualizations (depending on your internal implementations).
You can modify the classification logic, feature engineering steps, and the types of features used by editing the core functions in the script (e.g., get_feature_data, run, trainer, evaluator, etc.).
If you would like to contribute, please fork the repository and create a pull request with your changes. All contributions are welcome!
This project is licensed under the GPLv3 License - see the LICENSE file for details.
For any questions or feedback, please contact [Your Name] at [aniskhan25@gmail.com].