Unmanned aerial vehicle identification and tracking system
By using the YOLOv12 deep learning algorithm and EMA attention mechanism, combined with high-definition cameras and high-performance servers, a drone identification and tracking system was built, which solved the problem of drone identification along railway lines, achieved efficient and accurate drone target detection and tracking, and improved railway safety and system stability.
Patent Information
- Application Number
- CN202511191875.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-25
- Publication Date
- 2025-11-18
AI Technical Summary
The illegal flight of drones along railway lines threatens the safety of railway operations, and existing technologies are insufficient to efficiently and accurately identify and track drone targets in complex environments.
A drone identification and tracking system is constructed by using the YOLOv12 deep learning algorithm combined with the EMA attention mechanism and residual high-efficiency layer aggregation network. Data is collected through a high-definition camera network, and a high-performance server performs real-time target analysis and provides multi-dimensional functional support.
It achieves accurate identification and real-time tracking of drone targets, improves the identification rate, reduces the false alarm rate, ensures railway safety, and has self-healing capabilities and efficient data management functions.
Smart Images

Figure CN120973009A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of unmanned aerial vehicle identification, in particular to an unmanned aerial vehicle identification and tracking system. BACKGROUND
[0002] In recent years, with the popularization and application of small aircraft, railway transportation safety is facing new challenges. The illegal flight of "low, slow and small" aircraft represented by unmanned aerial vehicles in the area along the railway has become an important hidden danger threatening the safety of railway operation. Such aircraft have the characteristics of small size and strong maneuverability, and are more likely to lose control in complex railway environments, which may cause serious consequences.
[0003] The environment along the railway has its particularity: on the one hand, the dense distribution of electrified equipment puts higher requirements on flight safety; on the other hand, the open line area is often accompanied by strong wind speed changes and electromagnetic interference, which significantly increases the difficulty and risk coefficient of unmanned aerial vehicle control. Once an accident such as loss of control and crash occurs, not only the railway facilities may be damaged, but also the train operation safety may be endangered, causing irreparable losses.
[0004] In view of this safety hidden danger, the present application proposes an advanced computer vision identification technology solution. Through the optimized and improved YOLOv12 deep learning algorithm, accurate detection and real-time tracking of unmanned aerial vehicles along the railway are realized. This technical solution can effectively improve the recognition rate of unmanned aerial vehicles and other targets, and provide reliable technical support for railway safety protection. SUMMARY
[0005] To solve the problems of the prior art, the present application provides an unmanned aerial vehicle identification and tracking system.
[0006] In order to achieve the above purpose, the present application adopts the following technical scheme:
[0007] An unmanned aerial vehicle identification and tracking system, the data acquisition layer relies on a network of high-definition cameras deployed in key areas to obtain high-precision visual monitoring data all day long, providing global dynamic sensing capability for the system;
[0008] The processing and analysis layer, as the core hub, runs on a high-performance server cluster, and through the integration of a YOLOv12 deep learning visual detection module, it performs millisecond-level target analysis on real-time video streams, accurately identifies unmanned aerial vehicle features and marks them;
[0009] The application service layer provides multi-dimensional functional support, including dynamic target tracking display of the visual detection interface, flight trajectory analysis based on space-time dimensions, and construction of a local database to realize safe storage of massive data.
[0010] The region attention module used in YOLOv12 works as follows:
[0011] (1) Feature partitioning: The input feature map (H x W) is simply divided into l regions, each with a size of H / l x W or H x W / l;
[0012] (2) Intra-region attention computation: Attention is computed separately within each region, with the formula: where Q, K, and V are the query, key, and value matrices, respectively, and d is the feature dimension;
[0013] (3) Position awareness: The attention output is enhanced by a large separable convolution (7 x 7).
[0014] 3. The unmanned aerial vehicle identification tracking system according to claim 2, wherein a residual efficient layer aggregation network is adopted, a block-level residual design is introduced, a residual connection is established between input and output, and a default scaling factor 0.01 is used to control the residual strength, and a bottleneck structure design is adopted.
[0015] The unmanned aerial vehicle identification tracking system, the core detection module is used for processing image or video target detection algorithm and inference process encapsulation;
[0016] The video stream processing module realizes the functions of real-time video stream acquisition, processing and display by using multi-thread technology;
[0017] The history record management module is responsible for the storage, retrieval and management of detection results, and the database is used to realize the persistent data management tool function module which encapsulates general auxiliary methods and improves the code reuse rate;
[0018] The main application module is modularly integrated, and the user interface interaction and system function scheduling are handled in an all-round way, and finally a hierarchical and maintainable architecture system is formed.
[0019] The unmanned aerial vehicle identification tracking system, at the code implementation level, embeds a try-except exception capture structure for all key functions, effectively prevents system crashes caused by single-point faults through local error interception, and saves the execution context when an exception occurs; The granularity of exception capture gradually progresses from the function layer, the module layer to the process layer, ensuring that errors of different ranges can be properly isolated and processed, avoiding error propagation.
[0020] The unmanned aerial vehicle identification tracking system, the system is equipped with a standardized error handling hub print_error function, which centrally performs formatted output of exception information, log recording and error level determination, ensuring the standardization and traceability of exception handling; This function not only records the exception type, location, and call stack technical information, but also associates business impact assessment according to the preset error type mapping table, making it easy for operation and maintenance personnel to quickly judge the severity of the problem and the priority processing order.
[0021] The unmanned aerial vehicle identification tracking system is designed for end users, and an abnormal information translation layer is designed to convert bottom layer technology abnormalities into natural language prompts for friendly interaction through a visual interface; the system dynamically adjusts the technical detail display depth of error information according to different user roles, and provides complete diagnostic information for administrators, and only displays necessary guidance and solution suggestions for ordinary users.
[0022] The unmanned aerial vehicle identification tracking system establishes an abnormal self-healing mechanism, and automatically triggers a recovery strategy when a major failure is detected.
[0023] The unmanned aerial vehicle identification tracking system predicts potential risk points and actively adjusts system parameters by analyzing historical abnormal data, such as automatically increasing the timeout threshold or retry count of high-risk operations, and upgrades passive defense to active prevention.
[0024] The unmanned aerial vehicle identification tracking system ensures tracking and referencing of detection results by generating a unique session ID for each detection; saves detection parameters, timestamps and environment information to ensure reproducibility of results; automatically saves original input and detection results to support user viewing and comparison later; establishes an efficient search index to achieve fast search and browsing; and provides batch management functions to facilitate user viewing, loading and deleting of historical records.
[0025] Compared with the prior art, the beneficial effects of the application are: in view of the small and variable characteristics of the unmanned aerial vehicle target, the network structure of the YOLOv12 model is deeply optimized, the EMA attention mechanism is introduced, and the accuracy and speed of the tracking algorithm are improved; the system development history record and automatic error repair module are developed, the system performance is continuously optimized, and the system practicality and robustness are further improved. BRIEF DESCRIPTION OF DRAWINGS
[0026] Other features, objects and advantages of the application will become more apparent after reading the detailed description of non-limiting embodiments with reference to the following drawings.
[0027] Figure 1 is the area attention mechanism diagram of the application.
[0028] Figure 2 is the unmanned aerial vehicle identification performance index diagram of the application.
[0029] Figure 3 is the system resource occupation optimization situation diagram of the application.
[0030] Figure 4 is the training process curve diagram of the application.
[0031] Figure 5The confusion matrix analysis diagram of the unmanned aerial vehicle is the application.
[0032] Figure 6 The target size and detection performance analysis diagram of the unmanned aerial vehicle is the application.
[0033] Figure 7 The comprehensive evaluation diagram of the unmanned aerial vehicle detection performance of YOLOv12n is the application.
[0034] Figure 8 The system architecture optimization-modular design diagram is the application.
[0035] Figure 9 The comprehensive error handling mode diagram is the application.
[0036] Figure 10 The complete history record management system diagram is the application.
[0037] Figure 11 The user interface schematic diagram is the application.
[0038] Figure 12 The GUI code diagram is the application.
[0039] Figure 13 The local computer device configuration diagram is the application.
[0040] Figure 14 The terminal deployment program code diagram is the application.
[0041] Figure 15 The model loading diagram is the application.
[0042] Figure 16 The network gallery multi-target detection and recognition effect diagram is the application.
[0043] Figure 17 The selfie picture recognition result diagram is the application.
[0044] Figure 18 The selfie long-distance, low-resolution, and blurred image recognition result diagram is the application.
[0045] Figure 19 The video recording recognition result diagram is the application.
[0046] Figure 20 The camera real-time target tracking result diagram is the application.
[0047] Figure 21 The technical flowchart is the application.
[0048] Figure 22 The EMA attention mechanism structure diagram is the application. DETAILED DESCRIPTION
[0049] The application will be further described in detail by the following examples, which are only used to illustrate the application and do not limit the scope of the application.
[0050] An unmanned aerial vehicle identification and tracking system, the method involves an unmanned aerial vehicle identification and tracking system composed of three modules of data acquisition layer, processing and analysis layer and application service layer. The data acquisition layer relies on the deployment of high-definition camera network in key areas, and obtains high-precision visual monitoring data all-weather, providing global dynamic sensing capability for the system; the processing and analysis layer as the core hub runs in high-performance server cluster, through the integration of YOLOv12 deep learning visual detection module, millisecond-level target analysis is carried out on real-time video stream, and the characteristics of unmanned aerial vehicle are accurately identified and marked; the application service layer provides multi-dimensional function support, including dynamic target tracking display of visual detection interface, flight trajectory analysis based on space-time dimension, and construction of local database to realize safe storage of massive data such as detection log and image evidence, effectively improving the detection capability in low-altitude security field.
[0051] Inspired by adapter tuning, users can customize learnable adapters to inject cross-domain information into visual encoders. Specifically, to enrich the extracted features to have high domain generalization ability, an ideal adapter should meet the following two conditions. First, it can model the commonality between source and target domains, i.e., domain-invariant knowledge. Second, it can adaptively provide unique attributes for each domain, i.e., domain-specific knowledge.
[0052] Improved YOLOv12 model:
[0053] The introduction of EMA (Efficient Multi-Scale Attention) attention mechanism is a new feature enhancement method, which focuses on solving the common problems in traditional attention mechanisms.
[0054] Traditional attention mechanisms usually model cross-channel relationships through channel dimension reduction, which may cause information loss in deep visual representation extraction. EMA attention mechanism solves this problem through innovative design while maintaining computational efficiency.
[0055] Design principle of EMA attention mechanism
[0056] The core idea of EMA attention mechanism is to reduce computational overhead while preserving information in each channel. Unlike common channel attention mechanisms (such as SE, CBAM, etc.), EMA adopts the following innovative strategies:
[0057] (1) Feature grouping processing: EMA attention mechanism groups the channel dimension of input feature maps into multiple sub-features, allowing spatial semantic features to be well distributed within each feature group. This grouping strategy allows different semantic features to be expressed and processed more accurately.
[0058] (2) Parallel sub-network structure: EMA attention mechanism designs two parallel processing paths, one using a 1x1 convolution kernel to process features, similar to the coordinate attention (CA) mechanism, and the other using a 3x3 convolution kernel to capture larger spatial information. This parallel structure can establish short-range dependency relationships and capture long-range feature associations.
[0059] (3) Cross-space learning: The most significant innovation of EMA attention mechanism is the introduction of cross-space learning method, which integrates the output features of the two parallel branches through matrix multiplication operation, effectively capturing pixel-level pairwise relationships and highlighting global context. This design allows it to focus on both local and global features, improving model performance without significantly increasing computational burden.
[0060] Advantages of EMA attention
[0061] Compared with traditional attention mechanisms, EMA attention mechanism has many obvious advantages: it does not perform channel dimension reduction, fully preserves feature information, effectively avoids information loss, and through parallel sub-network and cross-space learning, EMA can well integrate information of different scales, enhancing the discriminability of feature representation. It not only provides strong feature representation ability, but also has relatively light computational burden, suitable for real-time applications. Most importantly, EMA attention mechanism is very flexible and can be easily integrated into various CNN architectures without significantly modifying the original network structure.
[0062] Experiments have shown that EMA outperforms existing attention mechanisms not only in accuracy but also in parameter efficiency on multiple computer vision benchmark tests such as CIFAR-100, ImageNet-1k, MS COCO, and VisDrone2019. For example, integrating EMA into ResNet50 on the CIFAR-100 dataset can achieve a 3.43% Top-1 accuracy improvement with only a small increase in parameter quantity.
[0063] YOLOv12 combined with EMA attention mechanism:
[0064] The core innovation of this research is to deeply integrate EMA attention mechanism with YOLOv12 to create a more efficient and accurate target detection system, fully utilizing the advantages of both and addressing their respective limitations.
[0065] YOLOv12 adopts the region attention mechanism to process spatial information, which has been proven to be effective in object detection. EMA has innovative designs in both channel and spatial dimensions. YOLOv12 reduces the computational cost while maintaining a large receptive field by dividing the feature map into several regions; EMA optimizes multi-dimensional feature representation through feature grouping and cross-space learning. This combination allows the R-ELAN structure of YOLOv12 to provide a stable optimization path for EMA, while the cross-dimensional learning of EMA enhances the perception of object boundaries in YOLOv12. The two complement each other and have a significant effect.
[0066] To achieve the deep integration of EMA attention mechanism and YOLOv12, this project adopts three key strategies.
[0067] (1) Introduce EMA modules to replace some of the original attention units in the third and fourth stages of the YOLOv12 backbone network, while retaining the original structure of the first two stages.
[0068] (2) Fine-tune the parameters of the integrated model, including setting the EMA grouping number to 32, modifying the cross-space learning part to work with the region attention module, adjusting the convolution kernel size and scaling factor.
[0069] (3) Embed the EMA module into the R-ELAN structure to work with the residual connection.
[0070] This integration scheme not only takes full advantage of the real-time performance of YOLOv12 but also utilizes the powerful feature representation capability of EMA, achieving the complementary advantages of both technologies. By retaining the hierarchical design of YOLOv12 and introducing the channel dimension optimization and cross-space learning of EMA, the integrated model of this project can effectively extract features at different scales while maintaining network training stability and inference efficiency, thereby improving the overall performance of object detection.
[0071] Attention mechanism is the core innovation of YOLOv12 and a key technology for achieving high-precision UAV detection on this platform. In traditional computer vision tasks, convolutional neural networks (CNN) process images through local receptive fields, making it difficult to capture long-range dependencies. Attention mechanism calculates the weight relationships between different positions on the feature map, allowing the network to "focus" on important regions of the image, greatly improving the detection ability of small targets such as distant UAVs.
[0072] The working method of the area attention module used in YOLOv12 is as follows:
[0073] (1) Feature partition: The input feature map (HxW) is simply divided into l regions (default l=4), and each region has a size of H / lxW or HxW / l.
[0074] (2) Intra-region attention calculation: Attention is calculated separately in each region, and the calculation formula is: where Q, K, and V are query, key, and value matrices, respectively, and d is the feature dimension.
[0075] (3) Position awareness: The attention output is enhanced by a large separable convolution (7x7) to help the network understand spatial position information.
[0076] Compared with traditional window attention, cross attention, and other methods, regional attention is simple and efficient, does not require complex window division and position encoding, and maintains a large receptive field, as shown in Figure 1 .
[0077] The platform uses a residual efficient layer aggregation network (R-ELAN) to solve the gradient problem of attention mechanisms during training through innovative feature aggregation design and residual connection. R-ELAN introduces a block-level residual design to establish a residual connection between input and output, and uses a default scaling factor of 0.01 to control the strength of the residual to ensure smooth gradient flow; optimizes the feature aggregation method, uses a bottleneck structure design to maintain feature integration capability while reducing computational cost and parameter quantity; at the same time, simplifies the hierarchical structure and reduces the stacking depth of the backbone network in the later stage, thereby optimizing the convergence. Through these technologies, the platform can still maintain a high detection rate for small unmanned aerial vehicles even in complex background and adverse weather conditions, providing reliable protection for airspace safety.
[0078] Unmanned aerial vehicle recognition and tracking hardware based on x86 computer
[0079] The scheme is tested on a Linux platform, and the PyTorch framework and YOLOv12 model are used for unmanned aerial vehicle detection. The experimental environment configuration is shown in Table 1:
[0080] Table 1 Experimental computer environment configuration
[0081]
[0082] The software environment is based on the Ubuntu 20.04LTS operating system, relies on the efficient resource management and stability of the Linux kernel, adapts Python 3.11.9 as the main development language, maximizes the parallel computing capability of the NVIDIA RTX 4090 graphics card through the deep integration of PyTorch 2.4.1 and CUDA 12.6, realizes model inference acceleration optimization combined with TensorRT 8.6.1, provides cross-platform computer vision processing support with OpenCV 4.8.0, and builds a lightweight Web interactive interface with Gradio 4.26. The whole environment realizes the AI development full-process closed loop in the containerization or native deployment mode, taking into account the development efficiency and production-level performance, and needs to ensure the strict compatibility verification of the NVIDIA driver, CUDA tool chain and system kernel version.
[0083] Data set acquisition and model training
[0084] The visual detection technology is based on machine learning methods, which need a sufficient amount of labeled data for training. A data set refers to a sample collection pre-collected and labeled for a specific task. In the model training process, the system learns features from the data and establishes a recognition model. The more training data and the richer the types, the higher the recognition accuracy of the model, and the stronger the recognition ability of different types of unmanned aerial vehicles. In addition, the data set is also used to test the trained model and evaluate its actual performance. The data set is shown in Figure 9
[0085] The data set construction process covers multi-source data integration and standardization processing: first, integrate public unmanned aerial vehicle data sets and self-built collected data, covering multiple lighting conditions, weather environments and complex background scenes, to ensure data diversity; in the preprocessing stage, the image size is unified to 640x640 pixels, the sample is expanded through horizontal flip, rotation, color adjustment and other enhancement operations, and the COCO format is used to label the unmanned aerial vehicle position and category information, while balancing the distribution ratio of different unmanned aerial vehicle types and background scenes. Finally, the training set, validation set and test set are divided according to the ratio of 8:1:1, and the data use is strictly isolated to ensure the objectivity of model evaluation, laying a high-quality data foundation for subsequent algorithm training and generalization ability verification.
[0086] By selecting the lightweight YOLOv12-N model, combining depth separable convolution and channel reduction technology (parameter quantity 4.2M), adapting to the real-time inference requirements of low-end devices such as Jetson Xavier; load COCO pre-training weight and use knowledge distillation technology for transfer learning, through the strategy of freezing the first 10 layers of the backbone network and fine-tuning the detection head, realize fast convergence on UAV dataset. According to the target characteristics of UAV, optimize the anchor box size (9 groups of clustering), configure the dynamic learning rate (cosine annealing scheduler, initial lr=0.001) and improve the loss function (CIoU Loss combined with Focal Loss), and finally complete the training.
[0087] Model testing and verification:
[0088] The YOLOv12n UAV recognition and tracking system developed in this scheme optimizes the model parameter quantity to 5.6M through depth separable convolution and channel reduction technology, which is 15% less than the traditional YOLOv8n. At the same time, combined with knowledge distillation transfer learning, customized anchor box design and improved loss function, it realizes excellent improvement in performance indicators. The specific data is as follows:
[0089] As shown in Figure 2 , the mAP@0.5 of this project is 93.2%, the mAP@0.5:0.95 is 87.6%, the precision is 94.8%, and the recall is 91.5%.
[0090] This project has made a significant breakthrough in system resource occupation. GPU memory consumption is only 3.8GB (40% less than the baseline), CPU occupancy rate is reduced to 28.3%, as shown in Figure 3 .
[0091] After 300 rounds of training, the system has made a significant breakthrough in training, and the training process is as shown in Figure 4 .
[0092] In the process of analyzing the confusion matrix of UAV, the UAV detection accuracy is high and the false positive rate is low, with only 0.4% of false negatives. The analysis process is as shown in Figure 5 .
[0093] The target size distribution and performance test also have excellent performance, as shown in Figure 6 .
[0094] Through depth separable convolution and channel reduction technology, the model parameter quantity is optimized to 5.6M, which is 15% less than the traditional YOLOv8n. At the same time, combined with knowledge distillation transfer learning, customized anchor box design and improved loss function, it realizes excellent improvement in performance indicators, as shown in Figure 7 . Table 2 below is the comparison of YOLO series with the same size data:
[0095] Table 2
[0096]
[0097] Front-end code, system architecture optimization: The front-end code of the target detection system based on YOLOv12 is comprehensively optimized and improved, making it more suitable for real-time unmanned aerial vehicle recognition on Linux platform, while providing solutions for the widely used Windows platform. The original code only provides basic detection functions, and there are problems such as loose system architecture, insufficient error handling, and poor user experience. The optimization of this scheme focuses on solving these problems, greatly improving the stability, reliability and practicality of the system.
[0098] This scheme comprehensively restructures the front-end code based on the principle of modular design, and divides the system functions into five high-cohesion module systems according to their responsibilities. The core detection module (detector.py) focuses on processing image / video target detection algorithm and inference process encapsulation. The video stream processing module (video_stream.py) uses multi-threading technology to realize real-time video stream acquisition, processing and display functions. The history record management module (history_manager.py) is responsible for the storage, retrieval and management of detection results, and realizes persistent data management tool functions through a database. The utility module (utils.py) centrally encapsulates general auxiliary methods, effectively improving code reuse. The main application module (main.py) integrates modules, coordinates user interface interaction and system function scheduling, and finally forms a well-structured and maintainable architecture system. As follows Figure 8 .
[0099] This hierarchical design makes the interfaces between modules clear and the responsibilities single, greatly improving the maintainability and extensibility of the code. When developing new functions or fixing problems, only the specific module needs to be concerned, without affecting the overall system stability.
[0100] Error handling mechanism covers all aspects:
[0101] This scheme project builds a multi-layer defense type error handling system, significantly improves the robustness and user experience of the system, and forms a complete protection closed loop through four key levels.
[0102] At the code implementation level, try-except exception capture structures are embedded for all key functions, effectively preventing system crashes caused by single-point faults through local error interception, and saving the execution context when an exception occurs, facilitating subsequent analysis and repair; the exception capture granularity progresses from function layer, module layer to process layer, ensuring that errors of different ranges can be properly isolated and handled, avoiding error propagation.
[0103] The system is equipped with a standardized error handling hub, print_error function, which centralizes the formatting output of exception information, logging, and error level determination, ensuring the standardization and traceability of exception handling. This function not only records technical information such as exception type, location, and call stack, but also associates business impact assessment based on a pre-set error type mapping table, facilitating the quick judgment of problem severity and priority processing order for operation and maintenance personnel.
[0104] For end users, an exception information translation layer is designed to convert underlying technical exceptions (such as database connection timeout, video stream decoding error, etc.) into natural language prompts for friendly interaction through a visual interface. The system dynamically adjusts the depth of technical details displayed in error information according to different user roles, providing complete diagnostic information for administrators, while only showing necessary guidance and solution suggestions for ordinary users, improving user experience while avoiding sensitive information leakage.
[0105] More importantly, an exception self-healing mechanism is established to automatically trigger recovery strategies such as index reconstruction and standby stream switching when major faults such as history record index corruption and video stream interruption are detected, maximizing the continuous availability of core functions and forming a full-link reliability protection solution covering "exception prevention - intelligent processing - user communication - system recovery".
[0106] The self-healing system also implements fault mode learning capabilities, predicting potential risk points and actively adjusting system parameters by analyzing historical exception data, such as automatically increasing the timeout threshold or retry count for high-risk operations, upgrading passive defense to proactive prevention.
[0107] Through this mechanism, the system not only maintains stable operation under various abnormal conditions, but also provides clear fault location and recovery paths, significantly reducing operation and maintenance costs and improving system reliability indicators, so that end users can obtain a smooth user experience and clear problem solving guidance even in the face of technical failures, as shown in Figure 8 .
[0108] History record function enhancement:
[0109] As shown in Figure 10 , this scheme has a comprehensive history record management function, which generates a unique session ID for each detection to ensure traceability and reference of detection results; saves detection parameters, timestamps, and environment information completely to ensure reproducibility; automatically saves original input and detection results to support user review and comparison later; establishes an efficient search index to achieve fast search and browsing; and provides batch management functions to facilitate user viewing, loading, and deleting of history records. This significantly improves the practicality of the system, especially for scenarios that require long-term tracking, monitoring, and analysis of detection results.
[0110] Making of graphical user interface (GUI)
[0111] Gradio, as a mature Python WEBUI development toolkit, plays an important role in this scheme. Based on Gradio, a simple and intuitive operation interface is constructed, making the whole system more user-friendly and efficient. This toolkit perfectly combines the powerful features of browser HTML applications with the flexibility of Python language, providing rich interface components and convenient event handling mechanisms. In specific implementation, attention is paid to user experience optimization, and through reasonable layout design and smooth interaction logic, the operator can quickly get started. At the same time, the interface adopts modular design idea, which not only facilitates the use and switching of current functions, but also reserves space for subsequent system expansion. Such design not only meets the professional needs of unmanned aerial vehicle monitoring, identification and tracking, but also ensures the convenience of operation. Figure 11 The user interface is shown. After the program runs, access 127.0.0.1:7860 to enter the system.
[0112] System function and terminal application test
[0113] Experimental equipment: This experiment uses terminal equipment such as Figure 13 As shown, the CPU of the local notebook computer is Intel Core i5-11400H, supporting PCIe 4.0 high-speed expansion bus; the GPU is NVIDIA GeForce RTX3060Laptop GPU (6GB video memory); the installed running memory (RAM) is 32GB. The program code adapted to terminal deployment is as shown in Figure 14
[0114] Research results display and analysis:
[0115] This scheme supports real-time detection, video detection and image detection, as well as historical record system.
[0116] Object detection interface, including image detection and video detection, supporting opening camera recording and local file selection, picture selection supporting file paste.
[0117] Picture size, confidence and device (cpu or gpu) can be selected. After clicking object detection, the results will be displayed on the right side, and the status information will be displayed. This is a direct observation of system information, which is convenient for debugging.
[0118] First, import the project into PyCharm, run the main.py file and wait for loading, until the command line prompt "Running on local URL: http: / / 127.0.0.1:7860", that is, the startup is successful. Click "drone recognition tracking", the system automatically loads the model and initializes the initial interface can be directly imported, pasted picture recognition or video tracking, such as Figure 15
[0119] During the test, multiple sources containing pictures of drones were selected for testing. The border in the figure represents the location and size of the detected small aircraft. The recognition results in different situations are shown in Figures 16 to 18
[0120] In the interface, select the video input type to upload video recordings for recognition. Figure 19 Video recording recognition results.
[0121] Switch the tab to "real-time detection" to call the local camera hardware for real-time tracking. The results are shown in Figure 20
[0122] This experiment uses the YOLO v12 algorithm and improved high-efficiency multi-scale attention mechanism to optimize the detection accuracy of drones, and demonstrates the system's recognition and tracking functions for drones in pictures, videos and real-time videos. Through actual testing, the system and model of this technology perform well in precision indicators and have good application potential.
[0123] This scheme is based on Python language and YOLOv12 algorithm, and studies an efficient, scalable and easy-to-deploy drone recognition and tracking system. Experimental data show that the drone recognition system proposed in this paper performs well in detection accuracy and real-time performance, with a detection accuracy of 95.6%, a single picture processing time of 1 second per picture, a video detection performance of 40-80 FPS (depending on the specific model and video parameters) under GPU processing, and 10 FPS under CPU processing. Real-time detection performance under GPU processing is 40-60 FPS, and under CPU processing is 30 FPS. The system still maintains stable performance in complex environments and can effectively complete the monitoring task of drones and support rapid response and disposal.
[0124] This scheme:
[0125] (1) Based on the YOLOv12 model, the neural network structure is optimized for the characteristics of drones. By introducing an attention mechanism (EMA) that better fits the distribution characteristics of drones, the detection speed and accuracy of the model in complex environments are improved.
[0126] (2) Innovatively fuses the EMA attention mechanism with the regional attention module of YOLOv12, and through the global context enhancement module and dynamic MLP proportion adjustment, significantly improves the perception ability of micro targets while maintaining the recognition performance, and accurately identifies drones in complex visual interference conditions (such as bird swarm interference, helicopters, and civil passenger planes).
[0127] (3) Process, self-shoot collect, and download drone datasets from the Internet to train the model. Machine learning relies on large-scale datasets as a foundation. In the training process of the model, the size and diversity of the dataset directly affect the accuracy of the model.
[0128] (4) Optimize the overall performance of the system, introduce hardware acceleration, adapt to low-performance hardware systems, reduce costs, or achieve higher performance on high-configuration computing platforms.
[0129] (5) Develop a graphical user interface (GUI) to display the drone recognition results in an intuitive way, while significantly reducing the difficulty of human-computer interaction. The design of the GUI should adhere to the principles of simplicity and efficiency, and needs to present real-time video images and directly display the number and location of drones in the image, helping users quickly and accurately grasp the airspace situation. For the functional modules in the use process, introduce multi-tab, history record query and management functions to meet the use scenarios such as "work traces", and realize the demand-oriented adaptation and flexible deployment of the system.
[0130] The core idea of realizing the system is to use visual recognition to identify and mark the tracked flying targets. This can greatly reduce the workload of manual work, while achieving high safety, low cost, and high efficiency. The overall process is shown in Figure 1 .
[0131] Although the specific embodiments of the present application are described above, those skilled in the art should understand that this is only an example, and the protection scope of the present application is defined by the appended claims. Those skilled in the art can make various changes or modifications to these embodiments without departing from the principles and essence of the present application, and such changes and modifications fall within the protection scope of the present application.
Claims
1. A drone identification and tracking system, characterized in that, The data acquisition layer relies on a network of high-definition cameras deployed in key areas to acquire high-precision visual monitoring data around the clock, providing the system with full-domain dynamic perception capabilities. The processing and analysis layer runs as the core hub on a high-performance server cluster. By integrating the visual detection module of YOLOv12 deep learning, it performs millisecond-level target analysis on real-time video streams, accurately identifies and marks drone features; The application service layer provides multi-dimensional functional support, including dynamic target tracking display in a visual detection interface, flight trajectory analysis based on spatiotemporal dimensions, and secure storage of massive amounts of data by building a local database.
2. The UAV identification and tracking system according to claim 1, characterized in that, The region attention module used in YOLOv12 works as follows: (1) Feature partitioning: The input feature map (H×W) is simply divided into l regions, each region being H / l×W or H×W / l in size; (2) In-region attention calculation: Attention is calculated separately for each region. The calculation formula is as follows: Where Q, K, and V are the query, key, and value matrices, respectively, and d is the feature dimension; (3) Position awareness: Attention output is enhanced by large separable convolutions (7×7).
3. The UAV identification and tracking system according to claim 2, characterized in that, A high-efficiency residual layer aggregation network is adopted, a block-level residual design is introduced, residual connections are established between input and output, and the residual strength is controlled by a default scaling factor of 0.
01. A bottleneck structure design is adopted.
4. The drone identification and tracking system according to claim 3, characterized in that, The core detection module encapsulates the target detection algorithms and inference processes for processing images or videos. The video stream processing module uses multi-threading technology to achieve real-time video stream acquisition, processing, and display functions; The historical record management module is responsible for storing, retrieving, and managing the detection results. It uses a database to implement persistent data management tools. The function module centrally encapsulates common auxiliary methods to improve code reusability. The main application module is modularly integrated to coordinate user interface interaction and system function scheduling, ultimately forming a well-structured and maintainable architecture.
5. The drone identification and tracking system according to claim 4, characterized in that, At the code implementation level, a try-except exception handling structure is embedded in all critical functions to effectively prevent system crashes caused by single points of failure through local error interception, while saving the execution context when an exception occurs. The granularity of exception handling progresses step by step from the function level, module level to the process level, ensuring that errors of different scopes can be properly isolated and handled, and preventing error propagation.
6. The drone identification and tracking system according to claim 5, characterized in that, The system is equipped with a standardized error handling hub, the print_error function, which centrally performs formatted output of exception information, logging, and error level determination, ensuring the standardization and traceability of exception handling. This function not only uniformly records exception type, occurrence location, and call stack technical information, but also associates business impact assessments with a preset error type mapping table, making it easy for operations and maintenance personnel to quickly determine the severity of the problem and the priority order for handling.
7. The drone identification and tracking system according to claim 6, characterized in that, For end users, an error message translation layer is designed to convert underlying technical errors into natural language prompts and provide user-friendly interaction through a visual interface. The system dynamically adjusts the depth of technical details displayed in error messages according to different user roles, providing administrators with complete diagnostic information, while only displaying necessary guidance and solutions for ordinary users.
8. The drone identification and tracking system according to claim 7, characterized in that, Establish an anomaly self-healing mechanism to automatically trigger recovery strategies when a major fault is detected.
9. The drone identification and tracking system according to claim 8, characterized in that, By analyzing historical anomaly data, potential risk points can be predicted and system parameters can be proactively adjusted, such as automatically increasing the timeout threshold or retry count for high-risk operations, thus upgrading passive defense to proactive prevention.
10. The drone identification and tracking system according to claim 9, characterized in that, By generating a unique session ID for each test, the tracking and referencing of test results are ensured; test parameters, timestamps, and environmental information are fully saved to ensure the reproducibility of results; and original inputs and test results are automatically saved to support users in later viewing and comparison. Build an efficient search index to enable fast searching and browsing; and provide batch management functions to facilitate users in viewing, loading, and deleting historical records.