Repository navigation
Expand file tree
/
Copy pathcarbonLearning.html
More file actions
283 lines (264 loc) · 19.7 KB
/
Copy pathcarbonLearning.html
File metadata and controls
283 lines (264 loc) · 19.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>A Strategic Framework for Active Learning in Digital Soil Mapping</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
<style>
body {
font-family: 'Inter', sans-serif;
background-color: #F8F9FA;
}
.chart-container {
position: relative;
width: 100%;
max-width: 600px;
margin-left: auto;
margin-right: auto;
height: 320px;
max-height: 400px;
}
@media (min-width: 768px) {
.chart-container {
height: 400px;
}
}
.flow-arrow {
color: #F28F3B;
font-size: 2rem;
line-height: 1;
}
.strategy-card {
background-color: white;
border-radius: 0.5rem;
box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
padding: 1.5rem;
border-left: 5px solid #00A6A6;
transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
height: 100%;
}
.strategy-card:hover {
transform: translateY(-5px);
box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}
.preferred-option {
border-color: #F28F3B;
}
</style>
</head>
<body class="bg-gray-50 text-[#342E37]">
<div class="container mx-auto p-4 sm:p-6 lg:p-12">
<header class="text-center mb-12">
<h1 class="text-4xl md:text-5xl font-bold text-[#00A6A6] mb-2">A Strategic Framework for Active Learning in Digital Soil Mapping</h1>
<p class="text-lg md:text-xl text-gray-600 max-w-3xl mx-auto">Optimizing Soil Core Placement to Minimize Farm-Scale Prediction Error for Soil Organic Carbon (SOC).</p>
</header>
<main>
<section id="introduction" class="mb-16">
<div class="bg-white p-8 rounded-lg shadow-lg">
<h2 class="text-3xl font-bold text-center mb-4">The Challenge: The High Cost of Uncertainty</h2>
<p class="text-center text-gray-700 max-w-4xl mx-auto mb-8">Accurate mapping of Soil Organic Carbon (SOC) is an economic and environmental imperative. However, traditional grid sampling methods are a blunt instrument: costly, labor-intensive, and often yielding low-resolution maps that fail to capture the true variability of a property, leading to risky management decisions.</p>
<div class="bg-red-50 border-l-4 border-red-500 p-6 rounded-r-lg max-w-3xl mx-auto">
<h3 class="text-2xl font-bold text-gray-800">The Economics of Traditional Sampling</h3>
<p class="text-gray-600 mt-2 mb-4">A standard approach for a 1000-hectare property reveals a significant upfront investment with no guarantee of actionable insights:</p>
<div class="text-center bg-white p-4 rounded-lg shadow-inner">
<span class="text-2xl font-semibold text-gray-700">250 Cores</span>
<span class="text-2xl mx-2">×</span>
<span class="text-2xl font-semibold text-gray-700">A$75/Core</span>
<span class="text-2xl mx-2">=</span>
<span class="text-3xl font-bold text-[#E03616]">A$18,750 Initial Outlay</span>
</div>
</div>
</div>
</section>
<section class="mb-16">
<h2 class="text-3xl font-bold text-center mb-8">Foundation: Key Data Layers Fueling the Model</h2>
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6 text-center">
<div class="bg-white p-4 rounded-lg shadow-md"><div class="text-4xl mb-2">🛰️</div><h3 class="font-semibold">Satellite Imagery</h3><p class="text-sm text-gray-500">Sentinel-2 Bare Earth & Fractional Cover time-series to capture soil and vegetation dynamics.</p></div>
<div class="bg-white p-4 rounded-lg shadow-md"><div class="text-4xl mb-2">⛰️</div><h3 class="font-semibold">Topography</h3><p class="text-sm text-gray-500">Digital Elevation Model (DEM) data on slope, aspect, and water flow which heavily influence SOC.</p></div>
<div class="bg-white p-4 rounded-lg shadow-md"><div class="text-4xl mb-2">🌦️</div><h3 class="font-semibold">Climate Data</h3><p class="text-sm text-gray-500">Long-term rainfall and temperature patterns that govern SOC accumulation rates.</p></div>
<div class="bg-white p-4 rounded-lg shadow-md"><div class="text-4xl mb-2">🔬</div><h3 class="font-semibold">Ancillary Data</h3><p class="text-sm text-gray-500">Geophysical data like gamma-radiometrics or existing soil type maps to add further context.</p></div>
</div>
</section>
<section id="process-overview" class="mb-16">
<h2 class="text-3xl font-bold text-center mb-8">The Active Learning Framework</h2>
<div class="flex flex-col md:flex-row items-center justify-center space-y-4 md:space-y-0 md:space-x-2 text-center">
<div class="p-4 bg-white rounded-lg shadow-md w-44 h-44 flex flex-col justify-center"><div class="text-4xl mb-2">🧩</div><h3 class="font-semibold">Segmentation</h3><p class="text-sm text-gray-500">PyShepSeg groups pixels into objects.</p></div>
<div class="flow-arrow font-mono transform md:rotate-0 rotate-90">→</div>
<div class="p-4 bg-white rounded-lg shadow-md w-44 h-44 flex flex-col justify-center"><div class="text-4xl mb-2">🧠</div><h3 class="font-semibold">TabPFN Model</h3> <p class="text-sm text-gray-500">Generates prediction & uncertainty.</p></div>
<div class="flow-arrow font-mono transform md:rotate-0 rotate-90">→</div>
<div class="p-4 bg-white rounded-lg shadow-md w-44 h-44 flex flex-col justify-center"><div class="text-4xl mb-2">🗺️</div><h3 class="font-semibold">Acquisition Function</h3><p class="text-sm text-gray-500">Selects next optimal sample point.</p></div>
<div class="flow-arrow font-mono transform md:rotate-0 rotate-90">↺</div>
<div class="p-4 bg-white rounded-lg shadow-md w-44 h-44 flex flex-col justify-center"><div class="text-4xl mb-2">🔄</div><h3 class="font-semibold">Retrain & Repeat</h3><p class="text-sm text-gray-500">Model improves with each new core.</p></div>
</div>
</section>
<section id="uncertainty-map" class="mb-16 bg-white p-6 rounded-lg shadow-lg">
<div class="grid grid-cols-1 md:grid-cols-3 gap-8">
<div class="md:col-span-1">
<h2 class="text-3xl font-bold mb-4">The Engine: TabPFN</h2>
<p class="text-gray-600 mb-6">The framework's core is the <strong class="text-[#00A6A6]">TabPFN</strong> model. It provides a full predictive distribution (quantiles) for each segment, and this quantile range is a direct metric of model uncertainty, which is essential for guiding sampling.</p>
<div class="bg-blue-50 border-l-4 border-blue-500 p-4 rounded-r-lg">
<h4 class="font-bold text-lg text-gray-800">The TabPFN Advantage</h4>
<ul class="list-disc list-inside text-gray-600 mt-2 space-y-1">
<li><strong>Transformer Architecture:</strong> Superior pattern recognition on tabular data.</li>
<li><strong>Zero Hyperparameter Tuning:</strong> Works "out-of-the-box," saving time.</li>
<li><strong>Unmatched Speed:</strong> Near-instant predictions enable rapid iteration.</li>
</ul>
</div>
</div>
<div class="md:col-span-2">
<div class="chart-container">
<canvas id="uncertaintyMapChart"></canvas>
</div>
<p class="text-center text-gray-600 mt-4 text-sm">The uncertainty map ( quantile range) is the key input for the acquisition function, highlighting areas where the model is least confident.</p>
</div>
</div>
</section>
<section id="acquisition-function" class="mb-16 bg-white p-8 rounded-lg shadow-xl">
<h2 class="text-3xl font-bold text-center mb-2 text-[#F28F3B]">The Strategy: The Acquisition Function</h2>
<p class="text-center text-gray-600 mb-8 max-w-3xl mx-auto">In Bayesian Optimization, the <strong class="text-gray-800">acquisition function</strong> is a rule that scores every potential sampling location to decide where to sample next. The function is designed to intelligently balance two competing goals: exploration and exploitation.</p>
<div class="grid grid-cols-1 md:grid-cols-2 gap-8">
<div class="strategy-card"><h3 class="text-2xl font-semibold mb-2 text-[#00A6A6]">🕵️ Exploration</h3><p class="text-gray-600">Sampling in regions of <strong class="text-gray-800">high uncertainty</strong> to reduce the model's overall ignorance and improve its global accuracy. This is crucial for ensuring no significant environmental zones are missed.</p></div>
<div class="strategy-card"><h3 class="text-2xl font-semibold mb-2 text-[#00A6A6]">🎯 Exploitation</h3><p class="text-gray-600">Sampling where the model predicts the most promising outcomes (e.g., high SOC) to quickly confirm hotspots, even if uncertainty is relatively low.</p></div>
</div>
</section>
<section id="mapping-vs-prospecting" class="mb-16">
<h2 class="text-3xl font-bold text-center mb-8">Two Goals, One Framework: Mapping vs. Prospecting</h2>
<p class="text-center text-gray-600 mb-8 max-w-3xl mx-auto">By tuning the acquisition function, we can align the sampling strategy with two distinct business objectives:</p>
<div class="grid grid-cols-1 md:grid-cols-2 gap-8 items-stretch">
<div class="strategy-card preferred-option border-l-8"><h3 class="text-2xl font-semibold mb-2 text-[#F28F3B]">🌍 Goal: Whole-Farm Mapping</h3><p class="text-gray-600 mb-4"><strong>Objective:</strong> To create the most accurate possible map of SOC across the entire property and minimize the overall farm-scale prediction error (RMSE). Essential for robust carbon accounting.</p><p class="text-gray-600"><strong>Acquisition Strategy:</strong> Prioritize <strong class="text-gray-800">Exploration</strong>. The function (e.g., Uncertainty + Diversity) will focus on reducing global uncertainty by sampling under-represented land types.</p></div>
<div class="strategy-card"><h3 class="text-2xl font-semibold mb-2 text-[#00A6A6]">💰 Goal: Carbon Prospecting</h3><p class="text-gray-600 mb-4"><strong>Objective:</strong> To efficiently identify specific locations with the highest SOC stocks for targeted management or high-value carbon credit projects, without needing a perfect map of the entire farm.</p><p class="text-gray-600"><strong>Acquisition Strategy:</strong> Prioritize <strong class="text-gray-800">Exploitation</strong>. The function (e.g., Upper Confidence Bound) is tuned to select locations with the highest predicted SOC values to find "hotspots" quickly.</p></div>
</div>
</section>
<section id="iterative-learning" class="mb-16">
<h2 class="text-3xl font-bold text-center mb-8">Seeing the Learning in Action: Uncertainty Reduction Over Time</h2>
<div class="grid grid-cols-1 md:grid-cols-3 gap-8 text-center">
<div>
<div class="chart-container" style="height:250px;"><canvas id="learningMap1"></canvas></div>
<h4 class="mt-4 font-semibold">Initial Model (0 Samples)</h4>
<p class="text-sm text-gray-500">High uncertainty is widespread across multiple zones.</p>
</div>
<div>
<div class="chart-container" style="height:250px;"><canvas id="learningMap2"></canvas></div>
<h4 class="mt-4 font-semibold">+10 Guided Samples</h4>
<p class="text-sm text-gray-500">Initial hotspots shrink; model identifies new areas of secondary uncertainty.</p>
</div>
<div>
<div class="chart-container" style="height:250px;"><canvas id="learningMap3"></canvas></div>
<h4 class="mt-4 font-semibold">+20 Guided Samples</h4>
<p class="text-sm text-gray-500">Map is predominantly low-uncertainty, with high confidence in predictions.</p>
</div>
</div>
</section>
<section id="results" class="mb-16">
<h2 class="text-3xl font-bold text-center mb-8">The Bottom Line: Return on Investment (ROI)</h2>
<p class="text-center text-gray-600 mb-8 max-w-3xl mx-auto">This framework delivers not just a better map, but a better financial outcome. By targeting sampling, it achieves a higher-confidence result for a lower total cost.</p>
<div class="grid grid-cols-1 md:grid-cols-2 gap-8 items-stretch">
<div class="bg-white p-6 rounded-lg shadow-lg border-t-8 border-gray-300">
<h3 class="text-2xl font-semibold text-center mb-4">Traditional Approach</h3>
<ul class="space-y-3 text-lg">
<li class="flex justify-between"><span>Field Sampling (250 cores):</span> <span class="font-bold">A$18,750</span></li>
<li class="flex justify-between"><span>Basic Analysis:</span> <span class="font-bold">A$1,000</span></li>
<li class="flex justify-between border-t pt-3 mt-3"><span>Total Investment:</span> <span class="font-bold text-2xl">A$19,750</span></li>
</ul>
<div class="mt-4 bg-red-50 text-red-700 p-3 rounded-lg text-center"><h4 class="font-semibold">Outcome: Low-Confidence Map</h4> <p class="text-sm">Uncertainty is too high to reliably detect small changes in SOC.</p></div>
</div>
<div class="bg-white p-6 rounded-lg shadow-lg border-t-8 border-[#00A6A6]">
<h3 class="text-2xl font-semibold text-center mb-4">Active Learning Framework</h3>
<ul class="space-y-3 text-lg">
<li class="flex justify-between"><span>Field Sampling (140 cores):</span> <span class="font-bold text-green-600">A$10,500</span></li>
<li class="flex justify-between"><span>Advanced Analysis:</span> <span class="font-bold">A$4,000</span></li>
<li class="flex justify-between border-t pt-3 mt-3"><span>Total Investment:</span> <span class="font-bold text-2xl">A$14,500</span></li>
</ul>
<div class="mt-4 bg-green-50 text-green-700 p-3 rounded-lg text-center"><h4 class="font-semibold">Outcome: High-Confidence Map</h4><p class="text-sm">Precision is sufficient to measure changes over time.</p></div>
</div>
</div>
<div class="mt-8 bg-green-100 border-t-4 border-green-500 p-6 rounded-lg text-center max-w-3xl mx-auto shadow-lg">
<h3 class="text-2xl font-bold text-green-800">Net Savings: A$5,250 + The Ability to Prove Carbon Sequestration</h3>
<p class="text-green-700 mt-2">A low-uncertainty baseline is the only way to reliably measure minor changes in soil carbon over time. This framework provides the statistical confidence required to verify sequestration for high-integrity carbon credit projects.</p>
</div>
</section>
</main>
<footer class="text-center mt-12 border-t pt-6">
<p class="text-gray-500">Analysis by @petescarth</p>
</footer>
</div>
<script>
document.addEventListener('DOMContentLoaded', function () {
const palette = { primary: '#00A6A6', secondary: '#F28F3B', accent: '#E03616' };
const defaultChartOptions = {
responsive: true, maintainAspectRatio: false,
plugins: {
legend: { display: false },
tooltip: {
callbacks: {
title: function(tooltipItems) {
const item = tooltipItems[0];
let label = item.chart.data.labels[item.dataIndex];
return Array.isArray(label) ? label.join(' ') : label;
}
}
}
}
};
function generateUncertaintyData(stage = 0) {
const data = [];
const baseUncertainty = 0.2 - stage * 0.08;
const clusterUncertainty = 0.6 - stage * 0.25;
for (let i = 0; i < 250; i++) {
data.push({ x: Math.random() * 100, y: Math.random() * 100, v: Math.random() * baseUncertainty });
}
for (let i = 0; i < 3; i++) {
const clusterX = [20, 80, 50][i];
const clusterY = [70, 75, 25][i];
for (let j = 0; j < 40; j++) {
data.push({ x: clusterX + (Math.random() - 0.5) * 20, y: clusterY + (Math.random() - 0.5) * 20, v: clusterUncertainty + Math.random() * 0.4 });
}
}
return data;
}
const uncertaintyToColor = (d) => {
const t = Math.min(1, Math.max(0, d.v));
const r = Math.round(110 + t * (224 - 110));
const g = Math.round(220 + t * (54 - 220));
const b = Math.round(150 + t * (22 - 150));
return `rgba(${r},${g},${b}, 0.8)`;
};
const createScatterChart = (canvasId, data, title) => {
const ctx = document.getElementById(canvasId);
if (ctx) {
new Chart(ctx, {
type: 'scatter',
data: {
datasets: [{
label: 'Uncertainty',
data: data.map(d => ({x: d.x, y: d.y})),
backgroundColor: data.map(uncertaintyToColor),
pointRadius: 5, pointHoverRadius: 7
}]
},
options: { ...defaultChartOptions,
scales: {
x: { display: false, grid: { display: false } },
y: { display: false, grid: { display: false } }
},
plugins: { ...defaultChartOptions.plugins,
title: { display: !!title, text: title },
tooltip: { callbacks: { label: (c) => `Segment Uncertainty: ${data[c.dataIndex].v.toFixed(3)}` } }
}
}
});
}
};
createScatterChart('uncertaintyMapChart', generateUncertaintyData(0));
createScatterChart('learningMap1', generateUncertaintyData(0));
createScatterChart('learningMap2', generateUncertaintyData(1));
createScatterChart('learningMap3', generateUncertaintyData(2));
});
</script>
</body>
</html>