Dense target detection method and system

By generating macroblock and microblock sequences and combining skip connections and bidirectional GRU models to extract features, the YOLOv8 detector is optimized, solving the problem of low accuracy in dense detection of electricity meters in low-voltage power distribution scenarios in old residential areas and achieving higher detection accuracy.

CN120976513APending Publication Date: 2025-11-18ELECTRIC POWER RES INST OF GUANGXI POWER GRID CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510815622.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-18
Publication Date
2025-11-18

AI Technical Summary

Technical Problem

In low-voltage power distribution scenarios in old residential areas, the high density of electricity meters, small spacing, and inclined installation make it difficult to detect dense targets. Existing algorithms are unable to accurately identify and segment them, and are prone to missed detections or false detections.

Method used

By generating macroblock and microblock sequences, and combining skip connections and a bidirectional GRU model to extract global semantic and local detail features, the improved SLIC algorithm and deformable convolution are used for feature fusion to optimize the anchor box size of the YOLOv8 detector and improve detection accuracy.

Benefits of technology

It significantly improves the accuracy of dense target detection, solves the problems of boundary blurring and target adhesion in dense target scenes, and enhances boundary fitting accuracy and detection accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120976513A_ABST
    Figure CN120976513A_ABST
Patent Text Reader

Abstract

The invention discloses a dense target detection method and system, relates to the technical field of fusion of computer vision and electric power Internet of Things, and can solve the problems of inaccurate segmentation and low detection accuracy of dense target detection in the prior art. According to the embodiment of the invention, the macro-block sequence and the micro-block sequence of the dense target image are generated, then the global feature used for capturing scene layout prior is acquired based on the macro-block sequence and the original dense target image, the local feature indicating local details is acquired based on the micro-block sequence, and then the global feature and the local feature are fused. A comprehensive feature considering global and local information is formed; the dense targets are detected based on the comprehensive features, the scene detection precision of the dense targets can be remarkably improved, and the method has important application value in the field of electric power Internet of Things.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer vision and smart grid intersection, and particularly relates to a dense target detection method and system. BACKGROUND

[0002] The goal of the smart grid is to build a panoramic real-time system covering all aspects of the power system, including power generation, transmission, transformation, distribution, power utilization and dispatching, etc. By using advanced technologies such as information communication, computers and control, the efficiency of each part of the power system is improved, the cost and environmental pollution are reduced, and the reliability, stability and self-healing ability of the power system are improved as much as possible. The smart meter is one of the basic devices for data acquisition of the smart grid (especially the smart distribution network), and undertakes the tasks of raw electric energy data acquisition, metering and transmission, and is the basis for information integration, analysis and optimization and information display.

[0003] With the advancement of smart grid construction, the demand for intelligent transformation of electric energy meters in the low-voltage distribution scene of old communities is urgent. In this scenario, the installation density of electric energy meters is extremely high, up to 30-50 / m2, which poses a serious challenge to the detection and identification technology of electric energy meters.

[0004] Firstly, the space constraint is significant, and the minimum distance between the instruments is only 1.5 cm, which corresponds to 5-8 pixels in the image, making it extremely difficult to detect small targets in dense areas and prone to missed detection or false detection. Secondly, the electric energy meter is installed at an angle of up to 45°, causing the dial to be distorted in perspective, further increasing the complexity of target positioning and identification.

[0005] Currently, the mainstream YOLO series algorithm in processing such scenarios, due to direct regression bounding box, easy to cause the prediction box of overlapping target fusion, can't accurately distinguish adjacent electric meter. Therefore, it is urgent to develop a kind of dense target detection method and system which can overcome the above problems, in order to meet the practical application needs of old community intelligent distribution. SUMMARY

[0006] In view of the problem of inaccurate segmentation and low detection accuracy of dense targets in the prior art, the present application provides a dense target detection method and system, which can improve the detection accuracy of dense targets.

[0007] In a first aspect, the present application provides a dense target detection method, which comprises:

[0008] The method comprises the following steps: acquiring a dense target image; generating a macro block sequence and a micro block sequence based on the dense target image; obtaining a global feature of the dense target image by fusing a global semantic feature and a global detail feature through a skip connection; the global semantic feature is obtained based on the macro block sequence, and the global detail feature is obtained based on the dense target image; obtaining a local feature of the dense target image by processing the micro block sequence through a bidirectional gated recurrent unit (GRU) model; obtaining a comprehensive feature by fusing the global feature and the local feature; and detecting a dense target in the dense target image based on the comprehensive feature through a YOLOv8 detector.

[0009] Preferably, the generating of the macro block sequence and the micro block sequence based on the dense target image comprises: generating the macro block sequence based on a down-sampled image of the dense target image by improving a simple linear iterative clustering (SLIC) algorithm; and obtaining four quadrant subgraphs by performing four-quadrant division on the dense target image; and generating the micro block sequence by performing non-overlapping sliding sampling on the four quadrant subgraphs through a sliding window.

[0010] Preferably, the dynamic adjustment formula of the compactness factor of the improved SLIC algorithm comprises:

[0011]

[0012] wherein m0 is an initial compactness factor, t is a current training iteration number, m t is a compactness factor under a current iteration number, T is a total iteration number, IoU t is an average intersection over union of a current validation set.

[0013] Preferably, the processing of the micro block sequence through the bidirectional GRU model to obtain the local feature of the dense target image comprises: extracting a feature of the micro block sequence through a preset CNN encoder; inputting the feature of the micro block sequence into the bidirectional GRU model to obtain the local feature output by the bidirectional GRU model; and a hidden state fusion formula of the bidirectional GRU model is: is a hidden state of a forward GRU at time t, is a hidden state of a reverse GRU at time t, H t is a local feature.

[0014] Preferably, before the fusing of the global semantic feature and the global detail feature through the skip connection to obtain the global feature, the method further comprises: extracting a feature of the macro block sequence through a preset CNN encoder; processing the macro block sequence through a Mamba encoder to obtain the global semantic feature; and a calculation formula of the global semantic feature comprises:

[0015] h t = Aht-1 + Bx t ;

[0016] y t = Ch t + Dx t ;

[0017] where h t is the hidden state of time step t; x t is the feature input of the t-th macro block corresponding to time step t, y t is the global semantic feature output at time step t, A is a state transition matrix, and B, C, and D are learnable parameter matrices.

[0018] Preferably, the global feature and the local feature are fused to obtain a comprehensive feature, including: the global feature and the local feature are weighted and fused through an attention gate mechanism to obtain a fused feature; the fused feature is offset compensated through deformable convolution to obtain a first intermediate feature; the first intermediate feature is activated through an LELU activation function to obtain a second intermediate feature; the second intermediate feature is decoded through a cross-level skip connection strategy to obtain the comprehensive feature; wherein the cross-level skip connection strategy is used to cross-level fuse low-level features and high-level features in the second intermediate feature.

[0019] Preferably, the comprehensive feature is a superpixel boundary map; and the dynamic anchor box size adjustment formula of the YOLOv8 detector includes:

[0020]

[0021] where D anchor is the dynamic anchor box size, N sp is the number of superpixels in the region of interest (ROI), σ I is the illumination variance of the region of interest, A ROI is the area of the region of interest, and I avg is the average illumination intensity of the region of interest.

[0022] In a second aspect, an embodiment of the present application provides a dense target detection system, which includes:

[0023] An acquisition module configured to acquire a dense target image;

[0024] A generation module configured to generate a macro block sequence and a micro block sequence based on the dense target image;

[0025] A global module configured to fuse a global semantic feature and a global detail feature through a skip connection to obtain a global feature; the global semantic feature is obtained based on the macro block sequence, and the global detail feature is obtained based on the dense target image;

[0026] a local module configured to process the microblock sequence by a bidirectional gated recurrent unit (GRU) model to obtain local features of the dense target image;

[0027] a fusion module configured to fuse the global features and the local features to obtain comprehensive features;

[0028] a detection module configured to detect dense targets in the dense target image based on the comprehensive features by a YOLOv8 detector.

[0029] In a third aspect, an embodiment of the present application provides a computing device, which includes a memory and a processor; the memory and the processor are coupled; the memory is configured to store computer program instructions; and the processor is configured to invoke the computer program instructions to execute the method according to the first aspect.

[0030] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, which stores computer execution instructions; when the computer execution instructions are executed by a processor, the method according to the first aspect is implemented.

[0031] The embodiments of the present application have the following beneficial effects: by generating a macroblock sequence and a microblock sequence of a dense target image, then obtaining global features for capturing scene layout priori based on the macroblock sequence and the original dense target image, obtaining local features indicating local details based on the microblock sequence, and then fusing the two to form comprehensive features considering global and local information; based on the comprehensive features to detect dense targets, the dense target scene detection precision can be significantly improved, and the present application has important application value in the field of power Internet of Things. BRIEF DESCRIPTION OF DRAWINGS

[0032] In order to more clearly illustrate the specific embodiments of the present application or the technical solutions in the prior art, the drawings needed in the specific embodiments or prior art description will be briefly introduced below. In all the drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, each element or part is not necessarily drawn according to the actual scale.

[0033] Figure 1 a flowchart of a dense target detection method provided by an embodiment of the present application;

[0034] Figure 2 a processing architecture diagram of a dense target detection method provided by an embodiment of the present application;

[0035] Figure 3 a two-stage superpixel generation flowchart provided by an embodiment of the present application;

[0036] Figure 4A circuit structure schematic diagram of a fusion module provided for an embodiment of the present application is shown in the figure;

[0037] Figure 5 A structure schematic diagram of a dense target detection system provided for an embodiment of the present application is shown in the figure;

[0038] Figure 6 A structure schematic diagram of a computing device provided for an embodiment of the present application is shown in the figure. DETAILED DESCRIPTION

[0039] The technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings of the embodiments of the present application. Obviously, the described embodiments are some of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of the present application.

[0040] It should be understood that, when used in the specification and the appended claims, the terms "comprise" and "include" indicate the presence of described features, integers, steps, operations, elements, and / or components, but do not exclude one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0041] It should also be understood that the terms used in the present application specification are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in the present application specification and the appended claims, unless otherwise clearly indicated by the context, the singular forms "a", "an" and "the" are intended to include the plural forms.

[0042] It should be further understood that the term "and / or" used in the present application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes these combinations.

[0043] To solve the core problems of boundary confusion, small target missing detection, poor environmental robustness, etc. in the existing dense power meter detection, the present application proposes a dense target detection method and system, aiming to achieve the following technical breakthroughs:

[0044] Boundary perception enhancement: through the cooperative optimization of superpixel segmentation and detection network, the boundary blur and target adhesion problems caused by dense arrangement are solved, and the boundary fitting accuracy is improved.

[0045] Multi-scale feature calibration: a global-local dual-channel feature extraction network is constructed to overcome the hierarchical misplacement defects of traditional feature pyramid network (FPN) in regular dense targets.

[0046] Edge computing adaptation: Design a lightweight feature fusion module and model quantization strategy to achieve real-time detection while maintaining high accuracy on embedded devices.

[0047] Please see Figure 1 , Figure 1 This application provides a flowchart illustrating a dense target detection method, which is applied to a computing device. Figure 1 As shown, the method includes:

[0048] Step 101: The computing device acquires dense target images.

[0049] The computing device can be a server or a terminal, specifically a personal computer, laptop, or tablet computer, or any other device with image data processing capabilities.

[0050] The computing device can connect to the camera or video recording device via wired or wireless means to acquire dense target images captured by the camera or video recording device in real time; it can also acquire the dense target images from a network database or storage device.

[0051] The dense target image refers to an image containing dense targets, specifically images of dense crowds, animal groups, dense vehicles in traffic scenes, and buildings in remote sensing satellite scenes. This document primarily uses the smart meter detection scenario in a power system as an example to illustrate the detection process of dense meter images.

[0052] Step 102: The computing device generates macroblock sequences and microblock sequences based on the dense target image.

[0053] Macroblocks and microblocks are the basic units used to divide images in digital image and video coding, and they differ in their granularity. For example, a macroblock can be 32 pixels by 32 pixels, while a microblock is 16 pixels by 16 pixels.

[0054] Among them, the macroblock sequence refers to the sequence obtained by arranging macroblocks in order of generation; the microblock sequence is similar.

[0055] In this embodiment, the computing device extracts features from macroblock sequences of dense target images to obtain global features representing global semantic information, and extracts features from microblock sequences to obtain local features representing local detail information.

[0056] Preferably, the computing device can first down-sample the dense target image, and then generate the macro block sequence based on the down-sampled image of the dense target image by improving a simple linear iterative clustering (SLIC) algorithm; divide the dense target image into four quadrant subgraphs by four-quadrant division; and generate the micro block sequence by performing non-overlapping sliding sampling on the four quadrant subgraphs through a sliding window.

[0057] In the method, the macro block sequence is generated based on the down-sampled image after the original image is down-sampled, which can reduce the amount of calculation and retain the global structure.

[0058] In the method, the SLIC algorithm is a classical method for image segmentation, which simplifies subsequent image processing tasks (such as target recognition, image compression, etc.) by dividing an image into superpixels. The core idea is to combine color similarity and spatial distance for iterative clustering.

[0059] In the method, the superpixel is an important concept in the field of image processing and computer vision, which aggregates adjacent pixels with similar features (such as color, texture, brightness, etc.) in an image into a "pixel block", and each block can be regarded as a basic unit with semantic information. It divides the image into small blocks with semantic meaning through clustering algorithm, which reduces the data dimension while retaining the structural information of the image.

[0060] In the method, the compactness factor m in the SLIC algorithm is a parameter used to control the trade-off between the regularity of superpixel shape and color consistency. The value of m determines the relative importance of spatial distance and color distance in the clustering process. A smaller m value will make the algorithm pay more attention to color similarity, and the superpixels tend to distribute along the real edges of the image to better maintain the boundary information of the image, but may result in irregular superpixel shape. A larger m value will increase the influence of spatial distance, making the generated superpixels more compact, closer to circular or square, and with higher internal color consistency, but may ignore the detailed edges of the image to some extent.

[0061] The improvement of the SLIC algorithm in the embodiments of the present application is the dynamic adjustment of the compactness factor. Preferably, the dynamic adjustment formula of the compactness factor of the improved SLIC algorithm comprises:

[0062]

[0063] In the formula, m0 is the initial compactness factor, t is the current training iteration number, m t is the compactness factor under the current iteration number, T is the total iteration number, and IoU t is the average intersection over union of the current validation set.

[0064] Based on the above principle, the computing device extracts the macro blocks in the dense target image by the improved SLIC algorithm, each macro block as a global semantic unit, encodes the scene layout (such as the distribution of the meter row and column, the structure of the meter box).

[0065] For the micro block sequence, the computing device can first take the center of the dense target image as the zero point, and divide the dense target image into four quadrant subgraphs in a four-quadrant division manner; then extract the micro block sequence of each quadrant subgraph through a sliding window sliding at a fixed step.

[0066] For example, the fixed step is 16 pixels, and the size of the micro block is 16 pixels * 16 pixels.

[0067] Step 103, the computing device fuses the global semantic features and the global detail features through the skip connection to obtain the global features of the dense target image.

[0068] The global semantic features are obtained based on the macro block sequence, and the global detail features are obtained based on the dense target image. Specifically, the global semantic features are used to represent the global semantic relationship of the dense target image, and the global detail features are used to represent the low-level spatial features (such as edges and textures) of the dense target image.

[0069] Preferably, the computing device can extract the features of the dense target image through a preset CNN encoder to obtain the global detail features; then process the macro block sequence through a Mamba encoder to obtain the global semantic features; the calculation formula of the global semantic features includes:

[0070] h t =Ah t-1 +Bx t ;

[0071] y t =Ch t +Dx t ;

[0072] Where h t is the hidden state of time step t; x t is the feature input of the t-th macro block corresponding to the time step t, y t is the global semantic feature finally output at time step t, A is a state transition matrix, and B, C, and D are learnable parameter matrices.

[0073] Then the two are fused through the skip connection and the U-Net decoder to form the global features that take into account both semantic information and detail information.

[0074] In step 104, the computing device processes the microblock sequence through a bidirectional gated recurrent unit (GRU) model to obtain local features of the dense target image.

[0075] Preferably, the computing device can extract features of the microblock sequence through a preset CNN encoder, input the features of the microblock sequence into the bidirectional GRU model, and obtain the local features output by the bidirectional GRU model. The hidden state fusion formula of the bidirectional GRU model is as follows: is the hidden state of the forward GRU at time t, is the hidden state of the reverse GRU at time t, H t is the local feature.

[0076] In step 105, the computing device fuses the global feature and the local feature to obtain a comprehensive feature.

[0077] After obtaining the global feature and the local feature of the dense target image, the two features can be fused to obtain a comprehensive feature that takes into account global and local information.

[0078] Preferably, the computing device can fuse the global feature and the local feature through an attention gate mechanism to obtain a fused feature, perform offset compensation on the fused feature through deformable convolution to obtain a first intermediate feature, activate the first intermediate feature through an LELU activation function to obtain a second intermediate feature, and decode the second intermediate feature through a cross-level skip connection strategy to obtain the comprehensive feature.

[0079] In the formula, the computing device can concatenate the global feature and the local feature along the channel dimension to form a mixed feature tensor graph, then use a Sigmoid function to generate a spatial attention mask, and the mask assigns a weight value between 0 and 1 to each pixel in the mixed feature tensor graph. Specifically, for the ammeter dense area and the texture area with clear boundaries, the computing device assigns a high weight, and for the metal reflection artifact and the background interference area, the computing device assigns a low weight. By weighting the global and local features, the computing device can obtain a fused feature.

[0080] It can be understood that the above-mentioned ammeter dense area, texture area with clear boundaries, and the like can be determined by the computing device based on global semantic units in the global feature.

[0081] In the superpixel segmentation process, due to the complexity of the image itself (such as illumination changes, object occlusion, texture complexity, etc.), the limitations of the segmentation algorithm, the boundary of the superpixel may not completely match the boundary of the actual object, and boundary offset may occur. Such offset will affect the accuracy of subsequent tasks based on superpixels. Deformable convolution is an improved form of traditional convolution. In traditional convolution, the convolution kernel slides on the input image or feature map in a fixed grid pattern, such as the commonly used 3x3, 5x5, etc. fixed size convolution kernel samples and calculates in a fixed position. Deformable convolution introduces a learnable offset, so that each sampling point of the convolution kernel can adaptively move to a more suitable position according to the content of the image.

[0082] Therefore, when deformable convolution is applied to compensate for superpixel boundary offset, the principle is that the offset learned by the network allows the convolution kernel to adaptively adjust the sampling position near the superpixel boundary. Specifically, deformable convolution generates an offset for each sampling point based on the feature information inside and around the superpixel. These offsets allow the convolution kernel to no longer be limited to fixed grid positions at the superpixel boundary, but can more accurately align with the true position of the superpixel boundary, thereby compensating for boundary offset caused by various factors. In this way, after deformable convolution processing, the boundary of the superpixel can better fit the boundary of the actual object, improving the accuracy of superpixel segmentation and providing a more reliable basis for subsequent image processing and analysis tasks.

[0083] Among them, the computing device can calculate the sampling position offset of each convolution kernel based on the superpixel similarity matrix; then dynamically adjust the sampling points of the convolution kernel to offset towards the real boundary direction; then perform convolution operation on the offset feature map to compensate for the offset, enhance the boundary alignment accuracy, and obtain the first intermediate feature.

[0084] Among them, the cross-level jump connection strategy is used to cross-level fuse the low-level features and high-level features in the second intermediate feature.

[0085] Step 106, the computing device detects the dense target in the dense target image based on the comprehensive feature through the YOLOv8 detector.

[0086] Among them, after obtaining the comprehensive feature, the computing device can detect the dense target image based on the comprehensive feature.

[0087] Preferably, the C2f module of the YOLOv8 detector is embedded with spatial attention gating, and the calculation formula is:

[0088]

[0089] Among them, represents element-wise addition, || represents channel concatenation, and σ is a sigmoid function. RGB is the RGB image feature of the dense target image, F SP is the comprehensive feature.

[0090] Preferably, the comprehensive feature is a superpixel boundary map; the dynamic anchor box size adjustment formula of the YOLOv8 detector comprises:

[0091]

[0092] where D anchor is the dynamic anchor box size, N sp is the number of superpixels in the region of interest (ROI), σ I is the illumination variance of the region of interest, A ROI is the area of the region of interest, and I avg is the average illumination intensity of the region of interest.

[0093] where the computing device can generate a plurality of boundary boxes with different scaling ratios and aspect ratios centered on each pixel, and these boundary boxes are the anchor boxes. Assuming that the height of the input image is h and the width is w, different shaped anchor boxes are generated centered on each pixel of the image, with a scaling ratio s e (0, 1) and an aspect ratio r > 0, then the width and height of the anchor box are and h s Here, the width and height are specific manifestations of the anchor box size, represented by D anchor , which is a concise representation of these size information, facilitating reference and processing in code or algorithm description.

[0094] where the superpixel boundary map is a binary map, 1 representing a superpixel boundary pixel and 0 representing a non-superpixel boundary pixel.

[0095] where the more superpixels in the region of interest, the more densely arranged the targets, in which case the anchor box size is smaller, thereby enhancing the detection capability of small targets; otherwise, the targets are arranged more sparsely, and the anchor box size can be appropriately enlarged to prevent missing targets.

[0096] In the embodiments of the present application, by generating a macro block sequence and a micro block sequence of the dense target image, then obtaining global features for capturing scene layout priors based on the macro block sequence and the original dense target image, obtaining local features indicating local details based on the micro block sequence, and then fusing the two to form a comprehensive feature that takes into account global and local information, the detection of dense targets based on the comprehensive feature can significantly improve the detection accuracy of dense target scenes and has important application value in the field of power Internet of Things.

[0097] The following will be described in conjunction with Figures 2 to 4 Another more detailed embodiment is described to further understand the method provided by the embodiments of the present application. This embodiment is also described with a computing device as the execution subject.

[0098] Referring to Figure 2 , the flow architecture of the computing device processing the dense target image is as shown in Figure 2 , the macro block sequence and the micro block sequence are extracted from the dense target image respectively, then the macro block sequence is input into the global module to obtain the global feature, and the micro block sequence is input into the local module to obtain the local feature; then the global feature and the local feature are input into the fusion module to obtain the comprehensive feature; finally, the comprehensive feature is input into the detection module, so that the detection module can use the comprehensive feature to detect the dense target in the dense target image of the corresponding type.

[0099] It can be understood that the above-mentioned modules are software modules.

[0100] Referring to Figure 3 , after obtaining the dense target image, the computing device generates a comprehensive super pixel map as the comprehensive feature based on the dense target image, and the flow is as shown in Figure 3 .

[0101] Firstly, the computing device performs adaptive histogram equalization on the dense target image to eliminate the interference of reflection. Then, CLAHE enhancement and gamma correction are performed on the image after eliminating the interference of reflection.

[0102] Then, the computing device can simultaneously or separately execute the processing flow of the global path and the local path.

[0103] In the global path, the dense target image is input into the CNN encoder and the super pixel segmentation module (improved SLIC algorithm + Mamba encoding) simultaneously to form double-path feature extraction:

[0104] 1) CNN encoder branch:

[0105] Input to the CNN encoder: original image without downsampling, obtain low-level spatial features output by the CNN encoder Encode edges, textures and other details (such as the frame of the electric meter, the screw hole position).

[0106] 2) Mamba encoder branch:

[0107] The computing device first down-samples the dense target image to a resolution of 512x512 to reduce computational load and preserve global structure; then runs an improved SLIC algorithm on the down-sampled image to generate a sequence of macroblocks covering 32x32 pixels, each macroblock serving as a global semantic unit to encode the scene layout (such as the row-column distribution of electric meters, meter box structure).

[0108] Then, the long-range dependency is modeled by the global Mamba encoder, specifically, a lightweight global Mamba encoder is used to process the macroblock sequence to obtain global semantic features Encode the scene layout priori.

[0109] 3) Feature fusion:

[0110] Concatenate: concatenate F CNN and F gme along the channel dimension to generate the fused feature F concat The calculation formula is:

[0111]

[0112] After concatenation, reduce the dimension to 256 channels through 1x1 convolution to reduce the computational load.

[0113] Specifically, the decoder adopts a U-Net architecture, which fuses multi-level features through skip connections to gradually restore the resolution:

[0114] a. Up-sampling and skip connection:

[0115] Each layer of the decoder contains a transposed convolution (Transposed Conv, kernel 3x3, stride 2) and a skip connection, and the calculation formula is:

[0116] The skip connection concatenates the feature of the dth layer of the encoder with the up-sampled result of the d+1th layer of the decoder.

[0117] b. Feature refinement:

[0118] Each layer is refined by convolution to gradually restore the original resolution, with deep layers processing semantic information (feature map size 128x128) and shallow layers restoring details (feature map size 512x512).

[0119] Each layer of convolution calculation applies convolution (Convolution), batch normalization (Batch Normalization), and Leaky ReLU activation function in turn, which can effectively improve the training speed, stability, and expression ability of the model.

[0120] c. The output of step b is passed through 1x1 convolution and Sigmoid activation to generate a binary global superpixel boundary map Mglobal ∈{0,1} H×W where 1 is the superpixel boundary pixel and 0 is the non-boundary pixel.

[0121] In the local path, the dense target image is first divided into four quadrant subgraphs by four-quadrant segmentation, and a microblock sequence is generated for each quadrant subgraph through a sliding window (step size 16 pixels). After feature extraction by the CNN encoder, the features are input into the bidirectional GRU:

[0122] 1) Forward GRU propagation (time sequence processing).

[0123] The calculation formula of the update gate is: The calculation formula of the reset gate is: The calculation formula of the candidate state is: The calculation formula of the hidden state update is:

[0124] 2) Reverse GRU propagation (time sequence reverse processing).

[0125]

[0126] Bidirectional feature fusion:

[0127] where x t is the CNN encoded feature of the t-th microblock; is the hidden state of the forward GRU at time t; is the hidden state of the reverse GRU at time t; is the learnable parameter matrix of the bidirectional GRU, is the bias matrix of the bidirectional GRU; ⊙: Hadamard product (element-wise multiplication); σ(·): Sigmoid activation function.

[0128] Then, the bidirectional fusion features of the four quadrant subgraphs are restored to the resolution by the decoder and spliced into a complete local feature map.

[0129] The boundary-sensitive loss function is introduced by the computing device in the decoding stage:

[0130]

[0131] where, is the boundary alignment term; is the boundary probability map predicted by the model (the probability of each pixel belonging to the target boundary); M gt (p) is the artificially labeled binary boundary mask (true label); is the smoothing regular term; ε is the set of superpixel boundary pixels; is the total variation regular term; λ = 0.1 is the regularization coefficient.

[0132] The fusion module aims to effectively combine global and local features, enabling the model to capture large-scale context information and fine-grained spatial cues simultaneously, both of which are crucial for accurate meter detection in dense environments; specifically, the global and local feature maps, which have been resized to the same spatial resolution, are first connected along the channel dimension. This connected feature tensor is then passed through a 1x1 convolution to reduce the dimensionality and facilitate feature interaction.

[0133] Figure 4 The circuit structure of the fusion module in the present application shows the dynamic fusion process of global and local features. This module realizes cross-modal feature calibration through multiple signal processing units and is the core component for improving the accuracy of dense target detection. The specific structure includes the following parts:

[0134] (1) Input interface and signal preprocessing unit (corresponding to Figure 4 Left input)

[0135] Hardware description: contains 2 sets of LVDS high-speed interface, used to receive global features (macroblock segmentation information) from the global module and local features (microblock sequence details) from the local module.

[0136] Global feature channel (corresponding to Figure 3 Global feature input) is used to perform 16-bit floating-point to fixed-point operation (FP16->INT16) to eliminate quantization noise caused by downsampling.

[0137] Local feature channel (corresponding to Figure 3 Local feature input) is used to adopt dynamic range compression circuit (DRC) to realize feature amplitude normalization through 8-stage shift register.

[0138] The signal preprocessing unit standardizes the global and local features, eliminating the scale difference of output features from different modules.

[0139] The feature mean and variance are automatically calculated by the hardware circuit to adjust the input signal to a unified dynamic range, ensuring the stability of subsequent fusion.

[0140] (2) Cross-modal feature calibration unit (corresponding to Figure 4 Multiplexer in

[0141] The cross-modal feature calibration unit contains a channel attention gate circuit composed of 4 parallel digital signal processing (DSP) modules, each of which includes:

[0142] Feature stitching circuit for completing 128-channel stitching of global / local features; convolution compression unit, dedicated 1x1 convolution IP core (clock frequency 200MHz, throughput 1.2GOP / s); Sigmoid generator, a nonlinear mapping circuit based on a lookup table (LUT), storing 256-order S-shaped curve parameters.

[0143] The cross-modal feature calibration unit further comprises a deformable convolution compensation unit, which comprises:

[0144] The offset calculation circuit is composed of a superpixel similarity matrix generator (SSMG) and a coordinate weighter; the SSMG module integrates a 32KB SRAM for storing superpixel similarity parameters, and realizes parallel reading and writing through a dual-port RAM; the deformation compensation executor comprises 16 configurable convolution kernels (supporting 3x3 / 5x5 dynamic switching), and the offset compensation precision reaches 0.1 pixels.

[0145] The deformable convolution compensation unit is used to correct the offset error of the superpixel boundary and the real meter outline. The implementation process is as follows:

[0146] Based on the superpixel similarity matrix, the sampling position offset of each convolution kernel is calculated; the sampling points of the convolution kernel are dynamically adjusted through a programmable logic unit, so that they are offset to the direction of the real meter boundary; convolution operation is performed on the offset feature map to enhance the boundary alignment accuracy.

[0147] The offset is calculated as follows: where w mn is the weight of the mth superpixel for the nth convolution kernel, generated by the superpixel similarity matrix, and (x m ,y m ) is the superpixel center coordinate.

[0148] This can solve the geometric deformation problem of traditional convolution in inclined meters and dense arrangement scenes, and improve the target positioning accuracy.

[0149] The coordinate weighter uses an 8-way fixed-point multiplier accumulator, which is completed in a single cycle.

[0150] The channel attention gate circuit can dynamically allocate the fusion weight of global and local features to suppress the interference of reflected light noise. The implementation process is as follows:

[0151] The global and local features are concatenated along the channel dimension to form a mixed feature tensor; the channel number is compressed through a 1x1 convolution kernel to extract cross-modal correlation information; a spatial attention mask is generated using a Sigmoid function, which assigns a weight value between 0 and 1 to each pixel; the global and local features are weighted and fused according to the weight value, and the calibrated feature map is output.

[0152] This can make the model automatically reduce the weight of global semantic features in the reflection area, prefer to rely on local detail features, and reduce the false alarm rate.

[0153] (3) Nonlinear enhancement and output unit (corresponding to LELU activation circuit in Figure 4 ):

[0154] LELU activation unit is used to enhance the response strength of high-frequency texture features (such as electric meter digits, metal scratches). The implementation process is as follows:

[0155] Perform lightweight enhanced linear activation (LELU) on the fused feature map; through piecewise linear approximation and sinusoidal oscillation term, strengthen the expression of high-frequency signals such as edges and corners.

[0156] In this way, the response strength of the electric meter character area can be improved by about 40% under low light conditions, supporting dark environment detection.

[0157] In order to further enhance the representation ability of the fused features, the present embodiment provides an activation function LELU, which is inspired by the lightweight and stable nonlinear modeling in SSMpa. The formula of the LELU function is extended as follows:

[0158]

[0159] τ is the input feature tensor, β = 0.05 is the oscillation enhancement coefficient, which is used to enhance the response of high-frequency features.

[0160] The LELU activation circuit includes a piecewise function circuit, which comprises:

[0161] A linear region is used to implement analog calculation of τ·ln(1+eτ) using a differential amplifier when |τ|<2; a saturation region is used to switch to an oscillation enhancement path through a comparator when |τ|≥2.

[0162] The LELU activation circuit further comprises a high-frequency enhancement module, which integrates a digital controlled oscillator to generate a sin(πτ) oscillation signal (frequency response range 10MHz-200MHz).

[0163] The LELU activation circuit further comprises a multi-scale skip connection circuit, which includes a resolution alignment module, wherein there is a bilinear interpolation dedicated circuit (including a 4-line buffer and a weighting calculation unit) for up-sampling the global features, and a maximum pooling circuit (window size 2x2, step 2) for down-sampling the local features. The LELU activation circuit further comprises a feature fusion executor, which integrates a 3x3 convolution kernel array (supporting dynamic weight loading).

[0164] The multi-scale skip connection circuit is used to fuse feature maps of different levels, taking into account global semantics and local details. The implementation process is as follows:

[0165] The high-level global feature (low resolution, strong semantics) is spliced with the low-level local feature (high resolution, strong details).

[0166] The resolution is aligned by the bilinear up-sampling circuit, and then the fusion result is refined by a 3x3 convolution kernel.

[0167] In the decoding stage, the Cross-Level Skip Connection (CLSC) strategy is adopted to fuse the global feature of the high level (low resolution, strong semantics) with the local feature of the low level (high resolution, strong details). For example, the global feature of the d+1th layer of the decoder is up-sampled and spliced with the local feature of the dth layer, and then refined by convolution. Its function is to retain multi-scale information, avoid loss of details caused by down-sampling / up-sampling, and enhance the target boundary alignment capability. The formula is:

[0168]

[0169] where d represents the decoder level (d=1 for the highest resolution), and Up is the bilinear up-sampling.

[0170] Each layer of the decoder restores the resolution step by step through transposed convolution and skip connection, and finally outputs the comprehensive superpixel boundary map M global .

[0171] This can solve the level misplacement problem of traditional pyramid network (FPN) in dense targets and reduce small target missed detection.

[0172] The application of LELU activation function is to apply LELU activation function uniformly after feature splicing and dimension reduction, rather than processing global / local features separately. LELU activation function acts on the fusion tensor after splicing of global and local features, enhancing the overall expression ability.

[0173] Skip connection and LELU belong to different stages in the feature fusion process, and their interaction is as follows:

[0174] First, adjust the global feature and local feature to the same resolution and splice along the channel dimension; then reduce the dimension through 1x1 convolution and apply LELU activation function; in the decoding stage, features of different levels are fused through the CLSC strategy (such as high-level global feature and low-level local feature).

[0175] Skip connection solves the problem of "information integrity in feature transmission", ensuring the complementarity of global semantics and local details.

[0176] LELU solves the problem of "expression ability of fused features", which enhances high-frequency signals (such as boundaries and reflective areas) through nonlinearity.

[0177] Exemplary, Figure 4 The impedance matching network Z = 50 Ω @ 100 MHz in the example is shown in FIG. 6, and the timing control accuracy is ± 5 ns.

[0178] After obtaining the comprehensive features, the comprehensive features are subjected to batch normalization operation through a balanced filter group, and then the batch normalized comprehensive features are output through a radio frequency switch ADG5412.

[0179] The above describes the method provided by the embodiments of the application, and the following describes the engineering optimization strategy of the method and system provided by the embodiments of the application.

[0180] The method model provided by the embodiments of the application can adopt mixed precision quantization (FP16+INT8), and the convolution layer of the fusion module is subjected to 8-bit linear quantization:

[0181]

[0182] Quantization error compensation control is ΔmAP≤0.3%.

[0183] Wherein, W refers to the convolution layer weight matrix before quantization; W q is the weight matrix after quantization; s is a scaling factor; z is a zero point offset; by merging the convolution calculation, batch normalization and LELU activation function calculation into a single calculation core, the inference speed is improved by 18%.

[0184] The embodiments of the application can generate metal surface reflection noise based on the Phong reflection model to generate training samples:

[0185]

[0186] Wherein, k a ,k d ,k s is the ambient / diffuse / specular reflection coefficient, Normal / light / source / view unit vector, α = 200 is the highlight index, i a , i l , are the ambient light intensity, the intensity of the lth light source, the reflection direction unit vector and the observation direction unit vector, respectively.

[0187] In order to evaluate the effectiveness of the proposed method, the applicant conducted experiments on a dense meter image dataset collected by himself, and the images mainly come from old residential areas with irregular installation layout.

[0188] The model is trained using the YOLOv8 detection framework, the learning rate is 0.001, the batch size is 16, and the Adam optimizer is used.

[0189] Table 1 below gives a qualitative evaluation of different superpixel segmentation methods, including SLIC, SEEDS, SSMamba, and our proposed strategy. Compared with traditional methods such as SLIC and SEEDS, our method achieves excellent results in terms of achievable segmentation accuracy (ASA) and boundary precision recall (BR-BP), indicating better alignment with real object boundaries in dense layouts. Although SSMpa also utilizes structured superpixels and exhibits strong boundary adhesion, our method further reduces under-segmentation error (UE) while improving compactness (CO), indicating a more effective balance between region uniformity and shape regularity.

[0190] These advantages directly contribute to more discriminative spatial representations, which are crucial for downstream detection tasks.

[0191] Table 1 Qualitative evaluation of superpixel segmentation performance in different methods

[0192] Algorithm ASA↑ BR-BP↑ UE↓ CO↑ SLIC 0.842 0.791 0.136 0.607 SEEDS 0.816 0.768 0.157 0.581 SSMamba 0.846 0.813 0.122 0.621 The present application 0.872 0.826 0.109 0.633

[0193] Table 2 below compares the detection performance under several settings: baseline YOLOv8, YOLOv9 enhanced by SLIC preprocessing, SSMamba integrated detection, and our full superpixel-guided feature fusion framework. Although SSMamba provides a significant improvement over the baseline by introducing structure-aware segmentation cues, our method outperforms it in terms of mAP@0.5 and mAP@0.5:0.95.

[0194] These improvements are particularly evident at higher IoT thresholds, demonstrating the superiority of our model in precise localization under dense and overlapping meter layouts.

[0195] This indicates that, in our framework, the hierarchical integration of global and local features provides a more refined and contextually aware representation than the transformer-centric design of SSMamba, especially for tasks with strict spatial constraints.

[0196] Table 2 Comparison of detection accuracy (MAP) on the Dense Meter dataset

[0197] Algorithm mAP@0.5↓ mAP@0.5:0.95↑ YOLOv8 (baseline) 0.91 0.646 YOLOv8 + SLIC 0.912 0.659 YOLOv8 + SSMamba 0.922 0.676 The present application 0.935 0.685

[0198] Our application first proposes a macro-micro dual-path superpixel generation mechanism. The global path captures scene layout priors through improved SLIC and Mamba encoders, while the local path enhances boundary continuity using GRU sequence modeling.

[0199] The core of the global path is to generate macro blocks through the dynamically adjusted SLIC algorithm to capture the global layout prior of the scene. Compared with the traditional SLIC, the improvement lies in the dynamic adjustment of the compactness factor: uniform superpixels are generated at the initial stage of training (t→0); with the iteration of training, the IoU is dynamically adjusted, and when the IoU is improved, m_t is increased to generate more compact superpixels. The dynamic adjustment formula of the compactness factor (formula m_t) is proposed to make the superpixel shape adaptively match the spatial distribution of the ammeter. The process is as follows:

[0200] The dynamic compactness factor m_t uses a fixed m_0=10 to generate uniform superpixels at the initial stage (t=0). With the increase of training iteration t, the IoU_t of the verification set is dynamically adjusted:

[0201] IoU rises→ln(IoU_t) is positive→m_t increases→superpixels are more compact;

[0202] IoU decreases→ln(IoU_t) is negative→m_t decreases→adapt to complex shape;

[0203] Finally, the superpixel shape adaptively matches the spatial distribution density of the ammeter. Adapt to the dense layout of the ammeter.

[0204] The macro block sequence is input into the lightweight global Mamba encoder, which models long-range dependencies through a state space model (SSM). The advantage is that the Mamba encoder processes the macro block sequence with linear complexity O(N), capturing cross-regional semantic associations (such as ammeter arrangement rules, meter box structure), forming scene layout prior knowledge.

[0205] Global-local collaborative mechanism:

[0206] Cross-level feature fusion (CLSC): global and local features are fused through cross-level jump connection. The technical advantage is that the global guides the local, and the scene layout prior (such as the number of rows and columns of ammeters) generated by the Mamba encoding constrains the boundary generation of the local GRU, avoiding over-segmentation. The local corrects the global, and the fine boundary captured by the GRU is fed back to the global feature to correct the small targets (such as inclined ammeters) that may be missed by SLIC.

[0207] Cross-modal feature fusion mechanism:

[0208] The LELU activation function is designed to realize the nonlinear calibration of superpixel features and RGB features. In low-light areas, the feature response intensity is improved by 40%. The LELU activation function acts on the fused feature ([F RGB ||F SP ] splicing result).

[0209] Among them, the RGB feature comes from the original image encoded by CNN (F RGB), superpixel features (F SP ) Output fusion from global path and local path.

[0210] The C2f module of the YOLOv8 detector embeds spatial attention gating, which can effectively suppress false alarms in reflective areas (false alarm rate reduced by 22%).

[0211] Edge computing optimization system:

[0212] A hybrid precision quantization strategy is proposed to maintain model sensitivity at INT8 precision, and a quantization error compensation algorithm makes the mAP loss ≤0.3%; a lightweight deployment scheme is implemented, and the model parameter quantity is compressed to 4.8M, meeting the strict resource constraints of power Internet of Things devices.

[0213] The following is the hardware deployment scheme of the embodiment of the present application:

[0214] The edge computing terminal is NVIDIA Jetson Xavier NX, which includes an OV5647 camera module;

[0215] The light compensation module includes 6 groups of 850nm infrared fill light, and the brightness self-adaptive adjustment formula is: k=0.05, S hist is the image gray histogram entropy value, L ir is adjusted, and the brightness of the infrared fill light (0-255 level) is adjusted according to the image gray histogram entropy value S hist is adjusted, S hist is high (high image complexity) to enhance the light compensation, S hist is low (simple image) to reduce the light compensation intensity.

[0216] The following is the software implementation details of the embodiment of the present application:

[0217] Superpixel optimization is implemented in C++, which improves SLIC and interacts with PyTorch through a Cython interface;

[0218] INT8 quantization is performed on the global module and the local module, and the precision loss is <0.8%;

[0219] Real-time post-processing: a non-maximum suppression improvement algorithm is used to solve the problem of false suppression of overlapping prediction boxes in dense target detection:

[0220]

[0221] The temperature coefficient τ=0.7 controls the strictness of suppression (the greater the value, the more relaxed the suppression), b i , b j are two candidate detection boxes, and IoU(b i ,bj The intersection-union ratio (IoU) of two boxes. The improved non-maximum suppression algorithm reduces the confidence of overlapping boxes by weighted decay (rather than direct deletion): if the two boxes have a high IoU (possibly belonging to the same target), the confidence of the lower-scoring box is significantly reduced; if the IoU is low (possibly adjacent targets), the confidence is slightly adjusted.

[0222] The following are the parameter optimization strategies in the embodiments of this application:

[0223] The initial learning rate is 0.001, and a cosine annealing strategy is used.

[0224] Loss function:

[0225]

[0226] in, For edge-sensitive loss, ε is the set of superpixel boundary pixels; To detect mission losses, For semantic segmentation task loss, This represents the total loss.

[0227] Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of a dense meter character recognition system provided in an embodiment of this application, as shown below. Figure 5 As shown, the system 50 includes:

[0228] Acquisition module 501 is used to acquire dense target images;

[0229] The generation module 502 is used to generate macroblock sequences and microblock sequences based on the dense target image;

[0230] Global module 503 is used to fuse global semantic features and global detail features through skip connections to obtain global features;

[0231] The global semantic feature is obtained based on the macroblock sequence, and the global detail feature is obtained based on the dense target image;

[0232] Local module 504 is used to process the micro-block sequence through a bidirectional gated recurrent unit (GRU) model to obtain the local features of the dense target image;

[0233] The fusion module 505 is used to fuse the global feature and the local feature to obtain the comprehensive feature;

[0234] The detection module 506 is used to detect dense targets in the dense target image based on the comprehensive features using the YOLOv8 detector.

[0235] The dense target detection system provided by the embodiments of the present application can be understood with reference to the corresponding content of the method embodiment part described above, which will not be repeated here.

[0236] As shown in Figure 6 , Figure 6 is a possible logical structure diagram of the computing device provided by the embodiments of the present application. The computing device 60 includes a processor 601, a communication interface 602, a memory 603, and a bus 604, and the processor 601, the communication interface 602, and the memory 603 are connected to each other through the bus 604. In the embodiments of the present application, the processor 601 is configured to control and manage the actions of the computing device 60, for example, the processor 601 is configured to execute Figure 1 or Figure 3 any embodiment of the steps and / or other processes for the technology described herein. The communication interface 602 is configured to support the communication of the computing device 60. The memory 603 is configured to store the program code and data of the computing device 60.

[0237] The processor 601 can be a central processing unit, a general processor, a digital signal processor, an application specific integrated circuit, a field programmable gate array, or other programmable logic device, a transistor logic device, a hardware component, or any combination thereof. It can implement or execute various exemplary logical blocks, modules, and circuits described in combination with the disclosure. The processor can also be a combination of computing functions, such as one or more microprocessor combinations, combinations of digital signal processors and microprocessors, and the like. The bus 604 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 only one thick line is used in the figure, but it does not mean that there is only one bus or only one type of bus.

[0238] In another embodiment of the present application, a computer readable storage medium is also provided, which includes instructions, when the instructions are run on a computer, the computer executes the method described in any embodiment of the above Figure 1 or Figure 3 any embodiment.

[0239] Those skilled in the art can clearly understand that the units of the examples described in combination with the embodiments disclosed herein can be realized in electronic hardware, computer software or a combination of both. In order to clearly illustrate the interchangeability of hardware and software, the components of the examples have been described in the above description in general terms. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0240] Those skilled in the art can clearly understand that, for the convenience and brevity of the description, the specific working processes of the above-described system, device and unit can refer to the corresponding processes in the foregoing method embodiments, which will not be repeated here.

[0241] In several embodiments provided by the embodiments of the present application, it should be understood that the disclosed system, device and method can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division, and actual implementation can have another division manner. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interface, device or unit, and can be electrical, mechanical or other forms.

[0242] The units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, i.e. they can be located in one place, or can be distributed on a plurality of network units. Some or all of the units can be selected based on actual needs to achieve the purpose of the embodiments.

[0243] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically, or two or more units can be integrated into one unit. The integrated unit can be realized in the form of hardware or software functional unit.

[0244] If the functions are realized in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application or all or part of the technical solutions that essentially contribute to the prior art can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store program codes.

[0245] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application, and they should be covered in the scope of the claims and description of the present application.

Claims

1. A method for detecting dense targets, characterized in that, The method includes: Acquire dense target images; Based on the dense target image, macroblock sequences and microblock sequences are generated; The global features of the dense target image are obtained by fusing global semantic features and global detail features through skip connections; the global semantic features are obtained based on the macroblock sequence, and the global detail features are obtained based on the dense target image. The micro-block sequence is processed by a bidirectional gated recurrent unit (GRU) model to obtain local features of the dense target image; By fusing the global features and the local features, a comprehensive feature is obtained; Dense targets in the dense target image are detected using the YOLOv8 detector based on the comprehensive features.

2. The method according to claim 1, characterized in that, The step of generating macroblock sequences and microblock sequences based on the dense target image includes: The macroblock sequence is generated based on the downsampled image of the dense target image by improving the Simple Linear Iterative Clustering (SLIC) algorithm. The dense target image is divided into four quadrants to obtain four quadrant sub-images; The micro-block sequence is generated by performing non-overlapping sliding sampling on the four quadrant subgraphs using a sliding window.

3. The method according to claim 2, characterized in that, The dynamic adjustment formula for the compactness factor of the improved SLIC algorithm includes: Where m0 is the initial compactness factor, t is the current training iteration number, and m t The compactness factor is the current iteration number, where T is the total number of iterations, and IoU is the total number of iterations. t This represents the average intersection-union ratio of the current validation set.

4. The method according to any one of claims 1-3, characterized in that, The process of processing the micro-block sequence using a bidirectional gated recurrent unit (GRU) model to obtain local features of the dense target image includes: Features of the micro-patch sequence are extracted using a preset CNN encoder; The features of the micro-block sequence are input into the bidirectional GRU model to obtain the local features output by the bidirectional GRU model; The hidden state fusion formula of the bidirectional GRU model is as follows: Let t be the hidden state of the forward GRU at time t. H represents the hidden state of the reverse GRU at time t. t These are local features.

5. The method according to any one of claims 1-3, characterized in that, Before fusing global semantic features and global detail features through skip connections to obtain the global features of the dense target image, the method further includes: The global detail features are obtained by extracting features from the dense target image using a preset CNN encoder. The macroblock sequence is processed by a Mamba encoder to obtain the global semantic features; the calculation formula for the global semantic features includes: h t =Ah t-1 +Bx t 4 y t =Ch t +Dx t ; Among them, h t Let x be the hidden state at time step t; t y is the feature input of the t-th macroblock corresponding to time step t. t A represents the global semantic features output at time step t, A is the state transition matrix, and B, C, and D are learnable parameter matrices.

6. The method according to any one of claims 1-3, characterized in that, The fusion of the global features and the local features to obtain the comprehensive features includes: The global features and the local features are weighted and fused using an attention gating mechanism to obtain fused features. Deformable convolution is used to perform offset compensation on the fused features to obtain the first intermediate feature; The second intermediate feature is obtained by activating the first intermediate feature using the LELU activation function; The second intermediate feature is decoded using a cross-level skip connection strategy to obtain the comprehensive feature; wherein, the cross-level skip connection strategy is used to perform cross-level fusion of low-level features and high-level features in the second intermediate feature.

7. The method according to any one of claims 1-3, characterized in that, The integrated feature is a comprehensive superpixel boundary map; the dynamic anchor box size adjustment formula of the YOLOv8 detector includes: Among them, D anchor For dynamic anchor frame dimensions, N sp σ represents the number of superpixels within the region of interest (ROI). I Let A be the illumination variance of the region of interest. ROI I represents the area of ​​the region of interest. avg The average illumination intensity of the region of interest.

8. A dense target detection system, characterized in that, The system includes: The acquisition module is used to acquire dense target images; The generation module is used to generate macroblock sequences and microblock sequences based on the dense target image; A global module is used to fuse global semantic features and global detail features through skip connections to obtain global features; the global semantic features are obtained based on the macroblock sequence, and the global detail features are obtained based on the dense target image; A local module is used to process the micro-block sequence through a bidirectional gated recurrent unit (GRU) model to obtain local features of the dense target image; The fusion module is used to fuse the global features and the local features to obtain comprehensive features; The detection module is used to detect dense targets in the dense target image based on the comprehensive features using a YOLOv8 detector.

9. A computing device, characterized in that, The computing device includes a memory and a processor; The memory and the processor are coupled; The memory is used to store computer program instructions; The processor is configured to invoke the computer program instructions to perform the method as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions; wherein, when the computer-executable instructions are executed by a processor, the method described in any one of claims 1-7 is implemented.