Lightweight target detection method

Through a lightweight target detection method with multi-scale preprocessing, dynamic resolution and channel resource adjustment, the problem of limited resources on edge devices is solved, and efficient and accurate target detection is achieved in different scenarios.

CN120807955AActive Publication Date: 2025-10-17贵州省通信产业服务有限公司
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202511316767.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-16
Publication Date
2025-10-17
Estimated Expiration
2045-09-16

AI Technical Summary

Technical Problem

When deployed on edge devices, existing object detection frameworks face the problems of excessive video memory usage and computing resources. They are unable to dynamically adjust resolution and channel resources, resulting in redundant calculations or information loss in different scenarios.

Method used

It adopts multi-scale preprocessing, lightweight backbone network (ICAneck) and dynamic strategy selection logic, combined with dynamic resolution adjustment and channel resource allocation, realizes adaptive adjustment of feature maps through ratio-aware attention mechanism, establishes information interaction channel, introduces progressive ICAblock for feature extraction, and adopts end-to-end training strategy to optimize the model.

Benefits of technology

While maintaining its lightweight, the model improves its adaptability to different target scales and scenarios, reduces redundant calculations, and improves detection accuracy and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120807955A_ABST
    Figure CN120807955A_ABST
Patent Text Reader

Abstract

The invention discloses a lightweight target detection method, and particularly relates to the technical field of target detection, and the method comprises the steps: firstly carrying out the preprocessing of an input image, and extracting low-calculation-amount and rich-semantic features through parallel convolution branch; then, an ICANeck lightweight trunk is adopted, and semantics are extracted in combination with divisible convolution and coordinate attention; constructing a strategy selection model, and switching between a fixed resolution-channel strategy and a dynamic resolution-channel strategy according to the target scale, the definition and the small target density to realize fine regulation and control of the resolution and the number of channels; the Stage 2-4 is subjected to abstraction deepening by using a progressive ICAblock; in the fusion stage, a proportional attention and channel alignment module is introduced to integrate scale features, and a lightweight detection head outputs a category and a frame; and sparse regularization and multi-task loss combined training is adopted, so that calculation and video memory overhead can be reduced, small target precision can be ensured, and edge real-time deployment can be adapted.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of target detection, and more particularly, to a lightweight target detection method. BACKGROUND

[0002] As a core task in the field of computer vision, target detection has been widely applied in scenarios such as autonomous driving, intelligent security, and industrial quality inspection. However, existing mainstream detection frameworks (such as Faster R-CNN, YOLOv5, RetinaNet, etc.) usually rely on fixed network depth and channel configuration, and follow the static scaling rule of "halving resolution and doubling channels each time". Although this design can achieve high accuracy on high-performance GPUs, it faces the following prominent problems when deployed on edge devices with limited computing power (such as Jetson Xavier NX, RK3588, or mobile NPU).

[0003] Fixed doubling channels cause the feature map to rapidly expand at the deep layer, resulting in exponential growth of memory usage and multiply-add operations, which is not conducive to real-time inference and low-power scenarios. Static down-sampling ratios cannot be dynamically adjusted according to image clarity, target size distribution, and small target density, leading to redundant calculations for large-sized targets or low-complexity images, while information loss may occur in small target dense or detail-rich scenarios. The fixed channel doubling strategy is resource-limited on high-resolution paths, which may lead to excessive compression of small target features and reduce detection recall rate.

[0004] To alleviate the above problems, lightweight models such as MobileNetV3, ShuffleNetV2, and GhostNet are proposed to reduce parameter quantity through depthwise separable convolution, channel compression, and feature reuse. However, these models are still based on the static resolution and channel allocation framework, making it difficult to simultaneously meet the dynamic needs of accuracy and efficiency in different scenarios. Therefore, developing a lightweight target detection method with dynamic resolution adjustment and adaptive channel resource scheduling capability has become a key technical demand in the current edge intelligence field. SUMMARY

[0005] To overcome the above-mentioned defects of the prior art, embodiments of the present application provide a lightweight target detection method to solve the problems raised in the background art.

[0006] To achieve the above-mentioned purpose, the present application provides the following technical solutions: A lightweight target detection method, comprising the following steps: Step S1: performing multi-scale preprocessing on the input image, extracting different receptive field information and fusing it into a first base semantic feature map; Step S2: input the first base semantic feature map into a lightweight main body ICAneck, which is composed of four levels of serial modules, each of which sequentially performs 1×1 channel compression, depth separable convolution, and coordinate attention, and adopts residual connection when the input and output sizes are consistent; Step S3: based on the target scale characteristics, image clarity, and small target density, a strategy selection logic model is constructed: when the determination results of the three indicators and the preset thresholds A1, A2, and A3 are determined, the following four combination strategies are adaptively switched: “fixed resolution halving strategy + channel doubling strategy”, “fixed resolution halving strategy + dynamic channel allocation strategy”, “dynamic resolution adjustment strategy + channel doubling strategy”, and “dynamic resolution adjustment strategy + dynamic channel allocation strategy”; under the determined combination strategy, the ICAneck output is split into three scale paths, and the downsampling ratio factor of each path is calculated by weighting the average size of the target of interest in the i-th path, the complexity of the current image, the prior of the attention intensity of the current task to small targets, and the acceptable computing load index of the current platform; at the same time, a channel allocation model is constructed, which combines the spatial density, the global channel resource budget, and the importance weight of each branch task to calculate the number of channels obtained by each branch; A bidirectional information interaction channel is established between the high and low resolution paths, the high semantic features are fed back to the high resolution path through upsampling and alignment, and the low semantic features are downsampled by step 2 convolution to compensate for the low resolution path, and ratio perception attention is introduced in the interaction process to weight the key channels; Step S4: respectively input the three paths into the second to fourth stages for progressive ICAblock feature extraction, each ICAblock is composed of depth separable convolution, inverted residual, and CoordAttention, and the channel compression rate a and expansion ratio are adaptively adjusted according to the path channel base; Step S5: perform channel alignment and layer-by-layer upsampling on the multi-scale feature maps output by the first to fourth stages, fuse them into a unified semantic feature map, and predict the target class and bounding box through the lightweight detection head; Step S6: adopt an end-to-end joint training strategy, combine the IoU-aware bounding box loss and cross-entropy classification loss, and introduce sparse regularization, compression rate self-regulation, and diversified data enhancement in training.

[0007] In a preferred embodiment, the multi-scale preprocessing in step S1 is performed by concatenating the branch outputs in the channel dimension and then performing 1×1 convolution compression.

[0008] In a preferred embodiment, the target scale property is determined by a maximum / minimum target area ratio, the image clarity is determined by Laplacian variance, and the small target density is determined by small target number ratio.

[0009] In a preferred embodiment, the down-sampling scale factor of each path is calculated as follows: ; wherein represents the average size of the target mainly focused on by the i-th path; C represents the complexity of the current image; represents the prior of the attention intensity of the current task to small targets; represents the acceptable computing load index of the current platform; represents the reference target size; is used to adjust the influence weight of each factor, and is set as needed.

[0010] In a preferred embodiment, the spatial density is the ratio between the spatial size of the feature map and the reference channel number at a scale.

[0011] In a preferred embodiment, the ratio-aware attention is generated by applying global average pooling to each feature map, then generating a channel weight vector through two layers of multi-layer perceptron, and then element-wise multiplying the original feature map.

[0012] In a preferred embodiment, the end-to-end training strategy in step S6 applies L1 or Group Lasso penalty to the dynamic path channel weight in structure regularization.

[0013] Technical effects and advantages of the present application: The present application makes deep improvements in structure mechanism and training strategy compared with existing benchmark detection frameworks (such as YOLOv5-S, Faster RCNN, etc.), and thus achieves the following comprehensive technical effects and significant advantages: first, through the hierarchical architecture of “multi-scale preprocessing ➔ ICAneck ➔ strategy selection logic ➔ dynamic path ➔ progressive ICAblock ➔ lightweight detection head”, the present application can adaptively adjust the resolution and channel number of the feature map according to the target scale, image clarity and small target density while maintaining end-to-end coherence, and significantly suppresses redundant computation.

[0014] The present application introduces a dynamic resolution generation mechanism and a channel resource adaptive allocation strategy, and combines a ratio-aware attention mechanism to establish an information interaction and fusion path between multiple scale paths, thereby realizing precise modeling of small targets and weak structure targets in a lightweight structure.

[0015] In the initial preprocessing module of the model, multi-scale feature fusion is adopted and a multi-scale preprocessing module is proposed to enhance the feature extraction capability of the model in the early stage.

[0016] Lightweight depth convolution is used to replace the standard 3×3 convolution, and the inverted residual module is integrated into the basic module. By adjusting the scaling factor, the number of model parameters and computational complexity are reduced while ensuring the performance of the network model, achieving the level of a lightweight network.

[0017] By introducing the CoordAttention module and integrating it into the ICAneck and ICAblock basic modules, while ensuring the acquisition of feature map channel feature information, the precise positioning of key points in the spatial direction is enhanced, useless features are suppressed, and the spatial resolution loss caused by upsampling is further reduced, thereby improving the performance of the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to facilitate understanding by those skilled in the art, the present invention will be further described below with reference to the accompanying drawings; Figure 1 A schematic diagram of a lightweight target detection method of the present invention; Figure 2 Schematic diagram of the ICAneck module and ICAblock module framework of the present invention; Figure 3 It is a structural diagram of the target detection framework diagram of the present invention. DETAILED DESCRIPTION

[0019] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0020] Example 1: A lightweight target detection method of the present invention, the flow chart is as follows Figure 1 As shown, the following steps are included: Step S1: Input and multi-scale preprocessing First, the original input image The spatial compression and channel enhancement of the original image provide a low-computation, high-information-density initial expression for subsequent feature extraction. The original image is spatially downsampled using a convolution or maximum pooling operation with a step size of 2, and the size is compressed to a quarter of the original image, that is, the size is obtained. Low-resolution feature map of H represents the height (number of rows) of the feature map, and W represents the width (number of columns) of the feature map. This process not only reduces the subsequent computational load, but also has a certain smoothing anti-interference effect, which helps to reduce the interference of texture noise on the extraction of features by the backbone network.

[0021] In order to extract more rich low-level semantics such as edges, textures and local structures from RGB three-channel images, a 3x3 convolution operation is further performed to increase the channel number of the feature map from 3 to the initial channel number , , to obtain the basic feature map . The convolution kernel of this convolution layer has a small receptive field (Receptive Field is a core concept in computer vision and neuroscience, which refers to the spatial range of input image or features of previous layer that a node or neuron in neural network can "see". Its essence is to describe the spatial mapping relationship between feature response and original input. In convolutional neural network, when each convolution kernel slides on the input image, the output of a pixel value is determined by the local region covered by it, which is the receptive field of the output position). It is specially designed to capture the local correlation between pixels, and can effectively enhance the non-linear expression ability with ReLU activation function, providing stable and semantic-rich input basis for subsequent modules.

[0022] Then a multi-path convolution structure is introduced to realize stronger multi-scale response ability. Specifically, multiple parallel convolution branches are designed, each branch uses different size of convolution kernel, such as 1x1, 3x3, 5x5, or uses atrous convolution to further expand the receptive field. These branches are calculated in parallel on the same input ( is the first "basic semantic feature map" obtained after the original image is preliminarily down-sampled and convolution encoded, which has moderate resolution and channel number, and has good structure starting expression ability, and is the shared input for all subsequent parallel paths and branch calculations), respectively capturing different scale region structures and texture information, thereby constructing multiple scale-sensitive intermediate feature maps. Then through weighted summation or channel-level splicing compression (such as Concat followed by 1x1 convolution) and other fusion strategies, the results of each branch are integrated into a unified structure of fusion feature map , which is used as the input of the subsequent Stage 1 ICAneck structure. The schematic diagram of ICAneck structure is shown in Figure 3 .

[0023] This step enhances the feature map's responsiveness to varying structural scales at a low computational cost, providing the model with a preliminary foundation for scale perception. Furthermore, the multi-branch parallel design effectively enhances the model's ability to preserve details and structural outlines at low resolutions, providing more discriminative raw semantic support for subsequent dynamic path branching and attention fusion. The entire S1 process not only compresses spatial dimensions but also enriches channel representation, serving as the first step towards lightweight and multi-scale collaboration.

[0024] Step S2: Stage 1—ICAneck feature extraction The fusion feature map output by step S1 This input is fed into the backbone feature extraction structure, ICAneck, to construct a lightweight and efficient primary semantic representation layer. The ICAneck module integrates an inverted residual structure, depthwise separable convolution, and a coordinate attention mechanism. This significantly reduces the number of parameters and computational complexity while maintaining information extraction capabilities, and is a key component of this method's lightweight design.

[0025] The ICAneck module consists of four modules stacked in series. Each module first performs channel compression via a 1×1 convolution. The compression ratio is controlled by the hyperparameter α (for example, α=0.25 means compression to one-quarter of the original channel size). This reduces the dimensionality of the intermediate channels and reduces subsequent computational overhead. The compressed feature maps are then subjected to a layer of depthwise separable convolution for spatial feature extraction. This convolution operation first independently extracts spatial information from each channel through a 3×3 channel-by-channel convolution, followed by cross-channel fusion through a 1×1 point-wise convolution. This ensures sufficient spatial modeling capabilities while significantly reducing the number of convolution kernel parameters and the number of multiply-add operations.

[0026] To further enhance the module's ability to focus on structural regions and the object itself, a CoordAttention mechanism is introduced after depthwise convolution. This mechanism performs global pooling of feature maps in the horizontal and vertical directions, forming two one-dimensional directional attention channels. This explicitly encodes the spatial position of the object and fuses it with the input features through attention weights, enhancing the representation of spatially sensitive areas such as edges, corners, and symmetrical structures. Compared to channel attention (e.g., SE) or spatial attention (e.g., CBAM), CoordAttention is more suitable for lightweight scenarios, offering low computational cost and high representation efficiency.

[0027] In terms of structural connectivity, each ICAneck module introduces an inverted residual connection: in the process of compression-convolution-attention-expansion, if the input and output sizes are the same, the input and output are directly added to form a skip connection, which helps maintain feature consistency and stable gradient flow during backpropagation, avoiding feature drift and degradation problems.

[0028] The final feature map outputted by the four ICAneck modules in series in the whole Stage 1 still maintains the spatial size , but its semantic hierarchy goes from shallow to deep, from original texture to intermediate structure information such as edge closeness, region consistency and local symmetry, etc., with good structure decoupling ability and semantic integrity. At the same time, since the change of channel dimension of each layer is controlled by a, the calculation resources and expression ability can be flexibly balanced by adjusting the value of a to meet different task requirements. The output as the basic semantic input will be used for the dynamic path branching construction and information interaction fusion in the subsequent step S3.

[0029] Step S3: Cross-scale information interaction and dynamic fusion First, a strategy selection logic model is constructed. To adapt to the feature distribution and deployment requirements of different target detection tasks, this model judges and selects the most suitable combination strategy from two dimensions: resolution adjustment strategy and channel number allocation strategy. The decision basis includes target scale characteristics, image clarity, and small target density.

[0030] Target scale characteristics measure the size of the size difference between targets in the image. If some targets are very small and some are particularly large, the scale difference is large; if all target sizes are similar, the difference is small. Randomly select 50-100 targets, calculate the ratio of the maximum target area to the minimum target area, and if the ratio of the maximum target area to the minimum target area is greater than threshold A1, the target scale characteristics is set to high, and if the ratio of the maximum target area to the minimum target area is less than threshold A1, the target scale characteristics is set to low. Threshold A1 is set as needed.

[0031] Image clarity measures whether the image is clear, including edge sharpness and texture richness. When the image is blurred, severely occluded, or low resolution, the clarity is low. Use Laplacian variance (image sharpness indicator, the larger the better) to calculate the variance of the image gray image using the Laplacian filter, and if the variance is greater than threshold A2, the image clarity is set to high, and if the variance is less than threshold A2, the image clarity is set to low. Threshold A2 is set as needed.

[0032] Small target density is the proportion of the number of small size targets in the image. If there are many small targets (such as pedestrians, faces, vehicles, etc.), and the task relies heavily on them, the density is high. First, define small targets, for example, less than 32x32 pixels, and count the proportion of small targets in the image (small target number divided by total target number). If the proportion of small targets in the image is greater than threshold A3, the small target density is set to high, and if the proportion of small targets in the image is less than threshold A3, the small target density is set to low. Threshold A3 is set as needed.

[0033] If the target scale property is low and the image definition is high, a fixed resolution halving strategy is adopted; otherwise, a dynamic resolution adjustment strategy is adopted. If the small target density is low, a channel doubling strategy is adopted; if the small target density is high, a dynamic channel allocation strategy is adopted.

[0034] Further, four different strategies appear, "fixed resolution halving strategy + channel doubling strategy", "fixed resolution halving strategy + dynamic channel allocation strategy", "dynamic resolution adjustment strategy + channel doubling strategy", and "dynamic resolution adjustment strategy + dynamic channel allocation strategy".

[0035] The fixed resolution halving strategy is to reduce the spatial resolution of the feature map by half every stage; the channel doubling strategy is to double the number of channels of the feature map according to the resolution reduction after each downsampling. The fixed resolution halving strategy and the channel doubling strategy are common technical means in the prior art, and will not be described here.

[0036] The dynamic resolution adjustment strategy and the dynamic channel allocation strategy are described in detail below. The feature map output by step S2 is taken as input and is shunted to three independent scale paths through a spatial decoupling strategy. The three paths no longer use fixed spatial scaling rules, but use a dynamic downsampling scale factor to control the resolution of their feature maps, so that each path generates a scale feature map with a size of .

[0037] Further, the downsampling method can be selected from methods such as adjustable step convolution, blur pooling, or interpolation convolution, which have anti-aliasing capability.

[0038] The scale factor is not a static constant, but is calculated in combination with the average size of the target of interest of the i-th path, the complexity of the current image, the prior of the attention intensity of the current task to small targets, and the acceptable computing load index of the current platform. The specific formula is as follows: ; wherein represents the average size of the target of interest of the i-th path; C represents the complexity of the current image (such as edge density, texture entropy); represents the prior of the attention intensity of the current task to small targets (derived from the label density or task weight); represents the acceptable computing load index of the current platform (inference time, model FLOPs budget); represents the reference target size (such as 1 / 10 of the image size); is used to adjust the influence weight of each factor and is set as needed.

[0039] The average size of the target of interest of the ith path represents the average side length of the target corresponding to the target category (or scale region) mainly responsible for detection in the training data; The complexity of the current input image is used to quantify the complexity of the current image in the spatial structure, such as the number of edges, the intensity of texture change, the degree of color imbalance, etc. The higher the complexity, the richer the detail information, and the higher resolution feature is needed to avoid important details from being lost.

[0040] The attention intensity of the current task to small targets prior represents the emphasis on small target detection performance in the current task, reflecting the expectation at the task priority level. The greater the value, the more sensitive the task is to small target detection, and the model should give higher fidelity to the high resolution path. It can be set as a fixed constant by the staff according to the task definition (such as 1.0 in the elderly monitoring scene and 0.5 in the general scene).

[0041] The current platform acceptable computing load indicator is used to constrain the maximum computing intensity that each branch of the model can undertake on a specific deployment platform, reflecting the tolerance of the system side to the computing cost of the high resolution path.

[0042] According to the spatial resolution of each path, the spatial resolution of each path is determined by the scale factor ; and the number of output channels thereof is dynamically allocated.

[0043] Specifically, a channel allocation model is constructed, which takes the "spatial density" of each branch as the core reference index. The spatial density is defined as the ratio between the spatial size (i.e. the total number of pixels) of the feature map at a certain scale and the reference channel number.

[0044] Combined with the spatial density, the global channel resource budget and the importance weight of each branch task, the number of channels obtained by each branch. The specific formula is as follows: ; wherein, (branch i final allocation channel number) is the target to be calculated; (spatial density factor) measures the information demand of branch i feature map in the spatial dimension; ωi (task importance weight) represents the priority or contribution to accuracy of the detection task undertaken by branch i, which can be set artificially or learned according to small target density, business demand, etc. (global channel resource budget) is the upper limit of the total channel allowed by the platform; N (total number of parallel branches) is the number of scale paths participating in the allocation; The normalization coefficient of all branches in the dimension of "spatial density x task weight" is used to ensure that the allocation result does not exceed the budget. This strategy takes into account the spatial information bearing needs and task priorities of each branch while not exceeding the global budget, thereby achieving fine and interpretable channel resource scheduling, providing balanced and efficient channel support for subsequent multi-scale feature extraction.

[0045] To realize the semantic complementation between paths, a bidirectional information interaction mechanism is established. An up-sampling and down-sampling channel is respectively constructed between the high-resolution path and the low-resolution path. The high-semantic path transmits information back to the high-resolution path through up-sampling (such as bilinear interpolation + 1x1 convolution), and after splicing with the original feature map, it is fused through convolution; the high-resolution path compresses the feature map through 3x3 convolution with a step of 2, and feeds back to the low-resolution path for semantic compensation. All channel interactions are aligned in channel dimension through 1x1 convolution to maintain structural consistency.

[0046] Further, a ratio-aware attention mechanism RAA is introduced to drive and strengthen the key path feature expression based on channel saliency. First, the feature map of each path is globally averaged to obtain a channel response vector. Then, an attention vector is extracted through a two-layer perception machine structure; finally, the attention vector is multiplied with the original feature to generate a channel weighted feature, which participates in the interaction and fusion between paths.

[0047] The final fused feature map of each scale has a dynamically adjusted spatial size and channel resource, and explicitly responds to different target scales and semantic levels. They will be sent as inputs to the subsequent Stage 2, Stage 3, and Stage 4 modules, forming a progressive semantic extraction link, and building a multi-scale detection feature system with detail preservation, structure perception, and semantic fusion capabilities under computational constraints. This step is one of the key innovations of the present application, significantly improving the model's ability to model multi-scale targets and structural flexibility.

[0048] Step S4: Stage 2-4—ICAblock progressive extraction In step S4, the model enters the progressive semantic extraction stage (Stage 2-4), and the core purpose of this stage is to further enhance the semantic depth and high-order information modeling of the different scale path feature maps from step 3, to form a multi-level abstract and complementary rich structure representation.

[0049] Specifically, the three feature paths constructed in step 3 enter the Stage 2, Stage 3, and Stage 4 modules respectively based on resolution (such as 1 / 6, 1 / 12, 1 / 24) and channel number. Each Stage is composed of multiple concatenated ICAblock modules, such as Figure 2As shown; ICAblock is a high-efficiency lightweight feature extraction unit, mainly including three parts: depth separable convolution is used to reduce the computational overhead and extract local spatial features; an inverted residual structure is used to enhance nonlinear expression and maintain gradient flow; and the CoordAttention attention mechanism is used to couple the channel dimension and the spatial dimension attention, and enhance the response of the key target area.

[0050] In order to maintain the lightness and stability of the convolution module, the channel compression rate a and the channel expansion ratio in the ICAblock are adaptively set according to the current path channel number, ensuring that even if the channel base is different, the capacity and generalization ability of the network can be balanced. For example, for a high-resolution path with only 24 channels, the compression rate a can be set to 0.5 and the expansion ratio to 1.5, while for a medium-resolution path with 64 channels, the compression rate can be set to 0.25 and the expansion ratio to 2.0.

[0051] In addition, in order to strengthen the expression ability of deep semantic structure, each Stage retains residual connection to ensure that feature information is not lost, while maintaining gradient stability during training; CoordAttention can guide the model to focus on key areas such as target boundaries, texture mutations, etc. Finally, Stage2, 3, 4 outputs feature maps that adapt to different receptive fields, information densities and semantic depths, providing a high-quality structural foundation for subsequent multi-scale fusion and detection prediction.

[0052] This stage constructs a feature extraction hierarchy that can adaptively adjust in terms of resolution, channel dimension, and semantic expression ability, especially suitable for balancing high spatial fidelity and high abstract semantics, thereby significantly enhancing the detection robustness and precision performance of the model in multi-scale complex scenes.

[0053] Step S5: Multi-scale feature fusion and target detection After completing the feature extraction of Stage1 to Stage4, the feature maps of all dynamic scale paths are summarized. Due to the inconsistency of branch size and channel number, first, all feature maps are projected to a unified channel dimension (such as 64 or 96) through a channel alignment module. Then, through layer-by-layer upsampling operation (such as interpolation + 1x1 convolution), all feature maps are upsampled to a unified resolution (1 / 4), and a unified semantic feature map is generated by weighted fusion in the channel dimension. During the fusion process, the channel attention weights generated by the RAA mechanism are continued, and the significance expression of different path features is adjusted. Finally, the fused feature map is input into a lightweight detection head module. The detection head is composed of 1~2 layers of depth separable convolution and an output layer, responsible for predicting the position of the bounding box and the confidence of the target class. This structure is simple and efficient, suitable for low-power real-time deployment scenarios.

[0054] Step S6: End-to-end training strategy In step S6, the model enters the end-to-end training strategy phase, the main goal of which is to achieve the best balance between performance and efficiency of the lightweight network through joint optimization means and structural regulation mechanisms. Since this method introduces dynamic resolution adjustment, dynamic channel allocation and adaptive fusion mechanisms, this phase not only focuses on the optimization of detection accuracy, but also needs to simultaneously adjust and constrain the compactness, adaptability and generalization ability of the network structure.

[0055] First, the training adopts a multi-task joint optimization strategy, which comprehensively uses the IoU-aware bounding box regression loss and the cross-entropy classification loss to guide the spatial positioning accuracy and class prediction accuracy of the detection box respectively. The IoU-aware loss focuses on the overlap quality of the predicted box and the real box, encouraging the network to generate a boundary box with a better shape, while the classification cross-entropy measures the target recognition reliability of each detection point, both of which improve the overall detection performance.

[0056] Second, to effectively control the computational complexity and redundancy risk of the dynamic structure, sparse regularization and compression rate self-adjustment strategies are introduced in the training process. Sparse regularization usually acts on the channel dimension and attention response within the dynamic path, forcing the model to automatically compress inefficient or redundant feature channels through L1 norm, Group Lasso, etc.; while the compression rate self-adjustment strategy allows the model to dynamically adjust key parameters such as compression ratio and channel expansion ratio of each branch during training, so that the structure tends to be optimally configured for the task.

[0057] For feature paths with different task importance, a task priority weight factor ω is introduced. Its setting can be based on artificial priori (such as increasing the weight of high-resolution paths to enhance small target detection ability), data statistics (automatically estimating through target size distribution) or as a learnable parameter participating in training. This mechanism can guide the model to automatically allocate more channel resources to key paths and improve the perception ability of specific tasks.

[0058] In addition, to enhance the scene adaptability and robustness of the model, various online data augmentation strategies are introduced in the training process, including random scaling, image occlusion, brightness disturbance, background replacement, and shear disturbance. These strategies can simulate various changes in complex environments and improve the model's generalization ability to occlusion, small targets, and uneven lighting. If necessary, context enhancement techniques such as CutMix and Mosaic can be used to enhance the overall modeling ability of the feature path to the spatial structure.

[0059] Finally, since the model structure contains multiple dynamic configuration modules (such as resolution path, channel allocation rules, etc.), all adjustable structure parameters are included in the calculation graph during the training stage, realizing synchronous learning of structure and weight. This not only improves the adaptation ability of the final model, but also enables the network obtained by training to have the advantages of lightweight, structure sparsity, branch efficiency, etc. while maintaining accuracy, laying a foundation for efficient inference in the subsequent deployment stage.

[0060] In summary, the target detection framework diagram of the present application is as shown in Figure 3

[0061] Those skilled in the art can appreciate that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized in electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. A person skilled in the art can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0062] In several embodiments provided in 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.

[0063] 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, that is, they can be located in one place, or can be distributed on a plurality of network units. According to actual needs, part or all of the units can be selected to realize the purpose of the embodiment scheme.

[0064] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit.

[0065] ​The above merely provides the specific implementation of the present application, but the protection scope of the present application is not limited to this. Any person skilled in the art can easily think of the changes or replacements within the technical range disclosed by the present application, which should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A lightweight target detection method, characterized in that: The following steps are involved: Step S1: Perform multi-scale preprocessing on the input image, extract different receptive field information and fuse them into the first basic semantic feature map; Step S2: Input the first basic semantic feature map into the lightweight backbone ICAneck. ICAneck consists of four stages of serial modules. Each stage performs 1×1 channel compression, depthwise separable convolution, and coordinate attention in sequence, and uses residual connections when the input and output sizes are the same. Step S3: Construct a strategy selection logic model based on target scale characteristics, image clarity, and small target density: After the judgment results of the three indicators and the preset thresholds A1, A2, and A3 are determined, adaptive switching is performed among the following four combination strategies, namely "fixed resolution halving strategy + channel doubling strategy", "fixed resolution halving strategy + dynamic channel allocation strategy", "dynamic resolution adjustment strategy + channel doubling strategy", and "dynamic resolution adjustment strategy + dynamic channel allocation strategy". Under the determined combination strategy, the ICAneck output is diverted to three scale paths, and the downsampling scale factor of each path is calculated by weighted summation of multiple factors, including the average size of the target focused on the i-th path, the complexity of the current image, the prior intensity of the current task's attention to small targets, and the acceptable computational load indicator of the current platform. At the same time, a channel allocation model is constructed, which combines spatial density, the global channel resource budget, and the importance weight of each branch task to calculate the number of channels obtained by each branch. A bidirectional information exchange channel is established between high-resolution and low-resolution paths. High-semantic features are upsampled and aligned to feed back to the high-resolution path, while low-semantic features are downsampled by convolution with a stride of 2 to compensate for the low-resolution path. Ratio-aware attention is introduced during the interaction process to weight key channels. Step S4: The three paths are respectively sent to the second to fourth stages for progressive ICAblock feature extraction. Each ICAblock consists of depthwise separable convolution, inverted residual, and CoordAttention. Its channel compression and expansion ratios are adaptively adjusted according to the channel cardinality of the path. Step S5: Perform channel alignment and layer-by-layer upsampling on the multi-scale feature maps output from the first to fourth stages, fuse them into a unified semantic feature map, and predict the target category and bounding box through the lightweight detection head; Step S6: Adopt an end-to-end joint training strategy, combine IoU-aware bounding box loss and cross-entropy classification loss, and introduce sparse regularization, compression rate self-adjustment, and diversified data enhancement in training.

2. The lightweight target detection method according to claim 1, characterized in that: The multi-scale preprocessing in step S1 is performed by concatenating the outputs of each branch in the channel dimension and then performing 1×1 convolution compression.

3. The lightweight target detection method according to claim 1, characterized in that: The target scale characteristic is determined by the maximum / minimum target area ratio, the image clarity is determined by the Laplace variance, and the small target density is determined by the small target number ratio.

4. The lightweight target detection method according to claim 1, characterized in that: The downsampling scale factor of each path is calculated as follows: ;in represents the average size of the target that the i-th path focuses on; C represents the complexity of the current image; Represents the prior strength of attention to small targets in the current task; Represents the acceptable computing load indicator of the current platform; represents the reference target size; 、 、 、 Used to adjust the influence weight of each factor and set as needed.

5. The lightweight target detection method according to claim 1, characterized in that: The spatial density is the ratio between the spatial size of the feature map and the number of reference channels at a scale.

6. The lightweight target detection method according to claim 1, characterized in that: The ratio-aware attention performs global average pooling on each feature map, then generates a channel weight vector through two layers of multi-layer perceptrons, and fuses it with the original feature map by element-wise multiplication.

7. The lightweight target detection method according to claim 1, characterized in that: In step S6, the end-to-end training strategy applies L1 or Group Lasso penalty to the dynamic path channel weights in structural regularization.

Citation Information

Patent Citations

  • Special crowd behavior analysis method based on edge calculation

    CN116012788A

  • 2D attitude detection method based on depth separable convolution and channel attention

    CN117558061A

  • Copper bush appearance defect detection method and system based on fusion attention mechanism

    CN119295389A

  • Multi-scale double-flow fusion real-time semantic segmentation method for road scene

    CN119888222A

  • Unmanned aerial vehicle tiny target detection method based on SCCA-YOLO

    CN120375243A