File size: 1,619 Bytes
73e9c25
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
---
sdk: streamlit
app_file: app.py
---

# TrafCast

A traffic speed prediction system for Los Angeles using LSTM neural networks.

## Overview

TrafCast predicts real-time traffic speeds across major Los Angeles highways and roads using deep learning. The system uses an LSTM (Long Short-Term Memory) model trained on historical traffic data to forecast speed patterns.

## Model Details

- **Architecture**: LSTM neural network with 2,191,617 parameters
- **Training Data**: 32+ million data points from LA traffic sensors
- **Performance**: Best validation loss of 6.6276, test loss of 6.0229
- **Features**: Weather data, road characteristics, time patterns, and historical speeds

## Quick Start

### Prerequisites
- Python 3.8+
- Virtual environment (recommended)

### Installation

1. **Clone the repository**
   ```bash
   git clone <repository-url>
   cd TrafCast
   ```

2. **Create and activate virtual environment**
   ```bash
   python -m venv .venv
   source .venv/bin/activate  # On Windows: .venv\Scripts\activate
   ```

3. **Install dependencies**
   ```bash
   pip install -r requirements.txt
   ```

4. **Run the application**
   ```bash
   streamlit run app.py
   ```

The app will be available at `http://localhost:8501`

## Usage

1. Select roads from the available LA highways
2. Choose a date and time for prediction
3. Select visualization mode (Predicted, Real, or Comparison)
4. Click "Apply Prediction" to generate traffic speed maps

## Data

The model was trained on compressed CSV files containing traffic sensor data from major LA roads including I-405, US-101, I-5, and state highways.