Target recognition method, device, electronic device and computer-readable storage medium

By quantizing and updating the parameter of the convolutional neural network model and generating a preset recognition model, the problem of low efficiency and reduced accuracy caused by large parameters in target recognition is solved, and efficient and accurate recognition is achieved Effect.

CN118429756BActive Publication Date: 2024-11-15XIAN SIXTH MIRROR NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410882741.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-03
Publication Date
2024-11-15
Estimated Expiration
2044-07-03

AI Technical Summary

Technical Problem

In the application of target recognition, convolutional neural networks have a slow model inference speed due to large amount of parameters and calculations, and parameter quantization will lead to quantization losses, which affects the recognition accuracy. How to improve the recognition efficiency and ensure the recognition accuracy is a technical problem. .

Method used

By training the pre-constructed original model and quantizing parameters, the distribution of target parameters is updated using the preset update function to control the quantization loss, and a preset recognition model is generated for target recognition.

Benefits of technology

When identifying targets, it not only improves efficiency but also ensures the recognition accuracy, avoids excessive quantization losses affecting the recognition accuracy, and realizes loss control during model quantization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118429756B_ABST
    Figure CN118429756B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of artificial intelligence technology, and provides a target recognition method, device, electronic device and computer-readable storage medium, the method comprising: obtaining an image to be recognized; using a preset recognition model to recognize a target to be recognized in the image to be recognized, and obtaining a recognition result, wherein the preset recognition model is obtained by training a pre-built original model and quantizing the parameters of the trained original model, and in the process of training the original model, the distribution of the target parameters of the original model is updated using a preset update function to control the quantization loss when the parameters of the trained original model are quantized. The present invention can improve the recognition efficiency and ensure the recognition accuracy when recognizing targets.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a target recognition method, device, electronic device and computer-readable storage medium. Background Art

[0002] With the popularity of convolutional neural network applications, more and more devices need to deploy convolutional neural networks. However, due to the large number of parameters and calculations, convolutional neural networks are limited by hardware conditions such as computing power, memory, and power consumption, resulting in slow model inference speed.

[0003] For example, in the application scenario of target recognition, if the number of parameters of the recognition model constructed based on the convolutional neural network is too large, the amount of calculation in the recognition process will be too large, which will greatly affect the efficiency of target recognition. Although parameter quantization of the recognition model can reduce the amount of calculation of the recognition model during recognition, parameter quantization will lead to quantization loss. Excessive quantization loss will affect the recognition accuracy of the recognition model. How to improve the recognition efficiency of the recognition model and ensure the recognition accuracy is a technical problem that needs to be urgently solved by technical personnel in this field. Summary of the invention

[0004] The object of the present invention is to provide a target recognition method, device, electronic device and computer-readable storage medium, which can improve the recognition efficiency and ensure the recognition accuracy during target recognition.

[0005] The embodiments of the present invention can be implemented as follows:

[0006] In a first aspect, the present invention provides a target recognition method, the method comprising:

[0007] Obtain an image to be recognized;

[0008] Using a preset recognition model to recognize the target in the image to be recognized, and obtaining a recognition result, wherein the preset recognition model is obtained by training a pre-constructed original model and performing parameter quantization on the trained original model, and in the process of training the original model, using a preset update function to update the distribution of the target parameters of the original model, so as to control the quantization loss when performing parameter quantization on the trained original model;

[0009] The preset update function is:

[0010] ,in, is the parameter array corresponding to the updated target parameters, is the parameter array corresponding to the target parameters before updating, is the preset learning rate, For use in The loss term for back-propagation loss update, is the back propagation loss, For use in The regularization term for distribution update, is the preset regularization weight, The smaller value of the number of rows and columns of the parameter array corresponding to the target parameter before the update. is the matrix isotropic metric function, , For the matrix No. Large singular values, To take the matrix Sum the elements on the diagonal, To perform the product operation, for The transposed matrix of .

[0011] In an optional implementation manner, the preset recognition model is obtained by:

[0012] Acquire a pre-built original model, wherein the original model includes initial parameters;

[0013] Each time the original model is trained, the target parameters in the current parameters are back-propagated and updated by using the preset update function until the preset training termination condition is met, thereby obtaining the trained original model, wherein the current parameters are the initial parameters during the first training and the current parameters updated during the last training when the training is not the first training;

[0014] The parameters of the trained original model are quantized to obtain the preset recognition model.

[0015] In an optional embodiment, the original model includes a convolutional layer and a fully connected layer, and the target parameters include parameters of the convolutional layer, or the target parameters include parameters of the convolutional layer and parameters of the fully connected layer.

[0016] In a second aspect, the present invention provides a target recognition device, the device comprising:

[0017] An acquisition module, used for acquiring an image to be recognized;

[0018] A recognition module, used for recognizing the target to be recognized in the image to be recognized by using a preset recognition model to obtain a recognition result, wherein the preset recognition model is obtained by training a pre-constructed original model and performing parameter quantization on the trained original model, and in the process of training the original model, the distribution of the target parameters of the original model is updated by using a preset update function to control the quantization loss when the parameters of the trained original model are quantized;

[0019] The preset update function is:

[0020] ,in, is the parameter array corresponding to the updated target parameters, is the parameter array corresponding to the target parameters before updating, is the preset learning rate, For use in The loss term for back-propagation loss update, is the back propagation loss, For use in The regularization term for distribution update, is the preset regularization weight, The smaller value of the number of rows and columns of the parameter array corresponding to the target parameter before the update. is the matrix isotropic metric function, , For the matrix No. Large singular values, To take the matrix Sum the elements on the diagonal, To perform the product operation, for The transposed matrix of .

[0021] In an optional implementation manner, the preset recognition model is obtained by:

[0022] Acquire a pre-built original model, wherein the original model includes initial parameters;

[0023] Each time the original model is trained, the target parameters in the current parameters are back-propagated and updated by using the preset update function until the preset training termination condition is met, thereby obtaining the trained original model, wherein the current parameters are the initial parameters during the first training and the current parameters updated during the last training when the training is not the first training;

[0024] The parameters of the trained original model are quantized to obtain the preset recognition model.

[0025] In an optional embodiment, the original model includes a convolutional layer and a fully connected layer, and the target parameters include parameters of the convolutional layer, or the target parameters include parameters of the convolutional layer and parameters of the fully connected layer.

[0026] In a third aspect, the present invention provides an electronic device, comprising a processor and a memory, wherein the memory is used to store a program, and the processor is used to implement the target recognition method described in the first aspect of the aforementioned implementation mode when executing the program.

[0027] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the target recognition method as described in the first aspect of the aforementioned implementation.

[0028] Compared with the prior art, the present invention utilizes a preset recognition model to recognize a target to be recognized in an image to be recognized and obtains a recognition result. The preset recognition model is obtained by training a pre-constructed original model and quantizing the parameters of the trained original model. Since the distribution of the target parameters of the original model is updated during the training process of the original model, when the parameters of the trained original model are quantized, the quantization loss can be controlled within the expected range based on the target parameters after the distribution update, thereby avoiding excessive quantization loss affecting the recognition accuracy of the preset recognition model obtained by quantization, thereby achieving both improved recognition efficiency and guaranteed recognition accuracy during target recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0030] Figure 1 This is an example flowchart of the target recognition method provided in this embodiment.

[0031] Figure 2 This is an example diagram of the generation process of the preset recognition model provided in this embodiment.

[0032] Figure 3 This is a block diagram of an example of a target recognition device provided in this embodiment.

[0033] Figure 4 An example block diagram of an electronic device provided in this embodiment.

[0034] Icons: 10 - electronic device; 11 - processor; 12 - memory; 13 - bus; 100 - target recognition device; 110 - acquisition module; 120 - recognition module; 130 - generation module. DETAILED DESCRIPTION

[0035] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.

[0036] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0037] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0038] In the description of the present invention, it should be noted that if the terms "upper", "lower", "inside", "outside", etc. appear to indicate an orientation or position relationship, they are based on the orientation or position relationship shown in the accompanying drawings, or are the orientation or position relationship in which the product of the invention is usually placed when used. They are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention.

[0039] In addition, the terms “first”, “second”, etc., if used, are merely used to distinguish between the descriptions and should not be understood as indicating or implying relative importance.

[0040] It should be noted that, in the absence of conflict, the features in the embodiments of the present invention may be combined with each other.

[0041] In order to control the quantization loss within the expected range when quantizing the model and avoid excessive quantization loss affecting the recognition accuracy of the quantized model, this embodiment provides a target recognition method, device, electronic device and computer-readable storage medium, which can improve the recognition efficiency and ensure the recognition accuracy when recognizing the target, and will be described in detail below.

[0042] Please refer to Figure 1 , Figure 1The target recognition method provided in this embodiment includes the following steps:

[0043] Step S101, obtaining an image to be recognized.

[0044] In this embodiment, the source of the image to be identified may be a photo taken by a camera, or a photo read from a photo database, or a frame of image extracted from a video played on a video playback platform.

[0045] Step S102, using a preset recognition model to recognize the target to be recognized in the image to be recognized, and obtaining a recognition result, wherein the preset recognition model is obtained by training a pre-constructed original model and quantizing the parameters of the trained original model, and in the process of training the original model, the distribution of the target parameters of the original model is updated using a preset update function to control the quantization loss when quantizing the parameters of the trained original model.

[0046] In this embodiment, the object of the target to be identified may be an object, an animal, a person, etc. The recognition result may be that the image to be identified includes the target to be identified or does not include the target to be identified. The original model includes, but is not limited to, a model based on CNN (Convolutional Neural Networks), ResNet (Residual Networks), CRNN (Convolutional Recurrent Neural Networks) or a network derived therefrom.

[0047] In this embodiment, the original model includes a convolutional layer and a fully connected layer, wherein the convolutional layer may be one or more, and the fully connected layer may be one or more. The target parameters may include the parameters of the convolutional layer, and the target parameters may also include the parameters of the convolutional layer and the parameters of the fully connected layer. The distribution of the target parameters is updated each time during training, and the parameters of a layer are updated as a whole. For example, the target parameters include the parameters of convolutional layer a, the parameters of convolutional layer b, and the parameters of the fully connected layer. The distribution of the target parameters is updated by updating the distribution of the parameters of convolutional layer a, the parameter distribution of convolutional layer b, and the parameter distribution of the fully connected layer, respectively.

[0048] It should be noted that, in addition to the convolutional layer and the fully connected layer, the original model may also include other processing layers with parameters, such as the activation layer. The above method provided in this embodiment only involves the update of the parameters of the convolutional layer and the fully connected layer. For the parameters of the remaining layers except the convolutional layer and the fully connected layer, the update method of the existing technology can be used.

[0049] In the above method provided by this embodiment, the distribution of the target parameters of the original model is updated during the training process of the original model. Therefore, when the parameters of the trained original model are quantized, the quantization loss can be controlled within the expected range based on the target parameters after the distribution update, thereby avoiding excessive quantization loss affecting the recognition accuracy of the preset recognition model obtained by quantization, and achieving both improved recognition efficiency and guaranteed recognition accuracy during target recognition.

[0050] This embodiment also provides Figure 1 For an example of a way to generate a preset recognition model in Figure 2 , Figure 2 The example diagram of the generation process of the preset recognition model provided in this embodiment includes the following steps:

[0051] Step S201, obtaining a pre-built original model, where the original model includes initial parameters.

[0052] In this embodiment, the initial parameters may be randomly generated or pre-set through configuration.

[0053] Step S202, each time the original model is trained, the target parameters in the current parameters are back-propagated and updated by using a preset update function until the preset training termination condition is met, thereby obtaining the trained original model. The current parameters are the initial parameters during the first training, and are the current parameters updated during the last training when it is not the first training.

[0054] In this embodiment, the preset training termination condition may be that the number of training times reaches the preset number of times or the accuracy of the current original model reaches the preset accuracy. The first training is to update the target parameters in the initial parameters of the original model, and starting from the second training, each time the target parameters updated in the previous training are updated.

[0055] In this embodiment, the preset update function is:

[0056] ,in, is the parameter array corresponding to the updated target parameters, is the parameter array corresponding to the target parameters before updating, is the preset learning rate, For use in The loss term for back-propagation loss update, is the back propagation loss, For use in The regularization term for distribution update, is the preset regularization weight, The smaller value of the number of rows and columns of the parameter array corresponding to the target parameter before the update. is the matrix isotropic metric function, , For the matrix No. Large singular values, To take the matrix Sum the elements on the diagonal, To perform the product operation, for The transposed matrix of .

[0057] In this embodiment, for the convenience of processing, when the preset update function is used to update the target parameters in the first training, the target parameters to be updated are first converted into a parameter array, and the parameter array of the updated target parameters is obtained after updating using the preset update function. Starting from the second training, when updating using the preset update function, the parameter array of the updated target parameters obtained in the previous training can be directly used as the object of updating the preset update function until the training is terminated to obtain the original model after training.

[0058] Step S203, quantizing the parameters of the trained original model to obtain a preset recognition model.

[0059] In order to more fully illustrate the technical effect that can be achieved by the above method provided by this embodiment, this embodiment also describes the derivation process of the above preset update function.

[0060] After an in-depth analysis of the model quantization process, it is found that if you want to control the quantization loss generated during the model quantization process, the model parameters need to meet the following two conditions (these two conditions will be collectively referred to as quantization-friendly distribution conditions):

[0061] (1) The values ​​of the parameters of the convolutional layer and / or fully connected layer are within a relatively small range, and the standard deviation of the parameter values ​​is within a preset deviation range;

[0062] (2) The change ratio between the distribution variance of the output feature map and the distribution variance of the input feature map after activation is less than the preset ratio.

[0063] In order to quantitatively describe the quantization-friendly distribution conditions, the definition is introduced:

[0064] Definition 1: Matrix mean and variance

[0065] For any The real matrix :

[0066] ,in, for The set of real matrices of , For the matrix Middle Row, No. Elements of a column.

[0067] Defining the Mapping and mapping , so that:

[0068] , , For the matrix The mean of For the matrix The variance of For the matrix The element at the i-th row and j-th column in .

[0069] There is a special case here. When, obviously:

[0070] , For the matrix The L2 norm of the matrix Sum the squares of the elements of and then find the square root. For the matrix The transposed matrix of Take the matrix The sum of the elements on the diagonal.

[0071] Linear transformation , for The set of real matrices of The matrix variance for:

[0072] For the matrix Large singular values.

[0073] , For the matrix The spectral radius of the equation is Orthogonal.

[0074] In order to minimize the increase in matrix variance after linear transformation, the spectral radius of the linear transformation needs to be as small as possible. The spectral radius in this formula has an obvious lower bound:

[0075] , the equation in this formula is Orthogonal, that is:

[0076] .

[0077] At this point, we can quantitatively describe the above quantization-friendly distribution conditions. For neural networks, the parameters of the convolutional layer or the fully connected layer are recorded as , the input of the corresponding layer is recorded as .assumed , the above quantization-friendly distribution conditions need to meet the following two requirements:

[0078] (1) As small as possible, the parameters of the convolutional layer or the fully connected layer can obtain a distribution with a relatively small value range and a small standard deviation;

[0079] (2) If As orthogonal as possible, then the change ratio between the distribution variance of the output feature map after activation and the distribution variance of the input feature map can be minimized and controlled within .

[0080] In order to reasonably control the parameter distribution of the model and keep the parameter distribution in a good "state" to avoid the model from falling into overfitting during training, the quantitative friendly distribution conditions described above are applied to the regularization method. To this end, the matrix isotropic metric function is defined :

[0081] , , For the matrix No. Large singular values, To take the matrix Sum the elements on the diagonal, To perform the product operation, for The transposed matrix of .

[0082] This leads to Corollary 1 and Corollary 2:

[0083] Corollary 1: ;like If not satisfied with the rank, .

[0084] The proof process of Corollary 1 is:

[0085] phalanx semidefinite, so .

[0086] ,

[0087] Obviously , if and only if The equality holds when is an orthogonal matrix.

[0088] like If the rank is not satisfied, then there is at least one , obviously there is , .

[0089] It can be concluded that It has the same properties as the quantization-friendly distribution conditions described quantitatively.

[0090] Corollary 2: right It is derivable, and we have:

[0091] ,in, for The Moore-Pensrose pseudoinverse matrix.

[0092] The proof process of Corollary 2 is:

[0093] .

[0094] It can be concluded that As a regularization condition, the quantization-friendly distribution condition described quantitatively above can be satisfied.

[0095] When training parameterized models, weight decay is one of the most widely used regularization techniques to combat overfitting. Weight decay requires adding a regularization term to the loss function that describes the complexity of the model. , transforming the empirical risk minimization problem into structural risk minimization:

[0096] ,in, For structural risk, is the empirical risk, is the regularization term, , is a parameter used to control the importance of the regularization term. In this embodiment, .

[0097] For the convolutional layer and fully connected layer in the convolutional neural network, the parameters of the convolutional layer and the fully connected layer are converted into matrix multiplication through the im2col algorithm. The im2col algorithm is an algorithm used to process matrices. It is used to convert convolution operations into matrix operations to speed up convolution. Its basic principle is to extract each convolution kernel into a row of elements in the matrix and then perform matrix operations. When the bias term is ignored, it can be written as: , its back propagation gradient update algorithm (i.e. the preset update function mentioned above) is rewritten as:

[0098] ,in, is the parameter array corresponding to the updated target parameters, is the parameter array corresponding to the target parameters before updating, is the preset learning rate, For use in The loss term for back-propagation loss update, is the back propagation loss, For use in The regularization term for distribution update, is the preset regularization weight, The smaller value of the number of rows and columns of the parameter array corresponding to the target parameter before the update. is the matrix isotropic metric function, , For the matrix No. Large singular values, To take the matrix Sum the elements on the diagonal, To perform the product operation, for The transposed matrix of .

[0099] It should be noted that the back-propagation gradient update algorithm is a specific implementation method with good mathematical properties, which can obtain relatively ideal quantization effects and control the quantization loss within an ideal range. In fact, the expression that satisfies the above Corollary 1 and Corollary 2 is not unique, and explicit or implicit regularization schemes that can satisfy the variance stability property can be used as alternatives.

[0100] In order to execute the corresponding steps in the above embodiment and each possible implementation method, an implementation method of the target recognition device 100 is given below. Figure 3 , Figure 3 This is a block diagram of the target recognition device provided by the present invention. It should be noted that the basic principles and technical effects of the target recognition device 100 provided by the present invention are the same as those of the corresponding above-mentioned embodiments, which are not mentioned in this embodiment for the sake of brief description.

[0101] The object recognition device 100 includes an acquisition module 110 , a recognition module 120 and a generation module 130 .

[0102] The acquisition module 110 is used to acquire the image to be recognized.

[0103] The recognition module 120 is used to recognize the target to be recognized in the image to be recognized by using a preset recognition model to obtain a recognition result, wherein the preset recognition model is obtained by training a pre-built original model and performing parameter quantization on the trained original model, and in the process of training the original model, the distribution of the target parameters of the original model is updated by using a preset update function to control the quantization loss when the parameters of the trained original model are quantized;

[0104] The preset update function is:

[0105] ,in, is the parameter array corresponding to the updated target parameters, is the parameter array corresponding to the target parameters before updating, is the preset learning rate, For use in The loss term for back-propagation loss update, is the back propagation loss, For use in The regularization term for distribution update, is the preset regularization weight, The smaller value of the number of rows and columns of the parameter array corresponding to the target parameter before the update. is the matrix isotropic metric function, , For the matrix No. Large singular values, To take the matrix Sum the elements on the diagonal, To perform the product operation, for The transposed matrix of .

[0106] The generation module 130 is used to: obtain a pre-built original model, the original model includes initial parameters; each time the original model is trained, the target parameters in the current parameters are back-propagated and updated by using a preset update function until the preset training termination condition is met, thereby obtaining the trained original model, wherein the current parameters are the initial parameters during the first training and are the current parameters updated during the last training when it is not the first training; and the parameters of the trained original model are quantized to obtain a preset recognition model.

[0107] In an optional embodiment, the original model includes a convolutional layer and a fully connected layer, the target parameters include parameters of the convolutional layer, or the target parameters include parameters of the convolutional layer and parameters of the fully connected layer.

[0108] The embodiment of the present invention also provides a block diagram of an electronic device 10. The electronic device 10 implements the target recognition method of the above embodiment. Figure 4 , Figure 4 The block diagram of the electronic device 10 provided by the present invention is shown. The electronic device 10 includes a processor 11, a memory 12 and a bus 13. The processor 11 and the memory 12 are connected via the bus 13.

[0109] The processor 11 may be an integrated circuit chip having the ability to process signals. In the implementation process, each step of the target recognition method of the above embodiment may be completed by an integrated logic circuit of hardware or software instructions in the processor 11. The above processor 11 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable logic gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.

[0110] The memory 12 is used to store a program for implementing the target recognition method of the above embodiment, and the program may be a software function module stored in the memory 12 in the form of software or firmware or fixed in the operating system (OS) of the electronic device 10. After receiving the execution instruction, the processor 11 executes the program to implement the target recognition method disclosed in the above embodiment.

[0111] An embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the target recognition method as described in any one of the aforementioned embodiments is implemented.

[0112] In summary, the embodiments of the present invention provide a target recognition method, device, electronic device and computer-readable storage medium, the method comprising: obtaining an image to be recognized; using a preset recognition model to recognize a target to be recognized in the image to be recognized, and obtaining a recognition result, wherein the preset recognition model is obtained by training a pre-constructed original model and performing parameter quantization on the trained original model, and in the process of training the original model, the distribution of the target parameters of the original model is updated using a preset update function to control the quantization loss when the parameters of the trained original model are quantized; the preset update function is: ,in, is the parameter array corresponding to the updated target parameters, is the parameter array corresponding to the target parameters before updating, is the preset learning rate, For use in The loss term for back-propagation loss update, is the back propagation loss, For use in The regularization term for distribution update, is the preset regularization weight, The smaller value of the number of rows and columns of the parameter array corresponding to the target parameter before the update. is the matrix isotropic metric function, , For the matrix No. Large singular values, To take the matrix Sum the elements on the diagonal, To perform the product operation, for The transposed matrix of . Compared with the prior art, this embodiment has at least the following advantages: (1) During the training process of the original model, the distribution of the target parameters of the original model is updated. Therefore, when the parameters of the trained original model are quantized, the quantization loss can be controlled within the expected range based on the target parameters after the distribution update, avoiding the quantization loss from being too large and affecting the recognition accuracy of the preset recognition model obtained by quantization, thereby achieving both improved recognition efficiency and guaranteed recognition accuracy during target recognition; (2) The preset update function provided by this embodiment can maintain ideal reasoning accuracy even in low-precision quantization; (3) The regularization term provided by this embodiment is equivalent to or even stronger than the matrix condition constraint, and is differentiable and plug-and-play; (4) The method provided by this embodiment is universal and has a wide range of application scenarios.

[0113] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims

1. A target recognition method, characterized in that: The method comprises: Obtain an image to be recognized; Using a preset recognition model to recognize the target to be recognized in the image to be recognized, and obtaining a recognition result, wherein the preset recognition model is obtained by training a pre-constructed original model and quantizing the parameters of the trained original model, and in the process of training the original model, using a preset update function to update the distribution of the target parameters of the original model to control the quantization loss when quantizing the parameters of the trained original model, the original model includes a convolution layer and a fully connected layer, and the target parameters include the parameters of the convolution layer, or the target parameters include the parameters of the convolution layer and the parameters of the fully connected layer; The preset update function is: ,in, is the parameter array corresponding to the updated target parameters, is the parameter array corresponding to the target parameters before updating, is the preset learning rate, For use in The loss term for back-propagation loss update, is the back propagation loss, For use in The regularization term for distribution update, is the preset regularization weight, The smaller value of the number of rows and columns of the parameter array corresponding to the target parameter before the update. is the matrix isotropic metric function, , For the matrix No. Large singular values, To take the matrix Sum the elements on the diagonal, To perform the product operation, for The transposed matrix of The preset recognition model is obtained in the following way: Acquire a pre-built original model, wherein the original model includes initial parameters; Each time the original model is trained, the target parameters in the current parameters are back-propagated and updated by using the preset update function until the preset training termination condition is met, thereby obtaining the trained original model, wherein the current parameters are the initial parameters during the first training and the current parameters updated during the last training when the training is not the first training; The parameters of the trained original model are quantized to obtain the preset recognition model.

2. A target recognition device, characterized in that: The device comprises: An acquisition module, used for acquiring an image to be recognized; A recognition module, used to recognize the target to be recognized in the image to be recognized by using a preset recognition model to obtain a recognition result, wherein the preset recognition model is obtained by training a pre-constructed original model and quantizing the parameters of the trained original model, and in the process of training the original model, the distribution of the target parameters of the original model is updated by using a preset update function to control the quantization loss when the parameters of the trained original model are quantized, and the original model includes a convolution layer and a fully connected layer, and the target parameters include the parameters of the convolution layer, or the target parameters include the parameters of the convolution layer and the parameters of the fully connected layer; The preset update function is: ,in, is the parameter array corresponding to the updated target parameters, is the parameter array corresponding to the target parameters before updating, is the preset learning rate, For use in The loss term for back-propagation loss update, is the back propagation loss, For use in The regularization term for distribution update, is the preset regularization weight, The smaller value of the number of rows and columns of the parameter array corresponding to the target parameter before the update. is the matrix isotropic metric function, , For the matrix No. Large singular values, To take the matrix Sum the elements on the diagonal, To perform the product operation, for The transposed matrix of The preset recognition model is obtained in the following way: Acquire a pre-built original model, wherein the original model includes initial parameters; Each time the original model is trained, the target parameters in the current parameters are back-propagated and updated by using the preset update function until the preset training termination condition is met, thereby obtaining the trained original model, wherein the current parameters are the initial parameters during the first training and the current parameters updated during the last training when the training is not the first training; The parameters of the trained original model are quantized to obtain the preset recognition model.

3. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory is used to store a program, and the processor is used to implement the target recognition method according to claim 1 when executing the program.

4. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor, the target recognition method as claimed in claim 1 is implemented.