An Anomaly Aware Spatio-Temporal Graph Atten-tion Network for Integrated Forecasting and Event Detection in Urban Traffic Streams
Traffic in the city is unpredictable since accidents or road closures can generate gridlock at any time. The gadgets in use today are either extremely slow, do not comprehend how roadways interact, or fail to recognize these unforeseen issues as they arise. We require a system that can simultaneously detect anomalous occurrences and predict typical traffic flows. The Anomaly-Aware Spatio Temporal Graph Attention Network (AA-STGAT) is a novel artificial intelligence model that we developed. Its primary function is to simultaneously forecast traffic speed for the next fifteen minutes and identify any possible collisions or severe traffic. It operates by comprehending the intricate spatial relationships between various routes and the temporal changes in traffic. The key innovation is a special training task that teaches the model to focus on both jobs simultaneously, making it better at identifying outliers. We trained and tested it using live streams of real-world data, including traffic speeds, weather, and scheduled public events. We tested our model on real data from major cities and compared it with other advanced AI systems. Our model was the most accurate. This reduced prediction error by 12.7% and improved accident detection accuracy by 15.3%. Most importantly, it makes its predictions fast enough (in less than 90 seconds) to be used in real-time traffic management systems. Our model was the most accurate, reducing prediction errors by 12.7% and improving anomaly detection by 15.3% over previous state-of-the-art systems. Furthermore, our enhanced AA-STGAT++ variant achieves an additional 30.1% improvement in prediction accuracy, 7.9% higher F1-score, and 40.1% faster inference time, processing city-scale networks in under 46 seconds. This makes it highly suitable for real-time traffic management.