General-ProjectsByIF commited on
Commit
779450b
·
verified ·
1 Parent(s): 3eda594

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +184 -0
README.md ADDED
@@ -0,0 +1,184 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ ---
4
+
5
+ # Model Card for Model ID
6
+
7
+ <!-- Provide a quick summary of what the model is/does. -->
8
+
9
+ This causal model takes environmental inputs for an area of a city, and returns an estimated effect of tree coverage change on the surface temperature, for that area.
10
+ The model expects the following information as inputs, for a 100x100 meter area:
11
+ -Confounding variables (X): Elevation, Proximity to water, Average percentage of tree coverage of neighboring areas, Average NDBI of neighboring areas
12
+ -Treatment variable (T) - optional: Percentage of tree canopy coverage
13
+
14
+ The model can be used in two ways:
15
+ **Method 1**: A simulation of tree coverage (in % - T1) is fed into the model, alongside the original tree coverage (in % - T0) and the rest of the confounding variables (X). The model then provides an output for each area that corresponds to the estimation of the effect on temperature for that tree coverage change.
16
+ **Method 2**: The confounding variables (X) are fed into the model. The model then provides an output for each area that corresponds to expected temperature change per unit change (in %pt) in tree cover.
17
+ The model was trained on raster data (satellite and orthophoto) of the city of Guatemala.
18
+ The goal is to understand how increasing tree coverage could help reduce the temperature in the city.
19
+
20
+
21
+
22
+ ## Model Details
23
+
24
+ ### Model Description
25
+
26
+ <!-- Provide a longer summary of what this model is. -->
27
+
28
+ - **Developed by:** Projects by IF for the Municipality of Guatemala, within the Artificial Intelligence Specialization of the Bloomberg Philanthropies City Data Alliance program
29
+ - **Funded by:** Bloomberg Philanthropies
30
+ - **Model type:** Causal inference model (CausalForestDML)
31
+ - **Task:** Estimating the causal effect of tree coverage on local temperature
32
+ - **Resolution:** 100 x 100 m grid cells
33
+ - **License:** Apache licence 2.0
34
+
35
+
36
+ ### Model Sources
37
+
38
+ <!-- Provide the basic links for the model. -->
39
+
40
+ - **Demo:** https://huggingface.co/spaces/Projects-by-IF/dashboard-temp-final
41
+
42
+ ## Uses
43
+
44
+ <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
45
+
46
+ ### Direct Use
47
+
48
+ <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
49
+ - Estimating the effect of tree coverage on local surface temperature
50
+
51
+
52
+ ### Downstream Use
53
+
54
+ <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
55
+
56
+ - Urban heat island mitigation studies
57
+ - Environmental planning and policy design
58
+ - Scenario analysis of reforestation interventions
59
+
60
+
61
+ ### Out-of-Scope Use
62
+
63
+ <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
64
+
65
+ - Do not use outputs for regulatory or economic decisions without expert validation.
66
+
67
+ ## Bias, Risks, and Limitations
68
+
69
+ <!-- This section is meant to convey both technical and sociotechnical limitations. -->
70
+
71
+ - The model is trained only on satellite data from Guatemala City and may not generalize well to other regions or climates.
72
+ - The model uses satellite-derived Land Surface Temperature (LST) instead of air temperature. Results should be seen as surface cooling potential, not human thermal comfort.
73
+ - The 100 x 100 m resolution limits detail. Tree cover is represented as percentage canopy cover, not individual trees.
74
+ - The model doesn’t consider tree species, spacing, canopy structure, or feasibility of planting in densely built areas, all of which affect real cooling outcomes.
75
+ - It captures localized, near-term effects, not long-term dynamics such as tree growth, survival, or maintenance. Cooling benefits may be nonlinear or delayed in reality.
76
+ - Results are estimates under causal assumptions; external validation is recommended before policy use.
77
+ - Local microclimate, building geometry, and temporal variation are not directly modeled.
78
+ - Only tree planting is modeled; other cooling measures (e.g., reflective roofs, water features, ventilation corridors) are excluded.
79
+ - Some edge cases produce unrealistic outputs (positive impact of trees on temperature) so the model isn’t applicable in those cases.
80
+
81
+ ### Recommendations
82
+
83
+ <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
84
+
85
+ - Interpret outputs as relative indicators of potential cooling, not precise temperature predictions.
86
+ - Combine results with local expert knowledge and on-site assessments before designing interventions.
87
+ - Use in conjunction with other urban heat mitigation strategies for comprehensive planning.
88
+
89
+ ## How to Get Started with the Model
90
+ You can call the model through the API interface found here: https://huggingface.co/spaces/Projects-by-IF/model-temp-api, using the code below (as an example)
91
+
92
+ ```python
93
+ import requests
94
+
95
+ url = "https://Projects-by-IF-model-temp-api.hf.space/model-effect"
96
+
97
+ headers = {"Content-Type": "application/json"}
98
+ data = {"X": X.tolist(), "T0":T.tolist(), "T1":(T_sim).tolist()}
99
+ response = requests.post(url, headers=headers, json=data)
100
+ if response.ok:
101
+ result = response.json()
102
+ print("Model response:", result["effect"])
103
+
104
+ ```
105
+
106
+ ## Training Details
107
+
108
+ ### Training Data
109
+
110
+ <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
111
+
112
+ The model was trained on satellite and orthophoto-derived raster data for Guatemala City, combining environmental, land cover, and built-environment layers.
113
+ Key raster datasets included: LST (Land Surface Temperature), NDBI, Elevation, Proximity to water and Percentage tree canopy coverage.
114
+ All datasets were cropped to the Guatemala City boundary and resampled to a 100×100 m grid, producing one record per cell with accompanying neighborhood statistics.
115
+
116
+
117
+ ### Training Procedure
118
+
119
+ <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
120
+
121
+ #### Preprocessing
122
+
123
+ **Resampling:** mean aggregation using rasterio
124
+ **Neighbor features:** for each variable, the average of the 8 surrounding cells was computed to capture local spatial context.
125
+ **Data cleaning:** removed null entries and standardized column names.
126
+ **Rounding:** All numeric values rounded to 2 decimals; no normalization or scaling applied.
127
+
128
+ #### Training parameters
129
+
130
+ **Training regime:**
131
+ Model trained on 100x100 m resolution grid cells across Guatemala City.
132
+ Inputs included confounding variables (X): Elevation, Proximity to water, Average percentage of tree coverage of neighboring areas, Average NDBI of neighboring areas; and the treatment variable (T): Percentage of tree canopy coverage
133
+ The target variable (Y) was LST (Land Surface Temperature).
134
+ Training was optimized to estimate the causal effect of tree coverage on LST, accounting for spatial confounders.
135
+
136
+ **Model type:** Causal inference framework (Causal Forest DML; econml).
137
+ The treatment model (T given X) is a Linear Regression model (sklearn), while the outcome model (Y given X) is a Random Forest model (sklearn)
138
+
139
+ **Objective:** Estimation of treatment effect rather than direct temperature prediction.
140
+
141
+
142
+ ## Evaluation
143
+
144
+ <!-- This section describes the evaluation protocols and provides the results. -->
145
+
146
+ ### Testing Data, Factors & Metrics
147
+
148
+ #### Testing Data
149
+
150
+ <!-- This should link to a Dataset Card if possible. -->
151
+
152
+ Model evaluation was conducted using historical data from Guatemala City.
153
+ For each 100×100 m grid cell, the dataset included:
154
+ - Historical tree coverage (%) for two time periods
155
+ - Corresponding Land Surface Temperature (LST) observations for the same periods
156
+ These data allowed comparison between observed temperature changes and model-predicted temperature effects based on changes in tree cover
157
+
158
+ #### Factors
159
+ Evaluation considered how well the model could reproduce observed temperature differences across space and time.
160
+
161
+ #### Metrics
162
+
163
+ <!-- These are the evaluation metrics being used, ideally with a description of why. -->
164
+
165
+ The model’s predicted temperature change was computed by multiplying each area’s estimated Individual Treatment Effect (ITE) by the observed change in tree coverage across that period of time.
166
+ This predicted change was then added to the historical baseline temperature and compared against the actual observed LST for the later period.
167
+ Performance was assessed using standard error-based metrics, including:
168
+ - Mean Squared Error (MSE)
169
+ - Correlation (R²) between predicted and observed temperature changes
170
+
171
+
172
+ ### Results
173
+
174
+ - MSE: 0.2318
175
+ - R²: 0.9767
176
+
177
+
178
+ ## Model Card Authors
179
+
180
+ Projects by IF https://www.projectsbyif.com/ for the Municipality of Guatemala, within the framework of the Artificial Intelligence Specialization of the Bloomberg Philanthropies City Data Alliance program.
181
+
182
+ ## Model Card Contact
183
+
184
+ weare@projectsbyif.com - Projects by IF