A lightweight target detection method
A lightweight target detection method using multi-scale preprocessing and dynamic resolution adjustment solves the problem of insufficient detection accuracy and efficiency on edge devices, and achieves efficient target detection in different scenarios.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 贵州省通信产业服务有限公司
- Filing Date
- 2025-09-16
- Publication Date
- 2026-05-15
AI Technical Summary
Existing object detection frameworks face issues such as excessive memory usage and wasted computing resources when deployed on edge devices, and cannot dynamically adjust resolution and channel resources, resulting in insufficient detection accuracy and efficiency.
By employing multi-scale preprocessing, a lightweight backbone network (ICAneck), and dynamic resolution adjustment and channel resource allocation strategies, combined with a ratio-aware attention mechanism, adaptive adjustment and information interaction of feature maps are achieved, enabling target detection through a lightweight detection head.
While maintaining end-to-end consistency, it significantly suppresses redundant computation, improves the detection accuracy and model efficiency of small targets and weakly structured targets, and adapts to the detection needs of different scenarios.
Smart Images

Figure CN120807955B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of target detection technology, and more specifically, to a lightweight target detection method. Background Technology
[0002] Object detection, a core task in computer vision, has been widely applied in scenarios such as autonomous driving, smart security, and industrial quality inspection. However, existing mainstream detection frameworks (such as Faster R-CNN, YOLOv5, and RetinaNet) typically rely on fixed network depth and channel configurations, following a static scaling rule of "halving the resolution and doubling the number of channels each time." While this design can achieve high accuracy on high-performance GPUs, it faces the following prominent problems when deployed on computationally limited edge devices (such as Jetson Xavier NX, RK3588, or mobile NPUs).
[0003] Fixed-channel doubling causes feature maps to expand rapidly at depth, leading to an exponential increase in memory usage and multiply-accumulate operations, which is detrimental to real-time inference and low-power scenarios. Static downsampling ratios cannot be dynamically adjusted based on image sharpness, target size distribution, and small target density, resulting in redundant computations for large targets or low-complexity images, while information loss is likely to occur in scenarios with dense small targets or rich details. Fixed-channel doubling strategies are resource-constrained on high-resolution paths and can easily lead to over-compression of small target features, reducing detection recall.
[0004] To alleviate these pain points, lightweight models such as MobileNetV3, ShuffleNetV2, and GhostNet have been proposed. These models reduce the number of parameters through depthwise separable convolutions, channel compression, and feature reuse. However, they are still mainly based on static resolution and channel allocation frameworks, making it difficult to simultaneously meet the dynamic requirements of accuracy and efficiency in different scenarios. Therefore, developing a lightweight object detection method with dynamic resolution adjustment and adaptive channel resource scheduling capabilities has become a key technical requirement in the current field of edge intelligence. Summary of the Invention
[0005] In order to overcome the above-mentioned defects of the prior art, embodiments of the present invention provide a lightweight target detection method to solve the problems mentioned in the background art.
[0006] To achieve the above objectives, the present invention provides the following technical solution:
[0007] A lightweight target detection method includes the following steps:
[0008] Step S1: Perform multi-scale preprocessing on the input image to extract information from different receptive fields and fuse them into the first basic semantic feature map;
[0009] Step S2: Input the first basic semantic feature map into the lightweight backbone ICANeck. ICANeck consists of four-level cascaded modules. Each level 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.
[0010] Step S3: Construct a strategy selection logic model based on target scale characteristics, image sharpness, and small target density: After the judgment results of the three indicators and preset thresholds A1, A2, and A3 are determined, adaptive switching is performed among the following four combination strategies: "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 ICAnk output is split into three scale paths. The downsampling ratio factor of each path is calculated by weighted summation of multiple factors, including the average size of the target of interest in the i-th path, the complexity of the current image, the prior intensity of the current task's attention to small targets, and the computational load index acceptable to the current platform. At the same time, a channel allocation model is constructed, which combines spatial density, global channel resource budget, and importance weight of each branch task to calculate the number of channels obtained by each branch.
[0011] A two-way information interaction 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 stride 2 convolution to compensate for the low-resolution path. Ratio-aware attention is introduced to weight key channels during the interaction process.
[0012] Step S4: The three paths are fed into the second to fourth stages respectively for progressive ICAblock feature extraction. Each ICAblock consists of depthwise separable convolution, inverted residual and CoordAttention. Its channel compression ratio α and expansion ratio are adaptively adjusted according to the number of channels in the path.
[0013] Step S5: Perform channel alignment and layer-by-layer upsampling on the multi-scale feature maps output from the first to fourth stages, and fuse them into a unified semantic feature map. Then, use a lightweight detection head to predict the target category and bounding box.
[0014] Step S6: Adopt an end-to-end joint training strategy, combining IoU-aware bounding box loss and cross-entropy classification loss, and introduce sparse regularization, compression rate self-adjustment and diversified data augmentation during training.
[0015] In a preferred embodiment, the multi-scale preprocessing in step S1 involves concatenating the outputs of each branch along the channel dimension and then performing 1×1 convolutional compression.
[0016] In a preferred embodiment, the target scale characteristic is determined by the ratio of the maximum / minimum target area, the image sharpness is determined by the Laplacian variance, and the small target density is determined by the proportion of small targets.
[0017] In a preferred embodiment, the downsampling scaling factor for each path is calculated using the following formula:
[0018] ;in C represents the average size of the target that the i-th path is primarily concerned with; C represents the complexity of the current image. This represents the priori intensity of the current task's focus on smaller objectives; This represents the acceptable computing load metric for the current platform. Represents the reference target size; Used to adjust the influence weight of each factor, set as needed.
[0019] In a preferred embodiment, the spatial density is the ratio between the spatial size of the feature map and the number of reference channels at a given scale.
[0020] In a preferred embodiment, the ratio-aware attention is achieved by applying global average pooling to each feature map, followed by generating channel weight vectors through two layers of multilayer perceptrons, and then fusing them with the original feature maps element-wise.
[0021] In a preferred embodiment, the end-to-end training strategy described in step S6 applies an L1 or Group Lasso penalty to the dynamic path channel weights during structural regularization.
[0022] The technical effects and advantages of this invention are as follows:
[0023] Compared with existing benchmark detection frameworks (such as YOLOv5-S, Faster RCNN, etc.), this invention has made in-depth improvements in both structural mechanism and training strategy, thus achieving 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", this invention maintains end-to-end coherence while enabling the resolution and number of channels of the feature map to adaptively adjust with the target scale, image sharpness and small target density, significantly suppressing redundant computation.
[0024] This invention introduces a dynamic resolution generation mechanism and an adaptive channel resource allocation strategy, and combines a ratio-aware attention mechanism to establish information interaction and fusion pathways between multiple scale paths, thereby achieving accurate modeling of small and structurally weak targets under lightweight structures.
[0025] 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 model's ability to extract features in the early stage.
[0026] Lightweight depthwise convolutions are used to replace standard 3×3 convolutions, and inverted residual modules are incorporated into the base module. By adjusting the scaling factor, the number of parameters and computational complexity of the model are reduced while ensuring the performance of the network model, thus achieving the level of a lightweight network.
[0027] By introducing the CoordAttention module and integrating it into the ICAneck and ICAblock basic modules, the model can improve the accurate localization of key points in the spatial direction while ensuring the acquisition of feature map channel feature information, suppressing useless features, further reducing the spatial resolution loss caused by upsampling, and improving the performance of the model. Attached Figure Description
[0028] To facilitate understanding by those skilled in the art, the present invention will be further described below with reference to the accompanying drawings;
[0029] Figure 1 This is a schematic flowchart of a lightweight target detection method according to the present invention;
[0030] Figure 2 This is a schematic diagram of the ICANeck module and ICAblock module framework of the present invention;
[0031] Figure 3 This is a schematic diagram of the target detection framework of the present invention. Detailed Implementation
[0032] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0033] Example 1: A lightweight target detection method according to the present invention, the flowchart is as follows. Figure 1 As shown, it includes the following steps:
[0034] Step S1: Input and Multi-scale Preprocessing
[0035] First, process the original input image. Spatial compression and channel enhancement provide a low-computation, high-information-density initial representation for subsequent feature extraction. A convolution or max-pooling operation with a stride of 2 is used to spatially downsample the original image, compressing its size to one-quarter of the original, resulting in a size of [size missing]. low-resolution feature map 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 and anti-interference effect, which helps to reduce the interference of texture noise on the backbone network when extracting features.
[0036] To extract richer low-level semantics from RGB three-channel images, such as edges, textures, and local structures, a 3×3 convolution operation is further performed. The number of channels was increased from 3 to the initial number of channels. The basic feature map is obtained. The convolutional kernel of this layer has a small receptive field (the receptive field is a core concept in computer vision and neuroscience, referring to the spatial range of the input image or features of the previous layer that a node or neuron in a neural network can "see." Essentially, it describes the spatial mapping relationship between the feature response and the original input. In a convolutional neural network, when each convolutional kernel slides across the input image, the output pixel value is determined by the local region it covers; this region is the receptive field at that output location). This kernel is specifically designed to capture local correlations between pixels. Combined with the ReLU activation function, it effectively enhances non-linear expressive power, providing a stable and semantically rich input foundation for subsequent modules.
[0037] Subsequently, a multi-path convolutional structure is introduced to achieve stronger multi-scale response capabilities. Specifically, multiple parallel convolutional branches are designed, each using a different kernel size, such as 1×1, 3×3, or 5×5, or dilated convolutions to further expand the receptive field. These branches operate on the same input... ( The first "basic semantic feature map" is obtained after the original image undergoes initial downsampling and convolutional encoding. It has a moderate resolution and number of channels, possesses good structural initial representation capabilities, and serves as the shared input for all subsequent parallel paths and branch calculations. Parallel computation is performed on the image to capture regional structure and texture information at different scales, thereby constructing multiple scale-sensitive intermediate feature maps. Then, fusion strategies such as weighted summation or channel-level concatenation and compression (e.g., concat followed by a 1×1 convolution) are used to integrate the results of each branch into a unified fused feature map. This serves as the input for the subsequent Stage 1 ICANeck structure. A schematic diagram of the ICANeck structure is shown below. Figure 3 As shown.
[0038] This step, on the one hand, enhances the feature map's responsiveness to different structural scales with low computational cost, providing a preliminary scale-aware foundation for the model; on the other hand, through a multi-branch parallel design, it effectively improves the model's ability to preserve details and structural contours at low resolution, providing more discriminative original semantic support for subsequent dynamic path branching and attention fusion. The entire S1 process not only compresses the spatial dimension but also enriches the channel representation, representing the first step towards achieving lightweight and multi-scale collaboration.
[0039] Step S2: Stage 1—ICAneck Feature Extraction
[0040] The fused feature map output from step S1 The input is fed into the backbone feature extraction structure ICAnerck, which is used to construct a lightweight and efficient primary semantic representation layer. The ICAnerck module integrates an inverted residual structure, depthwise separable convolution, and coordinate attention mechanism, which significantly reduces the number of parameters and computational complexity while ensuring information extraction capabilities. It is one of the core elements of the lightweight design of this method.
[0041] The ICAneck module consists of four stacked modules. Within each module, a 1×1 convolution is used for channel compression, with the compression ratio controlled by the hyperparameter α (e.g., α=0.25 means compression to one-quarter of the original channel size). This reduces the dimensionality of intermediate channels and lowers subsequent computational overhead. The compressed feature map is then processed by a depthwise separable convolution for spatial feature extraction. This convolution operation first extracts the spatial information of each channel independently through a 3×3 channel-wise convolution, and then fuses the channels through a 1×1 pointwise convolution. This ensures sufficient spatial modeling capability while significantly reducing the number of convolution kernel parameters and multiply-accumulate operations.
[0042] To further enhance the module's ability to focus on structural regions and target entities, a CoordAttention mechanism is introduced after depthwise convolution. This mechanism creates two one-dimensional attention channels by globally pooling the feature maps in both the horizontal and vertical directions, explicitly encoding the spatial location information of the target. It then fuses these attention weights with the input features to strengthen the representation of spatially sensitive regions such as edges, corners, and symmetrical structures. Compared to channel attention (such as SE) or spatial attention (such as CBAM), CoordAttention is more suitable for lightweight structural scenarios, offering lower computational cost and higher expressive efficiency.
[0043] In terms of structural connectivity, each ICANeck module introduces inverted residual connections: during the compression-convolution-attention-expansion process, if the input and output sizes are the same, the input and output are directly added to form a skip connection, which helps to maintain feature coherence and gradient flow stability during backpropagation, and avoids feature drift and degradation problems.
[0044] The final feature map output from the cascaded operation of the four ICAnk modules in Stage 1 remains unchanged. While maintaining a consistent spatial dimension, its semantic hierarchy deepens progressively, moving from raw textures to intermediate structural information such as edge closure, regional consistency, and local symmetry, demonstrating excellent structural decoupling capabilities and semantic integrity. Furthermore, since the dimensionality of each channel layer is controlled by α, the value of α can be adjusted to flexibly balance computational resources and expressive power to meet different task requirements. This output serves as the basic semantic input, used for dynamic path branch construction and information interaction fusion in subsequent step S3.
[0045] Step S3: Cross-scale information interaction and dynamic fusion
[0046] First, a strategy selection logic model is constructed. To adapt to the feature distribution and deployment requirements of different object detection tasks, this model starts from two dimensions, progressively judging and selecting the most suitable combination strategy: resolution adjustment strategy and channel number allocation strategy. The decision criteria include target scale characteristics, image sharpness, and small target density.
[0047] The target scale characteristic measures the magnitude of the size difference between targets in an image. If some targets are very small and others are exceptionally large, the scale difference is large; if all targets are roughly the same size, the difference is small. Randomly select 50-100 targets and calculate the ratio of the largest target area to the smallest target area. If this ratio is greater than a threshold A1, the target scale characteristic is set to "high"; if it is less than A1, it is set to "low". The threshold A1 is set as needed.
[0048] Image sharpness measures whether an image is clear, including the sharpness of edges and the richness of texture. Blurry, heavily occluded, or low-resolution images have low sharpness. Using Laplacian variance (an image sharpness index; the higher the value, the sharper the image), a Laplacian filter is applied to the grayscale image, and its variance is calculated. If the variance is greater than a threshold A2, the image sharpness is set to high; if the variance is less than the threshold A2, the image sharpness is set to low. The threshold A2 is set as needed.
[0049] Small target density refers to the proportion of small targets in an image. A high density is used when there are many small targets (such as pedestrians, faces, and vehicles) and the task heavily relies on them. First, define a small target, for example, with an area less than 32×32 pixels. Then, count the proportion of small targets in the image (number of small targets divided by the total number of targets). If the proportion of small targets in the image is greater than a threshold A3, the small target density is set to high; if the proportion is less than the threshold A3, the small target density is set to low. The threshold A3 is set as needed.
[0050] If the target has low scale characteristics and high image clarity, a fixed resolution halving strategy is used; otherwise, a dynamic resolution adjustment strategy is used. If the density of small targets is low, a channel doubling strategy is used; if the density of small targets is high, a dynamic channel allocation strategy is used.
[0051] This leads to four different strategies: "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".
[0052] The fixed resolution halving strategy reduces the spatial resolution of the feature map by half after each stage; the channel doubling strategy doubles the number of channels in the feature map after each downsampling, based on the resolution reduction. These two strategies are commonly used in existing technologies and will not be elaborated upon here.
[0053] The dynamic resolution adjustment strategy and dynamic channel allocation strategy are described in detail below. The feature map output from step S2 is used as input and split into three independent scale paths through a spatial decoupling strategy. These three paths no longer use fixed spatial scaling rules, but instead use dynamic downsampling scaling factors. Control the resolution of its feature maps so that each path generates a size of [size missing]. Scale feature map.
[0054] Furthermore, downsampling methods can be selected from those with anti-aliasing capabilities, such as adjustable stride convolution, fuzzy pooling, or interpolation convolution.
[0055] Scale factor The setting of is not a static constant, but is calculated by combining multiple factors such as the average size of the target of interest in the i-th path, the complexity of the current image, the prior intensity of the current task's attention to small targets, and the computational load index acceptable to the current platform; the specific formula is as follows:
[0056] ;in C represents the average size of the target that the i-th path is primarily concerned with; C represents the complexity of the current image (such as edge density, texture entropy). This represents the prior intensity of the current task’s attention to the small target (derived from the label density or task weight). This represents the acceptable computational load metrics for the current platform (inference time, model FLOPs budget). This represents the reference target size (e.g., 1 / 10 of the image size). Used to adjust the influence weight of each factor, set as needed.
[0057] The average size of the target of interest in the i-th path is represented in the training data. This scale path is mainly responsible for detecting the average side length of the target corresponding to the target category (or scale region).
[0058] The complexity of the current input image is used to quantify the spatial structural complexity of the current image, such as the number of edges, the intensity of texture variations, and the degree of color imbalance. Higher complexity indicates richer detail information, requiring higher resolution features to avoid losing important details.
[0059] The prior expression of the current task's focus on small targets reflects the importance attached to small target detection performance in the current task, reflecting expectations at the task priority level. A larger value indicates that the task is more sensitive to small target detection, and the model should provide higher fidelity to high-resolution paths. This value can be set by staff to a fixed constant based on the task definition (e.g., 1.0 for elderly care monitoring scenarios, and 0.5 for general scenarios).
[0060] The acceptable computational load metric for the current platform is used to constrain the maximum computational intensity that each branch of the model can bear on a specific deployment platform, reflecting the system's tolerance for high-resolution path computation costs.
[0061] Based on the spatial resolution of each path, the spatial resolution of each path is determined by a scaling factor. The decision is made to dynamically allocate resources for the number of its output channels.
[0062] Specifically, a channel allocation model is constructed, which uses the "spatial density" of each branch as the core reference indicator. Spatial density is defined as the ratio between the spatial size of the feature map (i.e., the total number of pixels) and the number of reference channels at a certain scale.
[0063] The final number of channels obtained by each branch is determined by combining spatial density, global channel resource budget, and the importance weight of each branch task. The specific formula is as follows: ;in, (The final number of channels allocated to branch i) is the target to be calculated; (Spatial density factor) measures the amount of information required by the feature map of branch i in the spatial dimension; ωi (task importance weight) represents the priority of branch i in undertaking the detection task or its contribution to accuracy, which can be set manually or learnably based on factors such as small target density and business needs. (Global channel resource budget) is the total channel limit allowed by the platform; N (total number of parallel branches) is the number of scale paths participating in the allocation; The normalization coefficients for all branches in the "spatial density × task weight" dimension are used to ensure that the allocation results do not exceed the budget. This strategy takes into account the spatial information carrying needs and task priorities of each branch without exceeding the global budget, thereby achieving fine and interpretable channel resource scheduling and providing balanced and efficient channel support for subsequent multi-scale feature extraction.
[0064] To achieve semantic complementarity between paths, a bidirectional information exchange mechanism is established. Upsampling and downsampling channels are constructed between the high-resolution and low-resolution paths, respectively. The high-semantic path transmits information back to the high-resolution path through upsampling (e.g., bilinear interpolation + 1×1 convolution), concatenates it with the original feature map, and then fuses it through convolution. The high-resolution path compresses the feature map through a 3×3 convolution with a stride of 2 and feeds it back to the low-resolution path for semantic compensation. Before all channel interactions, the channel dimensions are aligned using a 1×1 convolution to maintain structural consistency.
[0065] Furthermore, a ratio-aware attention mechanism (RAA) is introduced to enhance the feature representation of key paths driven by channel saliency. First, global average pooling is performed on the feature map of each path to obtain the channel response vector. Then, an attention vector is extracted through a two-layer perceptron structure. Finally, the attention vector is multiplied by the original features to generate channel-weighted features, which participate in the interaction and fusion between paths.
[0066] The final fused feature maps at each scale possess dynamically adjustable spatial dimensions and channel resources, explicitly responding to different target scales and semantic levels. These are then fed as input to subsequent Stage 2, Stage 3, and Stage 4 modules, forming a progressive semantic extraction chain. This collectively constructs a multi-scale detection feature system capable of detail preservation, structure awareness, and semantic fusion under computationally constrained conditions. This step is one of the key innovations of this invention, significantly enhancing the model's ability to model multi-scale targets and its structural flexibility.
[0067] Step S4: Stage 2-4—ICAblock Progressive Extraction
[0068] In step S4, the model enters the progressive semantic extraction stage (Stage 2~4). The core purpose of this stage is to further enhance the semantic depth and model higher-order information of the path feature maps of different scales from step 3, so as to form a multi-level abstract, complementary and rich structural representation.
[0069] Specifically, the three feature paths constructed in step 3 enter Stage 2, Stage 3, and Stage 4 modules respectively, based on resolution (e.g., 1 / 6, 1 / 12, 1 / 24) and number of channels. Each Stage consists of multiple cascaded ICAblock modules, such as... Figure 2As shown, ICAblock is an efficient and lightweight feature extraction unit, mainly consisting of three parts: depthwise separable convolution to reduce computational overhead and extract local spatial features; inverted residual structure to enhance nonlinear representation and maintain gradient flow; and CoordAttention mechanism to couple channel dimension and spatial dimension attention to enhance the response of key target regions.
[0070] To maintain the lightweight and stability of the convolutional module, the internal channel compression ratio α and channel expansion ratio of ICAblock are adaptively set according to the number of channels in the current path, ensuring that the network's capacity and generalization ability are balanced even with different channel numbers. For example, for a high-resolution path with only 24 channels, the compression ratio α can be set to 0.5 and the expansion ratio to 1.5, while for a medium-resolution path with 64 channels, the compression ratio can be set to 0.25 and the expansion ratio to 2.0.
[0071] Furthermore, to enhance the expressive power of deep semantic structures, residual connections are preserved in each Stage to ensure no feature information is lost, while maintaining gradient stability during training. CoordAttention guides the model to focus on key regions, such as target boundaries and texture abrupt changes. Finally, Stages 2, 3, and 4 output feature maps adapted to different receptive fields, information densities, and semantic depths, providing a high-quality structural foundation for subsequent multi-scale fusion and detection prediction.
[0072] This stage constructs a feature extraction hierarchy that can be adaptively adjusted in terms of resolution, channel dimension, and semantic expressive power. It is particularly suitable for achieving a balance between high spatial fidelity and high abstract semantics, thereby significantly enhancing the model's detection robustness and accuracy in complex multi-scale scenarios.
[0073] Step S5: Multi-scale feature fusion and target detection
[0074] After feature extraction for Stages 1 through 4, feature maps from all dynamic scale paths are aggregated. Due to inconsistencies in branch size and channel number, all feature maps are first projected to a unified channel dimension (e.g., 64 or 96) using a channel alignment module. Then, layer-by-layer upsampling operations (e.g., interpolation + 1×1 convolution) are used to upsample all feature maps to a unified resolution (1 / 4), and weighted fusion is performed along the channel dimension to generate a unified semantic feature map. During the fusion process, the channel attention weights generated by the RAA mechanism are continued to adjust the saliency expression of features from different paths. Finally, the fused feature map is input into a lightweight detection head module. This detection head consists of 1-2 depthwise separable convolutional layers and an output layer, responsible for predicting bounding box positions and target class confidence. This structure is simple and efficient, suitable for low-power real-time deployment scenarios.
[0075] Step S6: End-to-end training strategy
[0076] In step S6, the model enters the end-to-end training strategy stage, the main goal of which is to achieve the optimal balance between performance and efficiency of the lightweight network through joint optimization methods and structural adjustment mechanisms. Since this method introduces dynamic resolution adjustment, dynamic channel allocation and adaptive fusion mechanisms, this stage not only focuses on optimizing detection accuracy, but also needs to simultaneously adjust and constrain the compactness, adaptability and generalization ability of the network structure.
[0077] First, the training employs a multi-task joint optimization strategy, combining IoU-aware bounding box regression loss and cross-entropy classification loss to guide the spatial localization accuracy and class prediction accuracy of the detection boxes, respectively. IoU-aware loss focuses on the overlap quality between the predicted and ground truth boxes, encouraging the network to generate more closely fitting bounding boxes, while classification cross-entropy measures the object recognition reliability of each detection point. Together, they improve the overall detection performance.
[0078] Secondly, to effectively control the computational complexity and redundancy risk of dynamic structures, sparse regularization and compression ratio self-adjustment strategies are introduced during training. Sparse regularization typically applies to the channel dimension and attention response within the dynamic path, forcing the model to automatically compress inefficient or redundant feature channels through methods such as L1 norm and Group Lasso. Meanwhile, the compression ratio self-adjustment strategy allows the model to dynamically adjust key parameters such as the compression ratio and channel expansion ratio of each branch during training, making the structure tend towards the task-optimal configuration.
[0079] For feature paths with varying task importance, a task priority weight factor ω is introduced. This factor can be set based on manual priors (e.g., increasing the weight of high-resolution paths to enhance small target detection capabilities), statistical data (automatically estimated through target size distribution), or as a learnable parameter during training. This mechanism guides the model to automatically allocate more channel resources to critical paths, improving its ability to perceive specific tasks.
[0080] Furthermore, to enhance the model's scene adaptability and robustness, various online data augmentation strategies are introduced during training, including random scaling, image occlusion, brightness perturbation, background replacement, and cropping perturbation. These strategies can simulate diverse changes in complex environments, improving the model's generalization ability to conditions such as occlusion, small objects, and uneven lighting. When necessary, context enhancement techniques such as CutMix and Mosaic can also be used to enhance the overall modeling ability of feature paths on spatial structures.
[0081] Finally, since the model structure contains multiple dynamically configured modules (such as resolution paths and channel allocation rules), all adjustable structural parameters are incorporated into the computation graph during the training phase, enabling simultaneous learning of structure and weights. This not only improves the adaptability of the final model but also allows the trained network to maintain accuracy while possessing advantages such as lightweight design, sparse structure, and efficient branching, laying the foundation for efficient inference in the subsequent deployment phase.
[0082] In summary, the target detection framework of this invention is shown in the figure below. Figure 3 As shown.
[0083] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented 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 this application.
[0084] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0085] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0086] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0087] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A lightweight target detection method, characterized in that, Includes the following steps: Step S1: Perform multi-scale preprocessing on the input image to extract information from different receptive fields and fuse them into the first basic semantic feature map; Step S2: Input the first basic semantic feature map into the lightweight backbone ICANeck to perform the first stage feature extraction and output the first stage feature map. The ICANeck consists of four-level cascaded modules. Each level sequentially performs 1×1 channel compression, depthwise separable convolution and coordinate attention, and uses residual connection 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 preset thresholds A1, A2, and A3 are determined, adaptive switching is performed among the following four combination strategies: "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 feature map of the first stage is output from ICANeck and then split into three scale paths. The downsampling ratio factor of each path is calculated by weighted summation of multiple factors, including the average size of the target of interest in the i-th path, the complexity of the current image, the prior intensity of the current task's attention to small targets, and the computational load index acceptable to the current platform. At the same time, a channel allocation model is constructed, which combines spatial density, global channel resource budget, and importance weight of each branch task to calculate the number of channels obtained by each branch. A bidirectional information interaction channel is established between high- and low-resolution paths. High semantic features are upsampled and aligned with the feedback high-resolution path, while low semantic features are downsampled by stride 2 convolution to compensate for the low-resolution path. Ratio-aware attention is introduced during the interaction process to assign weights to key channels. Step S4: The three paths are fed into the second to fourth stages respectively for progressive ICAblock feature extraction. Each ICAblock consists of depthwise separable convolution, inverted residual and CoordAttention. Its channel compression ratio and expansion ratio are adaptively adjusted according to the channel base of the path. Step S5: Perform channel alignment and layer-by-layer upsampling on the first-stage feature map output by ICANeck and the multi-scale feature maps output from the second to fourth stages. Channel alignment projects all feature maps to a unified channel dimension, and layer-by-layer upsampling upsamples all feature maps to a unified resolution to fuse them into a unified semantic feature map. The target category and bounding box are then predicted by the lightweight detection head. Step S6: Adopt an end-to-end joint training strategy, combining IoU-aware bounding box loss and cross-entropy classification loss, and introduce sparse regularization, compression rate self-adjustment and diversified data augmentation during training.
2. The lightweight target detection method according to claim 1, characterized in that: The multi-scale preprocessing in step S1 involves concatenating the outputs of each branch along the channel dimension and then performing 1×1 convolutional compression.
3. The lightweight target detection method according to claim 1, characterized in that: The target scale characteristic is determined by the ratio of the maximum / minimum target area, the image sharpness is determined by the Laplacian variance, and the small target density is determined by the proportion of small targets.
4. The lightweight target detection method according to claim 1, characterized in that: The downsampling scaling factor for each path is calculated using the following formula: ;in C represents the average size of the target that the i-th path is primarily concerned with; C represents the complexity of the current image. This represents the priori intensity of the current task's focus on smaller objectives; This represents the acceptable computing load metric for the current platform. Represents the reference target size; , , , Used to adjust the influence weight of each factor, set as needed.
5. A 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 given scale.
6. The lightweight target detection method according to claim 1, characterized in that: The ratio-aware attention is achieved by applying global average pooling to each feature map, followed by generating channel weight vectors through two layers of multilayer perceptrons, and then fusing them with the original feature maps 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 penalties to the dynamic path channel weights during structural regularization.