{'fraction_non_alphanumeric': 0.02763448784082535, 'fraction_numerical': 0.010961680176860722, 'mean_word_length': 4.958470545188438, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Dual-Modality Vehicle Anomaly Detection via Bilateral Trajectory Tracing

Traffic anomaly detection has played a crucial role in Intelligent Transportation System (ITS). The main challenges of this task lie in the highly diversified anomaly scenes and variational lighting conditions. Although much work has managed to identify the anomaly in homogenous weather and scene, few resolved to cope with complex ones. In this paper, we proposed a dual-modality modularized methodology for the robust detection of abnormal vehicles. We introduced an integrated anomaly detection framework comprising the following modules: background modeling, vehicle tracking with detection, mask construction, Region of Interest (ROI) backtracking, and dual-modality tracing. Concretely, we employed background modeling to filter the motion information and left the static information for later vehicle detection. For the vehicle detection and tracking module, we adopted YOLOv5 and multi-scale tracking to localize the anomalies. Besides, we utilized the frame difference and tracking results to identify the road and obtain the mask. In addition, we introduced multiple similarity estimation metrics to refine the anomaly period via backtracking. Finally, we proposed a dual-modality bilateral tracing module to refine the time further. The experiments conducted on the Track 4 testset of the NVIDIA 2021 AI City Challenge yielded a result of 0.9302 F1-Score and 3.4039 root mean square error (RMSE), indicating the effectiveness of our framework.


INTRODUCTION
Traffic anomaly detection, one of the critical components for ITS, attracted more attention as the broader use of surveillance cameras. With the aid of anomaly detection, traffic management can respond to emergencies and make instantaneous decisions such as route re-planning and healthcare resource allocation. Admitting more and more cameras are mounted within the urban areas, only a few of the data collected by these devices is processed and responded to. This is because of the extremely un-even situation between limited human monitoring resources and the vast amount of collected data. Thus, an anomaly detection framework of high generalization and efficiency is urgently needed to confront this dilemma. Despite the importance of such an anomaly detection algorithm, several physical challenges, including object occlusion, lighting conditions, ever-changing weather, various anomaly scenarios, etc., must be addressed. Another difficulty comes from the distribution of anomaly since it often refers to an event that is not expected to occur in a given context, suggesting the imbalance between normal and abnormal samples. This creates great difficulty in precisely identifying the anomaly event in all samples since it only makes up a relatively minor fraction. Besides, both the normal scene and abnormal scene are highly diversified. The traffic flow pattern for the normal sample can vary from each other, so it is for the abnormal samples. Therefore, it is critical to define the traffic anomaly. Specifically, in the NVIDIA 2021 AI City Challenge, the traffic anomaly can be substantially categorized into two kinds: stalled vehicles and crashing ones.
In recent years, most of the work is deep-learning-based, and much state-of-art work is end-to-end algorithms. Such algorithms aim to detect anomalies by modeling normal and abnormal samples through deep neuron networks. Admitting great performance has been achieved by these previous work on many datasets, such as UCF-Crime [1], ShanghaiTech [2], UCSD Ped [3], SUBWAY [4], they can hardly generalize to another dataset. For one aspect, the scenes within the aforementioned dataset are often identical and homogenous. For another aspect, the anomalies in these datasets give great change in both inten-sity and motion of the frames. Both these two features make the modeling of the anomaly event readily. Contrary to these datasets, Iowa DOT [5], which functions as the benchmark for the challenge, consists of multi-scenarios and various weather, indicating the infeasibility of implementing aforementioned methodologies. Facing the current challenges, we proposed a dual-modality framework to fully utilize the motion information among frames to identify the traffic anomaly. Generally, two reasonable assumptions to tackle anomaly localization are made. First, the normal vehicles should drive along the road without parking movement lasting longer than the traffic signal control period or un-smoothed trajectory; thus, we define the problem as identify the stationary vehicle and vehicles with abnormal trajectory, which often refers to a car crashing event. Secondly, either stalled and crashed vehicles will ultimately come to a stop.
With these two assumptions, we will localize the stopping time of the vehicle then construct the trajectory to determine if it is a stalled vehicle. For a stalled vehicle with an un-smoothed trajectory, we determined that the start time would be when it began to deviates from the normal status. Concretely, we firstly utilized the classic MOG2 [6] algorithm for the background modeling to leave out the static information within the context. After the background modeling module, we were able to better cope with the instant occlusion of the abnormal vehicles, which managed to make the detection result of these vehicles given by YOLOv5 [7] more robust for multiple scenarios. Then we introduced a novel box-level branch and fused it with a pixel-level branch inspired by [8,9] for the comprehensiveness of vehicle tracking. Besides, the mask construction based on the fusion of motion and tracking trajectory was employed to filter out the parking lots, which do not count as anomalous regions. In our methodology, the filtered multi-granularity tracking result only provides a rough time-localization for the traffic anomaly. With the time and location provided by the aforementioned module, we refined the result with a proposed novel mechanism named Region of Interest (ROI) backtracking, which adopts multi-faceted distance metric for both object-level and pixel-level. Finally, we proposed another novel module, a dual-modality bilateral trajectory tracing branch, which makes a significant contribution to the accurate inference of anomaly time.
The main contributions of this paper are summarized as follows: • A novel fusion methodology of the box-level and pixellevel tracking branch is proposed. Each branch functions as compensation for detecting anomaly events, which is suggested to be efficient and robust. • A novel backtracking methodology that utilizes the object-level detection result to propose an ROI for similarity estimation with three distance metrics is proposed. The extensive testing of ROI backtracking indicates its superiority in accuracy and efficiency • A novel dual-modality bilateral trajectory tracing methodology that utilized the RGB image and sparse optical flow inspired by [10] in opposite directions to mine the spacial-temporal information between frames is proposed. This largely resolved the challenge created by the crashing vehicle.
To our best knowledge, we are the very first to propose the dual-modality bilateral trajectory tracing in the challenge to resolve the challenge brings about by abnormal moving vehicles. Attributing to the aforementioned strengths, our algorithm achieved a result with F1-Score of 0.9302 and an RMSE of 3.4039. The test result proved its effectiveness by outperforming many other teams.

RELATED WORK
Anomaly detection, where many researchers have explicitly studied for years, has experienced a significant methodology change. During the early years, many related research [11,3,12,13,14,15,16,17,18]focused on how to utilize handcrafted features such as Histogram of Optical Gradient (HOG), Histogram of Optical Flow (HOF), Mixture of Dynamic Textures (MDT) [17] that represent both the local and the global pattern of images; then, machine learning methods such as Support Vector Machine (SVM), Markov Random Field (MRF) [19,17], Isolation Forest [20] were implemented to identify the anomaly.
In the broad sense, these machine learning algorithms mainly face the problem of expensive computation and lack of efficiency. Deep learning algorithms, as one of the most prospering research fields, have proved their effectiveness on many downstream tasks such as classification, detection, and segmentation, become widely implemented in anomaly detection. Such methods [1,21,22,23,2,24,25,26,27,28,29] often introduce a deep neuron network to learn a good embedding or representation of the normal and abnormal samples. These work can be essentially categorized into two kinds: unsupervised and weakly-supervised framework. Unsupervised anomaly detection [2, 21,22,23,24] only models the normal samples while using multiple loss as the metric to classify the samples since the prediction loss for the abnormal sample is statistically greater than normal ones. The previous work mainly adopted the Auto-Encoder (AE) and Generative Adeversal Network (GAN) as the learning architecture for frame prediction or reconstruction. However, these unsupervised work all confront a problem of multiple-possibility for future frame prediction, which results in blurred predictions. Also, to produce robust results, the normal samples must be comprehensive; thus, extensive labeling for samples is inevitable. Weakly supervise as another widely-used framework a solution for laborious labeling by using Multiple Instance Learning (MIL) and noised label learning. Other deep learning based work includes methodology including multimodality [28], meta-learning [25] also produced considerable performance but still remain as challenging topics. In conclusion, challenges of laborious labeling and lack of interpretability, generalization is still unresolved. Since many traffic anomalies in Iowa DOT [5] only have subtle intensity change between frames, deep learning method might not be sensitive enough for these anomalies. Therefore, in previous AI City Challenges, hybrid frameworks with deep learning techniques were widely employed by teams. In 2018 AI City Challenge, Xu et al. [10] firstly introduced background modeling into the challenge and proposed dual-mode modeling to identify the static and mobile anomalies. For 2019 AI City Challenge, Bai et al. [8] developed an extra road mask module and proposed the spatial-temporal information matrix to discriminate the anomalies. In 2020 AI City Challenge, Li et al. [9] proposed a multi-granularity tracking module to facilitate static vehicle tracking. In this paper, we proposed a novel dual-modality bilateral trajectory tracing 2 mechanism that utilizes both frame intensity and sparse optical flow to trace the trajectory in forward and backward direction, respectively. This mechanism considerably contributes to the fine-grained localization for anomalies with a relatively small RSME of 3.4039 among all results of past teams.

METHODOLOGY
The proposed two-stage framework is shown in Figure 2 with its main modules. According to the figure, the static analysis stage provides the time and location when a vehicle came to a complete stop. In the dynamic analysis stage, the dual-modality bilateral module will be introduced to retrieve the crashing instant for moving anomalies. In the following sections, we introduce each module in the sequence of processing.

Background modeling
Since both two types of anomalies, including stalled vehicles and crashed vehicles, generally lead to stopped vehicles left on the road after a period of time, the static object analysis in modeling background is widely implemented in anomaly detection. Meanwhile, the fixed perspective in the videos with seldom rotation provides conveniences to model the background in a proper way.
To model the background, we adopted MOG2 [6] based on Gaussian Mixture Model (GMM). According to [9] and our experiments, it was more resilient to scene changes and camera shaking than simple moving average methodology [10]. We followed the empirical parameter T set by [9] where the components of GMM will be updated in the interval of 120 frames at 30 fps. Besides, it is worth mentioning that since the inner property of MOG2, the time when anomalies appear in the background modeling videos is often postponed compared to the actual timestamp. Hence multiple methodologies for start time tracing were proposed and introduced in the following sections.

Detection model
With the development of computer vision, object detection is of ever-growing importance. ITS raises many crucial topics such as speed estimation, vehicle re-identification, and anomaly vehicle detection. To effectively aid ITS, a detection model with high performance is the prerequisite to all aforementioned applications. In general, the detector can be divide into two groups: single-stage and second-stage detector. For a singlestage detector, the head structure of the detector is responsible for prediction of location and classification of the bounding box. Dissimilarly, the classification and prediction task were conducted alternatively. Since our model implements a tracking by detection framework, the selection of the detection model will primarily affect the performance for the later module. Due to the extra vast amount of labeling data required by classification, we determined YOLOv5 [7] to be our detector in terms of a tradeoff between timely-cost-efficiency and performance. YOLOv5, the latest version among the YOLO series, has achieved considerable performance on COCO [30] and other datasets. Also, the Cross-Stage-Partial-Connections (CSP) module proposed to facilitate small object detection in YOLOv4 [31] is suitable since the presence of tiny objects in the dataset.
To identify the vehicles of multi-view and multi-scale, we employed several techniques in training. Firstly, we manually labeled the vehicle class for a fraction of the training set frames. Unlike COCO, we only labeled one class, car, for the anomaly detection as the extensive experiment indicates an increase in mean average precision. Secondly, we adopted the adaptivesized anchor-box, which is deducted through the statistic distribution of all bounding boxes using the K-Means clustering algorithm. Thirdly, a multi-facet data-augmentation technique including shearing, flipping, mosaic transformation, perspective transformation, etc., was employed for generating final training data. Among all, the mosaic data augmentation proposed in Bochkovskiy et al.YOLOv4 [31] increase the mean average precision by providing integration of four different contexts. Finally, we used the weight pre-trained on the COCO dataset as initialization and then finetuned on our dataset. For performance evaluation, the detection model yields a result of 0.90 mAP@0.5 and an 0.87 F1-score at the confidence threshold of 0.457. As a comparison, we trained another detection model based on Faster R-CNN [32] with the same training data; it only achieved 0.80 mAP@0.5. In addition, the inference speed of YOLOv5 reached up to 65 fps without Test-Time-Augmentation (TTA) module, suggesting the superiority in inference efficiency and precision. Figure 2 shows some detection results by YOLOv5.

Road mask construction
Based on the fact that the stationary parking vehicles at the parking lot do not count as anomalies, our algorithm only outputs the static vehicle on/beside the main road as an anomaly to avoid the false alarm. Inspired by [9], we constructed the road mask in terms of both motion and trajectory information. In detail, the mask region was composed of areas where vehicle tracking results are found, and intensity changes were apparent.
Motion-based road mask. We subtracted the consecutive frames and emphasized the areas of difference. Three hyperparameters were set to handle the changes: di f f was used as the subtract result in frame level, the parameter k refers to the interval of implement subtract, T 1 refers to the upper bound of changing to avoid unexpected camera shaking and rotation, T 2 refers to the minimum area of ROI to cope with abnormal local changes. Above all, we accumulated all areas met the conditions to construct the motion-based road mask.
Trajectory-based road mask. To further refine the mask of road, we adopted the DeepSORT [33] as the multi-object tracking algorithm to track all vehicles detected by the former detection module, where region without any tracking results should not be considered as the regular route and, thus, not an anomalous region. For the final fusion, we take the intersection of the masks introduced above to eliminate the false alarms. A for recovery of the original shape of roads, morphological operations including dilation and erosion were implemented as the post-processing module for the mask construction.

Vehicle tracking
After the background modeling and detection module, detection results for every frame are collected, but no anomaly inference was yet made. To ensure the comprehensiveness of the anomaly inference, two branches of the tracking algorithm were developed.
Pixel-level tracking. For tracking at pixel-level, we followed the framework proposed by [8] to analyze anomaly using the spatialtemporal matrix, which represents the dynamic information of stationary vehicles. In this method, spatial-temporal matrices V detected , V undetected , V state , V score , V start and V end are calculated iteratively to identify the suspicious anomaly region. Concretely, if the state of one normality region transferred to a suspicious one, pixel-level tracking would compare the region with bounding boxes that were previously given to determine whether an anomaly had happened.
Box-level tracking. With full adoption to anomaly results provided by the pixel-level tracking branch, we first implement the DeepSORT [33] as the multi-object tracking algorithm on the samples that are predicted as normal ones, which serve as a supplement for anomaly detection. We set multiple criteria to identify the actual anomaly inferences during this phase while suppressing the false positive ones. Specifically, considering the unavoidable loss of tracked id caused by physical environment, we implemented IoU values as criteria to retrieve the original id. Then, we proposed three criteria: interval, frequency, and stability of each id to leave out the authentic anomaly vehicles.

ROI backtracking
Since the presence of static vehicle appearance delay in background modeling frames, the anomaly inference timestamps for both pixel and box level are also delayed. Therefore, an effective module must be developed to refine the start time of the anomaly. Despite the imprecise inference time, the location of the anomaly is invariant. Therefore, we can establish a connection between original and background modeling frames by setting an ROI used to estimate the similarity between the same region at two frames over a time span. A novel backtracking methodology was then proposed with the inspiration of [9].
Specifically, the ROI was set to be the anomaly bounding box location provided by the previous modules. We firstly search all detection results for each frame on original frames to find the ideal objects, while the IoU value between two bounding boxes functions as the object-level metric.
A pixel-level similarity measurement module then processes the pair of boxes that have high IoU values. A single distance metric might not be sufficient for various scenarios due to its unilaterality; hence, three distance metrics are introduced to evaluate the similarity of the intersection region in adjacent frames, including Peak Signal to Noise Ratio (PSNR), Structural Similarity (SSIM), and Euclidean distance. As the fusion of results produced by metrics above, we utilize a voting and weighting mechanism to reach the best performance while alleviating the extreme deviation caused by the discrepancy among these metrics.
For the anomaly frame contains multiple anomaly vehicles, we filtered the pixel-level inference results and left one with the earliest start time. Then we compared it with the box-level results to select the corresponding nearest results for both branches. After the selection of ROI, we implemented the ROI tracking algorithm separately for results given by two branches. After the ROI tracking module, a simple filtering mechanism is employed to combine similar anomalies and eliminate negative results with time and bounding box information to gain the fused fine-grind tracking results.

Dual-modality bilateral trajectory tracing
While much previous work succeeded in inferring the accurate start time for stalled vehicles, few have managed inference the crashing instant for moving vehicles since the widely-used background modeling eliminates most of the motion information. Consequently, the aforementioned modules were not adequate for accurate inference of start time for moving vehicles. Therefore, we proposed a novel dual-modality bilateral trajectory tracing module further to analyze the motion pattern of the moving vehicles and aimed to localize the crashing timestamp. Explicitly, intensity information corresponding to the global pattern and sparse optical flow corresponding to the local pattern were utilized in forward and backward directions, respectively.

Multiple vehicle trajectory tracing
Statistically, vehicle crashes often come up with sharp turns, which is the primary reaction of drivers when encountering such anomalies. Also, the sharp turns of an abnormal vehicle often show transitivity in other vehicles along the road for collision avoidance. Therefore, we determined the anomaly time as the To obtain the dynamic information, we took the time span S , consisting of 26 intervals of 1s as {S 0 , S 1 , ..., S 25 }, which starts 20s earlier than the given timestamp and ends at 6s later. The center points of bounding boxes on the original frames are stacked over time to form the trajectory for each vehicle. Each time node S i corresponds to a set of trajectories for all vehicles in the camera monitoring area, which can be represented as {T ra j i 0 , T ra j i 1 , ..., T ra j i n }. We consider each normal T ra j j i within 1 second, which is a tolerable interval to be straight. On the contrary, the abnormal one forms curving trajectories in a short period. Hence, to estimate the curving degree, we utilize the Least Square algorithm to fit straight lines and calculate estimation error E i j as the curving index. To seek out extreme deviation values in time scale, we set a constant threshold T to calculate abnormal curves in each trajectory T ra j j i where E i j is higher than T add up for each interval denoted as N i . Finally, a time series of abnormal sharp curves can be established by stacking N i over time.
Obviously, distractions exist in some scenarios that blending roads contribute to the normal curves of trajectories which should not be misclassified into abnormal ones. In this situation, time series will have an initial value of N i as in each interval, amount of vehicles pass through the roads, which form platform effect with relatively equal N i value and impair the peak of time series. Thus We adopt hierarchical constraints to avoid this kind of false-positive detection. Besides, road masks are introduced to eliminate unexpected trajectories out of the main road area and to seek off-track trajectories with length and intersection constraints.
From the visualization shown in Figure 3, some crashes can be included and traced accurately to the exact time, align with our sharp turning hypothesis.

Singular vehicle trajectory tracing
Admitting the effectiveness of multiple vehicle trajectory tracing, such object-level algorithm with global pattern analysis will fail in cases such as camera shaking and global similar motion pattern. The former case mainly results in unavoidable unstable or vanished detection, making the constant and steady tracking of same vehicle difficult. The later case mainly fail because of lacking of sufficient contrastive normal samples. Therefore, we proposed another branch of singular trajectory tracing to obtain the local motion pattern captured by sparse optical flow as the compensation for global perspective anomaly time localization. Optical flow, as a classical feature and modality in computer vision, is of great importance for motion analysis. Unlike the object-level trajectory tracing, it remains feasible when experiencing aforementioned cases. To avoid the expensive computational cost led by pixel and its neighborhoodwised tracking, we limited the tracking feature points for each anomaly detected. Concretely, since we had already obtained a refined stopping time and bounding box location given by the ROI backtracking, we used the sparse optical flow tracking algorithm, Lucas-Kanade method, in backward direction. With three assumptions that can be fairly made for optical flow: brightness constancy over time, subtle motion and spatial similarity among neighbourhood, the motion of feature points can be reasonably calculated. For a point with location (x, y) and its displacement(dx, dy) along horizontal and vertical directions at time stamp t can formulate the brightness constancy function as follows: Then take the Taylor expansion of I(x + dx, y + dy, t + dt) at (x, y, t): Finally, the instance motion can be denoted as (u, v) where u = dx dt and v = dy dt . Then we initialized p feature points within the bounding box at stopping frame and track these points backward for 390 frames denoted as a sequence of {F 0 , F 1 , ..., F 390 } where each time stamp corresponds to F i . For p tracking results in F i , including position and tracking status, we denoted them as {Pos i 0 , Pos i 1 , ..., Pos i p } and {S t i 0 , S t i 1 , ..., S t i p }, respectively. For next frame, only the points that are successfully tracked in the previous frame should be updated to p. Supposing each point location to be Pos n , where only points with S t n equal to true is 5 Figure 4: Examples of singular vehicle trajectory tracing where include stalled and crashed ones. In our hypothesis, once crashes happened, the trajectory of abnormal vehicles will curve immediately which representing violent variation in speed. As the results displayed, speed changes and outliers in the time duration are plotted on the right with optical flow trajectories on the left, respectively. further tracked. The points without being tracked in the previous frame are deposed.
To avoid a small fraction of unreliable optical flow tracking, we adopted the outlier filtering methodology proposed by [10] using the K-Nearest Neighbour to exclude the highly deviated points. Then we calculate the average u and v for every points and gives the final velocity magnitude as follows: The velocity was then stacked as a time series for each vehicle. To further reduce the noise in velocity time series, a suppression method was proposed to pick out the top four velocity values selected with the same interval from the top, represented with its indexes as {m 0 max , m 2 max , m 4 max , m 6 max } and the variable length of neighbor L − index, where L is the constant number set before the procedure. If all the neighbors {m i−neighbor , m i−neighbor+1 , ..., , m i−1 , m i+1 , ..., m i+neighbor } are smaller than m i itself, we set m i to 0 to weaken the disturbance of peak noises.
As for the final result, we utilized a moving window estimation module to identify the anomaly. Specifically, we calculated the mean value m for the rolling window. The mean absolute error (MAE) and standard deviation between the values in the rolling window and m were also computed as m_mae and m_std. Then the height of normal interval can be determined as 2(m_mae + scale * m_std) where the centre value is m. All points distributed out of the range are sought. Through further judgment, drastic changes and smooth fluctuations are categorized into anomaly and normalcy. We list out some typical distributions of abnormal velocity points in Figure 4 that extreme pulses such as the topleft curve and bottom-right one are the considered anomalies at the summit, whereas the left two are normal ones with a subtle 6

Track 4 dataset
Iowa DOT [5], the Track 4 dataset in NVIDIA 2021 AI CITY Challenge is partitioned into 100 training videos and 150 testing videos which contains videos with an approximate length of 15 minutes and at a frame rate of 30 fps and a resolution of 800 × 410 as the benchmark for the challenge. Some of them contain anomalies due to stalled or crashed vehicles. The main target of the challenge is to identify and localize anomalies in test videos to return the start time of the anomaly and confidence score.

Implementation details
Detection model. YOLOv5 is implemented as the detector of our model. For the optimizer, we adopted Stochastic Gradient Decent with an initial learning rate of 10 −2 . The K value and number of anchors are both set to be 9. The inference augmentation is also used in the testing video, where the TTA module will enlarge the image size by 30%; thus, the size of the image will be expanded to 832 × 832. The reason for this is to recognize the smaller object better.
Road mask construction. We follow [9] to set motion-based and trajectory-based parameters except for the filtering area, which is set as 6000 in the motion-based branch to eliminate the continuous shaking frames. What is more, we reduce the times of dilation in order to polish a thinner outline.
Pixel-level tracking. The minimum abnormal duration and suspicious abnormal duration are 60 seconds and 40 seconds, respectively. Other parameters are initialized corresponding to [8].
Box-level tracking. For anomaly detection, the minimum abnormal duration is set to be 40s, and the vehicle must appear at least four times out of 5 intervals of 10s. For retrieval of vehicle id, IoU threshold is set to be 0.3. For bounding box stability estimation, the standard deviation of the center point must be below three either for x or y coordinate.
ROI backtracking. The IoU between the selected bounding box and background modeling detection results is set to 0.9. The maximum deviation time is 12. Backtracking thresholds of PSNR, SSIM, Euclidean are set as 13, 0.4, 0.7, and average thresholds are 10, 0.3, 0.65 with 15 seconds max backtracking time.
Multiple vehicle trajectory tracing. The minimum length of trajectory in each interval is 10 points. The threshold of fitting error is 30. The off-track judgment is combined with an area threshold of 40 pixels and a fitting error of 10 at the lowest frequency of 8 times.
Singular vehicle trajectory tracing. The K value for the KNN filter is set to be 6. The density estimation of the clustering points was filtered by a threshold of 6.6. Finally, the scaling factor used to construct the normal interval in moving window estimation is 2.5.

Evaluation and experimental results
Evaluation indexes for algorithm performance consist of F1-S core and NRMS E for Track 4, respectively, representing the identification accuracy and time localization error. Specifically, the Track 4 score will be computed as: where F1 determines the harmonic mean of precision and recall, and NRMS E is the min-max normalization between 0 and 300 frames of time error. RMS E can be computed on difference of time between ground truth and true positive predictions. Briefly speaking, the maximum average prediction error is 300 seconds corresponding to a minimum NRMS E value 0. Specifically, NRMS E can be calculated as: We evaluate our methodology on the Track 4 testing data and obtain relatively high F1-S core at 0.9302 while maintaining low RMS E value at 3.4039, referring average time error in seconds. Finally, according to Equation 4, we gain 0.9197 S 4-S core on the full test set.

CONCLUSION
In this paper, a novel dual-modality two-stage anomalies detection model that analysis both static and motion information for abnormal vehicles was proposed. The static analysis stage infers the time and location of the static anomalies at both pixel and box level; As a supplementary, the dynamic analysis stage, including multiple and singular trajectory tracing branch, was proposed to infer the crashing instant in bilateral direction. In NVIDIA 2021 AI City Challenge, a considerable performance with an F1-Score of 0.9302 and RMSE of 3.4039 was achieved through our proposed framework.