This essay was written by Zoya Brahimzadeh as part of the Wolfram Emerging Leaders Program for Undergraduates, which is a 5-month long, project-based program designed for undergraduate students to take a deep dive into a topic of their choice. Students work remotely to take their project from ideation to completion, with the guidance of Wolfram experts
Memes are units of cultural transmission. In the digital world, their impact and characteristics have been analyzed intensively. However, there are a couple of key areas that existing studies do not focus on: the transmission and adaptation of memes in natural contexts (such as a community of scuba-divers), quantification of mutations in image-based memes, and, above all, analyzing meme propagation within the perspective of the underlying social network. This exploration aims to bridge these gaps by analyzing the spread of different memes across average subreddits to understand the social dynamics that drive digital culture formation via image-based memes.
Initial post scraping
Initial post scraping
We will begin our exploration by collecting data from Reddit. Our goal is to collect posts containing images from multiple subreddits as these posts may contain image-based-memes that we will use for further analysis.
Reddit API initialization
Reddit API initialization
Before we get too excited, let’s define some helper methods and constants for interacting with Reddit’s API.
Constants
Constants
Here are the helpful variables needed for Reddit API calls. The actual token and User-Agent information is concealed for privacy purposes.
In[]:=
token=SystemCredential["RedditAPI_token"];baseURL="https://oauth.reddit.com";headers={"Authorization"->token,"User-Agent"->SystemCredential["User-Agent"]}
Helper methods
Helper methods
What subreddits should I scrape?
What subreddits should I scrape?
Selecting a representative, non-NSFW subreddits
Selecting a representative, non-NSFW subreddits
Scraping selected subreddits
Scraping selected subreddits
Collecting additional data
Collecting additional data
The principal motive of this essay is to explore meme propagation within a social network. In order to design a social network, we need to understand how users interact within their communities and model sources of inspiration for meme spread. The most explicit way that these interactions are measured is through comments on subreddit posts. We will create a social network utilizing the comments on each image-containing post. The specifics of this method will be detailed in the next major section, however, for now, we need to collect this comment data.
Get comments
Get comments
Extracting images
Extracting images
Justifying social network properties
Justifying social network properties
Understanding overall Reddit dynamics
Understanding overall Reddit dynamics
Let’s take a look at Reddit from a macroscopic level. Here, we will analyze to see if Reddit follows one of the core properties of a social network. The power law is a distribution in which the values are right-skewed, there is a high ratio of max to min, and will look the same graphically no matter how they are scaled.
For example, here is a power law distribution observed when plotting the percentage of cities that fall into each population category. Figure from Newman, Mark. “Power laws,Pareto distributions and Zipf’s law.”Contemporary physics 46, no. 5 (2005): 323-351
The idea behind a power law distribution in social network theory is that there are many tight-knit communities, but there are much less very expansive communities; the average person isn’t incredibly flamboyant in a social network, but typically have a smaller circle.
Now let’s see if the same phenomenon is observed in community sizes of subreddits--social networks. Here, a histogram is plotted, grouping number of subreddits in each radius-bucket-category.
In[]:=
Histogram[ds[[All,2,All,2]]]
Out[]=
Here is also a distribution of subreddit sizes within each cluster. They’re typically around similar rages with outstandingly large outliers.
In[]:=
BoxWhiskerChart[ds[[All,2,All,2]]]
Out[]=
Dynamics within poster-commenter networks
Dynamics within poster-commenter networks
Across Reddit: distribution of number of reddit comments made by user
Across Reddit: distribution of number of reddit comments made by user
Let’s take a look at how frequently users interact. We can easily do this by tallying the number of comments each user has made and plotting the distribution of tallies.
Counts the number of comments made by each user in the dataset
In[]:=
numPostsPerUser=Normal[Counts[Flatten[Map[#["author_fullname"]&,cleanAllCommentsFromSubs,{2}]]]][[All,2]]
Plots the distribution of results
In[]:=
Histogram[numPostsPerUser]
Out[]=
Evidently, this an extreme example of following the power law--the number of community interactions tapers off very quickly.
Creating a social network
Creating a social network
Now, it’s finally time to create a social network out of all these subreddit interactions! Like I mentioned previously, the goal of this essay is to explore meme prorogation within a social network. In this step, we will create such a social network based on poster-commenter interactions. Commenting on posts in one explicit measure of an interaction between two users that guarantees that whatever meme or image was in the post is observed by the commenter. Thus, these interactions will constitute the basis of our Reddit social network that will also be utilized to analyze the spread of memes along subreddits.
For each post X with a set of comments Y, we will create a list of undirected edges . We will iterate this process over all posts in the dataset. The edges will be undirected because both the poster and commenter can gain information from each other from the interaction that may help with the diffusion of memes.
{X;∈Y}
Y
i
Y
i
Restructures dataset to extract source-post<--> comment author relationships and creates undirected edges.
In[]:=
allEdges=UndirectedEdge[#["sourcepost_author"],#["author_fullname"]]&/@Flatten[cleanAllCommentsFromSubs]
Compute edge weights based on how many times the two users interact
counts=Counts[allEdges];edgesWeighted=Normal[counts]/.Rule[UndirectedEdge[x_,y_],val_]:>UndirectedEdge[x,y,val];
Not surprisingly, most users have only interacted once:
In[]:=
Counts[counts]
Out[]=
17624,51,2205,337,43,71
Finally, lets draw a graph based on all these social interactions!
gFirst=Graph[edgesWeighted]
Out[]=
It’s fascinating to see all bigger social networks from the bigger subreddits, with a much greater amount of small, pair-based interactions between users. Once again, the power law is followed.
If we count the number of connected components of the social network, we see that there are many connected components with a small number of nodes and a lot less greatly connected components, just like how social networks form.
Clustering memes on meme subreddits
Clustering memes on meme subreddits
Almost there! Now, we need to cluster all the images to find memes in the clusters. A meme generally is a cultural token that is significant to a community. Because of Wolfram’s image processing powers, we will focus on finding meme groups based on meaningful visual similarities; whether it be a similar face, cartoon character, or visual scene--it would indicate that they are memes that have mutated from one-another.
We will follow the following paradigm in order to process images, vectorize them, and then cluster them.
We will follow the following paradigm in order to process images, vectorize them, and then cluster them.
Image processing
Image processing
Our first issue is that many memes have text overlays and boxes that will distract from the important visual features to be encoded. For example, it would be more difficult to say that these two memes are similar because they have so much white space with different letters and shapes (text) that could make them appear different in encoding models and visual similarity.
Since we are not processing the text or using OCR, preserving the text in the memes will only add noise to visual-based-clustering. Because of this, our first step is to get and blur all the BoundingBoxes of words detected in the image. We blur them so that the features of the image under the text are still preserved. For example, in Meme Example B, removing all the areas of the image with text would render the figures below incomprehensible:
So let’s begin! First, lets blur all the bounding boxes of text words.
Blurs the bounding box for each word found in the image
However, there is still a problem. The blurred out text area in memes like Meme A is half of the image. The whitespace will be over-represented and over-signified in comparison to the cartoon character in the meme. Since we are clustering based on similarly-appearing tangible objects (for example, the cartoon character in Meme A or the snapshot-in-action of the man from Meme B) found across different memes, the white area for text is not relevant and will devalue the other focal points of the image. Thus, lets remove this extra space!
We will detect “whitespace” or borders of images with no meaningful features by de-padding the edges of an image until there is variance in background color.
Method to detect the dimensions of the borders of an image and crop the image accordingly:
Now, lets apply this text-blurring and image-cropping to our entire dataset!
Also creates an association version of this for ease of future access.
Social network analysis: within subreddits
Social network analysis: within subreddits
Finally--the fun part! Let’s start taking a look at the prorogation of these memes within the social networks of their subreddits. In this section, we will both analyze the typical roles and dynamics that are at play with meme-posting and how similar memes diffuse across the network. We will also understand where there are discrepancies and what those may be attributed to.
Generating graphs for subreddits
Generating graphs for subreddits
We begin by creating a social network for each subreddit. These graphs will be created using the commenter-poster relationships extracted earlier. Though these may not quantify all the relationships between members of a subreddit, they still reveal the general structure of the social interactions within the subreddit--how frequently members across the subreddit interact--and the ways that people cluster around shared interests.
Draws an undirected edges between between a poster and all of the commenters for each post in each subreddit:
Next, it is important to remove all the edges where the author could not be retrieved earlier
Deletes all the cases where accessing author information resulted in a failure:
Turns every list of edges into a graph:
Helper Methods
Helper Methods
Next, we will define some helper methods that will aide future computations.
First, a method that will return the author associated with a meme posted, given the meme index. This will be helpful in identifying meme posters within the social networks crafted above.
Also, a method that will returns a “zoomed in” version of the graph to allow for visualizations of meme prorogation within the bigger network
Analysis of meme-poster roles and social network dynamics
Analysis of meme-poster roles and social network dynamics
Now that we have the basics, lets begin taking a look at the typical roles meme-posters have in their subreddits. Are meme-posters typically users with many social connections? Are there meme posters across every sub-community within a subreddit? Let’s see!
Breadth analysis
Breadth analysis
First, we will begin by getting a quick view of where meme posters are within their social networks.
Methods to highlight where the meme’s posters are in the social network, zooming in if able to:
Highlights locations of all meme-posters within all of each subreddits :
Generally, it’s evident that meme posters are dispersed throughout the social network, both in central areas and more niche branches. But let’s dig in to learn more about this phenomena!
Meme posters by sub-community
Meme posters by sub-community
Here, we investigate how spread out meme-posters are within the overall subreddit and better understand how their role may change as the size of the social network grows.
Though subreddits are formed around generally shared interests, in many instances, smaller sub-communities of interaction will form based on more specific areas of expertise or commentary.
For example, here are all the sub-communities identified from the 2nd subreddit we are analyzing.
These data distinguishing categories give incredibly useful information. We will begin by analyzing how well distributed meme posters are across subreddits by analyzing their presence in each sub-community found.
In the following example using two of the subreddits we are analyzing, each different sub-community is distinguished with different vertex hues. The meme-posters are identified in the social network with red-ish hues and a label above the node.
Highlights the meme posters within the existing social network. Each different community is colored differently
From a quick glance, it does seem like meme posters are distributed across different sub-communities--but lets verify if this is the case.
We can find the percentage of meme-posters prevalent in each sub-community of a subreddit by counting the number of meme-posters in the sub-community and the size of the sub-community itself.
Puts length of the intersection between the list of meme-posters and the list of vertexes in each subreddit sub-community over the size of the whole sub-community:
Computes this value for all sub communities across our subreddits and plots the distribution of percentages.
Generally, there is a left skew to these histograms--indicating that there tends to be a small but non-zero percentage of meme-posters in each sub-community. This is another example of the power law in action--there are much more sub-communities with a small degree of participation from meme-posters than large.
However, there are a couple of outliers to this trend. Namely, the 4th and 9th subreddits do not have a left skew--their distribution of percentages of meme-poster prevalence in sub-communities is more balanced. Why is this the case? Taking a look at these graphs, they have a much more well-rounded shape than the others and, most importantly, have less disconnected components.
It seems as though the less connected or disjoint components there are, the more likely they are to have higher meme-poster participation in sub-communities. This may be because the sub-communities themselves are better-connected, since there are more spaces for overlap.
It also seems like the 1st, 4th, and 9th subreddits have an incredibly small percentage of participation from meme-posters. Let’s take a look as to why.
It also seems like the 1st, 4th, and 9th subreddits have an incredibly small percentage of participation from meme-posters. Let’s take a look as to why.
Evidently, the 1st, 4th, and 9th subreddits have the largest social networks --the population of the subreddit is a very probable explanation for the lack of participation
But, lets take a closer look. Next we will analyze the percentage of sub-communities that contain at least one meme-poster
But, lets take a closer look. Next we will analyze the percentage of sub-communities that contain at least one meme-poster
Plotting this in comparison to the size of each social network, we can see the beginnings of a relationship between increased network size and meme-poster in each sub-community--that is, till a certain threshold.
Plots network size vs percentage of sub-communities with meme-posters:
Lastly, let’s take a look at the distribution of degrees for meme-posters in each social network.
Evidently, there is another left skew--most meme-posters tend to have a smaller number of connections, but there are a couple of more well-connected meme-posters within the social network.
However, no matter where a meme-poster is in this distribution, they are much more popular within the social network compared to an average subreddit user.
The distribution of degree’s for meme posters is much higher than the mean degree for members of the social network:
And the median value of all vertex degrees is also much lower than that of meme-poster-degrees:
Thus interestingly, meme-posters tend to be much more popular in social networks while still following power law scaling dynamics.
But there are a couple of subreddits from our example plot that do not have a left skew in meme-poster-vertex degrees--the 2nd, 6th, and 7th subreddits.
Taking a look at these, we can see that they are all similar in composition--they have one giant component and a limited amount of other sparsely connected smaller components. Compared to the shapes and sizes of the other social networks within our dataset, these three are medium sized social networks where there is some tight-knitted experience between users but still great degrees of separation.
Analyzing meme prorogation across networks
Analyzing meme prorogation across networks
In this section, we begin to look at the specific propagation of memes along these social networks to better understand the universality of memes to a subreddit. We are trying to understand whether memes tend to stay concentrated to their sub-community of origin or if they venture outwards into the larger subreddit.
A couple of diffusion visualizations
A couple of diffusion visualizations
The first is a diffusion of a meme family from the r/httyd_meme subreddit:
Evidently, this meme family is a bit more localized as it only spans across a corner of the social network, but it is still a bit more of a universal meme to the subreddit because it has many subreddit members in between to connect the diffusing memes.
Let’s take a look at another meme cluster! This one is the diffusion of a meme cluster from the r/ClimateShitposting subreddit.
Evidently, this meme cluster stretches across multiple communities so it is also a more universal meme--its not localized to one area of the social network. But, the connections between neighbors are slightly shorter, indicating that this meme does not stretch that far across different communities.
But analysis in this way can easily get convoluted and messy, let’s take a look at a clearer way of analyzing meme dynamics.
Creating new social network based on meme-posters
Creating new social network based on meme-posters
In this final section, we will create a new social network solely based on meme-posters in order to better identify prominent meme-posters within subreddit and analyze how silo-ed meme-propagation pathways are--are there intersections or common people who typically participate in spreading memes? We will explore this further in this section.
Comparison with two subreddits
Comparison with two subreddits
Generates edges for new network for both graphs based on connecting memes to their inspiration source
Generates graph from edges for both subreddits
Styles each set of edges within a subreddit’s network with a different hue
Highlights the different meme within the new social network
Evidently, the social network is not fully connected--there are a lot of small floating components. However, there are a couple areas where meme propagators intersect. The giant component connects main different groups of meme-propagators. This indicates that there are both meme trails that are more mainstream within the subreddit since they connect to multiple specialized meme-diffuser communities and more niche memes that are not connected to mainstream culture.
There are many posters that were connected to multiple times in this new network--perhaps because they interact with a lot of other users. Such as user t2_5uspfx5a, who was connected with 22 times in this meme-spread-based social network.
Selects the top ten most frequently featured posters within the network
And there are also a couple posters who had interacted with multiple different meme-chains. This is evident by multitude of differently colored edges--indicating different meme chains--that these top nodes are connected to.
Highlights these users in the social network:
Overall, its fascinating to observe that there is a distinction--a role--that some meme-posters take on where they interact with a lot more other members and are involved with the spread of multiple memes. This may imply a causal relationship--the more active a meme-poster is in engaging with community members, the more successful they can be in spreading future memes and driving culture. Evidently, there are some key players that are more involved in amplifying digital culture of the subreddit than other users with frequent participation.
Acknowledgments
Acknowledgments
I would like to thank Aaron Enright for being an incredible mentor and providing so much support throughout this project. I would also like to thank WELP:U directors Rory Foulger and Eryn Gillam for all their support and guidance throughout the program.
Works Cited
Works Cited
◼
Cochrane, Leslie, et al. ““One Does Not Simply Categorize a Meme”: A Dual Classification System for Visual-Textual Internet Memes.” Proceedings of the Linguistic Society of America, vol. 7, no. 1, 5 May 2022, p. 5260, https://doi.org/10.3765/plsa.v7i1.5260. Accessed 12 June 2022.
◼
Kanti Baowaly, Mrinal, et al. “Co-Comment Network: A Novel Approach to Construct Social Networks within Reddit.” Computación Y Sistemas, vol. 26, no. 1, 30 Mar. 2022, https://doi.org/10.13053/cys-26-1-4175. Accessed 5 Apr. 2023.
◼
Social Networks & Power Laws. Stanford University, 2021.
◼
Tsugawa, Sho, and Hiroyuki Ohsaki. “Emergence of Fractals in Social Networks: Analysis of Community Structure and Interaction Locality.” Terrestrial Environment Research Center (University of Tsukuba), vol. 66, 1 July 2014, pp. 568–575, ieeexplore.ieee.org/document/6899262, https://doi.org/10.1109/compsac.2014.80. Accessed 30 Jan. 2025.
◼
Valensise, Carlo M., et al. “Entropy and Complexity Unveil the Landscape of Memes Evolution.” Scientific Reports, vol. 11, no. 1, 8 Oct. 2021, p. 20022, www.nature.com/articles/s41598-021-99468-6, https://doi.org/10.1038/s41598-021-99468-6.
CITE THIS NOTEBOOK
CITE THIS NOTEBOOK
Dynamics to scale: analyzing meme mutation processes across Reddit
by Zoya Brahimzadeh
Wolfram Community, STAFF PICKS, February 11, 2025
https://community.wolfram.com/groups/-/m/t/3391562
by Zoya Brahimzadeh
Wolfram Community, STAFF PICKS, February 11, 2025
https://community.wolfram.com/groups/-/m/t/3391562