Social media as a sensor: unraveling nonlinear drivers of perceived thermal comfort in Shanghai
Walking through urban streets, one might wonder why a temperature of 30°C feels like an unbearable heatwave in one district yet remains tolerable in another. This phenomenon transcends mere meteorological metrics; it is a fundamental urban issue. The disparity in thermal experience—where some blocks feel stifling while others remain pleasant—stems from both ambient temperatures and the nuanced ways in which individuals perceive and experience their environment. Factors such as canopy cover, the proximity of water bodies, the openness of street canyons, and the ventilation afforded by building heights subtilely modulate our "perceived temperature." Published in Landscape and Urban Planning, this study departs from these everyday experiences to address a critical yet historically overlooked question: How is the city truly "perceived"?
Outdoor Thermal Comfort (OTC) represents a psychological state of satisfaction with the external thermal environment and serves as a vital metric of urban livability. Achieving a profound understanding of residents' Perceived Thermal Comfort (PTC) and its underlying mechanisms is essential for enhancing the quality of urban public spaces and the well-being of citizens. However, conventional methodologies face significant constraints: questionnaire-based surveys struggle to achieve large-scale, longitudinal observations, while numerical simulations incur high computational costs and often fail to capture authentic individual experiences. In recent years, location-based social media data, characterized by high spatiotemporal resolution and near-real-time availability, has emerged as a transformative data source for delineating public environmental perceptions. Existing scholarship has predominantly focused on extreme heat events, utilizing topic modeling and sentiment analysis to characterize public responses during climatic crises.

Figure 1. Research framework.
This study proposes an analytical framework integrating social media data with machine learning to systematically investigate the annual dynamic shifts in PTC across Shanghai. Drawing upon 71,023 geatagged Weibo posts, the researchers utilized a fine-tuned BERT model to isolate texts relevant to the thermal environment, subsequently coupling this with Baidu AI sentiment analysis to construct a proxy indicator for PTC. On this basis, an XGBoost model was deployed, complemented by SHAP (SHapley Additive exPlanations) values and Partial Dependence Plots (PDPs), to systematically decode the nonlinear influence mechanisms of urban morphology, socio-spatial characteristics, and climatic factors on PTC.
The core findings of this study include:
- Seasonal and diurnal variations in PTC are pronounced. PTC reaches its zenith during spring and autumn, with a significant decline observed in summer. Regarding diurnal patterns, thermal comfort levels during summer nights are markedly higher than during the day. Spatially, natural Local Climate Zones (LCZs) consistently exhibit higher comfort levels, whereas compact built environments (such as LCZ 3) report the lowest PTC levels.

Figure 2. Temporal characteristics of PTC, illustrating the distribution of average PTC (with 95% confidence intervals) and Weibo post volume at monthly (a) and hourly (b) scales, alongside seasonal and diurnal disparities (c).

Figure 3. Box plots of PTC distribution across different Local Climate Zones (LCZs) for the four seasons: (a) Spring, (b) Summer, (c) Autumn, and (d) Winter.
- The relative importance of drivers varies by category. Regarding urban morphology, the Proportion of Green and Blue Infrastructure (PGB) emerges as the most significant 2D indicator throughout the year. In terms of 3D structures, Vegetation Height (VH) dominates during spring and autumn, while Building Height (BH) and the Aspect Ratio (H/W) become more critical during summer and winter. Among socio-spatial characteristics, the Tourist Facility Proportion (TOFP) is the most influential variable across all seasons. Climatic factors exhibit distinct seasonal heterogeneity.
- The study identifies significant nonlinear relationships and threshold effects between PTC and its environmental drivers. When Vegetation Coverage (VC) exceeds 50%, PTC improves substantially. Proximity to Green and Blue Infrastructure (DGB) is most effective at enhancing thermal comfort within a 100-meter range, with diminishing returns beyond this threshold. The Proportion of Green and Blue Infrastructure (PGB) continuously improves comfort levels once it exceeds 0.1. The Sky View Factor (SVF) maintains an inverted U-shaped relationship with PTC, reaching an optimum state between 0.4 and 0.8. Building Height (BH) corresponds to higher comfort levels at 15 to 20 meters. Interestingly, Vegetation Height (VH) yields higher comfort at low (< 1 m) or high (> 2 m) values, with a local minimum occurring at approximately 1.5 m (roughly 0.79).

Figure 4. Nonlinear impacts of key urban morphological factors on PTC.
- Socio-spatial and climatic thresholds further modulate perception. Thermal comfort declines sharply when the Transport Facility Proportion (TFP) exceeds 0.125. The Shopping Facility Proportion (SFP) reaches an optimal range between 0.10 and 0.20, while the Tourist Facility Proportion (TOFP) tends to stabilize after surpassing 0.1. Regarding climatic conditions, comfort levels are highest under moderate temperatures and appropriate humidity, while cloudy weather tends to enhance the thermal perception experience.
Building upon these findings, the paper proposes optimization strategies for urban planning and design. These include the strategic allocation of green and blue infrastructure within a 100-meter radius of residential areas and the development of continuous green corridor systems to mitigate the Urban Heat Island (UHI) effect through multi-layered vegetation and permeable paving. Recommendations also include optimizing building heights and spatial layouts to improve ventilation and shading, and regulating the spatial clustering of commercial, tourism, and transport facilities to avoid adverse thermal impacts. Furthermore, the integration of climate monitoring and smart management tools is suggested to bolster urban adaptive capacity. In the context of urban renewal, priority should be given to retrofitting compact built-up areas (e.g., LCZ 3) with low thermal comfort, guiding their transition toward more open spatial forms (e.g., LCZ 4 or LCZ 5) to systematically improve urban microclimates and resident perceptions.
Hongping Sun, a Research Assistant at the Shanghai Key Laboratory of Urban Design and Urban Science (LOUD) and a joint Ph.D. student at East China Normal University and NYU Shanghai, remarked: "As climate change intensifies and urbanization progresses, the issue of urban thermal comfort has become increasingly salient. Addressing the limitations of traditional methods in capturing individual perceptions and spatiotemporal continuity, this study adopts a 'people-centered' perspective, utilizing real-time, high-resolution social media data to delineate public thermal perceptions in authentic contexts. We found that perceived thermal comfort during summer nights is generally higher than during the day, with significant variations across different Local Climate Zones. By employing machine learning, we systematically analyzed the nonlinear influences of environment factors and identified key thresholds. These results not only aid in enhancing the thermal quality of public spaces but also provide a scientific and actionable basis for urban renewal, climate-adaptive planning, and health-oriented spatial governance."
Professor Ying Li, the corresponding author and Co-Founding Director of LOUD, noted: "'Thermal comfort' is evolving from a purely meteorological topic into a core issue concerning urban livability and public health. However, our understanding of how humans perceive urban thermal environments has long been constrained by data and methodological limitations. By transforming social media into a 'perceptual sensor,' we have utilized tens of thousands of authentic expressions and machine learning to systematically map the disparities in thermal comfort across Shanghai's diverse temporal and spatial scales. These results may challenge intuitive perceptions: our sense of 'comfort' is never dictated by temperature alone, but by the collective interplay of spatial and environmental elements. When we use data to understand 'bodily sensation,' urban design and governance gain a more concrete and operable direction."
This research was supported by the Shanghai Foundation for Nature and Health, the Pudong Pearl Program for Leading Talents, the Shanghai Higher Education Distinguished Professor (Oriental Scholar) Program, the Overseas High-Level Young Talents Recruitment Program, and the Shanghai Municipal Education Commission (AI-Driven Research Paradigm Reform and Disciplinary Empowerment Key Project). The study also received strong support from the Winston Foundation, the NYU Shanghai Faculty Grant, Xiangliang Climate, and Envision Energy.
Reference
Sun, H., Li, C., Huang, K., Li, Y., & Guan, C. (2026). Social media as a sensor: unraveling nonlinear drivers of perceived thermal comfort in Shanghai. Landscape and Urban Planning, 271, 105636.
- 154 views