Model training method, image recognition method and related products thereof
By introducing target interference noise and residual map learning in the training process of the image recognition model, the problem of imbalanced learning of high-frequency features and low-frequency features in the image recognition model is solved, and the accuracy of image classification is improved.
Patent Information
- Application Number
- CN202410354698.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-26
- Publication Date
- 2024-09-17
AI Technical Summary
During the training process of existing image recognition models, the learning of high-frequency features and low-frequency features is unbalanced, resulting in low parameter update accuracy and the inability to effectively distinguish the distribution of key features of image categories.
By introducing target interference noise points in the image reconstruction process, high-frequency feature information is lost, forming a target reconstructed image dominated by low-frequency features, and the feature channel weight is learned through the residual map, and feature weighting processing is performed, prompting the model to pay more attention to low-frequency features, thereby improving Image classification accuracy.
The parameter update accuracy and image classification accuracy of the image recognition model are improved, ensuring that the model can learn and distinguish key feature distributions of image categories more effectively.
Smart Images

Figure CN118657971A
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a model training method, an image recognition method and related products. Background Art
[0002] At present, with the rapid development of artificial intelligence technology, image classification is a basic task in the field of computer vision. Its goal is to assign the input image to a predefined category label, which is of great significance to the field of artificial intelligence. By using neural network models to classify images, the content in the image can be automatically identified and understood, thereby realizing many practical applications, such as autonomous driving, intelligent security, medical image analysis, etc. At the same time, with the popularization of digital image acquisition equipment and the rapid development of the Internet, a large amount of image data that needs to be automatically classified will be generated. Therefore, it is necessary to provide a solution for image classification and recognition with high efficiency and accuracy. Summary of the invention
[0003] The purpose of the embodiments of the present application is to provide a model training method, an image recognition method and related products thereof, which can achieve the effect of guiding the model to pay more attention to learning the distribution of key features that help distinguish image categories, thereby improving the parameter update accuracy of the image recognition model.
[0004] In order to implement the above technical solution, the embodiment of the present application is implemented as follows:
[0005] In a first aspect, an embodiment of the present application provides a model training method, the method comprising:
[0006] The image recognition model is trained using the initial input image to obtain a trained image recognition model; wherein the model training includes:
[0007] Performing image processing based on the initial input image and the target interference noise to obtain a first feature map and a target reconstructed image;
[0008] Performing feature weighting processing based on the residual map corresponding to the initial input image and the first feature map to obtain a second feature map; the residual map is obtained by performing residual calculation on the initial input image and the target reconstructed image;
[0009] Performing image classification processing based on the second feature map to obtain a classification prediction result of the initial input image;
[0010] Based on the classification prediction result and the true classification label of the initial input image, the parameters of the image recognition model are updated.
[0011] In a second aspect, an embodiment of the present application provides an image recognition method, the method comprising:
[0012] Performing image processing on the image to be classified using the image recognition model to obtain a classification result of the image to be classified; wherein the image processing includes:
[0013] Performing image processing based on the image to be classified to obtain an eighth feature map;
[0014] Performing feature processing based on the eighth feature map to obtain a ninth feature map;
[0015] Image classification processing is performed based on the ninth feature map to obtain a classification result of the image to be classified.
[0016] In a third aspect, an embodiment of the present application provides a model training device, the device comprising:
[0017] The model training module is used to perform model training on the image recognition model using the initial input image to obtain a trained image recognition model; wherein the model training includes:
[0018] Performing image processing based on the initial input image and the target interference noise to obtain a first feature map and a target reconstructed image;
[0019] Performing feature weighting processing based on the residual map corresponding to the initial input image and the first feature map to obtain a second feature map; the residual map is obtained by performing residual calculation on the initial input image and the target reconstructed image;
[0020] Performing image classification processing based on the second feature map to obtain a classification prediction result of the initial input image;
[0021] Based on the classification prediction result and the true classification label of the initial input image, the parameters of the image recognition model are updated.
[0022] In a fourth aspect, an embodiment of the present application provides an image recognition device, the device comprising:
[0023] The image processing module is used to perform image processing on the image to be classified using the image recognition model to obtain the classification result of the image to be classified; wherein the image processing includes:
[0024] Performing image processing based on the image to be classified to obtain an eighth feature map;
[0025] Performing feature processing based on the eighth feature map to obtain a ninth feature map;
[0026] Image classification processing is performed based on the ninth feature map to obtain a classification result of the image to be classified.
[0027] In a fifth aspect, an embodiment of the present application provides an electronic device, the device comprising:
[0028] A processor; and a memory arranged to store computer executable instructions, wherein the executable instructions are configured to be executed by the processor, and the executable instructions include instructions for executing the steps in the above method.
[0029] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the storage medium is used to store computer-executable instructions, and the executable instructions enable the computer to execute the steps in the above method.
[0030] In a seventh aspect, an embodiment of the present application provides a computer program product, wherein the computer program product includes a computer program, and when the computer program is executed by a processor, it implements part or all of the steps in the above method.
[0031] It can be seen that in the embodiment of the present application, first, image reconstruction is performed based on the initial input image and the target interference noise. In this way, since a part of non-critical feature information (such as high-frequency features) may be lost due to feature extraction and other processing during the image reconstruction process, and under the interference of the target interference noise, the degree of loss of high-frequency features is promoted, so that the target reconstructed image mainly contains the key feature information of the target object (such as low-frequency features); then, the initial input image and the target reconstructed image are subjected to residual calculation to obtain a residual map, so that the residual map mainly contains the image background information and the high-frequency features lost in the image reconstruction process; then, the weight distribution of each feature channel is learned based on the residual map, wherein the weight coefficients of the image background information and the high-frequency features lost in the image reconstruction process in the first weight information obtained are relatively large, while the weight coefficients of the low-frequency features are relatively large. The weight coefficient is relatively small, therefore, feature weighting processing can be performed with the help of the second weight information that is complementary to the first weight information. Since the sum of the weight coefficients corresponding to the same feature channel in the first weight information and the second weight information is a constant (for example, equal to 1), if the weight coefficient corresponding to the low-frequency feature in the first weight information is relatively small, then the weight coefficient corresponding to the low-frequency feature in the second weight information is relatively large. In this way, feature weighting based on the second weight information is used to obtain a second feature map, and then image classification processing is performed based on the second feature map. The model parameters are then updated based on the classification prediction results, which can guide the model to pay more attention to learning the distribution of key features that help distinguish image categories, thereby improving the parameter update accuracy of the image recognition model, and then improving the image classification accuracy of the trained image recognition model. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in one or more of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0033] Figure 1 A schematic diagram of a first flow chart of a model training method provided in an embodiment of the present application;
[0034] Figure 2 A schematic diagram of the first implementation principle of the model training method provided in the embodiment of the present application;
[0035] Figure 3 A schematic diagram of a second implementation principle of the model training method provided in an embodiment of the present application;
[0036] Figure 4 A second flow chart of the model training method provided in the embodiment of the present application;
[0037] Figure 5 A schematic diagram of a third implementation principle of the model training method provided in an embodiment of the present application;
[0038] Figure 6 A schematic diagram of the process of an image recognition method provided in an embodiment of the present application;
[0039] Figure 7 A schematic diagram of the implementation principle of the image recognition method provided in the embodiment of the present application;
[0040] Figure 8 A schematic diagram of the module composition of the model training device provided in an embodiment of the present application;
[0041] Fig. 9 A schematic diagram of the module composition of the image recognition device provided in an embodiment of the present application;
[0042] Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0043] In order to enable those skilled in the art to better understand the technical solutions in one or more of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only one or more partial embodiments of the present application, rather than all embodiments. Based on one or more embodiments of the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0044] It should be noted that, in the absence of conflict, one or more embodiments and features in the embodiments of the present application may be combined with each other. The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0045] One or more embodiments of the present application provide a model training method, an image recognition method and related products thereof. Considering that the existing image recognition model only includes an image classification network, in the process of model training, feature information in the input image is extracted, image category recognition is performed based on the feature information, and a predicted category of the input image is obtained. Then, the parameters of the image classification network are iteratively updated based on the predicted category and the true category to obtain a trained image recognition model. In this process, both non-critical feature information (such as high-frequency features) in the input image and critical feature information (such as low-frequency features) in the input image participate in network learning to the same extent. In this way, high-frequency features (such as color features of the target object, etc.) may interfere with the image classification process to a certain extent, and cannot guide the network to focus on learning low-frequency features (such as contour features of the target object, etc.) that are more helpful for image classification. Therefore, there is a problem of low accuracy in updating parameters of the image recognition model. Based on the above problem, the present technical solution first reconstructs the image based on the initial input image and the target interference noise. In this way, due to the loss of part of the non-critical feature information (such as high-frequency features) due to feature extraction and other processing during the image reconstruction process, and under the interference of the target interference noise, the loss of high-frequency features is promoted, so that the target reconstruction The image mainly contains the key feature information of the target object (such as low-frequency features); then the initial input image and the target reconstructed image are subjected to residual calculation to obtain a residual map, so that the residual map mainly contains the image background information and the high-frequency features lost in the image reconstruction process; then, the weight distribution of each feature channel is learned based on the residual map, wherein the weight coefficients of the image background information and the high-frequency features lost in the image reconstruction process in the first weight information obtained are relatively large, while the weight coefficients of the low-frequency features are relatively small. Therefore, the feature weighting processing can be performed with the help of the second weight information which is complementary to the first weight information. Since the first weight information and the second weight information are The sum of the weight coefficients corresponding to the same feature channel in the information is a constant (for example, equal to 1). If the weight coefficient corresponding to the low-frequency feature in the first weight information is relatively small, then the weight coefficient corresponding to the low-frequency feature in the second weight information is relatively large. In this way, feature weighting is performed based on the second weight information to obtain a second feature map, and then image classification processing is performed based on the second feature map. The model parameters are then updated based on the classification prediction results to guide the model to pay more attention to learning the distribution of key features that help distinguish image categories, thereby improving the parameter update accuracy of the image recognition model, and then improving the image classification accuracy of the trained image recognition model.
[0046] in, Figure 1A flowchart of a model training method provided in one or more embodiments of the present application is provided. Figure 1 The method can be executed by an electronic device, which may be a terminal device or a designated server, and the method at least includes the following steps:
[0047] The image recognition model is trained using the initial input image to obtain a trained image recognition model; wherein, Figure 1 As shown, the model training includes:
[0048] S102, performing image processing based on the initial input image and the target interference noise to obtain a first feature map and a target reconstructed image; the first feature map is obtained by performing feature extraction processing m times based on the initial input image, and the target reconstructed image is obtained by performing image reconstruction on the feature map obtained by performing feature extraction processing n times based on the initial input image, and the target interference noise is added in the process of performing feature extraction processing for the qth time, m, q and n are all integers greater than 1 and q is greater than m, and n is greater than q; that is, the target reconstructed image is generated based on the feature map obtained by performing feature extraction after adding the target interference noise, and the first feature map is the feature map obtained by performing feature extraction before adding the target interference noise.
[0049] The above-mentioned initial input image may be an initial sample image with annotation information, and the annotation information may include contour information of the target object in the initial sample image, that is, boundary information between the target object and the background area in the image, and may also include the real classification label of the target object; the above-mentioned target interference noise may be random noise added in the process of feature extraction based on the initial input image, which is used to interfere with the image reconstruction process and increase the degree of loss of high-frequency features of the target object; because in the image reconstruction process, only the area where the target object is located in the image is reconstructed, and the background area in the image is not reconstructed, and some high-frequency features of the target object will be lost, therefore, the above-mentioned target reconstructed image mainly includes low-frequency features of the target object.
[0050] S104, performing feature weighting processing based on the residual map corresponding to the initial input image and the first feature map to obtain a second feature map; the residual map is obtained by performing residual calculation on the initial input image and the target reconstructed image.
[0051] The above-mentioned residual image can be obtained by subtracting the pixel values between the initial input image and the target reconstructed image. Since the target reconstructed image mainly includes the low-frequency features of the target object, the above-mentioned residual image mainly includes the image background information and the high-frequency features lost in the image reconstruction process, and then feature extraction is performed based on the residual image to obtain the first weight information; and then feature weighting processing is performed with the help of the second weight information that has a complementary relationship with the first weight information to obtain the second feature map; wherein, since the residual image mainly includes the image background information and the high-frequency features lost in the image reconstruction process (that is, the feature information that may interfere with the image classification process), the weight coefficient of the high-frequency feature in the first weight information is relatively large, and the weight coefficient of the low-frequency feature is relatively small; and, since for the same feature channel, the weight coefficient in the first weight information and the weight coefficient in the second weight information have a complementary relationship, therefore, the weight coefficient of the high-frequency feature in the second weight information is relatively small, and the weight coefficient of the low-frequency feature is relatively large.
[0052] Since the target reconstructed image is generated based on a feature map obtained by feature extraction after adding target interference noise, and the first feature map is a feature map obtained by feature extraction before adding target interference noise, the first feature map contains richer features of the target object; based on this, after determining the second weight information, feature weighting processing is performed on the first feature map based on the second weight information to obtain the second feature map.
[0053] S106: Perform image classification processing based on the second feature map to obtain a classification prediction result of the initial input image.
[0054] After the second feature map is obtained by weighting the features based on the second weight information, since the weight coefficient of the high-frequency features in the first weight information is relatively large, and the weight coefficient of the low-frequency features is relatively small, the weight coefficient of the high-frequency features in the second weight information is relatively small, and the weight coefficient of the low-frequency features is relatively large. In this way, image classification is performed based on the second feature map after feature weighting, and then the model parameters are updated based on the classification prediction results. This can achieve the effect of guiding the model to pay more attention to learning the distribution of key features that help distinguish image categories.
[0055] It should be noted that, in the process of determining the first weight information, feature extraction is performed based on the residual map, and weights are assigned to each feature channel. This process focuses on learning the image background information and the high-frequency features lost in the image reconstruction process; and in the process of determining the classification prediction result, image classification processing is performed based on the second feature map. Since the second feature map is obtained by feature weighting based on the second weight information, the weight coefficient of the low-frequency feature in the second weight information is relatively large. This process focuses on learning the low-frequency features of the target object. That is to say, in the process of processing the initial input image, the feature learning of different processing processes has different emphases. On the basis of ensuring the comprehensiveness of image feature learning, the guidance model is more focused on learning the key feature distribution that helps to distinguish image categories.
[0056] S108, updating the parameters of the image recognition model based on the classification prediction result and the true classification label of the initial input image.
[0057] After obtaining the classification prediction results of the initial input image, if the number of image samples selected for each round of parameter update is N, where N is an integer greater than 1, the total loss function of the image recognition model to be trained is determined based on the classification prediction results of the N initial input images and the true classification labels; then the parameters of the image recognition model are updated based on the total loss function. After multiple rounds of parameter updates, the termination conditions of the model training are met, and the trained image recognition model can be obtained.
[0058] Among them, the process of updating the parameters of the image recognition model based on the total loss function can refer to the existing process of tuning the model parameters using the gradient descent method back propagation, which will not be repeated here.
[0059] In an embodiment of the present application, first, an image is reconstructed based on an initial input image and target interference noise. In this way, since a portion of non-critical feature information (such as high-frequency features) may be lost due to feature extraction and other processing during the image reconstruction process, and under the interference of target interference noise, the degree of loss of high-frequency features is promoted, so that the target reconstructed image mainly contains the key feature information of the target object (such as low-frequency features); then, a residual calculation is performed on the initial input image and the target reconstructed image to obtain a residual map, so that the residual map mainly contains image background information and high-frequency features lost in the image reconstruction process; then, based on the residual map, the weight distribution of each feature channel is learned, wherein the weight coefficients of the image background information and the high-frequency features lost in the image reconstruction process in the first weight information obtained are relatively large, while the weight coefficients of the low-frequency features are relatively large. The number is relatively small, therefore, feature weighting processing can be performed with the help of the second weight information that is complementary to the first weight information. Since the sum of the weight coefficients corresponding to the same feature channel in the first weight information and the second weight information is a constant (for example, equal to 1), if the weight coefficient corresponding to the low-frequency feature in the first weight information is relatively small, then the weight coefficient corresponding to the low-frequency feature in the second weight information is relatively large. In this way, feature weighting based on the second weight information is used to obtain a second feature map, and then image classification processing is performed based on the second feature map. Then, the model parameters are updated based on the classification prediction results, which can guide the model to pay more attention to learning the distribution of key features that help distinguish image categories, thereby improving the parameter update accuracy of the image recognition model, and then improving the image classification accuracy of the trained image recognition model.
[0060] In a specific embodiment, the above-mentioned image recognition model may include an image reconstruction network, and the image reconstruction network may include a first convolutional subnetwork and a second convolutional subnetwork, and the input of the second convolutional subnetwork includes the output of the first convolutional subnetwork; the above-mentioned first feature map is output by the first convolutional subnetwork, the target interference noise is added during the feature extraction process of the second convolutional subnetwork, and the target reconstructed image is obtained by image reconstruction based on the feature map output by the second convolutional subnetwork; further, the above-mentioned image recognition model includes not only an image reconstruction network, but also an attention network and an image classification network, the above-mentioned second feature map is obtained by feature weighting processing by the attention network, and the above-mentioned classification prediction result is obtained by image classification processing by the image classification network.
[0061] Taking the above image recognition model including an image reconstruction network, an attention network and an image classification network, and the image reconstruction network including a first convolutional subnetwork and a second convolutional subnetwork as an example, Figure 2 As shown in the figure, a specific implementation process of a model training method is given, which mainly includes:
[0062] Get N initial input images;
[0063] For each initial input image i, an image reconstruction network is used to perform image processing based on the initial input image i and the target interference noise to obtain a first feature map i and a target reconstructed image i; wherein the first feature map i may be output by a first convolutional subnetwork in the image reconstruction network, the target interference noise is added during feature extraction by a second convolutional subnetwork in the image reconstruction network, and the target reconstructed image i is obtained by image reconstruction based on the feature map output by the second convolutional subnetwork in the image reconstruction network, and the value of i is an integer from 1 to N;
[0064] Perform residual calculation based on the target reconstructed image i and the initial input image i to obtain the residual image i corresponding to the initial input image i;
[0065] Input the above residual map i and the first feature map i into the attention network;
[0066] Using the attention network to perform feature weighting processing based on the residual map i and the first feature map i, a second feature map i is obtained, and the second feature map i is input into the image classification network;
[0067] Using an image classification network to perform image classification processing based on the second feature map i, a classification prediction result i of the initial input image i is obtained;
[0068] Determine a total loss function based on the classification prediction result i of each initial input image i and the true classification label i of the initial input image i;
[0069] The parameters of the above image recognition model are iteratively updated based on the above total loss function to obtain a trained image recognition model.
[0070] Among them, considering that the residual map mainly includes image background information and high-frequency features lost in the image reconstruction process, and it is necessary to encourage the model to focus on learning the distribution of low-frequency features, therefore, it is necessary to give a higher weight coefficient to the low-frequency features in the second feature map. Based on this, for the determination process of the second feature map, firstly, feature extraction is performed based on the residual map to determine the first weight information, and then the second feature map is obtained by feature weighting with the help of the second weight information that has a complementary relationship with the first weight information; specifically, the above S104, based on the residual map corresponding to the above initial input image and the first feature map, performs feature weighting processing to obtain the second feature map, specifically includes:
[0071] Perform feature extraction processing based on the residual image corresponding to the initial input image to determine first weight information; the first weight information includes first weight coefficients under multiple channels;
[0072] Feature weighting processing is performed based on the first feature map and the second weight information to obtain a second feature map; the second weight information includes second weight coefficients under multiple channels, and the sum of the first weight coefficient and the second weight coefficient under the same channel is equal to 1.
[0073] In some example embodiments, the attention network may include a first attention sub-network and a second attention sub-network; correspondingly, the S104 performs feature weighting processing based on the residual map and the first feature map corresponding to the initial input image to obtain the second feature map, specifically including:
[0074] Step A1, using the first attention sub-network to perform feature extraction processing based on the residual map corresponding to the above-mentioned initial input image, to determine the first weight information.
[0075] The above-mentioned first weight information can be obtained by performing convolution processing, pooling processing, and logistic regression processing on the residual map corresponding to the initial input image; the above-mentioned first weight information may include first weight coefficients under multiple channels, and different channels correspond to different features. Since the residual map mainly includes image background information and high-frequency features lost in the image reconstruction process, the weight coefficient of the channel corresponding to the high-frequency features of the target object is relatively large, while the weight coefficient of the channel corresponding to the low-frequency features of the target object is relatively small.
[0076] Step A2: Use the second attention sub-network to perform feature weighting processing based on the first feature map and the second weight information to obtain a second feature map.
[0077] The above-mentioned second weight information may include second weight coefficients under multiple channels, and the sum of the first weight coefficient and the second weight coefficient under the same channel is equal to 1; since the weight coefficient of the high-frequency feature in the first weight information is relatively large, and the weight coefficient of the low-frequency feature is relatively small, therefore, the weight coefficient of the high-frequency feature in the second weight information is relatively small, and the weight coefficient of the low-frequency feature is relatively large. Therefore, feature weighting processing of the first feature map based on the second weight information can give a higher weight coefficient to the low-frequency feature in the second feature map, thereby prompting the image classification network to pay more attention to the low-frequency feature distribution of the target object.
[0078] In a specific embodiment, in the above Figure 2 Based on , the above attention network can include a first attention sub-network and a second attention sub-network; Figure 3 As shown in the figure, a specific implementation process of a model training method is given, which mainly includes:
[0079] Get N initial input images;
[0080] For each initial input image i, an image reconstruction network is used to perform image processing based on the initial input image i and the target interference noise to obtain a first feature map i and a target reconstructed image i;
[0081] Perform residual calculation based on the target reconstructed image i and the initial input image i to obtain the residual image i corresponding to the initial input image i;
[0082] The residual image i and the first feature image i output by the first convolutional subnetwork in the image reconstruction network are input into the attention network; the first convolutional subnetwork is located before the second convolutional subnetwork, that is, the input of the second convolutional subnetwork includes the output of the first convolutional subnetwork;
[0083] Using the first attention sub-network to perform feature extraction processing based on the residual image i, and determine the first weight information;
[0084] Determine the second weight information based on the magnitude of each first weight coefficient in the first weight information; the second weight information includes a plurality of second weight coefficients, and the sum of the first weight coefficient and the second weight coefficient under the same feature channel is equal to 1;
[0085] Using the second attention sub-network to perform feature weighting processing on the first feature map i based on the second weight information to obtain the second feature map i, and input the second feature map i into the image classification network;
[0086] Using an image classification network to perform image classification processing based on the second feature map i, a classification prediction result i of the initial input image i is obtained;
[0087] Determine a total loss function based on the classification prediction result i of each initial input image i and the true classification label i of the initial input image i;
[0088] The parameters of the above image recognition model are iteratively updated based on the above total loss function to obtain a trained image recognition model.
[0089] Among them, for the process of determining the first weight information, feature learning is performed based on the residual map corresponding to the initial input image to obtain the weight coefficient of each feature channel. Specifically, the feature extraction process is performed based on the residual map corresponding to the initial input image to determine the first weight information, which specifically includes:
[0090] The residual map corresponding to the initial input image is convolved to obtain a third feature map; the third feature map is pooled to obtain a fourth feature map; and a logistic regression is performed based on the fourth feature map to obtain first weight information.
[0091] In some example embodiments, the first attention sub-network may include a convolution layer, a pooling layer, and a logistic regression layer; correspondingly, the step A1, using the first attention sub-network to perform feature extraction processing based on the residual map corresponding to the initial input image, and determining the first weight information, specifically includes:
[0092] Step A11, use a convolution layer to convolve the above residual map to obtain a third feature map; in some example embodiments, channel dimension can be increased by using at least one 1*1*256 convolution layer to obtain a feature map after channel dimension increase (i.e., the third feature map).
[0093] Step A12, using a pooling layer to perform pooling processing on the above-mentioned third feature map to obtain a fourth feature map; in some example embodiments, dimensionality reduction compression can be performed through a global pooling layer to obtain a feature map after dimensionality reduction compression (i.e., the fourth feature map).
[0094] Step A13, using a logistic regression layer to perform logistic regression processing based on the above-mentioned fourth feature map to obtain first weight information; in some example embodiments, logistic regression calculation can be performed through the logistic regression layer sigmoid to obtain 64-dimensional weight information (i.e., the first weight information, including 64 weight coefficients).
[0095] Among them, considering that the image reconstruction network performs feature extraction, the target object is regarded as a whole, and the various components of the target object are not distinguished. Therefore, for the first feature map, the features of the various components of the target object are entangled. In order to improve the accuracy of feature weighting, the first feature map is not directly subjected to feature weighting processing based on the second weight information, but a feature decoupling step is introduced, and the first feature map is first subjected to feature decoupling processing to obtain a fifth feature map, and then the fifth feature map is subjected to feature weighting processing based on the second weight coefficient; specifically, the feature weighting processing based on the first feature map and the second weight information to obtain the second feature map specifically includes:
[0096] A feature decoupling process is performed based on the first feature map to obtain a fifth feature map; and a feature weighting process is performed based on the fifth feature map and the second weight information to obtain a second feature map.
[0097] In some example embodiments, the second attention sub-network may include a feature decoupling layer and a feature processing layer; correspondingly, the step A2, using the second attention sub-network to perform feature weighted processing based on the first feature map and the second weight information to obtain the second feature map, specifically includes:
[0098] Step A21, use a feature decoupling layer to perform feature decoupling processing based on the above-mentioned first feature map to obtain a fifth feature map; in some example embodiments, feature decoupling can be performed by using a 1*1 convolution layer to obtain a feature map after feature decoupling (i.e., the fifth feature map).
[0099] Step A22, using the feature processing layer to perform feature weighting processing based on the fifth feature map and the second weight information to obtain a second feature map.
[0100] In an embodiment of the present application, before performing feature weighting processing based on the second weight information, a step of performing feature decoupling processing on the first feature map is added, and feature weighting processing is performed on the fifth feature map after feature decoupling based on the second weight information to obtain a second feature map; for example, the target object is a bird, and after feature decoupling, the feature information of different components such as the bird's beak and feathers can be distinguished.
[0101] Among them, considering that feature information that contributes to image classification may be lost in the process of feature extraction and feature decoupling, therefore, in order to further improve the accuracy of feature learning, specifically, the feature weighted processing based on the fifth feature map and the second weight information is performed to obtain the second feature map, specifically including:
[0102] Based on the fifth feature map and the second weight information, feature weighting processing is performed to obtain a sixth feature map; based on the first feature map, feature completion processing is performed on the sixth feature map to obtain a second feature map.
[0103] In some example embodiments, the feature processing layer may include a feature weighting unit and a feature completion unit; correspondingly, the step A22, using the feature processing layer to perform feature weighting processing based on the fifth feature map and the second weight information to obtain the second feature map, specifically includes:
[0104] Step A221, using a feature weighting unit to perform feature weighting processing based on the fifth feature map and the second weight information to obtain a sixth feature map;
[0105] Step A222, using a feature completion unit to perform feature completion processing on the above-mentioned sixth feature map based on the above-mentioned first feature map to obtain a second feature map; in some example embodiments, the feature completion unit may include a residual structure, and perform residual learning on the first feature map and the sixth feature map to supplement the lost feature information in the sixth feature map.
[0106] In an embodiment of the present application, the fifth feature map is first feature-weighted based on the second weight information to obtain a sixth feature map; then the sixth feature map is feature-completed based on the first feature map to obtain a second feature map; that is, the second feature map is obtained by feature-completing the sixth feature map based on the first feature map, the sixth feature map is obtained by feature-weighting the fifth feature map based on the second weight information, and the fifth feature map is obtained by feature-decoupling the first feature map. This can solve the problem that feature information contributing to image classification may be lost during feature extraction and feature decoupling, thereby further improving the feature learning accuracy of the image classification network.
[0107] In some example embodiments, the first convolutional subnetwork may include multiple feature extraction layers, and the second convolutional subnetwork may also include multiple feature extraction layers. Therefore, the image reconstruction network may include multiple feature extraction layers (i.e., convolutional layers) connected in sequence. The first feature map may be a feature map output by the first feature extraction layer. For example, the first feature extraction layer may be a feature extraction layer with a higher ranking, or a feature extraction layer located in the middle. The target interference noise may be added during the feature extraction process performed by the second feature extraction layer in the image reconstruction network. For example, the second feature extraction layer may be a feature extraction layer with a lower ranking, or the last feature extraction layer. It can be seen that the second feature extraction layer is located after the first feature extraction layer, that is, the input of the second feature extraction layer includes the feature map after at least one feature extraction of the output of the first feature extraction layer.
[0108] Among them, considering that the image reconstruction process not only needs to output the target reconstructed image, the above-mentioned first feature map is also obtained by the mth feature extraction in the image reconstruction process, and the target reconstructed image is generated based on the feature map obtained by feature extraction after adding the target interference noise, and the first feature map is the feature map obtained by feature extraction before adding the target interference noise; specifically, the above-mentioned S102, performing image processing based on the initial input image and the target interference noise to obtain the first feature map and the target reconstructed image, specifically includes:
[0109] Perform convolution processing based on the initial input image to obtain a first intermediate feature map; perform convolution processing based on the first intermediate feature map to obtain a first feature map; perform convolution processing based on the first feature map to obtain a second intermediate feature map; perform convolution processing based on the second intermediate feature map and target interference noise to obtain a seventh feature map; perform image reconstruction based on the seventh feature map to obtain a target reconstructed image.
[0110] In some example embodiments, the image reconstruction network may include a first convolutional subnetwork, a second convolutional subnetwork, and an image reconstruction layer, the first convolutional subnetwork includes a plurality of first convolutional layers connected in series, the second convolutional subnetwork includes a plurality of second convolutional layers connected in series, and the first feature extraction layer is the last first convolutional layer; and, in order to enhance the degree of loss of high-frequency features of the target object caused by the target interference noise added during the feature extraction process, that is, to increase the degree of loss of high-frequency features in the target reconstructed image, the target interference noise adding process may be set to the last feature extraction layer, that is, the second feature extraction layer is the last second convolutional layer; correspondingly, the above S102, performing image processing based on the initial input image and the target interference noise to obtain the first feature map and the target reconstructed image, specifically includes:
[0111] Step B1, using the first convolutional layer in the first convolutional subnetwork to perform convolution processing based on the initial input image to obtain a first intermediate feature map; the input of the first convolutional layer includes the initial input image, and the first intermediate feature map output by the first convolutional layer is used as the input of the next first convolutional layer to obtain the next first intermediate feature map.
[0112] Step B2, using the last first convolutional layer in the first convolutional subnetwork to perform convolution processing based on the first intermediate feature map output by the previous first convolutional layer to obtain a first feature map; the last first convolutional layer is the above-mentioned first feature extraction layer; in some example embodiments, the first convolutional subnetwork may include multiple 3*3 convolutional layers as downsampling layers, and each layer will obtain downsampled image features.
[0113] Step B3, using the first second convolutional layer in the second convolutional subnetwork to perform convolution processing based on the above-mentioned first feature map to obtain a second intermediate feature map; the input of the first second convolutional layer includes the first feature map output by the last first convolutional layer, and the second intermediate feature map output by the first second convolutional layer is used as the input of the next second convolutional layer to obtain the next second intermediate feature map.
[0114] Step B4, using the last second convolutional layer in the second convolutional subnetwork to perform convolution processing based on the target interference noise and the second intermediate feature map output by the previous second convolutional layer, to obtain the seventh feature map; the last second convolutional layer is the above-mentioned second feature extraction layer; in some example embodiments, the second convolutional subnetwork may include multiple 3*3 convolutional layers as upsampling layers, and each layer will obtain finer image features.
[0115] Step B5: Use the image reconstruction layer to perform image reconstruction based on the seventh feature map to obtain a target reconstructed image.
[0116] In an embodiment of the present application, an image reconstruction network is used to reconstruct the target object in the initial input image to obtain a target reconstructed image. At the same time, the first feature map output by the preset feature extraction layer in the image reconstruction network is used as the input of the attention network. Therefore, the image reconstruction network includes at least a first convolutional subnetwork and a second convolutional subnetwork. The first feature map is output by the first convolutional subnetwork. In some example embodiments, the first convolutional subnetwork includes a plurality of first convolutional layers connected in sequence, and the first feature map is output by the last first convolutional layer; the target reconstructed image is obtained by image reconstruction based on the feature map output by the second convolutional subnetwork, and target interference noise is added during feature extraction by the second convolutional subnetwork; in some example embodiments, the second convolutional subnetwork includes a plurality of second convolutional layers connected in sequence, and target interference noise is added during feature extraction by the last second convolutional layer in the second convolutional subnetwork.
[0117] Among them, for the determination process of the loss function, only the loss caused by image classification can be considered. Considering that the model includes not only the image classification process but also the image reconstruction process, in order to improve the updating accuracy of the model parameters, not only the first loss function corresponding to the image classification but also the second loss function corresponding to the image reconstruction is considered, such as Figure 4 As shown, the above S108, based on the above classification prediction result and the true classification label of the initial input image, updates the parameters of the above image recognition model, specifically including:
[0118] S1082, performing classification loss calculation based on the above classification prediction result and the true classification label of the initial input image to obtain a first loss function.
[0119] In some example embodiments, the first loss function may be obtained by weighted summing of cross entropy loss functions corresponding to the initial input images, and the cross entropy loss function is determined based on the classification prediction results of the initial input images and the true classification labels; in other example embodiments, if the number of samples in each batch is N, a small number of initial input images may be marked as wrong categories, so as to prompt the network to learn that the target object does not belong to the wrong category, that is, the first number of initial input images (i.e., the first initial input images) are used as first category image samples, the first initial input images are marked as the correct category, and the second number of initial input images (i.e., the second initial input images) are used as second category image samples, the second initial input images are marked as the wrong category, the sum of the first number and the second number is equal to N, and the second number is less than the first number; based on this, the first loss function may be the first sub-loss function corresponding to the first number of first initial input images and the second sub-loss function corresponding to the second number. The first sub-loss function is determined by a second sub-loss function corresponding to a second initial input image, the first sub-loss function is determined based on the cosine distance between the predicted probability that the first initial input image belongs to the correct category and a preset value, and is used to characterize the loss of identifying the initial input image as the correct category (i.e., the true classification label), so as to encourage the network to learn the association between the various components of the target object in the first initial input image that is correctly classified, that is, the network learns that the target object in the first initial input image belongs to the true classification label; the second sub-loss function is determined based on the cosine distance between the predicted probability that the second initial input image belongs to the wrong category and a preset value, and is used to characterize the loss of identifying the initial input image as the wrong category (i.e., any specified classification label other than the true classification label), so as to encourage the network to learn the difference between the correct classification and the wrong classification, that is, the network learns that the target object in the second initial input image does not belong to the specified classification label.
[0120] S1084, performing image reconstruction loss calculation based on the target reconstructed image and the initial input image to obtain a second loss function.
[0121] In some example embodiments, the second loss function may be determined based on a mean square error loss function between a target reconstructed image and an initial input image, and the second loss function may be expressed as mse(out1,x), where out1 represents the target reconstructed image and x represents the initial input image.
[0122] S1086: Based on the first loss function and the second loss function, update the parameters of the image recognition model.
[0123] In some example embodiments, after determining the first loss function and the second loss function, a weighted sum is performed on the first loss function and the second loss function to obtain a total loss function; based on the total loss function, parameters of the image recognition model are updated, so that after multiple rounds of parameter updates, the model training termination conditions are met and a trained image recognition model can be obtained.
[0124] In order to further improve the updating accuracy of the model parameters, the network is prompted to better learn the difference between the correct category and the wrong category, so that the network can better learn that the target object in the initial input image does not belong to the wrong category other than the true classification label, based on this, the above classification prediction result may include a first probability that the initial input image is identified as a true classification label and a second probability that it is identified as a specified classification label, and the specified classification label is not the true classification label of the initial input image, that is, the specified classification label is any preset classification label other than the true classification label; correspondingly, the above S1082, based on the above classification prediction result and the true classification label of the initial input image, performs classification loss calculation to obtain a first loss function, specifically including:
[0125] Step C1, for a first number of first initial input images, performing cosine distance calculation based on a first probability corresponding to the first initial input image and a preset value to obtain a first sub-loss function;
[0126] Step C2, for a second number of second initial input images, performing cosine distance calculation based on a second probability corresponding to the second initial input image and a preset value to obtain a second sub-loss function;
[0127] Step C3: determine a first loss function based on the first sub-loss function and the second sub-loss function.
[0128] In some example embodiments, the preset value is equal to 1, the number of samples in each batch is N, the second number is a, and the first sub-loss function can be expressed as p1 represents the first probability that a first initial input image is identified as a true classification label, d(p1,1) represents the cosine distance between the first probability (i.e., the predicted probability that the first initial input image belongs to the correct category) and the preset value. The above second sub-loss function can be expressed as p2 represents the second probability that a second initial input image is identified as a specified classification label, and d(p2,1) represents the cosine distance between the second probability (i.e., the predicted probability that the second initial input image belongs to a certain error category) and a preset value; specifically, the second sub-loss function is equal to 1 minus the average of the loss values corresponding to the second number of second initial input images, and the loss value corresponding to the second initial input image is equal to the cosine distance between the second probability corresponding to the second initial input image and the preset value; after determining the first sub-loss function and the second sub-loss function, the first sub-loss function and the second sub-loss function are weightedly summed to obtain the first loss function; specifically, d(p1,1) and d(p2,1) can be calculated using the following formulas, for example, a pairwise distance function based on cosine distance
[0129] In the embodiment of the present application, for the image classification loss, the cross entropy loss function is not directly used as the basis for determining the image classification loss, but a batch of N initial input images is divided into a first number of first initial input images and a second number of second initial input images, and the loss of the first initial input image being identified as the correct category and the loss of the second initial input image being identified as the wrong category are considered at the same time. In this way, the network can not only better learn the key feature distribution of the correct category, but also make the network prediction result close to the correct category based on the first sub-loss function. At the same time, the network can also learn the difference between the wrong category and the correct category, and make the network prediction result stay away from the wrong category based on the second sub-loss function, thereby further improving the updating accuracy of the model parameters.
[0130] In a specific embodiment, the image reconstruction network includes a first convolutional subnetwork, a second convolutional subnetwork and an image reconstruction layer, the first attention subnetwork includes a convolutional layer, a pooling layer, and a logistic regression layer, and the second attention subnetwork includes a feature decoupling layer, a feature weighting layer and a feature completion layer; in the above Figure 3 On the basis of Figure 5 As shown in the figure, the implementation process of the above model training method is as follows:
[0131] Get N initial input images;
[0132] For each initial input image i, use the first convolution subnetwork to perform at least one convolution process based on the initial input image i to obtain a first feature map i;
[0133] Using the second convolutional subnetwork to perform at least one convolution process based on the first feature map i and the target interference noise point, to obtain a seventh feature map i;
[0134] Using the image reconstruction layer to reconstruct the image based on the seventh feature map i, to obtain a target reconstructed image i;
[0135] Perform residual calculation based on the target reconstructed image i and the initial input image i to obtain the residual image i corresponding to the initial input image i;
[0136] Input the residual map i and the first feature map i into the attention network;
[0137] Using the convolution layer, pooling layer, and logistic regression layer in the first attention sub-network to sequentially perform convolution processing, pooling processing, and logistic regression processing based on the residual image i to determine the first weight information;
[0138] Determine the second weight information based on the magnitude of each first weight coefficient in the first weight information; the second weight information includes a plurality of second weight coefficients, and the sum of the first weight coefficient and the second weight coefficient under the same feature channel is equal to 1;
[0139] Perform feature decoupling processing on the first feature map i using the feature decoupling layer in the second attention sub-network to obtain a fifth feature map i; and input the fifth feature map i into the feature weighting layer;
[0140] Using the feature weighting layer in the second attention sub-network to perform feature weighting processing on the fifth feature map i based on the second weight information, to obtain a sixth feature map i; and inputting the sixth feature map i into the feature completion layer;
[0141] Using the feature completion layer in the second attention sub-network to perform feature completion processing on the sixth feature map i based on the first feature map i, to obtain the second feature map i, and input the second feature map i into the image classification network;
[0142] Using an image classification network to perform image classification processing based on the second feature map i, a classification prediction result i of the initial input image i is obtained;
[0143] Determine a total loss function based on the classification prediction result i of each initial input image i and the true classification label i of the initial input image i;
[0144] The parameters of the above image recognition model are iteratively updated based on the above total loss function to obtain a trained image recognition model.
[0145] The model training method in the embodiment of the present application reconstructs the image based on the initial input image and the target interference noise. In this way, due to the loss of some non-critical feature information (such as high-frequency features) due to feature extraction and other processing during the image reconstruction process, and under the interference of the target interference noise, the loss of high-frequency features is promoted, so that the target reconstructed image mainly contains the key feature information of the target object (such as low-frequency features); then the initial input image and the target reconstructed image are subjected to residual calculation to obtain a residual map, so that the residual map mainly contains the image background information and the high-frequency features lost in the image reconstruction process; then, the weight distribution of each feature channel is learned based on the residual map, wherein the weight coefficients of the image background information and the high-frequency features lost in the image reconstruction process in the first weight information obtained are relatively large, while the weight coefficients of the low-frequency features are relatively large. The weight coefficient is relatively small, therefore, feature weighting processing can be performed with the help of the second weight information that is complementary to the first weight information. Since the sum of the weight coefficients corresponding to the same feature channel in the first weight information and the second weight information is a constant (for example, equal to 1), if the weight coefficient corresponding to the low-frequency feature in the first weight information is relatively small, then the weight coefficient corresponding to the low-frequency feature in the second weight information is relatively large. In this way, feature weighting based on the second weight information is used to obtain a second feature map, and then image classification processing is performed based on the second feature map. The model parameters are then updated based on the classification prediction results, which can guide the model to pay more attention to learning the distribution of key features that help distinguish image categories, thereby improving the parameter update accuracy of the image recognition model, and then improving the image classification accuracy of the trained image recognition model.
[0146] Corresponding to the above Figures 1 to 5 The model training method described above is based on the same technical concept. The embodiment of the present application also provides an image recognition method. Figure 6 A flowchart of an image recognition method provided in an embodiment of the present application is shown in FIG. Figure 6 The method can be executed by an electronic device, which can be a terminal device or a designated server; the method is applied to an image recognition model, which can be a computer system using the above Figures 1 to 5 The model obtained by training the model training method described is as follows Figure 6 As shown, the above-mentioned image recognition method at least includes the following steps:
[0147] Performing image processing on the image to be classified using the image recognition model to obtain a classification result of the image to be classified; wherein the image processing includes:
[0148] S602, performing image processing based on the image to be classified to obtain an eighth feature map; in some example embodiments, the eighth feature map may be output by the first convolutional subnetwork in the image reconstruction network.
[0149] S604: Perform feature processing based on the eighth feature map to obtain a ninth feature map.
[0150] S606: Perform image classification processing based on the ninth feature map to obtain a classification result of the image to be classified.
[0151] The above-mentioned image to be classified is an image that needs to identify the category of the target object contained therein. The determination process of the above-mentioned eighth feature map can refer to the determination process of the above-mentioned first feature map, and the determination process of the above-mentioned ninth feature map can refer to the determination process of the above-mentioned second feature map, which will not be repeated here. It should be noted that if the image recognition model includes an image reconstruction network, an attention network and an image classification network, then in the process of using the trained image recognition model to identify the image category of the image to be classified, that is, the model application stage, the above-mentioned image reconstruction network includes a first convolutional subnetwork, does not include a second convolutional subnetwork and an image reconstruction layer, and the output of the first convolutional subnetwork is the eighth feature map; since the image reconstruction network only outputs the eighth feature map and does not output a reconstructed image, there is no need to generate a residual map. Therefore, the input of the above-mentioned attention network only includes the eighth feature map, does not include the residual map, does not distinguish the weight allocation of each feature, and does not distinguish the weight coefficients of each feature. The feature extraction processing is directly based on the eighth feature map to obtain the ninth feature map.
[0152] The above S602, performing image processing based on the image to be classified to obtain the eighth feature map, specifically includes:
[0153] Convolution processing is performed based on the image to be classified to obtain a third intermediate feature map; convolution processing is performed based on the third intermediate feature map to obtain an eighth feature map.
[0154] In some example embodiments, the image reconstruction network may include a first convolutional subnetwork, and the first convolutional subnetwork includes a plurality of first convolutional layers connected in series; correspondingly, the S602, performing image processing based on the image to be classified to obtain the eighth feature map, specifically includes:
[0155] Using the first convolutional layer in the first convolutional subnetwork to perform convolution processing based on the image to be classified, to obtain a third intermediate feature map;
[0156] The last first convolutional layer in the first convolutional subnetwork is used to perform convolution processing based on the third intermediate feature map output by the previous first convolutional layer to obtain an eighth feature map.
[0157] The specific processing process of the first convolutional subnetwork can refer to the above embodiment, and the determination process of the eighth feature map can refer to the determination process of the first feature map, which will not be repeated here.
[0158] The above S604, performing feature processing based on the above eighth feature map to obtain a ninth feature map, specifically includes:
[0159] Based on the eighth feature map, feature decoupling processing is performed to obtain a decoupled feature map; based on the eighth feature map, feature completion processing is performed on the decoupled feature map to obtain a ninth feature map.
[0160] In an embodiment of the present application, feature decoupling is first performed based on the eighth feature map to obtain a decoupled feature map; then, feature completion is performed on the decoupled feature map based on the eighth feature map to obtain a ninth feature map; that is, the ninth feature map ultimately used for image classification is obtained by feature completion of the decoupled feature map based on the eighth feature map. This can solve the problem that feature information contributing to image classification may be lost during feature extraction and feature decoupling, thereby further improving image classification accuracy.
[0161] In some example embodiments, the attention network may include a second attention sub-network, and the second attention sub-network includes a feature decoupling layer and a feature processing layer; correspondingly, the S604, performing feature processing based on the eighth feature map to obtain a ninth feature map, specifically includes:
[0162] Using a feature decoupling layer to perform feature decoupling processing based on the eighth feature map to obtain a decoupled feature map;
[0163] The feature processing layer is used to perform feature completion processing on the decoupled feature map based on the eighth feature map to obtain a ninth feature map.
[0164] The specific processing process of the above-mentioned second attention sub-network can refer to the above-mentioned embodiment, and the determination process of the above-mentioned ninth feature map can refer to the determination process of the above-mentioned second feature map, which will not be repeated here; among them, since the first attention sub-network does not input the residual map, therefore, each weight coefficient in the first weight information is 0, and correspondingly, each weight coefficient in the second weight coefficient is 1, and the decoupled feature map is still a decoupled feature map after feature weighting processing.
[0165] Take the above image recognition model including an image reconstruction network, an attention network and an image classification network, and the image reconstruction network includes a first convolutional subnetwork and a second convolutional subnetwork, and the attention network includes a feature decoupling layer and a feature processing layer as an example. Figure 7 As shown, the implementation process of the above image recognition method is specifically as follows:
[0166] Using the first convolutional subnetwork in the image reconstruction network to perform convolution processing based on the image to be classified, to obtain an eighth feature map; and inputting the eighth feature map into the attention network;
[0167] Using the feature decoupling layer in the attention network to perform feature decoupling processing based on the eighth feature map, a decoupled feature map is obtained; and the decoupled feature map is input into the feature weighting layer;
[0168] The feature weighting layer in the attention network is used to perform feature weighting processing on the decoupled feature map based on the fourth weight information to obtain a feature-weighted decoupled feature map; and the feature-weighted decoupled feature map is input into the feature completion layer; wherein the fourth weight information is determined based on the third weight information, and since the input of the convolutional layer is empty, each weight coefficient in the third weight information is 0, and correspondingly, each weight coefficient in the fourth weight information is 1, so that the feature-weighted decoupled feature map is consistent with the output of the feature decoupling layer;
[0169] Using the feature completion layer in the attention network to perform feature completion processing on the feature-weighted decoupled feature map based on the eighth feature map, a ninth feature map is obtained;
[0170] The image classification network is used to perform image classification processing based on the ninth feature map to obtain a classification result of the image to be classified.
[0171] The image recognition method in the embodiment of the present application uses a trained image recognition model to perform feature extraction processing based on the image to be classified to obtain an eighth feature map, then performs feature extraction processing based on the eighth feature map to obtain a ninth feature map, and then performs image classification processing based on the ninth feature map to obtain a classification result of the image to be classified; wherein, in the training process of the image recognition model, image reconstruction is first performed based on the initial input image and the target interference noise. In this way, since a part of non-critical feature information (such as high-frequency features) will be lost during the image reconstruction process due to feature extraction and other processing, and under the interference of the target interference noise, the degree of loss of high-frequency features is promoted, so that the target reconstructed image mainly contains the key feature information (such as low-frequency features) of the target object; then, the initial input image and the target reconstructed image are subjected to residual calculation to obtain a residual map, so that the residual map mainly contains the image background information and the high-frequency features lost during the image reconstruction process; then, the features of each feature channel are learned based on the residual map. Weight allocation, wherein the weight coefficients of the image background information and the high-frequency features lost in the image reconstruction process in the first weight information obtained are relatively large, while the weight coefficients of the low-frequency features are relatively small. Therefore, feature weighting processing can be performed with the help of the second weight information that is complementary to the first weight information. Since the sum of the weight coefficients corresponding to the same feature channel in the first weight information and the second weight information is a constant (for example, equal to 1), if the weight coefficient corresponding to the low-frequency feature in the first weight information is relatively small, then the weight coefficient corresponding to the low-frequency feature in the second weight information is relatively large. In this way, feature weighting is performed based on the second weight information to obtain a second feature map, and then image classification processing is performed based on the second feature map, and then the model parameters are updated based on the classification prediction results, which can achieve the effect of guiding the model to pay more attention to learning the distribution of key features that help distinguish image categories, thereby improving the parameter update accuracy of the image recognition model, and then improving the image classification accuracy of the trained image recognition model.
[0172] It should be noted that this embodiment in the present application and the previous embodiment in the present application are based on the same inventive concept, so the specific implementation of this embodiment can refer to the implementation of the aforementioned model training method, and the repeated parts will not be repeated.
[0173] Corresponding to the above Figures 1 to 5 The model training method described above is based on the same technical concept. The embodiment of the present application also provides a model training device. Figure 8 A schematic diagram of the module composition of the model training device provided in the embodiment of the present application, which is used to perform Figures 1 to 5 The model training method described in Figure 8 As shown, the device comprises:
[0174] The model training module is used to perform model training on the image recognition model using the initial input image to obtain a trained image recognition model; wherein the model training includes:
[0175] An image reconstruction module 802 is used to perform image processing based on the initial input image and the target interference noise to obtain a first feature map and a target reconstructed image;
[0176] A feature map generation module 804 is used to perform feature weighting processing based on the residual map corresponding to the initial input image and the first feature map to obtain a second feature map; the residual map is obtained by performing residual calculation between the initial input image and the target reconstructed image;
[0177] A category prediction module 806 is used to perform image classification processing based on the second feature map to obtain a classification prediction result of the initial input image;
[0178] The parameter updating module 808 is used to update the parameters of the image recognition model based on the classification prediction result and the true classification label of the initial input image.
[0179] The model training device in the embodiment of the present application reconstructs the image based on the initial input image and the target interference noise. In this way, due to the loss of some non-critical feature information (such as high-frequency features) due to feature extraction and other processing during the image reconstruction process, and under the interference of the target interference noise, the loss of high-frequency features is reduced, so that the target reconstructed image mainly contains the key feature information of the target object (such as low-frequency features); the initial input image and the target reconstructed image are then subjected to residual calculation to obtain a residual map, so that the residual map mainly contains the image background information and the high-frequency features lost in the image reconstruction process; then, the weight distribution of each feature channel is learned based on the residual map, wherein the weight coefficients of the image background information and the high-frequency features lost in the image reconstruction process in the first weight information obtained are relatively large, while the weight coefficients of the low-frequency features are relatively large. The weight coefficient is relatively small, therefore, feature weighting processing can be performed with the help of the second weight information that is complementary to the first weight information. Since the sum of the weight coefficients corresponding to the same feature channel in the first weight information and the second weight information is a constant (for example, equal to 1), if the weight coefficient corresponding to the low-frequency feature in the first weight information is relatively small, then the weight coefficient corresponding to the low-frequency feature in the second weight information is relatively large. In this way, feature weighting based on the second weight information is used to obtain a second feature map, and then image classification processing is performed based on the second feature map. The model parameters are then updated based on the classification prediction results, which can guide the model to pay more attention to learning the distribution of key features that help distinguish image categories, thereby improving the parameter update accuracy of the image recognition model, and then improving the image classification accuracy of the trained image recognition model.
[0180] It should be noted that the embodiment of the model training device in the present application and the embodiment of the model training method in the present application are based on the same inventive concept. Therefore, the specific implementation of this embodiment can refer to the implementation of the corresponding model training method mentioned above, and the repeated parts will not be repeated.
[0181] Corresponding to the above Figure 6 to Figure 7 The image recognition method described above is based on the same technical concept. The embodiment of the present application also provides an image recognition device. Fig. 9 The module composition diagram of the image recognition device provided in the embodiment of the present application is used to perform Figure 6 to Figure 7 Image recognition methods described, such as Fig. 9 As shown, the device comprises:
[0182] The image processing module is used to perform image processing on the image to be classified using the image recognition model to obtain the classification result of the image to be classified; wherein the image processing includes:
[0183] A first feature extraction module 902, configured to perform image processing based on the image to be classified to obtain an eighth feature map;
[0184] A second feature extraction module 904, configured to perform feature processing based on the eighth feature map to obtain a ninth feature map;
[0185] The image classification and recognition module 906 is used to perform image classification processing based on the ninth feature map to obtain a classification result of the image to be classified.
[0186] The image recognition device in the embodiment of the present application uses the trained image recognition model to perform feature extraction processing based on the image to be classified to obtain an eighth feature map, then performs feature extraction processing based on the eighth feature map to obtain a ninth feature map, and then performs image classification processing based on the ninth feature map to obtain a classification result of the image to be classified; wherein, in the training process of the image recognition model, image reconstruction is first performed based on the initial input image and the target interference noise. In this way, since a part of non-critical feature information (such as high-frequency features) will be lost during the image reconstruction process due to feature extraction and other processing, and under the interference of the target interference noise, the degree of loss of high-frequency features is promoted, so that the target reconstructed image mainly contains the key feature information (such as low-frequency features) of the target object; then, the initial input image and the target reconstructed image are subjected to residual calculation to obtain a residual map, so that the residual map mainly contains the image background information and the high-frequency features lost during the image reconstruction process; then, the features of each feature channel are learned based on the residual map. Weight allocation, wherein the weight coefficients of the image background information and the high-frequency features lost in the image reconstruction process in the first weight information obtained are relatively large, while the weight coefficients of the low-frequency features are relatively small. Therefore, feature weighting processing can be performed with the help of the second weight information that is complementary to the first weight information. Since the sum of the weight coefficients corresponding to the same feature channel in the first weight information and the second weight information is a constant (for example, equal to 1), if the weight coefficient corresponding to the low-frequency feature in the first weight information is relatively small, then the weight coefficient corresponding to the low-frequency feature in the second weight information is relatively large. In this way, feature weighting is performed based on the second weight information to obtain a second feature map, and then image classification processing is performed based on the second feature map, and then the model parameters are updated based on the classification prediction results, which can achieve the effect of guiding the model to pay more attention to learning the distribution of key features that help distinguish image categories, thereby improving the parameter update accuracy of the image recognition model, and then improving the image classification accuracy of the trained image recognition model.
[0187] It should be noted that the embodiment of the image recognition device in the present application and the embodiment of the model training method in the present application are based on the same inventive concept. Therefore, the specific implementation of this embodiment can refer to the implementation of the corresponding model training method mentioned above, and the repeated parts will not be repeated.
[0188] Corresponding to the above Figures 1 to 7 Based on the same technical concept, the present application also provides an electronic device for executing the above-mentioned model training method. Fig.10 shown.
[0189] Electronic devices may have relatively large differences due to different configurations or performances, and may include one or more processors 1001 and memory 1002, and the memory 1002 may store one or more storage applications or data. Among them, the memory 1002 may be a short-term storage or a persistent storage. The application stored in the memory 1002 may include one or more modules (not shown in the figure), and each module may include a series of computer executable instructions in the electronic device. Furthermore, the processor 1001 may be configured to communicate with the memory 1002 and execute a series of computer executable instructions in the memory 1002 on the electronic device. The electronic device may also include one or more power supplies 1003, one or more wired or wireless network interfaces 1004, one or more input and output interfaces 1005, one or more keyboards 1006, etc.
[0190] The electronic device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer executable instructions for the electronic device, and the one or more programs are configured to be executed by one or more processors, including computer executable instructions for performing the following:
[0191] The image recognition model is trained using the initial input image to obtain a trained image recognition model; wherein the model training includes:
[0192] Performing image processing based on the initial input image and the target interference noise to obtain a first feature map and a target reconstructed image;
[0193] Performing feature weighting processing based on the residual map corresponding to the initial input image and the first feature map to obtain a second feature map; the residual map is obtained by performing residual calculation on the initial input image and the target reconstructed image;
[0194] Performing image classification processing based on the second feature map to obtain a classification prediction result of the initial input image;
[0195] Based on the classification prediction result and the true classification label of the initial input image, the parameters of the image recognition model are updated.
[0196] The one or more programs configured to be executed by one or more processors also include computer executable instructions for performing the following:
[0197] Performing image processing on the image to be classified using the image recognition model to obtain a classification result of the image to be classified; wherein the image processing includes:
[0198] Performing image processing based on the image to be classified to obtain an eighth feature map;
[0199] Performing feature processing based on the eighth feature map to obtain a ninth feature map;
[0200] Image classification processing is performed based on the ninth feature map to obtain a classification result of the image to be classified.
[0201] The electronic device in the embodiment of the present application reconstructs the image based on the initial input image and the target interference noise. In this way, due to the loss of some non-critical feature information (such as high-frequency features) due to feature extraction and other processing during the image reconstruction process, and under the interference of the target interference noise, the loss of high-frequency features is promoted, so that the target reconstructed image mainly contains the key feature information of the target object (such as low-frequency features); then the initial input image and the target reconstructed image are subjected to residual calculation to obtain a residual map, so that the residual map mainly contains the image background information and the high-frequency features lost in the image reconstruction process; then, the weight distribution of each feature channel is learned based on the residual map, wherein the weight coefficients of the image background information and the high-frequency features lost in the image reconstruction process in the first weight information obtained are relatively large, while the weight coefficients of the low-frequency features are relatively large. The coefficient is relatively small, therefore, feature weighting processing can be performed with the help of the second weight information that is complementary to the first weight information. Since the sum of the weight coefficients corresponding to the same feature channel in the first weight information and the second weight information is a constant (for example, equal to 1), if the weight coefficient corresponding to the low-frequency feature in the first weight information is relatively small, then the weight coefficient corresponding to the low-frequency feature in the second weight information is relatively large. In this way, feature weighting based on the second weight information is used to obtain a second feature map, and then image classification processing is performed based on the second feature map. Then, the model parameters are updated based on the classification prediction results, which can guide the model to pay more attention to learning the distribution of key features that help distinguish image categories, thereby improving the parameter update accuracy of the image recognition model, and then improving the image classification accuracy of the trained image recognition model.
[0202] It should be noted that the embodiment of the electronic device in the present application and the embodiment of the model training method in the present application are based on the same inventive concept. Therefore, the specific implementation of this embodiment can refer to the implementation of the corresponding model training method mentioned above, and the repeated parts will not be repeated.
[0203] Corresponding to the above Figures 2 to 7 The method shown is based on the same technical concept. The embodiment of the present application also provides a computer-readable storage medium, which is used to store computer-executable instructions. The storage medium can be a USB flash drive, an optical disk, a hard disk, etc. When the computer-executable instructions stored in the storage medium are executed by the processor, the following process can be implemented:
[0204] The image recognition model is trained using the initial input image to obtain a trained image recognition model; wherein the model training includes:
[0205] Performing image processing based on the initial input image and the target interference noise to obtain a first feature map and a target reconstructed image;
[0206] Performing feature weighting processing based on the residual map corresponding to the initial input image and the first feature map to obtain a second feature map; the residual map is obtained by performing residual calculation on the initial input image and the target reconstructed image;
[0207] Performing image classification processing based on the second feature map to obtain a classification prediction result of the initial input image;
[0208] Based on the classification prediction result and the true classification label of the initial input image, the parameters of the image recognition model are updated.
[0209] The computer executable instructions stored in the above storage medium can also implement the following process when executed by the processor:
[0210] Performing image processing on the image to be classified using the image recognition model to obtain a classification result of the image to be classified; wherein the image processing includes:
[0211] Performing image processing based on the image to be classified to obtain an eighth feature map;
[0212] Performing feature processing based on the eighth feature map to obtain a ninth feature map;
[0213] Image classification processing is performed based on the ninth feature map to obtain a classification result of the image to be classified.
[0214] When the computer executable instructions stored in the storage medium in the embodiment of the present application are executed by the processor, the image is reconstructed based on the initial input image and the target interference noise. In this way, since a part of non-critical feature information (such as high-frequency features) may be lost due to feature extraction and other processing during the image reconstruction process, and under the interference of the target interference noise, the degree of loss of high-frequency features is promoted, so that the target reconstructed image mainly contains the key feature information of the target object (such as low-frequency features); then the initial input image and the target reconstructed image are subjected to residual calculation to obtain a residual map, so that the residual map mainly contains the image background information and the high-frequency features lost in the image reconstruction process; then, the weight distribution of each feature channel is learned based on the residual map, wherein the weight coefficients of the image background information and the high-frequency features lost in the image reconstruction process in the first weight information obtained are compared. The weight coefficient of the low-frequency feature is relatively large, while the weight coefficient of the low-frequency feature is relatively small. Therefore, the feature weighting processing can be performed with the help of the second weight information which is complementary to the first weight information. Since the sum of the weight coefficients corresponding to the same feature channel in the first weight information and the second weight information is a constant (for example, equal to 1), if the weight coefficient corresponding to the low-frequency feature in the first weight information is relatively small, then the weight coefficient corresponding to the low-frequency feature in the second weight information is relatively large. In this way, feature weighting based on the second weight information is used to obtain the second feature map, and then image classification processing is performed based on the second feature map. Then, the model parameters are updated based on the classification prediction results, which can guide the model to pay more attention to learning the distribution of key features that help distinguish image categories, thereby improving the parameter update accuracy of the image recognition model, and then improving the image classification accuracy of the trained image recognition model.
[0215] It should be noted that the embodiment of the storage medium in the present application and the embodiment of the model training method in the present application are based on the same inventive concept. Therefore, the specific implementation of this embodiment can refer to the implementation of the corresponding model training method mentioned above, and the repeated parts will not be repeated.
[0216] An embodiment of the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements some or all of the steps in the above method; wherein, when the computer program product is run on a computer, it enables the computer to execute the above-mentioned related steps to implement the method in the above embodiment.
[0217] In addition, an embodiment of the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor can execute the computer-executable instructions stored in the memory so that the chip executes the methods in the above-mentioned method embodiments.
[0218] Among them, the electronic device, server, computer storage medium, computer program product or chip provided in the embodiments of the present application are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.
[0219] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0220] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the embodiments of the present application may adopt the form of complete hardware embodiments, complete software embodiments, or embodiments in combination with software and hardware. Moreover, the application may adopt the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0221] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0222] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0223] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory. Memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium. Computer-readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media for storing information that can be accessed by a computing device. According to the definition in this article, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0224] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0225] The embodiments of the present application can be described in the general context of computer executable instructions executed by a computer, such as a program module. Generally, a program module includes routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of the present application can also be practiced in a distributed computing environment, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices. The various embodiments in the present application are described in a progressive manner, and the same and similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0226] The above description is only an embodiment of this document and is not intended to limit this document. For those skilled in the art, this document may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this document should be included in the scope of the claims of this document.
Claims
1. A model training method, characterized in that: The method comprises: The image recognition model is trained using the initial input image to obtain a trained image recognition model; wherein the model training includes: Performing image processing based on the initial input image and the target interference noise to obtain a first feature map and a target reconstructed image; Performing feature weighting processing based on the residual map corresponding to the initial input image and the first feature map to obtain a second feature map; the residual map is obtained by performing residual calculation on the initial input image and the target reconstructed image; Performing image classification processing based on the second feature map to obtain a classification prediction result of the initial input image; Based on the classification prediction result and the true classification label of the initial input image, the parameters of the image recognition model are updated.
2. The method according to claim 1, characterized in that The step of performing feature weighting processing on the residual map corresponding to the initial input image and the first feature map to obtain a second feature map includes: Perform feature extraction processing based on the residual image corresponding to the initial input image to determine first weight information; the first weight information includes first weight coefficients under multiple channels; Feature weighting processing is performed based on the first feature map and the second weight information to obtain a second feature map; the second weight information includes second weight coefficients under the multiple channels, and the sum of the first weight coefficient and the second weight coefficient under the same channel is equal to 1.
3. The method according to claim 2, characterized in that The performing feature extraction processing based on the residual image corresponding to the initial input image to determine the first weight information includes: Performing convolution processing on the residual map to obtain a third feature map; Performing pooling processing on the third feature map to obtain a fourth feature map; Logistic regression processing is performed based on the fourth feature map to obtain first weight information.
4. The method according to claim 2, characterized in that: The step of performing feature weighting processing based on the first feature map and the second weight information to obtain a second feature map includes: Performing feature decoupling processing based on the first feature map to obtain a fifth feature map; Feature weighting processing is performed based on the fifth feature map and the second weight information to obtain a second feature map.
5. The method according to claim 4, characterized in that The performing feature weighting processing based on the fifth feature map and the second weight information to obtain the second feature map includes: Perform feature weighting processing based on the fifth feature map and the second weight information to obtain a sixth feature map; Based on the first feature map, feature completion processing is performed on the sixth feature map to obtain a second feature map.
6. The method according to claim 1, characterized in that The performing image processing based on the initial input image and the target interference noise to obtain a first feature map and a target reconstructed image includes: Performing convolution processing based on the initial input image to obtain a first intermediate feature map; Performing convolution processing based on the first intermediate feature map to obtain a first feature map; Performing convolution processing based on the first feature map to obtain a second intermediate feature map; Performing convolution processing based on the second intermediate feature map and the target interference noise to obtain a seventh feature map; Image reconstruction is performed based on the seventh feature map to obtain a target reconstructed image.
7. The method according to claim 1, characterized in that The updating of the parameters of the image recognition model based on the classification prediction result and the true classification label of the initial input image comprises: Perform classification loss calculation based on the classification prediction result and the true classification label of the initial input image to obtain a first loss function; Performing image reconstruction loss calculation based on the target reconstructed image and the initial input image to obtain a second loss function; Based on the first loss function and the second loss function, the parameters of the image recognition model are updated.
8. The method according to claim 7, characterized in that The classification prediction result includes a first probability that the initial input image is identified as a true classification label and a second probability that the initial input image is identified as a specified classification label, and the specified classification label is not the true classification label; The performing classification loss calculation based on the classification prediction result and the true classification label of the initial input image to obtain a first loss function includes: For a first number of first initial input images, perform cosine distance calculation based on a first probability corresponding to the first initial input image and a preset value to obtain a first sub-loss function; For a second number of second initial input images, perform cosine distance calculation based on a second probability corresponding to the second initial input image and the preset value to obtain a second sub-loss function; A first loss function is determined based on the first sub-loss function and the second sub-loss function.
9. An image recognition method, characterized in that: The method comprises: Performing image processing on the image to be classified using the image recognition model to obtain a classification result of the image to be classified; wherein the image processing includes: Performing image processing based on the image to be classified to obtain an eighth feature map; Performing feature processing based on the eighth feature map to obtain a ninth feature map; Image classification processing is performed based on the ninth feature map to obtain a classification result of the image to be classified.
10. The method according to claim 9, characterized in that The step of performing image processing based on the image to be classified to obtain an eighth feature map includes: Perform convolution processing based on the image to be classified to obtain a third intermediate feature map; Convolution processing is performed based on the third intermediate feature map to obtain an eighth feature map.
11. The method according to claim 9, characterized in that The performing feature processing based on the eighth feature map to obtain a ninth feature map includes: Performing feature decoupling processing based on the eighth feature map to obtain a decoupled feature map; Based on the eighth feature map, feature completion processing is performed on the decoupled feature map to obtain a ninth feature map.
12. A model training device, characterized in that: The device comprises: The model training module is used to perform model training on the image recognition model using the initial input image to obtain a trained image recognition model; wherein the model training includes: Performing image processing based on the initial input image and the target interference noise to obtain a first feature map and a target reconstructed image; Performing feature weighting processing based on the residual map corresponding to the initial input image and the first feature map to obtain a second feature map; the residual map is obtained by performing residual calculation on the initial input image and the target reconstructed image; Performing image classification processing based on the second feature map to obtain a classification prediction result of the initial input image; Based on the classification prediction result and the true classification label of the initial input image, the parameters of the image recognition model are updated.
13. An image recognition device, characterized in that: The device comprises: The image processing module is used to perform image processing on the image to be classified using the image recognition model to obtain the classification result of the image to be classified; wherein the image processing includes: Performing image processing based on the image to be classified to obtain an eighth feature map; Performing feature processing based on the eighth feature map to obtain a ninth feature map; Image classification processing is performed based on the ninth feature map to obtain a classification result of the image to be classified.
14. An electronic device, characterized in that: The device comprises: Processor; and A memory arranged to store computer executable instructions, the executable instructions being configured to be executed by the processor, the executable instructions comprising instructions for performing the steps of the method according to any one of claims 1 to 8 or any one of claims 9 to 11.
15. A computer-readable storage medium, characterized in that: The storage medium is used to store computer-executable instructions, and the executable instructions enable a computer to execute the method according to any one of claims 1 to 8 or any one of claims 9 to 11.
16. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 8 or any one of claims 9 to 11 is implemented.
Citation Information
Patent Citations
Image classification method and device, training method and device, equipment and medium
CN111368937A
Remote sensing image super-resolution reconstruction method based on deep convolutional neural network
CN113222819A
Two-stage mainboard image defect detecting and positioning method based on machine vision
CN114972213A
End-to-end human behavior classification method and system based on space-time adaptive fusion
CN116189281A
Decoupling Category-Wise Independence and Relevance with Self-Attention for Multi-Label Image Classification
US20200356842A1
Cited By
Image processing method, model training method and related device
CN119052654A
Carotid plaque image feature rapid extraction method, apparatus and device, and medium
CN119360044A
