# devashishprasad/smart-traffic-junction architecture

> Architecture diagram of the GitHub repository devashishprasad/smart-traffic-junction, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/devashishprasad/smart-traffic-junction
- Repository: https://github.com/devashishprasad/smart-traffic-junction

## Overview

##### Data Processing Pipeline
- Input Layer
- Video Input (QMUL Junction 2 dataset)
- ROI Extraction Module (saverois.py)

- Feature Extraction Layer
- HOG (Histogram of Oriented Gradients) Processor
- LBP (Local Binary Pattern) Processor
- Feature Storage (save_HOG_LBP.py)

- Machine Learning Layer
- SVM Classifier (classifier.py)
- Model Storage

- Prediction Layer
- Real-time Processing (predictor.py)
- Traffic Density Output

##### System Integration Points
- Data Flow Connections
- Storage Interfaces
- Processing Pipelines

##### Specific elements
- Video input source
- ROI extraction process
- Feature extraction (HOG/LBP)
- SVM classifier
- Real-time prediction system
- Output visualization

##### Pipeline nature of the system
- Clear separation between preprocessing, feature extraction, and classification stages
- Parallel processing where applicable (HOG and LBP extraction)

##### Technical specifications
- Input video format
- Feature vector dimensions
- Model parameters
- Output format

##### System boundaries
- Training pipeline
- Inference pipeline
- Storage components

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles and Classes
    classDef storage fill:#b3d9ff,stroke:#333
    classDef processing fill:#90EE90,stroke:#333
    classDef decision fill:#FFE5B4,stroke:#333
    classDef ml fill:#DDA0DD,stroke:#333
    classDef input fill:#E6E6FA,stroke:#333

    %% Legend
    subgraph Legend
        L1[Storage]:::storage
        L2[Processing]:::processing
        L3[Decision Point]:::decision
        L4[ML Component]:::ml
        L5[Input/Output]:::input
    end

    %% Main Pipeline
    VideoInput[Video Input]:::input
    click VideoInput "https://github.com/DevashishPrasad/Smart-Traffic-Junction/blob/master/dataset.zip"
    
    ROIExtraction[ROI Extraction Module]:::processing
    click ROIExtraction "https://github.com/DevashishPrasad/Smart-Traffic-Junction/blob/master/saverois.py"
    
    subgraph FeatureExtraction[Feature Extraction Layer]
        HOG[HOG Processor]:::processing
        LBP[LBP Processor]:::processing
        FeatureStorage[Feature Storage]:::storage
    end
    click FeatureExtraction "https://github.com/DevashishPrasad/Smart-Traffic-Junction/blob/master/save_HOG_LBP.py"

    subgraph MLLayer[Machine Learning Layer]
        SVMClassifier[SVM Classifier]:::ml
        ModelStorage[Model Storage]:::storage
    end
    click MLLayer "https://github.com/DevashishPrasad/Smart-Traffic-Junction/blob/master/classifier.py"

    subgraph PredictionLayer[Prediction Layer]
        RealTimeProc[Real-time Processing]:::processing
        DensityOutput[Traffic Density Output]:::input
    end
    click PredictionLayer "https://github.com/DevashishPrasad/Smart-Traffic-Junction/blob/master/predictor.py"

    MainProcessor[Main Processing Pipeline]:::processing
    click MainProcessor "https://github.com/DevashishPrasad/Smart-Traffic-Junction/blob/master/image-processing/main.py"

    Documentation[System Documentation]:::storage
    click Documentation "https://github.com/DevashishPrasad/Smart-Traffic-Junction/blob/master/README.md"

    Research[Research Reference]:::storage
    click Research "https://github.com/DevashishPrasad/Smart-Traffic-Junction/blob/master/Paper.pdf"

    %% Connections
    VideoInput --> ROIExtraction
    ROIExtraction --> HOG
    ROIExtraction --> LBP
    HOG --> FeatureStorage
    LBP --> FeatureStorage
    FeatureStorage --> SVMClassifier
    SVMClassifier --> ModelStorage
    ModelStorage --> RealTimeProc
    RealTimeProc --> DensityOutput
    MainProcessor --> ROIExtraction
    MainProcessor --> FeatureExtraction
    MainProcessor --> MLLayer
    MainProcessor --> PredictionLayer
```
