
8,801 railway stations, three trained ML models, and a live map that tells you where India actually needs new stations. Full Python source code plus a Flask dashboard you can run tonight.
Python | scikit-learn | NetworkX | Flask | Leaflet.js | pandas | Chart.js | SciPy
RailGrid AI takes a flat Kaggle table of Indian railway station coordinates and turns it into something an actual planning department could use. The dataset gives you station name, code, state, zone, latitude, longitude, junction flag and route count for 8,801 stations after cleaning. What it doesn't give you is connectivity — there are no station-to-station edges anywhere in the file. So the project builds that structure itself, using a BallTree nearest-neighbour search with the haversine metric to connect each station to its 8 closest neighbours within 120 km. NetworkX then runs shortest-path traversal, degree analysis and betweenness centrality on top of that derived graph.
Four analytical modules sit on that base. A Random Forest zone classifier recovers 4,437 missing railway zone labels at 94.7% accuracy. A coverage gap module uses Gaussian kernel density estimation and nearest-neighbour distance to flag 441 isolated stations. A grid-based recommendation engine scores 0.5-degree cells across the country and returns 20 ranked sites for new stations. And a route count regressor estimates junction traffic from spatial context alone — deliberately excluding is_junction and station_count_in_state, because both leak the target straight into the model.
The whole thing ships as a Flask 3 REST API with 12 endpoints, wired to a Leaflet dashboard with six pages of maps, heatmaps, corridor tracing and live prediction.
Think of it as four questions asked of one dataset.
Where are the gaps? The coverage module measures how far each station sits from its nearest neighbour, flags the top 5% as isolated, and draws a density surface over the whole country. You end up with a heatmap where thin regions are obvious at a glance instead of buried in a spreadsheet.
Which stations hold the network together? Betweenness centrality on the proximity graph ranks stations by how much connectivity flows through them. Pull one high-centrality node out and the network fragments.
Where should the next station go? A 0.5-degree grid gets scored on three components — distance to nearest station (0.45 weight), sparsity within 100 km (0.35), and access to the nearest junction (0.20). Cells under 30 km from an existing station get rejected as redundant. Cells over 160 km away get rejected as unreachable. Top 20 survivors come back ranked, with catchment rings drawn on the map.
What's missing from the records? Roughly half the rows have no railway zone. The classifier fills them in and attaches a confidence score to every single imputed value, so you can filter on it later.
Target leakage. In this dataset, is_junction is derived from route_count — every non-junction has exactly zero routes. Feed route count into a junction predictor and you'll get near-perfect accuracy that means nothing at all. The notebook prints the crosstab, documents the exclusion, and reports an honest 68.4% accuracy instead of a fake 99%. If your examiner asks one sharp question during viva, it'll probably be this one. Good news: the answer is already written out for you in the notebook cells.
No GPU. No cloud account. No dataset licensing headache. The models are Random Forests and Gradient Boosting from scikit-learn, and the full training notebook runs top-to-bottom in 3 to 6 minutes on a normal laptop. You run railgrid_ai_training.ipynb, it spits out models/, outputs/ and figures/, you drop those next to app.py, and the dashboard comes alive.
/api/predictrailway_proximity_graph.graphml so you can open it in Gephi if you want extra viva ammunitionFirst-pass infrastructure shortlisting. Before anyone commissions a terrain or demand study, someone has to decide which 20 locations are even worth studying. That's exactly what the site scorer produces — a geographically justified shortlist that filters out both the redundant spots and the unreachable ones.
Coverage equity reporting. "Region X is underserved" is an opinion until you attach a number to it. The density surface and isolation flags turn it into a measurable claim with a state-wise breakdown.
Maintenance and contingency prioritisation. Centrality rankings tell you which stations, if disrupted, would break the most routes. That maps directly onto where upgrades and disaster planning should go first.
Warehouse and retail siting. Any logistics business picking a distribution hub needs rail proximity as an input. The predict endpoint answers "what's the rail context at this coordinate" for anywhere in India.
Repairing messy government datasets. The zone classifier is really a general recipe for recovering missing categorical labels in any spatial registry. Same approach works on postal circles, district codes, forest divisions, whatever.
If you're a student who needs a working project for your college submission, final-year project, semester project, internship, or academic demonstration, this is for you. Whether you're studying BCA, B.Tech, MCA, M.Tech, Computer Science, IT, AI, Data Science, or another related field, you can choose a project that fits your requirements. If you need the source code, project report, documentation, or help setting up and running the project, CodeAj gives you the resources and support to get started faster.
Honestly, this one suits you particularly well if your guide keeps saying "your project has no novelty." Reservation systems and railway booking portals get submitted by four teams every year in every college. Nobody submits a betweenness centrality analysis of the station network. Browse the rest of the AI and ML final year projects if you want to compare before deciding.
You get the complete source code — the 56-cell training notebook, app.py, all seven Jinja templates, the JS modules in static/js/, requirements file, everything. The project report and documentation come with it, so you're not writing 60 pages from a blank page at 1 AM. And if the setup fights you, our team walks you through it instead of leaving you on a forum thread from 2019. If you're still shopping around, the wider machine learning projects with source code collection and the Flask project source code library have more options in the same stack.
The corridor graph is inferred, not real. There's no train routing data in the dataset, so two stations 20 km apart across a river will look connected here even though no track joins them. Route count prediction sits at R squared 0.23 — geography explains under a quarter of junction traffic variance, and the rest comes from historical decisions the data simply doesn't contain. Site recommendations ignore population, terrain, land cost and road access entirely. Betweenness is approximated from a 400-node sample because exact computation over 8,801 nodes is expensive.
All of that is documented in the notebook and the README. Which sounds like a weakness in a listing. It isn't — examiners reward a student who can name their model's boundaries far more than one who claims 99% on everything.
Add any of these professional upgrades to save time and impress your evaluators.
Personal session with an expert developer
We'll install and configure the project on your PC via remote session (Google Meet, Zoom, or AnyDesk).
1-hour live session to explain logic, flow, database design, and key features.
Want to know exactly how the setup works? Review our detailed step-by-step process before scheduling your session.
Fully customized to match your college format, guidelines, and submission standards.
Need feature changes, UI updates, or new features added?
Charges vary based on complexity.
We'll review your request and provide a clear quote before starting work.
Reviews