Unmasking hate speech in Kenyan elections with AI and collaboration

How we leveraged the power of technological innovation to turn the tide against disinformation

Code for Africa
Code For Africa
4 min readJun 12, 2023

--

Kenya’s 2022 general election was marred by an onslaught of hate speech online, pitting supporters of the two major candidates against each other. Over 550,000 toxic posts were identified by the MAPEMA consortium on Facebook alone, a trend that is becoming all too common during elections. As often is the case, communities are instigated to take a side through inciting comments and hate speech, creating a fertile ground for violence that has unfortunately accompanied past elections.

Joining forces, Code for Africa (CfA), Shujaaz Inc. and AIfluence formed the MAPEMA consortium — a pioneering initiative that utilises cutting-edge Artificial Intelligence (AI) and Machine Learning (ML) technologies and tools to combat the rise of toxic content and manipulation in online political spaces. This early warning system aims to detect and counter hate speech and polarising content online, and was backed by the United Nations Development Programme (UNDP) and Office of the United Nations High Commissioner for Human Rights (OHCHR).

The CfA team used an array of tools to monitor social and digital media, developing and utilising a machine-readable database called ‘hatelex’ and employing open-source tools such as CrowdTangle as well as proprietary solutions like Meltwater to monitor conversations and identify networks involved in electoral disinformation campaigns and information operations on Facebook, Instagram, and Twitter.

Furthermore, the team used its inbuilt media monitoring solution CivicSignal (which contains over 4,000 digital media collections from sub-Saharan Africa, including 410 media sources in Kenya) and proprietary AI-based solution from PrimerAI to track digital media, analyse trends, and generate real-time reports for key stakeholders and decision-makers.

Of the more than 550,000 toxic Facebook posts identified as a result, over 800 cases of hate speech content were flagged and shared with social media platforms for action.

“Part of our work was to use the expert skill sets that we have in digital forensics and data analytics to monitor social media platforms and digital media for cases of hate speech and incitement, and communicate these results to enable effective responses by our partners,” said Peter Kimani, a senior investigative data analyst at Code for Africa’s iLAB team.

See how the MAPEMA consortium worked together:

As part of the effort, the consortium also incorporated extensive public perception surveys, gathering data from over 3,900 citizens in seven hotspot counties aimed at gaining a comprehensive understanding of the key challenges facing citizens during elections. The collected information served as a valuable knowledge base, enabling the consortium to produce insightful public perception reports called the Youth Barometer on critical issues like hate speech, misinformation/disinformation, and electoral conversations.

On its part, Shujaaz Inc. used the insights from the monitoring to develop response messaging which was subsequently integrated into comical and animated content targeting youthful audiences through its network of 7.5 million youth ambassadors in Kenya. The ambassadors reached over 3.9 million citizens with messages of peace in the process. In addition, Shujaaz Inc hosted interactive virtual events called ‘Mic Yetu’, where young people discussed voter education and promoting peace during elections.

“We brought young people into conversations with leaders to talk about issues on voter education and how to keep the peace during elections,” Joy Mwaniki from Shujaaz Inc. said.

With the help of over 3,000 micro and nano influencers, AIfluence utilised research insights to effectively spread targeted peace messages to 8.5 million Kenyans.

“Our strategy was to work with micro and nano influencers that we identified across all social media platforms to speak actively against hate speech and to promote peaceful messaging,” said Tsimba Mabiala, campaign manager, AIfluence.

Moreover, the consortium deployed a series of counter-messaging campaigns to disseminate positive messaging through traditional and online media, reaching over 27.9 million Kenyans in the process.

Addressing hate speech, incitement, misinformation, and disinformation requires an active and collaborative approach involving multiple stakeholders. The consortium’s success is attributed to the combined efforts of the three organisations, actively supported by UN agencies and state actors. It is essential to acknowledge that these challenges persist beyond election periods, demanding ongoing active vigilance and monitoring.

See how the MAPEMA consortium worked together here.

CfA project implementation team: Allan Cheboi, Ivan Musebe, John Ndungu, Justin Arenstein, Peter Kimani and Virginiah Gitome. Code for Africa (CfA) 2023. www.disinfo.africa

— —

Code for Africa (CfA) is the continent’s largest network of civic technology and data journalism labs, with teams in 21 countries. CfA builds digital democracy solutions that give citizens unfettered access to actionable information that empowers them to make informed decisions, and that strengthens civic engagement for improved public governance and accountability. This includes building infrastructure like the continent’s largest open data portals at openAFRICA and sourceAFRICA. CfA incubates initiatives as diverse as the africanDRONE network, the PesaCheck fact-checking initiative, the sensors.AFRICA air quality sensor network and the research and analysis programme CivicSignal.

CfA also manages the African Network of Centres for Investigative Reporting (ANCIR), which gives the continent’s best muckraking newsrooms the latest possible forensic data tools, digital security and whistleblower encryption to help improve their ability to tackle crooked politicians, organised crime and predatory big business. CfA also runs one of Africa’s largest skills development initiatives for digital journalists, and seed funds cross-border collaboration.

--

--

Code for Africa
Code For Africa

Africa's largest network of #CivicTech and #OpenData labs. Projects include #impactAFRICA, #openAFRICA, #PesaCheck, #sensorsAfrica and #sourceAFRICA.