Classifying the Evolving Mask Debate: A Transferable Machine Learning Framework


  • Julia Warnken University of Connecticut
  • Swapna S. Gokhale University of Connecticut



Anti-mask, Classification, Twitter, Longitudinal Data, Machine Learning


Anti-maskers represent a community of people that opposes the use of face masks on grounds that they infringe personal freedoms. This community has thoroughly exploited the convenience and reach of online social media platforms such as Facebook and Twitter to spread discordant information about the ineffectiveness and harm caused by masks in order to persuade people to shun their use. Automatic detection and demoting of anti-mask tweets is thus necessary to limit their damage. This is challenging because the mask dialogue continuously evolves with creative arguments that embed emerging knowledge about the virus, changing socio-political landscape, and present policies of public health officers and organizations. Therefore, this paper builds a transferrable machine learning framework that can separate between anti-mask and pro-mask tweets from longitudinal data collected at four epochs during the pandemic. The framework extracts content, emotional, and engagement features that faithfully capture the patterns that are relevant to anti-mask rhetoric, but ignores those related to contextual details. It trains two ensemble learners and two neural network architectures using these features. Ensemble classifiers can identify anti-mask tweets with approximately 80% accuracy and F1-score from both individual and combined data sets. The invariant linguistic features extracted by the framework can thus form the basis of automated classifiers that can efficiently separate other types of falsehoods and misinformation from huge volumes of social media data.


Download data is not yet available.


Ahmed, Wasim, Vidal-Alaball, Josep, Segui, Francesc, and Moreno, Pedro. 2020. "A Social Network Analysis of Tweets Related to Masks during the COVID-19 Pandemic." International Journal of Environmental Research and Public Health, 17: 8.

Al-Ramahi, Mohammad, Noshokaty, Ahmed, El-Gayar, Omar, Nasralah, Tareq, and Wahbeh, Abudllah. 2020. "Public Discourse Against Masks in the COVID-19 Era: Infodemiology Study of Twitter Data" (Preprint). JMIR Public Health and Surveillance, 7.

Benamara, Farah, Cesarano, Carmine, Picariello, Antonio, Reforgiato Recupero, Diego, and Subrahmanian, Vs. 2007. "Sentiment analysis: Adjectives and adverbs are better than adjectives alone." In International Workshop on Web and Social Media.

Breen, Kerry. 2021. "How Long Do We Need to Wear Masks? Here's What Experts Predict". Accessed: 2022-01-31.

Buitinck, Lars, Louppe, Gilles, Blondel, Mathieu, Pedregosa, Fabian, Mueller, Andreas, Grisel, Olivier, Niculae, Vlad, Prettenhofer, Peter, Gramfort, Alexandere, Grobler, Jacques, Layton, Robert, Vanderplas, Jake, Joly, Arnaud, Holt, Brian, and Varoquaux, Gael. 2013. "API design for machine learning software: Experiences from the scikit-learn project." Proc. of ECML PKDD Workshop: Languages for Data Mining and Machine Learning, 108-122.

CDC. 2020. "CDC Calls on Americans to Wear Masks to Prevent Covid-19 Spread." Accessed: 2021-01-21.

Cerbin, Luca, DeJesus, Jason, Warnken, Julia, and Gokhale, Swapna. 2021. "Unmasking the Mask Debate on Social Media." In 2021 IEEE 45th Annual Computers, Software, and Applications Conference (COMPSAC), 677-682.

Cheng, K. K., Lam, Tai, and Leung, Chi. 2020. "Wearing face masks in the community during the COVID-19 pandemic: altruism and solidarity." The Lancet. 10.1016/S0140-6736(20)30918-1.

Chollet, Francois et al. 2015. Keras.

Cotfas, Liviu-Adrian, Delcea, Camelia, Gherai, Rare, and Roxin, Ioan. 2021. "Unmasking People's Opinions behind Mask-Wearing during COVID-19 Pandemic: A Twitter Stance Analysis." Symmetry, 13(11): 1995.

Delashmit, Walter H., and Manry, Michael T. 2005. "Recent Developments in Multilayer Perceptron Neural Networks." In the 7th Annual Memphis Area Engineering and Science Conference.

Devlin, Jacob, Chang, Ming-Wei, Lee, Kenton, and Toutanova, Kristina. 2018. "BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding." CoRR, abs/1810.04805.

Ernst, Diana. 2021. "CDC Reverses Course on Masks for Fully Vaccinated in Light of SARS-CoV-2 Variant." Accessed: 2022-01-05.

Freidman, Jerome H. 2001. "Greedy function approximation: a gradient boosting machine." Annals of Statistics, 1189-1232.

Gabe, Nicole, and Hill, Drew. 2021. "New Version of Mask Debate Asks if Fully Vaccinated People Still Need to Wear Them." Accessed: 2022-01-31.

Godoy, Maria. 2020. "Yes, Wearing Masks Helps, Here's Why." 21/880832213/. Accessed: 2021-01-21.

He, Lu, He, Changyang, Reynolds, Tara L., Bai, Qiushi, Huang, Yicong, Li, Chen, Zheng, Kai, and Chen, Yunan. 2021. "Why do people oppose mask wearing? A comprehensive analysis of U.S. tweets during the COVID-19 pandemic." Journal of the American Medical Informatics Association, 28: 1564-1573.

Hilder, Alex. 2021. "Fauci: Sen. Rand Paul is Dead Wrong in Assuming Masks Aren't Needed After Vaccination". Accessed: 2022-01-31.

Hochreiter, Sepp, and Schmidhuber Jurgen. 1997. "Long Short-Term Memory." Neural Computation, 9(8): 1735-1780.

Hutto, C., and Gilbert, Eric. 2014. "VADER: A Parsimonious Rule-Based Model for Sentiment Analysis of Social Media Text." Proceedings of the International AAAI Conference on Web and Social Media, 8(1): 216-225.

Kearney, Michael W. 2020. "R: Collecting and Analyzing Twitter Data."

Kessler, Glen. 2021. "The GOP's Attack on the CDC's Mask Reversal and a Study from India." https: // Accessed: 2022- 01-05.

Kiely, Eugene. 2021. "Misinformation About Face Masks." Accessed: 2022-01-05.

Lang, Jun, Erickson, Wesley, and Jing-Schmidt, Zuo. 2021. "#MaskOn! #MaskOff! Digital polarization of mask-wearing in the United States during COVID-19." PLoS ONE, 16: e0250817.

Liaw, Andrew, and Wiener, Matthew. 2002. "Classification and Regression by randomForest." R News. 3:18-22.

Loper, Edward, and Bird, Steven. 2002. "NLTK: The Natural Language Toolkit." CoRR, cs.CL/0205028.

Mikolov, Tomas, Sutskever, Ilya, Chen, Kai, Corrado, Greg, and Dean, Jeffrey. 2013. "Distributed Representations of Words and Phrases and their Compositionality." CoRR, abs/1310.4546.

Morrison, Sara. 2020. "Biden Wants A National Mask Mandate. Can He Do That?" Accessed: 2021-01-21.

Nicholson, Chris. 2019. "A Beginner's Guide to Word2Vec and Neural Word Embeddings." word2vec. Accessed: 2022-04-02.

Novitsky, Mikala. 2021. "Governor Ducey's Decision Refuels Mask Debate in Schools." https: // Accessed: 2022-01-31.

Pascual-Ferra, Paola, Alperstein, Neil, Barnett, Daniel, and Rimal, Rajeev. 2021. "Toxicity and verbal aggression on social media: Polarized discourse on wearing face masks during the COVID-19 pandemic." Big Data & Society, 8.

Paul, Nijhum, and Gokhale, Swapna. 2020. "Analysis and Classification of Vaccine Dialogue in the Coronavirus Era." In 2020 IEEE International Conference on Big Data (Big Data), 3220-3227.

Pedregosa, Fabian, Varoquaux, Gael, Gramfort, Alexandre, Michel, Vincent, Thirion, Bertrand, Grisel, Olivier, Blondel, Mathieu, Prettenhofer, Peter, Weiss, Ron, Dubourg, Vincent et al. 2011. "Scikit-learn: Machine learning in Python." Journal of Machine Learning Research, 12(Oct): 2825-2830.

Perry, Susan. 2020. "Social Media Users are More Likely to Believe False Information About Covid-19 and to Ignore Public Health Advice, Study Suggests". Accessed: 2021-01-21.

Rehurek, Radim, and Sojka, Petr. 2010. "Software Framework for Topic Modelling with Large Corpora." 45-50. 10.13140/2.1.2393.1847.

Reuters. 2021. "Misinformation is Serious Threat to Public Health Surgeon General Warns". Accessed: 2022-01-05.

Shen, Yanqing. 2020. "Covid-19 Outbreak: Tweet Analysis on Face Masks." Accessed: 2021-01-21.

Staff, Knau. 2020. "Twitter Analysis Shows Arizona is #1 in Anti-Face Mask Activity." twitter-analysis-shows-arizona-1-anti-face-mask-activity. Accessed: 2021-01-21.

Taylor, Adam. 2020. "How the Split Over Masks Sums Up America's Chaotic Coronavirus Response." Accessed: 2021-01-21.

Zafarani, Reza, Abbasi, Mohammad Ali, and Liu, Huan. 2014. "Social media mining: an introduction." Cambridge University Press.