Illegal security window detection method and system based on unmanned aerial vehicle image

By introducing a deep learning object detection model with a hybrid attention transformer and inner-MPDIoU loss function into the YOLOv8 framework, the problems of blind spots and high false detection rates of traditional detection methods are solved, and all-round, high-precision detection of the facades of high-rise buildings is achieved, meeting the needs of refined urban management.

CN122049751APending Publication Date: 2026-05-15SHANGHAI AVCON INFORMATION TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-02-25
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

Existing technologies struggle to provide comprehensive coverage of high-rise building facades in complex environments. Traditional detection methods suffer from blind spots and high false detection rates, and their ability to detect small and dense targets is insufficient, failing to meet the needs of refined urban management.

Method used

A deep learning object detection model based on the YOLOv8 framework is adopted, which combines a hybrid attention transformer (HAT) and an inner-MPDIoU loss function. By using drones to capture images of building facades, the feature response of the target area is enhanced and the bounding box localization is optimized to achieve high-precision detection.

Benefits of technology

It achieves comprehensive coverage of the facades of high-rise buildings, reduces false detection and missed detection rates, improves detection accuracy and efficiency, and meets the high-precision and real-time requirements of refined urban management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122049751A_ABST
    Figure CN122049751A_ABST
Patent Text Reader

Abstract

The invention relates to the crossing field of computer vision, unmanned aerial vehicle application and smart city security and protection technologies, in particular to an illegal security window detection method and system based on an unmanned aerial vehicle image. The method comprises the following steps: performing cruise shooting on a building facade through an unmanned aerial vehicle to obtain an image of a target area; a deep learning target detection model based on a YOLOv8 framework is adopted to detect the illegal security window in the image, the deep learning target detection model is provided with an HAT converter at the Neck end of the YOLOv8 framework, and an inner-MPDIOU loss function is adopted; and outputting a detection result of the illegal security window. According to the invention, the problems of large blind area, low manual inspection efficiency and insufficient detection precision of traditional fixed monitoring can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the intersection of computer vision, drone applications, and smart city security technology, and in particular to a method and system for detecting illegal burglar bars based on drone images. Background Technology

[0002] The detection of illegal burglar bars is a crucial aspect of refined urban management, playing a vital role in ensuring public safety and maintaining the overall urban landscape. However, current monitoring methods face numerous practical challenges. Ground-based fixed monitoring equipment, limited by installation location and viewing angle, struggles to achieve comprehensive coverage of high-rise building facades, resulting in numerous blind spots and failing to effectively detect illegal burglar bar installations in high-rise areas.

[0003] Manual inspections, as a major supplement to traditional supervision, require staff to check each building individually, which not only consumes a lot of manpower and time but also makes it difficult to detect concealed illegal burglar bars. In addition, burglar bars are highly similar to the building facade in color and material, resulting in significant background interference. Traditional algorithms struggle to effectively distinguish the target from the background, leading to a high false detection rate.

[0004] In real-life scenarios, burglar bars are often densely packed or small in size. Existing detection models are insufficient to detect such small and dense targets, making it difficult to meet the actual needs of precise supervision. Although unmanned aerial vehicle (UAV) technology has gradually become widespread and has been applied in fields such as building inspection, there is currently a lack of dedicated detection solutions for illegal burglar bars. Especially in special scenarios such as complex backgrounds, small targets, and dense targets, high-precision, real-time detection systems are not yet mature and cannot fully adapt to the real-world needs of urban refined management for the supervision of illegal burglar bars. Summary of the Invention

[0005] The purpose of this invention is to provide a method and system for detecting illegal burglar bars based on drone images, so as to solve the above-mentioned problems.

[0006] To achieve the above objectives, a method for detecting illegal burglar bars based on drone images is provided in a first aspect of the present invention, comprising the following steps: By using drones to cruise and photograph the exterior of buildings, images of the target area can be obtained; An illegal burglar window in the image is detected using a deep learning object detection model based on the YOLOv8 framework. The deep learning object detection model sets a hybrid attention transformer at the Neck end of the YOLOv8 framework and uses the inner-MPDIoU loss function. Output the detection results of illegal burglar bars.

[0007] Furthermore, in the aforementioned method for detecting illegal burglar bars, the hybrid attention transformer integrates a window-based multi-head self-attention mechanism and a channel attention mechanism to establish global image dependencies and distinguish the importance of feature channels, thereby enhancing the feature response of the target region of the illegal burglar bar.

[0008] Furthermore, in the aforementioned method for detecting illegal burglar bars, the hybrid attention transformer adopts a three-stage structure, including shallow feature extraction, deep feature extraction, and feature optimization output. The deep feature extraction is achieved through a series of residual hybrid attention groups. The residual hybrid attention groups adopt a residual nested structure, consisting of multiple hybrid attention modules and overlapping cross attention modules connected in series. The outputs and inputs of the inner modules are fused through residual connections, and finally the features are integrated through a 3×3 convolutional layer with residual connections.

[0009] Furthermore, in the aforementioned method for detecting illegal burglar bars, the hybrid attention module includes a CAB module and a W-MSA module, and residual connections are introduced to preserve the original feature information. The CAB module is a convolutional block based on a channel attention mechanism, and the W-MSA module is a convolutional block based on a window-based multi-head self-attention mechanism. The processing steps of the hybrid attention module include: after receiving input features, splitting the input features into a first branch and a second branch; performing LayerNorm normalization on the first branch; processing it through the CAB module and the W-MSA module; summing the result element-wise with the second branch; splitting the summation result into a third branch and a fourth branch; performing LayerNorm normalization on the third branch again; inputting the third branch into a multilayer perceptron for nonlinear feature enhancement; and then summing the result element-wise with the fourth branch to obtain the output.

[0010] Furthermore, in the aforementioned method for detecting illegal burglar bars, the overlapping cross-attention module comprises an overlapping cross-attention layer and a multilayer perceptron. Cross-connections between windows are established through the overlapping cross-attention layer to enhance the network representation capability.

[0011] Furthermore, in the aforementioned method for detecting illegal burglar bars, the inner-MPDIoU loss function is based on the MPDIoU loss function combined with the inner-IoU concept. First, an auxiliary bounding box is generated by dynamically scaling the original bounding box. Then, the intersection-union ratio is calculated in the internal region corresponding to the auxiliary bounding box, and finally, the auxiliary bounding box is obtained by multiplying the original bounding box by a scale factor. The scale factor has a value range of [0.5, 1.5].

[0012] Furthermore, in the aforementioned method for detecting illegal burglar bars, when the intersection-union ratio (IU) between the predicted frame and the actual frame is ≥0.7, it is determined to be a high IU sample, and the scale factor is 0.75; when the IU between the predicted frame and the actual frame is ≤0.5, it is determined to be a low IU sample, and the scale factor is 1.2.

[0013] Furthermore, in the aforementioned method for detecting illegal burglar bars, the deep learning object detection model is trained based on a preset dataset. The deep learning object detection model divides the dataset into a training set and a validation set, and the training is carried out in the following three stages: The first stage uses a model based on the YOLOv8m framework as the pre-trained model, with a training set to validation set ratio of 4:1, and employs strong data augmentation, default learning rate, and MuSGD optimizer. The second stage uses the model from the first stage as the pre-trained model, with a training set to validation set ratio of 4:1, and employs weak data augmentation, low learning rate, and MuSGD optimizer. The third stage uses the model from the second stage as the pre-trained model, with a training set to validation set ratio of 1:3. Data augmentation is disabled, and a low learning rate and MuSGD optimizer are used.

[0014] In a second aspect of the invention, a system for detecting illegal burglar bars based on drone images is also proposed, comprising: The airborne detection module is equipped with the deep learning target detection model based on the YOLOv8 framework described in the first aspect above, and is used to process images captured by the drone in real time. The data transmission module transmits back the identification results and alarm information output by the airborne detection module via the image transmission link; The cloud management platform is used to receive data from the data transmission module and generate statistical analysis reports including the coordinates of the boundary frame of the illegal anti-theft window, confidence level, and category information. The system also includes a model optimization system that continuously trains the model based on the data accumulated on the cloud management platform and updates the deep learning target detection model in the airborne detection module.

[0015] Furthermore, in the aforementioned illegal burglar bars detection system, the image preprocessing and model detection steps of the airborne detection module include: The images captured by the drone were adjusted to 640×640 resolution and then normalized and data-enhanced. Feature maps at three different scales are extracted from the model's backbone. Semantic information is fused from top to bottom and positional information is passed from bottom to top. The global contextual understanding is then enhanced by the HAT transformer inserted at the Neck end. Output the bounding box coordinates, confidence level, and category information of the illegal burglar bars.

[0016] Compared with the prior art, the present invention has at least the following technical effects: This invention achieves comprehensive coverage of building facades through drone-based aerial photography, effectively eliminating blind spots in fixed surveillance and significantly improving patrol efficiency and reducing manpower and time costs compared to manual inspections. Simultaneously, by inserting a HAT transformer into the Neck of the YOLOv8 framework and employing a deep learning object detection model with an inner-MPDIoU loss function, the invention effectively reduces background interference and improves the detection accuracy of small and dense targets through the parallel synergy of the hybrid attention mechanism in the HAT transformer and the inner-MPDIoU loss function, thereby reducing false positives and false negatives. The final output is the detection result of illegal burglar bars, avoiding human subjectivity and meeting the high-precision, real-time requirements of urban refined management for the monitoring of illegal burglar bars. Attached Figure Description

[0017] Figure 1 This is a flowchart of a method for detecting illegal burglar bars based on drone images in one embodiment of the present invention; Figure 2 This is a schematic diagram of the HAT converter in one embodiment of the present invention; Figure 3 This is a schematic diagram of the residual hybrid attention group RHAG in one embodiment of the present invention; Figure 4 This is a schematic diagram of the HAB module in one embodiment of the present invention; Figure 5 This is a schematic diagram of the CAB module in one embodiment of the present invention; Figure 6 This is a schematic diagram of the OCAB module in one embodiment of the present invention; Figure 7 This is a schematic diagram illustrating the spatial distance between the predicted bounding box and the ground truth bounding box in target detection according to an embodiment of the present invention; Figure 8 This is a comparison diagram of two spatial layouts of the detection frame in one embodiment of the present invention. Detailed Implementation

[0018] The following will describe in more detail a method and system for detecting illegal burglar bars based on UAV images, with reference to the accompanying diagrams. Preferred embodiments of the invention are illustrated. It should be understood that those skilled in the art can modify the invention described herein while still achieving its advantageous effects. Therefore, the following description should be understood as being of general knowledge to those skilled in the art and is not intended to limit the invention.

[0019] For clarity, not all features of the actual embodiments are described. In the following description, well-known functions and structures are not detailed in detail, as they would obscure the invention with unnecessary detail. It should be understood that in the development of any actual embodiment, numerous implementation details must be made to achieve the developer's specific objectives, such as changes from one embodiment to another according to limitations related to the system or business. Furthermore, it should be understood that such development work may be complex and time-consuming, but is merely routine work for those skilled in the art.

[0020] Based on the teachings of this specification, those skilled in the art can form new technical solutions through cross-combination of different implementation methods without creating technical contradictions. Such variations should all be considered to fall within the protection scope of this invention.

[0021] The invention is described more specifically by way of example in the following paragraphs with reference to the accompanying drawings. The advantages and features of the invention will become clearer from the following description. It should be noted that the drawings are in a very simplified form and use non-precise proportions, and are only used to facilitate and clarify the illustration of the embodiments of the invention.

[0022] Current technologies often employ the YOLOv8 model to utilize drones for high-altitude aerial photography of building facades to detect illegal burglar bars. It's worth noting that the YOLOv8 model is a next-generation real-time object detection AI model developed by Ultralytics, and is one of the latest versions in the YOLO (You Only Look Once) series, designed to quickly and accurately locate and identify targets from images or videos.

[0023] As mentioned in the background section, existing YOLOv8 models have the following shortcomings: First, they are weak against complex backgrounds, making it difficult for the model to effectively distinguish between targets and backgrounds, leading to false detections. Second, from a drone's perspective, they lack sufficient feature representation for small, dense, and easily obscured security windows, resulting in a high false negative rate. Third, the feature fusion at the native neck only focuses on the transmission of semantic and positional information, lacking effective capture of global image dependencies, resulting in weak feature responses in the security window target area and affecting recognition accuracy. Fourth, the model's native loss function is insufficiently optimized for low crossover ratio (CVR) samples, making it difficult to accurately locate illegal security windows and failing to meet the actual needs of efficient and accurate detection of illegal security windows in urban refined management.

[0024] In view of this, such as Figure 1This embodiment discloses a method for detecting illegal burglar bars based on drone images, aiming to solve the problems of large blind spots in traditional fixed monitoring, low efficiency of manual patrols, and insufficient detection accuracy. By combining drone patrols with an improved deep learning target detection model, intelligent, comprehensive, and highly accurate detection of illegal burglar bars is achieved. The detection method includes the following steps: S1: Use drones to cruise and photograph the exterior of buildings to obtain images of the target area; S2: The illegal burglar bars in the image are detected by a deep learning object detection model based on the YOLOv8 framework. The deep learning object detection model sets the HAT transformer at the Neck end of the YOLOv8 framework and adopts the inner-MPDIoU loss function. S3: Output the detection results of illegal burglar bars.

[0025] For step S1, regarding the shooting equipment and parameter settings, this embodiment selects an industry-grade drone with fixed-point cruise and adaptive hovering functions. Its stable flight performance ensures accurate completion of the shooting task in complex airspace environments. The drone is equipped with a high-definition camera, and the camera resolution is set to 4000×3000 pixels. This resolution can clearly present the structural details of the security window, meeting the needs of subsequent deep learning model feature extraction and avoiding the loss of target features due to image blurring.

[0026] The patrol route needs to be tailored to the building distribution characteristics of the target area. For example, a zigzag patrol route can be used to allow the drone to systematically cover each building facade, avoiding any missed areas. The patrol altitude should be strictly controlled between 30 and 50 meters. This altitude range ensures complete coverage of the security window areas on the building facade while maintaining image clarity, avoiding situations where the target appears too small due to excessive distance or the shooting range is limited due to excessive proximity. Simultaneously, the drone can flexibly adjust its viewing angle from 45° to 60° to avoid blind spots caused by building structures, achieving comprehensive coverage of the facades of buildings ranging from 6 to 30 stories.

[0027] During image acquisition and preprocessing, the drone will take real-time images of the building facade while flying along the preset cruise path, and temporarily store the original images through the onboard storage module to prevent data loss.

[0028] For step S2, the deep learning target detection model used in this embodiment is based on the YOLOv8 framework. The HAT transformer and MPDIoU loss function are applied to the YOLOv8 model simultaneously. The HAT transformer is inserted at the Neck end of YOLOv8, and the original loss function is replaced with inner-MPDIoU to form a proprietary improved YOLOv8 model. This model is used to address the challenges of detecting burglar bars in UAV images, thereby improving the detection accuracy and efficiency of small and dense targets in complex scenes.

[0029] The Hybrid Attention Transformer (HAT) is used for single-image super-resolution reconstruction. HAT integrates two attention mechanisms: window-based multi-head self-attention (W-MSA) and channel attention (CA). On the one hand, the window-based multi-head self-attention mechanism establishes global dependencies between different locations within the image; on the other hand, the channel attention mechanism distinguishes the importance of different feature channels, thereby enhancing the feature response of the target area of ​​the illegal security window and reducing interference from complex backgrounds such as building facades and air conditioner units.

[0030] Reference Figure 2 Structurally, the HAT transformer employs a three-stage structure: shallow feature extraction, deep feature extraction, and image reconstruction. Specifically, firstly, shallow feature extraction uses a convolutional layer (Conv) to initially extract features from the input image, filtering redundant information and retaining basic features. Subsequently, deep feature extraction is implemented through a series of Residual Hybrid Attention Groups (RHAGs), where the RHAGs use a residual-in-residual (RIR) structure, meaning each RHAG contains multiple nested residual connections. (Refer to...) Figure 3 The RHAG (Hybrid Attention Block) consists of multiple Hybrid Attention Blocks (HABs) and Overlapping Cross-Attention Blocks (OCABs) connected in series. Residual connections fuse the outputs and inputs of the inner modules, and finally, a 3×3 convolutional layer with residual connections integrates the features, enhancing the representational ability of the target features. Finally, image reconstruction integrates the feature maps extracted from the deep features and outputs them to the subsequent detection head, providing strong representational features for the localization and classification of illegal burglar bars.

[0031] Furthermore, as a core component of RHAG, the HAB module's structure diagram is as follows: Figure 4 As shown, it includes a CAB (Channel Attention Block) module and a W-MSA (Window-based Multi-Head Self-Attention) module, and introduces residual connections to preserve the original feature information.

[0032] from Figure 4 Here is the specific processing procedure of the HAB module: Receive input features from shallow feature extraction or the previous module. Next, it is split into a first branch and a second branch. The first branch is used for feature enhancement processing, while the second branch retains the original features. LayerNorm normalization is performed on the features of the first branch to generate normalized features. To stabilize the training process and accelerate model convergence; Then, the normalized features The inputs are processed by the CAB and W-MSA modules respectively. Then, the outputs of the CAB and W-MSA modules are summed element-wise with the original features of the second branch to obtain the intermediate features. This achieves a combination of feature enhancement and original information preservation; Then the intermediate features It is split into a third branch and a fourth branch. After performing LayerNorm normalization on the third branch, it generates... The input is a multilayer perceptron (MLP), which enhances the feature representation capability through nonlinear transformation. Finally, the output of the MLP is summed element-wise with the features of the fourth branch to obtain the final output Y of the HAB module.

[0033] The entire calculation process of the HAB module can be represented as follows: in, and Represents intermediate features; MLP is a multilayer perceptron that extracts richer features through nonlinear transformations; LayerNorm is a common normalization technique in deep learning, used to stabilize the training process, accelerate model convergence, and improve generalization ability; element-wise sum is a basic operation in deep learning, referring to the operation of adding corresponding elements of two or more tensors of the same shape.

[0034] Additionally, refer to Figure 5 The CAB module is a channel attention-based convolutional module consisting of two standard convolutional layers, the GELU activation function, and the CA channel attention module. It weights the normalized feature information to extract important channel information by calculating the importance weight for each channel and applying the weights to each channel of the input feature. The W-MSA module is a window-based multi-head self-attention module. Its purpose is to divide the input feature into multiple local windows and then calculate self-attention within each window to capture local feature details.

[0035] Furthermore, refer to Figure 6 The Overlapping Cross-Attention (OCAB) module consists of an Overlapping Cross-Attention (OCA) layer and a Multilayer Perceptron (MLP). The OCAB module establishes cross-connections between windows in the window self-attention process through the OCA layer, breaking down feature isolation between local windows and enhancing the network's global representation capability. Specifically, after LayerNorm normalization of the input features, the OCA layer calculates the cross-attention between windows, fusing feature information from different windows. The processed features are then input into the MLP for nonlinear transformation, and finally, element-wise summed with the original input features through residual connections, outputting optimized features that provide more comprehensive feature support for deep feature extraction.

[0036] Furthermore, the inner-MPDIoU loss function used in this embodiment is an improvement based on the MPDIoU (Minimum Points Distance Intersection over Union) loss function combined with the inner-IoU (Internal Intersection over Union) concept, with the aim of improving the positioning accuracy of the illegal burglarproof window boundary box.

[0037] It's important to note that MPDIoU is an improved algorithm that minimizes the distance between the top-left and bottom-right corners of the predicted bounding box and the ground truth bounding box. Like other improved IoU algorithms, it considers bounding box overlap, center offset, and aspect ratio variations. It handles both overlapping and non-overlapping bounding boxes well. MPDIoU considers not only the center distance but also the distances between the top-left and bottom-right corners, allowing the loss function to more comprehensively reflect the positional differences of the bounding boxes.

[0038] Combination Figure 7 Yellow represents the ground truth bounding box, and red represents the predicted bounding box. The specific formula for calculating the MPDIoU loss function is as follows: in, This represents the intersection-over-union ratio, which is the ratio of the intersection to the union of the predicted bounding boxes and the ground truth bounding boxes. This represents the squared Euclidean distance between the top-left corner of the predicted bounding box and the top-left corner of the actual bounding box. The squared Euclidean distance between the top right corner of the predicted bounding box and the top right corner of the true bounding box is represented by ; W and H represent the width and height of the smallest closure box containing both boxes.

[0039] Furthermore, based on the MPDIoU loss function, the inner-IoU concept is used to modify the MPDIoU loss function to obtain the formula for the inner-MPDIoU loss function: Reference Figure 8 The core idea of ​​the inner-MPDIoU loss function is to generate auxiliary bounding boxes by dynamically scaling the original bounding box, and then calculate the intersection-over-union (IoU) ratio within the corresponding internal region of the auxiliary bounding box. This allows the loss function to adaptively focus on regions of different scales based on prediction quality, improving localization accuracy and convergence speed. The benefit of this approach is that for tasks requiring precise bounding box localization, such as burglar bars detection from a drone's perspective, dense object detection, and background detection in complex environments, it helps the model generate more accurate detection boxes.

[0040] Furthermore, the auxiliary bounding box is obtained by multiplying the original bounding box by a scale factor, denoted by `ratio`, which ranges from [0.5, 1.5]. Its main function is to control the generation of auxiliary bounding boxes at different scales for loss calculation. When `ratio = 1`, the inner-MPDIoU loss function is essentially the MPDIoU loss function. For high cross-union ratio (CUI) samples, a smaller `ratio` can be used to generate auxiliary bounding boxes; for low CUI samples, a larger `ratio` is used. In a preferred embodiment, when the CUI of the predicted box and the ground truth box is ≥ 0.7, it is considered a high CUI sample, and a scale factor of 0.75 is used to generate an auxiliary bounding box, focusing on optimizing the precise region of the bounding box. When the CUI of the predicted box and the ground truth box is ≤ 0.5, it is considered a low CUI sample, and a scale factor of 1.2 is used to generate an auxiliary bounding box, expanding the feature learning range and improving the localization accuracy of the bounding box.

[0041] Among them, the combination Figure 8 The formula for calculating inner-IoU is as follows: in in, It is the area of ​​the intersection of the interior regions of the two bounding boxes; It is the area of ​​the union of the regions inside the two bounding boxes; These are the top, bottom, left, and right boundaries of the actual auxiliary bounding box; It predicts the top, bottom, left, and right boundaries of the bounding box; These are the coordinates of the center point of the actual bounding box; These are the width and height of the actual bounding box; These are the coordinates of the center point of the prediction box; These are the width and height of the prediction box.

[0042] Furthermore, the deep learning object detection model is trained on a custom dataset, UAV-WD. The dataset was created by using X-Anylabeling to annotate images of burglar bars captured by drones, ensuring that clear objects in each image were accurately labeled. The annotation criteria were clarity and independence, with low-resolution targets left unlabeled. After annotation, relevant data crawled from web crawlers was used to construct the UAV-WD dataset.

[0043] The deep learning object detection model divides the dataset into a training set and a validation set, and the training is carried out in the following three stages: The first stage uses a deep learning object detection model based on the YOLOv8m framework as the pre-trained model, with a training set to validation set ratio of 4:1. It employs a random number seed of 1, strong data augmentation, a default learning rate, and a MuSGD optimizer. In this embodiment, strong data augmentation includes random cropping, flipping, and brightness adjustment operations. The second stage uses the model trained in the first stage as the pre-trained model. The ratio of training set to validation set remains 4:1. It employs random number seed 2, weak data augmentation, low learning rate, and MuSGD optimizer. Weak data augmentation involves only slight noise addition and Gaussian blurring. As an example, the low learning rate is 1 / 10 of the default learning rate in the first stage. The third stage uses the model trained in the second stage as the pre-trained model, adjusts the ratio of training set to validation set to 1:3, adopts a random number seed of 3, disables data augmentation, and continues to use a low learning rate and MuSGD optimizer. Through multi-stage training, the generalization ability and detection accuracy of the model are gradually improved.

[0044] In terms of image preprocessing and model detection, the original images (4000×3000 pixels) captured by the drone are first adjusted to a resolution of 640×640 and normalized (pixel values ​​are mapped to the [0,1] interval). Data augmentation operations are then performed according to the settings during the training phase. During the inference phase, only normalization and resolution adjustment are performed. Subsequently, the model's Backbone network (YOLOv8 native Backbone) extracts feature maps of three different scales: P3 (80×80), P4 (40×40), and P5 (20×20), corresponding to small, medium, and large target features, respectively. Then, semantic information is fused from top to bottom using FPN (Feature Pyramid Network), and finally, PANet (Pathfinder Network) is used. The Aggregation Network (ANN) transmits positional information from bottom to top. At the feature fusion end of the Neck, the HAT transformer is inserted to perform global context enhancement on the fused features, strengthening the target feature response of the illegal burglar window. Finally, the enhanced feature map is processed by the model's detection head, and the detection results of the illegal burglar window's bounding box coordinates (coordinate values ​​relative to a 640×640 resolution image), confidence (probability that the target is an illegal burglar window), and category information (illegal burglar window category) are output.

[0045] For step S3, the detection results of illegal burglar bars include bounding box coordinates, confidence scores, and category information, enabling intelligent identification of illegal burglar bars. To ensure the accuracy and effectiveness of the output detection results of illegal burglar bars, post-processing operations are first required on the raw data output by the model.

[0046] In response to the issue that multiple overlapping bounding boxes may appear for the same illegal burglar bars, the Non-Maximum Suppression (NMS) algorithm is used to filter and retain the bounding box with the highest confidence and the most accurate positioning, so as to avoid duplicate annotations affecting subsequent handling judgments.

[0047] Since the model detection in step S2 is based on a 640×640 resolution image, a coordinate restoration operation is also required. According to the size ratio of the original captured image (4000×3000 pixels) and the processed image, the bounding box coordinates output by the model are restored to the actual coordinates in the original image, so that the location information of the illegal security window can be accurately traced.

[0048] The confidence filtering step sets a confidence threshold of 0.5 to filter out detection results with a confidence level below this threshold, thereby reducing false detections and ensuring that all output results are highly reliable targets of illegal burglar bars.

[0049] The post-processed and optimized detection results will be used to implement intelligent applications through a system linkage of local output, remote transmission, and real-time early warning. During output, the drone's onboard detection module will synchronously output the complete processed detection results in real time, including the original captured image of the illegal security window, the restored precise bounding box coordinates, target confidence level, and category label, allowing on-site personnel to view the detection status in real time.

[0050] In summary, this invention, by inserting a HAT transformer into the Neck of the YOLOv8 framework and employing a deep learning target detection model with an inner-MPDIoU loss function, effectively reduces interference from complex backgrounds such as building facades and air conditioner units through the parallel synergy of the hybrid attention mechanism in the HAT transformer and the inner-MPDIoU loss function. It also enhances the feature response of the target area, enabling the model to have a stronger feature representation capability for small-scale, densely distributed, and mutually occluded burglar bars from the aerial view of a UAV.

[0051] In another embodiment, a system for detecting illegal burglar bars based on drone images is also proposed. The system includes an airborne detection module, a data transmission module, a cloud management platform, and a model optimization system.

[0052] The airborne detection module carries the deep learning object detection model based on the YOLOv8 framework described in the previous embodiment, used for real-time processing of images captured by the drone. The data transmission module transmits the recognition results and alarm information output by the airborne detection module back via an image transmission link. The cloud management platform receives the data from the data transmission module and generates statistical analysis reports including the coordinates of the illegal security window's bounding box, confidence level, and category information. The model optimization system continuously trains the model based on the data accumulated on the cloud management platform and updates the deep learning object detection model in the airborne detection module.

[0053] Specifically, the remote transmission module (image transmission link) synchronously uploads the detection results, along with the GPS positioning information and image capture timestamps during the drone's flight, to the cloud management platform. This enables centralized storage, categorized management, and visualization of the detection data, facilitating remote monitoring of the entire inspection area by management personnel. The real-time early warning function ensures rapid response to detection results. When the system detects an illegal burglar bar, it immediately sends an alarm message to relevant management personnel. This message includes the precise GPS location of the illegal target, on-site screenshots, and key violation parameters. This provides accurate navigation support and strong evidence for management personnel to quickly reach the scene and conduct enforcement actions, truly achieving intelligent and efficient identification and control of illegal burglar bars.

[0054] The above are merely preferred embodiments of the present invention and do not constitute any limitation on the present invention. Any equivalent substitutions or modifications made by those skilled in the art to the technical solutions and content disclosed in the present invention without departing from the scope of the present invention shall be deemed to have remained within the protection scope of the present invention.

Claims

1. A method for detecting illegal burglar bars based on drone images, characterized in that, Includes the following steps: By using drones to cruise and photograph the exterior of buildings, images of the target area can be obtained; An illegal burglar window in the image is detected using a deep learning object detection model based on the YOLOv8 framework. The deep learning object detection model sets a hybrid attention transformer at the Neck end of the YOLOv8 framework and uses the inner-MPDIoU loss function. Output the detection results of illegal burglar bars.

2. The detection method according to claim 1, characterized in that, The hybrid attention transformer integrates a window-based multi-head self-attention mechanism and a channel attention mechanism to establish global image dependencies and distinguish the importance of feature channels, thereby enhancing the feature response of the target area of ​​the illegal security window.

3. The detection method according to claim 2, characterized in that, The hybrid attention transformer adopts a three-stage structure, including shallow feature extraction, deep feature extraction, and image reconstruction. The deep feature extraction is achieved through a series of residual hybrid attention groups. The residual hybrid attention groups adopt a residual nested structure, which consists of multiple hybrid attention modules and overlapping cross attention modules connected in series. The output and input of the inner module are fused through residual connections. Finally, the features are integrated through a 3×3 convolutional layer with residual connections.

4. The detection method according to claim 3, characterized in that, The hybrid attention module includes a CAB module and a W-MSA module, and introduces residual connections to preserve the original feature information. The CAB module is a convolutional block based on a channel attention mechanism, and the W-MSA module is a convolutional block based on a window-based multi-head self-attention mechanism. The processing steps of the hybrid attention module include: after receiving input features, splitting the input features into a first branch and a second branch; performing LayerNorm normalization on the first branch; processing it through the CAB module and the W-MSA module; summing the result element-wise with the second branch; splitting the summation result into a third branch and a fourth branch; performing LayerNorm normalization on the third branch again; inputting the third branch into a multilayer perceptron for nonlinear feature enhancement; and then summing the result element-wise with the fourth branch to obtain the output.

5. The detection method according to claim 3, characterized in that, The overlapping cross-attention module consists of an overlapping cross-attention layer and a multilayer perceptron. Cross-connections between windows are established through the overlapping cross-attention layer to enhance the network's representation capabilities.

6. The detection method according to claim 1, characterized in that, The inner-MPDIoU loss function is based on the MPDIoU loss function combined with the inner-IoU concept. It first generates an auxiliary bounding box by dynamically scaling the original bounding box, and then calculates the intersection-union ratio (IU) in the internal region corresponding to the auxiliary bounding box. The auxiliary bounding box is obtained by multiplying the original bounding box by a scale factor, and the scale factor has a value range of [0.5, 1.5].

7. The detection method according to claim 6, characterized in that, When the intersection-union ratio (IU) between the predicted bounding box and the ground truth bounding box is ≥0.7, it is determined to be a high IU sample, and the scale factor is 0.75; when the IU between the predicted bounding box and the ground truth bounding box is ≤0.5, it is determined to be a low IU sample, and the scale factor is 1.

2.

8. The detection method according to claim 1, characterized in that, The deep learning object detection model is trained on a pre-set dataset. The deep learning object detection model divides the dataset into a training set and a validation set, and the training is carried out in the following three stages: The first stage uses the deep learning object detection model based on the YOLOv8m framework as the pre-trained model, with a training set to validation set ratio of 4:1, and employs strong data augmentation, default learning rate, and MuSGD optimizer. The second stage uses the model trained in the first stage as the pre-trained model. The ratio of the training set to the validation set is 4:

1. Weak data augmentation, low learning rate and MuSGD optimizer are used. The third stage uses the model trained in the second stage as the pre-trained model, with a training set to validation set ratio of 1:

3. Data augmentation is disabled, and a low learning rate and MuSGD optimizer are used.

9. A system for detecting illegal burglar bars based on drone images, characterized in that, include: An airborne detection module, equipped with a deep learning target detection model based on the YOLOv8 framework as described in any one of claims 1-8, is used for real-time processing of images captured by a drone; The data transmission module transmits back the identification results and alarm information output by the airborne detection module via the image transmission link; The cloud management platform is used to receive data from the data transmission module and generate statistical analysis reports including the coordinates of the boundary frame of the illegal anti-theft window, confidence level, and category information. The system also includes a model optimization module, which continuously trains the model based on the data accumulated on the cloud management platform and updates the deep learning target detection model in the airborne detection module.

10. The detection system according to claim 9, characterized in that, The image preprocessing and model detection steps of the airborne detection module include: The images captured by the drone were adjusted to 640×640 resolution and then normalized and data-enhanced. Feature maps at three different scales are extracted from the model's backbone. The system integrates semantic information from top to bottom and positional information from bottom to top, and then enhances global contextual understanding through a hybrid attention transformer inserted at the Neck. Output the bounding box coordinates, confidence level, and category information of the illegal burglar bars.