A lightweight target detection method and system based on convolutional neural network
By building a lightweight object detection model and optimization of centroid pruning algorithm, the problems of large computing volume and high memory usage on edge devices are solved, and efficient real-time object detection is achieved, suitable for resource-constrained edge devices.
Patent Information
- Application Number
- CN202510715240.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2045-05-30
AI Technical Summary
The existing object detection methods have large computing volume and high memory usage on edge devices, making it difficult to meet the balance between computing complexity and detection accuracy, and cannot meet the real-time requirements.
A lightweight object detection model based on convolutional neural network is constructed, and feature extraction and fusion is adopted using the FF-ELAN module, EConv module and MFA module, and combined with the optimization model of the centroid of pruning algorithm, it is deployed on edge devices for object detection.
Significantly reduce the computational complexity and memory usage, maintain high detection accuracy, meet the real-time needs of edge devices, and adapt to practical application scenarios with limited resources.
Smart Images

Figure CN120258049B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of target detection technology, and in particular to a lightweight target detection method and system based on convolutional neural networks. Background Art
[0002] As a key technology in computer vision, object detection has broad applications in numerous scenarios, including robotic navigation, intelligent video surveillance, and industrial inspection. By replacing manual inspection with visual models, it effectively reduces labor costs and has become a hot topic in both theoretical research and practical applications in recent years. With the rapid development of deep learning technology, object detection algorithms based on deep convolutional neural networks have gradually become mainstream. Algorithms such as Faster R-CNN, YOLO, and SSD have achieved remarkable results in detection accuracy through their end-to-end learning approach.
[0003] However, these advanced object detection algorithms have exposed many problems when applied to edge computing devices. Edge computing devices (such as embedded systems and mobile terminals) typically have limited computing power, scarce memory resources, and constrained power consumption. Existing detection algorithms mostly rely on complex network structures, which suffer from drawbacks such as large computational workloads, numerous parameters, and frequent memory accesses. These algorithms place enormous computational pressure and memory burden on edge devices, making them difficult to deploy directly. Although researchers have proposed a variety of lightweight object detection methods, such as MoblieNet-SSD, which attempt to reduce computational complexity and memory usage through model compression and network structure optimization, they still face a series of severe challenges in actual application:
[0004] 1. The trade-off between computational complexity and accuracy: While existing lightweight methods offer some improvement in computational complexity, detection accuracy significantly decreases when processing complex scenes or high-resolution images. For example, YOLOv8, while pursuing high accuracy, still requires significant memory and computing resources. This makes it difficult to run efficiently on resource-constrained edge devices, and it fails to strike a good balance between computational complexity and detection accuracy.
[0005] 2. Memory access bottlenecks constrain performance: Edge devices have inherent limitations in storage bandwidth and memory capacity. Existing object detection methods require frequent memory access when processing high-resolution images. This makes memory access a key performance bottleneck, severely reducing inference speed and, in turn, affecting the real-time and accuracy of object detection.
[0006] 3. Difficulty meeting strict real-time requirements: In scenarios with extremely high real-time requirements, such as autonomous driving and security monitoring, existing lightweight methods still cannot meet the practical needs of low latency and high throughput. For example, the YOLO series of algorithms have slow inference speeds when processing high-resolution images, making them unable to meet the requirements of real-time monitoring of high-bitrate video, making it difficult to ensure efficient and stable system operation.
[0007] In summary, there is an urgent need for a new target detection method that can significantly reduce computational complexity and memory usage while ensuring detection accuracy, so as to adapt to resource-constrained edge computing devices and meet the strict requirements of real-time and efficiency in actual application scenarios. Summary of the Invention
[0008] To this end, an embodiment of the present invention provides a lightweight target detection method and system based on convolutional neural networks, which is used to solve the problems of large computational complexity and high memory usage of existing target detection methods on edge devices.
[0009] To solve the above problems, an embodiment of the present invention provides a lightweight target detection method based on a convolutional neural network, which includes:
[0010] A lightweight object detection model based on a convolutional neural network is constructed. The model consists of an FF-ELAN module, an EConv module, an MFA module, and a detection head. The FF-ELAN module is used to simultaneously extract shallow and deep features of the input image. The EConv module is used to replace traditional conventional convolution with a lightweight convolution structure to reduce the model's computational complexity while maintaining feature expression capabilities. The MFA module is used to implement multi-level feature reuse and cross-feature fusion. The detection head is used to predict the target category and location.
[0011] The overall process of the model is as follows: the input image passes through multiple FF-ELAN modules in sequence for feature extraction. The features output by each FF-ELAN module are processed by the EConv module and then input into the MFA module for feature fusion. Finally, the fused features are input into the detection head to complete the object detection task.
[0012] Optimizing the model using a centroid-based pruning algorithm to obtain an optimized model;
[0013] Deploying the optimized model on an edge device;
[0014] The edge device uses the optimized model to perform target detection on the collected image data and outputs the detection results.
[0015] Preferably, the FF-ELAN module adopts a dual-branch structure, including a left branch and a right branch; the left branch uses point-by-point convolution to process the input feature map to retain shallow features; the right branch uses a multi-layer connection combination of partial convolution to extract deep features, and the partial convolution of each layer only calculates part of the channels of the input feature map.
[0016] Preferably, in the right branch, the output features of the partial convolution of each layer are used as the input of the partial convolution of the next layer, gradually enhancing the feature expression capability; the output features of the left branch and the right branch are combined in the channel dimension to generate combined features, and the combined features are fused through point-by-point convolution to obtain features with rich semantic information.
[0017] Preferably, the MFA module constructs an EConv module through point-by-point convolution and depth-wise separable convolution to replace the traditional conventional convolution operation; the EConv module decomposes the conventional convolution into depth-wise separable convolution and point-by-point convolution, the depth-wise separable convolution performs spatial convolution on each input channel separately, and the point-by-point convolution adjusts the channel dimension of the output of the depth-wise separable convolution.
[0018] Preferably, the calculation process of the EConv module is: first, spatially convolve the input feature map through depthwise separable convolution, and then reduce or increase the channel dimension of the output of the depthwise separable convolution through point-by-point convolution to reduce the amount of calculation and memory usage and achieve feature fusion.
[0019] Preferably, the centroid-based pruning algorithm comprises the following steps:
[0020] For each convolution kernel in the model, calculate its center of mass in the spatial dimension. The center of mass is the average value of the convolution kernel in the spatial dimension. The calculation formula of the center of mass is as follows:
[0021] ;
[0022] Where, is the centroid of the convolution kernel, Indicates the convolution kernels, is the number of convolution kernels of this layer;
[0023] Calculate the Euclidean distance between each convolution kernel and the centroid, where the Euclidean distance The calculation formula is:
[0024] ;
[0025] Where, is the size of the convolution kernel, and Respectively represent the convolution kernel and the center of mass at the position ( ) at the value;
[0026] Set a distance threshold and, based on the distance calculation result, delete redundant convolution kernels whose distance from the centroid is less than the distance threshold.
[0027] Preferably, the distance threshold is adaptively determined according to the distribution characteristics of each convolution kernel layer, and the calculation formula is:
[0028] ;
[0029] Where, is the distance threshold, is the average distance between all convolution kernels and the centroid, is the standard deviation, is the adjustment coefficient.
[0030] Preferably, the detection head includes a classification branch and a regression branch, the classification branch is used to predict the category probability of the target, and the regression branch is used to predict the position and size of the target; the detection head receives the feature map processed by the FF-ELAN module and the MFA module to detect the target category and position.
[0031] The embodiment of the present invention further provides a lightweight target detection system based on a convolutional neural network, which is used to implement the above-mentioned lightweight target detection method based on a convolutional neural network, and specifically includes:
[0032] A model building module builds a lightweight object detection model based on a convolutional neural network. The model consists of an FF-ELAN module, an EConv module, an MFA module, and a detection head. The FF-ELAN module is used to simultaneously extract shallow and deep features of the input image. The EConv module is used to replace traditional conventional convolution with a lightweight convolution structure to reduce the model's computational complexity while maintaining feature expression capabilities. The MFA module is used to implement multi-level feature reuse and cross-feature fusion. The detection head is used to predict the target category and location.
[0033] The overall process of the model is as follows: the input image passes through multiple FF-ELAN modules in sequence for feature extraction. The features output by each FF-ELAN module are processed by the EConv module and then input into the MFA module for feature fusion. Finally, the fused features are input into the detection head to complete the object detection task.
[0034] A model optimization module, configured to optimize the model using a centroid-based pruning algorithm to obtain an optimized model;
[0035] A model deployment module, configured to deploy the optimized model on an edge device;
[0036] The target detection module is used for the edge device to perform target detection on the collected image data using the optimized model and output the detection results.
[0037] An embodiment of the present invention also provides a computer storage medium, which stores a computer software product. The computer software product includes several instructions for enabling a computer device to execute the above-mentioned lightweight target detection method based on convolutional neural network.
[0038] It can be seen from the above technical solutions that the present invention has the following beneficial effects:
[0039] (1) Low computational complexity: This paper constructs a lightweight target detection model consisting of an FF-ELAN module, an EConv module, and an MFA module. This model uses a lightweight convolutional structure to replace traditional conventional convolutions, reducing the computational complexity of the model and the computational overhead when running on edge devices. Furthermore, a centroid-based pruning algorithm removes redundant convolution kernels, further reducing the computational complexity and enabling the model to run quickly under the limited computing power of edge devices.
[0040] (2) Small memory footprint: On the one hand, the lightweight convolution structure and feature fusion method used in the model design reduce the number of parameters and memory access. On the other hand, the centroid-based pruning algorithm optimizes the model, removes redundant convolution kernels, and reduces the model size, thereby reducing memory footprint and adapting to the limited memory resources of edge devices.
[0041] (3) Good detection effect: The dual-branch structure of the FF-ELAN module can extract shallow and deep features at the same time. The MFA module realizes multi-level feature reuse and cross-feature fusion. The detection head accurately predicts the target category and position. Combined with the optimized model, it can reduce the amount of calculation and memory usage while still maintaining a high target detection accuracy to meet the needs of actual applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the implementation cases of the present invention or the technical solutions in the prior art, the following is a brief description of the drawings required for use in the embodiments. By referring to the drawings, the features and advantages of the present invention will be more clearly understood. The drawings are schematic and should not be understood as limiting the present invention in any way. Those skilled in the art can derive other drawings based on these drawings without inventive effort. Among them:
[0043] Figure 1 A flowchart of a lightweight target detection method based on convolutional neural network provided by the present invention;
[0044] Figure 2 A schematic diagram of the overall architecture of the lightweight object detection model based on convolutional neural networks constructed by the present invention;
[0045] Figure 3 Schematic diagram of the partial convolution calculation process of the present invention;
[0046] Figure 4 A block diagram of a lightweight target detection system based on convolutional neural networks provided by the present invention. DETAILED DESCRIPTION
[0047] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. 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 shall fall within the scope of protection of the present invention.
[0048] Example 1:
[0049] In order to solve the problems of large computation and high memory usage of existing target detection methods on edge devices, such as Figure 1 As shown, an embodiment of the present invention proposes a lightweight target detection method based on a convolutional neural network, the method comprising:
[0050] S1: Build a lightweight object detection model based on convolutional neural network;
[0051] S2: Optimize the model using the centroid-based pruning algorithm to obtain the optimized model;
[0052] S3: Deploy the optimized model on the edge device;
[0053] S4: The edge device uses the optimized model to perform target detection on the collected image data and outputs the detection results.
[0054] From the above technical solution, it can be seen that the present invention proposes a lightweight target detection method based on convolutional neural networks. By constructing a lightweight target detection model based on convolutional neural networks and utilizing the unique design of the FF-ELAN module, EConv module, MFA module and detection head, the model calculation complexity is effectively reduced and the feature extraction and fusion capabilities are improved, which preliminarily solves the problem of large computational complexity on edge devices; the centroid-based pruning algorithm further optimizes the model, deletes redundant convolution kernels, reduces the computational complexity and memory usage, and makes the model more adaptable to the resource limitations of edge devices; the optimized model is deployed on the edge device to ensure that the model can run stably in actual edge scenarios; finally, the edge device uses the model to perform target detection on the collected image data and output the results, realizing efficient and real-time target detection, successfully solving the problems of large computational complexity and high memory usage of existing target detection methods on edge devices, and meeting actual application needs.
[0055] In step S1, a lightweight target detection model based on convolutional neural network is constructed, such as Figure 2 As shown in Figure 1, the model consists of an FF-ELAN module, an EConv module, an MFA module, and a detection head. The FF-ELAN module is used to simultaneously extract both shallow and deep features from the input image. The EConv module replaces traditional convolution with a lightweight convolutional structure to reduce the model's computational complexity while maintaining feature expressiveness. The MFA module implements multi-level feature reuse and cross-feature fusion, and the detection head predicts object class and location. The overall model process is as follows: the input image sequentially passes through multiple FF-ELAN modules for feature extraction. The features output by each FF-ELAN module are processed by the EConv module and then fed into the MFA module for feature fusion. Finally, the fused features are fed into the detection head to complete the object detection task.
[0056] Specifically, the FF-ELAN (Focused Feature Extraction Layer Aggregation Network) module employs a dual-branch architecture consisting of a left branch and a right branch. The left branch processes the input feature map using point-by-point convolution (1x1 convolution), preserving shallow-level features. The right branch extracts deeper features through a multi-layered combination of partial convolutions. Each layer of partial convolution operates on only a subset of the input feature map channels, reducing computational effort and memory access. The output of each partial convolution serves as the input to the next layer, gradually enhancing feature representation. Finally, the outputs of the left and right branches are combined in the channel dimension and fused through point-by-point convolution to generate features rich in semantic information.
[0057] Conventional convolution: Perform global feature extraction on the input feature map to capture the overall information of the image. The formula is as follows:
[0058] ;
[0059] Where, is the convolution output feature map, is the weight of the convolution kernel, is the input feature map, is the bias term.
[0060] Point-by-point convolution: 1x1 convolution is used to reduce and increase the channel dimension of the feature map to reduce the amount of calculation. The formula is as follows:
[0061] ;
[0062] Where, is the point-by-point convolution output feature map, is the point-by-point convolution kernel weight, is the bias term.
[0063] Partial Convolution: Reduces the number of convolutions on the channel, reduces the calculation of irrelevant areas, and focuses more on extracting features in the central area. The calculation amount of partial convolution is only 1 / 2 of that of regular convolution. , significantly reducing computational complexity and memory access. Figure 3 The specific calculation process is as follows:
[0064] ;
[0065] in, is the partial convolution output feature map, and are the height and width of the feature map, is the convolution kernel size, is the number of input channels.
[0066] Through its dual-branch architecture, the FF-ELAN module can simultaneously extract shallow and deep features, enhancing feature diversity. The left branch retains shallow spatial detail information, while the right branch gradually extracts deep semantic information through partial convolution. Ultimately, feature fusion generates combined features with rich semantic information. The use of partial convolution significantly reduces the amount of computation, while the introduction of point-by-point convolution further reduces the computational overhead of the channel dimension. The dual-branch architecture improves the module's computational efficiency through parallel computing, making it particularly suitable for resource-constrained edge devices.
[0067] Furthermore, within the MFA module's structural design, this paper proposes a feature fusion bottleneck block, designed to efficiently fuse multi-level features while significantly reducing computational complexity. This bottleneck block (layer) combines pointwise convolution with depthwise separable convolution to create a highly efficient EConv module, replacing traditional convolution operations. This design not only reduces computational complexity and memory usage but also improves feature fusion efficiency, making it particularly suitable for resource-constrained edge devices.
[0068] Specifically, the MFA module consists of three 1x1 convolutions (point-wise convolutions) and a bottleneck layer. Input data first enters the first 1x1 convolution for channel transformation. Simultaneously, input data from another branch undergoes a second 1x1 convolution before entering the bottleneck layer for feature processing. A third 1x1 convolution also operates on the input data. Finally, the outputs of these three branches converge at a single node to achieve feature fusion, thereby enabling multi-level feature reuse and cross-feature fusion. The EConv module consists of three parts: 1x1 convolutions (point-wise convolutions) at the top and bottom, and a depthwise separable convolution (DSC) in the middle. Input data first undergoes preliminary channel adjustment in the top 1x1 convolution, then enters the middle DSC for operations such as spatial convolution. Finally, the bottom 1x1 convolution performs further processing. The output of the top 1x1 convolution is fused with the output of the bottom 1x1 convolution via a branch, reducing computational complexity while maintaining feature representation. The bottleneck layer consists of two EConv modules and two 1x1 convolutions. Input data first enters the first EConv module for processing, and its output then enters the second EConv module. Simultaneously, the input data also directly enters the second 1x1 convolution through a branch. The output of the first EConv module and the output of the second 1x1 convolution converge at a single node and are finally processed by the first 1x1 convolution, achieving feature fusion and information integration.
[0069] Furthermore, the EConv module decomposes conventional convolution into depthwise separable convolution and pointwise convolution, significantly reducing computational complexity. Depthwise separable convolution performs spatial convolution on each input channel separately, while pointwise convolution adjusts the channel dimension of the output of depthwise separable convolution. Depthwise separable convolution is significantly less computationally intensive than conventional convolution.
[0070] The calculation process of the EConv module is: first perform spatial convolution on the input feature map through depth-wise separable convolution, and the calculation amount is:
[0071] ;
[0072] Where, is the depth-wise separable convolution output feature map, and are the height and width of the feature map, is the convolution kernel size, is the number of input channels.
[0073] Then, the output of the depth-wise separable convolution is subjected to channel dimension reduction or dimension increase by point-by-point convolution. The computational cost is:
[0074]
[0075] Where, Number of output channels.
[0076] The total computational effort of the Econv module is:
[0077]
[0078] Where, Output feature maps for the Econv module. Compared with conventional convolution, the computational complexity of the EConv module is reduced by about 50%.
[0079] Furthermore, the detection head includes a classification branch and a regression branch. The classification branch is used to predict the category probability of the target, and the regression branch is used to predict the location and size of the target. The detection head receives the feature map processed by the FF-ELAN module and the MFA module to detect the target category and location.
[0080] By combining depthwise separable convolution with pointwise convolution, the EConv module significantly reduces computational complexity and memory usage. The bottleneck layer (block) enhances feature diversity and expressiveness through multi-level feature reuse and cross-feature fusion. Pointwise convolution enables information exchange between channels, while depthwise separable convolution preserves rich spatial information. Ultimately, feature fusion generates more discriminative feature maps. The EConv module's highly modular design allows for flexible integration into various network structures, improving overall model performance.
[0081] In step S2, the above model is optimized using a centroid-based pruning algorithm to obtain an optimized model.
[0082] This paper proposes a centroid-distance-based pruning (CDP) algorithm for the post-processing stage of the model. This algorithm aims to significantly reduce the model's computational complexity and memory usage by calculating the centroid of the convolution kernels and removing redundant kernels that are close to the centroid. By systematically identifying and removing redundant kernels, the CDP algorithm optimizes the model structure while maintaining high detection accuracy, making it particularly suitable for resource-constrained edge devices.
[0083] The core idea of the CDP algorithm is to reduce the number of model parameters and computational complexity by calculating the centroid of the convolution kernel and deleting redundant convolution kernels that are close to the centroid. The specific steps are as follows:
[0084] Centroid calculation: For each convolution kernel in the model, calculate its centroid in the spatial dimension. The centroid is the average value of the convolution kernel in the spatial dimension, reflecting the overall distribution characteristics of the convolution kernel in this layer. The centroid calculation formula is as follows:
[0085] ;
[0086] Where, is the centroid of the convolution kernel, Indicates the convolution kernels, is the number of convolution kernels in this layer.
[0087] Distance metric: Calculate the Euclidean distance between each convolution kernel and the centroid, where the Euclidean distance The calculation formula is:
[0088] ;
[0089] Where, is the size of the convolution kernel, and Respectively represent the convolution kernel and the center of mass at the position ( ) at the .
[0090] Pruning strategy: Set a distance threshold and, based on the distance calculation results, delete redundant convolution kernels whose distance from the centroid is less than the distance threshold. Specifically, the distance threshold is adaptively determined based on the distribution characteristics of each layer of convolution kernels. The calculation formula is:
[0091] ;
[0092] Where, is the distance threshold, is the average distance between all convolution kernels and the centroid, is the standard deviation, is the adjustment coefficient.
[0093] By calculating the centroid of the convolution kernels, redundant kernels can be quickly identified and removed, significantly reducing the model's parameter count and computational complexity. Because kernels farther from the centroid are retained, which typically contain more unique information, the pruned model maintains high detection accuracy. The pruning strategy is adaptively adjusted based on the distribution characteristics of each layer's kernels, avoiding the accuracy loss associated with fixed pruning rates in traditional pruning methods.
[0094] The CDP algorithm is particularly well-suited for resource-constrained edge devices, reducing model computational complexity and memory usage while maintaining high detection accuracy. For example, in scenarios with high real-time requirements, such as autonomous driving and security monitoring, the CDP algorithm can significantly improve model inference speed, meeting the demands of low latency and high throughput.
[0095] In step S3, the optimized model is deployed on the edge device.
[0096] In step S4, the edge device uses the optimized model to perform target detection on the collected image data and outputs the detection results.
[0097] Example 2:
[0098] like Figure 4 As shown, the present invention provides a lightweight target detection system based on a convolutional neural network, which is used to implement the lightweight target detection method based on a convolutional neural network in the first embodiment, specifically comprising:
[0099] Model construction module 100 builds a lightweight object detection model based on a convolutional neural network. The model consists of an FF-ELAN module, an EConv module, an MFA module, and a detection head. The FF-ELAN module is used to simultaneously extract shallow and deep features of the input image. The EConv module is used to replace traditional conventional convolution with a lightweight convolution structure to reduce the model's computational complexity while maintaining feature expression capabilities. The MFA module is used to implement multi-level feature reuse and cross-feature fusion. The detection head is used to predict the target category and location.
[0100] The overall process of the model is as follows: the input image passes through multiple FF-ELAN modules in sequence for feature extraction. The features output by each FF-ELAN module are processed by the EConv module and then input into the MFA module for feature fusion. Finally, the fused features are input into the detection head to complete the object detection task.
[0101] The model optimization module 200 is used to optimize the model using a centroid-based pruning algorithm to obtain an optimized model;
[0102] A model deployment module 300 is used to deploy the optimized model on edge devices;
[0103] The target detection module 400 is used by the edge device to perform target detection on the collected image data using the optimized model and output the detection results.
[0104] A lightweight target detection system based on a convolutional neural network in this embodiment is used to implement the aforementioned lightweight target detection method based on a convolutional neural network. Therefore, the specific implementation methods of the lightweight target detection system based on a convolutional neural network can be found in the embodiment part of the lightweight target detection method based on a convolutional neural network mentioned above. For example, the model construction module 100, the model optimization module 200, the model deployment module 300, and the target detection module 400 are respectively used to implement steps S1, S2, S3, and S4 in the aforementioned lightweight target detection method based on a convolutional neural network. Therefore, its specific implementation methods can refer to the descriptions of the corresponding embodiments of each part. In order to avoid redundancy, they will not be repeated here.
[0105] Example 3:
[0106] An embodiment of the present invention provides a computer storage medium storing a computer software product. The computer software product includes several instructions for enabling a computer device to execute the above-mentioned lightweight target detection method based on convolutional neural network.
[0107] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0108] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0109] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0110] Obviously, the above embodiments are merely examples for clarity of explanation and are not intended to limit the implementation methods. Those skilled in the art will appreciate that other variations or modifications can be made based on the above description. It is not necessary and impossible to enumerate all implementation methods here. Obvious variations or modifications arising therefrom remain within the scope of protection of the present invention.
Claims
1. A lightweight target detection method based on convolutional neural network, characterized in that: include: A lightweight object detection model based on a convolutional neural network was constructed. The model consists of an FF-ELAN module, an EConv module, an MFA module, and a detection head. The FF-ELAN module is used to simultaneously extract shallow and deep features of the input image. The EConv module is used to replace traditional conventional convolution with a lightweight convolution structure to reduce the model's computational complexity while maintaining feature expression capabilities. The MFA module is used to implement multi-level feature reuse and cross-feature fusion. The detection head is used to predict the target category and location. The FF-ELAN module adopts a dual-branch structure, including a left branch and a right branch; the left branch uses point-by-point convolution to process the input feature map to retain shallow features; The right branch uses a multi-layer connection combination of partial convolution to extract deep features. The partial convolution of each layer only calculates part of the channels of the input feature map. In the right branch, the output features of the partial convolution of each layer are used as the input of the partial convolution of the next layer, gradually enhancing the feature expression capability. The output features of the left branch and the right branch are combined in the channel dimension to generate combined features, and the combined features are fused through point-by-point convolution to obtain features with rich semantic information. The EConv module consists of three parts: 1x1 convolutions at the top and bottom, and a depthwise separable convolution in the middle. The input data first undergoes preliminary channel adjustment by the top 1x1 convolution, then enters the middle depthwise separable convolution for spatial convolution, and finally is further processed by the bottom 1x1 convolution. At the same time, the output of the top 1x1 convolution is also fused with the output of the bottom 1x1 convolution through a branch. The MFA module consists of three 1x1 convolutions and a bottleneck layer. The input data first enters the first 1x1 convolution for channel transformation; at the same time, the input data of another branch first passes through the second 1x1 convolution and then enters the bottleneck layer for feature processing; the third 1x1 convolution also operates on the input data; finally, the outputs of the three branches converge at a node to achieve feature fusion; wherein the bottleneck layer consists of two EConv modules and two 1x1 convolutions. The input data first enters the first EConv module for processing, and its output then enters the second EConv module; at the same time, the input data also directly enters the second 1x1 convolution through a branch; the output of the second EConv module and the output of the second 1x1 convolution converge at a node, and finally pass through the first 1x1 convolution for processing to achieve feature fusion and information integration; The overall process of the model is as follows: the input image is sequentially passed through multiple FF-ELAN modules for feature extraction. The features output by each FF-ELAN module are processed by the EConv module and then input into the MFA module for feature fusion. Finally, the fused features are input into the detection head to complete the target detection task. The calculation process of the EConv module is as follows: first, spatial convolution is performed on the input feature map through depthwise separable convolution, and then the channel dimension of the output of the depthwise separable convolution is reduced or increased through point-by-point convolution to reduce the amount of calculation and memory usage and achieve feature fusion; Optimizing the model using a centroid-based pruning algorithm to obtain an optimized model, wherein the centroid-based pruning algorithm is used to calculate the centroid of the convolution kernel of each layer in the model and the Euclidean distance between each convolution kernel and the centroid, and setting a distance threshold to delete redundant convolution kernels whose distance from the centroid is less than the distance threshold; Deploying the optimized model on an edge device; The edge device uses the optimized model to perform target detection on the collected image data and outputs the detection results.
2. The lightweight target detection method based on convolutional neural network according to claim 1, characterized in that The MFA module constructs an EConv module through point-by-point convolution and depth-wise separable convolution to replace the traditional conventional convolution operation; the EConv module decomposes the conventional convolution into depth-wise separable convolution and point-by-point convolution. The depth-wise separable convolution performs spatial convolution on each input channel separately, and the point-by-point convolution adjusts the channel dimension of the output of the depth-wise separable convolution.
3. The lightweight target detection method based on convolutional neural network according to claim 1, characterized in that: The centroid-based pruning algorithm includes the following steps: For each convolution kernel in the model, calculate its center of mass in the spatial dimension. The center of mass is the average value of the convolution kernel in the spatial dimension. The calculation formula of the center of mass is as follows: Where, f s is the centroid of the convolution kernel, X i Represents the i-th convolution kernel, and N is the number of convolution kernels in this layer; Calculate the Euclidean distance between each convolution kernel and the centroid, where the Euclidean distance d is calculated as: Where K is the size of the convolution kernel, X i (m,n) and f s (m,n) represent the values of the convolution kernel and the center of mass at position (m,n) respectively; Set a distance threshold and, based on the distance calculation result, delete redundant convolution kernels whose distance from the centroid is less than the distance threshold.
4. The lightweight target detection method based on convolutional neural network according to claim 3, characterized in that: The distance threshold is adaptively determined according to the distribution characteristics of each convolution kernel, and the calculation formula is: t=μ-ασ; Where t is the distance threshold, μ is the average distance between all convolution kernels and the centroid, σ is the standard deviation, and α is the adjustment coefficient.
5. The lightweight target detection method based on convolutional neural network according to claim 1, characterized in that: The detection head includes a classification branch and a regression branch. The classification branch is used to predict the category probability of the target, and the regression branch is used to predict the position and size of the target. The detection head receives the feature map processed by the FF-ELAN module and the MFA module to detect the target category and position.
6. A lightweight target detection system based on convolutional neural network, characterized in that: The system is used to implement the lightweight target detection method based on convolutional neural network according to any one of claims 1 to 5, specifically comprising: A model building module builds a lightweight object detection model based on a convolutional neural network. The model consists of an FF-ELAN module, an EConv module, an MFA module, and a detection head. The FF-ELAN module is used to simultaneously extract shallow and deep features of the input image. The EConv module is used to replace traditional conventional convolution with a lightweight convolution structure to reduce the model's computational complexity while maintaining feature expression capabilities. The MFA module is used to implement multi-level feature reuse and cross-feature fusion. The detection head is used to predict target category and location. The overall process of the model is as follows: the input image is sequentially passed through multiple FF-ELAN modules for feature extraction. The features output by each FF-ELAN module are processed by the EConv module and then input into the MFA module for feature fusion. Finally, the fused features are input into the detection head to complete the target detection task. A model optimization module, configured to optimize the model using a centroid-based pruning algorithm to obtain an optimized model; A model deployment module, configured to deploy the optimized model on an edge device; The target detection module is used for the edge device to perform target detection on the collected image data using the optimized model and output the detection results.
7. A computer storage medium, characterized in that The computer storage medium stores a computer software product, which includes several instructions for enabling a computer device to execute the lightweight target detection method based on convolutional neural network according to any one of claims 1 to 5.
Citation Information
Patent Citations
Lightweight double-branch convolutional neural network for image target detection and detection method thereof
CN114648684A
Lightweight target detection method, and lightweight method and device of target detection model
CN119942137A