Lightweight target recognition device and method based on end side deployment, and computer storage medium
By deploying a lightweight target recognition device on the end side, using binarized neural network, deep separable convolution and inverse residual technology, the original image is subjected to binarized inverse residual processing, which solves the problem of insufficient accuracy of the existing lightweight target recognition model, and realizes the application of high-precision target recognition in resource-constrained environments.
Patent Information
- Application Number
- CN202411801728.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-03-21
AI Technical Summary
The existing lightweight target recognition model has shortcomings in terms of accuracy, especially in end-side devices and embedded systems with limited computing resources and storage space.
Using a lightweight target recognition device based on end-side deployment, the image acquisition module, feature extraction module, analysis and processing module and result output module are combined with binarized neural network, deep separable convolution and inverse residual technology to perform binarized inverse residual processing on the original image to obtain high-precision target recognition results.
While maintaining extremely low model storage and computing requirements, the model accuracy is improved, solving the problem of poor accuracy of existing lightweight target recognition models, and is suitable for end-side devices with resource-constrained.
Smart Images

Figure CN119672310A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of target recognition technology, and in particular to a lightweight target recognition device and method based on terminal side deployment, and a computer storage medium. Background Art
[0002] With the rapid development of science and technology, the field of target recognition has gradually been replaced by computer processing models instead of manual visual inspection, thereby improving the accuracy and efficiency of target recognition. Existing target recognition models are usually implemented based on convolutional neural network (CNN) deep learning algorithms. In order to improve the accuracy of target recognition models, the model depth is getting deeper and deeper, and the complexity of the model is also increasing, resulting in the model occupying a large amount of computing resources and storage space. However, in practical applications, such as end-side devices and embedded systems, their computing power and storage space are limited, so large and complex models are difficult to apply.
[0003] To solve this problem, the research on lightweight models came into being. Existing lightweight model technologies mainly focus on reducing model parameters and computational complexity. For example, using depthwise separable convolution instead of standard convolution can significantly reduce the number of parameters and the amount of computation. However, these methods often sacrifice the depth and channel width of the model, affecting the performance of the model. In addition, some methods use quantization technology to binarize weights and activation functions, which further reduces the storage requirements of the model, but also introduces precision loss. Summary of the invention
[0004] The object of the present invention is to provide a lightweight target recognition device and method based on terminal-side deployment, and a computer storage medium, so as to at least solve the problem of poor accuracy of existing lightweight target recognition models.
[0005] In order to solve the above technical problems, the present invention provides a lightweight target recognition device based on terminal side deployment, comprising: An image acquisition module is used to acquire the original image to be identified; A feature extraction module, used to extract a first feature image from the original image; An analysis and processing module, used for performing binarization inverse residual processing on the first feature image to obtain a second feature image; A result output module is used to obtain a target recognition result according to the second feature image and output the target recognition result.
[0006] Optionally, in the lightweight target recognition device based on terminal-side deployment, the feature extraction module only includes a convolutional layer.
[0007] Optionally, in the lightweight target recognition model based on terminal-side deployment, the analysis and processing module includes: A first binarization neural network unit, used for performing binarization processing on the first feature image to obtain a binarized feature image; A first depthwise separable convolution unit, configured to perform depthwise separable convolution processing on the binary feature image to obtain a third feature image; The first inverse residual unit is used to perform residual calculation and batch normalization processing on the first feature image and the third feature image to obtain the second feature image.
[0008] Optionally, in the lightweight target recognition device based on end-side deployment, the first depth-separable convolution unit includes a first binarization depth convolution layer, a separable convolution layer, a first batch of quantization regularization layers and a first activation function layer, which are arranged in sequence.
[0009] Optionally, in the lightweight target recognition device based on end-side deployment, the convolution kernel of the first binary deep convolution layer is 1×1, so as to amplify the number of channels of the binary feature image by a preset multiple; the convolution kernel of the separable convolution layer is 3×3; and the activation function used by the first activation function layer is the PreLU activation function.
[0010] Optionally, in the lightweight target recognition device based on end-side deployment, the first inverse residual unit includes a second binarization deep convolution layer, a second batch regularization layer, a residual calculation layer and a second activation function layer arranged in sequence.
[0011] Optionally, in the lightweight target recognition device based on end-side deployment, the convolution kernel of the second binary deep convolution layer is 1×1, so as to restore the number of channels of the third feature image to be consistent with the number of channels of the binary feature image; the residual calculation layer is used to perform residual calculation on the first feature image and the third feature image; the activation function used by the second activation function layer is a linear function, which is used to perform linear processing on the output result of the residual calculation layer to obtain the second feature image.
[0012] Optionally, in the lightweight target recognition device based on end-side deployment, the result output module includes a fully connected layer; the fully connected layer is used to obtain the target classification probability based on the input feature image to output the target recognition result.
[0013] Optionally, in the lightweight target recognition device based on terminal-side deployment, the result output module further includes a downsampling submodule arranged before the fully connected layer; the downsampling submodule is used to downsample the second feature image to obtain a fourth feature image; The downsampling submodule includes a second binarization neural network unit, a second depthwise separable convolution unit, two second inverse residual units and a channel link unit; the second binarization neural network unit is used to perform binarization processing on the second feature image; the second depthwise separable convolution unit is used to perform depthwise separable convolution processing on the second feature image processed by the second binarization neural network unit; the two second inverse residual units are respectively used to perform inverse residual processing on the second feature image processed by the second depthwise separable convolution unit, so as to output the first downsampled feature image and the second downsampled feature image respectively; the channel link unit is used to perform channel linking and merging of the first downsampled feature image and the second downsampled feature image, so as to output the fourth feature image.
[0014] Optionally, in the lightweight target recognition device based on terminal-side deployment, the structures and parameters of the two second inverse residual units in the downsampling submodule are the same.
[0015] Optionally, in the lightweight target recognition device based on end-side deployment, the second feature image is input into the two second inverse residual units in the downsampling submodule after average pooling processing, so as to extract image features through inverse residual processing, and obtain the first downsampling feature image and the second downsampling feature image respectively.
[0016] In order to solve the above technical problems, the present invention further provides a lightweight target recognition method based on device-side deployment, which is applied to the lightweight target recognition device based on device-side deployment as described in any one of the above items. The lightweight target recognition method based on device-side deployment includes: Acquire several consecutive frames of original images; Extracting a first feature image from the original image; Performing binarization inverse residual processing on the first feature image to obtain a second feature image; Obtain a target recognition result according to the second feature image, and output the target recognition result.
[0017] In order to solve the above technical problems, the present invention also provides a computer storage medium, which stores an executable program; when the executable program is executed, the lightweight target recognition method based on end-side deployment as described above is implemented.
[0018] The lightweight target recognition device and method based on end-side deployment and computer storage medium provided by the present invention include: an image acquisition module for acquiring the original image to be identified; a feature extraction module for extracting a first feature image from the original image; an analysis and processing module for performing binarization inverse residual processing on the first feature image to obtain a second feature image; a result output module for obtaining a target recognition result according to the second feature image and outputting the target recognition result. The binarization inverse residual processing is performed by the analysis and processing module, which combines the binarization neural network, the depth-separable convolution and the inverse residual, and can achieve the lightweight of the model without sacrificing the model depth and channel width, that is, while maintaining extremely low model storage and computing requirements, the model accuracy is improved, solving the problem of poor accuracy of existing lightweight target recognition models. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 A structural block diagram of a lightweight target recognition model based on device-side deployment provided in this embodiment; Figure 2 This is an architecture diagram of the analysis and processing module provided in this embodiment; Figure 3 A structural block diagram of a lightweight target recognition model based on device-side deployment with a downsampling submodule provided in this embodiment; Figure 4 The architecture diagram of the downsampling submodule provided in this embodiment; Figure 5 A flowchart of a lightweight target recognition method based on terminal-side deployment provided in this embodiment. DETAILED DESCRIPTION
[0020] The following is a further detailed description of the lightweight target recognition model and target recognition method based on end-side deployment proposed in the present invention in combination with the accompanying drawings and specific embodiments. It should be noted that the accompanying drawings are all in a very simplified form and use non-precise proportions, which are only used to conveniently and clearly assist in explaining the purpose of the embodiments of the present invention. In addition, the structure shown in the accompanying drawings is often part of the actual structure. In particular, the emphasis that each drawing needs to show is different, and sometimes different proportions are used.
[0021] It should be noted that the terms "first", "second", etc. in the specification, claims and drawings of the present invention are used to distinguish similar objects in order to describe the embodiments of the present invention, rather than to describe a specific order or sequence. It should be understood that the structures used in this way can be interchanged under appropriate circumstances. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0022] This embodiment provides a lightweight target recognition device based on terminal side deployment, such as Figure 1 As shown, including: An image acquisition module is used to acquire the original image to be identified; A feature extraction module, used to extract a first feature image from the original image; An analysis and processing module, used for performing binarization inverse residual processing on the first feature image to obtain a second feature image; A result output module is used to obtain a target recognition result according to the second feature image and output the target recognition result.
[0023] The lightweight target recognition device based on terminal deployment provided in this embodiment performs binarization inverse residual processing through the analysis and processing module, combines the binarization neural network, deep separable convolution and inverse residual, and can achieve model lightweight without sacrificing model depth and channel width. That is, while maintaining extremely low model storage and computing requirements, it improves the model accuracy and solves the problem of poor accuracy of existing lightweight target recognition models.
[0024] Specifically, in this embodiment, the image acquisition module can acquire a plurality of frames of continuous original images, that is, it can be understood that the image acquisition module can acquire a segment of video images.
[0025] In practical applications, the format and size of the original image can be reasonably set according to actual needs. Also, the method of obtaining the original image is well known to those skilled in the art, and will not be described in detail in this application.
[0026] Furthermore, in order to simplify the model structure as much as possible while ensuring the target recognition effect, in this embodiment, the feature extraction module may only include a convolution layer. The convolution layer for feature extraction can be implemented using an existing conventional CNN convolution layer, so that it can be ensured that the extracted first feature image can retain the information in the original image and retain precision and accuracy during the abstraction process. The specific structure and parameter settings of the conventional CNN convolution layer are well known to those skilled in the art and can be adjusted according to actual needs, so this application will not go into details.
[0027] Furthermore, in this embodiment, if Figure 1 As shown, the analysis and processing module includes a first binarization neural network unit, a first depthwise separable convolution unit and a first inverse residual unit which are arranged in sequence, wherein the first binarization neural network unit is used to perform binarization processing on the first feature image to obtain a binarized feature image; the first depthwise separable convolution unit is used to perform depthwise separable convolution processing on the binarized feature image to obtain a third feature image; the first inverse residual unit is used to perform residual calculation and batch normalization processing on the first feature image and the third feature image to obtain the second feature image.
[0028] In this way, the first feature image is processed sequentially through the organic combination of the binarized neural network unit, the depthwise separable convolution unit and the inverse residual unit, which can achieve the lightweight of the model without sacrificing the model depth and channel width. That is, while maintaining extremely low model storage and computing requirements, the model accuracy is improved, solving the problem of poor accuracy of existing lightweight target recognition models.
[0029] Among them, the binarized neural network (BNN), as an extreme network quantization method, quantizes all weights and activation values to only two possible values (usually -1 and 1), which can significantly reduce the storage requirements of the model and accelerate the calculation process. Although BNN can greatly reduce the storage and calculation pressure of the model, its performance is usually limited by the large loss of precision, especially in complex image processing tasks. To this end, this embodiment combines deep separable convolution and inverse residual, so that while using the binarized neural network to binarize the weights and activation functions, greatly reducing the storage requirements of the model, the deep separable convolution is used to further reduce the calculation amount of the model, while maintaining the depth and channel width of the model, and using the inverse residual to effectively alleviate the information loss problem that may be caused by the binarization process, thereby enhancing the feature extraction ability of the model and improving the accuracy of the model without adding additional parameters and calculations.
[0030] Specifically, in this embodiment, the binarized neural network unit can be implemented using the existing BNN, which will not be described in detail in this application.
[0031] And, in this embodiment, if Figure 2 As shown, the first depthwise separable convolution unit includes a first binarized depthwise convolution layer, a separable convolution layer, a first batch of quantized regularization layers and a first activation function layer which are arranged in sequence.
[0032] In practical applications, the convolution kernel of the first binary depth convolution layer is 1×1, so as to amplify the number of channels of the binary feature image by a preset multiple; the convolution kernel of the separable convolution layer is 3×3; and the activation function used by the first activation function layer is the PreLU activation function.
[0033] And, in this embodiment, if Figure 2 As shown, the inverse residual unit includes a second binarization depth convolution layer, a second batch regularization layer, a residual calculation layer and a second activation function layer which are arranged in sequence.
[0034] In practical applications, the convolution kernel of the second binary deep convolution layer is 1×1, so as to restore the number of channels of the third feature image to be consistent with the number of channels of the binary feature image; the residual calculation layer is used to perform residual calculation on the first feature image and the third feature image; the activation function used by the second activation function layer is a linear function, which is used to perform linear processing on the output result of the residual calculation layer to obtain the second feature image.
[0035] In this way, the binary depthwise convolution is combined with the separable convolution through the first depthwise separable convolution unit, so that the number of parameters of the original binary convolution is reduced again, thereby significantly reducing the amount of calculation and the number of model parameters, which not only effectively improves the computational efficiency of the model, but also effectively reduces the memory usage of the model.
[0036] At the same time, since in the first binarized neural network unit, each input channel is convolved with its corresponding filter, this means that each channel is processed metrically, which effectively reduces the amount of calculation; and in the first depthwise separable convolution unit, point-by-point convolution (1×1 convolution) can be used to linearly combine the output at each position, changing the number of channels. After merging with the binary convolution, the computational complexity can be greatly reduced again on the basis of the original binarized neural network.
[0037] In addition, by using the separable convolution kernel linear bottleneck structure, the first inverse residual unit can effectively extract more complex features, thereby improving the expressiveness of the analysis and processing module. Moreover, the use of the inverse residual unit can better capture features and reduce information loss, which helps to improve the accuracy of the model. In addition, in the first inverse residual unit, the last layer is a linear bottleneck and has no activation function, which helps to retain the expressiveness of high-dimensional features while reducing the computational complexity required at the same dimensional scale.
[0038] The analysis and processing module provided in this embodiment, through the above architectural design, ensures that the computing efficiency is effectively improved and the memory usage is significantly reduced, so that the model has better adaptability on the terminal side (such as embedded devices) or in resource-constrained environments; at the same time, through the above architectural design, it is possible to optimize the information flow and enhance the feature extraction capability, thereby improving the accuracy and expression ability of the model, especially improving the performance of the model in complex tasks.
[0039] Furthermore, in this embodiment, if Figure 1 As shown, the result output module includes a fully connected layer; the fully connected layer is used to obtain the target classification probability according to the input feature image to output the target recognition result.
[0040] Preferably, in order to improve the accuracy of the target recognition result, in this embodiment, Figure 3 As shown, the result output module also includes a downsampling submodule arranged before the fully connected layer; the downsampling submodule is used to downsample the second feature image to obtain a fourth feature image.
[0041] Specifically, in this embodiment, if Figure 4 As shown, the downsampling submodule includes a second binarization neural network unit, a second depthwise separable convolution unit, two second inverse residual units and a channel link unit; the second binarization neural network unit is used to perform binarization processing on the second feature image; the second depthwise separable convolution unit is used to perform depthwise separable convolution processing on the second feature image processed by the second binarization neural network unit; the two second inverse residual units are respectively used to perform inverse residual processing on the second feature image processed by the second depthwise separable convolution unit, so as to respectively output the first downsampled feature image and the second downsampled feature image; the channel link unit is used to perform channel linking and merging of the first downsampled feature image and the second downsampled feature image, so as to output the fourth feature image.
[0042] Among them, in a specific embodiment, the second binarization neural network unit of the downsampling submodule has the same structure as the first binarization neural network unit of the analysis and processing module; the second depthwise separable convolution unit of the downsampling submodule has the same structure as the first depthwise separable convolution unit of the analysis and processing module; the two second inverse residual units of the downsampling submodule have the same structure as the first inverse residual unit of the analysis and processing module. In this way, the difficulty of developing a lightweight target recognition model can be reduced as much as possible while ensuring the consistency and coherence of the downsampling process. Of course, in some situations where real-time analysis of images is not required, the network structure of the downsampling submodule can also be shared with the network structure of the analysis and processing module, thereby improving the utilization of the network structure and simplifying the model structure.
[0043] Furthermore, in this embodiment, the structures and parameters of the two second inverse residual units in the downsampling submodule are the same.
[0044] Preferably, after the second feature image is subjected to average pooling processing, it is input into the two second inverse residual units in the downsampling submodule to extract image features through inverse residual processing to obtain the first downsampling feature image and the second downsampling feature image, respectively. In practical applications, the average pooling parameters can be set according to actual needs, for example, it can be 2×2.
[0045] The lightweight target recognition device provided in this embodiment is activated through lightweight network recognition, so that high-precision target recognition can be achieved with only extremely small storage resource requirements and computing logic requirements. It is not only easy to integrate and deploy on the terminal side, but also can greatly reduce the power consumption of the terminal side equipment.
[0046] This embodiment also provides a lightweight target recognition method based on device-side deployment, which is applied to the lightweight target recognition device based on device-side deployment as described above. Figure 5 As shown, the lightweight target recognition method based on terminal side deployment includes: S1, obtaining several consecutive frames of original images; S2, extracting a first feature image from the original image; S3, performing binarization inverse residual processing on the first feature image to obtain a second feature image; S4, obtaining a target recognition result according to the second feature image, and outputting the target recognition result.
[0047] The lightweight target recognition method based on terminal deployment provided in this embodiment performs binarization inverse residual processing on the first feature image, combines a binarized neural network, a deep separable convolution and an inverse residual, and can achieve model lightweighting without sacrificing model depth and channel width. That is, while maintaining extremely low model storage and computing requirements, it improves model accuracy and solves the problem of poor accuracy of existing lightweight target recognition models.
[0048] Specifically, in this embodiment, step S1, obtaining a plurality of consecutive frames of original images, which can be understood as obtaining a segment of video images. Also, the format and size of the original images can be reasonably set according to actual needs, and this application does not impose any restrictions on this.
[0049] In a specific embodiment, the frame rate of the captured video image may be 1fps, and the resolution may be 224×224. In order to better illustrate the implementation of the target recognition method provided in this embodiment, in this embodiment, the video image and its parameters are used as the basis for description. Those skilled in the art can learn the implementation scheme of the target recognition method provided in this application under other video images and parameters under this embodiment.
[0050] Furthermore, in this embodiment, in step S2, a first feature image is extracted from the original image.
[0051] Specifically, in this embodiment, the existing conventional CNN convolutional layer can be used to process the original image to extract the first feature image. In this way, it can be ensured that the extracted first feature image can retain the information in the original image and retain precision and accuracy during the abstraction process.
[0052] Taking the above example, the accuracy of the obtained first feature image can reach 8 bits.
[0053] Furthermore, in this embodiment, in step S3, binarization inverse residual processing is performed on the first feature image to obtain a second feature image.
[0054] Specifically, in this embodiment, if Figure 2 As shown, the first feature image sequentially enters the first binarization neural network unit, the first depthwise separable convolution unit and the first inverse residual unit for processing.
[0055] First, the first feature image enters the first binarization neural network unit for binarization processing to obtain a binary feature image (C×H×W), where C represents the number of channels, H represents the height of the feature image, and W represents the width of the feature image. The process can be expressed as:
[0056] in, represents the first feature image, represents the binarization operation, Represents the binary feature image.
[0057] The computational complexity of this process can be expressed as: ,in, represents the number of input channels, and K represents the convolution kernel size.
[0058] After that, the binary feature image is input into the first binary deep convolution layer with a convolution kernel of 1×1 for deep convolution, thereby amplifying the original number of channels by a preset multiple ( C×H×W), where Indicates the magnification multiple; then, the feature image with amplified channel number is input into the separable convolution layer with a convolution kernel of 3×3 for convolution processing, and then passes through the first batch of quantization regularization layers for batch regularization and the first activation function layer for activation using the PreLU activation function to obtain the third feature image. This process can be expressed as:
[0059] in, It indicates that the first binary depth convolution layer with a convolution kernel of 1×1 performs a binary convolution for channel enlargement.
[0060] Then, the third feature image is input into the second binarized deep convolution layer with a convolution kernel of 1×1 for deep convolution, thereby compressing the enlarged number of channels back to the original number of channels (C×H×W). This process can be expressed as:
[0061] in, Indicates that the first binary depth convolution layer with a convolution kernel of 1×1 performs a binary convolution with channel compression; The computational complexity of this process can be expressed as: In this way, the computational complexity is further reduced on the basis of the original BNN. That is, by increasing or decreasing the dimension of the feature image, the effect that can be achieved by the high-dimensional convolution kernel can be achieved with a smaller number of parameters, thereby reducing the computational complexity of the model and improving the processing efficiency of the model while ensuring the accuracy of the model.
[0062] Finally, batch regularization is performed in the second batch regularization layer and residual calculation layer is used to perform residual calculation with the first feature image to obtain the second feature image.
[0063] Among them, the process of batch normalization can be expressed as:
[0064] in, represents the network binarization parameter, It means counting the number of 1s in the output binary sequence, and XNOR means exclusive-or-or operation.
[0065] In this way, batch normalization can remove the multiplication process in the binary convolution, simplifying the architecture of the entire model and reducing the memory usage of the model.
[0066] And, the activation process of the activation function can be expressed as:
[0067] in, Represents the PreLU activation function.
[0068] In this embodiment, by combining the binary depth convolution and the separable convolution, the number of parameters of the original 3×3 separable convolution layer can be reduced to 1 / C again. out , where C out Indicates the number of output channels. This significantly reduces the amount of calculation and the number of model parameters, thereby improving calculation efficiency. In addition, as the number of parameters is reduced, the memory usage is also reduced accordingly, and the calculation and memory efficiency are effectively improved, which in turn speeds up the model reasoning efficiency.
[0069] Also, in this embodiment, by using a separable convolution kernel linear bottleneck structure, the first inverse residual unit can effectively extract more complex features, thereby improving the expressive power of the network; in this step, the last layer is a linear bottleneck and has no activation function, which helps to retain the expressive power of high-dimensional features while reducing the computational complexity required at the same dimensional scale.
[0070] Furthermore, in this embodiment, in step S4, the method of obtaining a target recognition result according to the second feature image and outputting the target recognition result includes: S41, down-sampling the second feature image to obtain a fourth feature image.
[0071] Specifically, Figure 3 As shown, first, the second feature image enters the second binarized neural network unit of the downsampling submodule and passes through the 1×1 binarized depth convolution layer of the second depth-separable convolution unit for channel amplification ( C×H×W), and then input to a stride of 2 (the image size becomes half of the original) ( The convolution kernel of c×1 / 2H×1 / 2W) is a 3×3 separable convolution layer, and then enters the PreLU activation function after batch normalization. The process can refer to the relevant process content in step S3.
[0072] Next, the inverse residual calculation process is similar to that in step S3, except that in this step, two second inverse residual units with the same structure are copied. Subsequently, the second feature image is downsampled by 2×2 average pooling (c×1 / 2H×1 / 2W), and then the residual operation is performed with the feature images output by the batch normalization layer in the two second inverse residual units to obtain the first downsampled feature image and the second downsampled feature image.
[0073] Finally, the first down-sampled feature image and the second down-sampled feature image are merged in the channel direction through the channel link unit and output (2C×1 / 2H×1 / 2W).
[0074] S42, obtaining a target recognition result according to the fourth feature image, and outputting the target recognition result.
[0075] Specifically, the fourth feature image passes through a fully connected layer and outputs the probability of the corresponding classification and the target recognition result. The terminal side is activated after receiving the corresponding signal and completes subsequent data processing.
[0076] The lightweight target recognition method based on terminal deployment provided in this embodiment, when applied to the terminal, only requires minimal storage resources and computing logic to achieve high-precision target recognition. In actual application, when a specific event occurs, such as a pre-defined and trained target / event such as a human body or a vehicle, exists in the original image, the lightweight target recognition model can recognize the target in real time, and at the same time, the function of the high-power module on the terminal device can be activated according to the output of the lightweight target recognition model, thereby reducing the power consumption of the terminal device and being able to flexibly and timely mobilize the terminal device function module according to the template recognition process.
[0077] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other. In addition, the different parts between the various embodiments can also be used in combination with each other, and the present invention is not limited to this.
[0078] The lightweight target recognition device and method based on end-side deployment and computer storage medium provided in this embodiment include: an image acquisition module for acquiring the original image to be identified; a feature extraction module for extracting a first feature image from the original image; an analysis and processing module for performing binarization inverse residual processing on the first feature image to obtain a second feature image; a result output module for obtaining a target recognition result based on the second feature image and outputting the target recognition result. By performing binarization inverse residual processing through the analysis and processing module, combined with binarization neural network, deep separable convolution and inverse residual, the model can be lightweight without sacrificing model depth and channel width, that is, while maintaining extremely low model storage and computing requirements, the model accuracy is improved, solving the problem of poor accuracy of existing lightweight target recognition models.
[0079] The above description is only a description of the preferred embodiments of the present invention, and is not intended to limit the scope of the present invention. Any changes or modifications made by a person skilled in the art in the field of the present invention based on the above disclosure shall fall within the scope of protection of the claims.
Claims
1. A lightweight target recognition device based on terminal side deployment, characterized in that: include: An image acquisition module is used to acquire the original image to be identified; A feature extraction module, used to extract a first feature image from the original image; An analysis and processing module, used for performing binarization inverse residual processing on the first feature image to obtain a second feature image; A result output module is used to obtain a target recognition result according to the second feature image and output the target recognition result.
2. The lightweight target recognition device based on terminal side deployment according to claim 1 is characterized in that: The feature extraction module only includes convolutional layers.
3. The lightweight target recognition device based on terminal side deployment according to claim 1 is characterized in that: The analysis and processing module comprises: A first binarization neural network unit, used for performing binarization processing on the first feature image to obtain a binarized feature image; A first depthwise separable convolution unit, configured to perform depthwise separable convolution processing on the binary feature image to obtain a third feature image; The first inverse residual unit is used to perform residual calculation and batch normalization processing on the first feature image and the third feature image to obtain the second feature image.
4. The lightweight target recognition device based on terminal side deployment according to claim 3 is characterized in that: The first depthwise separable convolution unit includes a first binarized depthwise convolution layer, a separable convolution layer, a first batch of quantized regularization layers and a first activation function layer which are arranged in sequence.
5. The lightweight target recognition device based on terminal side deployment according to claim 4 is characterized in that: The convolution kernel of the first binary depth convolution layer is 1×1, so as to amplify the number of channels of the binary feature image by a preset multiple; the convolution kernel of the separable convolution layer is 3×3; The activation function used by the first activation function layer is the PreLU activation function.
6. The lightweight target recognition device based on terminal side deployment according to claim 3 is characterized in that: The first inverse residual unit includes a second binarization depth convolution layer, a second batch regularization layer, a residual calculation layer and a second activation function layer which are arranged in sequence.
7. The lightweight target recognition device based on terminal side deployment according to claim 6 is characterized in that: The convolution kernel of the second binary deep convolution layer is 1×1, so as to restore the number of channels of the third feature image to be consistent with the number of channels of the binary feature image; the residual calculation layer is used to perform residual calculation on the first feature image and the third feature image; the activation function used by the second activation function layer is a linear function, which is used to perform linear processing on the output result of the residual calculation layer to obtain the second feature image.
8. The lightweight target recognition device based on terminal side deployment according to claim 1 is characterized in that: The result output module includes a fully connected layer; the fully connected layer is used to obtain the target classification probability according to the input feature image to output the target recognition result.
9. The lightweight target recognition device based on terminal side deployment according to claim 8 is characterized in that: The result output module further includes a downsampling submodule disposed before the fully connected layer; the downsampling submodule is used to downsample the second feature image to obtain a fourth feature image; The downsampling submodule includes a second binarization neural network unit, a second depthwise separable convolution unit, two second inverse residual units and a channel link unit; the second binarization neural network unit is used to perform binarization processing on the second feature image; the second depthwise separable convolution unit is used to perform depthwise separable convolution processing on the second feature image processed by the second binarization neural network unit; the two second inverse residual units are respectively used to perform inverse residual processing on the second feature image processed by the second depthwise separable convolution unit, so as to output the first downsampled feature image and the second downsampled feature image respectively; the channel link unit is used to perform channel linking and merging of the first downsampled feature image and the second downsampled feature image, so as to output the fourth feature image.
10. The lightweight target recognition device based on terminal side deployment according to claim 9, characterized in that: The structures and parameters of the two second inverse residual units in the downsampling submodule are the same.
11. The lightweight target recognition device based on terminal side deployment according to claim 9, characterized in that: After the second feature image is subjected to average pooling processing, it is input into two second inverse residual units in the downsampling submodule to extract image features through inverse residual processing to obtain the first downsampling feature image and the second downsampling feature image respectively.
12. A lightweight target recognition method based on device-side deployment, applied to the lightweight target recognition device based on device-side deployment as claimed in any one of claims 1 to 11, characterized in that: The lightweight target recognition method based on terminal-side deployment includes: Acquire several consecutive frames of original images; Extracting a first feature image from the original image; Performing binarization inverse residual processing on the first feature image to obtain a second feature image; Obtain a target recognition result according to the second feature image, and output the target recognition result.
13. A computer storage medium, characterized in that: The computer storage medium stores an executable program; when the executable program is executed, the lightweight target recognition method based on terminal-side deployment as described in claim 12 is implemented.