Studying the pre-Islamic State tweets of people who end up backing the organization paints a revealing picture of how support emerges, say computer scientists.

Back in May 2014, news emerged that an Egyptian man called Ahmed Al-Darawy had died on the battlefields of Iraq while fighting for the Islamic State of Iraq and the Levant, otherwise known as Islamic State or ISIS.

On the face of it, his death seemed something of a puzzle. Al-Darawy was a 38-year-old father of three, a former policeman and manager in a multinational company in Egypt. He had also been a key player in the non-violent democracy movement that ousted the Egyptian president Hosni Mubarak in 2011 during the Arab Spring. Al-Darawy had even stood for elected office after the uprisings.

Many observers asked what had turned this nonviolent activist into a hardened supporter of the violent ISIS movement. But Al-Darawy’s story is not so unusual.

Studies of people who have joined these kinds of organizations suggest that they tend to be better educated, financially better off, more exposed to Western culture and generally more accomplished than average. Neither do these individuals show evidence of psychological disorders. On the contrary, they appear to be more psychologically robust than average.

These characteristics are hardly unusual. Many people in many societies share similar characteristics. So what distinguishes those that choose to fight for violent groups such as ISIS from those who do not?

Today, we get some insight into this question thanks to the work of Walid Magdy and pals at the Qatar Computing Research Institute in Doha. These guys have studied tweets in Arabic generated by people who support ISIS and those who oppose it to determine what factors people in each group have in common.

They then searched through each individual’s history of tweets to see whether their pre-ISIS tweets reveal any common factors that might predetermine their later support or opposition.

Magdy and co begin by collecting some 3.1 million Arabic tweets mentioning ISIS created by more than 250,000 users between October and December 2014. Of these users, 165,000 had active accounts that dated back to pre-ISIS times.

To determine the difference between users supporting or opposing ISIS, they asked a native Arabic speaker to judge the polarization of a random sample of 1,000 tweets.

This revealed a clear trend. Tweets that demonstrate support for ISIS tend to use its full name, the Islamic State in Iraq and the Levant, or some variation of this. Tweets that opposed ISIS tended to use the abbreviation.

They then picked out all those users who had authored 10 or more tweets about ISIS, whether in support or opposition. This produced a total of 11,332 pro-ISIS users and 45,628 anti-ISIS users.

Next, Magdy and co; studied the way tweets supporting or opposing; ISIS varied in time. “Anti-ISIS tweets generally peaked when news of ISIS human rights violations emerged such as the killing of hostage, accounts of torture, or reports of the enslavement of Yazidi women,” they say. “On the other hand, pro-ISIS tweets generally peaked in conjunction with the release of propaganda videos and major military achievements.”

They also studied the hashtags associated with these tweets, finding links with various news events that seem to trigger interest in ISIS. Unsurprisingly, most of these tweeters, seemed to originate in the Middle East

Finally, Magdy and co studied the historical timeline of tweets of more than 7,000 pro-ISIS users and an equal number of anti-ISIS users. The goal was to look for features in common that could predict their future support or opposition.

Magdy and co trained a machine learning algorithm to spot users of both types and said it was able to classify other users as likely to become pro- or anti-ISIS with high accuracy. “We train a classifier that can predict future support or opposition of ISIS with 87 percent accuracy,” they say.

The hashtags these people use give an interesting insight into the origin of their support or opposition. “Looking at discriminating hashtags suggested that a major source of support for ISIS stems from frustration with the missteps of the Arab Spring,” say Magdy and co. “As for opposition to ISIS, it is linked with support for other rebel groups, mostly in Syria, that have been targeted by ISIS, support for existing Middle Eastern regimes, and Shia sectarianism.”

That is interesting research that reveals the complexity of the forces at work in determining support or opposition to movements like ISIS—why people like Ahmed Al-Darawy end up dying on the battlefield. A better understanding of these forces is surely a step forward in finding solutions to the tangled web that exists in this part of the world.

However, it is worth ending on a note of caution. The ability to classify people as potential supporters of ISIS raises the dangerous prospect of a kind of thought police, like that depicted in films like Minority Report. Clearly, much thought must be given to the way this kind of information should be used.