HyperAIHyperAI

Command Palette

Search for a command to run...

A MODULAR ZERO-SHOT PIPELINE FOR ACCIDENT DETECTION,LOCALIZATION, AND CLASSIFICATION IN TRAFFICSURVEILLANCE VIDEO

Amey Thakur Sarvesh Talele

Abstract

We describe a zero-shot pipeline developed for the ACCIDENT @ CVPR 2026 challenge. The challenge requires predicting when, where, and what type of traffic accident occurs in surveillance video, without labeled real-world training data. Our method separates the problem into three independent modules. The first module localizes the collision in time by running peak detection on z-score normalized frame-difference signals. The second module finds the impact location by computing the weighted centroid of cumulative dense optical flow magnitude maps using the Farneback algorithm. The third module classifies collision type by measuring cosine similarity between CLIP image embeddings of frames near the detected peak and text embeddings built from multi-prompt natural language descriptions of each collision category. No domain-specific finetuning is involved; the pipeline processes each video using only pre-trained model weights. Our implementation is publicly available as a Kaggle notebook [Thakur and Talele, 2026].

One-sentence Summary

For the ACCIDENT @ CVPR 2026 challenge, independent researchers propose a modular zero-shot pipeline that detects accident timing via peak detection on z-score normalized frame-difference signals, localizes impact using the weighted centroid of cumulative Farneback optical flow magnitude maps, and classifies collision types through CLIP image-text cosine similarity, all without domain-specific finetuning.

Key Contributions

  • A modular zero-shot pipeline is introduced for the ACCIDENT @ CVPR 2026 challenge, separating traffic accident analysis into independent temporal, spatial, and collision-type modules that rely only on pre-trained model weights.
  • The temporal module localizes the collision via z-score peak detection on frame-difference signals, and the spatial module estimates the impact point by accumulating Farneback optical flow, applying 90th-percentile thresholding, and returning the weighted centroid.
  • A CLIP-based classification module matches image embeddings from frames around the detected peak against multi-prompt text embeddings of the five collision categories, and the full pipeline achieves a public leaderboard score of 0.2523 without domain-specific fine-tuning.

Introduction

Road traffic crashes kill over one million people each year, and surveillance cameras already record many of these events, so automated analysis could provide faster emergency alerts and objective scene reconstructions. Prior accident detection methods usually require supervised training on annotated video from the same deployment environment, making them expensive to transfer across different cameras, lighting, and traffic patterns. The ACCIDENT @ CVPR 2026 competition intensifies this challenge by allowing only synthetic CARLA videos for development and prohibiting manual annotation of the real CCTV test set. To address this, the authors propose a modular zero-shot pipeline with independent modules for temporal localization, spatial impact-point estimation, and collision-type classification, using statistical frame-difference anomaly detection, dense optical flow centroids, and CLIP-based text-image matching.

Dataset

  • Sources and composition:

    • The paper uses the ACCIDENT @ CVPR 2026 dataset.
    • It has two splits: development and test.
    • Development split: 2,211 synthetic CCTV-style videos generated with the CARLA simulator.
    • Test split: 2,027 real surveillance recordings from public traffic camera feeds.
  • Development split details:

    • Five collision categories with counts: rear-end 794, head-on 588, sideswipe 405, t-bone 358, single-vehicle 66.
    • Annotations include accident time, impact coordinates, and collision type.
    • Synthetic videos are rendered at 1920 x 1080 resolution with a fixed 20 FPS frame rate.
    • Clip durations range from 5.8 to 32.2 seconds, with a mean of 17.7 seconds and standard deviation of 3.9 seconds.
    • Accident time occurs at a median of 6.9 seconds into the clip, with an interquartile range of 5.2 to 9.8 seconds, placing most collisions in the first half.
    • Impact coordinates are normalized 2D coordinates and cluster toward the frame center: c_x and c_y both have means near 0.50, with standard deviations of 0.13 and 0.18.
  • Test split details:

    • 2,027 real surveillance recordings.
    • Resolution, frame rate, and lighting vary across videos.
    • Compression artifacts, lens distortion, and partial occlusion are common.
    • The test split may not be annotated by hand, so methods must generalize from the synthetic domain or from general-purpose pre-training alone.
  • Processing and usage:

    • The development split serves as the labeled synthetic source for training and validation.
    • The test split is the real-world evaluation set.
    • The excerpt does not describe additional filtering rules, cropping strategy, or training mixture ratios.
    • The main processing details provided are fixed CARLA rendering resolution and frame rate, normalized impact coordinates, and temporal accident annotations.

Method

The authors formulate the accident detection task as predicting a tuple (t,cx,cy,k)(t^*, c_x^*, c_y^*, k^*)(t,cx,cy,k), representing the accident time in seconds, the normalized image coordinates of the impact point, and the collision type from a predefined set K={head-on,rear-end,sideswipe,single,t-bone}\mathcal{K} = \{\text{head-on}, \text{rear-end}, \text{sideswipe}, \text{single}, \text{t-bone}\}K={head-on,rear-end,sideswipe,single,t-bone}. The pipeline is decomposed into three distinct modules: temporal peak detection for time estimation, spatial impact localization for coordinate prediction, and collision type classification using a pre-trained vision-language model.

To estimate the accident time, the authors exploit the sudden intensity changes caused by collisions. They construct a one-dimensional signal from per-frame brightness differences. Given a grayscale frame ItRH×WI_t \in \mathbb{R}^{H \times W}ItRH×W resized to H=180H=180H=180 and W=320W=320W=320, the mean absolute difference between adjacent frames is computed as:

dt=1HWu=1Hv=1WIt+1(u,v)It(u,v)d_t = \frac{1}{HW} \sum_{u=1}^{H} \sum_{v=1}^{W} |I_{t+1}(u, v) - I_t(u, v)|dt=HW1u=1Hv=1WIt+1(u,v)It(u,v)

This raw signal contains both collision signals and background noise. To suppress short-lived noise from camera shake or ordinary traffic, a centered rolling mean with window w=5w=5w=5 is applied:

dˉt=1WtsWtds\bar{d}_t = \frac{1}{|W_t|} \sum_{s \in W_t} d_sdˉt=Wt1sWtds

where Wt={s:stw/2}W_t = \{s: |s - t| \le \lfloor w/2 \rfloor\}Wt={s:stw/2⌋}. The smoothed values are then normalized into z-scores using the series-wide mean μ\muμ and standard deviation σ\sigmaσ:

zt=dˉtμσ+εz_t = \frac{\bar{d}_t - \mu}{\sigma + \varepsilon}zt=σ+εdˉtμ

with ε=108\varepsilon = 10^{-8}ε=108. Frames with ztz_tzt exceeding a threshold τ=1.5\tau = 1.5τ=1.5 are treated as anomaly candidates. The frame with the highest anomaly score among these candidates is selected as the accident frame index tframet_{\text{frame}}^*tframe. If no frame crosses the threshold, the global maximum is selected. The final time prediction is t=tframe/ft^* = t_{\text{frame}}^* / ft=tframe/f.

As shown in the figure below, the raw frame-difference series contains a mixture of gradual intensity drift and sharp transients. After smoothing and normalization, the collision event stands out as a distinct peak while background variation remains below the detection threshold.

Once the accident time is identified, the authors localize the impact point by accumulating dense optical flow over a short window. A 30-frame window is centered on the predicted accident frame index (or starting at N/3\lfloor N/3 \rfloorN/3 if time is unavailable). The Farneback dense optical flow algorithm is run at 320×180320 \times 180320×180 resolution for consecutive frames within this window. The displacement magnitudes are summed to create a magnitude map:

M(u,v)=tfx2(u,v,t)+fy2(u,v,t)M(u, v) = \sum_{t} \sqrt{f_x^2(u, v, t) + f_y^2(u, v, t)}M(u,v)=tfx2(u,v,t)+fy2(u,v,t)

To suppress diffuse background motion, a percentile threshold at the 90th percentile of MMM is applied, zeroing out lower values. The impact location is then calculated as the weighted centroid of the thresholded map, normalized to unit coordinates:

cx=1Wu,vvM(u,v)u,vM(u,v),cy=1Hu,vuM(u,v)u,vM(u,v)c_x^* = \frac{1}{W} \frac{\sum_{u, v} v \cdot M(u, v)}{\sum_{u, v} M(u, v)}, \quad c_y^* = \frac{1}{H} \frac{\sum_{u, v} u \cdot M(u, v)}{\sum_{u, v} M(u, v)}cx=W1u,vM(u,v)u,vvM(u,v),cy=H1u,vM(u,v)u,vuM(u,v)

If the sum of magnitudes is negligible, the frame center (0.5,0.5)(0.5, 0.5)(0.5,0.5) is returned.

Refer to the framework diagram below, which illustrates the accumulation result. The collision region concentrates most of the optical flow energy into a compact spatial cluster. After percentile thresholding, the weighted centroid falls within that cluster to provide a localized impact coordinate.

For collision type classification, the authors leverage CLIP, a pre-trained vision-language model. For each collision type kKk \in \mathcal{K}kK, five natural language descriptions {pk1,,pk5}\{p_k^1, \ldots, p_k^5\}{pk1,,pk5} are written to characterize the collision from a bystander perspective. Each prompt is encoded by the CLIP text encoder ϕtext\phi_{\text{text}}ϕtext, L2-normalized, and averaged to form a class text embedding:

tk=15j=15ϕtext(pkj)ϕtext(pkj)\mathbf{t}_k = \frac{1}{5} \sum_{j=1}^{5} \frac{\phi_{\text{text}}(p_k^j)}{\|\phi_{\text{text}}(p_k^j)\|}tk=51j=15ϕtext(pkj)ϕtext(pkj)

At inference time, eight video frames centered on the predicted accident time tt^*t are extracted and fed into the CLIP visual encoder. Each image embedding is L2-normalized and averaged into a single representation:

v=18i=18ϕimg(Iti)ϕimg(Iti)\mathbf{v} = \frac{1}{8} \sum_{i=1}^{8} \frac{\phi_{\text{img}}(I_{t_i})}{\|\phi_{\text{img}}(I_{t_i})\|}v=81i=18ϕimg(Iti)ϕimg(Iti)

The predicted collision type is the class with the highest cosine similarity to the video representation:

k=argmaxkKvtkk^* = \arg\max_{k \in \mathcal{K}} \mathbf{v} \cdot \mathbf{t}_kk=argkKmaxvtk

Experiment

The experiments evaluate a training-free CLIP-based pipeline on the ACCIDENT dataset, using synthetic CARLA clips for development and real CCTV surveillance videos for testing, with submissions scored by a harmonic mean of temporal, spatial, and collision-type accuracy. Since no model weights are trained or fine-tuned, the setup validates generalization from synthetic data or general-purpose pre-trained features. Qualitatively, the method can estimate accident time and location well when it detects the correct event, but collision classification is unreliable, likely because CLIP responds to viewpoint and scene geometry rather than collision dynamics. Error analysis attributes failures to large background motion, simultaneous multi-vehicle movement, and overhead or oblique camera angles.

Prompt templates define five collision types: head-on, rear-end, sideswipe, single, and t-bone. For each type, five natural language descriptions are encoded with CLIP, normalized, and averaged into one text embedding to reduce sensitivity to individual wording. In practice, this classification component struggles on real CCTV data, often predicting t-bone for head-on examples and shifting overall predictions toward sideswipe and single categories. Five prompts per collision type are averaged into a single CLIP text embedding to reduce dependence on any one wording. The prompt set covers head-on, rear-end, sideswipe, single, and t-bone collision types. On a calibration subset, all head-on videos were predicted as t-bone by the CLIP-based classifier. Across the full test set, sideswipe was the most predicted category and rear-end was the least predicted, opposite to the rear-end-heavy synthetic training distribution.

Pipeline hyperparameters were selected by visual inspection on synthetic videos and held fixed across all test videos. Temporal detection uses a five-frame smoothing window and a 1.5 z-score threshold, while spatial localization uses a 30-frame context window with multi-scale pyramid processing. In evaluation, the pipeline achieves a modest leaderboard score, and although individual temporal and spatial predictions can be accurate, classification failure drives the composite score to zero through the harmonic mean. Temporal and spatial hyperparameters were fixed across all test videos after visual inspection rather than tuned per video. The predicted collision type distribution on real CCTV is dominated by sideswipe and single-vehicle categories, whereas the synthetic training split is dominated by rear-end collisions. Error analysis attributes temporal localization failures to background motion, spatial drift to multiple moving vehicles, and misclassification to viewpoint differences between synthetic renders and real CCTV footage.

The experiments evaluate a CLIP-based collision classifier and a fixed-parameter temporal/spatial detection pipeline on synthetic and real CCTV video. Five prompt embeddings per collision type are averaged to reduce wording sensitivity, but the classifier struggles on real data, misclassifying head-on cases as t-bone and shifting predictions toward sideswipe and single-vehicle categories despite a rear-end-heavy synthetic training distribution. Temporal and spatial parameters are selected by visual inspection and held constant, yielding modest individual predictions, yet classification failure drives the composite score to zero through the harmonic mean. Error analysis attributes temporal localization failures to background motion, spatial drift to multiple moving vehicles, and misclassification to viewpoint differences between synthetic renders and real CCTV footage.


Build AI with AI

From idea to launch — accelerate your AI development with free AI co-coding, out-of-the-box environment and best price of GPUs.

AI Co-coding
Ready-to-use GPUs
Best Pricing

HyperAI Newsletters

Subscribe to our latest updates
We will deliver the latest updates of the week to your inbox at nine o'clock every Monday morning
Powered by MailChimp