{'fraction_non_alphanumeric': 0.029318201358438656, 'fraction_numerical': 0.01263863812225948, 'mean_word_length': 5.174097664543525, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Sequence Models for Drone vs Bird Classification

Drone detection has become an essential task in object detection as drone costs have decreased and drone technology has improved. It is, however, difficult to detect distant drones when there is weak contrast, long range, and low visibility. In this work, we propose several sequence classification architectures to reduce the detected false-positive ratio of drone tracks. Moreover, we propose a new drone vs. bird sequence classification dataset to train and evaluate the proposed architectures. 3D CNN, LSTM, and Transformer based sequence classification architectures have been trained on the proposed dataset to show the effectiveness of the proposed idea. As experiments show, using sequence information, bird classification and overall F1 scores can be increased by up to 73% and 35%, respectively. Among all sequence classification models, R(2+1)D-based fully convolutional model yields the best transfer learning and fine-tuning results.


Introduction
Initially used for military purposes, drones are now used in a variety of other fields as well, such as traffic and weather monitoring [6], and smart agriculture monitoring [19], just to name a few [17]. In addition, since the COVID-19 pandemic, drones have been increasingly used to deliver groceries and medical supplies autonomously and enforce social segregation. Nowadays, small quadcopters can be easily purchased on the Internet at low prices, which brings unprecedented opportunities but poses several threats regarding safety, privacy, and security [9].
As a result of this recent and rapid interest on the drone utilization, the first Drone vs. Bird Detection Challenge was launched in 2017, in conjunction with the first edition of the International Workshop on Small-Drone Surveillance, Detection and Counteraction Techniques (WOSDETC) 1 [5]. This challenge aimed to address the technical issues of discriminating between drones and birds [5]. In practice, drones can be easily confused with birds, particularly at long distances, which makes the surveillance task even more challenging. The use of video analytics can solve the issue, but effective algorithms are needed, which can operate under unfavorable conditions, such as weak contrast, long-range, low visibility, etc.
Recently, an architecture based on an object detector and a Kalman-based tracker [2] yielded the state-of-the-art results in WOSDETC2021 Drone vs Bird Challenge [4]. This method performs drone detection from a single frame without using the sequence information. An additional score boosting is applied to decrease the effect of false positives; however, it still fails to distinguish distant bird tracks from drone tracks in most scenarios. Because, as seen in Figure  1, birds can easily be confused with drones at certain distances, and sequence information (i.e., wing movements) is crucial to distinguish distant bird images from drones. In order to overcome this issue, in this work, we extend the previous work of [2], with a sequence classification-based post-process stage, and aim at improving our false positive rates. To our knowledge, this work is the first to explore the addition of a video classification model to improve the drone vs. bird differentiation performance of an object detector.
We conduct experiments to explore 3D-CNN, LSTM and  Transformer-based architectures for sequence-based classification. Moreover, we propose a new drone vs. bird video classification dataset to train and evaluate the proposed architectures.

Related Work
Video classification task has gained a significant success in the recent years. Specifically, the topic has gained more attention after the emergence of deep learning models as a successful tool for video classification. The reader may refer to [15] for more information on the state-of-the-art on video classification literature.
Convolutional neural network based video classification methods can be analysed in 2 main categories: fully convolutional architectures and time-distributed 2D convolutional network based architectures.
As one of the fully convolutional video classifiers, R(2+1)D [20] proposes a ResNet [8] inspired architecture with efficient alternative to 3D convolutions. Similarly, SlowFast [7] proposes a fully convolutional two stream model that extracts features from undersampled/upsampled versions of the input stream. Since these types of models are able to extract spatio-temporal features with a fully convolutional network, they are easy to implement and deploy. Thus, we have utilized R(2+1)D based architecture in our work.
Another alternative for video classification is to extract frame-based features from a CNN based backbone and feed to LSTM [21]. Alternatively, LSTM can be replaced with Transformer encoder layer having multi-head self attention to extract temporal features [1]. These type of architectures can benefit from any pretrained image classification model. Thus, we explored the effect of these type of sequence models in our experiments.

Proposed Work
The proposed technique is based on our previous work in [2] which utilizes a YOLOv5 [11] detector and a Kalmanbased object tracker. Main focus of this work is to explore the effect of an additional video classification stage on top of tracker to improve the detection accuracy and false positives rates. Overall structure of the proposed technique can be seen in Figure 2.

Video Classification Model
As for the video classification stage, two types of architectures are utilized. First type includes the architectures consisting of fully convolutional backbones R(2+1)D [20] while the second type contains Resnet18 [8] backbone combined with additional temporal feature extraction/fusion neck (LSTM/Transformer/MLP). Overall diagrams for Type 1 and Type 2 sequence classification models can be seen in Figure 2.

Dataset
To fine-tune and evaluate the proposed sequence classification modalities, a new drone vs bird video classification dataset (DvsB-Vid) has been formed from Drone vs Bird Detection Challenge [4] dataset which consists of a pool of 77 different video sequences containing drones, birds, planes on various backgrounds.
To create DvsB-Vid, we first applied the detection and tracking pipeline proposed in [2] disregarding any trackbased post-processing. Since the pipeline is trained without any negative labels, the resulting tracks contain many false positives containing bird, plane, and cloud objects. These track bounding boxes have been cropped and exported as video sequences and each sequence has been annotated as a drone or bird (disregarding other labels). While exporting a single track bounding boxes as frame sequences, after ten consecutive Kalman based tracker prediction that is not detected by the detector, a new frame sequence is started. Since all bounding boxes in a track sequence are not at a fixed size, all boxes in a track are resized to match the size of largest bounding box in the corresponding track. Dataset splits are the same as provided in [10] for the original Drone vs. Bird Challenge dataset. There are 153 and 60 drone tracks/sequences are present in the training and validation split, respectively. Similarly, 92 and 20 bird tracks/sequences present in the training and validation split, respectively. In total, there are 48871 and 15526 frames in training and validation split, respectively. Sample bird and drone sequence visuals are taken from the proposed dataset can be seen if Figures 3 and 4, respectively.

Results
Comprehensive experiments have been performed to compare different architectures on the proposed DvsB-Vid dataset having drone and bird sequences. Sample bird and drone sequence visuals are taken from the proposed dataset can be seen in Figures 3 and 4, respectively. In all experiments, frames are resized so that the short side is 224 pixels, and the same dataset is used in both video and image classification experiments (by only changing the data sampling collation pipelines). For type 1 and type 2 sequence classification model experiments batch size is selected as 8 and 16, respectively. Moreover, batch size of 128 is used for image classification experiments.
After hyperparameter-tuning, optimizer is chosen as AdamW [12] for image classification, LSTM and R(2+1)D based models and as SGD [18] for MLP/Transformer based sequence classification models. In all experiments learning rate of 0.0001 and loss function of focal loss resulted in most stable results. Moreover, all experiments lasted 12 epochs with 1 full warm-up epoch and learning rate is decayed by 0.1 at 8th epoch.
All of the mentioned architectures are implemented using Pytorch framework [14], pretrained weights are acquired from TorchVision framework [13].
Two scenarios are considered in experiments for all proposed modalities: transfer learning and fine-tuning. In transfer learning scenario, all backbone layers are frozen and remaining parameters (neck and head) are learned from scratch. In fine-tuning scenario, most of the backbone parameters are unfrozen and updated during training.
Category-based, overall (macro) F1 scores and the number of parameters for proposed modalities are given in Table 1. Single image based classifier contains the least number of total parameters and yields the best drone classification score and the worst bird classification score for the transfer learning scenario. Sequence-based models yield better macro F1 in all cases except MLP neck based finetuning. LSTM based neck yields better performance com- pared to MLP which shows the importance of the sequential information extraction capability of RNN based layer. Transformer-based neck yields worse results than LSTM. This may be due to multi-head self-attention increasing the complexity significantly while training data is not that large. On a larger dataset, Transformer based head might yield better results. R(2+1)D based fully convolutional sequence model yields the best drone, bird and macro F1 scores in the fine-tuning scenario and the best bird and macro F1 scores in the transfer learning scenario. This is impressive considering in the transfer learning scenario, R(2+1)D based sequence model has only 1K trainable parameters. This can be explained with R(2+1)D having more pretrained parameters than other architectures.
Validation set confusion matrices for some of the modalities in fine-tuning scenario can be seen in Figure 5. Poor bird classification result can be seen for image classification model while R(2+1)D based model provides very promising results.

Conclusion
In this work, the effect of a drone vs. bird classifier based post processing has been explored to decrease the number of false positives predicted by a drone detection and tracking architecture. LSTM/Transformer/MLP based temporal fusion necks are added on top of 2D and 3D image/video feature extractors to create sequence classification models. These sequence classifiers have been compared with single frame based image classifier on the newly proposed DvsB-Vid dataset. As experiments show, using sequence information, bird classification and overall scores can be increased by up to 73% and 35%, respectively. Among all sequence classification models, R(2+1)D based fully convolutional model yields the best transfer learning and fine-tuning results.
Recent image and video-based vision transformers can be utilized in future work to achieve better sequence classification results. Moreover, the sequence classification dataset can be enlarged by the addition of other noise labels which are not drone or bird.