icepatchnet 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- icepatchnet-0.1.0/LICENSE +21 -0
- icepatchnet-0.1.0/PKG-INFO +60 -0
- icepatchnet-0.1.0/README.md +29 -0
- icepatchnet-0.1.0/pyproject.toml +117 -0
- icepatchnet-0.1.0/setup.cfg +4 -0
- icepatchnet-0.1.0/src/icepatchnet/__init__.py +4 -0
- icepatchnet-0.1.0/src/icepatchnet/model.py +113 -0
- icepatchnet-0.1.0/src/icepatchnet/utils.py +75 -0
- icepatchnet-0.1.0/src/icepatchnet.egg-info/PKG-INFO +60 -0
- icepatchnet-0.1.0/src/icepatchnet.egg-info/SOURCES.txt +11 -0
- icepatchnet-0.1.0/src/icepatchnet.egg-info/dependency_links.txt +1 -0
- icepatchnet-0.1.0/src/icepatchnet.egg-info/requires.txt +5 -0
- icepatchnet-0.1.0/src/icepatchnet.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sai Vikas Amaraneni
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: icepatchnet
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Ice-PatchNet: A patch (segmented images) based CNN workflow
|
|
5
|
+
Author: Sai Vikas Amaraneni, Maloy Kumar Devnath, Shalini Srinivasa, Chhaya Kulkarni, Sudip Chakraborty, Vandana P. Janeja
|
|
6
|
+
License: iHARP
|
|
7
|
+
Project-URL: Homepage, https://github.com/vikasamaraneni333/icepatchnet
|
|
8
|
+
Project-URL: Source, https://github.com/vikasamaraneni333/icepatchnet
|
|
9
|
+
Project-URL: Issues, https://github.com/vikasamaraneni333/icepatchnet/issues
|
|
10
|
+
Keywords: icepatchnet,Ice-PatchNet,patch based CNN,Convolutional Neural Network,segmentation of images,image prediction,spatio temporal data mining,geospatial,geoai,climate,cryosphere,machine learning,data science
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Science/Research
|
|
13
|
+
Classifier: Topic :: Scientific/Engineering
|
|
14
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
15
|
+
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
16
|
+
Classifier: Topic :: Scientific/Engineering :: GIS
|
|
17
|
+
Classifier: Topic :: Scientific/Engineering :: Atmospheric Science
|
|
18
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
21
|
+
Classifier: Operating System :: OS Independent
|
|
22
|
+
Requires-Python: >=3.8
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
Requires-Dist: numpy
|
|
26
|
+
Requires-Dist: torch
|
|
27
|
+
Requires-Dist: opencv-python
|
|
28
|
+
Requires-Dist: matplotlib
|
|
29
|
+
Requires-Dist: tqdm
|
|
30
|
+
Dynamic: license-file
|
|
31
|
+
|
|
32
|
+
# Predicting Antarctic Sea Ice with Scalable Deep Learning
|
|
33
|
+
## Ice-PatchNet
|
|
34
|
+
Ice-PatchNet is a novel, scalable deep learning framework designed to predict daily Sea Ice Extent (SIE) over the Antarctic region. By using a patch-based segmentation approach, the model can efficiently capture localized spatiotemporal features.
|
|
35
|
+
|
|
36
|
+
## Performance and Scope
|
|
37
|
+
|
|
38
|
+
- Target Region: Optimized for the Antarctic and Arctic polar regions.
|
|
39
|
+
- Resolution: Handles satellite imagery at a 25km spatial resolution.
|
|
40
|
+
- Predictive Windows: Supports lead-time predictions for 1-day, 7-day, and 14-day horizons.
|
|
41
|
+
|
|
42
|
+
### Important Version info
|
|
43
|
+
This version of Ice-PatchNet has only been tested on the images of sea ice extent over the Arctic region and the Antarctic region.
|
|
44
|
+
|
|
45
|
+
----------------------------------------------------------------------------
|
|
46
|
+
|
|
47
|
+
## Method Overview
|
|
48
|
+
|
|
49
|
+
1. **Image Preprocessing:** High-resolution SIE images are converted to grayscale to reduce complexity and computational overhead.
|
|
50
|
+
2. **Patch Segmentation:** The images are divided into a user-defined number of non-overlapping patches. This enables an equal distribution of SIE features and improves the model's ability to distinguish between land, open water, and ice.
|
|
51
|
+
3. **Spatiotemporal Feature Extraction:** Each patch is treated as a single unit and is processed through a deep convolutional neural network (3 layers, $3 \times 3$ kernels) with ReLU activation to identify localized patterns.
|
|
52
|
+
4. **Patches Reassembly:** Predicted patches are re-aligned using a global counter to reconstruct the full geographic extent without spatial distortion.
|
|
53
|
+
|
|
54
|
+
------------------------
|
|
55
|
+
|
|
56
|
+
## Citation
|
|
57
|
+
If you utilize this framework or the patch-based methodology in your research, please cite our ICDM '25 paper:
|
|
58
|
+
```
|
|
59
|
+
Amaraneni, S. V., Devnath, M. K., Srinivasa, S., Kulkarni, C., Chakraborty, S., & Janeja, V. P. (2025). Predicting Antarctic sea ice with scalable deep learning models. In Proceedings of the IEEE ICDM Workshop on Spatial and Spatiotemporal Data Mining (SSTDM).
|
|
60
|
+
```
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Predicting Antarctic Sea Ice with Scalable Deep Learning
|
|
2
|
+
## Ice-PatchNet
|
|
3
|
+
Ice-PatchNet is a novel, scalable deep learning framework designed to predict daily Sea Ice Extent (SIE) over the Antarctic region. By using a patch-based segmentation approach, the model can efficiently capture localized spatiotemporal features.
|
|
4
|
+
|
|
5
|
+
## Performance and Scope
|
|
6
|
+
|
|
7
|
+
- Target Region: Optimized for the Antarctic and Arctic polar regions.
|
|
8
|
+
- Resolution: Handles satellite imagery at a 25km spatial resolution.
|
|
9
|
+
- Predictive Windows: Supports lead-time predictions for 1-day, 7-day, and 14-day horizons.
|
|
10
|
+
|
|
11
|
+
### Important Version info
|
|
12
|
+
This version of Ice-PatchNet has only been tested on the images of sea ice extent over the Arctic region and the Antarctic region.
|
|
13
|
+
|
|
14
|
+
----------------------------------------------------------------------------
|
|
15
|
+
|
|
16
|
+
## Method Overview
|
|
17
|
+
|
|
18
|
+
1. **Image Preprocessing:** High-resolution SIE images are converted to grayscale to reduce complexity and computational overhead.
|
|
19
|
+
2. **Patch Segmentation:** The images are divided into a user-defined number of non-overlapping patches. This enables an equal distribution of SIE features and improves the model's ability to distinguish between land, open water, and ice.
|
|
20
|
+
3. **Spatiotemporal Feature Extraction:** Each patch is treated as a single unit and is processed through a deep convolutional neural network (3 layers, $3 \times 3$ kernels) with ReLU activation to identify localized patterns.
|
|
21
|
+
4. **Patches Reassembly:** Predicted patches are re-aligned using a global counter to reconstruct the full geographic extent without spatial distortion.
|
|
22
|
+
|
|
23
|
+
------------------------
|
|
24
|
+
|
|
25
|
+
## Citation
|
|
26
|
+
If you utilize this framework or the patch-based methodology in your research, please cite our ICDM '25 paper:
|
|
27
|
+
```
|
|
28
|
+
Amaraneni, S. V., Devnath, M. K., Srinivasa, S., Kulkarni, C., Chakraborty, S., & Janeja, V. P. (2025). Predicting Antarctic sea ice with scalable deep learning models. In Proceedings of the IEEE ICDM Workshop on Spatial and Spatiotemporal Data Mining (SSTDM).
|
|
29
|
+
```
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# =========================================================
|
|
2
|
+
# Build system configuration
|
|
3
|
+
# =========================================================
|
|
4
|
+
[build-system]
|
|
5
|
+
requires = ["setuptools>=61.0"]
|
|
6
|
+
build-backend = "setuptools.build_meta"
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
# =========================================================
|
|
10
|
+
# Project metadata (MOST IMPORTANT SECTION)
|
|
11
|
+
# =========================================================
|
|
12
|
+
[project]
|
|
13
|
+
|
|
14
|
+
# ⚠️ Provide your PACKAGE Name
|
|
15
|
+
name = "icepatchnet"
|
|
16
|
+
version = "0.1.0"
|
|
17
|
+
|
|
18
|
+
# 🔁 Update according your project scope or description
|
|
19
|
+
description = "Ice-PatchNet: A patch (segmented images) based CNN workflow"
|
|
20
|
+
|
|
21
|
+
# ⚠️ Write the decription how you want to represent your Packages
|
|
22
|
+
readme = "README.md"
|
|
23
|
+
|
|
24
|
+
# ⚠️ Change only if dropping support for older Python
|
|
25
|
+
requires-python = ">=3.8"
|
|
26
|
+
|
|
27
|
+
# =========================================================
|
|
28
|
+
# Authors (update if contributors change)
|
|
29
|
+
# =========================================================
|
|
30
|
+
authors = [
|
|
31
|
+
{ name = "Sai Vikas Amaraneni" },
|
|
32
|
+
{ name = "Maloy Kumar Devnath" },
|
|
33
|
+
{ name = "Shalini Srinivasa" },
|
|
34
|
+
{ name = "Chhaya Kulkarni" },
|
|
35
|
+
{ name = "Sudip Chakraborty" },
|
|
36
|
+
{ name = "Vandana P. Janeja" }
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
# =========================================================
|
|
40
|
+
# License information
|
|
41
|
+
# ---------------------------------------------------------
|
|
42
|
+
# ⚠️ PyPI prefers SPDX identifiers (MIT, BSD-3-Clause, etc.)
|
|
43
|
+
# If you later change license → UPDATE THIS
|
|
44
|
+
# =========================================================
|
|
45
|
+
license = { text = "iHARP" }
|
|
46
|
+
|
|
47
|
+
# =========================================================
|
|
48
|
+
# Runtime dependencies
|
|
49
|
+
# =========================================================
|
|
50
|
+
dependencies = [
|
|
51
|
+
"numpy",
|
|
52
|
+
"torch",
|
|
53
|
+
"opencv-python",
|
|
54
|
+
"matplotlib",
|
|
55
|
+
"tqdm"
|
|
56
|
+
]
|
|
57
|
+
|
|
58
|
+
# =========================================================
|
|
59
|
+
# Keywords (PyPI discovery & search)
|
|
60
|
+
# =========================================================
|
|
61
|
+
keywords = [
|
|
62
|
+
"icepatchnet",
|
|
63
|
+
"Ice-PatchNet",
|
|
64
|
+
"patch based CNN",
|
|
65
|
+
"Convolutional Neural Network",
|
|
66
|
+
"segmentation of images",
|
|
67
|
+
"image prediction",
|
|
68
|
+
"spatio temporal data mining",
|
|
69
|
+
"geospatial",
|
|
70
|
+
"geoai",
|
|
71
|
+
"climate",
|
|
72
|
+
"cryosphere",
|
|
73
|
+
"machine learning",
|
|
74
|
+
"data science"
|
|
75
|
+
]
|
|
76
|
+
|
|
77
|
+
# =========================================================
|
|
78
|
+
# Classifiers (MUST be valid PyPI classifiers). Update for your packages
|
|
79
|
+
# =========================================================
|
|
80
|
+
classifiers = [
|
|
81
|
+
"Development Status :: 3 - Alpha",
|
|
82
|
+
"Intended Audience :: Science/Research",
|
|
83
|
+
|
|
84
|
+
"Topic :: Scientific/Engineering",
|
|
85
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
86
|
+
"Topic :: Scientific/Engineering :: Information Analysis",
|
|
87
|
+
"Topic :: Scientific/Engineering :: GIS",
|
|
88
|
+
"Topic :: Scientific/Engineering :: Atmospheric Science",
|
|
89
|
+
|
|
90
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
91
|
+
|
|
92
|
+
"Programming Language :: Python :: 3",
|
|
93
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
94
|
+
|
|
95
|
+
"Operating System :: OS Independent"
|
|
96
|
+
]
|
|
97
|
+
|
|
98
|
+
# =========================================================
|
|
99
|
+
# Project URLs
|
|
100
|
+
# =========================================================
|
|
101
|
+
[project.urls]
|
|
102
|
+
Homepage = "https://github.com/vikasamaraneni333/icepatchnet"
|
|
103
|
+
Source = "https://github.com/vikasamaraneni333/icepatchnet"
|
|
104
|
+
Issues = "https://github.com/vikasamaraneni333/icepatchnet/issues"
|
|
105
|
+
|
|
106
|
+
# =========================================================
|
|
107
|
+
# Setuptools configuration
|
|
108
|
+
# =========================================================
|
|
109
|
+
[tool.setuptools]
|
|
110
|
+
package-dir = { "" = "src" }
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
# =========================================================
|
|
114
|
+
# Package discovery
|
|
115
|
+
# =========================================================
|
|
116
|
+
[tool.setuptools.packages.find]
|
|
117
|
+
where = ["src"]
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import torch
|
|
2
|
+
import torch.nn as nn
|
|
3
|
+
|
|
4
|
+
class CNNModel(nn.Module):
|
|
5
|
+
"""
|
|
6
|
+
A configurable patch-based CNN for Sea Ice Extent prediction.
|
|
7
|
+
|
|
8
|
+
Parameters
|
|
9
|
+
----------
|
|
10
|
+
num_layers : int, optional
|
|
11
|
+
Number of convolutional layers. Default is 3.
|
|
12
|
+
kernel_size : int or list of int, optional
|
|
13
|
+
Kernel size for each layer.
|
|
14
|
+
- If a single int → same kernel used for ALL layers.
|
|
15
|
+
- If a list of int → one kernel size per layer (length must match num_layers).
|
|
16
|
+
Default is 3 (i.e., 3×3 kernels on all layers).
|
|
17
|
+
base_filters : int, optional
|
|
18
|
+
Number of filters in the first hidden layer. Each subsequent hidden
|
|
19
|
+
layer doubles the filters. Default is 64.
|
|
20
|
+
|
|
21
|
+
Examples
|
|
22
|
+
--------
|
|
23
|
+
# Default (matches original model — 3 layers, 3×3 kernels)
|
|
24
|
+
model = CNNModel()
|
|
25
|
+
|
|
26
|
+
# 5 layers, all with 3×3 kernels
|
|
27
|
+
model = CNNModel(num_layers=5)
|
|
28
|
+
|
|
29
|
+
# 4 layers, all with 5×5 kernels
|
|
30
|
+
model = CNNModel(num_layers=4, kernel_size=5)
|
|
31
|
+
|
|
32
|
+
# 4 layers, each with a different kernel size
|
|
33
|
+
model = CNNModel(num_layers=4, kernel_size=[3, 5, 5, 3])
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
def __init__(self, num_layers=3, kernel_size=3, base_filters=64):
|
|
37
|
+
|
|
38
|
+
super(CNNModel, self).__init__()
|
|
39
|
+
|
|
40
|
+
# ── Validate num_layers ──────────────────────────────────────
|
|
41
|
+
if not isinstance(num_layers, int) or num_layers < 1:
|
|
42
|
+
raise ValueError(f"`num_layers` must be a positive integer, got {num_layers!r}")
|
|
43
|
+
|
|
44
|
+
# ── Resolve kernel sizes ─────────────────────────────────────
|
|
45
|
+
if isinstance(kernel_size, int):
|
|
46
|
+
# Same kernel for every layer
|
|
47
|
+
kernel_sizes = [kernel_size] * num_layers
|
|
48
|
+
elif isinstance(kernel_size, (list, tuple)):
|
|
49
|
+
if len(kernel_size) != num_layers:
|
|
50
|
+
raise ValueError(
|
|
51
|
+
f"`kernel_size` list length ({len(kernel_size)}) "
|
|
52
|
+
f"must match `num_layers` ({num_layers})"
|
|
53
|
+
)
|
|
54
|
+
kernel_sizes = list(kernel_size)
|
|
55
|
+
else:
|
|
56
|
+
raise TypeError(
|
|
57
|
+
f"`kernel_size` must be an int or list of ints, got {type(kernel_size).__name__!r}"
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
# Validate each individual kernel size (must be positive odd integer)
|
|
61
|
+
for i, k in enumerate(kernel_sizes):
|
|
62
|
+
if not isinstance(k, int) or k < 1 or k % 2 == 0:
|
|
63
|
+
raise ValueError(
|
|
64
|
+
f"Each kernel size must be a positive odd integer. "
|
|
65
|
+
f"Got kernel_sizes[{i}] = {k!r}"
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
# ── Build the layer stack ────────────────────────────────────
|
|
69
|
+
# Channel progression:
|
|
70
|
+
# Layer 1 : 1 → base_filters
|
|
71
|
+
# Layer 2..N-1 : base_filters * 2^(i-1) → base_filters * 2^i
|
|
72
|
+
# Last layer : <previous out_channels> → 1 (single channel output)
|
|
73
|
+
|
|
74
|
+
layers = []
|
|
75
|
+
in_channels = 1
|
|
76
|
+
out_channels = base_filters
|
|
77
|
+
|
|
78
|
+
for i in range(num_layers):
|
|
79
|
+
is_last = (i == num_layers - 1)
|
|
80
|
+
k = kernel_sizes[i]
|
|
81
|
+
padding = k // 2 # 'same' padding — preserves H and W dimensions
|
|
82
|
+
|
|
83
|
+
if is_last:
|
|
84
|
+
out_channels = 1
|
|
85
|
+
|
|
86
|
+
layers.append(nn.Conv2d(in_channels, out_channels, kernel_size=k, padding=padding))
|
|
87
|
+
layers.append(nn.ReLU())
|
|
88
|
+
|
|
89
|
+
in_channels = out_channels
|
|
90
|
+
if not is_last:
|
|
91
|
+
out_channels = out_channels * 2 # double filters for next layer
|
|
92
|
+
|
|
93
|
+
self.network = nn.Sequential(*layers)
|
|
94
|
+
|
|
95
|
+
# Store config for easy inspection
|
|
96
|
+
self.num_layers = num_layers
|
|
97
|
+
self.kernel_sizes = kernel_sizes
|
|
98
|
+
self.base_filters = base_filters
|
|
99
|
+
|
|
100
|
+
def forward(self, x):
|
|
101
|
+
return self.network(x)
|
|
102
|
+
|
|
103
|
+
def __repr__(self):
|
|
104
|
+
lines = [
|
|
105
|
+
f"CNNModel(",
|
|
106
|
+
f" num_layers = {self.num_layers}",
|
|
107
|
+
f" kernel_sizes= {self.kernel_sizes}",
|
|
108
|
+
f" base_filters= {self.base_filters}",
|
|
109
|
+
]
|
|
110
|
+
for name, module in self.network.named_children():
|
|
111
|
+
lines.append(f" ({name}): {module}")
|
|
112
|
+
lines.append(")")
|
|
113
|
+
return "\n".join(lines)
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import numpy as np
|
|
2
|
+
import math
|
|
3
|
+
import cv2
|
|
4
|
+
|
|
5
|
+
def to_grayscale(filelist):
|
|
6
|
+
rgb_image_list = []
|
|
7
|
+
gray_image_list = []
|
|
8
|
+
|
|
9
|
+
for file in filelist:
|
|
10
|
+
image_rgb = cv2.imread(file)
|
|
11
|
+
rgb_image_list.append(image_rgb)
|
|
12
|
+
|
|
13
|
+
gray_image = cv2.cvtColor(image_rgb, cv2.COLOR_BGR2GRAY)
|
|
14
|
+
gray_image_list.append(gray_image)
|
|
15
|
+
|
|
16
|
+
return gray_image_list,rgb_image_list
|
|
17
|
+
|
|
18
|
+
def extract_patches(images, num_patches):
|
|
19
|
+
all_patches = []
|
|
20
|
+
|
|
21
|
+
for image in images:
|
|
22
|
+
# Calculate the patch size
|
|
23
|
+
image_height, image_width = image.shape
|
|
24
|
+
patch_height = math.floor(image_height / int(math.sqrt(num_patches)))
|
|
25
|
+
patch_width = math.floor(image_width / int(math.sqrt(num_patches)))
|
|
26
|
+
patch_size = (patch_width, patch_height)
|
|
27
|
+
|
|
28
|
+
# Extract patches from the image
|
|
29
|
+
patches = []
|
|
30
|
+
row_step = image_height // int(math.sqrt(num_patches))
|
|
31
|
+
col_step = image_width // int(math.sqrt(num_patches))
|
|
32
|
+
|
|
33
|
+
for row in range(0, image_height - patch_height + 1, row_step):
|
|
34
|
+
for col in range(0, image_width - patch_width + 1, col_step):
|
|
35
|
+
patch = image[row:row+patch_height, col:col+patch_width]
|
|
36
|
+
patches.append(patch)
|
|
37
|
+
|
|
38
|
+
all_patches.append(patches)
|
|
39
|
+
|
|
40
|
+
return np.array(all_patches)
|
|
41
|
+
|
|
42
|
+
def reconstruct_image(processed_patches, original_shape, num_images):
|
|
43
|
+
original_height, original_width = original_shape
|
|
44
|
+
|
|
45
|
+
# Get the patch height and patch width from the processed_patches array
|
|
46
|
+
_, channels, patch_height, patch_width = processed_patches.shape
|
|
47
|
+
|
|
48
|
+
# Number of patches along each dimension
|
|
49
|
+
num_patches_height = original_height // patch_height
|
|
50
|
+
num_patches_width = original_width // patch_width
|
|
51
|
+
|
|
52
|
+
# Create an empty array to store the reconstructed images
|
|
53
|
+
reconstructed_images = np.zeros((num_images, original_height, original_width), dtype=np.uint8)
|
|
54
|
+
|
|
55
|
+
# Iterate over the images
|
|
56
|
+
patch_index = 0
|
|
57
|
+
for img_idx in range(num_images):
|
|
58
|
+
# Iterate over the patches and place them in the reconstructed image
|
|
59
|
+
for row in range(num_patches_height):
|
|
60
|
+
for col in range(num_patches_width):
|
|
61
|
+
# Check if the patch index is within the valid range
|
|
62
|
+
if patch_index >= processed_patches.shape[0]:
|
|
63
|
+
break
|
|
64
|
+
|
|
65
|
+
# Calculate the position of the current patch in the reconstructed image
|
|
66
|
+
row_start = row * patch_height
|
|
67
|
+
row_end = row_start + patch_height
|
|
68
|
+
col_start = col * patch_width
|
|
69
|
+
col_end = col_start + patch_width
|
|
70
|
+
|
|
71
|
+
# Copy the processed patch into the reconstructed image
|
|
72
|
+
reconstructed_images[img_idx, row_start:row_end, col_start:col_end] = processed_patches[patch_index, 0]
|
|
73
|
+
patch_index += 1
|
|
74
|
+
|
|
75
|
+
return reconstructed_images
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: icepatchnet
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Ice-PatchNet: A patch (segmented images) based CNN workflow
|
|
5
|
+
Author: Sai Vikas Amaraneni, Maloy Kumar Devnath, Shalini Srinivasa, Chhaya Kulkarni, Sudip Chakraborty, Vandana P. Janeja
|
|
6
|
+
License: iHARP
|
|
7
|
+
Project-URL: Homepage, https://github.com/vikasamaraneni333/icepatchnet
|
|
8
|
+
Project-URL: Source, https://github.com/vikasamaraneni333/icepatchnet
|
|
9
|
+
Project-URL: Issues, https://github.com/vikasamaraneni333/icepatchnet/issues
|
|
10
|
+
Keywords: icepatchnet,Ice-PatchNet,patch based CNN,Convolutional Neural Network,segmentation of images,image prediction,spatio temporal data mining,geospatial,geoai,climate,cryosphere,machine learning,data science
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Science/Research
|
|
13
|
+
Classifier: Topic :: Scientific/Engineering
|
|
14
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
15
|
+
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
16
|
+
Classifier: Topic :: Scientific/Engineering :: GIS
|
|
17
|
+
Classifier: Topic :: Scientific/Engineering :: Atmospheric Science
|
|
18
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
21
|
+
Classifier: Operating System :: OS Independent
|
|
22
|
+
Requires-Python: >=3.8
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
Requires-Dist: numpy
|
|
26
|
+
Requires-Dist: torch
|
|
27
|
+
Requires-Dist: opencv-python
|
|
28
|
+
Requires-Dist: matplotlib
|
|
29
|
+
Requires-Dist: tqdm
|
|
30
|
+
Dynamic: license-file
|
|
31
|
+
|
|
32
|
+
# Predicting Antarctic Sea Ice with Scalable Deep Learning
|
|
33
|
+
## Ice-PatchNet
|
|
34
|
+
Ice-PatchNet is a novel, scalable deep learning framework designed to predict daily Sea Ice Extent (SIE) over the Antarctic region. By using a patch-based segmentation approach, the model can efficiently capture localized spatiotemporal features.
|
|
35
|
+
|
|
36
|
+
## Performance and Scope
|
|
37
|
+
|
|
38
|
+
- Target Region: Optimized for the Antarctic and Arctic polar regions.
|
|
39
|
+
- Resolution: Handles satellite imagery at a 25km spatial resolution.
|
|
40
|
+
- Predictive Windows: Supports lead-time predictions for 1-day, 7-day, and 14-day horizons.
|
|
41
|
+
|
|
42
|
+
### Important Version info
|
|
43
|
+
This version of Ice-PatchNet has only been tested on the images of sea ice extent over the Arctic region and the Antarctic region.
|
|
44
|
+
|
|
45
|
+
----------------------------------------------------------------------------
|
|
46
|
+
|
|
47
|
+
## Method Overview
|
|
48
|
+
|
|
49
|
+
1. **Image Preprocessing:** High-resolution SIE images are converted to grayscale to reduce complexity and computational overhead.
|
|
50
|
+
2. **Patch Segmentation:** The images are divided into a user-defined number of non-overlapping patches. This enables an equal distribution of SIE features and improves the model's ability to distinguish between land, open water, and ice.
|
|
51
|
+
3. **Spatiotemporal Feature Extraction:** Each patch is treated as a single unit and is processed through a deep convolutional neural network (3 layers, $3 \times 3$ kernels) with ReLU activation to identify localized patterns.
|
|
52
|
+
4. **Patches Reassembly:** Predicted patches are re-aligned using a global counter to reconstruct the full geographic extent without spatial distortion.
|
|
53
|
+
|
|
54
|
+
------------------------
|
|
55
|
+
|
|
56
|
+
## Citation
|
|
57
|
+
If you utilize this framework or the patch-based methodology in your research, please cite our ICDM '25 paper:
|
|
58
|
+
```
|
|
59
|
+
Amaraneni, S. V., Devnath, M. K., Srinivasa, S., Kulkarni, C., Chakraborty, S., & Janeja, V. P. (2025). Predicting Antarctic sea ice with scalable deep learning models. In Proceedings of the IEEE ICDM Workshop on Spatial and Spatiotemporal Data Mining (SSTDM).
|
|
60
|
+
```
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
src/icepatchnet/__init__.py
|
|
5
|
+
src/icepatchnet/model.py
|
|
6
|
+
src/icepatchnet/utils.py
|
|
7
|
+
src/icepatchnet.egg-info/PKG-INFO
|
|
8
|
+
src/icepatchnet.egg-info/SOURCES.txt
|
|
9
|
+
src/icepatchnet.egg-info/dependency_links.txt
|
|
10
|
+
src/icepatchnet.egg-info/requires.txt
|
|
11
|
+
src/icepatchnet.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
icepatchnet
|