olmoearth-inferencex 1.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.
Files changed (29) hide show
  1. olmoearth_inferencex-1.1.0/LICENSE +202 -0
  2. olmoearth_inferencex-1.1.0/MANIFEST.in +2 -0
  3. olmoearth_inferencex-1.1.0/PKG-INFO +241 -0
  4. olmoearth_inferencex-1.1.0/README.md +204 -0
  5. olmoearth_inferencex-1.1.0/oe_inferencex/__init__.py +76 -0
  6. olmoearth_inferencex-1.1.0/oe_inferencex/assess.py +275 -0
  7. olmoearth_inferencex-1.1.0/oe_inferencex/awf.py +97 -0
  8. olmoearth_inferencex-1.1.0/oe_inferencex/calibrate.py +220 -0
  9. olmoearth_inferencex-1.1.0/oe_inferencex/cli.py +293 -0
  10. olmoearth_inferencex-1.1.0/oe_inferencex/compare.py +295 -0
  11. olmoearth_inferencex-1.1.0/oe_inferencex/data.py +86 -0
  12. olmoearth_inferencex-1.1.0/oe_inferencex/demo.py +116 -0
  13. olmoearth_inferencex-1.1.0/oe_inferencex/evidence.py +118 -0
  14. olmoearth_inferencex-1.1.0/oe_inferencex/explain.py +185 -0
  15. olmoearth_inferencex-1.1.0/oe_inferencex/figstyle.py +76 -0
  16. olmoearth_inferencex-1.1.0/oe_inferencex/lcc.py +168 -0
  17. olmoearth_inferencex-1.1.0/oe_inferencex/metrics.py +247 -0
  18. olmoearth_inferencex-1.1.0/oe_inferencex/reliability.py +122 -0
  19. olmoearth_inferencex-1.1.0/oe_inferencex/signals.py +229 -0
  20. olmoearth_inferencex-1.1.0/oe_inferencex/stats.py +158 -0
  21. olmoearth_inferencex-1.1.0/oe_inferencex/taskcard.py +284 -0
  22. olmoearth_inferencex-1.1.0/olmoearth_inferencex.egg-info/PKG-INFO +241 -0
  23. olmoearth_inferencex-1.1.0/olmoearth_inferencex.egg-info/SOURCES.txt +27 -0
  24. olmoearth_inferencex-1.1.0/olmoearth_inferencex.egg-info/dependency_links.txt +1 -0
  25. olmoearth_inferencex-1.1.0/olmoearth_inferencex.egg-info/entry_points.txt +2 -0
  26. olmoearth_inferencex-1.1.0/olmoearth_inferencex.egg-info/requires.txt +16 -0
  27. olmoearth_inferencex-1.1.0/olmoearth_inferencex.egg-info/top_level.txt +1 -0
  28. olmoearth_inferencex-1.1.0/pyproject.toml +97 -0
  29. olmoearth_inferencex-1.1.0/setup.cfg +4 -0
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,2 @@
1
+ # The source archive carries the package alone. The tests grade the package against exp/out, which is not shipped.
2
+ prune tests
@@ -0,0 +1,241 @@
1
+ Metadata-Version: 2.4
2
+ Name: olmoearth-inferencex
3
+ Version: 1.1.0
4
+ Summary: Label-free audit of Earth-observation prediction maps: which windows to review first, why, and how two inferences differ
5
+ Author: Ziming Qi
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Documentation, https://olmoearth-inferencex.readthedocs.io
8
+ Project-URL: Repository, https://github.com/2imi9/olmoearth_inferenceX
9
+ Project-URL: Changelog, https://github.com/2imi9/olmoearth_inferenceX/blob/main/CHANGELOG.md
10
+ Keywords: earth-observation,remote-sensing,selective-classification,error-ranking,OlmoEarth,audit
11
+ Classifier: Development Status :: 5 - Production/Stable
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Topic :: Scientific/Engineering :: GIS
18
+ Classifier: Operating System :: OS Independent
19
+ Requires-Python: <3.14,>=3.11
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ Requires-Dist: numpy>=1.26.4
23
+ Requires-Dist: pyyaml>=6.0
24
+ Requires-Dist: huggingface_hub>=0.20
25
+ Provides-Extra: encoder
26
+ Requires-Dist: olmoearth-pretrain<0.2,>=0.1; extra == "encoder"
27
+ Requires-Dist: torch<2.8,>=2.7; extra == "encoder"
28
+ Provides-Extra: geo
29
+ Requires-Dist: rasterio>=1.4; extra == "geo"
30
+ Requires-Dist: geopandas>=1.0; extra == "geo"
31
+ Requires-Dist: shapely>=2.0; extra == "geo"
32
+ Requires-Dist: pystac-client>=0.8; extra == "geo"
33
+ Requires-Dist: planetary-computer>=1.0; extra == "geo"
34
+ Requires-Dist: matplotlib>=3.8; extra == "geo"
35
+ Requires-Dist: scipy>=1.11; extra == "geo"
36
+ Dynamic: license-file
37
+
38
+ olmoearth_inferenceX measures differences between Earth-observation inferences
39
+ without labels, and shows on expert-labelled testbeds which of those differences
40
+ predict error. It was built around OlmoEarth and has since been run on a served
41
+ global product no one here had a hand in training.
42
+
43
+ <img src="https://raw.githubusercontent.com/2imi9/olmoearth_inferenceX/main/docs/figures/pipeline.png" alt="One scene through the audit: Sentinel-2 bands, the frozen OlmoEarth encoder and the task head, the prediction, confidence and boundary layers, the review set at a 5% budget drawn on the scene, and the reasons per flagged window" width="760">
44
+
45
+ Try it in two minutes
46
+ ---------------------
47
+
48
+ ```bash
49
+ pip install olmoearth-inferencex
50
+ oe-inferencex demo
51
+ ```
52
+
53
+ No data, no labels and nothing but numpy. The command makes a small made-up water map the way a model would (sure in
54
+ the middle of the water and the land, unsure along the shore, fooled by one cloud shadow), audits it without labels,
55
+ and writes the picture below with the same files a real audit writes.
56
+
57
+ <img src="https://raw.githubusercontent.com/2imi9/olmoearth_inferenceX/main/docs/figures/demo_review_set.png" alt="Left: a water map with the 5% of windows to check first outlined in orange, all of them along the shore and around a false patch. Right: the same map with the windows that are really wrong filled in red; the orange outlines sit on the edges of the red areas" width="760">
58
+
59
+ *Left: the map, with the 5% of windows to check first in orange. Right: where the map is really wrong, in red, known
60
+ only because the scene is made up. The flagged 5% hold about a quarter of the errors, five times what a random 5%
61
+ would, which is close to what the record measures on a real flood map. The middle of the red patch at the top right is
62
+ an error the model is sure about, and nothing computed without labels finds those.*
63
+
64
+ Then your own map, a GeoTIFF (with `pip install "olmoearth-inferencex[geo]"`) or a `.npy` array of probabilities or
65
+ logits:
66
+
67
+ ```bash
68
+ oe-inferencex assess your_map.tif --out audit
69
+ ```
70
+
71
+ What the project found, in six plain sentences: [Findings, in short](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/Findings.md#in-short).
72
+
73
+ The strongest evidence
74
+ ----------------------
75
+
76
+ **On tasks this project did not choose, the model's own margin ranks its errors
77
+ better than any control that sees no model — on 24 of 24.**
78
+
79
+ The tasks are the 25 of the [OlmoEarth paper embedding suite](https://huggingface.co/datasets/allenai/olmoearth-paper-embeddings)
80
+ by Ai2, with the splits fixed in the files. On all 24 that a top-1 minus top-2 margin is
81
+ defined for, and on all 14 distinct sources behind them, the margin beats the best
82
+ no-model control: 6,435,473 graded units, an accuracy range from 0.333 to 0.979,
83
+ 17 of 17 classification tasks and 7 of 7 segmentation tasks, sign test p = 6e-08.
84
+ Six of the tasks come from GEO-Bench 1, a third-party benchmark, and the margin
85
+ wins on all six. On the same tasks it also beats the competitors the literature
86
+ proposes: a five-seed ensemble on 22 of 24, nearest-neighbour typicality on
87
+ 24 of 24 and a Mahalanobis distance on 24 of 24
88
+ ([exp73](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/results/comparisons.md#the-strong-alternatives-on-the-same-suite-exp73)).
89
+ Nor is it a property of OlmoEarth: under the fifteen other encoders the suite
90
+ is published for, eight families outside OlmoEarth (AnySat, Clay,
91
+ Panopticon, Galileo, CROMA, TerraMind, Satlas, Copernicus-FM) and the OlmoEarth
92
+ size series, the margin beats the control on 322 of 332 scored tasks, every
93
+ encoder at 90% or better
94
+ ([exp74](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/results/comparisons.md#the-suite-under-the-other-encoders-exp74)).
95
+ Within the model's own confidence family the forms are close; on multi-class
96
+ tasks one minus the top probability is marginally better than top-1 minus top-2
97
+ ([exp76](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/results/comparisons.md#which-confidence-which-statistic-which-aggregator-exp76)).
98
+
99
+ This is the answer to the obvious objection — that a result like this rests on
100
+ testbeds the author picked. It does not.
101
+ [Tasks we did not choose (exp70)](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/results/comparisons.md#tasks-we-did-not-choose-ai2s-whole-published-suite-exp70).
102
+
103
+ *What this is not: a leaderboard result. That suite measures accuracy, and no
104
+ public benchmark measures label-free error ranking.*
105
+
106
+ What it does
107
+ ------------
108
+
109
+ On these testbeds the model's own logit margin is the difference that predicts
110
+ error; disagreement across crops, backbones or encoders does not rank errors; the
111
+ sensor difference says where shared errors come from; the frozen-versus-fine-tuned
112
+ difference measures how much training moved the model. Given a prediction map:
113
+
114
+ 1. **Which windows to review first** — review sets at a chosen budget, in
115
+ confidence order or boundary first.
116
+ 2. **Why each flagged window is suspect** — label-free cues carrying measured
117
+ evidence from expert-labelled testbeds.
118
+ 3. **Score any candidate audit rule** the same way, against the model's own
119
+ confidence and a no-model control, on two references at once.
120
+ 4. **Audit a deployed product**, whoever trained it — including a served global
121
+ land-cover product audited from nothing but the probabilities it publishes
122
+ about itself.
123
+ 5. **Measure the difference between two inferences** of one scene: across crops,
124
+ backbones, sensors, encoders, fine-tuning, and acquisition dates — how much
125
+ they disagree, what the disagreeing windows share, and with labels, which side
126
+ is right.
127
+ 6. **Fuse label-free readings with labels** where they exist, reported held-out
128
+ and bound to the model family it was fitted on, because such rules do not
129
+ transfer across families.
130
+ 7. **Grade against a reference that is a sample, not a map** — design-weighted
131
+ estimators report the population quantity. Ignoring the design overstated one
132
+ lead by a quarter of its size.
133
+
134
+ Both halves run from the command line without writing Python:
135
+ `oe-inferencex assess` and `oe-inferencex compare`
136
+ ([Usage](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/Usage.md#command-line)).
137
+
138
+ <img src="https://raw.githubusercontent.com/2imi9/olmoearth_inferenceX/main/docs/figures/compare.png" alt="The two-period, two-sensor square on one GEOID-Flood chip: four dated inputs, four inferences on identical windows, the same-date and same-sensor differences on the scene, and the label bridge boxed apart" width="760">
139
+
140
+ *Four dated inputs of one GEOID-Flood chip (Lake Shkodër at Gruemirë, Albania),
141
+ each read on identical windows. Same-period pairs differ on 22 windows before the
142
+ event and 44 after; same-sensor pairs on 97 (optical) and 67 (radar). What a
143
+ difference **is** needs labels, so that panel is boxed apart. Full numbers in
144
+ [Comparisons](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/results/comparisons.md#the-difference-atlas-every-pair-of-inferences-under-one-measurement-exp57).*
145
+
146
+ What the evidence spans
147
+ -----------------------
148
+
149
+ The ranking result rests on five kinds of reference whose errors fail in different
150
+ ways, which is the part of this work hardest to argue with:
151
+
152
+ | The answer key came from | Testbeds |
153
+ |---|---|
154
+ | people reading the same imagery | [Sen1Floods11 hand labels](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/results/comparisons.md#dense-flood-masks-sen1floods11-exp18), [Copernicus EMS through GEOID-Flood](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/results/comparisons.md#geoid-flood-the-exception-as-a-rate-over-events-exp55), [WorldFloods v2](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/results/comparisons.md#the-fourth-cell-post-event-optical-from-worldfloods-completes-the-square-exp62) |
155
+ | another model's output | [DFC2020](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/results/comparisons.md#dfc2020-eight-class-land-cover-both-sensors-our-own-encoder-two-references-exp66), whose test labels are an iterated random forest, not hand-drawn |
156
+ | experts annotating a served product | [Dynamic World's 409 expert tiles](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/results/comparisons.md#auditing-a-production-model-with-its-own-probabilities-dynamic-world-exp67), audited from its own published probabilities |
157
+ | surveyors standing in the field | [LUCAS Copernicus 2022](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/results/comparisons.md#the-protocol-against-ground-observation-lucas-exp68), the only reference here that never saw a pixel |
158
+ | farmers' own declarations | [EuroCrops](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/results/comparisons.md#eurocrops-a-dense-crop-map-from-declarations-and-a-difference-labelled-on-both-sides-exp69), which also labels both sides of a two-date comparison |
159
+
160
+ Two warnings for practitioners
161
+ ------------------------------
162
+
163
+ **Report your readout's generalisation gap beside any ranking comparison.** A
164
+ small readout that has memorised its practice data reverses which confidence
165
+ signal ranks best. On LUCAS the margin went from last of four model signals to the
166
+ front, on the same data, purely from choosing the probe's regularisation on
167
+ held-out ground.
168
+
169
+ **A two-date difference needs the right floor.** How often the map moves where the
170
+ ground did not is 6% to 37% on crops — one to two orders of magnitude above the
171
+ rate at which merely reseeding the readout moves it. Comparing a date difference
172
+ against the reseed rate flatters it.
173
+
174
+ Quickstart
175
+ ----------
176
+
177
+ 1. [Findings](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/Findings.md) — what holds, the numbers, how a claim gets in,
178
+ and the limits.
179
+ 2. [Usage](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/Usage.md) — assess a prediction, explain its review set, the
180
+ production case, how to score a new rule.
181
+ 3. [Recipe](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/method/recipe.md) — what to do and not do when auditing a map.
182
+ 4. [Technical report](https://github.com/2imi9/olmoearth_inferenceX/blob/main/report/main.pdf): the whole record in ten pages, what was done,
183
+ what held, and what did not.
184
+
185
+ Also: [TECHNIQUES](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/TECHNIQUES.md) (everything tried, one line each, with the
186
+ verdict) · [Protocol](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/method/protocol.md) (how results are scored) ·
187
+ [Explanation](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/results/explanation.md), [Signals](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/results/signals.md),
188
+ [Comparisons](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/results/comparisons.md) (per-cue, per-signal, per-experiment
189
+ evidence) · [Agent integration](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/method/agent_integration.md) ·
190
+ [Related work](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/related_work.md) (where each idea comes from) ·
191
+ [Roadmap](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/plan/roadmap.md).
192
+
193
+ Full documentation: **https://olmoearth-inferencex.readthedocs.io/**
194
+
195
+ Setup
196
+ -----
197
+
198
+ Python 3.11+ and numpy; nothing else for the package. To use it:
199
+
200
+ ```bash
201
+ pip install olmoearth-inferencex # add [geo] to read and write GeoTIFFs
202
+ oe-inferencex demo # a first run on a made-up map
203
+ oe-inferencex assess --help
204
+ ```
205
+
206
+ The development version installs from the repository:
207
+ `pip install "olmoearth-inferencex @ git+https://github.com/2imi9/olmoearth_inferenceX"`.
208
+
209
+ [examples/quickstart.py](https://github.com/2imi9/olmoearth_inferenceX/blob/main/examples/quickstart.py) runs the whole surface on a
210
+ synthetic map with no data to download; the public API is what
211
+ `oe_inferencex.__all__` exports, and [CHANGELOG.md](https://github.com/2imi9/olmoearth_inferenceX/blob/main/CHANGELOG.md) says what a
212
+ release contains. Rasters need the `geo` extra (`rasterio`); `.npy` input does
213
+ not.
214
+
215
+ To work on the repository, with the tests against the recorded numbers:
216
+
217
+ ```bash
218
+ git clone https://github.com/2imi9/olmoearth_inferenceX.git
219
+ cd olmoearth_inferenceX
220
+ uv sync
221
+ uv run pytest
222
+ ```
223
+
224
+ For the full experiment environment:
225
+
226
+ ```bash
227
+ uv sync --extra encoder --extra geo
228
+ uv run python scripts/audit_one_scene.py # one scene end to end
229
+ ```
230
+
231
+ Licence
232
+ -------
233
+
234
+ Apache License 2.0; see [LICENSE](https://github.com/2imi9/olmoearth_inferenceX/blob/main/LICENSE). To cite the software or its
235
+ recorded results, see [CITATION.cff](https://github.com/2imi9/olmoearth_inferenceX/blob/main/CITATION.cff).
236
+
237
+ Contact
238
+ -------
239
+
240
+ For questions and suggestions, please
241
+ [open an issue on GitHub](https://github.com/2imi9/olmoearth_inferenceX/issues).
@@ -0,0 +1,204 @@
1
+ olmoearth_inferenceX measures differences between Earth-observation inferences
2
+ without labels, and shows on expert-labelled testbeds which of those differences
3
+ predict error. It was built around OlmoEarth and has since been run on a served
4
+ global product no one here had a hand in training.
5
+
6
+ <img src="https://raw.githubusercontent.com/2imi9/olmoearth_inferenceX/main/docs/figures/pipeline.png" alt="One scene through the audit: Sentinel-2 bands, the frozen OlmoEarth encoder and the task head, the prediction, confidence and boundary layers, the review set at a 5% budget drawn on the scene, and the reasons per flagged window" width="760">
7
+
8
+ Try it in two minutes
9
+ ---------------------
10
+
11
+ ```bash
12
+ pip install olmoearth-inferencex
13
+ oe-inferencex demo
14
+ ```
15
+
16
+ No data, no labels and nothing but numpy. The command makes a small made-up water map the way a model would (sure in
17
+ the middle of the water and the land, unsure along the shore, fooled by one cloud shadow), audits it without labels,
18
+ and writes the picture below with the same files a real audit writes.
19
+
20
+ <img src="https://raw.githubusercontent.com/2imi9/olmoearth_inferenceX/main/docs/figures/demo_review_set.png" alt="Left: a water map with the 5% of windows to check first outlined in orange, all of them along the shore and around a false patch. Right: the same map with the windows that are really wrong filled in red; the orange outlines sit on the edges of the red areas" width="760">
21
+
22
+ *Left: the map, with the 5% of windows to check first in orange. Right: where the map is really wrong, in red, known
23
+ only because the scene is made up. The flagged 5% hold about a quarter of the errors, five times what a random 5%
24
+ would, which is close to what the record measures on a real flood map. The middle of the red patch at the top right is
25
+ an error the model is sure about, and nothing computed without labels finds those.*
26
+
27
+ Then your own map, a GeoTIFF (with `pip install "olmoearth-inferencex[geo]"`) or a `.npy` array of probabilities or
28
+ logits:
29
+
30
+ ```bash
31
+ oe-inferencex assess your_map.tif --out audit
32
+ ```
33
+
34
+ What the project found, in six plain sentences: [Findings, in short](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/Findings.md#in-short).
35
+
36
+ The strongest evidence
37
+ ----------------------
38
+
39
+ **On tasks this project did not choose, the model's own margin ranks its errors
40
+ better than any control that sees no model — on 24 of 24.**
41
+
42
+ The tasks are the 25 of the [OlmoEarth paper embedding suite](https://huggingface.co/datasets/allenai/olmoearth-paper-embeddings)
43
+ by Ai2, with the splits fixed in the files. On all 24 that a top-1 minus top-2 margin is
44
+ defined for, and on all 14 distinct sources behind them, the margin beats the best
45
+ no-model control: 6,435,473 graded units, an accuracy range from 0.333 to 0.979,
46
+ 17 of 17 classification tasks and 7 of 7 segmentation tasks, sign test p = 6e-08.
47
+ Six of the tasks come from GEO-Bench 1, a third-party benchmark, and the margin
48
+ wins on all six. On the same tasks it also beats the competitors the literature
49
+ proposes: a five-seed ensemble on 22 of 24, nearest-neighbour typicality on
50
+ 24 of 24 and a Mahalanobis distance on 24 of 24
51
+ ([exp73](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/results/comparisons.md#the-strong-alternatives-on-the-same-suite-exp73)).
52
+ Nor is it a property of OlmoEarth: under the fifteen other encoders the suite
53
+ is published for, eight families outside OlmoEarth (AnySat, Clay,
54
+ Panopticon, Galileo, CROMA, TerraMind, Satlas, Copernicus-FM) and the OlmoEarth
55
+ size series, the margin beats the control on 322 of 332 scored tasks, every
56
+ encoder at 90% or better
57
+ ([exp74](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/results/comparisons.md#the-suite-under-the-other-encoders-exp74)).
58
+ Within the model's own confidence family the forms are close; on multi-class
59
+ tasks one minus the top probability is marginally better than top-1 minus top-2
60
+ ([exp76](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/results/comparisons.md#which-confidence-which-statistic-which-aggregator-exp76)).
61
+
62
+ This is the answer to the obvious objection — that a result like this rests on
63
+ testbeds the author picked. It does not.
64
+ [Tasks we did not choose (exp70)](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/results/comparisons.md#tasks-we-did-not-choose-ai2s-whole-published-suite-exp70).
65
+
66
+ *What this is not: a leaderboard result. That suite measures accuracy, and no
67
+ public benchmark measures label-free error ranking.*
68
+
69
+ What it does
70
+ ------------
71
+
72
+ On these testbeds the model's own logit margin is the difference that predicts
73
+ error; disagreement across crops, backbones or encoders does not rank errors; the
74
+ sensor difference says where shared errors come from; the frozen-versus-fine-tuned
75
+ difference measures how much training moved the model. Given a prediction map:
76
+
77
+ 1. **Which windows to review first** — review sets at a chosen budget, in
78
+ confidence order or boundary first.
79
+ 2. **Why each flagged window is suspect** — label-free cues carrying measured
80
+ evidence from expert-labelled testbeds.
81
+ 3. **Score any candidate audit rule** the same way, against the model's own
82
+ confidence and a no-model control, on two references at once.
83
+ 4. **Audit a deployed product**, whoever trained it — including a served global
84
+ land-cover product audited from nothing but the probabilities it publishes
85
+ about itself.
86
+ 5. **Measure the difference between two inferences** of one scene: across crops,
87
+ backbones, sensors, encoders, fine-tuning, and acquisition dates — how much
88
+ they disagree, what the disagreeing windows share, and with labels, which side
89
+ is right.
90
+ 6. **Fuse label-free readings with labels** where they exist, reported held-out
91
+ and bound to the model family it was fitted on, because such rules do not
92
+ transfer across families.
93
+ 7. **Grade against a reference that is a sample, not a map** — design-weighted
94
+ estimators report the population quantity. Ignoring the design overstated one
95
+ lead by a quarter of its size.
96
+
97
+ Both halves run from the command line without writing Python:
98
+ `oe-inferencex assess` and `oe-inferencex compare`
99
+ ([Usage](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/Usage.md#command-line)).
100
+
101
+ <img src="https://raw.githubusercontent.com/2imi9/olmoearth_inferenceX/main/docs/figures/compare.png" alt="The two-period, two-sensor square on one GEOID-Flood chip: four dated inputs, four inferences on identical windows, the same-date and same-sensor differences on the scene, and the label bridge boxed apart" width="760">
102
+
103
+ *Four dated inputs of one GEOID-Flood chip (Lake Shkodër at Gruemirë, Albania),
104
+ each read on identical windows. Same-period pairs differ on 22 windows before the
105
+ event and 44 after; same-sensor pairs on 97 (optical) and 67 (radar). What a
106
+ difference **is** needs labels, so that panel is boxed apart. Full numbers in
107
+ [Comparisons](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/results/comparisons.md#the-difference-atlas-every-pair-of-inferences-under-one-measurement-exp57).*
108
+
109
+ What the evidence spans
110
+ -----------------------
111
+
112
+ The ranking result rests on five kinds of reference whose errors fail in different
113
+ ways, which is the part of this work hardest to argue with:
114
+
115
+ | The answer key came from | Testbeds |
116
+ |---|---|
117
+ | people reading the same imagery | [Sen1Floods11 hand labels](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/results/comparisons.md#dense-flood-masks-sen1floods11-exp18), [Copernicus EMS through GEOID-Flood](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/results/comparisons.md#geoid-flood-the-exception-as-a-rate-over-events-exp55), [WorldFloods v2](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/results/comparisons.md#the-fourth-cell-post-event-optical-from-worldfloods-completes-the-square-exp62) |
118
+ | another model's output | [DFC2020](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/results/comparisons.md#dfc2020-eight-class-land-cover-both-sensors-our-own-encoder-two-references-exp66), whose test labels are an iterated random forest, not hand-drawn |
119
+ | experts annotating a served product | [Dynamic World's 409 expert tiles](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/results/comparisons.md#auditing-a-production-model-with-its-own-probabilities-dynamic-world-exp67), audited from its own published probabilities |
120
+ | surveyors standing in the field | [LUCAS Copernicus 2022](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/results/comparisons.md#the-protocol-against-ground-observation-lucas-exp68), the only reference here that never saw a pixel |
121
+ | farmers' own declarations | [EuroCrops](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/results/comparisons.md#eurocrops-a-dense-crop-map-from-declarations-and-a-difference-labelled-on-both-sides-exp69), which also labels both sides of a two-date comparison |
122
+
123
+ Two warnings for practitioners
124
+ ------------------------------
125
+
126
+ **Report your readout's generalisation gap beside any ranking comparison.** A
127
+ small readout that has memorised its practice data reverses which confidence
128
+ signal ranks best. On LUCAS the margin went from last of four model signals to the
129
+ front, on the same data, purely from choosing the probe's regularisation on
130
+ held-out ground.
131
+
132
+ **A two-date difference needs the right floor.** How often the map moves where the
133
+ ground did not is 6% to 37% on crops — one to two orders of magnitude above the
134
+ rate at which merely reseeding the readout moves it. Comparing a date difference
135
+ against the reseed rate flatters it.
136
+
137
+ Quickstart
138
+ ----------
139
+
140
+ 1. [Findings](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/Findings.md) — what holds, the numbers, how a claim gets in,
141
+ and the limits.
142
+ 2. [Usage](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/Usage.md) — assess a prediction, explain its review set, the
143
+ production case, how to score a new rule.
144
+ 3. [Recipe](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/method/recipe.md) — what to do and not do when auditing a map.
145
+ 4. [Technical report](https://github.com/2imi9/olmoearth_inferenceX/blob/main/report/main.pdf): the whole record in ten pages, what was done,
146
+ what held, and what did not.
147
+
148
+ Also: [TECHNIQUES](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/TECHNIQUES.md) (everything tried, one line each, with the
149
+ verdict) · [Protocol](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/method/protocol.md) (how results are scored) ·
150
+ [Explanation](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/results/explanation.md), [Signals](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/results/signals.md),
151
+ [Comparisons](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/results/comparisons.md) (per-cue, per-signal, per-experiment
152
+ evidence) · [Agent integration](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/method/agent_integration.md) ·
153
+ [Related work](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/related_work.md) (where each idea comes from) ·
154
+ [Roadmap](https://github.com/2imi9/olmoearth_inferenceX/blob/main/docs/plan/roadmap.md).
155
+
156
+ Full documentation: **https://olmoearth-inferencex.readthedocs.io/**
157
+
158
+ Setup
159
+ -----
160
+
161
+ Python 3.11+ and numpy; nothing else for the package. To use it:
162
+
163
+ ```bash
164
+ pip install olmoearth-inferencex # add [geo] to read and write GeoTIFFs
165
+ oe-inferencex demo # a first run on a made-up map
166
+ oe-inferencex assess --help
167
+ ```
168
+
169
+ The development version installs from the repository:
170
+ `pip install "olmoearth-inferencex @ git+https://github.com/2imi9/olmoearth_inferenceX"`.
171
+
172
+ [examples/quickstart.py](https://github.com/2imi9/olmoearth_inferenceX/blob/main/examples/quickstart.py) runs the whole surface on a
173
+ synthetic map with no data to download; the public API is what
174
+ `oe_inferencex.__all__` exports, and [CHANGELOG.md](https://github.com/2imi9/olmoearth_inferenceX/blob/main/CHANGELOG.md) says what a
175
+ release contains. Rasters need the `geo` extra (`rasterio`); `.npy` input does
176
+ not.
177
+
178
+ To work on the repository, with the tests against the recorded numbers:
179
+
180
+ ```bash
181
+ git clone https://github.com/2imi9/olmoearth_inferenceX.git
182
+ cd olmoearth_inferenceX
183
+ uv sync
184
+ uv run pytest
185
+ ```
186
+
187
+ For the full experiment environment:
188
+
189
+ ```bash
190
+ uv sync --extra encoder --extra geo
191
+ uv run python scripts/audit_one_scene.py # one scene end to end
192
+ ```
193
+
194
+ Licence
195
+ -------
196
+
197
+ Apache License 2.0; see [LICENSE](https://github.com/2imi9/olmoearth_inferenceX/blob/main/LICENSE). To cite the software or its
198
+ recorded results, see [CITATION.cff](https://github.com/2imi9/olmoearth_inferenceX/blob/main/CITATION.cff).
199
+
200
+ Contact
201
+ -------
202
+
203
+ For questions and suggestions, please
204
+ [open an issue on GitHub](https://github.com/2imi9/olmoearth_inferenceX/issues).