Since it rose to prominence nearly two years ago, the Islamic State group has distinguished itself from other militant groups through its prolific social media presence. Now, a team of scientists has developed an algorithm that aims to sift through this chaotic online universe and to eventually predict the group’s next attack.

The researchers, led by Neil Johnson, a physicist at the University of Miami, focused on the Russia-based social network Vkontakte, looking for pro-ISIS statements in multiple languages. The reason they chose Vkontakte is because Facebook shuts down pro-ISIS groups and discussions very promptly, and because Vkontakte’s 350 million users are more diverse — culturally and linguistically.

Johnson and his colleagues used a mathematical model — already being used to study groups of interacting objects, such as particles and animals, in the natural world — to sift through the online chatter of pro-ISIS posts each day from mid-2014 until August 2015.

Moreover, instead of focusing only on large social media groups, the researchers manually identified 196 pro-ISIS “aggregates” — a term they used to refer to ad hoc pro-ISIS groups — and then studied how they coalesced and proliferated prior to the onset of an event in the real world.

“It was like watching crystals forming. We were able to see how people were materializing around certain social groups; they were discussing and sharing information — all in real-time,” Johnson said in a statement. “The question is — Can there be a signal of how people are coming collectively together to do something without a proper system in place?”

According to the results published Friday in the journal Science, the answer is yes — at least to a certain extent.

The researchers found that just before an attack takes place, there might be a spike in the formation of these small aggregates. After retroactively analyzing the data, they found that the algorithm could have been used to predict the 2014 attack on the Syrian town of Kobane. 

“The main implication of our work is that once you identify the aggregates, you have your hand on the pulse of the entire organization. Instead of having to sift through millions of internet users and tracking specific individuals, an anti-ISIS agency can simply follow the relatively small number of aggregates to gauge what is happening in terms of hard-core global ISIS support,” Johnson wrote in an article published in the Conversation. “Now that we’ve identified a rather precise mathematical equation that describes their evolution, we can start to think about how to intervene.”

However, many still remain unconvinced. Given that the attack on Kobane — a large-scale military incursion — was the sole example cited in the study, it is not yet certain how effective the algorithm would be in predicting smaller terrorist attacks, especially the recent Orlando-style “lone-wolf” attack.

“With military action, if their strategy is to use social media to intimidate, then it makes sense. But with a terrorist attack, we’re often talking about one, two, sometimes a dozen people who are operating out of conditions of secrecy,” J.M. Berger, a fellow at George Washington University’s Program on Extremism, told the New York Times.