In the right hands, big data can do amazing things. In a new study, researchers at Chinese search giant Baidu lay out how to use its catalog of maps and search data to prevent massive crowds from forming.

The main objective would be to create an early warning system that deters potentially dangerous situations, such as a massive rash of panicked people fleeing a location, stepping on anything that falls in their way. On New Year's Eve 2014, Shanghai suffered a stampede that left 36 dead and 50 injured, according to the Guardian. Stampedes are obviously not limited to China — in Birmingham, U.K., during a concert in 2009, a sudden stampede of desperate onlookers penetrated the perimeter of the performance, gaining them access to the show, but also injuring 60 people in the process, according to Reuters.

Baidu's system would catch people before they've even arrived at their proposed destination. Crunching map queries and historical data, Baidu says it can use machine learning to detect when and where a crowd will form. Researchers say that they've noticed that a half an hour to two hours before a dangerous crowd amasses, there are a large number of searches about the area where people will ultimately meet. An algorithm could detect this anomaly and trigger a warning that urges users to stay away from that area. Considering Baidu's large share of the Chinese search market, the product has potential to impact a lot of people.

Baidu

While keeping people from entering a potentially hazardous area is commendable, that same tool used in a different context could have far more nefarious results. In the hands of the Chinese government, for instance, data about how many people are congregating where could help quell dissent and protests. With this data, the Chinese government could see where people are organizing or about to organize and shutdown transit or send a troops to bar any assembly.

For now, much of the research remains academic, but the company says it has begun developing this product for deployment. "It is worth mentioning that we have developed an early warning system for human crowds based on the aforementioned decision method and prediction model," the researchers note in the study. Whether it will expand its use beyond an early warning system for big crowds is yet to be seen.

h/t Mashable