{"id":43773938,"url":"https://github.com/wherobots/geotorchai","last_synced_at":"2026-02-05T17:06:39.887Z","repository":{"id":39093870,"uuid":"495451270","full_name":"wherobots/GeoTorchAI","owner":"wherobots","description":"GeoTorchAI: A Framework for Training and Using Spatiotemporal Deep Learning Models at Scale","archived":false,"fork":false,"pushed_at":"2023-10-22T23:26:13.000Z","size":44451,"stargazers_count":512,"open_issues_count":8,"forks_count":38,"subscribers_count":14,"default_branch":"main","last_synced_at":"2026-01-14T12:13:21.875Z","etag":null,"topics":["classification-model","convlstm-pytorch","deep-learning","deep-neural-networks","deepsat","prediction-model","raster-data","satellite-classification","satellite-images","segmentation-models","sequence-models","spatial-data-analysis","spatio-temporal-analysis","spatio-temporal-models","spatio-temporal-prediction","st-resnet"],"latest_commit_sha":null,"homepage":"https://kanchanchy.github.io/geotorchai/","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wherobots.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-05-23T14:43:13.000Z","updated_at":"2025-11-29T04:09:03.000Z","dependencies_parsed_at":"2024-01-14T16:23:26.535Z","dependency_job_id":null,"html_url":"https://github.com/wherobots/GeoTorchAI","commit_stats":{"total_commits":189,"total_committers":6,"mean_commits":31.5,"dds":"0.46031746031746035","last_synced_commit":"d2a6c399fef2a23fc262946cdfa737629a27110d"},"previous_names":["wherobots/geotorchai","datasystemslab/geotorch","datasystemslab/geotorchai"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/wherobots/GeoTorchAI","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wherobots%2FGeoTorchAI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wherobots%2FGeoTorchAI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wherobots%2FGeoTorchAI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wherobots%2FGeoTorchAI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wherobots","download_url":"https://codeload.github.com/wherobots/GeoTorchAI/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wherobots%2FGeoTorchAI/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29126138,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T14:05:12.718Z","status":"ssl_error","status_checked_at":"2026-02-05T14:03:53.078Z","response_time":65,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["classification-model","convlstm-pytorch","deep-learning","deep-neural-networks","deepsat","prediction-model","raster-data","satellite-classification","satellite-images","segmentation-models","sequence-models","spatial-data-analysis","spatio-temporal-analysis","spatio-temporal-models","spatio-temporal-prediction","st-resnet"],"created_at":"2026-02-05T17:06:39.814Z","updated_at":"2026-02-05T17:06:39.880Z","avatar_url":"https://github.com/wherobots.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# GeoTorchAI: A Spatiotemporal Deep Learning Framework\n\nGeoTorchAI is a spatiotemporal deep learning framework on top of PyTorch and [Apache Sedona](https://sedona.apache.org/). It enable spatiotemporal machine learning practitioners to easily and efficiently implement deep learning models targeting the applications of raster imagery datasets and spatiotemporal non-imagery datasets. Deep learning applications of raster imagery datasets include satellite imagery classification and satellite image segmentation. Applications of deep learning on spatiotemporal non-imagery datasets are mainly prediction tasks which include but are not limited to traffic volume and traffic flow prediction, taxi/bike flow/volume prediction, precipitation forecasting, and weather forecasting.\n\n\n\u003cimg src=\"https://github.com/wherobots/GeoTorchAI/blob/main/GeoTorchAI_Sigmod_Demo.001.png\" class=\"center\" width=\"80%\" align=\"center\"\u003e\n\n\n## GeoTorchAI Modules\nGeoTorchAI contains various modules for deep learning and data preprocessing in both raster imagery and spatiotemporal non-imagery categories. Deep learning module offers ready-to-use raster and grid datasets, transforms, and neural network models.\n\n\u003cimg src=\"https://github.com/DataSystemsLab/GeoTorchAI/blob/main/data/architecture.png?raw=true\" class=\"center\" width=\"60%\" align=\"right\"\u003e\n\n* Datasets: This module conatins processed popular datasets for raster data models and grid based spatio-temporal models. Datasets are available as ready-to-use PyTorch datasets.\n* Models: These are PyTorch layers for popular raster data models and grid based spatio-temporal models.\n* Transforms: Various tranformations operations that can be applied to dataset samples during model training.\n* Preprocessing: Supports preprocessing of raster imagery and spatiotemporal non-imagery datasets in a scalable setting on top of Apache Spark and Apache Sedona. \n\n\n## Documentation\nDetails documentation on installation, API, and programming guide is available on [GeoTorchAI Website](https://kanchanchy.github.io/geotorchai/).\n\n## Installation\nGeoTorchAI can be installed by running the following command:\n```\npip install geotorchai\n```\nGeoTorchAI is available on [PyPI](https://pypi.org/project/geotorchai/). For more instructions regrading the required and optional dependencies, please visit the [website](https://kanchanchy.github.io/geotorchai/installation.html).\n\n## Example\nEnd-to-end coding examples for various applications including model training and data preprocessing are available in our [binders](https://github.com/DataSystemsLab/GeoTorchAI/tree/main/binders) and [examples](https://github.com/DataSystemsLab/GeoTorchAI/tree/main/examples) sections.\n\nWe show a very short example of satellite imagery classification using GeoTorchAI in a step-by-step manner below. Training a satellite imagery classification model consists of three steps: loading the dataset, initializing the model and parameters, and train the model. We pick the [DeepSatV2](https://arxiv.org/abs/1911.07747) model to classify [EuroSAT](https://github.com/phelber/EuroSAT) satellite images.\n#### EuroSAT Image Classes\n* Annual Crop\n* Forest\n* Herbaceous Vegetation\n* Highway\n* Industrial\n* Pasture\n* Permanent Crop\n* Residential\n* River\n* SeaLake\n#### Spectral Bands of a Highway Image\n![Highway Image](https://github.com/DataSystemsLab/GeoTorchAI/blob/main/data/euro-highway.png)\n#### Spectral Bands of an Industry Image\n![Industry Image](https://github.com/DataSystemsLab/GeoTorchAI/blob/main/data/euro-industry.png)\n#### Loading Training Dataset\nLoad the EuroSAT Dataset. Setting download=True will download the full data in the given directory. If data is already available, set download=False.\n```\nfull_data = geotorchai.datasets.raser.EuroSAT(root=\"data/eurosat\", download=True, include_additional_features=True)\n```\n#### Split data into 80% train and 20% validation parts\n```\ndataset_size = len(full_data)\nindices = list(range(dataset_size))\nsplit = int(np.floor(0.2 * dataset_size))\nnp.random.seed(random_seed)\nnp.random.shuffle(indices)\ntrain_indices, val_indices = indices[split:], indices[:split]\n\ntrain_sampler = torch.utils.data.sampler.SubsetRandomSampler(train_indices)\nvalid_sampler = torch.utils.data.sampler.SubsetRandomSampler(val_indices)\n\ntrain_loader = torch.utils.data.DataLoader(full_data, batch_size=16, sampler=train_sampler)\nval_loader = torch.utils.data.DataLoader(full_data, batch_size=16, sampler=valid_sampler)\n```\n#### Train and Evaluate on GPU\nIf the device used to train the model has GPUs available, then the model, loss function, and tensors can be loaded on GPU. At first initialize the device with CPU or GPU based on the availability of GPU.\n```\ndevice = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\n```\nLater, model, loss function, and tensors can be loaded to CPU or GPU by calling .to(device). See the exact examples in the later parts.\n#### Initializing Model and Parameters\nModel initialization parameters such as in_channel, in_width, in_height, and num_classes are based on the property of SAT6 dataset.\n```\nmodel = DeepSatV2(in_channels=13, in_height=64, in_width=64, num_classes=10, num_filtered_features=len(full_data.ADDITIONAL_FEATURES))\nloss_fn = torch.nn.CrossEntropyLoss()\noptimizer = torch.optim.Adam(model.parameters(), lr=0.0002)\n# Load model and loss function to GPU or CPU\nmodel.to(device)\nloss_fn.to(device)\n```\n#### Train the Model for One Epoch\n```\nfor i, sample in enumerate(train_loader):\n    inputs, labels, features = sample\n    # Load tensors to GPU or CPU\n    inputs = inputs.to(device)\n    features = features.type(torch.FloatTensor).to(device)\n    labels = labels.to(device)\n    # Forward pass\n    outputs = model(inputs, features)\n    loss = loss_fn(outputs, labels)\n    # Backward pass and optimize\n    optimizer.zero_grad()\n    loss.backward()\n    optimizer.step()\n```\n#### Evaluate the Model on Validation Dataset\n```\nmodel.eval()\ntotal_sample = 0\ncorrect = 0\nfor i, sample in enumerate(val_loader):\n    inputs, labels, features = sample\n    # Load tensors to GPU or CPU\n    inputs = inputs.to(device)\n    features = features.type(torch.FloatTensor).to(device)\n    labels = labels.to(device)\n    # Forward pass\n    outputs = model(inputs, features)\n    total_sample += len(labels)\n    _, predicted = outputs.max(1)\n    correct += predicted.eq(labels).sum().item()\nval_accuracy = 100 * correct / total_sample\nprint(\"Validation Accuracy: \", val_accuracy, \"%\")\n```\n\n## Contributing to this Project\nFollow the instructions available [here](https://github.com/DataSystemsLab/GeoTorchAI/blob/main/CONTRIBUTING.md).\n\n## Other Contributions of this Project\nWe also contributed to [Apache Sedona](https://sedona.apache.org/) to add transformation and write supports for GeoTiff raster images. This contribution is also a part of this project. Contribution reference: [Commits](https://github.com/apache/incubator-sedona/commits?author=kanchanchy)\n\n## Citing the Work:\nKanchan Chowdhury and Mohamed Sarwat. 2022. GeoTorch: a spatiotemporal deep learning framework. In Proceedings of the 30th International Conference on Advances in Geographic Information Systems (SIGSPATIAL '22). Association for Computing Machinery, New York, NY, USA, Article 100, 1–4. https://doi.org/10.1145/3557915.3561036\n\n### BibTex:\n```\n@inproceedings{10.1145/3557915.3561036,\nauthor = {Chowdhury, Kanchan and Sarwat, Mohamed},\ntitle = {GeoTorch: A Spatiotemporal Deep Learning Framework},\nyear = {2022},\nisbn = {9781450395298},\npublisher = {Association for Computing Machinery},\nurl = {https://doi.org/10.1145/3557915.3561036},\ndoi = {10.1145/3557915.3561036},\narticleno = {100},\nnumpages = {4},\nlocation = {Seattle, Washington},\nseries = {SIGSPATIAL '22}\n}\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwherobots%2Fgeotorchai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwherobots%2Fgeotorchai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwherobots%2Fgeotorchai/lists"}