How tarangver/traffic-sign-recognition-system-using-cnn-and-keras works
This repo is not a “service-based system” (no backend/frontend). It’s a notebook-driven ML application implementing a Traffic Sign Recognition pipeline using CNNs in TensorFlow/Keras, trained on GTSRB (43 classes), with offline training/evaluation plus inference modes:
• Single image prediction (from testIMG/)
• Real-time detection (webcam via OpenCV)
• An ML lifecycle / data pipeline (preprocess → train → evaluate → inference)
• A runtime inference flow (webcam/image → preprocessing → model → class label)
Read the file tree as architecture boundaries
From the tree, the repo is organized around artifacts and stages rather than modules/packages:
• traffic_sign_recognition/notebooks/
• 1_Data_Preprocessing.ipynb — dataset loading + cleaning + normalization + splits
• 2_Model_Training.ipynb — CNN definition + training loop + checkpointing (likely)
• 3_Model_Evaluation.ipynb — metrics + confusion matrix + plots
• 4_Image_Prediction.ipynb — inference on images (e.g., testIMG/*.png)
• 5_RealTime_Detection.ipynb — webcam capture + frame inference (OpenCV)
• traffic_sign_recognition/data/dataset.txt — dataset reference/details (source pointer)
• traffic_sign_recognition/testIMG/ — inference inputs
• traffic_sign_recognition/Outpur Screenshot/ — results images (outputs)
• Documentations/ — report/paper/PPT (context, not runtime)
Offline ML pipeline (build/train/evaluate)
Components to show
Data Source
• “GTSRB dataset (~50k images, 43 classes)”
• As an external datastore (downloaded dataset) feeding preprocessing
Data Preprocessing Stage (1_Data_Preprocessing.ipynb)
• Resize/crop (if any), normalization, label encoding
• Train/val/test split
• Output: preprocessed tensors/arrays + labels (and possibly augmented samples)
Model Training Stage (2_Model_Training.ipynb)
• Keras CNN: Conv2D/ReLU → MaxPool → Dropout → Dense → Softmax(43)
• Output: trained model artifact (e.g., .h5/SavedModel) + training history
Model Evaluation Stage (3_Model_Evaluation.ipynb)
• Metrics: accuracy/loss curves, confusion matrix, classification report
• Output: plots + evaluation summary (stored as images in “Output Screenshot”)
Artifacts/Outputs
• Screenshots/plots (Outpur Screenshot/)
• Documentation PDFs (optional, separate lane)
Online/interactive inference (predict)
Components to show
Batch/Single Image Predictor (4_Image_Prediction.ipynb)
• Input: testIMG/*.png (or user-supplied image)
• Preprocess (must match training preprocessing)
• Load trained model → predict → map class index → label
Real-Time Detector (5_RealTime_Detection.ipynb)
• Input: Webcam frames (OpenCV)
• Frame preprocessing → model inference → overlay label on frame → display UI
• TensorFlow/Keras (training + inference)
• OpenCV (webcam + image IO)
• NumPy (arrays)
• Scikit-learn (confusion matrix / metrics)
• Matplotlib/Seaborn (plots)
Relationships and interactions to show (b)
• GTSRB dataset → 1_Data_Preprocessing.ipynb
• 1_Data_Preprocessing.ipynb → (Preprocessed Train/Val/Test sets) → 2_Model_Training.ipynb
• 2_Model_Training.ipynb → (Trained Model Artifact) → “Model Registry/Model File”
• 2_Model_Training.ipynb → (Training History) → 3_Model_Evaluation.ipynb (optional)
• Preprocessed Test Set → 3_Model_Evaluation.ipynb
• 3_Model_Evaluation.ipynb → “Metrics/Confusion Matrix/Plots” → Outpur Screenshot/
• “Model File” → 4_Image_Prediction.ipynb
• testIMG/*.png → 4_Image_Prediction.ipynb → “Predicted Class + Confidence”
• “Model File” → 5_RealTime_Detection.ipynb
• “Webcam” → 5_RealTime_Detection.ipynb → “Annotated Live Video Feed”
• Preprocessing Function (resize/normalize) used by both 1_Data_Preprocessing and inference notebooks (even if duplicated in notebooks today).
Architectural patterns / principles to highlight (c)
• Pipeline architecture: sequential stages with clearly defined inputs/outputs.
• Artifact-driven workflow: training produces a model artifact consumed by inference.
• Separation of concerns (by notebook):
• Data prep vs training vs evaluation vs inference.
• Consistency constraint: same preprocessing + label mapping across all inference paths.
• Two runtime modes:
• Offline evaluation (batch metrics)
• Interactive/real-time inference loop (webcam frames)
• Normalization scheme (e.g., /255.0)
• Output vector size = 43 softmax probabilities
Technologies to place
Attach these to the components where they matter:
• TensorFlow/Keras: model definition, training, saving/loading, inference
• OpenCV: webcam capture, frame conversion, possibly ROI extraction
• Scikit-learn: confusion matrix, classification report
• Matplotlib/Seaborn: training curves, confusion matrix plots
• NumPy: data arrays, transformations
To make it principal-engineer-grade and unambiguous:
Labels
• Use exact names from repo:
• 1_Data_Preprocessing.ipynb, 2_Model_Training.ipynb, etc.
• testIMG/, data/dataset.txt, Outpur Screenshot/
• Semantic labels under them: “Split/Normalize”, “Train CNN”, “Confusion Matrix”, “Webcam Loop”.
Detail level (don’t under-specify)
Because “separating into as many components as possible is best”, explicitly break out:
• “Image Preprocessing (resize/normalize)” as a shared subcomponent
• “Model Artifact Store (SavedModel/H5)” even if not present in the tree
Gaps (and how to represent them honestly)
• “Model file (generated)” as an artifact node with a note: “Produced during training”.