A small-batch image recognition method, device and medium
By combining deep convolutional neural networks and reinforcement learning, a mini-batch image recognition model (SDRL) is constructed, which solves the recognition difficulty caused by the incompleteness of mini-batch image data and achieves high-precision image recognition in special fields.
Patent Information
- Application Number
- CN202310665994.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-06
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2043-06-06
AI Technical Summary
Due to the incompleteness and uncertainty of small batches of image data, existing technologies struggle to achieve high-precision image recognition, especially in specialized fields such as battlefields and rare medical images, where data scarcity and annotation difficulties lead to poor performance of deep learning.
We employ deep convolutional neural networks to extract features and combine them with policy network and value network models for end-to-end learning. We construct a small-batch image recognition model (SDRL) using reinforcement learning methods, and achieve rapid and accurate recognition by using limited data for feature extraction and intelligent decision-making.
Under limited data and computing resources, high-precision small-batch image recognition was achieved, especially in battlefield and rare medical images, with a recognition accuracy of up to 91% and low computing resource consumption.
Smart Images

Figure CN116843953B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image recognition, in particular to a small-batch image recognition method, device and medium. BACKGROUND
[0002] Due to the characteristics of difficulty in obtaining, difficulty in labeling, and low repeatability, images in some special fields (such as battlefields and rare case medical images) can only obtain small-batch images, which leads to few image feature data available, thereby increasing the difficulty of image recognition.
[0003] The prior art usually adopts deep learning to recognize images, but deep learning for image recognition usually relies on a large amount of high-quality manually labeled data. In a small-batch image recognition task, due to the obvious difficulty of data labeling and the scarcity of data itself, a large number of labeled image data is difficult to obtain.
[0004] Secondly, new special field equipment is constantly updated, and new special field targets also emerge in an endless stream. However, due to the incompleteness and uncertainty of the data collected by the new special field target images, there are few image feature data available, and it is difficult to recognize them by using deep learning.
[0005] Therefore, how to recognize small-batch images with high precision has become a research hotspot. SUMMARY
[0006] The technical problem to be solved by the present application is that due to the incompleteness and uncertainty of the data collected by small-batch images, it is difficult to accurately recognize small-batch images. The purpose is to provide a small-batch image recognition method, device and medium, which inputs the few special field target images collected as original images, extracts features through a deep convolutional neural network, and inputs them into a strategy network model and a value network model for reasoning and decision-making, so as to realize end-to-end small-batch image recognition learning, and solve the problem that it is difficult to accurately recognize small-batch images due to the incompleteness and uncertainty of the data collected by small-batch images.
[0007] The present application is realized by the following technical scheme:
[0008] The present application provides a small-batch image recognition method in the first aspect, comprising the following steps:
[0009] S1, acquiring small-batch images;
[0010] S2, constructing a feature extraction network model, and extracting features of the small-batch images by using the feature extraction network model to obtain image features of the small-batch images;
[0011] S3, a small batch image classification model is constructed, the image features are input into the small batch image classification model for prediction, and a classification label prediction is obtained;
[0012] S4, the feature extraction network model and the small batch image classification model are trained according to the classification label prediction, a small batch image recognition model SDRL is obtained, and the small batch image is recognized by using the small batch image recognition model SDRL, and a target image is obtained.
[0013] In the above technical solution, first, the feature extraction network model is used to extract the features of the small batch image to obtain the image features of the small batch image, and then the small batch image classification model is used to infer and decide the image features to complete the prediction of the image features of the small batch image. Through classification prediction, the key image features in the small batch image can be extracted, and even if the data collected by the small batch image is incomplete, the key image features of the small batch image can be obtained.
[0014] The feature extraction network model and the small batch image classification model are trained with the predicted results, and finally a small batch image recognition model SDRL is constructed. The small batch image recognition model SDRL is used to recognize the small batch image, and a target image is obtained.
[0015] By using the method of reinforcement learning, under the condition of only inputting the original image, the small batch image recognition under the condition of incomplete and uncertain information is realized through interactive learning. The feature extraction of deep learning and the intelligent decision function of reinforcement learning are fully utilized to construct a high-precision special field small batch image recognition model SDRL. Through the small batch image recognition model SDRL, the problem of edge computing image recognition can be solved by using limited data and limited computing resources in some special fields, and finally the effect of fast and accurate target recognition can be realized.
[0016] In an optional embodiment, a feature extraction network model is constructed, and the feature extraction network model is used to extract features of the small batch image to obtain image features of the small batch image, including the following steps:
[0017] An 11-layer convolutional neural network M_Net is constructed. The first 10 layers of the convolutional neural network are alternately composed of convolutional layers and maximum pooling layers, and the 11th layer of the convolutional neural network M_Net is composed of a regularization layer dropout;
[0018] The image information of the small batch image is extracted by using the convolutional layer and is activated by a ReLU function and then is transmitted to the maximum pooling layer;
[0019] The image information is selected by using the maximum pooling layer;
[0020] The regularization layer dropout is used to randomly delete part of the neurons in the convolutional neural network M_Net.
[0021] In an optional embodiment, a small batch image classification model is constructed, the image feature is input into the small batch image classification model for prediction, and the classification label prediction comprises the following steps:
[0022] A strategy network model is constructed, and the strategy network model is used to calculate the classification selection probability.
[0023] A value network model is constructed, and the value network model is used to update the strategy network model.
[0024] The small batch image recognition scenario is modeled as a Markov decision process MDP, and the updated strategy network model is calculated by the classifier Agent on the image feature to obtain the classification label prediction.
[0025] In an optional embodiment, the strategy network model is constructed, and the strategy network model is used to calculate the classification selection probability, comprising the following steps:
[0026] A strategy network model is constructed by using a deep neural network to learn a strategy function, and the strategy function is calculated multiple times using the strategy network model to obtain multiple strategy gradients.
[0027] The multiple strategy gradients are averaged to obtain the classification selection probability.
[0028] In an optional embodiment, before the strategy function is calculated multiple times using the strategy network model, the following steps are further included:
[0029] A gradient function is constructed, and the gradient function is used to update the weight in the strategy function, wherein the gradient function is represented as follows:
[0030]
[0031] wherein, is a gradient function, is a strategy function, is a state has a reference value, is a state is a strategy selects an action The expected cumulative return action value function.
[0032] In an optional embodiment, after the gradient function is constructed, the following steps are further included:
[0033] The expected cumulative return action value function and the state The owned benchmark value builds an advantage function, and the advantage function is used for reducing variance caused by changes in state benchmark values;
[0034] The advantage function is expressed as follows:
[0035]
[0036] The advantage function is expressed as follows:
[0037] In an optional embodiment, the value network model is built, and updating the policy network model using the value network model includes the following steps:
[0038] The value network model is built using a deep neural network to learn a value function;
[0039] The policy gradient is input into the value network model, and the value network model is updated according to the policy gradient;
[0040] The updated value network model is fed back to the policy network model, and the policy network model is updated.
[0041] In an optional embodiment, after the policy gradient is input into the value network model and the value network model is updated according to the policy gradient, the method further includes:
[0042] The value function is calculated multiple times using the value network model to obtain multiple value gradients;
[0043] The value gradient and the policy gradient are input into the value network model to update the value gradient, and an updated value gradient is obtained;
[0044] The multiple updated value gradients are averaged to obtain a target value parameter;
[0045] The target value parameter is fed back to the value network model, and the value network model is updated.
[0046] The second aspect of the present application provides an electronic device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements a small-batch image recognition method when executing the program.
[0047] The third aspect of the present application provides a computer readable storage medium, which stores a computer program, and the program is executed by a processor to implement a small-batch image recognition method.
[0048] Compared with the prior art, the present application has the following advantages and beneficial effects:
[0049] The present application realizes end-to-end small-batch image recognition learning by inputting the collected few special field target images as original images, extracting features through a deep convolutional neural network, and sending the features to a policy network model and a value network model for reasoning and decision-making, thereby solving the problem that it is difficult to accurately recognize small-batch images due to the incompleteness and uncertainty of the data collected by small-batch images. BRIEF DESCRIPTION OF DRAWINGS
[0050] In order to more clearly illustrate the technical solutions of the example embodiments of the present application, the drawings needed in the embodiments will be briefly introduced as follows. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can also be obtained without creative labor. In the drawings:
[0051] Figure 1 A flowchart of a small-batch image recognition method provided for the embodiment 1 of the present application;
[0052] Figure 2 A flowchart of an updating process of the value network model and the policy network model weight provided for the embodiment 1 of the present application;
[0053] Figure 3 A convolutional neural network M_Net model training test precision increment curve provided for the embodiment 2 of the present application;
[0054] Figure 4 A small-batch image recognition model training test loss decrement curve provided for the embodiment 2 of the present application;
[0055] Figure 5 A convolutional neural network M_Net model training test precision increment curve provided for the embodiment 2 of the present application;
[0056] Figure 6 A small-batch image recognition model training test loss decrement curve provided for the embodiment 2 of the present application;
[0057] Figure 7 A convolutional neural network M_Net model test set confusion matrix provided for the embodiment 2 of the present application;
[0058] Figure 8 A small-batch image recognition model test set confusion matrix provided for the embodiment 2 of the present application;
[0059] Figure 9 A training time consumption graph provided for the embodiment 2 of the present application;
[0060] Figure 10A test time consumption diagram provided for the embodiment 2 of the present application;
[0061] Figure 11 A structural schematic diagram of an electronic device provided for the embodiment 3 of the present application. DETAILED DESCRIPTION
[0062] In order to make the objectives, technical solutions and advantages of the present application clearer, further detailed description will be made to the present application in combination with embodiments and drawings, and the illustrative embodiments of the present application and the description thereof are only used to explain the present application, and do not limit the present application.
[0063] Embodiment 1
[0064] Figure 1 A flow chart of a small-batch image recognition method provided for the embodiment 1 of the present application, as shown in Figure 1 The small-batch image recognition method comprises the following steps:
[0065] Step S1, acquiring a small-batch image.
[0066] The present application aims at recognizing special field images, such as battlefield images, rare medical case images and the like small-batch images. The small-batch images herein can be images crawled from the Internet, or images taken on site.
[0067] Step S2, constructing a feature extraction network model, and extracting features of the small-batch image by using the feature extraction network model to obtain image features of the small-batch image.
[0068] The feature extraction network model is a convolutional neural network M_Net obtained by improving a traditional CNN network model according to the data characteristics of small-batch image recognition, and the convolutional neural network M_Net is taken as the feature extraction network model.
[0069] Specifically, the feature extraction network model comprises an input layer and an 11-layer convolutional neural network.
[0070] According to the small-batch data image characteristics, the input layer is designed as a 256*256 matrix.
[0071] The first 10 layers of the 11-layer convolutional neural network are alternately composed of convolutional layers and maximum pooling layers, and the 11th layer is a regularization layer dropout. The structure of the first 10 layers of the convolutional neural network M_Net is shown in the following table:
[0072] Network layer name Number of neurons Step / kernel size Activation function Conv1 256*256*32 5 ReLU Maxpooling1 2 max Conv2 128*128*64 5 ReLU Maxpooling2 2 max Conv3 64*64*128 5 ReLU Maxpooling3 2 max Conv4 32*32*192 3 ReLU Maxpooling4 2 max Conv5 8*8*64 3 ReLU Maxpooling5 2 max
[0073] As described in the above table, the first 10 layers of the convolutional neural network M_Net are Conv1, Maxpooling1, Conv2, Maxpooling2, Conv3, Maxpooling3, Conv4, Maxpooling4, Conv5 and Maxpooling5 in turn. Among them, the number of neurons of Conv1 is 256*256*32, and the step length is 5; the number of neurons of Conv2 is 128*128*64, and the step length is 5; the number of neurons of Conv3 is 64*64*128, and the step length is 5; the number of neurons of Conv4 is 32*32*192, and the step length is 3; the number of neurons of Conv5 is 8*8*64, and the step length is 3. The step lengths of Maxpooling1, Maxpooling2, Maxpooling3, Maxpooling4 and Maxpooling5 are all 2.
[0074] In the first 10 layers of the convolutional neural network M_Net, the ReLU activation function is used to activate the neurons in the neural network, and the activation information is transmitted to the next layer of the neural network. After each layer of convolution, the ReLU function is activated, and the main features are extracted by using a maximum pooling layer with a size of 2*2.
[0075] The 11th layer is a regularization layer dropout. By randomly deleting part of the neurons in each training, the overfitting of the model is reduced. After using dropout, the network parameters are reduced, at the same time, the model does not rely too much on a small part of neurons, and the structure that cannot be generalized by chance in a small sample is broken, so that the overfitting of the model is inhibited, and the effect of the model is improved.
[0076] Further, in order to reduce the information transmission error, the present application adopts cross-entropy to construct a loss function. For a single sample, let be the correct sample probability distribution (such as [0, 0, 1, 0,...]), be the predicted probability distribution output by the model, and let there be m categories, then the cross-entropy loss function is:
[0077]
[0078] Step S3, constructing a small-batch image classification model, sending the image features into the small-batch image classification model for prediction to obtain a classification label prediction.
[0079] The Deep Q-Learning (DQN) algorithm is based on a reinforcement learning model and combines deep learning, which opens up the field of deep reinforcement learning, but it has the disadvantage of consuming a large amount of computing resources and memory resources, and is not suitable for application in edge computing scenarios such as joint operations battlefield which need a large amount of computing resources.
[0080] Specifically, Figure 2 A flow chart of the updating process of the value network model and the strategy network model weight for the embodiment 1 of the present application is shown in FIG. 1. Figure 2 As shown in FIG. 2, the steps of constructing the small batch image classification model are as follows:
[0081] The strategy network model is constructed, and the classification selection probability is calculated using the strategy network model.
[0082] The strategy network model is constructed by using a deep neural network to learn a strategy function, which is used for action selection for the classifier Agent.
[0083] Specifically, let be the weight of the strategy network model, and the strategy function of the strategy network model is expressed as:
[0084]
[0085] wherein, is the strategy network model, N is a constant, is the value network model.
[0086] In the field of deep reinforcement learning, the and can be used instead of the and proposed in the improved model of Williams, and therefore, the gradient function can be expressed as follows:
[0087]
[0088] wherein, is the gradient function, is the strategy function, is the baseline value of the state , and is the expected cumulative return action value function of the state under the action selected by the strategy .
[0089] The weight in the strategy function of the strategy network model is updated using the above gradient function, so as to obtain the optimal strategy that maximizes the target income.
[0090] Further, the advantage function under the state can be constructed by and , and the advantage function is expressed as follows:
[0091]
[0092] The advantage function adopts an action value function minus a reference value possessed by a corresponding state, and can depict the gain brought by the action, thereby reducing variance caused by changes in the state reference value.
[0093] The policy network model obtains the weights of a plurality of policy network models after each training is completed, averages the weights of the plurality of policy network models, and synchronously updates the average value, and the average value is used as a probability of action selection of the classifier agent, that is, a classification selection probability.
[0094] Further, a value network model is constructed, and the policy network model is updated using the value network model.
[0095] The value network model is constructed by using a deep neural network to learn a value function, and the value network model is used to assist in the reinforcement update of the parameters in the policy network model.
[0096] For the value function of the value network model, the classifier agent interacts with the environment, estimates the value function, and promotes the optimization of the policy network model. The optimization loss function is as follows:
[0097]
[0098] The value function of the value network model is as follows:
[0099]
[0100] wherein, is a reward decay coefficient.
[0101] Further, to improve the exploration degree of the policy , an entropy regularization term is added, and the parameters in the policy function are updated using the value network model. The maximum target function in the policy network model is as follows:
[0102]
[0103] wherein, is a hyperparameter.
[0104] In summary, the gradient update formula of the weights of the policy network model and the weights of the value network model is as follows:
[0105]
[0106]
[0107] Further, constructing a value network model, and updating the policy network model using the value network model comprises the following steps:
[0108] A value network model is constructed by using a deep neural network to learn a value function.
[0109] The policy gradient is input into the value network model, and the value network model is updated according to the policy gradient.
[0110] The policy gradient is input into the value network model, and the value network model is updated according to the policy gradient.
[0111] The value function is calculated multiple times using the value network model to obtain multiple value gradients.
[0112] The value gradient and the policy gradient are input into the value network model to update the value gradient to obtain an updated value gradient.
[0113] The multiple updated value gradients are averaged to obtain a target value parameter.
[0114] The target value parameter is fed back to the value network model to update the value network model.
[0115] The updated value network model is fed back to the policy network model to update the policy network model.
[0116] Further, the small-batch image recognition scenario is modeled as a Markov decision process (MDP), and the image features are classified and selected by the classifier agent according to the classification selection probability.
[0117] The Markov decision process (MDP) includes an action set A, a state set S, a state transition probability p, and a reward function r(s, a), wherein the action set A is a set of classifier agent actions, representing a set of selected classification labels for small-batch images.
[0118] To facilitate reinforcement learning based on convolutional neural network feature extraction, the small-batch image recognition scenario is modeled as a Markov decision process (MDP).
[0119] In the embodiment of the application, the MDP in the battlefield combat target image recognition scenario includes an action set A, a state set S, a state transition probability P, and a reward function r(s, a).
[0120] Wherein, the action of the classifier Agent is equivalent to selecting a classification label for an image.
[0121] The state set S includes the state of the classifier Agent, which provides observation information to facilitate the Agent to make decisions. S t represents the state of the Agent at time t. , M t represents the image features extracted by the convolutional neural network M_Net at time t.
[0122] The state transition probability p is the probability of transitioning to a new state under the state s and performing the action a. In the multi-classification problem, for each state-action pair, it can reach a new state .
[0123] The reward function r(s, a) provides the Agent with a reward, which will be received after the Agent performs an action, and is used as the basis for learning the next step policy.
[0124] Specifically, when the classifier Agent is in the state (i.e., the classifier Agent selects the image features extracted by the convolutional neural network M_Net at time t), the classification selection probability calculated by the policy network model is taken as the state transition probability p, and the classifier Agent selects the image features extracted by the convolutional neural network M_Net at time t+1 according to the classification selection probability, and the state of the classifier Agent changes to . The classifier Agent repeats the action of classification selection until the image it recognizes includes the termination label "END".
[0125] Further, in the present application, the reward information should reflect the pros and cons of the classification effect, so for each input image, the model takes the confidence of correct classification in each round of epoch as the index for measurement.
[0126] If the confidence of the real class of the image is improved after the next round of epoch classification, the Agent will receive a positive reward, otherwise, it will receive a negative reward, and the reward function is:
[0127]
[0128] wherein, M t represents the confidence of performing a certain action (classification) at time t, M t represents the real classification, and M t represents the specific reward value.
[0129] Further, in order to encourage the classifier Agent to complete the classification with as few steps as possible and strengthen the final goal, when a classification action is an output action or reaches the maximum number of steps, the reward value and the strategy are as follows:
[0130]
[0131] wherein, represents a specific reward value. That is, after executing the last classification action, if the image is correctly classified, the Agent receives a positive reward, otherwise a negative reward.
[0132] Step S4, training the feature extraction network model and the small batch image classification model according to the classification label prediction, obtaining a small batch image recognition model SDRL, and using the small batch image recognition model SDRL to recognize the small batch image to obtain a target image.
[0133] Embodiment 2
[0134] On the basis of the small batch image recognition method provided in Embodiment 1, Embodiment 2 provides a small batch image recognition method based on the main parameters of the number of cycles Epochs being 200 times, the reward decay coefficient being 0.9 to perform a training process on the battlefield image and the training results of the single convolutional neural network M_Net model for image classification and the training results of the small batch image recognition model SDRL combining the convolutional neural network M_Net model and deep reinforcement learning.
[0135] Step S1, obtaining battlefield images, since the particularity of battlefield images, it is difficult to obtain, so the battlefield images that can be obtained belong to small batch images.
[0136] Step S2, constructing a feature extraction network model, using the feature extraction network model to extract features of the small batch image, obtaining image features of the battlefield image.
[0137] Using the improved convolutional neural network M_Net to extract features of the battlefield image, obtaining image features of the battlefield image.
[0138] Step S3, constructing a small batch image classification model, sending the image features of the battlefield image into the small batch image classification model for prediction, obtaining a classification label prediction.
[0139] Specifically, the small-batch image recognition scene is modeled as a Markov decision process (MDP), a classifier agent is used to select a classification label of an image feature of a battlefield image, the classifier agent is selected through multiple epochs until a terminal label is selected, and then the classifier agent stops the classification selection of the image feature of the battlefield image.
[0140] In the process, the state of the classifier agent at the t time is recorded and the state is recorded as At this time The image feature of the battlefield image extracted by the convolutional neural network M_Net at the t time is taken.
[0141] The classifier agent is in the state The state is transferred to a new state with a state transition probability p. The image feature of the battlefield image extracted by the convolutional neural network M_Net at the t+1 time is taken. The agent is transferred from the state to the state as an action.
[0142] When the classifier agent completes an action, the reward function r(s,a) provides a reward for the agent.
[0143] Further, when the classifier agent is in the state The state is transferred to a new state with a state transition probability p.
[0144] Further, the parameters in the policy network model are updated using the value network model.
[0145] Step S4, according to the classification label, the feature extraction network model and the small-batch image classification model are trained to obtain a small-batch image recognition model SDRL, and the small-batch image recognition model SDRL is used to recognize the small-batch image to obtain a target image.
[0146] Figure 3 The convolutional neural network M_Net model training test precision increment curve provided by the embodiment 2 of the application is shown in the figure, Figure 4 The small-batch image recognition model training test loss decrement curve provided by the embodiment 2 of the application is shown in the figure, Figures 3-4As shown, the single convolutional neural network M_Net model can reach 90% accuracy after 75 rounds, and the small-batch image recognition model SDRL can reach 90% accuracy after 50 rounds. The small-batch image recognition model SDRL has a faster learning speed than the single convolutional neural network M_Net model. After 75 rounds of training, the learning curve of the single convolutional neural network M_Net model tends to be stable, and the highest accuracy can reach 94.766%, but the test curve fluctuates greatly, and the test accuracy is only 78% to 83%. The small-batch image recognition model SDRL still slowly rises after 50 rounds, and the highest training accuracy is 96.583%. After 200 rounds, there is still an upward trend, and the test accuracy can reach 90%, and it is relatively stable.
[0147] Figure 5 The training and test accuracy increasing curve diagram of the convolutional neural network M_Net model provided for embodiment 2 of the application is as shown in Figure 6 The training and test loss decreasing curve diagram of the small-batch image recognition model provided for embodiment 2 of the application is as shown in Figures 5-6 As shown, the Loss value of the small-batch image recognition model SDRL and the test set Loss value both rapidly decrease. The small-batch image recognition model SDRL has a more stable and more advantageous learning and optimization advantage than the single convolutional neural network M_Net model. Although the single convolutional neural network M_Net model has a lower Loss value (about 0.6) at the beginning of training, the Loss value does not decrease significantly, and fluctuates greatly.
[0148] Figure 7 The test set confusion matrix diagram of the convolutional neural network M_Net model provided for embodiment 2 of the application is as shown in Figure 8 The test set confusion matrix diagram of the small-batch image recognition model provided for embodiment 2 of the application is as shown in Figures 7-8 As shown, the horizontal direction of the image is the model prediction result, the vertical direction is the sample actual label, and the main diagonal line area is the precision. From Figure 7 and Figure 8 It can be seen that the accuracy of the small-batch image recognition model SDRL is obviously higher than that of the single convolutional neural network M_Net model, and it can better identify small-batch images, and its highest accuracy reaches 91% and the lowest accuracy reaches 89.4%. Therefore, the small-batch image recognition model SDRL has high and stable accuracy in identifying small-batch images.
[0149] From the efficiency point of view, Figure 9 The training time consumption diagram provided for embodiment 2 of the application is as shown in Figure 10 The test time consumption diagram provided for embodiment 2 of the application is as shown in Figure 10 and Figure 11In the training process, the average time for each training round is 38.3 seconds, and after 53 rounds of training, the training accuracy can reach more than 90%, and the time required is only 33.4 minutes. After the model training reaches a relatively ideal effect, testing is carried out, and the average time for each test round is 13.5 seconds. After 9 rounds of testing, the testing accuracy can reach 100%, and the time required is only 2.2 minutes.
[0150] Through the small-batch image recognition method provided in Example 1 and the training results of Example 2, the present application aims at some special fields (such as battlefield, rare medical image, etc.), which are difficult to obtain and label images, and the edge computing capability is relatively weak compared with cloud computing. Reinforcement learning and improved convolutional neural network model are used to construct a synchronous deep reinforcement learning small-batch image recognition algorithm. The small-batch image such as military image dataset is recognized. The test results show that the recognition accuracy of the method can reach 91%, which has the characteristics of high recognition accuracy and low consumption of computing resources. Through the method, the problem of realizing edge computing image recognition with limited data volume and limited computing resources in some special fields can be solved, and finally the effect of fast and accurate target recognition can be realized.
[0151] Example 3
[0152] Figure 11 A structural schematic diagram of an electronic device provided in Example 3 is shown in Figure 11 The electronic device includes a processor 21, a memory 22, an input device 23 and an output device 24; the number of processors 21 in the computer device can be one or more, Figure 11 one processor 21 is taken as an example; the processor 21, the memory 22, the input device 23 and the output device 24 in the electronic device can be connected through a bus or other means, Figure 11 one processor 21 is taken as an example; the processor 21, the memory 22, the input device 23 and the output device 24 in the electronic device can be connected through a bus or other means,
[0153] The memory 22 is a kind of computer readable storage medium, which can be used to store software programs, computer executable programs and modules. The processor 21 executes various functions of the electronic device and data processing by running the software programs, instructions and modules stored in the memory 22, that is, realizes the small-batch image recognition method of Example 1.
[0154] The memory 22 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system and application programs required by at least one function; and the data storage area can store data created according to the use of the terminal and the like. In addition, the memory 22 can include a high-speed random access memory, and can also include a non-volatile memory such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state memory device. In some examples, the memory 22 can further include a memory remotely arranged with respect to the processor 21, which can be connected to the electronic device through a network. Examples of the above network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0155] The input device 23 can be used to receive the id and password input by the user and the like. The output device 24 is used to output the network configuration page.
[0156] Embodiment 4
[0157] The embodiment 4 of the present application also provides a computer readable storage medium, and the computer executable instructions are used to implement the small batch image recognition method provided in the embodiment 1 when executed by the computer processor.
[0158] The storage medium provided by the embodiment of the present application includes computer executable instructions, and the computer executable instructions are not limited to the method operations provided in the embodiment 1, but can also perform the related operations in the small batch image recognition method provided by any embodiment of the present application.
[0159] The above specific embodiments further illustrate the purpose, technical solutions and beneficial effects of the present application. It should be understood that the above description is only a specific embodiment of the present application and is not used to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the present application should be included in the protection scope of the present application.
Claims
1. A small-batch image recognition method, characterized by, The method comprises the following steps: S1, obtaining a small batch of images; S2, constructing a feature extraction network model, using the feature extraction network model to extract features of the small batch of images, and obtaining image features of the small batch of images; S3, constructing a small batch of image classification model, feeding the image features into the small batch of image classification model for prediction, and obtaining a classification label prediction; S4, training the feature extraction network model and the small batch of image classification model according to the classification label prediction, obtaining a small batch of image recognition model SDRL, and using the small batch of image recognition model SDRL to recognize the small batch of images to obtain a target image; Constructing a small batch of image classification model, feeding the image features into the small batch of image classification model for prediction, and obtaining a classification label prediction comprises the following steps: Constructing a strategy network model, using the strategy network model to calculate a classification selection probability; Constructing a value network model, using the value network model to update the strategy network model; Modeling a small batch of image recognition scenario as a Markov decision process MDP, and using a classifier Agent to calculate the image features with the updated strategy network model to obtain a classification label prediction; Constructing a strategy network model, using the strategy network model to calculate a classification selection probability comprises the following steps: Using a deep neural network to learn a strategy function to construct a strategy network model, using the strategy network model to calculate the strategy function for multiple rounds to obtain multiple strategy gradients; Taking an average of the multiple strategy gradients as the classification selection probability; Before using the strategy network model to calculate the strategy function for multiple rounds, the method further comprises the following steps: Constructing a gradient function, using the gradient function to update weights in the strategy function, wherein the gradient function is expressed as follows: wherein, is a gradient function, is a policy function, is a state has a reference value, is a state is selected by a policy selects an action expected cumulative return action value function.
2. The small-batch image recognition method of claim 1, wherein, Constructing a feature extraction network model, using the feature extraction network model to extract features of the small batch of images, and obtaining image features of the small batch of images comprises the following steps: Constructing an 11-layer convolutional neural network M_Net; wherein the first 10 layers of the convolutional neural network are alternately composed of convolutional layers and max-pooling layers, and the 11th layer of the convolutional neural network M_Net is composed of a regularization layer dropout; Using the convolutional layer to extract image information of the small batch of images and passing the image information to the max-pooling layer after activation by a ReLU function; Using the max-pooling layer to select the image information; Using the regularization layer dropout to randomly delete part of the neurons in the convolutional neural network M_Net.
3. The small-batch image recognition method of claim 1, wherein, After constructing the gradient function, the method further comprises the following steps: by the desired cumulative return action value function and state The owned benchmark values construct an advantage function that is used to reduce variance due to changes in the state benchmark values; wherein the advantage function is expressed as follows: wherein is the merit function.
4. The small-batch image recognition method of claim 1, wherein, Constructing a value network model, using the value network model to update the strategy network model comprises the following steps: Using a deep neural network to learn a value function to construct a value network model; Inputting the strategy gradient into the value network model, and using the value network model to update according to the strategy gradient; Feeding the updated value network model back to the strategy network model to update the strategy network model.
5. The small-batch image recognition method of claim 4, wherein, inputting the policy gradient into the value network model, the value network model further comprising, after being updated according to the policy gradient: performing multiple rounds of calculation on the value function using the value network model to obtain multiple value gradients; inputting the value gradient and the policy gradient into the value network model to update the value gradient to obtain an updated value gradient; averaging the multiple updated value gradients to obtain a target value parameter; feeding back the target value parameter to the value network model to update the value network model.
6. An electronic device, comprising: A computer program product, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements the small-batch image recognition method according to any one of claims 1 to 5 when executing the program.
7. A computer readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the processor to implement the small-batch image recognition method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Multi-source domain migration target identification method based on reinforcement learning
CN114202031A
Semi-supervised part defect detection method based on confrontation mechanism
CN115830397A