Preventing Gang and Gun Violence Via Social Media Analysis

Coordinated by,

Status: Completed

Project Duration: 14 Aug 2021 - 14 Oct 2021

Open Source resources available from this project

Project background.

Many suffer from different forms of violence world wide, and at different levels. No one can deny that Iraq has had more than its fair share of violence, crimes, and terror in the past few decades. To put this into perspective, in 2006-2007, 55,638 civilians were killed (According to This time is considered to be one of the bloodiest and most violent years that the country ever witnessed. In 2020 Iraq ranked number 82 out of 129 in Safety Index and still faces big challenges in preventing crimes and gang violence taking place across the country.

The problem.

There are many factors that contribute to these catastrophes. Given the fact that over half of Iraq’s population is active on social media, coming with an annual growth of [3.6%]( ([according to](, we see the potential in paying attention to this important medium as one of these factors that could contribute to violence in one way or another.

No one can deny the massive role social media plays in our daily lives. One can even say that it has become the main, if not the only, place to express one’s opinions and affiliation. This can be seen in the substantial impact it has had in the October 2019-2020 [protests in Iraq](

For those reasons, it is extremely important to acknowledge the effect social media has on our community and raise some important questions. One of them is, is it possible to predict violent actions that could take place on the ground from social media posts? 

According to numerous studies and articles on this subject, the answer is, yes. Feel free to read more about it in [this article]( by the [Tahrir Institute for Middle East Policy](, where it specifically talks about the social media, and hate speech impact during the protests. this paper is titled [Violence and Social Media](

Project goals.

This 4-week project aims to help uncover how we can predict violence and gang actions by analyzing social tweets and communities. We will achieve this by :
- Scrapping relevant data from different social media platforms; mainly tweets and Facebook.
- Cleaning, processing, and labeling the data.
- Implementing well-known algorithms and libraries such as [Girvan Newmann algorithm](, networkX, to analyze and detect communities.
- Training different machine learning models to classify violence from non-violent tweets.
-  Evaluating and visualizing the results.

Project plan.

  • Week 1

    – Data Scraping, Cleaning, and Pre-Processing.
    – Testing & Preparing the Models.

  • Week 2

    – Data Scraping, Cleaning, Pre-Processing.
    – Data Annotation.
    – Network & Community Analysis.
    – Testing & Choosing the Best Models.

  • Week 3

    – Data annotation.
    – Network & Community Analysis.
    – Training Sentiment Analysis Model.

  • Week 4

    – Evaluating, Data Visualization and Documentation.

Learning outcomes.

1. Leadership & collaboration skills.

2. Implementing web scraping techniques and building the dataset from the ground up. This will result in a high understanding of the data itself.

3. Implementing advanced NLP algorithms.

4. Using different Arabic Text processing libraries, including Yarub library for processing and modeling Arabic text. This library was developed by collaborators in our previous project. Read more about it here.

5. You’ll learn how to use the data and evaluate the results to extract useful information that could help detect and prevent violence on the ground.

Share project on: