top of page

Athens-Polis: Machine Learning in Urban Graffiti

Key Words

This project explores the correlation between street graffiti and spatial cognitive indicators in the first district of Athens by building machine learning data sets and training models, providing a new paradigm for the study of the impact of street features on urban space.

Machine Learning, Urban perception, Urban Data, Graffiti, Street View Image

Date

April 2024

2a The Touristin Street Art Athens.JPG
Research Background

Recent urban studies increasingly use machine learning to understand how physical features influence human perception, yet the role of graffiti remains underexplored. While traditionally associated with disorder, graffiti also reflects cultural expression and local identity, particularly in cities like Athens where it is deeply embedded in the urban fabric. Building on prior work that links urban elements to perceptual indicators such as safety and liveliness, this study investigates how different types of graffiti affect spatial cognition. By analyzing over 30,000 street view images from Athens' First District, we aim to quantify the relationship between graffiti and six cognitive indices, offering new insights into the visual dynamics of urban space. 

Data and Methods
Technical Pipeline

This study constructs a machine learning pipeline that processes over 30,000 Google Street View images from Athens’ First District. Graffiti types are classified into four categories using a ResNet-50 image classification model, while six perceptual indicators—such as safety, beauty, and liveliness—are predicted using models trained on the Place Pulse dataset. The classified outputs are then spatially analyzed through ANOVA, Kruskal-Wallis tests, and Geographically Weighted Regression (GWR) to examine correlations between graffiti presence and urban perception across different areas of the city.

Graffiti - Tech Pipeline.jpg
Google Street View Images of Athens' 1st District
微信截图_20240821162931.jpg
4 types of Graffiti
Screenshot 2025-04-28 at 12.21.03 AM.png
Training Dataset Preparation

 

Google Street View Images of Athens' 1st District

Athens’ First District, home to landmarks like the Acropolis and the graffiti-heavy Exarcheia neighborhood, was chosen as the study area. Using Python and the Google Street View API, 29,820 images were collected from 7,455 geo-located points spaced at 20-meter intervals. At each point, images were captured from four directions (0°, 90°, 180°, and 270°), forming a comprehensive visual dataset of the urban environment.

 

Graffiti Classification

Graffiti in the images was classified into four categories: no graffiti, tagging, throw-up, and works. Thousands of labeled examples for each type were used to train the model. The dataset was split into training, validation, and test sets in a 7:2:1 ratio.

 

Place Pulse Dataset

To model urban perception, the Place Pulse dataset was used. It contains over 100,000 images rated across six dimensions: lively, safety, clean, wealthy, depressing, and beautiful. For training, images with scores significantly above or below the mean were selected to represent high and low perception categories.

 

Model Architecture and Training

The model was based on ResNet-50, modified to suit the classification tasks. For graffiti, the final layer had four output nodes; for perception, six separate binary classifiers were trained (one for each perceptual category). Images were cropped to 300×300 pixels, resized to 400×400, and normalized. A batch size of 8 was used to balance memory and performance.

 

Training Process

Training ran for 15 epochs using the Adam optimizer and OneCycleLR scheduler to dynamically adjust the learning rate. A fixed random seed (1234) and deterministic CuDNN settings ensured consistent, reproducible results.

 

Experimental Results

The graffiti classification model achieved over 90% accuracy, while the perception classification models reached over 70% across all six categories. These results validated the model’s effectiveness and laid the foundation for the study’s spatial and correlation analyses.

Results and Findings
微信图片_20240817020726.png
beautiful.jpg
微信图片_20240817020730.png
clean.jpg
微信图片_20240817020735.png
lively.jpg
微信图片_20240817020738.png
微信图片_20240817020741.png
wealthy.jpg
safe.jpg
微信图片_20240817020733.png
depressing.jpg

The graffiti classification model achieved over 90% accuracy, while perception classification models surpassed 70% accuracy. Results showed that graffiti presence correlates positively with perceptions of “lively” and “depressing,” but negatively with “safe,” “clean,” “wealthy,” and “beautiful.” Among graffiti types, “Taggings” were most strongly associated with negative perceptions, while “Throw-ups” were often linked to higher liveliness and relatively better scores across the six perception dimensions.

 

Spatial analysis using Geographically Weighted Regression (GWR) revealed significant regional variation in how graffiti influences perception. In areas like Exarcheia and near the Acropolis, graffiti—especially complex works—enhanced perceptions of beauty and liveliness. In contrast, regions with poor infrastructure or limited graffiti coverage, such as eastern mountain areas, showed negative or weaker correlations. “Clean” and “safe” perceptions were especially sensitive to graffiti presence, often registering negative correlations, particularly in the city center and northern neighborhoods. These findings suggest that the visual impact of graffiti is not uniform but mediated by environmental context, graffiti type, and surrounding urban form—offering new insights for urban design and public space policy.

Screenshot 2025-05-16 at 5.32.52 AM.png

The regression coefficients for "clean" show a widespread negative correlation, especially in the northeastern region (around -2.0 to -3.0), including Exarcheia. Only the northwest and southeast show weak positives (0.0 to 0.5). For "depressing," coefficients are mostly positive, especially in the west and north (1.5 to 2.0), while weak negatives appear in some northern areas (-0.5 to 0.0). "Lively" scores are generally positive, with high values in the western city center (1.0 to 1.5), but turn negative in the northwest and southwest (-1.5 to -1.0). "Safe" shows a strong negative correlation in the central and northern areas (-2.5 to -3.0), while the eastern region performs slightly better (0 to weakly negative). "Wealthy" scores mirror “safe,” with weak negatives overall, stronger negatives in central/northern areas (-1.5 to -3.0), and weak positives (0.0 to 0.5) in scattered corners.

graffiti_legend.png
Conclusion

This study applied machine learning to over 30,000 Google Street View images from 7,455 locations in Athens’ First District, classifying each location by graffiti type and six spatial perception indicators: lively, safe, clean, wealthy, depressing, and beautiful. The results revealed that graffiti overall was positively associated with perceptions of liveliness and depression, but negatively correlated with safety, cleanliness, wealth, and beauty. Different types of graffiti had distinct effects—“Taggings” were most negatively perceived, especially in terms of safety and cleanliness, while “Throw-ups” were associated with higher liveliness scores.

 

Spatial analysis using Geographically Weighted Regression (GWR) showed strong regional variation. In areas like Exarcheia and near the Acropolis, graffiti—especially complex works—enhanced perceptions of beauty and vibrancy. In contrast, graffiti in northern and eastern neighborhoods, often combined with poor infrastructure or limited natural features, reinforced negative perceptions. These findings suggest that the visual impact of graffiti is not uniform but context-dependent, shaped by both form and location. The study argues that graffiti, beyond being a surface feature, plays a meaningful role in how people experience and evaluate urban space—offering both challenges and opportunities for urban planners.

bottom of page