Data and Code for "Out of Africa: To What Extent Does a Text-to-Image Model Sustain Cartographic Projection Bias in Depictions of the African Continent?"
收藏资源简介:
This repository contains the dataset and analysis pipeline for the paper: "Out of Africa: To What Extent Does a Text-to-Image Model Sustain Cartographic Projection Bias in Depictions of the African Continent?". The following resources are provided: Data Files SD-curated.zip: The primary dataset consisting of 1,000 binary silhouettes of the African continent generated via the Stability AI API. SD-faux.zip: A collection of 111 "false" representations generated by the model that were manually deselected because they bore no plausible resemblance to the African continent (the 11% failure rate discussed in the paper). truth32.zip: Eleven reference cartographic projections standardized to a 32x32 binary image format to serve as interpretive anchors. epsg.txt: A mapping file used in the scripts, containing the EPSG/ESRI codes or abbreviations for the eleven reference projections. Code stable-diffusion-generate-africa.py: The batch generation script used to access the SD 3.5 Flash model and process raw outputs into binary format. geometric_features_descriptive.py: Extracts six core geometric features (Size, Width, Height, Aspect Ratio, Eccentricity, and Cardinal Angle) to quantify areal, distance, and angular distortion. tsne_hac.py: The main analysis script that performs t-SNE dimensionality reduction using the Kulczynski distance metric and Hierarchical Agglomerative Clustering to identify morphological regimes. tsne_hyperparam_grid.py: A sensitivity analysis tool that generates a 3x3 grid of embeddings to verify cluster stability using k-NN overlap and Adjusted Rand Index (ARI). cluster_prototype_analysis.py: Computes the numerical "signature" (mean and standard deviation) for each identified cluster. cluster_overlay_visualization.py: Creates semi-transparent visual composites to reveal the "typical" morphology and spatial consistency within each cluster. prompt-cluster-association.py: Performs a Chi-square test to ensure that morphological clusters are independent of specific prompt phrasings. The analysis pipeline (shown in Figure-1.png) integrates computer vision techniques with cartographic principles to audit AI outputs. The process consists of the following steps: (1) Standardization: All 1,000 AI-generated images and 11 reference projections are resized to a 32x32 binary format and flattened into 1,024-dimensional pixel vectors. (2) Feature Extraction: Six geometric features (size, width, height, aspect ratio, eccentricity, and cardinal angle) are computed to quantify the three classical types of cartographic distortion: area, distance, and angle. (3) Dimensionality Reduction: The pipeline employs t-SNE with a Kulczynski distance metric to project high-dimensional silhouettes into a 2D space while preserving local morphological similarities. (4) Clustering: Hierarchical agglomerative clustering using Ward's linkage is applied to the t-SNE coordinates to identify distinct "distortion regimes". (5) Bias Assessment: Each morphological cluster is characterized through geometric prototypes and visual density overlays, then compared against reference projections that serve as interpretive anchors.



