Neural network model, image recognition method and device suitable for edge devices
By designing a neural network model suitable for embedded devices in edge devices and using breathing modules and intermediate convolution units to reduce the amount of parameters and memory requirements, the problem of difficult image processing in embedded devices is solved and efficient image recognition is achieved.
Patent Information
- Application Number
- CN202210990859.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-18
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2042-08-18
AI Technical Summary
Embedded devices have small memory and slow data processing speed, which makes image processing difficult. The existing lightweight deep learning network framework still has high memory requirements.
A neural network model suitable for edge devices is designed, including the initial convolution unit, breathing module and fully connected layer. The breathing module uses fewer convolution kernels and activation layers through the series breathing unit and intermediate convolution unit. , reducing the Featuremap size and parameter amount, and setting up a batch normalization layer, a discarding layer and a pooling layer in the model to improve the efficiency and flexibility of the model.
The model runs effectively in a small memory space, reduces memory requirements, improves the accuracy and efficiency of image processing, and can flexibly solve classification and regression problems in image processing.
Smart Images

Figure CN115273060B
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of data processing technology, and specifically relates to a neural network model, an image recognition method and a device suitable for edge devices. Background Art
[0002] At present, the image processing technology, which is currently popular in the field of artificial intelligence, has received more and more attention in the embedded field and is providing a more intelligent experience for human life, such as: camera face recognition, license plate positioning, mobile phone beauty camera, etc. However, since the embedded system itself has the characteristics of small memory capacity and limited data processing speed, and the image data has a large amount of information and has high requirements for memory space and data processing speed, the development of graphics processing technology in embedded systems has increased difficulty.
[0003] In order to realize image processing within the limited memory space of embedded devices, related technologies have borrowed lightweight deep learning network frameworks such as MobileNet and LeNet. However, the memory required by these frameworks is still high for embedded devices with smaller memory. Summary of the invention
[0004] One of the purposes of the present invention is to provide a neural network model, image recognition method and device suitable for edge devices, so as to solve the problem of small memory and slow data processing speed of embedded devices leading to difficulty in image processing mentioned in the background technology.
[0005] To achieve the above object, the present invention provides the following technical solutions:
[0006] A neural network model suitable for edge devices, comprising an initial convolution unit, a breathing module and a fully connected layer connected in series; the initial convolution unit comprises at least one initial convolution layer; the breathing module comprises at least one breathing unit, the breathing units are arranged in sequence, and the breathing unit comprises a first breathing convolution layer, a second breathing convolution layer and an activation layer; wherein,
[0007] The first breathing convolution layer and the second breathing convolution layer are sequentially connected in series, and the number of convolution kernels of the first breathing convolution layer is configured to be smaller than the number of channels of input data of the breathing unit; the activation layer is cooperatively arranged after the second breathing convolution layer.
[0008] Preferably, in the breathing unit, a batch normalization layer is arranged between the second breathing convolution layer and the activation layer, and the batch normalization layer is configured to standardize the data distribution to have a mean of 0 and a variance of 1.
[0009] Preferably, the breathing unit further comprises a discarding layer, which is arranged after the activation layer, and the discarding layer is configured to discard a preset proportion of data information.
[0010] Preferably, the breathing unit further comprises a pooling layer, and the pooling layer is arranged between the second breathing convolution layer and the activation layer or after the activation layer.
[0011] Preferably, in the breathing module, an intermediate convolution unit is arranged between any adjacent breathing units, and the intermediate convolution unit includes at least one intermediate convolution layer.
[0012] An image recognition method comprises the following steps:
[0013] Connecting an output unit after the neural network model suitable for edge devices to obtain an image recognition model;
[0014] If image recognition is a classification problem, the output unit includes an activation layer softmax and a classification layer connected in sequence; if image recognition is a regression problem, the output unit includes a regression layer;
[0015] Input the image data into the trained image recognition model to obtain the image recognition result.
[0016] Preferably, the image recognition method comprises:
[0017] Acquire a plurality of pointer meter images and a plurality of pointer meter readings corresponding to the plurality of pointer meter images;
[0018] Inputting the plurality of pointer meter images and the plurality of pointer meter readings into the image recognition model for training to obtain a trained image recognition model;
[0019] The pointer meter image to be identified is input into the trained image recognition model to obtain the pointer meter reading prediction value corresponding to the pointer meter image to be identified.
[0020] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the image recognition method when executing the computer program.
[0021] A computer-readable storage medium stores a computer program, which implements the image recognition method when executed by a processor.
[0022] A computer program product comprises a computer program, which implements the image recognition method when executed by a processor.
[0023] Compared with the prior art, the present invention has the following beneficial effects:
[0024] The neural network model suitable for edge devices of the present invention has a smaller feature map by setting a breathing unit, which reduces the amount of parameters that need to be learned and reduces the memory requirement, so it can be used in embedded devices with small memory space; in addition, by using common operators, it is easy to use various reasoning frameworks and can also obtain better results in deeper network structures; the framework is highly flexible and can flexibly solve classification and regression problems in image processing according to actual needs. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 It is a schematic diagram of the structure of the neural network model applicable to edge devices of the present invention.
[0026] Figure 2 The figure is a schematic diagram of a specific network structure of a neural network model applicable to edge devices according to an embodiment of the present invention.
[0027] Figure 3 For the regression problem Figure 2 Schematic diagram of network parameters of a neural network model suitable for edge devices.
[0028] Figure 4 For classification problems Figure 2 Schematic diagram of network parameters of a neural network model suitable for edge devices.
[0029] Figure 5 This is an example of a pointer table image. DETAILED DESCRIPTION
[0030] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work belong to the protection scope of the present invention.
[0031] Reference Figure 1 As shown, a neural network model suitable for edge devices includes an initial convolution unit, a breathing module and a fully connected layer connected in series in sequence; the initial convolution unit includes at least one initial convolution layer; the breathing module includes at least one breathing unit, and the breathing units are arranged in sequence, and the breathing unit includes a first breathing convolution layer, a second breathing convolution layer and an activation layer; wherein the first breathing convolution layer and the second breathing convolution layer are connected in series in sequence, and the number of convolution kernels of the first breathing convolution layer is configured to be less than the number of channels of the input data of the breathing unit; the activation layer is arranged after the second breathing convolution layer.
[0032] In the neural network model, the original input image is used as the input of the initial convolution unit, the output of the initial convolution unit is used as the input of the breathing module, and the input of the breathing module is used as the input of the fully connected layer, and finally the output result of the fully connected layer is obtained. In the initial convolution unit, there is at least one initial convolution layer, which is used to extract the features of the original input image. Generally, the number of convolution kernels of the initial convolution layer is greater than the number of channels of the original input image, that is, greater than 3 (the number of channels of the original input image), so that the number of output channels of the initial convolution layer is greater than 3. Of course, in the initial convolution unit, including but not limited to the initial convolution layer, a batch normalization layer, an activation layer relu, a pooling layer, etc. can also be set, and those skilled in the art can set them according to actual conditions.
[0033] In the breathing unit, the first breathing convolution layer and the second breathing convolution layer can be any convolution layer used to extract image features in the prior art. Through the two consecutive convolution layers of the first breathing convolution layer and the second breathing convolution layer, image features of appropriate depth can be extracted, and the first breathing convolution layer effectively reduces the size of the feature map by using fewer convolution kernels (the number of convolution kernels determines the number of channels of the output data, and the number of channels of the output data is the number of feature maps), thereby reducing the number of parameters and reducing the memory of the model.
[0034] Generally, the number of convolution kernels of the second breathing convolution layer will be set to be greater than the number of convolution kernels of the first breathing convolution layer, so as to extract more features. Of course, the second breathing convolution layer can also be set to be less than or equal to the number of convolution kernels of the first breathing convolution layer. Those skilled in the art can set it according to actual conditions.
[0035] In the breathing unit, the activation layer is a ReLu activation function. By setting the ReLu activation function, gradient descent and back propagation can be more efficient: the gradient explosion and gradient vanishing problems are avoided; and other complex activation functions such as exponential functions are not set in the model, while reducing the overall computational cost of the neural network.
[0036] In the breathing module, when there is only one breathing unit, the output of the breathing unit is directly used as the input of the fully connected layer, and when there are more than two breathing units, the breathing module constructed by the breathing units is in a serial form.
[0037] Furthermore, the breathing unit may also include one or more layers of a batch normalization layer, a discard layer, and a pooling layer.
[0038] The batch normalization layer is configured to normalize the data distribution to a mean of 0 and a variance of 1. The batch normalization layer is preferably arranged after the second breathing convolution layer, and a Relu activation function is connected after the batch normalization layer. The batch normalization layer is used to normalize the data so that it obeys the same distribution, thereby improving the generalization ability of the model and accelerating the convergence speed of the model.
[0039] The drop layer is configured to drop a preset proportion of data information. The drop layer is preferably arranged after the activation layer Relu activation function. The drop layer preferably has a drop rate of 50%, which can reduce the model complexity and avoid overfitting to a certain extent, thereby training a better model and improving the model recognition accuracy.
[0040] The pooling layer includes an average pooling layer or a maximum pooling layer. The pooling layer can reduce the feature dimension, that is, the dimension of the feature map, reduce parameters, reduce the amount of calculation, and maintain the invariance of image rotation, translation, scaling, etc. The pooling layer is preferably arranged after the activation layer or between the second breathing convolution layer and the activation layer; when a batch normalization layer is arranged between the second breathing convolution layer and the activation layer, the pooling layer is preferably arranged between the second breathing convolution layer and the batch normalization layer, and when a drop layer is connected after the activation layer, the pooling layer is preferably arranged after the drop layer.
[0041] It should be noted here that the specific positions of the batch normalization layer, the discard layer, and the pooling layer are set by conventional technical means in the field and can be set by those skilled in the art according to actual conditions.
[0042] Furthermore, in the breathing module, an intermediate convolution unit is arranged between any adjacent breathing units, and the intermediate convolution unit includes at least one intermediate convolution layer.
[0043] In the present invention, by setting an intermediate convolution unit between two breathing units, the extracted features are richer, thereby improving the accuracy of the prediction. It should be noted here that not all adjacent breathing units must be provided with an intermediate convolution unit, and those skilled in the art may set an intermediate convolution unit between any two adjacent breathing units according to actual conditions. The intermediate convolution layer in the intermediate convolution unit may be any convolution layer in the prior art, and the convolution kernel of the intermediate convolution layer is greater than or equal to the number of channels of the input data of the intermediate convolution layer. In the intermediate convolution unit, there may be multiple intermediate convolution layers, and of course there may also be other layers except the intermediate convolution layer, such as batch normalization layer, activation layer, pooling layer, etc.
[0044] Figure 2 The neural network model structure (i.e., SimpleNet network model) of the embodiment of the present invention is shown. Figure 2 As shown, the neural network model includes an initial convolution unit, a breathing module and a fully connected layer connected in series.
[0045] In this embodiment, the size of the image to be input is set to 160x120x3, with a width of 160, a height of 120, and a depth of 3.
[0046] The initial convolution unit includes a first convolution layer conv_1, a second convolution layer conv_2, a first batch normalization layer BatchNorm_1 and a first activation layer Relu_1 which are connected in series in sequence. In this embodiment, the convolution kernel size of the first convolution layer conv_1 is 5x5 (determines the output layer feature size), the number of convolution kernel channels: 3, and the number of convolution kernels: 4 (determines the number of output channels). The convolution kernel size of the second convolution layer conv_2 is 5x5, the number of convolution kernel channels: 4, and the number of convolution kernels: 8. Here, since the number of channels of the image to be input is 3, the number of convolution kernels of the first convolution layer conv_1 is set to 4, so that the number of output channels is greater than 3. Refer to Figure 3 and Figure 4 As shown, the image size output by the first convolutional layer conv_1 of the input image is 160x120x4, and the total number of learnable parameters of the first convolutional layer conv_1 is 304; the image size output by the second convolutional layer conv_2 is 160x120x8, and the total number of learnable parameters of the second convolutional layer conv_2 is 808; the image size output by the first batch normalization layer BatchNorm_1 is 160x120x8, and the total number of learnable parameters of the first batch normalization layer BatchNorm_1 is 16; the image size output by the first activation layer Relu_1 is 160x120x8, and the total number of learnable parameters of the first activation layer Relu_1 is 0.
[0047] The breathing module includes 6 breathing units connected in sequence, an intermediate convolution unit is connected between the second breathing unit and the third breathing unit, and an intermediate convolution unit is also connected between the fourth breathing unit and the fifth breathing unit.
[0048] The first breathing unit includes a third convolutional layer conv_3, a fourth convolutional layer conv_4, a second batch normalization layer BatchNorm_2, a second activation layer Relu_2, and a first average pooling layer AvgPool2d_1 connected in series. In this embodiment, the convolution kernel size of the third convolutional layer conv_3 is 5x5, the number of convolution kernel channels is 8, and the number of convolution kernels is 4. The convolution kernel size of the fourth convolutional layer conv_4 is 5x5, the number of convolution kernel channels is 4, and the number of convolution kernels is 8. Here, since the number of channels of the image output by the first convolutional unit is 8, and the image is used as the input image of the first breathing unit, the number of convolution kernels of the third convolutional layer conv4 is set to 4, which effectively reduces the size of the feature map.
[0049] The second breathing unit includes a fifth convolutional layer conv_5, a sixth convolutional layer conv_6, a third batch normalization layer BatchNorm_3, a third activation layer Relu_3, a first dropout layer Dropout_1, and a second average pooling layer AvgPool2d_2 connected in series. In this embodiment, the convolution kernel size of the fifth convolutional layer conv_5 is 5x5, the number of convolution kernel channels is 8, and the number of convolution kernels is 4. The convolution kernel size of the sixth convolutional layer conv_6 is 5x5, the number of convolution kernel channels is 4, and the number of convolution kernels is 8.
[0050] The intermediate convolution unit arranged between the second breathing unit and the third breathing unit includes the seventh convolution layer conv_7, the eighth convolution layer conv_8, the fourth batch normalization layer BatchNorm_4, the fourth activation layer Relu_4 and the third average pooling layer AvgPool2d_3 connected in series in sequence. In this embodiment, the convolution kernel size of the seventh convolution layer conv_7 is 5x5, the number of convolution kernel channels is 8, and the number of convolution kernels is 8. The convolution kernel size of the eighth convolution layer conv_8 is 5x5, the number of convolution kernel channels is 8, and the number of convolution kernels is 16.
[0051] The third breathing unit includes the ninth convolution layer conv_9, the tenth convolution layer conv_10, the fifth batch normalization layer BatchNorm_5, the fifth activation layer Relu_5 and the fourth average pooling layer AvgPool2d_4 connected in series. In this embodiment, the convolution kernel size of the ninth convolution layer conv_9 is 5x5, the number of convolution kernel channels is 16, and the number of convolution kernels is 8. The convolution kernel size of the tenth convolution layer conv_10 is 5x5, the number of convolution kernel channels is 8, and the number of convolution kernels is 16.
[0052] The fourth breathing unit includes the eleventh convolution layer conv_11, the twelfth convolution layer conv_12, the sixth batch normalization layer BatchNorm_6, the sixth activation layer Relu_6, the second dropout layer Dropout_2 and the fifth average pooling layer AvgPool2d_5, which are connected in series in sequence. In this embodiment, the convolution kernel size of the eleventh convolution layer conv_11 is 5x5, the number of convolution kernel channels: 16, and the number of convolution kernels: 8. The convolution kernel size of the twelfth convolution layer conv_12 is 5x5, the number of convolution kernel channels: 8, and the number of convolution kernels: 16. The second dropout layer Dropout_2 discards 50% of redundant neurons.
[0053] The intermediate convolution units set in the 4th and 5th breathing units include the 13th convolution layer conv_13, the 14th convolution layer conv_14, the 7th batch normalization layer BatchNorm_7, the 7th activation layer Relu_7 and the 6th average pooling layer AvgPool2d_6 connected in series. In this embodiment, the convolution kernel size of the 13th convolution layer conv_13 is 5x5, the number of convolution kernel channels is 16, and the number of convolution kernels is 16. The convolution kernel size of the 14th convolution layer conv_14 is 5x5, the number of convolution kernel channels is 16, and the number of convolution kernels is 32.
[0054] The fifth breathing unit includes the fifteenth convolution layer conv_15, the sixteenth convolution layer conv_16, the eighth batch normalization layer BatchNorm_8 and the eighth activation layer Relu_8 connected in series. In this embodiment, the convolution kernel size of the fifteenth convolution layer conv_15 is 5x5, the number of convolution kernel channels is 32, and the number of convolution kernels is 16. The convolution kernel size of the sixteenth convolution layer conv_16 is 5x5, the number of convolution kernel channels is 16, and the number of convolution kernels is 32.
[0055] The sixth breathing unit includes the seventeenth convolution layer conv_17, the eighteenth convolution layer conv_18, the ninth activation layer Relu_9, the third dropout layer Dropout_3, the fully connected layer fc and the regression output layer. In this embodiment, the convolution kernel size of the seventeenth convolution layer conv_17 is 5x5, the number of convolution kernel channels: 32, and the number of convolution kernels: 16. The convolution kernel size of the eighteenth convolution layer conv_18 is 5x5, the number of convolution kernel channels: 16, and the number of convolution kernels: 32. The third dropout layer Dropout_3 discards 20% of redundant neurons.
[0056] In the above embodiment, the use of a 5x5 convolution kernel can better capture image feature information and improve accuracy compared to the use of a 3x3 convolution kernel in the related art. In addition, the number of convolution kernels in the first convolution layer conv_1 to the eighteenth convolution layer conv_18 is not in a monotonically increasing form, but is dynamically scaled. For example, the number of convolution kernels in the first convolution layer is 4, the number of convolution kernels in the second convolution layer is expanded to 8, and the number of convolution kernels in the third convolution layer is reduced to 4 again. The scaling method effectively reduces the size of the feature map and the amount of parameter learning, thereby reducing the calculation time and improving the calculation efficiency.
[0057] The present invention discloses an image recognition method, which uses an image recognition model to perform image recognition. The image recognition model is composed of a neural network model suitable for edge devices and an output unit. The output unit is arranged after the neural network model suitable for edge devices, specifically, the output unit is connected after the fully connected layer. Figure 3 and Figure 4 When the image recognition is a classification problem, the fully connected layer fc is connected to the Softmax activation function and the classification layer in sequence; when encountering a regression problem, the fully connected layer fc is connected to the regression layer mae. This image recognition method is to input image data into the trained image recognition model to obtain image recognition results.
[0058] For example, Figure 2 The simplenet network model in is applied to the reading recognition of the pointer meter image. Then the regression layer mae is connected after the fully connected layer fc in the simplenet network model to form an image recognition model. For details, refer to Figure 3 As shown; the reading recognition of the pointer meter image based on the image recognition model includes the following steps:
[0059] (1-1) Acquire a plurality of pointer meter images and a plurality of pointer meter readings corresponding to the plurality of pointer meter images; take the pointer meter images and the corresponding pointer meter readings as a sample, and construct a sample set consisting of a plurality of samples; it should be noted here that the pointer meter readings are normalized pointer meter readings.
[0060] (1-2) Training through sample sets: Input multiple samples into the Figure 2 and Figure 3 The image recognition model shown in the figure is trained to obtain a trained image recognition model.
[0061] (1-3) Inputting the pointer meter image to be identified into the trained image recognition model to obtain the pointer meter reading prediction value corresponding to the pointer meter image to be identified, wherein the prediction value is the normalized reading.
[0062] In this embodiment, the pooling layer set in the breathing unit and the intermediate convolution unit in the breathing module is preferably an average pooling layer. Compared with the maximum pooling layer, the average pooling layer can retain more information of the pointer meter image and is more suitable for pointer meter reading recognition.
[0063] In this embodiment, the image recognition model uses the objective function of the L1 regularization term to calculate the gradient, thereby training the image recognition model. The robustness of L1 to noise is better than that of the L2 regularization term, and is more suitable for pointer meter reading recognition.
[0064] In this embodiment, Here, the initial reading is defined as the reading on the left side of the pointer meter, which is generally the minimum value of the pointer meter; the final reading is defined as the reading on the right side of the pointer meter, which is generally the maximum value of the pointer meter; of course, the final reading does not have to be greater than the initial reading, and technicians in this field can set it according to actual conditions.
[0065] For example, using Figure 2 and Figure 3 The network structure in Figure 5 The pointer table image in is used to read the normalized value. Figure 5 Calculation results of (a): The normalized reading is 0.1698, which is converted into a reading of 20.4, and the actual reading is about 19.5; Figure 5 Calculation result of (b): The normalized reading is 0.3325, which is converted to a reading of 66.5, and the actual reading is approximately 67.5.
[0066] In order to verify the neural network model SimpleNet of the embodiment of the present invention, SimpleNet and MobileNetv2_small_035 (035 means that the depth factor of MobileNet is 0.35) are used for comparison. The comparison results are as follows:
[0067] First of all, from the perspective of model size, the model size of simplenet is 370kB, and mobilenetv2_small_035 is 1540kB. Therefore, it can be seen that simple lennet is more lightweight and has obvious advantages.
[0068] Secondly, the pointer table dataset was used to perform inference on the arm chip using the arm compute library, and a comparative test was conducted on the performance of the model. Specifically, it was trained on 4000 images and tested on 377 images. The test results are shown below, where MAE is the mean absolute error, RMSE is the root mean square error, and 3%-acc is the accuracy rate where the absolute error is within 3%; all results are calculated based on normalized readings.
[0069]
[0070] From the above test results, we can see that simplenet performs better than mobilenet.
[0071] The above comparison verifies the deep learning network model of the present invention: Simplenet further reduces the memory requirement and improves the recognition accuracy compared to Mobilenet.
[0072] As another aspect of the embodiment of the present invention, the method of the present invention can be implemented by a computer readable medium, which stores computer executable instructions, that is, program instructions corresponding to the method of the present invention, and the computer executable instructions are used to execute the above Figure 1-4 The method described in the illustrated and corresponding embodiments, namely the neural network model and image recognition method, can implant the computer executable instructions into a secure storage chip.
[0073] A readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, wherein readable program code is carried. Such propagated data signals may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the foregoing. A readable signal medium may also be any readable medium other than a readable storage medium, which may transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0074] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0075] Program code for performing the operations of the present application may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0076] The present invention also discloses a computing device. The computing device is in the form of a general computing device. The components of the computing device may include but are not limited to: at least one processor, at least one memory, and a bus connecting different system components (including the memory and the processor).
[0077] In some possible implementations, various aspects of the image recognition method provided by the present application can also be implemented in the form of a program product, which includes a program code. When the program product is run on a computer device, the program code is used to enable the computer device to execute the various exemplary embodiments described above in this specification according to the present application. The program product can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
Claims
1. An image recognition method suitable for edge devices, characterized in that: Input the image data into the trained image recognition model to obtain the image recognition result; The image recognition model includes a neural network model and an output unit connected to the neural network model; The neural network model comprises an initial convolution unit, a breathing module and a fully connected layer connected in series in sequence; the initial convolution unit comprises at least one initial convolution layer; the breathing module comprises at least one breathing unit, the breathing units are arranged in series, and an intermediate convolution unit is arranged between any adjacent breathing units; The breathing unit includes a first breathing convolution layer, a second breathing convolution layer and an activation layer; wherein the first breathing convolution layer and the second breathing convolution layer are sequentially connected in series, and the number of convolution kernels of the first breathing convolution layer is configured to be smaller than the number of channels of the input data of the breathing unit; the activation layer is arranged after the second breathing convolution layer; The intermediate convolution unit includes two intermediate convolution layers, the number of convolution kernels of the first intermediate convolution layer is equal to the number of channels of the input data of the intermediate convolution unit, and the number of convolution kernels of the second intermediate convolution layer is greater than the number of channels of the input data of the intermediate convolution unit.
2. The image recognition method applicable to edge devices according to claim 1, characterized in that: In the breathing unit, a batch normalization layer is arranged between the second breathing convolution layer and the activation layer, and the batch normalization layer is configured to standardize the data distribution to have a mean of 0 and a variance of 1.
3. The image recognition method applicable to edge devices according to claim 1, characterized in that: The breathing unit further includes a discarding layer, which is arranged after the activation layer and is configured to discard a preset proportion of data information.
4. The image recognition method applicable to edge devices according to claim 1, characterized in that: The breathing unit further includes a pooling layer, which is arranged between the second breathing convolution layer and the activation layer or after the activation layer.
5. The image recognition method applicable to edge devices according to claim 1, characterized in that: If image recognition is a classification problem, the output unit includes an activation layer softmax and a classification layer connected in sequence; if image recognition is a regression problem, the output unit includes a regression layer.
6. The image recognition method applicable to edge devices according to claim 5, characterized in that: The image recognition method comprises: Acquire a plurality of pointer meter images and a plurality of pointer meter readings corresponding to the plurality of pointer meter images; Inputting the plurality of pointer meter images and the plurality of pointer meter readings into the image recognition model for training to obtain a trained image recognition model; The pointer meter image to be identified is input into the trained image recognition model to obtain the pointer meter reading prediction value corresponding to the pointer meter image to be identified.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the image recognition method according to any one of claims 1 to 6 is implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the image recognition method according to any one of claims 1 to 6 is implemented.
9. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the image recognition method according to any one of claims 1 to 6 is implemented.
