✅
Trusted Academic Publisher
Serving Researchers Since 2012

ALERTX: An AI-Driven System for Urban Crime Detection and Risk Prediction

DOI : 10.17577/IJERTCONV14IS110029
Download Full-Text PDF Cite this Publication

Text Only Version

ALERTX: An AI-Driven System for Urban Crime Detection and Risk Prediction

Harsha Vardhan Reddy1, Harish.P2 , Gowtham.C3,Soniya Joseph4

Student, Department of BCA, St Francis College, Bengaluru1 2 3 Assistant Professor, Department of BCA, St Francis College, Bengaluru4

Email id:soniyajoseph0123@gmail.com,rudra04115@gmail.com ,harishgowda1379@gmail.com chinnarajuchinna2426@gmail.com

Abstract

The data on urban crime can be complicated to analyze in order to make informed decisions in the short term for both citizens and administrators. ALERTX is a Progressive Web Application that takes location-based information on crime and transforms it into both safety suggestions for citizens and an incident management process for administrators. The system is implemented as a Python Flask REST API, SQLAlchemy with an SQLite database, Leaflet, OpenStreetMap data, browser-based geolocation, and role-specific authentication. The systems analytical core is a spatio-temporal risk assessment algorithm, which weights the value of theft, assault, and robbery incidents and decreases their contribution to the risk score based on the distance to the destination and the time of day. ALERTX application suggests the safest route based on the calculated risk assessment. For the citizens, it provides safety scores, risk categories, nearby incidents, heat-map visualization, a safe route recommendation, and an emergency SOS reporting system. For the administrators, it provides a dashboard to enter and manage data, upload CSV files, audit user accounts, view and manage emergency tickets, check status, and export to spreadsheet CSV files. The system contains a demo data set of 20 Bengaluru locations and automated testing of the authentication, authorization, risk assessment, route suggestion, emergency dispatch, and report generation processes. This paper discusses the architecture, risk scoring methodology, implementation, workflow, validation, and limitations of the ALERTX system.

Keywords

Crime analysis; urban safety; geospatial risks; Haversine distance; Progressive Web Application; Flask; Leaflet; OpenStreetMap; REST API; safe-route navigation; SOS feature.

  1. Introduction

    As digital services become more widely used, the way people get information, communicate, move around the city, and even call for help has changed. A location-aware web application has one clear advantage: it can bring location and context data together in a single map view. Even so, not all public- safety information is presented in a way that lets a person understand the answer to a very basic question.

    ALERTX was designed with this challenge in mind. Instead of treating crime data as a plain list, the application converts it into location-aware risk data. According to the description in the abstract submitted with the upload, the platform is a full-stack PWA with a Flask REST backend and a geospatial front end built on Leaflet and OpenStreetMap. Its risk engine is multi-factorial and takes into account crime seriousness, a time factor, a night threshold, and an inverse-distance factor over a 3-kilometer radius. The same project also provides separate workflows for citizens and administrators, covering geolocation, heat maps, risk advisory, emergency reporting, crime data ingestion, user auditing, and dispatch through spreadsheets.

    The basic idea behind this design is that a digital system should be easy for its intended users to understand, rather than simply displaying technical information. The reference paper provided for this research also deals with usability, accessibility, iterative design, feedback, and the link between technology and human needs. This paper uses that discussion of human-centered software design as a framework, although its technical content comes from the ALERTX project.

    The main innovation of ALERTX is not a new theory of crime prediction. What it does is bring together several practical elements (geospatial visualization, weighted risk assessment, route comparison, authentication, emergency alerting, and data administration) in one web application. The significance of this research lies in showing how these elements can work together as part of an operational process.

    1. Problem Statement

      The crime-related data available to citizens may consist of scattered pieces of information such as reports, news, lists, and even static statistics. This information does not always tell citizens where their own risk zone lies, given their actual position and where they plan to go. A second challenge is operational: once an emergency report is generated, the data has to be recorded and followed up through a clear chain of action.

    2. Objectives

      • Create a public-safety application that runs in a web browser as a Progressive Web Application.

      • Represent crime data spatially through interactive maps and risk zones.

      • Use crime type weights to calculate a specific risk score.

      • Adjust the score for time so that night is separated from day.

      • Compare the direct trajectory with other possible trajectories and choose the lower-risk option based

        on the projects crime exposure model.

      • Create an emergency SOS process that generates a permanent ticket and lets administrators update its status.

      • Provide role-based access control for citizens and administrators.

      • Manage crime data manually and in batches, and export dispatch information.

  2. Literature Review -Comparison Table

    Aspect

    Description / Application in ALERTX

    References

    Human- Centered Software Design

    ALERTX follows human-centered design principles so that safety analysis is presented in an understandable and actionable form. The system considers usability, user requirements, interaction design, feedback, iteration, and evaluation.

    [9]

    User Interaction and Feedback

    User-provided information is processed by the system and converted into actionable outputs such as maps, risk categories, recommendations, route comparisons, and emergency procedures. This creates a continuous user system feedback cycle.

    [9]

    Progressive Web App (PWA)

    ALERTX uses PWA concepts that allow the application to behave like an installable application while supporting browser caching and service-worker-based offline functionality.

    [11]

    Interactive Mapping

    Leaflet is used as the interactive mapping library, while OpenStreetMap provides collaborative geographic map data for displaying locations, routes, and risk areas.

    [11]

    Distance Calculation

    The Haversine algorithm calculates the great-circle distance between two geographical coordinates using latitude and longitude. This supports location-based distance calculations within ALERTX.

    [10]

    Geospatial Crime Analysis

    Recent research demonstrates the importance of spatial, temporal, and geospatial techniques in urban crime analysis, including micro-geographic prediction, temporal patterns, GIS-based analysis, and hotspot identification.

    [1][7]

    Machine Learning Context

    Existing 20242025 studies use GIS, machine learning, spatial clustering, environmental parameters, and deep spatiotemporal models for crime prediction. ALERTX differs by currently using a deterministic risk engine rather than a trained machine-learning model.

    [1][7]

    Spatial Risk

    Assessment

    ALERTX uses geographical information and risk zones to

    represent areas with different levels of potential safety

    [1][7]

    Aspect

    Description / Application in ALERTX

    References

    risk, helping users understand their surrounding environment.

    Overall System Approach

    ALERTX combines human-centered interaction, web technologies, geospatial mapping, distance calculation, spatial risk analysis, and authentication into an integrated public-safety platform.

    [1][11]
  3. System Architecture

    ALERTX uses a multi-tier client-server architecture. The presentation tier consists of the login page, the citizen dashboard, the administrator dashboard, the responsive design, and the map interface. The services tier is built with the Flask framework and provides REST interfaces for authentication, crime information, risk assessment, route analysis, emergency reports, administration, and analytics. The analytical engine is separated into a backend component that carries out geographic distance computation, spatial risk assessment, route-risk assessment, and safe-route selection.

    Layer

    Main Components

    Purpose

    Presentation

    HTML, CSS, JavaScript, PWA manifest, service worker, Leaflet

    Citizen and administrator interaction

    API / Service

    Flask REST API

    Authentication, crime data, risk, routes, SOS and administration

    Security

    JWT, bearer-token validation, role checks

    Identity, authentication and authorization

    Analytics

    ai_engine.py

    Distance, spatial risk, temporal adjustment and route-risk calculations

    Persistence

    SQLite + SQLAlchemy

    Users, crime zones, incident tickets and audit records

    Reporting

    XlsxWriter / spreadsheet export

    Dispatch and incident reporting

    Table 1. Major ALERTX architectural layers and responsibilities.

    1. System Workflow

      • Citizen/Admin Browser/PWA interface

      • Browser Flask REST API

      • Flask Authentication/Security layer

      • Flask Risk & Route Engine

      • Flask SQLite database

      • The database, together with the risk engine, produces a JSON response.

      • JSON response Risk dashboard, map, route comparison or dispatch console

        Figure 1. Logical data flow of the ALERTX system (textual representation).

  4. Methodology

    The methodology used for this report is implementation-based. The uploaded project was analyzed through its abstract, source code, data structures, user interface script, service worker logic, and test automation process, with the aim of identifying what the system can actually do.

    The methodology proceeds as follows: requirements identification, data modeling, backend service creation, risk engine creation, map and dashboard integration, emergency workflow integration, offline mode/PWA, and endpoint verification. This process is in line with existing HCI concepts, which rely on iterative development and testing [9].

    1. Data Model

      The database model is made up of four major entities. The User entity holds identity, role, hashed password, emergency contact details, status, and creation date. The CrimeZone entity holds the geographic location of a surveillance area along with theft, assault, robbery, severity, risk value, and risk level.

    2. Demonstration Crime Dataset

      The project archive contains a crime-data JSON file covering 20 monitored locations in the Bengaluru area. The bundled records include fields such as area name, postal code, latitude, longitude, theft count, assault count, and robbery count, as well as recent incident records in the JSON version. The dataset

      should be treated as a project demonstration dataset unless an external official source is explicitly attached to it. For that reason, this paper does not present the bundled values as official police statistics.

      Area

      Theft

      Assault

      Robbery

      Baseline score (1,2,3)

      MG Road

      12

      6

      4

      36

      Majestic

      20

      10

      8

      64

      Koramangala

      8

      3

      2

      22

      Marathahalli

      22

      12

      9

      73

      Commercial Street

      25

      14

      10

      83

      Table 2. Sample values from the project crime dataset. Baseline score uses the database model's 1/2/3 weighting; the live spatial engine uses 1/2.5/3.5.

    3. Crime Categories Relevant to ALERTX

      ALERTX currently models three principal incident categories in its spatial risk engine: theft, assault, and robbery. These categories map directly onto the project's data fields and weighting formula, which makes them more appropriate to discuss here than a broad catalogue of unrelated crimes. General crime literature treats theft as the non-consensual taking of property, assault as conduct involving physical harm, unwanted contact, or threats (depending on the legal system), and robbery as the taking of property through force, threat, or fear. These descriptions serve only as conceptual background, and the project's database counts should not be read as legal findings about individual incidents.

      Table 5. Crime categories used by ALERTX and their relationship to the current Indian legal framework.

      ALERTX Category

      General Meaning

      Current Indian Legal Context

      Role in ALERTX

      Theft

      Taking another person's property without consent.

      BNS §303: Theft.

      Weighted with coefficient 1.0 in the live spatial engine.

      Assault

      Conduct involving physical harm, unwanted contact, or threat/attempt depending on context.

      BNS §130 defines assault; related hurt provisions appear in §§114 125.

      Weighted with coefficient 2.5 in the live spatial engine.

      Robbery

      Taking property where theft/extortion is accompanied by immediate force, hurt, restraint, or fear.

      BNS §309: Robbery; §§310313 cover dacoity and related aggravated offences.

      Weighted with cofficient 3.5 in the live spatial engine.

      The legal mapping is included to explain the terminology used in the application, not to turn the risk

      score into a legal classification. India's current criminal law framework is the Bharatiya Nyaya Sanhita (BNS), 2023, which came into force on July 1, 2024. This paper therefore refers to BNS sections rather than presenting old IPC section numbers as the current law [5].

      It is also important to separate the project's AI-Based label from a claim of machine-learning prediction. The supplied implementation relies on deterministic, weighted, distance-based, and time- based rules rather than a trained machine-learning model. Accordingly, this paper describes the component as a risk prediction engine or heuristic risk model. A future version could validate these fixed weights, or replace them, with a trained model built on a sufficiently large set of time-stamped and geocoded historical crime data.

  5. Spatio-Temporal Risk Prediction Model

    The risk engine is the central analytical component of ALERTX. It receives a geographic coordinate and a set of crime zones and evaluates the zones that fall within a configurable radius. The current dashboard calls the engine with a 3-kilometre radius. The calculation has four main stages: geographic distance measurement, crime-type weighting, inverse-distance weighting, and nocturnal adjustment.

    1. Haversine Distance

      For two points given as latitude and longitude, the engine calculates the great-circle distance using the Haversine formulation. In the implementation, the Earth radius is set to 6371 kilometres. The resulting distance serves two purposes: it determines whether a zone lies inside the monitoring radius, and it controls how much that zone influences the composite risk score. Haversine distance is appropriate for a lightweight geographic calculation when the application works with latitude/longitude coordinates [10].

    2. Crime Severity Weighting

      The live spatial engine assigns a weight of 1.0 to theft, 2.5 to assault, and 3.5 to robbery. For zone i, the base score can therefore be written as:

      S = 1.0T + 2.5A + 3.5R

      where T, A and R are the recorded theft, assault and robbery counts for zone i. These weights are design parameters of the project, not coefficients learned from a statistical training dataset.

    3. Inverse-Distance Weighting

      A nearby crime zone should influence a person's current location more strongly than one that is farther away. ALERTX applies this idea through the following weight:

      w = 1 / (1 + d¹·)

      where d is the Haversine distance in kilometres. The composite score before the time adjustment is the weighted average:

      C = (Sw) / w

    4. Nocturnal Adjustment and Classification

      The implementation treats 20:00 through 05:59 as night mode. In that period the composite score is multiplied by 1.25, and the classification thresholds are lowered as well: the high-risk threshold moves from 24 to 20, and the medium-risk threshold from 11 to 9. The output includes a risk level, a safety percentage, a descriptive safety badge, a recommendation, the number of monitored nearby zones, and a breakdown of theft, assault and robbery counts.

      Condition

      Day Threshold

      Night Threshold

      Output

      LOW

      < 11

      < 9

      Standard precautions

      MEDIUM

      11<24

      9<20

      Situational awareness

      HIGH

      24

      20

      Caution / alternate travel advised

      Table 3. Risk classification thresholds implemented by the spatial risk engine.

  6. AI Safe Route Navigation

    The route component does not call a conventional road-routing service. Instead, the project builds a direct line between an origin and a destination, samples points along that line, measures crime exposure at those points, and evaluates alternative curved trajectories displaced perpendicular to the direct path. The candidate offsets currently are 0.0, +0.015, 0.015, +0.030 and 0.030 degrees in coordinate space.

    For each sampled route, the engine examines crime zones within 1.5 kilometres of every route point. A zone's contribution is calculated with the same crime-type weights and an inverse-distance term. The route risk is the average exposure across the sampled points. The route with the lowest calculated exposure is returned as the safe route, together with its distance, estimated travel time, risk score, waypoints, and the percentage reduction in calculated crime exposure.

    This distinction matters: the generated path is a risk-optimized geometric trajectory, not a full road- network route. A production system would need a routing graph or routing service to guarantee that every waypoint corresponds to a road that can be driven or walked.

  7. Implementation Results and Validation

    The project archive contains an automated unittest suite with ten test cases. They cover registration and password hashing, duplicate-account prevention, JWT login, rejection of unauthorized access, role- based authorization, emergency-contact updates, risk assessment, safe-route navigation, emergency SOS status progression, and spreadsheet export. Together, these tests provide a structured verification plan for the main backend workflows.

    A separate direct run of the analytical engine on the bundled demonstration dataset gives the following illustrative outputs when the risk engine is evaluated at selected project coordinates. These values are calculated from the project code and the bundled dataset, and they should not be read as measured real- world crime probabilities.

    Location

    Risk Score

    Risk Level

    Safety %

    Nearby Zones

    MG Road

    54.1

    HIGH

    15

    5

    Majestic

    67.8

    HIGH

    15

    2

    Koramangala

    29.2

    HIGH

    41

    3

    Marathahalli

    83.5

    HIGH

    15

    1

    Commercial Street

    62.4

    HIGH

    15

    5

    Table 4. Illustrative risk-engine outputs using the project's bundled crime_data.py records.

    In the route test that corresponds to the project's automated test case, the direct geometric trajectory from MG Road to Marathahalli is approximately 11.37 km, with a calculated exposure score of 36.4. The lowest-risk candidate produced by the current route algorithm is approximately 13.48 km, with an exposure score of 19.2. That is a calculated 47% reduction in crime exposure, at the cost of a geometric detour of approximately 2.11 km. Again, these figures describe the project's mathematical model, not observed travel risk.

    The automated test suite could not be run in the isolated analysis environment used here, because Flask was not installed in it. This paper therefore does not claim a successful end-to-end test pass rate. The test source itself shows the intended assertions, including that the safe-route risk should be less than or equal to the direct-route

    Figure 3. ALERXT Sae Route Planning and Risk-Aware Navigation Interface

Figure 4. ALERXT Command and Dispatch Dashboard for Emergency Incident Management

Figure 2. ALERXT Area Safety Assessment and

Citizen Location Monitoring Interface

Figure 1. ALERXT Live Emergency Queue and Real-Time Incident Mapping Dashboard

  1. Future Scope

    Future development can improve ALERTX in several directions. First, the heuristic risk engine could be replaced or complemented by a statistically validated model trained on time-stamped and geocoded historical incidents. This would let the system estimate risk from observed patterns instead of relying on fixed weights alone.

    Second, the route module can be integrated with a genuine road-network graph. A graph-based approach could assign a safety cost to road segments and optimize a route while considering distance, travel time, accessibility, and crime exposure together. Third, the system could incorporate richer temporal features such as weekday effects, seasonal patterns, event periods, and rolling incident density.

    Fourth, the citizen interface could offer more accessibility options, multiple languages, simplified navigation, screen-reader improvements, and configurable alert preferences. These improvements are consistent with established usability and human-centred design principles [9]. Fifth, the administrative dashboard could include trend analytics, anomaly detection, geographic clustering, and data-quality monitoring.

    Finally, any real deployment should put governance in place around data provenance and privacy. Crime- risk outputs should be presented as contextual indicators, not as definitive statements that a person or neighborhood is dangerous. Transparent explanations, source timestamps, confidence indicators, and a clear separation between project-generated risk scores and verified emergency information would make the system more responsible.

  2. Conclusion

ALERTX shows how a web-based geospatial application can bring crime data, geographic computation, route analysis, emergency reporting, and administrative workflows together in a single public-safety platform. The system uses Flask and SQLAlchemy for backend services and persistence, Leaflet and OpenStreetMap for interactive geographic visualization, JWT-based authentication for protected operations, and a dedicated analytical engine for spatial and temporal risk estimation.

The project's main analytical contribution is a transparent risk formulation built on crime-type severity, inverse-distance influence, and nocturnal adjustment. Its route component carries the same idea from a point location over to a travel trajectory, comparing candidate paths by their calculated crime exposure. The resulting platform is best understood as a decision-support prototype that helps demonstrate how urban safety information can be turned into actionable digital guidance.

The next stage of the work should focus on data provenance, empirical calibration, road-network routing, security hardening, and field-based usability evaluation. With those additions, ALERTX could move from a functional prototype toward a more rigorously validated urban safety information system.

References

  1. R. Khalfa and W. Hardyns, Comparing Machine Learning-Based Crime Predictions Across Micro- Geographic Units: Street Segments, Rectangular Grids, and Hexagonal Grids, Applied Spatial Analysis and Policy, vol. 18, art. no. 79, 2025, doi: 10.1007/s12061-025-09683-1.

  2. E. G. lgün and M. Dener, Exploratory data analysis, time series analysis, crime type prediction, and trend forecasting in crime data using machine learning, deep learning, and statistical methods, Neural Computing and Applications, vol. 37, pp. 1177311798, 2025, doi: 10.1007/s00521-025-11094- 9.

  3. Y. Cai, A. Chen, Z. Tang, Y. Wang, and Y. Song, Advancing urban management: Integrating GIS, LLMs, and media narratives into environmental and socio-economic analyses for enhanced urban crime analysis, PLOS ONE, vol. 20, no. 11, e0331788, 2025, doi: 10.1371/journal.pone.0331788.

  4. STEval: A framework for evaluating spatio-temporal crime prediction models, Engineering Applications of Artificial Intelligence, vol. 162, art. no. 112123, 2025, doi: 10.1016/j.engappai.2025.112123.

  5. Ministry of Home Affairs, Government of India, Notification appointing 1 July 2024 as the date on which the provisions of the Bharatiya Nyaya Sanhita, 2023 come into force, Feb. 23, 2024.

  6. G. Bediroglu and H. E. Colak, Predicting and analyzing crimeEnvironmental design relationship via GIS-based machine learning approach, Transactions in GIS, vol. 28, pp. 13771399, 2024, doi: 10.1111/tgis.13195.

  7. C. Jing, X. Lv, Y. Wang, M. Qin, S. Jin, S. Wu, and G. Xu, A deep multi-scale neural networks for crime hotspot mapping prediction, Computers, Environment and Urban Systems, vol. 109, art. no. 102089, 2024, doi: 10.1016/j.compenvurbsys.2024.102089.

  8. Y. Sahu and V. Kumar, Spatial Clustering and Machine Learning for Crime Prediction: A Case Study on Women Safety in Bhopal, in Proceedings of the Asian Conference on Computer Vision Workshops (ACCV Workshops), 2024, pp. 648663.

  9. International Organization for Standardization, Ergonomics of human-system interactionPart 210: Human-centred design for interactive systems, ISO 9241-210:2019, 2019.

  10. Wikipedia contributors, Haversine formula, Wikipedia, The Free Encyclopedia. [Online].

    Available: https://en.wikipedia.org/wiki/Haversine_formula

  11. Leaflet, Leafletan open-source JavaScript library for interactive maps. [Online]. Available:

    https://leafletjs.com/

  12. M. Jones, J. Bradley, and N. Sakimura, JSON Web Token (JWT), RFC 7519, Internet Engineering

Task Force, May 2015, doi: 10.17487/RFC7519.