Lightweight deep learning target detection and recognition model and method

By using a lightweight network framework combining the CnTR module and the YOLOv5s algorithm, along with the ReLU activation function and the GIOU loss function, the high computational complexity and low detection accuracy of traditional models are solved, achieving efficient and accurate target detection.

CN119579851BActive Publication Date: 2025-10-24TIANJIN JINHANG INST OF TECH PHYSICS
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411398153.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-09
Publication Date
2025-10-24
Estimated Expiration
2044-10-09

AI Technical Summary

Technical Problem

Traditional deep learning object detection models have high computational complexity and large storage requirements, making them difficult to apply in resource-constrained embedded devices and mobile terminals. Furthermore, traditional loss functions have low detection accuracy and slow convergence speed in complex scenarios.

Method used

Feature extraction is performed using the CnTR module. A lightweight network framework based on the YOLOv5s algorithm is used, which combines the ReLU activation function and the GIOU loss function. By adaptively adjusting the correlation coefficient and model quantization, the model complexity is reduced and the detection accuracy is improved.

Benefits of technology

It achieves efficient target detection in resource-constrained environments, possesses high computational efficiency and high detection accuracy, and is suitable for FPGA platform applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119579851B_ABST
    Figure CN119579851B_ABST
Patent Text Reader

Abstract

The application provides a lightweight deep learning target detection and recognition model and method, which comprises a network framework based on YOLOv5s algorithm for lightweight processing to obtain an overall framework module, a CnTR module is used to process and extract features of an input image through a convolution layer, a RELU activation function, dimension splicing and summation operation to obtain a feature extraction result, a loss function module adopts a GIOU loss function to measure the gap between the prediction and the true value of the model according to the feature extraction result to guide the parameter adjustment of the model, an activation function module adopts a RELU activation function to perform nonlinear transformation on the feature extraction result, and a model quantization module quantizes the parameters and data in the overall framework module, the feature extraction module and the activation function module to reduce the storage requirement and the calculation amount of the model. The application has the advantages of network lightweight, high calculation efficiency, high detection accuracy and adaptation to FPGA platform application, and can realize efficient target detection tasks in a resource-limited environment.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

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

[0002] With the rapid development of deep learning technology, target detection has made remarkable achievements in the field of computer vision. However, traditional deep learning target detection models usually have large computational complexity and storage requirements, which are greatly limited in some resource-constrained scenarios, such as embedded devices, mobile terminals, etc.

[0003] At present, the target detection algorithm based on deep learning mainly includes a region proposal-based method and a regression-based method. Among them, the YOLO series algorithm has attracted widespread attention due to its fast detection speed and high accuracy. However, the original YOLOv5s algorithm still has the problems of large model and high computational complexity, which is difficult to meet the requirements of some application scenarios with strict requirements on computing resources and storage resources.

[0004] In addition, the traditional loss function has the problems of low accuracy and slow convergence speed when dealing with target detection tasks in complex scenes. At the same time, the design of the activation function and the feature extraction module in the model directly affects the performance and efficiency of the model. SUMMARY

[0005] In view of the above defects or deficiencies in the prior art, the present application aims to provide a lightweight deep learning target detection and recognition model and method.

[0006] In a first aspect, the present application provides a lightweight deep learning target detection and recognition model, comprising:

[0007] a feature extraction unit, wherein the feature extraction unit adopts a CnTR module, the CnTR module extracts initial features of different levels of target objects in an input image through a plurality of convolution layers, and then performs nonlinear processing, dimension splicing and summation operation through a RELU activation function to obtain the initial features of different levels of target objects in the input image;

[0008] a target detection unit, wherein the target detection unit comprises an overall framework module, an activation function module and a loss function module obtained by lightweight processing based on a network framework of a YOLOv5s algorithm;

[0009] The overall framework module has an adaptive adjustment strategy that can dynamically optimize a correlation coefficient, wherein the correlation coefficient at least includes a depth coefficient and a width coefficient, the depth coefficient is the extraction degree of different levels of the overall framework module to the initial features, and the width coefficient is the number of neurons and the number of feature channels in each level of the overall framework module.

[0010] The overall framework module fuses different levels of the initial features to obtain high-level features through the adaptive adjustment strategy.

[0011] The activation function module adopts a RELU activation function to perform nonlinear transformation on the high-level features to obtain transformed high-level features.

[0012] The loss function module adopts a GIOU loss function to obtain gradient information and an adjustment direction for adjusting the correlation coefficient of the overall framework module according to the initial features, the high-level features, and the transformed high-level features.

[0013] The overall framework module receives the transformed high-level features and continuously adjusts the correlation coefficient according to the gradient information and the adjustment direction of the correlation coefficient. In the process of continuously adjusting the correlation coefficient of the overall framework module, it iterates repeatedly to output a target detection result corresponding to the initial features, the target detection result at least including a position and a category of the target object in the input image.

[0014] According to the technical scheme provided in the embodiments of the present application, the number of layers of the network framework of the overall framework module is half of the number of layers of the network framework based on the YOLOv5s algorithm.

[0015] According to the technical scheme provided in the embodiments of the present application, the layers of the network framework of the overall framework module that retain the network framework of the YOLOv5s algorithm are adjusted according to the importance of each layer in target detection, the number of neurons, the weight parameters, and the settings of the RELU activation function in the layer, to ensure that the overall framework module outputs the target detection result under the condition of halving the number of layers.

[0016] According to the technical scheme provided in the embodiments of the present application, the feature extraction unit adopts a CnTR module that is a simplified CnTR module, and the simplified CnTR module is a calculation structure composed of a convolution layer, a RELU activation function, dimension splicing, and summation operation.

[0017] According to the technical scheme provided in the embodiments of the present application, the activation function module adopts a RELU activation function to perform nonlinear transformation on the high-level features, and performs nonlinear transformation on each element in the high-level features to obtain transformed high-level features.

[0018] According to the technical scheme provided in the embodiments of the present application, when outputting a target detection result corresponding to the transformed high-level features, the depth coefficient of the overall framework module is 0.20, and the width coefficient is 0.25.

[0019] According to the technical scheme provided in the embodiment of the present application, the convolution layer adopts a convolution kernel and a step size of a specific size to adapt to the feature distribution of the input image; the RELU activation function adopts an adaptive slope adjustment strategy in the activation process to enhance the nonlinear mapping ability for different features; the dimension splicing operation performs dynamic weight distribution according to the importance of the features; and the summation operation combines adaptive weight coefficients to optimize the feature fusion effect.

[0020] According to the technical scheme provided in the embodiment of the present application, the model quantization module converts model parameters represented by 32-bit floating-point numbers into integer numbers represented by low-bit numbers, and the model parameters at least include weights and biases.

[0021] According to the technical scheme provided in the embodiment of the present application, when the GIOU loss function of the loss function module obtains gradient information and an adjustment direction of the correlation coefficient of the overall framework module, a dynamic weight adjustment mechanism is introduced, different weights are given to each sub-item in the GIOU loss function according to different feature extraction stages and task difficulties.

[0022] In a second aspect, the present application provides a lightweight deep learning target detection and recognition method, which is realized based on the lightweight deep learning target detection and recognition model as described above, and includes the following steps:

[0023] Collect and organize an image dataset for target detection, the image dataset including a plurality of images; and pre-process the images to obtain input images;

[0024] Initialize the model, and after the overall framework module, the feature extraction module, the loss function module and the activation function module are in normal initial states, input the input images into the model;

[0025] The feature extraction unit processes and extracts features of the input images through a convolution layer, a RELU activation function, dimension splicing and summation operation, to obtain initial features of different levels of target objects in the input images;

[0026] Input the initial features into the target detection unit to obtain target detection results corresponding to the initial features.

[0027] The loss function module adopts a GIOU loss function; the activation function module adopts a RELU activation function; the overall framework module dynamically optimizes the correlation coefficient of the model through an adaptive adjustment strategy, and continuously adjusts the structure and parameters of the model to improve the performance of the model.

[0028] Compared with the prior art, the beneficial effects of the present application are that: the present application performs lightweight processing based on the network framework of the YOLOv5s algorithm, reduces the number of layers to half of the traditional YOLOv5s algorithm, adopts a CnTR module, performs feature extraction through a simplified convolution layer, a RELU activation function, dimension splicing and summation operation, adopts a RELU activation function to perform nonlinear transformation on the feature extraction result, can quickly and effectively activate features, improve the calculation efficiency of the model, and other measures, so that the model is more suitable for the application of the FPGA platform. FPGA has the advantages of strong parallel processing capability, low power consumption and the like, and can meet the real-time requirements of the model in a resource-limited environment. The lightweight deep learning target detection and recognition model has the advantages of network lightweight, high calculation efficiency, high detection accuracy and adaptation to FPGA platform application, and can realize efficient target detection tasks in a resource-limited environment. BRIEF DESCRIPTION OF DRAWINGS

[0029] Figure 1 A structure diagram of the lightweight deep learning target detection and recognition model provided by the embodiment of the present application is shown in the figure.

[0030] Figure 2 A calculation process diagram of the lightweight deep learning target detection and recognition model provided by the embodiment of the present application is shown in the figure. DETAILED DESCRIPTION

[0031] The present application will be further described in detail below in combination with the drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the related application, and not to limit the application. In addition, it should be noted that only the parts related to the application are shown in the drawings for ease of description.

[0032] It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict. The present application will be described in detail below with reference to the drawings and in combination with the embodiments.

[0033] Embodiment 1

[0034] As mentioned in the background, in order to solve the problems in the prior art, the present application proposes a lightweight deep learning target detection and recognition model, please refer to Figure 1 As shown, it comprises:

[0035] The feature extraction unit adopts a CnTR module, which extracts the initial features of different levels of target objects in the input image through a plurality of convolution layers, and then performs nonlinear processing, dimension splicing and summation operation through a RELU activation function.

[0036] The target detection unit comprises an overall framework module obtained through lightweight processing based on a network framework of a YOLOv5s algorithm, an activation function module, and a loss function module.

[0037] The overall framework module has an adaptive adjustment strategy that can dynamically optimize a correlation coefficient; wherein the correlation coefficient at least includes a depth coefficient and a width coefficient, the depth coefficient is the extraction degree of different levels of the overall framework module to the initial features, and the width coefficient is the number of neurons and the number of feature channels in each level of the overall framework module.

[0038] The overall framework module fuses the initial features of different levels through the adaptive adjustment strategy to obtain high-level features.

[0039] The activation function module adopts a RELU activation function to perform nonlinear transformation on the high-level features to obtain transformed high-level features.

[0040] The loss function module adopts a GIOU loss function to obtain gradient information and an adjustment direction for adjusting the correlation coefficient of the overall framework module according to the initial features, the high-level features, and the transformed high-level features.

[0041] The overall framework module receives the transformed high-level features and continuously adjusts the correlation coefficient according to the gradient information and the adjustment direction of the correlation coefficient. In the process of continuously adjusting the correlation coefficient of the overall framework module, it outputs a target detection result corresponding to the initial features through repeated iteration, wherein the target detection result at least includes the position and category of the target object in the input image.

[0042] Further, when outputting the target detection result corresponding to the transformed high-level features, the depth coefficient of the overall framework module is 0.20, and the width coefficient is 0.25.

[0043] Specifically, the feature extraction module adopts a CnTR module, which processes and extracts features of the input image through a convolution layer (CONV), a RELU activation function (RELU), dimension concatenation (CAT), and summation operation (SUM) to obtain a feature extraction result at least including initial features of different levels of the target object in the input image.

[0044] The loss function module adopts a GIOU loss function, which measures the gap between the model's prediction and the true value according to the feature extraction result during the processing and feature extraction of the feature extraction module, and guides the parameter adjustment of the model.

[0045] An activation function module adopts a RELU activation function to perform nonlinear transformation on the feature extraction result output by the feature extraction module; the local feature information is an important basis for subsequent processing in the activation function module and the overall framework module and for calculation by the loss function module;

[0046] A model quantization module quantizes parameters and data in the overall framework module, the feature extraction module, and the activation function module, thereby reducing storage requirements and computation of the model.

[0047] The overall framework module is subjected to lightweight processing based on a network framework of a YOLOv5s algorithm, and the number of layers is reduced to half of that of a traditional YOLOv5s algorithm, thereby greatly reducing complexity and computation of the model. Meanwhile, through a self-adaptive adjustment strategy, related coefficients such as a depth coefficient and a width coefficient are dynamically optimized, and the model structure can be automatically adjusted according to different tasks and data, thereby improving adaptability and performance of the model.

[0048] In the feature extraction module, a CnTR module is adopted to perform feature extraction through a simplified convolution layer, a RELU activation function, dimension splicing, and summation operation, and unnecessary calculation steps are removed, thereby improving efficiency of feature extraction. The model quantization module quantizes parameters and data in the overall framework module, the feature extraction module, and the activation function module, converts parameters and data originally represented by 32-bit floating-point numbers into integers of low-bit numbers, greatly reduces storage space occupied by the parameters, and in calculation, integer numbers are usually faster than floating-point numbers, thereby reducing complexity and time cost of calculation.

[0049] The activation function module adopts a RELU activation function to perform nonlinear transformation on the feature extraction result, can quickly and effectively activate features, and improves computation efficiency of the model. The loss function module adopts a GIOU loss function to measure a gap between prediction of the model and a true value according to the feature extraction result in the process of feature extraction by the feature extraction module, can more accurately evaluate performance of the model, guide adjustment of parameters of the model, and improve detection precision.

[0050] In the training process, the model quantization module adopts a computation amount compression method for quantization inference, and in the forward propagation process in the training stage, computation is performed by using quantization values, and in the backward propagation process, a loss function for quantization inference is used for optimization. Compared with directly quantizing existing model parameters, this method can better ensure that model precision does not decrease.

[0051] Through network lightweight design, calculation layer simplification and data quantization and the like, the model is more suitable for application of the FPGA platform.

[0052] In conclusion, the lightweight deep learning target detection and recognition model has the advantages of network lightweight, high calculation efficiency, high detection precision and adaptation to FPGA platform application, and can realize efficient target detection task in a resource-limited environment.

[0053] The design concept of the present application is that the present application is optimized based on a YOLOv5s network, and the most prominent feature is flexible structure, and depth_multiple coefficients are introduced to control the depth of the model and width_multiple coefficients are introduced to control the number of convolution kernels. The coefficient depth_multiple is used in the case of number≠1 in the backbone (number=1 represents a functional background layer, such as a down-sampling Conv, Focus, SPP, etc.), that is, a Bottleneck layer is used to control the depth of the model, for example, 0.33 is set in YOLOv5s, so assuming that there are three Bottlenecks in YOLOv5l, there is only one Bottleneck in YOLOv5s. The coefficient width_multiple is used to set the number of convolution kernels of the convolution layer, for example, 0.5 is set in YOLOv5s, and the number of convolution kernels is set to half, since global average pooling GAP, sigmod activation function, one-dimensional convolution and the like are not suitable for FPGA calculation, the present application replaces the sigmod activation function with a RELU activation function, and replaces a CSP module with a CnTR module.

[0054] The RELU activation function can be represented by a formula:

[0055]

[0056] Wherein y is the output result of the RELU activation function, is the value of the pixel point i.

[0057] The CnTR module is composed of multiple residual blocks, and sufficient local features are extracted through dense convolution layers, and the present application simplifies the CnTR module to a calculation structure composed of only CONV, RELU, CAT and SUM. Figure 1 The C3TR structure in the CnTR module refers to an RDB structure containing three residual blocks, the C2TR structure refers to an RDB structure containing two residual blocks, and the C1TR structure refers to an RDB structure containing one residual block.

[0058]

[0059] wherein F* is the output of the previous step; Conv is a convolution layer; is a RELU activation function; indicates the dimension splicing of the result.

[0060] The GIOU loss function is used in the application, only 75 layers are contained, the number of layers is small, and the algorithm does not contain a global average pooling GAP difficult to be laid out to an FPGA, a Sigmod activation function, a one-dimensional convolution and other structures, so that the application is convenient for transplantation to the FPGA.

[0061] Quantization processing of the convolution layer

[0062] The convolution layer calculation process is as shown in Figure 2 , and is modeled as

[0063] Before and after quantization of the input feature map, it can be represented as

[0064]

[0065] In the formula, x represents a floating point value of the input feature map, q x represents a fixed point value of the input feature map, s x is a scaling factor of the quantized input feature map, and z x is an offset of the quantized input feature map, and for a convolution layer, there is only one set of quantization parameters s x and z x .

[0066] Before and after quantization of the weight parameter, it can be represented as

[0067]

[0068] In the formula, w represents a floating point value of the weight, q w represents a fixed point value of the weight, s w is a scaling factor of the quantized weight, and z w is an offset of the quantized weight, and for a convolution layer, there are n sets of quantization parameters s w and z w .

[0069] The process of the convolution layer plus the activation layer is that the input feature map is convolved with the weight and then calculated through the RELU, which can be represented by the formula

[0070]

[0071] In the formula, m represents the dimension of the input feature map, k represents the size of the convolution kernel, bias represents the bias value of the convolution layer, and is obtained through training.

[0072] Due to the effect of the relu function, the floating-point value of the output feature map can be expressed as:

[0073]

[0074] On the other hand, the output feature map is quantized:

[0075]

[0076] In the formula, y represents the floating-point value of the output feature map, q y represents the fixed-point value of the output feature map, s y is the scaling factor of the quantized output feature map, z y is the offset of the quantized output feature map, and for a convolutional layer, there is only one set of quantization parameters s y and z y .

[0077] Substituting the input feature map and the weight quantization formula, the quantized output is:

[0078]

[0079] Because and the relu function value is greater than or equal to 0

[0080] Therefore, q y The numerator and denominator have the same sign, and we discuss the removal of relu in different cases:

[0081]

[0082] For an input of m latitude and an output of n latitude, a convolutional layer with a convolution kernel of m*n*k:

[0083] 、 、 、 There is only one value, 、 There are n values.

[0084] When , for 1:n latitude output:

[0085]

[0086] The great advantage of the SSD algorithm implementation is the relu function activation, which makes the feature map of each layer distributed in the positive real number interval, which makes 、 Constantly 0, greatly simplifying the calculation, and the formula is simplified as:

[0087]

[0088] Let , The formula can be expressed as:

[0089]

[0090] Where M, b are constants, which can be obtained offline.

[0091] In summary, the output of the convolution layer is:

[0092]

[0093] Since the input of each convolution layer is actually the output of the previous convolution layer, there is a relationship between the scaling factors:

[0094] For the k-th convolution layer, Then:

[0095]

[0096] In summary, for the k-th convolution layer, the quantization result of the output feature map can be expressed as:

[0097]

[0098] Loss function design

[0099] The loss function of the target detection task is generally composed of two parts: the bounding box regression loss and the classification loss. Here, the bounding box regression loss and the classification loss used in the experimental training phase are described. The most commonly used calculation index in the bounding box regression loss is the intersection over union (IoU), and the calculation method is as follows:

[0100]

[0101] The intersection over union can obtain the distance between the predicted box and the real box, thus reflecting the detection effect. However, it has the following shortcomings as a loss function:

[0102] If IoU = 0, the overlap degree of the two is also 0, which means that the loss function is 0, and the gradient backpropagation and algorithm training cannot be performed.

[0103] The IoU cannot accurately reflect the overlap degree of the two. The following figure shows three different situations with the same IoU value. It can be seen that the IoU is equal, but the overlap degree is not equal. Figure 1

[0104] Due to the above-mentioned shortcomings of IoU, GIOU overcomes the shortcomings of IoU while fully inheriting the existing advantages of IoU.

[0105] ​Therefore, the application adopts GIOU as the loss function of the bounding box regression. Assuming that the predicted box is A, the real box is B, and C can be represented by the minimum convex closed box containing A and B. The calculation formula of GIOU is as follows:

[0106]

[0107] Similar to IoU, GIOU can also be used as a distance, and the loss can be expressed as follows:

[0108]

[0109] The classification loss in the training stage adopts binary cross-entropy loss (BCE loss). Therefore, as shown in the following formula, the complete loss function is composed of three parts of the bounding box regression loss (the first term), the confidence prediction loss (the second and third terms) and the class prediction loss (the fourth term).

[0110]

[0111] Quantization is the reduction of the number of bits of a numerical value, and the number of bits of a numerical value refers to the way a numerical value is represented. In deep learning applications, the data format used for research and development is generally 32-bit floating point. However, due to the limited computing resources of all platforms of the project, we need to represent a large number of parameter weights and feature maps using 8-bit integer data format under the premise of little loss of model accuracy, so as to obtain similar performance to the floating point model. The most significant advantage of the quantization method is that it can greatly reduce the bandwidth and storage space. For example, the parameter weights and feature maps using 8-bit integers can reduce the bandwidth requirement by 4 times compared to the 32-bit floating point model when performing calculations. In addition, compared with floating point numbers, integer numbers have faster calculation speed, less power consumption and less memory storage requirement.

[0112] The application adopts a calculation amount compression method for quantization inference. Compared with existing methods of the same type, the forward propagation stage of the method will simultaneously add a parameter quantization module and an activation value quantization module. Therefore, the method can simultaneously quantize the feature map, and can use integer numbers for calculation in the inference stage, thereby improving the calculation efficiency of the algorithm model; at the same time, the method uses quantized values for calculation in the forward propagation process in the training stage, and uses a quantization inference loss function for optimization in the backward propagation process. Therefore, compared with directly quantizing the existing model parameters, the method can better ensure that the model accuracy does not decrease.

[0113] For deep learning-based neural network models, there are two types of parameters that need to be quantized, one is the weight of the model, and the other is the activation value of the model, that is, the feature map. Assuming that the weight range of a certain layer is [a, b], the quantization method is: the minimum value of the weight is regarded as a, and the maximum value of the weight is regarded as b, the weight is fine-tuned through training, and the weight range is mapped to [0, 255], so as to be changed to 8-bit integer.

[0114] For activation values, the value is largely dependent on the input of the network. Assuming that the activation value range in the retraining stage is still [a, b], the activation value is updated using the EMA (Exponential moving average) with a smoothing parameter close to 1 during training. The role of EMA is: when the activation value range changes dramatically, it can slow down the trend of change.

[0115] In designing the quantization scheme, we plan to select the mainstream 8-bit quantization precision, and still use 32-bit floating point numbers in the training stage. The combination of the two can optimize the performance of the compressed model (the bias vector also uses 32-bit floating point numbers). When determining the quantization scheme, first determine how to relate the corresponding real value r and the quantized value q. The mapping form between q and r, that is, the quantization formula, is as follows:

[0116]

[0117] Where S and Z are quantization parameters, both of which are constants. After transformation:

[0118]

[0119]

[0120] Move the quantized value in the formula to the left side to get:

[0121] Define as the multiplier O, and get:

[0122]

[0123]

[0124] Since O is obtained by S1, S2 and S3, and S1, S2 and S3 are quantization parameters defined earlier, both of which are constants, it can be known that the value of N is between (0, 1), and thus:

[0125]

[0126] ​​Wherein, n is a non-negative integer, and the value range of O0 is [0.5, 1).

[0127] In order to reduce the number of operations, it is converted to the following form:

[0128]

[0129] Let be defined as , be defined as . Since each and only needs n times of calculation, a total of 2n2 additions are needed, and the remaining calculation cost is mainly concentrated in .

[0130] Next, the quantization matrix formula 3-13 needs to be modified to integrate the bias matrix and the activation matrix, assuming that q1 is the weight matrix and q2 is the activation matrix. The weight and activation value types are both unit8, and the following formula can be obtained:

[0131]

[0132] In order to ensure that the quantized bias addend is int32 added to the addend, the bias matrix needs to be quantized to int32 data type. Therefore, we need to quantize the weight and activation value to 8-bit integer, and the bias matrix is 32-bit integer.

[0133] In a preferred embodiment, in the process of processing and feature extraction by the feature extraction module, the loss function module measures the gap between the prediction of the model and the true value according to the feature extraction result output by the feature extraction module and the intermediate output of the overall framework module, and then adjusts the model parameters.

[0134] In a preferred embodiment, the activation function module performs nonlinear transformation on the feature extraction result output by the feature extraction module, and then transmits the nonlinearly transformed feature extraction result to the subsequent layer in the overall framework module for further feature processing, and provides the feature information processed by the activation function module to the loss function module to guide the parameter adjustment of the model.

[0135] In a preferred embodiment, the feature extraction module adopts a CnTR module which is a simplified CnTR module, and the simplified CnTR module is a calculation structure composed of a convolution layer, a RELU activation function, dimension splicing, and summation operation.

[0136] In a preferred embodiment, the RELU activation function adopted by the activation function module receives the feature extraction result, and performs a nonlinear transformation on each element in the processed image in the feature extraction result.

[0137] In a preferred embodiment, when performing feature extraction, the CnTR module of the feature extraction module adopts a convolution kernel of a specific size and a step length to adapt to the feature distribution of the input image; in the activation process, the RELU activation function adopts an adaptive slope adjustment strategy to enhance the nonlinear mapping ability for different features; the dimension concatenation operation dynamically allocates weights according to the importance of the features, and the summation operation combines adaptive weight coefficients to optimize the feature fusion effect.

[0138] In a preferred embodiment, the model quantization module converts model parameters represented by 32-bit floating-point numbers into integer numbers represented by low-bit numbers, and the model parameters at least include weights and biases.

[0139] In a preferred embodiment, when measuring the gap between the model's prediction and the true value, the GIOU loss function of the loss function module introduces a dynamic weight adjustment mechanism, and according to different feature extraction stages and task difficulties, different weights are given to each sub-item in the GIOU loss function.

[0140] Embodiment 2

[0141] Based on embodiment 1, this embodiment proposes a lightweight deep learning target detection and recognition method, which is realized based on the lightweight deep learning target detection and recognition model as described above, and includes the following steps:

[0142] Collect and organize an image dataset for target detection, which includes a plurality of images; pre-process the images to obtain input images;

[0143] Initialize the model, and after the overall framework module, the feature extraction module, the loss function module, and the activation function module are in a normal initial state, input the input images into the model;

[0144] The feature extraction unit processes and extracts features of the input images through the convolution layer, the RELU activation function, the dimension concatenation, and the summation operation, to obtain different levels of initial features of the target objects in the input images;

[0145] Input the initial features into the target detection unit to obtain the target detection result corresponding to the initial features.

[0146] In the formula, the loss function module adopts a GIOU loss function; the activation function module adopts a RELU activation function; and the overall framework module dynamically optimizes the correlation coefficient of the model through an adaptive adjustment strategy, and continuously adjusts the structure and parameters of the model to improve the performance of the model.

[0147] The principles and implementation manners of the present application are described herein by using specific examples, and the above example descriptions are only used to help understand the method and core idea of the present application. The above descriptions are only preferred implementation manners of the present application. It should be noted that, due to the limited expression of the text, there are infinite specific structures in the objective world. For ordinary skilled persons in the technical field, some improvements, refinements or changes can be made without departing from the principles of the present application, and the above technical features can be combined in an appropriate manner. These improvements, refinements, changes or combinations, or the direct application of the inventive concept and technical solution to other occasions without improvement, shall be regarded as the protection scope of the present application.

Claims

1. A lightweight deep learning target detection and recognition model, characterized in that, The application relates to a target detection method and device. The application comprises: a feature extraction unit, which adopts a CnTR module, wherein the CnTR module extracts initial features of different levels of a target object in an input image through a plurality of convolution layers, carries out nonlinear processing on the initial features through a RELU activation function, carries out dimension splicing and summation operation, and obtains the initial features of different levels of the target object in the input image; a target detection unit, which comprises an overall framework module obtained by carrying out lightweight processing on a network framework based on a YOLOv5s algorithm, an activation function module and a loss function module; the overall framework module has an adaptive adjustment strategy which can dynamically optimize a correlation coefficient; wherein the correlation coefficient at least comprises a depth coefficient and a width coefficient, the depth coefficient is the extraction degree of different levels of the overall framework module to the initial features, and the width coefficient is the number of neurons and the number of feature channels in each level of the overall framework module; the overall framework module fuses the initial features of different levels through the adaptive adjustment strategy to obtain high-level features; the activation function module adopts a RELU activation function to carry out nonlinear transformation on the high-level features to obtain transformed high-level features; the loss function module adopts a GIOU loss function to obtain gradient information and an adjustment direction of the correlation coefficient of the overall framework module according to the initial features, the high-level features and the transformed high-level features; 2. The lightweight deep learning object detection and recognition model of claim 1, wherein: the overall framework module receives the transformed high-level features and continuously adjusts the correlation coefficient according to the gradient information and the adjustment direction of the correlation coefficient; in the process of continuously adjusting the correlation coefficient of the overall framework module, the overall framework module iterates repeatedly to output a target detection result corresponding to the initial features, wherein the target detection result at least comprises the position and the category of the target object in the input image.

3. The lightweight deep learning object detection and recognition model of claim 2, wherein: The number of layers of the network framework of the overall framework module is half of the number of layers of the network framework based on the YOLOv5s algorithm. 4.The lightweight deep learning object detection and recognition model of claim 1, wherein: The layers of the network framework of the overall framework module which remain the network framework of the YOLOv5s algorithm are adjusted according to the importance of each layer in target detection, the number of neurons, the weight parameter and the setting of the RELU activation function in the layer are adjusted to ensure that the overall framework module outputs the target detection result under the condition of halving the number of layers.

5. The lightweight deep learning object detection and recognition model of claim 1, wherein: The feature extraction unit adopts a simplified CnTR module, and the simplified CnTR module is a calculation structure composed of a convolution layer, a RELU activation function, dimension splicing and summation operation.

6. The lightweight deep learning object detection and recognition model of claim 1, wherein: The activation function module adopts a RELU activation function to carry out nonlinear transformation on the high-level features, and carries out nonlinear transformation on each element in the high-level features to obtain transformed high-level features. When outputting the target detection result corresponding to the transformed high-level features, the depth coefficient of the overall framework module is 0.20, and the width coefficient is 0.

25.

7. The lightweight deep learning object detection and recognition model of claim 1, wherein: The convolution layer adopts a convolution kernel and a step size of a specific size to adapt to the feature distribution of the input image; the RELU activation function adopts an adaptive slope adjustment strategy in the activation process to enhance the nonlinear mapping ability of different features, the dimension splicing operation dynamically allocates weights according to the importance of the features, and the summation operation combines adaptive weight coefficients to optimize the feature fusion effect. 8.The lightweight deep learning object detection and recognition model of claim 1, wherein: The model quantization module converts model parameters represented by 32-bit floating-point numbers into integer numbers represented by low-bit numbers, and the model parameters at least include weights and biases. 9.The lightweight deep learning object detection and recognition model of claim 1, wherein: The GIOU loss function of the loss function module introduces a dynamic weight adjustment mechanism when obtaining gradient information and adjustment direction of the correlation coefficient of the overall framework module, and different weights are given to each sub-item in the GIOU loss function according to different feature extraction stages and task difficulties.

10. A lightweight deep learning target detection and recognition method based on the lightweight deep learning target detection and recognition model of any one of claims 1-9, characterized in that, The method comprises the following steps: Collect and organize an image dataset for target detection, the image dataset comprising a plurality of images; pre-process the images to obtain input images; Initialize the model, input the input images into the model after the overall framework module, the feature extraction module, the loss function module and the activation function module are in normal initial states; The feature extraction unit processes and extracts features of the input images through a convolution layer, a RELU activation function, dimension splicing and summation operation to obtain initial features of different levels of target objects in the input images; Input the initial features into the target detection unit to obtain target detection results corresponding to the initial features; The loss function module adopts a GIOU loss function; the activation function module adopts a RELU activation function; the overall framework module dynamically optimizes the correlation coefficient of the model through an adaptive adjustment strategy, and continuously adjusts the structure and parameters of the model to improve the performance of the model.

Citation Information

Patent Citations

  • Lightweight target detection method and system for edge equipment

    CN117036730A

  • Lightweight CASL-YOLO fall detection method and system in complex environment

    CN117935370A