1 Introduction
The study of politics needs a robust capacity to analyze visual data at large scale. Visual content is potent in conveying political ideas and mobilizing support, and the deluge of images and videos in the contemporary media environment, if anything, amplifies its role. Since images may convey something different from text (Coleman Reference Coleman2010), it can be crucial to analyze visual data directly, instead of via its accompanying text. However, large-scale visual political analysis often has to skip the visual content to instead rely on the accompanying text (e.g., captions or transcripts). While the text-as-data literature has developed a range of specialized computational methods tailored to social scientific purposes, the visual equivalent is still underdeveloped (Bucy and Joo Reference Bucy and Joo2021; Magnani and Segerberg Reference Magnani and Segerberg2021; Peng, Lock, and Ali Salah Reference Peng, Lock and Ali Salah2024; Torres and Cantú Reference Torres and Cantú2022; Williams, Casas, and Wilkerson Reference Williams, Casas and Wilkerson2020).
Large-scale image analysis presents a distinctive methodological frontier in computational social science. Images in political analysis such as photos, memes and data visualizations present their own challenge as compared with words in text-as-data but also as compared with how visual features such as color and texture are approached in medical image analysis. Images in social contexts can entail complex, multilayered semantics that invoke a semantic and cultural gap between what is easily extracted and how the image is understood (van Noord Reference van Noord2022; Smeulders et al. Reference Smeulders, Worring, Santini, Gupta and Jain2000). Intriguingly, recent developments in computer vision offer potential to broach this frontier directly.
This article proposes a visual structural topic model (vSTM) that is designed to deal with the semantic complexity of images in political analysis, while enabling mixed membership modeling and the capacity to capture the relationship between a visual topic and other variables of interest. The ability to automatically categorize unlabeled image data is central to a number of analytical scenarios, several of which pivot on the relationship between visual content and other covariates. Examples can be found in studies analyzing how various actors use visual strategies to shape public agendas and engage audiences with their cause (e.g., Farkas and Bene Reference Farkas and Bene2021; Jing and Tian Reference Jing and Tian2021; Kim and Bas Reference Kim and Bas2023; Laaksonen et al. Reference Laaksonen, Hokka, Nelimarkka, Nikunen, Pettersson and Nortio2022; Mooseder et al. Reference Mooseder, Brantner, Zamith and Pfeffer2023; Peng Reference Peng2021; Qian et al. Reference Qian, Yingdan, Peng, Shen and Huacen2024; Torres Reference Torres2024), or research that analyzes key drivers in processes of discursive politicization or protest mobilization (e.g., Knüpfer, Schwemmer, and Heft Reference Knüpfer, Schwemmer and Heft2023; Lu and Peng Reference Lu and Peng2024; Oak and Nielsen Reference Oak and Nielsen2024).
The vSTM makes three key contributions. First, it incorporates state-of-the-art image representation techniques that significantly advance the ability to capture semantic complexity in image data for the purpose of visual topic modeling. Second, it extends the statistical underpinnings of traditional text topic models to accept continuous embeddings to leverage the signature strength of mixed membership models for the analysis of image data. Third, we provide an easy-to-use software package designed for scalability and flexibility.
2 Visual topics and image representation
We conceive of a visual topic as a meaningful collation of elements recurring in images. Elements are features derived from the arrangement of pixels. They may range from low-level features such as color to high-level entities such as “person,” “protester,” or “Greta Thunberg.” Technically, a visual topic is a distribution over these elements, analogous to how textual topics are distributions over words in text topic models. However, the elements constituting images are not necessarily discrete (as words in text are), and individual elements do not necessarily carry a self-contained meaning (as words do). Moreover, in text, units are organized in a natural hierarchy of meaning (e.g., letters form words and words form sentences), such that the underpinning of a topic is intuitive and direct—a set of words that co-occur with high probability. By contrast, digital images store information as pixels, which lack explicit semantic structure. Defining a visual topic in terms of pixels would be similar to defining a text topic in terms of letters.
This means that different types of visual topics are possible: the (combination of) elements that we use to represent an image shape the meaning we can extract and what the resulting topics emphasize. Visual content can involve one or several semantic layers. Broadly, these include a graphical layer of low-level features extracted from pixels, such as color, brightness and shapes, which can project emotion and meaning (Kress and Van Leeuwen Reference Kress and Van Leeuwen2020), and a literal layer that brings into play the denotative representational meaning of high-level features, the objects depicted in the image (Barthes Reference Barthes1977). Yet another layer of connotative meaning emerges in elements beyond the depiction, in the cultural, ideological, and emotional associations that are invoked for specific audiences (Barthes Reference Barthes1977).
Visual content relevant for political analysis will typically assume a complex interaction of several layers, even if a single layer may constitute the key analytical focus in particular studies. For example, some may focus on low-level features, such as color, brightness, and graphics and their role in content and its effects, such as how they frame content (e.g., Chen et al. Reference Chen, Kim, Gao and Raschka2022; Curini, Moffitt, and Zulianello Reference Curini, Moffitt and Zulianello2024; Qian et al. Reference Qian, Yingdan, Peng, Shen and Huacen2024; Torres Reference Torres2024), engage audiences (e.g., Lu and Pan Reference Lu and Pan2022; Qian et al. Reference Qian, Yingdan, Peng, Shen and Huacen2024) or cue credibility and trust (e.g., Billard and Moran Reference Billard and Moran2023; Peng, Lu, and Shen Reference Peng, Lu and Shen2023; Von Sikorski Reference Von Sikorski2022). In other cases, focus centers on the persuasive use of high-level features, such as symbols, faces and casual settings (e.g., Farkas and Bene Reference Farkas and Bene2021; León, Negredo, and Erviti Reference León, Negredo and Erviti2022; Peng Reference Peng2021; Segerberg and Magnani Reference Segerberg and Magnani2025). Pursuing simple semantics with focus on one layer can be parsimonious and powerful, but in other cases, it is important to capture a more complex interaction of layers. This can be the case when trying to capture content themes that depend on, but are not reducible to, specific visual features. Examples of this could be a breast cancer topic with images of women and pink ribbons symbolizing cancer awareness and support, or a visual topic of climate science criticism consisting of conceptually related, yet visually distinct content, such as data visualizations, historical news clippings and weather photographs.
The distinctive character of visual semantics also means that computer vision can offer a variety of approaches to represent images as numerical vectors (image embeddings) to retain meaning for use in statistical analysis. The choice of embedding is a key operationalization, as it defines what it means for images to be similar and likely to share a topic. Depending on the embedding, topics can differently emphasize the various layers of meaning and the complexity with which they interact.
2.1 Three paradigms of image representation
Computer vision approaches to image representation have evolved profoundly over recent decades. For our purposes, three paradigm shifts are relevant. Each offers conceptual and performance advances that support distinct paths to modeling visual topics. Continuous embeddings are important in these developments: the more we move toward complex semantic layers, the more we need to draw on continuous embeddings.
2.1.1 Feature engineering
Early approaches focused on extracting low-level features by designing algorithms to detect specific patterns in images, like textures and edges (Dalal and Triggs Reference Dalal and Triggs2005; Ojala, Pietikäinen, and Harwood Reference Ojala, Pietikäinen and Harwood1996). A key example is the bag-of-visual-words (BoVW) model, which extracts distinctive local patches, clusters them into a visual vocabulary and represents each image by the frequency of these visual “words” (Csurka et al. Reference Csurka, Dance, Fan, Willamowski and Bray2004; Sivic and Zisserman Reference Sivic and Zisserman2003). Using low-level descriptors like SIFT (Lowe Reference Lowe2004), BoVW provides a discrete representation designed to identify textural elements and simple shapes. This is useful for literally themed topics based on distinctive graphical details, such as the presence of barbed wire fences in media coverage of migrants (see Torres Reference Torres2024). However, because representations produced by BoVW ignore spatial relationships and higher-level semantic concepts, images that share local elements but are fundamentally different (e.g., a protest, parade or “migrant caravan”) risk being associated with the same topic.
2.1.2 Supervised feature learning
The shift to deep learning marked a significant leap for computational image analysis. Architectures like VGG and ResNet learn hierarchical features in a supervised manner, optimized to classify images into a predefined set of human-annotated labels (e.g., 1,000 classes in ImageNet; Krizhevsky, Sutskever, and Hinton Reference Krizhevsky, Sutskever and Hinton2012). Similarly, large datasets (e.g., COCO; Lin et al. Reference Lin2014) have been gathered to train deep object detection models, to identify if and where the object categories in the training data are present in an input image.
Scholz et al. (Reference Scholz, Weidmann, Steinert-Threlkeld, Keremoğlu and Goldlücke2024) suggest that pretrained object detectors can be used to produce discrete image representations whose elements are the detected objects, to then train an image classifier. Used for topic modeling, this representation would discern visual topics based on the objects the model was trained to detect, which is both a strength—since the elements are easily interpretable—and a constraint, since it is limited to these categories. Training data may lack key categories, or they may be too coarse (e.g., reducing “politicians shaking hands” to “people”). Additionally, this representation overlooks spatial arrangement and composition (e.g., shot angles that convey power dynamics) or other graphical properties that may carry salience in political analysis (e.g., color grading that shifts emotional resonance).
Alternatively, continuous embeddings can be extracted from a network’s intermediate layer. With models pretrained on large datasets, these embeddings can outperform earlier representations used in social science (Zhang and Peng Reference Zhang and Peng2022). Unlike the former, continuous embeddings capture not only the denotative objects but also their hierarchical and relational properties. This means that topics could be defined in terms of, and differently emphasize, graphical elements (e.g., color) or more semantically meaningful categories (e.g., people), depending on which layer is used (Yosinski et al. Reference Yosinski, Clune, Bengio and Lipson2014; Zeiler and Fergus Reference Zeiler and Fergus2014). However, their elements (the values in the numerical vector constituting the embedding) are inherently bespoke as they are encouraged to capture variability in the categories of the training data, thereby often emphasizing denotative semantics (Arminio et al. Reference Arminio, Magnani, Piqueras, Rossi and Segerberg2026 ).
2.1.3 Self-supervised and weakly supervised feature learning
A third paradigm shifts toward task-agnostic representations learned through self-supervised or weakly supervised methods on much larger datasets, eliminating the need for expensive human annotations. These off-the-shelf continuous embeddings significantly advance the capacity to capture semantically complex visual topics, including ones that emphasize the connotative layer. Still, each approach encodes distinct assumptions.
One set of models, often based on the Vision Transformer architecture (ViT; Dosovitskiy et al. Reference Dosovitskiy2021), excel at complex topics with graphical and literal emphasis. Self-supervised models like DINO learn exclusively from images by producing similar embeddings for different augmented views (e.g., crops and color shifts) of the same image (Caron et al. Reference Caron2021). This process leads to high-quality semantic segmentation and a remarkable pixel-level understanding of how objects are arranged and interact in a scene. For instance, in the image of politicians shaking hands, DINO embeddings may capture rich details beyond the objects themselves, including the background (e.g., flag and podium), composition (e.g., close-up and wide shot), interaction, attire, posture, facial expression and other graphical details (e.g., color grading).
A second approach uses text as a supervisory signal. Models like CLIP (Radford et al. Reference Radford2021) are trained on a massive number of image–text pairs to learn a shared embedding space, where corresponding images and text are close together. This allows CLIP to learn comprehensive visual representations that move beyond typical object labels. Consequently, CLIP can in principle capture semantically complex visual topics based on conceptual and abstract themes that integrally involve the image. It can associate objects and symbols with larger entities, such as geographic location (e.g., the Eiffel Tower with Paris), and detect projected emotion, human traits, abstract concepts (e.g., “LGBTQ+”) and visual styles like anime (Goh et al. Reference Goh2021).
A final, emerging, paradigm involves generative models. Large language models (LLMs) increasingly incorporate a translation layer connecting image encoders (like CLIP or DINO) to a language model, allowing diverse inputs to be processed through a common textual interface (e.g., Li et al. Reference Li, Li, Savarese and Hoi2023; Liu et al. Reference Liu, Li, Wu and Lee2023). Instead of a fixed representation, LLMs enable researchers to generate highly problem-specific and tailored textual descriptions. For example, the model can be prompted to focus on visual framing or emotional tone, or contextualize the image using accompanying text (e.g., a social media post). This approach can be used to cluster images based on their connotative meaning by first embedding the descriptions using a sentence transformer (Arminio et al. Reference Arminio, Magnani, Piqueras, Rossi and Segerberg2026). While offering unparalleled flexibility, a drawback is the potential semantic gap, as the textual description may omit image-native visual details.
2.2 Previous approaches to visual topic modeling
Pioneering work to tackle political image data with topic models has largely focused on the first two paradigms, remaining in the domain of graphical and literal visual topics. These approaches fall into two tracks.
2.2.1 Discrete feature approaches
This track uses a logic familiar from and compatible with traditional topic models, which operate on a document-term matrix. Torres (Reference Torres2024) skillfully exploits the discrete representation of images in BoVW to combine it with a structural topic model. Kim and Bas (Reference Kim and Bas2023) use a commercial object detection model to extract and count objects as input into a topic model, which could similarly be done using open-source models as suggested by Scholz et al. (Reference Scholz, Weidmann, Steinert-Threlkeld, Keremoğlu and Goldlücke2024) for supervised classification. The advantage here is smooth integration into existing topic model toolkits. The drawback is the difficulty in rendering semantically complex topics or being tied to pre-existing categories.
2.2.2 Single-membership clustering
The other track circumvents the topic modeling framework by using pretrained image embeddings for single-membership clustering (Joshi and Buntain Reference Joshi and Buntain2024; Mooseder et al. Reference Mooseder, Brantner, Zamith and Pfeffer2023; Muise et al. Reference Muise, Yingdan, Pan and Reeves2022; Peng Reference Peng2021). This track has been shown to produce more visually coherent clusters when compared to BoVW on image datasets based on political memes, protest, and climate change (Zhang and Peng Reference Zhang and Peng2022). Nevertheless, the approach has two limitations. One is that in the case of supervised pretrained embeddings, the clusters still emphasize graphical and literal similarity over connotative or conceptual similarity. For example, a cluster might effectively group “image types” (e.g., infographics), but risks overlooking distinct, ideologically relevant, meanings within those types (Joshi and Buntain Reference Joshi and Buntain2024). As this can in principle be addressed using other types of embeddings, a more fundamental limitation is the assignment of images to a single cluster. Semantically rich visual content can refer to several themes, and single-membership may obscure analytical insights, for example, when graphical format topics (e.g., “memes” or “posters”) dominate over literal content topics (e.g., “people”), even if the latter is present in the former.
2.3 Toward a vSTM with continuous embeddings
We contend that it is desirable for visual topic modeling in the context of political analysis to draw on approaches that can offer a spectrum of possible emphases (i.e., can capture graphical and literal, but also connotative similarity) and have the capacity to handle complex semantics in which multiple semantic layers of visual meaning come into play—that is, approaches based on continuous embeddings. We also hold that it is important to retain the flexibility of mixed membership modeling in semantically complex contexts.
There are two potential obstacles to moving in this direction. The first centers on interpretability. A critique of continuous embeddings is their opacity when used as model inputs compared to more straightforward discrete features (Scholz et al. Reference Scholz, Weidmann, Steinert-Threlkeld, Keremoğlu and Goldlücke2024; Torres Reference Torres2024). However, the balance is reversed when interpreting output-side topics. In the case of semantically complex images, a representation that is too simple risks producing topics that are less coherent and meaningful, and consequently difficult to interpret. We acknowledge that embracing continuous embeddings shifts the onus of interpretability to robust post hoc interpretation. As reported below, the vSTM therefore provides a number of outputs that can be used in this manner. We also provide evidence for the claim that the vSTM with continuous embeddings provides comparatively more interpretable and meaningful topics.
The other potential obstacle is that incorporating continuous embeddings requires an alternative formulation of the statistical underpinnings of the topic model. In the next section, we therefore provide such a formulation, extending a mixed-membership model that enables us to think of image embeddings as a weighted sum of topics and topic proportions. Our contribution is two fold. First, we introduce a hierarchical prior for topic proportions, linking covariates to the prevalence of topics through a generalized linear model, analogous to how STM extends LDA and CTM (Blei and Lafferty Reference Blei and Lafferty2006; Blei, Ng, and Jordan Reference Blei, Ng and Jordan2003). Second, we focus on scalability, implementing and demonstrating how the model can be estimated using stochastic variational inference (Hoffman et al. Reference Hoffman, Blei, Wang and Paisley2013; Kucukelbir et al. Reference Kucukelbir, Tran, Ranganath, Gelman and Blei2017). This makes it feasible to explore several topic models in large image datasets, while also facilitating extensions and modifications of the model.
3 The visual STM
The vSTM is similar in spirit to the structural topic model for text in that the prevalence of topics depends on covariates through a generalized linear model (Roberts et al. Reference Roberts2014). To accommodate continuous embeddings, we draw on a set of related methods for modeling data as convex combinations of real-valued mixture components (Cutler and Breiman Reference Cutler and Breiman1994; Giesen et al. Reference Giesen, Kahlmeyer, Laue, Mitterreiter, Nussbaum and Staudt2023; Heller, Williamson, and Ghahramani Reference Heller, Williamson and Ghahramani2008). We refer to the components as topics and their mixture weights as topic proportions. The vSTM differs from word-embedding topic models (e.g., Das, Zaheer, and Dyer Reference Das, Zaheer, Dyer, Zong and Strube2015; Dieng, Ruiz, and Blei Reference Dieng, Ruiz and Blei2020) as it operates on a single embedding per observation, and unlike multimodal topic models (Bianchi, Terragni, and Hovy Reference Bianchi, Terragni and Hovy2021; Zosa and Pivovarova Reference Zosa, Pivovarova and Calzolari2022), our model does not require training neural networks or paired text–image data.
3.1 Statistical model
Plate diagram of the generative model of vSTM.
$\boldsymbol {\beta }_k$
is a topic,
$\boldsymbol {\theta }_i$
is the vector of topic proportions for image i,
$\boldsymbol {\Gamma }$
is the matrix of topic prevalence coefficients,
$\boldsymbol {z}_i$
is the image embedding and
$\boldsymbol {x}_i$
are image-level covariates
.

Figure 1 Long description
The diagram shows the dependencies in the visual Structural Topic Model. Image-level covariates, xi, and topic-prevalence coefficients, Γ, influence image-specific topic proportions, θi. Topic proportions and topic vectors, βk, in turn determine the image embedding, zi. Variables xi, θi, and zi are repeated for images i ε N, while βk is repeated for topics k=1, …, k.
Formally, our data consist of N image embeddings
$\boldsymbol {z}_i \in \mathbb {R}^D$
and image-level covariates
$\boldsymbol {x}_i \in \mathbb {R}^P$
, assumed to influence the prevalence of visual topics. We model each image embedding
$\boldsymbol {z}_i$
using a normal distribution
where K is the number of topics,
$\boldsymbol {\theta }_i$
is a vector of topic proportions, such that
$\theta _{i,k} \geq 0$
and
$\sum _k \theta _{i,k} = 1$
, and
$\boldsymbol {\beta } = \left [\boldsymbol {\beta }_1, \dots , \boldsymbol {\beta }_K\right ]^T$
is a matrix of topics, where (Figure 1)
$\boldsymbol {\beta }_k \in \mathbb {R}^D$
. The image-specific topic proportions thus define how much each topic contributes to
$\boldsymbol {z}_i$
. A specific topic
$\boldsymbol {\beta }_k$
is a point in the embedding space. If
$\boldsymbol {z}_i$
is close to
$\boldsymbol {\beta }_k$
, then the corresponding topic proportion
$\theta _{i,k}$
will also tend to be “large.”
$\boldsymbol {\Sigma }_z$
is the covariance matrix.
Topic proportions are sampled from a logistic-normal distribution, whose mean depends on the covariates
$\boldsymbol {x}_{i} \in \mathbb {R}^P$
and a set of topic prevalence coefficients
$\boldsymbol {\Gamma } \in {\mathbb {R}^{P \times (K-1)}}$
This reflects the idea that images with similar covariates are also more likely to use the same topics. To ensure statistical identifiability,
$\boldsymbol {\eta }_i$
is sampled as a
$(K-1)$
-dimensional Gaussian and mapped to the K-dimensional simplex via a transformation function f, rather than using an overparameterized K-dimensional softmax. This projection resolves the translation invariance of the standard softmax by anchoring the latent space. Our software defaults to the isometric log-ratio (ILR) transformation for this mapping, although other options like appending a fixed reference value (e.g., zero) to
$\boldsymbol {\eta }_i$
achieve the same identifiability. Unlike the Dirichlet distribution, this construction allows correlations between topics to be modeled explicitly (Aitchison and Shen Reference Aitchison and Shen1980; Blei and Lafferty Reference Blei and Lafferty2006). We additionally implement a sparsemax transformation (Martins and Astudillo Reference Martins and Astudillo2016) as an alternative to the ILR link, which can generate sparser topic proportions.
We also place priors on
$\boldsymbol {\beta }_k, \boldsymbol {\Sigma }_z, \boldsymbol {\Sigma }_\theta $
and
$\boldsymbol {\Gamma }$
. We use student-t distributions for
and
$\beta _{k,d} \sim \text {student-t}(\nu _\beta , 0, \sigma _{\beta })$
. Similar to Gaussian mixture models, multiple parameterizations are possible for the likelihood covariance
$\boldsymbol {\Sigma }_z$
, in this case, reflecting different assumptions about the error structure of the embeddings (see also Gruhl and Erosheva Reference Gruhl and Erosheva2014; Heller, Williamson, and Ghahramani Reference Heller, Williamson and Ghahramani2008). A simple covariance (e.g.,
$\boldsymbol {\Sigma }_z=\sigma _z\boldsymbol {I}$
) with fixed
$\sigma _z$
can work well in practice. Crucially, the choice must be considered in light of the specific geometry of the embeddings. In our analysis in Section 5.1, we found L2-normalizing the embeddings prior to fitting the model, and calibrating the variance to the hypersphere by scaling the standard deviation by
$1/\sqrt {D}$
(since the expected magnitude of any single dimension on a unit hypersphere decreases as dimensionality D increases) to be robust and work well across different embeddings.
Finally, we decompose the topic proportion covariance
$\boldsymbol {\Sigma }_{\theta }$
into a correlation matrix
$\boldsymbol {\Omega }_{\theta }$
and standard deviations
$\boldsymbol {\sigma }_{\theta }$
, such that
$\boldsymbol {\Sigma }_{\theta } = \text {diag}(\boldsymbol {\sigma }_{\theta }) \boldsymbol {\Omega }_{\theta } \text {diag}(\boldsymbol {\sigma }_{\theta })$
. We use the Lewandowski–Kurowicka–Joe (LKJ) prior on
$\boldsymbol {\Omega }_{\theta } \sim \text {LKJ}(\eta _{\theta })$
, where
$\eta _{\theta }>0$
controls the degree of correlation between the visual topics. A value of
$\eta _{\theta } = 1$
corresponds to a uniform distribution over correlation matrices, while values greater than one concentrate more mass around the diagonal (Lewandowski, Kurowicka, and Joe Reference Lewandowski, Kurowicka and Joe2009). More specific details on the priors and hyperparameters used in Sections 4 and 5 are deferred to the Supplementary Material.
3.2 Inference
We implement model inference to be flexible and scalable. Specifically, vSTM utilizes the automatic differentiation and parallelization capabilities of the Python library JAX (Bradbury et al. Reference Bradbury2018). This enables the user of our software to defer heavy computations to a GPU (if available), and to leverage existing implementations of state-of-the-art inference algorithms implemented in libraries like BlackJAX and NumPyro (Cabezas et al. Reference Cabezas2024; Phan, Pradhan, and Jankowiak Reference Phan, Pradhan and Jankowiak2019). We make this easy by defining the model’s log joint density
$p(\boldsymbol {\theta }_i, \boldsymbol {\beta }, \boldsymbol {\Gamma }, \boldsymbol {\Omega }_\theta , \boldsymbol {\sigma }_\theta , \boldsymbol {\sigma }_z \vert \boldsymbol {z}_i, \boldsymbol {x}_i)$
and gradient
$\nabla \log p(\boldsymbol {\theta }_i, \boldsymbol {\beta }, \boldsymbol {\Gamma }, \boldsymbol {\Omega }_\theta , \boldsymbol {\sigma }_\theta , \boldsymbol {\sigma }_z \vert \boldsymbol {z}_i, \boldsymbol {x}_i)$
, conditioned on the data, in terms of parameters in an unconstrained space. Necessary reparameterizations and Jacobian adjustments (due to a change of variable) for constrained parameters (e.g., topic proportions
$\boldsymbol {\theta }_i$
) are handled internally. This is similar to the approach in probabilistic programming languages like Stan (Stan Development Team 2024) and is what enables compatibility with a wide range of general-purpose optimization and sampling methods that are designed for unconstrained spaces.
In this article, we use mean-field variational inference (MF-VI) throughout. We describe the details of our implementation and how we make it scalable to large data in Section D of the Supplementary Material. Since VI is known to underestimate the uncertainty of the posterior distribution, but can provide good point estimates of the posterior mean (Wang and Blei Reference Wang and Blei2019), our focus is on the latter. These quantities are often of primary interest, so we argue that VI offers a practical trade-off that is often reasonable in topic modeling contexts where the researcher is likely to explore many models. Furthermore, recent work has shown that making accurate statistical and causal inferences using latent quantities inferred from unstructured data, requires additional considerations at a more fundamental level than the choice of a particular inference method (Egami et al. Reference Egami, Fong, Grimmer, Roberts and Stewart2022, Reference Egami, Hinck, Stewart and Wei2023).
3.3 Covariates and topic prevalence
A key output of the model is the relation between the covariates and topic prevalence. Since the image-level covariates
$\boldsymbol {x}_i$
map to topic proportions
$\boldsymbol {\theta }_i$
nonlinearly, we characterize the relationship more interpretably via the marginal distribution of topic proportions
where
$\boldsymbol {\eta }_i \sim \text {normal}(\boldsymbol {x}_i\boldsymbol {\widehat {\Gamma }}, \boldsymbol {\widehat {\Sigma }}_\theta )$
, f is the function mapping
$\boldsymbol {\eta }_i$
to the simplex and
$\boldsymbol {\widehat {\Gamma }}$
and
$\boldsymbol {\widehat {\Sigma }}_\theta $
are point estimates of the prevalence coefficients and covariance matrix of topic proportions.
In practice, the researcher can use Equation (3) to predict the value of topic proportions at some specific covariate values of interest, use predictions at different values to make comparisons or compute an average prediction over a range of values. We show a concrete example in Section 4.
3.4 Interpreting the topic-element distribution
The vSTM can in principle be combined with many types of image representations, some of which are more easily interpretable, while others contain elements that do not individually carry a clear meaning. As discussed in Section 2.1, less interpretable representations can be desirable for capturing complex semantics. In both cases, we need a procedure to summarize the topic distribution
$\boldsymbol {\beta }_k$
.
When the input is already based on interpretable elements, the interpretation is straightforward, as we can simply look at the elements that are the most characteristic for the images associated with each topic.
When image embeddings are difficult to interpret directly, it is still possible to obtain interpretable summaries of the topics post hoc using an auxiliary representation of the images. Let
$\tilde {\boldsymbol {z}}_i$
be an auxiliary representation of
$\boldsymbol {z}_i$
, with interpretable elements. The probability of any particular element appearing in topic k is then
where
$\hat {\boldsymbol {\theta }}_i$
are the topic proportions obtained from the vSTM. As
$\tilde {\boldsymbol {\beta }}_k$
is now a distribution over interpretable elements, it can be analyzed directly or be used for calculating other quantities, such as frequent and exclusive (FREX) keywords (Bischof and Airoldi Reference Bischof and Airoldi2012).
We view this approach as complementary to the necessary step of inspecting representative images, regardless of the embedding type. Sections 4 and 5 exemplify the trickier case when embeddings are less interpretable. In both cases, we use CLIP to produce the input embeddings (
$\boldsymbol {z}_i$
) and an LLM to generate text descriptions, which are encoded into an image-term matrix (
$\boldsymbol {\tilde {z}}_i$
). We note that this approach, in principle, can be used for any type of (input or auxiliary) interpretable elements, for example, object detection labels (Scholz et al. Reference Scholz, Weidmann, Steinert-Threlkeld, Keremoğlu and Goldlücke2024) or visual words (Torres Reference Torres2024).
4 Applying the model: Visual topics and their interpretation
This section uses an example from online climate communication to showcase the steps involved in applying the vSTM. We provide the code to fit the model efficiently on large-scale data as an easy-to-use software package, which also includes tools to aid interpretation, as shown in this section.
4.1 Data and setup
We focus on Twitter/X communication around United Nations Climate Change Conferences (COP) 21–27. The data consist of
$154{,}177$
unique images posted with the #COP2X hashtag by the most active users in the hashtag stream (
$N=1{,}707$
), defined by the number of posts. We use the COP year, stakeholder type, and stance as our image-level covariates, assumed to influence the prevalence of visual topics. Each account was manually coded according to stakeholder type based on profile description, following a coding scheme developed from Mooseder et al. (Reference Mooseder, Brantner, Zamith and Pfeffer2023). We also manually coded the account stance toward progressive climate action (for/against/unclear), based on profile description and recent (multi-modal) post content.
4.1.1 Step 1: Choosing the embedding model
A first step in applying the vSTM is choosing which embeddings to use. Many factors influence how the meaning of images is encoded.
Table 1 gives an overview of example embeddings, following our discussion in Section 2. If research goals require connotative and complex topics, we recommend a “CLIP-style” embedding. These embeddings are easy and fast to generate and can represent semantic layers that extend beyond literal depiction. For more tailored representations, using an LLM as in Arminio et al. (Reference Arminio, Magnani, Piqueras, Rossi and Segerberg2026) is also a good option. Pretrained embeddings from models trained under a supervised objective (e.g., VGG16 on ImageNet) should be considered primarily if the training data and learning task closely resemble the analysis data. If the goals of the research call for graphically and/or literally defined topics, self-supervised models (e.g., DINO) are likely to offer good off-the-shelf performance. We provide initial evidence of these claims in Section B of the Supplementary Material, by evaluating the coherence of topics resulting from different embeddings, in terms of denotation (what is depicted) and connotation (the implied meaning), under different embeddings.
Image embedding options
.

Table 1 Long Description
The table has three columns: paradigm, example model, and embedding semantics. Supervised learning is represented by pretrained VGG16 and described as having bespoke semantics tied to categories in the pretraining data. Self-supervised learning is represented by DINO and captures graphical and literal semantics. Weakly supervised learning is represented by CLIP and captures graphical, literal, and connotative semantics. Generative AI is represented by Gemma 3 and offers tailored semantics that can be steered using a prompt.
Note: The table shows example models that can be used to extract embeddings. 1. By bespoke, we mean that the semantics are tied to categories in pretraining data (e.g., ImageNet). 2. Tailored refers to the possibility to steer the focus of the embedding using a prompt.
In this section, we use CLIP’s image encoder as an example to show how the model is run step by step.Footnote 1
4.1.2 Step 2: Selecting the number of topics
The next step is to select the number of topics. To this end, two sets of diagnostics can provide practical guidance in narrowing down a range or selection of models to consider for further inspection.
The first concerns the predictive performance of the model. In this regard, we use five-fold cross-validation to compute perplexity, which is the exponential of the negative log likelihood on held-out data, normalized by the number of held-out observations and embedding dimensions. Lower perplexity indicates that the model, relatively speaking, is better at predicting unseen data. Since topic proportions are local to each image, we fit new ones for the held-out set, while keeping global parameters fixed.
In addition, coherence, and exclusivity scores (details in Section A.3 of the Supplementary Material) can serve as a surrogate for semantic validity—how internally coherent and yet distinctive the topics are (Quinn et al. Reference Quinn, Monroe, Colaresi, Crespin and Radev2010). Figure 2 shows the diagnostics for several models, varying the number of topics between
$10$
and
$150$
. The left panel shows perplexity, averaged over five held-out sets. It initially decreases sharply, before leveling off around
$K=50$
, and later increases again. The right panel reports coherence and exclusivity averaged over all topics. Low exclusivity suggests that many topics are similar to each other, while low coherence indicates that the images within a topic are more heterogeneous.
Diagnostics for model selection. The left panel shows perplexity, averaged over five held-out sets. The right panel shows coherence and exclusivity for each model, averaged over all topics
.

Figure 2 Long description
The left panel plots perplexity against the number of topics from 10 to 150. Perplexity decreases rapidly at first, reaches its lowest region at roughly 60–80 topics, and then increases slightly. The right panel plots exclusivity against coherence, with each point labelled by the number of topics. Models with fewer topics generally have greater exclusivity and lower coherence, while models with more topics generally have higher coherence and lower exclusivity. The model with 45 topics is highlighted as a compromise between these diagnostics.
In this example, we select
$K=45$
as a model that offers a balance between coherence, exclusivity and perplexity. We emphasize that this decision is ultimately made in a specific research context, where priorities can differ. The figure should in this sense not be read prescriptively, but rather as a tool to navigate how the model behaves as the resolution (broad vs. fine-grained topics) increases or decreases.
4.1.3 Step 3: Validation of topic coherence
As with any unsupervised method, manual validation is crucial (Grimmer, Roberts, and Stewart Reference Grimmer, Roberts and Stewart2021; Quinn et al. Reference Quinn, Monroe, Colaresi, Crespin and Radev2010). Step 2 provides a range of K’s where the model, relatively speaking, performs well with respect to a mathematical operationalization of what “well” means (e.g., topics are well separated in Euclidean space). Although useful given the computational and time constraints faced in practice, a good score does not necessarily imply that topics are meaningful to humans. Thus, to test more systematically if topics are coherent, we adapt the word-intrusion task to images (Chang et al. Reference Chang, Gerrish, Wang, Boyd-Graber and Blei2009; Ying, Montgomery, and Stewart Reference Ying, Montgomery and Stewart2022). We tasked four researchers to perform
$100$
evaluations, where each task consists of identifying the “intruder” in a set of four images, where three are associated with the same topic, and the fourth (“intruder”) is from a different topic. The results show that evaluators are able to identify the intruder around
$65\%$
of the time, even as the same-topic images are drawn randomly from the pool of images where the topic is the largest (i.e.,
$k = \arg \max _k \theta _{ik}$
), rather than from the top of the distribution. This indicates that evaluators intuitively perceived topics as representing the same theme or concept. Further details regarding the procedure and additional considerations on the task design are provided in Section A.4 of the Supplementary Material.
4.1.4 Step 4: Interpreting and labeling topics
Step 4 is to interpret and label topics. We maintain that it is important to include an image-native approach to interpreting visual topics. In contrast to reading representative documents, inspecting a large number of images is fast and intuitive. In order to label topics, we recommend visualizing images that are representative for each topic (see also Torres Reference Torres2024; Zhang and Peng Reference Zhang and Peng2022). One can consider either the top N images with the highest topic proportion
$\theta _{ik}$
for each k, or a random sample of images with high proportions. The former provides a sense of what prototypical images look like; the latter gives a better sense of the variety of images included, and if the meaning is still coherent in less pronounced cases.
As a complement, the approach in Section 3.4 can be used to generate an interpretable representation of topics post hoc, using both images and text. Here, we use the Gemma 3 model (Gemma Team et al. 2025) to generate a description for each image, using a simple open-ended prompt.Footnote
2
A part-of-speech tagger is then used to extract relevant word classes (nouns, verbs, and adjectives) from the descriptions, which are transformed into an image-term matrix
$\tilde {\boldsymbol {Z}} \in \mathbb {N}^{N \times V}$
, where V is the number of unique terms. We then compute the topic-term distribution
$\tilde {\boldsymbol {\beta }_k}$
using Equation (4) and use this to derive FREX scores (Bischof and Airoldi Reference Bischof and Airoldi2012).
We assign topic labels by inspecting 50 top images and a random sample of 200 images for each topic. We also look at the top 25 FREX nouns, verbs and adjectives for each topic. Figure 3 shows an example of what this looks like in practice, for a selection of topics. In this case, we find that topics are generally coherent but some are more difficult to label than others, mainly due to being similar to other topics. We include an overview of all topics and broader macro-topic categories in Table 1 in the Supplementary Material.
Top six images from a selection of topics. The top FREX nouns, verbs, and adjectives of a topic are shown above the images and are identified automatically using a part-of-speech tagger on the LLM image descriptions
.

Figure 3 Long description
Six horizontal rows each show six representative images with FREX nouns, verbs, and adjectives. Climate activism contains demonstrations, crowds, and climate-protest signs. Nature contains lakes, forests, mountains, turquoise water, and streams. Political commentary contains cartoons, memes, and satirical illustrations. Political leaders contains close-up or podium photographs of political figures. Causes and consequences contains industrial facilities, smokestacks, smoke or steam, and fire. Event flyers contains text-heavy promotional graphics for climate-related webinars and events.
4.1.5 Step 5: Analyzing covariates and topic prevalence
While steps 1–4 are generally applicable, the use of further parameters for analysis depends on the research question. This said, a key output of the model is
$\boldsymbol {\Gamma }$
, which characterizes how image-level covariates influence the prevalence of topics.
Figure 4 exemplifies this in the context of a question that concerns the online discourse of actors for and against progressive climate action. It shows how, in our case, topics vary by actor type, stance, and COP event for a selection of topics, computed using the marginal distribution of topic proportions (Equation 3). Top-producing private individual accounts are likely to post images of “climate activism,” but diverge in their rendition: “For” accounts post undramatic images of turnout in street demonstrations; “against” accounts post images that follow a delegitimizing “protest paradigm” frame (Chan and Lee Reference Chan and Lee1984) by highlighting police confrontations, disruption (e.g., blocking traffic) or spectacle (e.g., activists dressed in costumes). As a group, top-producing politicians, business actors, and scientists post a different set of topics, such as witnessing conference scenes (e.g., “climate panels”). Journalistic actors document summit scenes, political elites, and protests. Their visual coverage of summit scenes (e.g., “event spaces”) decreases, correlating with the pandemic and increasing constraints on media access (Hayes and O’Neill Reference Hayes and O’Neill2025).
Predicted topic proportions by actor type and stance, across each COP for a selection of topics. Topics with a “
$+$
” are merged into one
.

Figure 4 Long description
Four panels plot predicted topic proportions across COP21–COP27. Blue lines represent actors supporting progressive climate action and orange lines actors against it; marker shapes indicate political, private, journalistic, advocacy, business, and scientific actors. Climate activism varies mostly between about 1 and 10 percent. Political commentary is substantially higher for some actors against climate action, reaching close to 20 percent. Event spaces and venues are generally more prevalent before COP26 and decline sharply at COP26. Climate panels and presentations increase substantially around COP23–COP25, drop at COP26, and rise again at COP27.
Note that our focus here is to show the model in application, and that this figure should be interpreted with caution. Recall that the data consist of unique images posted by highly productive accounts, not the most popular content. There were only a handful of accounts with a stance “against” climate action in this data.
5 Comparison to existing approaches
We now proceed to compare vSTM to other approaches to visual structural topic modeling both quantitatively and qualitatively. Currently, the BoVW representation model combined with STM is the most established approach and constitutes the state of the art in a social science context (Torres Reference Torres2024). In the quantitative comparison, we also compare vSTM to STM applied to object detection labels and LLM-generated image descriptions. While not previously evaluated for topic modeling, these discrete visual elements have been proposed as useful representations for classification and clustering tasks (Arminio et al. Reference Arminio, Magnani, Piqueras, Rossi and Segerberg2026; Scholz et al. Reference Scholz, Weidmann, Steinert-Threlkeld, Keremoğlu and Goldlücke2024).
5.1 Semantic validity of topics
We compare the semantic validity of topics produced by vSTM to discrete approaches with STM. We use a dataset of almost 12,000 images related to climate communication from Zhang and Peng (Reference Zhang and Peng2022), for which Arminio et al. (Reference Arminio, Magnani, Piqueras, Rossi and Segerberg2026) produced expert annotations for 500 pairs of images that were annotated for their denotative and connotative similarity on a three-point scale (0 = unrelated, 1 = somewhat related and 2 = closely related). To quantify semantic validity, we use the connotative annotations to adopt a measure for clustering quality from Grimmer and King (Reference Grimmer and King2011). We assign each image to its dominant topic and calculate a quality score Q as the average expert-rated similarity for same-topic pairs, minus the average expert-rated similarity for different-topic pairs. The maximum possible score is 2, the minimum is
$-$
2, and a score of 0 suggests that the model performs no better than random assignment.
We fit several configurations of vSTM and STM to the same set of images. For robustness, we test vSTM with two embeddings: CLIP and GPT4o-generated image descriptions, embedded using a sentence transformer.Footnote
3
For STM, we use BoVW, the same GPT4o descriptions, but represented in a document-feature matrix (DFM), and object detection labels produced by the YOLOE model (Wang et al. Reference Wang, Liu, Chen, Lin, Han and Ding2025). For BoVW, we must set the number of visual words that form the vocabulary. We test several sizes (500, 1,000, 2,500, 5,000, 7,500, and 10,000) and report here the one producing the best results, which is 2,500 visual words. For the object-based STM, we use YOLOE as it has a comparably large vocabulary (
$1,000+$
objects). We represent the images by the number of times an object appears in the image, akin to a DFM. A threshold on the confidence of the predictions must be set to determine which of the detected objects should be kept. This is a trade-off between accuracy and coverage. We use
$0.1$
, as we find that a lower threshold generally leads to better results on the evaluation, even as the labels are noisier. A higher threshold quickly leads to many images without a single label, which would force us to remove them from the analysis.Footnote
4
We vary the number of topics between
$10$
and
$100$
to avoid the risk of bias in favor of any particular approach. For each configuration, we fit the model 10 times. We use short-run LDA to initialize STM (Roberts, Stewart, and Tingley Reference Roberts, Stewart and Tingley2019) and draw the initial parameters from a uniform distribution for vSTM.
Figure 5 reports the average quality score Q with a
$95\%$
confidence interval. We find that more complex representations (CLIP+vSTM, GPT4o+vSTM, and GPT4o+STM) significantly outperform BoVW+STM and YOLOE+STM across all K. The results indicate that vSTM performs marginally better than STM with GPT4o representations for most K. This aligns with our expectation that converting a rich textual description into a simpler DFM leads to loss of information, which is avoided by vSTM’s use of transformer embeddings. While on average scoring lower than the GPT4o configurations, CLIP+vSTM performs remarkably well compared to BoVW+STM and YOLOE+STM. This is important. CLIP embeddings are available off the shelf, are generally much faster to obtain and do not require designing a prompt. Moreover, the GPT4o prompt was in this case explicitly tuned to summarize the connotative meaning of the images, whereas CLIP’s embeddings are general-purpose. Our main takeaway is that modern, complex image representations are crucial for good performance in visual topic modeling. The continuous vSTM framework is uniquely positioned to fully leverage the strength of these representations.
Quality score for different discrete and continuous configurations using STM and vSTM, respectively
.

Figure 5 Long description
The graph plots quality score Q against the number of topics from 10 to 100 for GPT4o+STM, YOLOE+STM, BoVW+STM, GPT4o+vSTM, and CLIP+vSTM. GPT4o+vSTM, GPT4o+STM, and CLIP+vSTM have substantially higher scores than YOLOE+STM and BoVW+STM across the topic range. GPT4o+vSTM reaches the highest scores at larger numbers of topics. Shaded regions show 95 percent confidence intervals.
5.2 Qualitative inspection of vSTM and bag of visual words + STM topics
We test vSTM’s capacity to generate topics that are coherent, interpretable, and accurate in capturing concepts of substantive interest in comparison to BoVW + STM. Therefore, we replicate Torres’s (Reference Torres2024) analysis of the extent to which media ideology affects coverage of a “caravan” of migrants attempting to enter the United States on foot. An STM is fitted to 688 images represented using a BoVW and identifies a topic of interest: the extent to which dense crowds are present in an image. The “Dense crowd” topic is assumed to be a frame that casts the size of the migrant group as a threat.
We applied vSTM using the same number of topics (
$15$
) as in the original study and identified those portraying large crowds and migrants. We again use CLIP to generate the image embeddings and Gemma 3 to produce image descriptions and generate topic keywords in the same way as in Section 4. Figures 6 and 7, respectively, show the three vSTM topics that portray migrants and the “Dense crowd” topic from Torres (Reference Torres2024). As the method for generating keywords is agnostic to how the topics were generated, we use the most representative images and top FREX nouns, verbs, and adjectives to label the topics in both cases.
Top 18 most representative images for three migrant topics. The top FREX keywords are computed using the method in Section 3.4
.

Figure 6 Long description
Three grids each contain 18 representative photographs. “Migrant caravan, distant view” shows very large groups travelling along roads and bridges, often photographed from above or at a distance. “Migrant caravan, close-up” shows smaller groups and individuals at street level, walking, waiting, travelling beside vehicles, and carrying belongings. “Children and circumstances” emphasizes children, families, resting or waiting, temporary conditions, limited belongings, and difficult circumstances. Each topic is accompanied by FREX nouns, verbs, and adjectives.
The top 18 most representative images for the “Dense crowd” topic from Torres (Reference Torres2024). The top FREX keywords are computed using the method in Section 3.4
.

Figure 7 Long description
The grid contains 18 representative photographs from the “Dense crowd” topic. Images include tightly packed crowds viewed from above, street gatherings, demonstrations with signs, rallies, seated audiences, public ceremonies, and groups of uniformed soldiers. Some images are dominated by dense crowds, while others contain smaller groups. FREX nouns, verbs, and adjectives are displayed above the grid.
The results show that the vSTM migrant topics are comparatively more coherent with respect to the semantic meaning, both in terms of how similar representative images are, and the interpretability of keywords. The topic “Migrant caravan (distant view)” consistently shows images of the caravan: people walking in a dense crowd, often taken from above or from a distance. The keywords contain words, such as caravan, dense, and migrant. Meanwhile, the “Dense crowd” topic discovered by the BoVW+STM approach is more ambiguous. Among the top images, we find pictures of protests, Trump rallies and soldiers. While the first two include dense crowds, they are arguably less relevant for the particular frame under study.
The upshot is that while the “Dense crowd” topic may better capture how much of a picture is filled with people, it is less likely to adequately capture what is actually portrayed. This suggests that relying on low-level visual features can produce topics that are well defined according to specific graphical or literal criteria but fail to capture meaning in a broader sense. In contrast, by relying on a more powerful representation (here CLIP), vSTM can produce semantically valid topics that are easier to interpret. The other topics in Figure 6 are similarly meaningful yet distinct in portraying migrant groups. For example, the topic we label “Children and circumstances” emphasizes difficult circumstances and vulnerable individuals, especially mothers with children, rather than the size of the caravan.
6 Concluding remarks
Topic models have become a standard tool for large-scale content analysis of text in the social sciences. As visual data become more central in political life, there is a growing need for similar methods that can systematically categorize images. To meaningfully help address questions on the basis of large-scale visual digital communication and trace data, such methods need to encompass a spectrum of visual semantic layers and have the capacity to capture the complex interaction between them.
We propose the vSTM, a visual topic model that adapts traditional probabilistic topic models to the image domain by leveraging pretrained image embeddings. The article shows empirically that vSTM produces coherent topics, outperforming traditional approaches based on low-level visual features. It also demonstrates how topics can be interpreted and labeled efficiently using a combination of visualizations and topical keywords, despite the embeddings themselves not being directly interpretable. Ultimately, by jointly estimating latent visual themes and their relationship with document-level covariates, the vSTM provides a novel way to test and advance theories of visual political communication at scale. Specifically, the model’s ability to capture multilayered semantics, from graphical components and literal depictions to more affective and abstract themes, allows researchers to systematically analyze how, when and with what consequences political actors of various kinds use and respond to nontextual content and cues for persuasion and mobilization. Consequently, the vSTM enables a deeper theoretical integration of visuality into models of agenda setting, public opinion and political behavior.
This work suggests several directions for future research. First, there is a need to develop and evaluate robust validation procedures that are tailored to visual topic models and can account for the multilayered semantics of images. Relatedly, while we provide conceptual and practical guidance on the choice of pretrained embeddings, future work should further examine their implications for measurement and potential biases. Additionally, a current limitation when using variational inference to estimate the model is reliably quantifying the uncertainty of the covariate-topic relationships, which remains an important point for future work. Finally, several extensions of the model are possible, including jointly modeling multiple modalities, such as text and images, to include semi-supervised components guiding the topic discovery toward key concepts of interest, or altering the likelihood to explicitly model directional data, as embeddings often are.
Acknowledgments
We thank Michelle Torres, Victoria Yantseva, Joakim Lindblad, Sophie Mainz, Emelie Karlsson, Cristóbal Moya, Xin Shen, Diletta Goglia, Inga Wohlert, Davide Vega, Simon Herrmann, and Väinö Yrjänäinen for feedback and comments. We also appreciated comments from participants of the 2024 workshop “How Image-As-Data Approaches Can Help Analysing Protest and Its Organisation: Methods and Applications” at Freie Universität Berlin. We thank members of the Center for Social Media and Politics (CSMaP), New York University. The feedback from Benjamin Guinaudeau, Jason Greenfield, Melina Munch, Chris Schwarz, Amanda Drucker, and Kylan Rutherford greatly helped improve the final draft of the article.
Funding statement
This research has been funded by the Swedish Research Council (Grant No. 2021-02769) and by the Swedish Research Council for Health, Working Life and Welfare (FORTE) (Grant No. 2021-01646) under the CHANSE ERA-NET Co-fund Programme, which has received funding from the European Union’s Horizon 2020 Research and Innovation Programme under Grant Agreement No. 101004509. Experiments were enabled by resources provided by the National Academic Infrastructure for Supercomputing in Sweden (NAISS), partially funded by the Swedish Research Council through Grant Agreement No. 2022-06725. M.M. was funded by the Swedish Research Council (Grant No. 2022-03381). M.P. acknowledges support from The Karl Staaff Foundation.
Data availability statement
Replication material for this article is available at the Harvard Dataverse at https://doi.org/10.7910/DVN/WATYCB (Piqueras et al. Reference Piqueras, Segerberg, Magnani, Magnusson and Sladoje2026).
Competing interests
The authors declare no competing interests.
Supplementary material
The supplementary material for this article can be found at https://doi.org/10.1017/pan.2026.10062.













