Image recognition model training method and device

By introducing a detailed feature guidance layer into the image recognition model and guiding shallow features using the true value of the image detail information, the contradiction between semantic segmentation performance and inference speed in the prior art is solved, and the semantic segmentation effect with high precision and low latency is achieved.

CN112699893BActive Publication Date: 2025-03-21BEIJING SANKUAI ONLINE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110033686.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-11
Publication Date
2025-03-21
Estimated Expiration
2041-01-11

AI Technical Summary

Technical Problem

When real-time semantic segmentation is implemented, it is difficult for the prior art to maintain high accuracy without affecting the inference speed. It is often necessary to reduce the image scale or introduce additional branches, resulting in a loss of accuracy or a decrease in the inference speed.

Method used

By introducing a detailed feature guidance layer, the shallow features are guided using the image detail information truth value during the training stage, so that the network can more fully encode spatial information and improve semantic segmentation performance without increasing computational consumption or affecting the inference speed.

Benefits of technology

It realizes improving semantic segmentation performance without affecting the inference speed, avoiding accuracy loss and increased computational volume.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112699893B_ABST
    Figure CN112699893B_ABST
Patent Text Reader

Abstract

The present disclosure provides an image recognition model training method and device. The method includes: inputting sample data into a pre-trained image recognition model; calling a deep feature processing layer to process the image to obtain deep feature information corresponding to the image; calling a detail feature guidance layer to process the image according to the true value of the image to obtain a detail feature value corresponding to the image, and determining a detail loss value corresponding to the detail feature guidance layer according to the detail feature value; when the detail loss value is within a first preset range, fusing the deep feature information and the detail feature value to obtain a predicted classification result corresponding to the image; calculating the loss value of the image recognition model according to the initial classification result and the predicted classification result; when the loss value is within a second preset range, using the trained image recognition model as the target image recognition model. The present disclosure can enable the network to more fully encode spatial information, while improving the semantic segmentation performance, without introducing additional computational consumption, and will not affect the inference speed of the model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of model training technology, and in particular, to an image recognition model training method and device. Background Art

[0002] Semantic segmentation is a very important direction in computer vision. With the booming development of deep learning, the speed and accuracy of image semantic segmentation based on deep learning have entered a new stage. Currently, many fields need to apply semantic segmentation technology, such as autonomous driving, robotics, augmented reality, etc.

[0003] Real-time semantic segmentation has very high requirements for inference speed. For this type of technical field, maintaining efficient inference speed and high accuracy at the same time is a very critical issue. Most solutions in the field will choose to reduce the image scale and use lightweight backbone networks to speed up, but this will lose image detail information, resulting in a loss of accuracy. Therefore, many solutions will use additional spatial branches to supplement spatial information, but the introduction of additional branches will cause a decrease in inference speed. Some solutions also directly use shallow information of the network for fusion, but due to the lack of prior guidance of shallow information of the network, the semantic segmentation results are not ideal. Summary of the invention

[0004] The embodiments of the present disclosure provide an image recognition model training method and device for guiding shallow features based on the true value of image detail information, so that the network can more fully encode spatial information, and while improving semantic segmentation performance, it will not introduce additional computing consumption and will not affect the reasoning speed of the model.

[0005] According to a first aspect of an embodiment of the present disclosure, there is provided an image recognition model training method, comprising:

[0006] Inputting sample data into a pre-trained image recognition model; wherein the sample data includes an image, an image truth value corresponding to the image, and an initial classification result corresponding to the image, and the image recognition model includes a deep feature processing layer and a detail feature guidance layer, wherein the detail feature guidance layer is only applied in the training phase of the image recognition model;

[0007] Calling the deep feature processing layer to process the image to obtain deep feature information corresponding to the image;

[0008] Calling the detail feature guiding layer to process the image according to the true value of the image to obtain a detail feature value corresponding to the image, and determining a detail loss value corresponding to the detail feature guiding layer according to the detail feature value;

[0009] When the detail loss value is within a first preset range, fusing the deep feature information with the detail feature value to obtain a prediction classification result corresponding to the image;

[0010] Calculating a loss value of the image recognition model according to the initial classification result and the predicted classification result;

[0011] When the loss value is within the second preset range, the trained image recognition model is used as the target image recognition model.

[0012] Optionally, the detail feature guiding layer comprises: a detail truth value generating unit and a detail loss guiding unit,

[0013] The calling of the detail feature guiding layer to process the image according to the true value of the image to obtain a detail feature value corresponding to the image, and determining a detail loss value corresponding to the detail feature guiding layer according to the detail feature value, includes:

[0014] Calling the detail true value generating unit to process the image to obtain image edge information corresponding to the image, and determining the detail feature value corresponding to the image according to the image edge information and the image true value;

[0015] The detail loss guiding unit is called to perform dimensionality reduction processing on the detail feature value to obtain a predicted detail classification result corresponding to the detail feature value, and the detail loss value is calculated based on the predicted detail classification result and the detail feature value.

[0016] Optionally, the detail truth value generating unit includes: a detail capturing subunit and a weight fusion subunit,

[0017] The calling of the detail true value generating unit to process the image to obtain image edge information corresponding to the image, and determining the detail feature value corresponding to the image according to the image edge information and the image true value, includes:

[0018] Calling the detail capture subunit to capture edge information of the image using multiple preset step sizes to obtain edge information of the image at multiple scales, and determining an initial detail feature value according to the edge information and the true value of the image;

[0019] Calling the weight fusion subunit to sample the initial detail feature values ​​using a plurality of preset sampling magnifications, and fusing the sampled detail feature values ​​to obtain fused detail feature values;

[0020] The fused detail feature values ​​that are greater than a set threshold are screened out from the fused detail feature values ​​to serve as detail feature values ​​corresponding to the image.

[0021] Optionally, calling the detail loss guiding unit to perform dimensionality reduction processing on the detail feature value to obtain a predicted detail classification result corresponding to the detail feature value, and calculating the detail loss value according to the predicted detail classification result and the detail feature value, includes:

[0022] Calling the detail loss guiding unit to perform dimensionality reduction processing on the detail feature value to obtain a reduced-dimensionality detail feature value, and obtaining the predicted detail classification result according to the reduced-dimensionality detail feature value;

[0023] According to the predicted detail classification result and the detail feature value, a cross entropy loss value and a similarity coefficient difference loss value corresponding to the detail feature guidance layer are calculated;

[0024] The detail loss value is determined according to the sum of the cross entropy loss value and the similarity coefficient difference loss value.

[0025] Optionally, after determining the detail loss value corresponding to the detail feature guiding layer according to the detail feature value, the method further includes:

[0026] When the detail loss value is not within the first preset range, the model parameters of the image recognition model are adjusted, and the step of calling the detail feature guiding layer to process the image according to the image true value to obtain the detail feature value corresponding to the image is executed.

[0027] According to a second aspect of an embodiment of the present disclosure, there is provided an image recognition model training device, comprising:

[0028] A sample data input module, used to input sample data into a pre-trained image recognition model; wherein the sample data includes an image, an image truth value corresponding to the image, and an initial classification result corresponding to the image; the image recognition model includes a deep feature processing layer and a detail feature guidance layer, wherein the detail feature guidance layer is only applied in the training phase of the image recognition model;

[0029] A deep feature acquisition module, used for calling the deep feature processing layer to process the image to obtain deep feature information corresponding to the image;

[0030] a detail loss determination module, configured to call the detail feature guiding layer to process the image according to the true value of the image, obtain a detail feature value corresponding to the image, and determine a detail loss value corresponding to the detail feature guiding layer according to the detail feature value;

[0031] A prediction classification result acquisition module, configured to fuse the deep feature information and the detail feature value to obtain a prediction classification result corresponding to the image when the detail loss value is within a first preset range;

[0032] A loss value calculation module, used to calculate the loss value of the image recognition model according to the initial classification result and the predicted classification result;

[0033] The target recognition model acquisition module is used to use the trained image recognition model as the target image recognition model when the loss value is within a second preset range.

[0034] Optionally, the detail feature guiding layer comprises: a detail truth value generating unit and a detail loss guiding unit,

[0035] The detail loss determination module comprises:

[0036] a detail feature determination submodule, configured to call the detail true value generation unit to process the image, obtain image edge information corresponding to the image, and determine a detail feature value corresponding to the image according to the image edge information and the image true value;

[0037] The detail loss calculation submodule is used to call the detail loss guidance unit to perform dimensionality reduction processing on the detail feature value to obtain the predicted detail classification result corresponding to the detail feature value, and calculate the detail loss value based on the predicted detail classification result and the detail feature value.

[0038] Optionally, the detail truth value generating unit includes: a detail capturing subunit and a weight fusion subunit,

[0039] The detail feature determination submodule includes:

[0040] A detail feature value determination submodule, configured to call the detail capture subunit to capture edge information of the image using a plurality of preset step sizes, obtain edge information of the image at a plurality of scales, and determine an initial detail feature value according to the edge information and the true value of the image;

[0041] A fused feature value acquisition submodule is used to call the weight fusion subunit to sample the initial detail feature value using multiple preset sampling magnifications, and fuse the sampled detail feature values ​​to obtain fused detail feature values;

[0042] The detail feature value acquisition submodule is used to filter out fused detail feature values ​​greater than a set threshold from the fused detail feature values ​​to serve as the detail feature values ​​corresponding to the image.

[0043] Optionally, the detail loss calculation submodule includes:

[0044] A predicted detail classification result acquisition submodule is used to call the detail loss guiding unit to perform dimensionality reduction processing on the detail feature value to obtain a reduced-dimensionality detail feature value, and obtain the predicted detail classification result according to the reduced-dimensionality detail feature value;

[0045] A loss value calculation submodule, used to calculate the cross entropy loss value and the similarity coefficient difference loss value corresponding to the detail feature guidance layer according to the predicted detail classification result and the detail feature value;

[0046] The detail loss determination submodule is used to determine the detail loss value according to the sum of the cross entropy loss value and the similarity coefficient difference loss value.

[0047] Optionally, the device further comprises:

[0048] A model parameter adjustment module is used to adjust the model parameters of the image recognition model and execute the detail loss determination module when the detail loss value is not within a first preset range.

[0049] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:

[0050] A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements any of the above-described image recognition model training methods when executing the program.

[0051] According to a fourth aspect of an embodiment of the present disclosure, a readable storage medium is provided. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute any of the above-described image recognition model training methods.

[0052] The embodiments of the present disclosure provide an image recognition model training method and device, which inputs sample data into a pre-trained image recognition model, wherein the sample data includes an image, an image true value corresponding to the image, and an initial classification result corresponding to the image; the image recognition model includes a deep feature processing layer and a detail feature guidance layer, and the detail feature guidance layer is only used in the training stage of the image recognition model, the deep feature processing layer is called to process the image to obtain deep feature information corresponding to the image, the detail feature guidance layer is called to process the image according to the image true value to obtain a detail feature value corresponding to the image, and the detail loss value corresponding to the detail feature guidance layer is determined according to the detail feature value. When the detail loss value is within a first preset range, the deep feature information and the detail feature value are fused to obtain a predicted classification result corresponding to the image, and the loss value of the image recognition model is calculated according to the initial classification result and the predicted classification result. When the loss value is within a second preset range, the trained image recognition model is used as the target image recognition model. The embodiments of the present disclosure introduce a detail feature guidance layer, obtain the true value of image detail information based on the true value of image semantic segmentation, and then guide the shallow features of the network based on the true value of the image detail information, so that the network can more fully encode spatial information. In addition, the detail feature guidance layer is a plug-and-play network layer that is only used in the training stage and has no effect in the reasoning stage. Therefore, while improving the semantic segmentation performance, it will not introduce additional computing consumption and will not affect the reasoning speed of the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings required for use in the description of the embodiments of the present disclosure will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0054] Figure 1 A flowchart of a method for training an image recognition model according to an embodiment of the present disclosure;

[0055] Figure 2 A flowchart of another method for training an image recognition model according to an embodiment of the present disclosure;

[0056] Figure 3 A schematic diagram of the structure of an image recognition model training device provided in an embodiment of the present disclosure;

[0057] Figure 4 A schematic diagram of the structure of another image recognition model training device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0058] The following will be combined with the drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the embodiments in the embodiments of the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the embodiments of the present disclosure.

[0059] Embodiment 1

[0060] Reference Figure 1 , which shows a flowchart of the steps of an image recognition model training method provided by an embodiment of the present disclosure, such as Figure 1 As shown, the image recognition model training method may specifically include the following steps:

[0061] Step 101: Input sample data into a pre-trained image recognition model.

[0062] The embodiments of the present disclosure can be applied to the scenario of training an image recognition model.

[0063] In this embodiment, the image recognition model may include: a deep feature processing layer and a detail feature guidance layer, wherein the detail feature guidance layer is only applied to the training stage of the image recognition model.

[0064] Sample data refers to data used to train an image recognition model. In this example, the sample data may include an image, an image truth value corresponding to the image, and an initial classification result corresponding to the image.

[0065] When the image recognition model needs to be trained, an image can be obtained as a training sample, the image true value of the image can be obtained, and the business personnel can assign an initial classification result to each pixel in the image, with the image, the image true value corresponding to the image, and the initial classification result corresponding to the image as sample data.

[0066] After the sample data is acquired, the sample data may be input into the image recognition model to be trained.

[0067] After the sample data is input into the image recognition model to be trained, step 102 and step 103 are performed.

[0068] Step 102: calling the deep feature processing layer to process the image to obtain deep feature information corresponding to the image.

[0069] The deep feature information refers to feature information of pixels in an image obtained by recognizing the image. In this example, the deep feature information may be Context info of the image, that is, context information.

[0070] After the sample data is input into the image recognition model to be trained, the deep feature processing layer in the image recognition model can be called to process the image to obtain the deep feature information of the image.

[0071] It can be understood that the specific network structure of the deep feature processing layer can adopt the network structure commonly used in the prior art, and the embodiments of the present disclosure do not limit the specific structure of the network layer.

[0072] Step 103: calling the detail feature guiding layer to process the image according to the true value of the image to obtain a detail feature value corresponding to the image, and determining a detail loss value corresponding to the detail feature guiding layer according to the detail feature value.

[0073] The detail feature guidance layer refers to a network layer added to the image recognition model for identifying detail features of an image (such as image boundaries and corner features, etc.). In this embodiment, the detail feature guidance layer may include a detail truth value generation unit and a detail loss guidance unit, wherein the detail truth value generation unit may capture detail feature information in an image, and the detail loss guidance unit may calculate a detail loss value and guide the detail feature information based on the detail loss value.

[0074] After the sample data is input into the image recognition model to be trained, the detail feature guidance layer can be called to process the image according to the image true value corresponding to the image to obtain the detail feature value corresponding to the image, and the detail loss value corresponding to the detail feature guidance layer is calculated according to the detail feature value. This process will be described in detail in the following embodiment 2, and the embodiments of the present disclosure will not be described in detail here.

[0075] After calling the detail feature guiding layer to process the image according to the true value of the image to obtain the detail feature value corresponding to the image, and determining the detail loss value corresponding to the detail feature guiding layer according to the detail feature value, step 104 is executed.

[0076] Step 104: When the detail loss value is within a first preset range, the deep feature information and the detail feature value are fused to obtain a predicted classification result corresponding to the image.

[0077] The first preset range refers to a numerical range pre-set by business personnel for determining whether the detail loss value meets business requirements. The specific numerical range of the first preset range can be determined according to business requirements, and this embodiment does not impose any restrictions on this.

[0078] The predicted classification result refers to the classification result of each pixel obtained by predicting each pixel in the image.

[0079] After the detail loss value is obtained, it can be determined whether the detail loss value is within a first preset range.

[0080] If the detail loss value is not within the first preset range, at this time, the model parameters of the image recognition model can be adjusted to process the input sample data again until the detail loss value is within the first preset range.

[0081] If the detail loss value is within the first preset range, the deep feature information and the detail feature value may be fused to obtain a prediction classification result corresponding to the image.

[0082] After the deep feature information and the detail feature values ​​are fused to obtain the prediction classification result corresponding to the image, step 105 is executed.

[0083] Step 105: Calculate the loss value of the image recognition model based on the initial classification result and the predicted classification result.

[0084] After obtaining the predicted classification result corresponding to the image, the loss value corresponding to the image recognition model can be calculated based on the initial classification result and the predicted classification result corresponding to the image.

[0085] After the loss value corresponding to the image recognition model is calculated, step 106 is executed.

[0086] Step 106: When the loss value is within a second preset range, the trained image recognition model is used as a target image recognition model.

[0087] The second preset range refers to a numerical range pre-set by business personnel for determining whether the training degree of the image recognition model meets business requirements. The specific numerical range of the second preset range can be determined according to business requirements, and this embodiment does not impose any restrictions on this.

[0088] After calculating the loss value corresponding to the image recognition model, it can be determined whether the loss value is within a second preset range.

[0089] If the loss value is within the second preset range, it means that the trained image recognition model can meet the business needs. At this time, the trained image recognition model can be used as the target image recognition model, which can be used in subsequent image semantic segmentation scenarios.

[0090] If the loss value is not within the second preset range, it means that the trained image recognition model cannot meet the business needs. At this time, the parameters of the image recognition model can be adjusted, and the image recognition model can continue to be trained in combination with the sample data until the loss value of the image recognition model is within the second preset range.

[0091] The embodiments of the present disclosure introduce a detail feature guidance layer, obtain the true value of image detail information based on the true value of image semantic segmentation, and then guide the shallow features of the network based on the true value of the image detail information, so that the network can more fully encode spatial information. In addition, the detail feature guidance layer is a plug-and-play network layer that is only used in the training stage and has no effect in the reasoning stage. Therefore, while improving the semantic segmentation performance, it will not introduce additional computing consumption and will not affect the reasoning speed of the model.

[0092] The image recognition model training method provided by the embodiments of the present disclosure is implemented by inputting sample data into a pre-trained image recognition model, wherein the sample data includes an image, an image true value corresponding to the image, and an initial classification result corresponding to the image; the image recognition model includes a deep feature processing layer and a detail feature guidance layer, and the detail feature guidance layer is only used in the training stage of the image recognition model; the deep feature processing layer is called to process the image to obtain deep feature information corresponding to the image; the detail feature guidance layer is called to process the image according to the image true value to obtain a detail feature value corresponding to the image; and a detail loss value corresponding to the detail feature guidance layer is determined according to the detail feature value; when the detail loss value is within a first preset range, the deep feature information and the detail feature value are fused to obtain a predicted classification result corresponding to the image; the loss value of the image recognition model is calculated according to the initial classification result and the predicted classification result; when the loss value is within a second preset range, the trained image recognition model is used as the target image recognition model. The embodiments of the present disclosure introduce a detail feature guidance layer, obtain the true value of image detail information based on the true value of image semantic segmentation, and then guide the shallow features of the network based on the true value of the image detail information, so that the network can more fully encode spatial information. In addition, the detail feature guidance layer is a plug-and-play network layer that is only used in the training stage and has no effect in the reasoning stage. Therefore, while improving the semantic segmentation performance, it will not introduce additional computing consumption and will not affect the reasoning speed of the model.

[0093] Embodiment 2

[0094] Reference Figure 2 , shows a flowchart of the steps of another image recognition model training method provided by an embodiment of the present disclosure, such as Figure 2 As shown, the image recognition model training method may specifically include the following steps:

[0095] Step 201: Input sample data into a pre-trained image recognition model.

[0096] The embodiments of the present disclosure can be applied to the scenario of training an image recognition model.

[0097] In this embodiment, the image recognition model may include: a deep feature processing layer and a detail feature guidance layer, wherein the detail feature guidance layer is only applied to the training stage of the image recognition model.

[0098] Sample data refers to data used to train an image recognition model. In this example, the sample data may include an image, an image truth value corresponding to the image, and an initial classification result corresponding to the image.

[0099] When the image recognition model needs to be trained, an image can be obtained as a training sample, the image true value of the image can be obtained, and the business personnel can assign an initial classification result to each pixel in the image, with the image, the image true value corresponding to the image, and the initial classification result corresponding to the image as sample data.

[0100] After the sample data is acquired, the sample data may be input into the image recognition model to be trained.

[0101] After the sample data is input into the image recognition model to be trained, step 202 and step 203 are performed.

[0102] Step 202: calling the deep feature processing layer to process the image to obtain deep feature information corresponding to the image.

[0103] The deep feature information refers to feature information of pixels in an image obtained by recognizing the image. In this example, the deep feature information may be Context info of the image, that is, context information.

[0104] After the sample data is input into the image recognition model to be trained, the deep feature processing layer in the image recognition model can be called to process the image to obtain the deep feature information of the image.

[0105] It can be understood that the specific network structure of the deep feature processing layer can adopt the network structure commonly used in the prior art, and the embodiments of the present disclosure do not limit the specific structure of the network layer.

[0106] Step 203: calling the detail true value generation unit to process the image to obtain image edge information corresponding to the image, and determining the detail feature value corresponding to the image according to the image edge information and the image true value.

[0107] In this embodiment, the detail feature guiding layer may include a detail true value generating unit and a detail loss guiding unit.

[0108] After the sample data is input into the image recognition model, the detail truth value generation unit can be called to process the image to obtain the image edge information corresponding to the image, and determine the detail feature value corresponding to the image based on the image edge information and the image truth value. Specifically, it can be described in detail in combination with the following specific implementation method.

[0109] In a specific implementation of the present disclosure, the detail truth value generating unit includes: a detail capturing subunit and a weight fusion subunit, and the above step 203 may include:

[0110] Sub-step S1: calling the detail capture sub-unit to capture edge information of the image using multiple preset step sizes to obtain edge information of the image at multiple scales, and determining an initial detail feature value based on the edge information and the true value of the image.

[0111] In this embodiment, the detail truth value generating unit may include: a detail capturing subunit and a weight fusion subunit.

[0112] After the image is input into the image recognition model, the detail capture subunit can be called to capture the edge information of the image using multiple preset step sizes to obtain the edge information of the image at multiple scales. For example, the Laplacian operator can be used as the convolution kernel to implement this process through convolution operations. For the true value of the image, Laplacian convolutions with different step sizes are used for processing to capture the edge information of the image at multiple scales. The step sizes that can be set here are 1, 2, and 4, respectively, and the original image, two times, and four times downsampling are used to obtain the spatial information of the image (i.e., edge information).

[0113] After capturing edge information of the image at multiple scales, the initial detail feature value may be determined according to the edge information and the true value of the image. Specifically, the edge information and the true value of the image may be subjected to matrix calculation to obtain the initial detail feature value.

[0114] After the initial detail feature value is determined based on the edge information and the true value of the image, sub-step S2 is executed.

[0115] Sub-step S2: calling the weight fusion sub-unit to sample the initial detail feature values ​​using a plurality of preset sampling magnifications, and fusing the sampled detail feature values ​​to obtain fused detail feature values.

[0116] After obtaining the initial detail feature value, the weight fusion subunit can be called to sample the initial detail feature value using multiple preset sampling ratios, and the sampled detail feature values ​​can be fused to obtain the fused detail feature value. Specifically, for the obtained multi-scale boundary information, we first upsample to the same size, without processing the original image, and upsample the two-fold and four-fold downsampled parts to the original image size, respectively, and then use 1x1 trainable convolution for fusion to obtain the fused detail feature value.

[0117] After the fused detail feature value is obtained, sub-step S3 is executed.

[0118] Sub-step S3: Filtering out fused detail feature values ​​greater than a set threshold from the fused detail feature values ​​to serve as detail feature values ​​corresponding to the image.

[0119] The set threshold refers to a threshold pre-set by a business person for determining whether a feature value is a detail feature. The specific value of the set threshold can be determined according to business requirements, and this embodiment does not impose any limitation on this.

[0120] After obtaining the fused detail feature values, the fused detail feature values ​​greater than the set threshold can be screened out from the fused detail feature values ​​as the detail feature values ​​corresponding to the image. For example, for the fused result, a threshold of 0.1 is used for card control. Values ​​greater than the threshold are detail information (i.e., detail feature values), and values ​​less than the threshold are other information.

[0121] After the detail feature value is obtained, step 204 is executed.

[0122] Step 204: calling the detail loss guiding unit to perform dimensionality reduction processing on the detail feature value to obtain a predicted detail classification result corresponding to the detail feature value, and calculating the detail loss value according to the predicted detail classification result and the detail feature value.

[0123] After obtaining the detail feature value corresponding to the image, the detail loss guidance unit can be called to perform dimensionality reduction processing on the detail feature value to obtain the predicted detail classification result corresponding to the detail feature value, and calculate the detail loss value based on the predicted detail classification result and the detail feature value.

[0124] In this embodiment, the detail loss value may include: a cross entropy loss value (BCE loss) and a similarity coefficient difference loss value (Dice loss). The above process may be described in detail in combination with the following specific implementation method.

[0125] In a specific implementation of the present disclosure, the above step 204 may include:

[0126] Sub-step M1: calling the detail loss guiding unit to perform dimensionality reduction processing on the detail feature value to obtain the reduced-dimensionality detail feature value, and obtaining the predicted detail classification result according to the reduced-dimensionality detail feature value.

[0127] In an embodiment of the present disclosure, after obtaining the detail feature value of the image, the detail loss guidance unit can be called to perform dimensionality reduction processing on the detail feature value to obtain the reduced dimensionality detail feature value, and then the predicted detail classification result can be obtained based on the reduced dimensionality detail feature value. Specifically, in this example, a detail head can be used to predict the detail feature, and then the loss function is calculated together with the detail true value (i.e., the detail feature value). First, a 3x3 convolution-batch normalization-non-linear unit is used to reduce the dimensionality of the shallow features, and then a 1x1 convolution is used to further reduce the dimensionality to the specified dimension to generate detail prediction features, i.e., the predicted detail classification result.

[0128] After obtaining the predicted detail classification result, execute sub-step M2.

[0129] Sub-step M2: According to the predicted detail classification result and the detail feature value, the cross entropy loss value and the similarity coefficient difference loss value corresponding to the detail feature guidance layer are calculated.

[0130] After obtaining the predicted detail classification results, the cross entropy loss value and similarity coefficient difference loss value corresponding to the detail feature guidance layer can be calculated based on the predicted detail classification results and the detail feature values. Specifically, the detail guidance layer can be regarded as a binary segmentation problem. Since the number of pixels representing details in the detail truth value is far less than the number of pixels representing non-details, this is a binary classification problem with unbalanced samples. When encountering this problem, a conventional approach is to use a weighted softmax loss function to train binary segmentation. However, doing so often causes the detail margin prediction to be too coarse, affecting the representation of the details. Therefore, the BCE loss function and the Dice loss function can be used for joint training. The Dice loss function is used to measure the calculated prediction results: semantic truth value; the intersection of the predicted result of the image information and the detail truth value, so it is not sensitive to the problem of imbalanced positive and negative samples. For the predicted detail feature map, the detail loss function L detail As shown in the following formula (1):

[0131] L detail (p d ,g d )=L dice (p d ,g d )+L bce (p d ,g d ) (1)

[0132] In the above formula (1), p d is the predicted detail feature map, g d is the corresponding detail eigenvalue, L bce (p d ,g d ) is the cross entropy loss value, and is the similarity coefficient difference loss value.

[0133] Among them, L dice (p d ,g d ) can be expressed as the following formula (2):

[0134]

[0135] In the above formula (2), i refers to the i-th pixel, ε is a Plasma smoothing term, and in order to avoid division by zero, ε can be set to 1.

[0136] Sub-step M3: Determine the detail loss value according to the sum of the cross entropy loss value and the similarity coefficient difference loss value.

[0137] After obtaining the cross entropy loss value and the similarity coefficient difference loss value, the sum of the two loss values ​​can be calculated and used as the detail loss value.

[0138] Step 205: When the detail loss value is within a first preset range, the deep feature information and the detail feature value are fused to obtain a predicted classification result corresponding to the image.

[0139] The first preset range refers to a numerical range pre-set by business personnel for determining whether the detail loss value meets business requirements. The specific numerical range of the first preset range can be determined according to business requirements, and this embodiment does not impose any restrictions on this.

[0140] The predicted classification result refers to the classification result of each pixel obtained by predicting each pixel in the image.

[0141] After the detail loss value is obtained, it can be determined whether the detail loss value is within a first preset range.

[0142] If the detail loss value is not within the first preset range, at this time, the model parameters of the image recognition model can be adjusted to process the input sample data again until the detail loss value is within the first preset range.

[0143] If the detail loss value is within the first preset range, the deep feature information and the detail feature value may be fused to obtain a prediction classification result corresponding to the image.

[0144] After the deep feature information and the detail feature values ​​are fused to obtain the prediction classification result corresponding to the image, step 206 is executed.

[0145] Step 206: Calculate the loss value of the image recognition model based on the initial classification result and the predicted classification result.

[0146] After obtaining the predicted classification result corresponding to the image, the loss value corresponding to the image recognition model can be calculated based on the initial classification result and the predicted classification result corresponding to the image.

[0147] After the loss value corresponding to the image recognition model is calculated, step 207 is executed.

[0148] Step 207: When the loss value is within a second preset range, the trained image recognition model is used as a target image recognition model.

[0149] The second preset range refers to a numerical range pre-set by business personnel for determining whether the training degree of the image recognition model meets business requirements. The specific numerical range of the second preset range can be determined according to business requirements, and this embodiment does not impose any restrictions on this.

[0150] After calculating the loss value corresponding to the image recognition model, it can be determined whether the loss value is within a second preset range.

[0151] If the loss value is within the second preset range, it means that the trained image recognition model can meet the business needs. At this time, the trained image recognition model can be used as the target image recognition model, which can be used in subsequent image semantic segmentation scenarios.

[0152] If the loss value is not within the second preset range, it means that the trained image recognition model cannot meet the business needs. At this time, the parameters of the image recognition model can be adjusted, and the image recognition model can continue to be trained in combination with the sample data until the loss value of the image recognition model is within the second preset range.

[0153] The embodiments of the present disclosure introduce a detail feature guidance layer, obtain the true value of image detail information based on the true value of image semantic segmentation, and then guide the shallow features of the network based on the true value of the image detail information, so that the network can more fully encode spatial information. In addition, the detail feature guidance layer is a plug-and-play network layer that is only used in the training stage and has no effect in the reasoning stage. Therefore, while improving the semantic segmentation performance, it will not introduce additional computing consumption and will not affect the reasoning speed of the model.

[0154] Step 208: When the detail loss value is not within the first preset range, the model parameters of the image recognition model are adjusted, and the step of calling the detail feature guidance layer to process the image according to the image true value to obtain the detail feature value corresponding to the image is executed.

[0155] When the detail loss value is not within the first preset range, the model parameters of the image recognition model can be adjusted, and the step of calling the detail feature guidance layer to process the image according to the image true value to obtain the detail feature value corresponding to the image is executed until the detail loss value is within the first preset range, thereby realizing the prior guidance of the detail features.

[0156] The image recognition model training method provided by the embodiments of the present disclosure is implemented by inputting sample data into a pre-trained image recognition model, wherein the sample data includes an image, an image true value corresponding to the image, and an initial classification result corresponding to the image; the image recognition model includes a deep feature processing layer and a detail feature guidance layer, and the detail feature guidance layer is only used in the training stage of the image recognition model; the deep feature processing layer is called to process the image to obtain deep feature information corresponding to the image; the detail feature guidance layer is called to process the image according to the image true value to obtain a detail feature value corresponding to the image; and a detail loss value corresponding to the detail feature guidance layer is determined according to the detail feature value; when the detail loss value is within a first preset range, the deep feature information and the detail feature value are fused to obtain a predicted classification result corresponding to the image; the loss value of the image recognition model is calculated according to the initial classification result and the predicted classification result; when the loss value is within a second preset range, the trained image recognition model is used as the target image recognition model. The embodiments of the present disclosure introduce a detail feature guidance layer, obtain the true value of image detail information based on the true value of image semantic segmentation, and then guide the shallow features of the network based on the true value of the image detail information, so that the network can more fully encode spatial information. In addition, the detail feature guidance layer is a plug-and-play network layer that is only used in the training stage and has no effect in the reasoning stage. Therefore, while improving the semantic segmentation performance, it will not introduce additional computing consumption and will not affect the reasoning speed of the model.

[0157] Embodiment 3

[0158] Reference Figure 3 , which shows a schematic diagram of the structure of an image recognition model training device provided by an embodiment of the present disclosure, such as Figure 3 As shown, the image recognition model training device 300 may specifically include the following modules:

[0159] The sample data input module 310 is used to input the sample data into the pre-trained image recognition model; wherein the sample data includes an image, an image truth value corresponding to the image, and an initial classification result corresponding to the image; the image recognition model includes a deep feature processing layer and a detail feature guidance layer, wherein the detail feature guidance layer is only applied in the training phase of the image recognition model;

[0160] A deep feature acquisition module 320 is used to call the deep feature processing layer to process the image to obtain deep feature information corresponding to the image;

[0161] A detail loss determination module 330 is used to call the detail feature guiding layer to process the image according to the true value of the image to obtain a detail feature value corresponding to the image, and determine a detail loss value corresponding to the detail feature guiding layer according to the detail feature value;

[0162] A prediction classification result acquisition module 340 is used to fuse the deep feature information and the detail feature value to obtain a prediction classification result corresponding to the image when the detail loss value is within a first preset range;

[0163] A loss value calculation module 350, used to calculate the loss value of the image recognition model according to the initial classification result and the predicted classification result;

[0164] The target recognition model acquisition module 360 ​​is used to use the trained image recognition model as the target image recognition model when the loss value is within the second preset range.

[0165] The image recognition model training device provided by the embodiment of the present disclosure inputs sample data into a pre-trained image recognition model, wherein the sample data includes an image, an image true value corresponding to the image, and an initial classification result corresponding to the image; the image recognition model includes a deep feature processing layer and a detail feature guidance layer, and the detail feature guidance layer is only used in the training stage of the image recognition model; the deep feature processing layer is called to process the image to obtain deep feature information corresponding to the image; the detail feature guidance layer is called to process the image according to the image true value to obtain a detail feature value corresponding to the image; and a detail loss value corresponding to the detail feature guidance layer is determined according to the detail feature value; when the detail loss value is within a first preset range, the deep feature information and the detail feature value are fused to obtain a predicted classification result corresponding to the image; the loss value of the image recognition model is calculated according to the initial classification result and the predicted classification result; when the loss value is within a second preset range, the trained image recognition model is used as the target image recognition model. The embodiments of the present disclosure introduce a detail feature guidance layer, obtain the true value of image detail information based on the true value of image semantic segmentation, and then guide the shallow features of the network based on the true value of the image detail information, so that the network can more fully encode spatial information. In addition, the detail feature guidance layer is a plug-and-play network layer that is only used in the training stage and has no effect in the reasoning stage. Therefore, while improving the semantic segmentation performance, it will not introduce additional computing consumption and will not affect the reasoning speed of the model.

[0166] Embodiment 4

[0167] Reference Figure 4 , which shows a schematic diagram of the structure of another image recognition model training device provided by an embodiment of the present disclosure, such as Figure 4 As shown, the image recognition model training device 400 may specifically include the following modules:

[0168] The sample data input module 410 is used to input the sample data into the pre-trained image recognition model; wherein the sample data includes an image, an image truth value corresponding to the image, and an initial classification result corresponding to the image; the image recognition model includes a deep feature processing layer and a detail feature guidance layer, wherein the detail feature guidance layer is only applied in the training phase of the image recognition model;

[0169] A deep feature acquisition module 420 is used to call the deep feature processing layer to process the image to obtain deep feature information corresponding to the image;

[0170] A detail loss determination module 430 is used to call the detail feature guidance layer to process the image according to the true value of the image to obtain a detail feature value corresponding to the image, and determine a detail loss value corresponding to the detail feature guidance layer according to the detail feature value;

[0171] A prediction classification result acquisition module 440 is used to fuse the deep feature information and the detail feature value to obtain a prediction classification result corresponding to the image when the detail loss value is within a first preset range;

[0172] A loss value calculation module 450, used to calculate the loss value of the image recognition model according to the initial classification result and the predicted classification result;

[0173] A target recognition model acquisition module 460, configured to use the trained image recognition model as a target image recognition model when the loss value is within a second preset range;

[0174] The model parameter adjustment module 470 is used to adjust the model parameters of the image recognition model and execute the detail loss determination module when the detail loss value is not within the first preset range.

[0175] Optionally, the detail feature guiding layer comprises: a detail truth value generating unit and a detail loss guiding unit,

[0176] The detail loss determination module 430 includes:

[0177] The detail feature determination submodule 431 is used to call the detail true value generation unit to process the image, obtain image edge information corresponding to the image, and determine the detail feature value corresponding to the image according to the image edge information and the image true value;

[0178] The detail loss calculation submodule 432 is used to call the detail loss guiding unit to perform dimensionality reduction processing on the detail feature value to obtain the predicted detail classification result corresponding to the detail feature value, and calculate the detail loss value based on the predicted detail classification result and the detail feature value.

[0179] Optionally, the detail truth value generating unit includes: a detail capturing subunit and a weight fusion subunit,

[0180] The detail feature determination submodule 431 includes:

[0181] A detail feature value determination submodule, configured to call the detail capture subunit to capture edge information of the image using a plurality of preset step sizes, obtain edge information of the image at a plurality of scales, and determine an initial detail feature value according to the edge information and the true value of the image;

[0182] A fused feature value acquisition submodule is used to call the weight fusion subunit to sample the initial detail feature value using multiple preset sampling magnifications, and fuse the sampled detail feature values ​​to obtain fused detail feature values;

[0183] The detail feature value acquisition submodule is used to filter out fused detail feature values ​​greater than a set threshold from the fused detail feature values ​​to serve as the detail feature values ​​corresponding to the image.

[0184] Optionally, the detail loss calculation submodule 432 includes:

[0185] A predicted detail classification result acquisition submodule is used to call the detail loss guiding unit to perform dimensionality reduction processing on the detail feature value to obtain a reduced-dimensionality detail feature value, and obtain the predicted detail classification result according to the reduced-dimensionality detail feature value;

[0186] A loss value calculation submodule, used to calculate the cross entropy loss value and the similarity coefficient difference loss value corresponding to the detail feature guidance layer according to the predicted detail classification result and the detail feature value;

[0187] The detail loss determination submodule is used to determine the detail loss value according to the sum of the cross entropy loss value and the similarity coefficient difference loss value.

[0188] The image recognition model training device provided by the embodiment of the present disclosure inputs sample data into a pre-trained image recognition model, wherein the sample data includes an image, an image true value corresponding to the image, and an initial classification result corresponding to the image; the image recognition model includes a deep feature processing layer and a detail feature guidance layer, and the detail feature guidance layer is only used in the training stage of the image recognition model; the deep feature processing layer is called to process the image to obtain deep feature information corresponding to the image; the detail feature guidance layer is called to process the image according to the image true value to obtain a detail feature value corresponding to the image; and a detail loss value corresponding to the detail feature guidance layer is determined according to the detail feature value; when the detail loss value is within a first preset range, the deep feature information and the detail feature value are fused to obtain a predicted classification result corresponding to the image; the loss value of the image recognition model is calculated according to the initial classification result and the predicted classification result; when the loss value is within a second preset range, the trained image recognition model is used as the target image recognition model. The embodiments of the present disclosure introduce a detail feature guidance layer, obtain the true value of image detail information based on the true value of image semantic segmentation, and then guide the shallow features of the network based on the true value of the image detail information, so that the network can more fully encode spatial information. In addition, the detail feature guidance layer is a plug-and-play network layer that is only used in the training stage and has no effect in the reasoning stage. Therefore, while improving the semantic segmentation performance, it will not introduce additional computing consumption and will not affect the reasoning speed of the model.

[0189] An embodiment of the present disclosure also provides an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the image recognition model training method of the aforementioned embodiment when executing the program.

[0190] An embodiment of the present disclosure also provides a readable storage medium, which, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to execute the image recognition model training method of the aforementioned embodiment.

[0191] As for the device 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.

[0192] The algorithms and displays provided herein are not inherently related to any particular computer, virtual system or other device. Various general purpose systems may also be used together with the teachings based thereon. According to the above description, it is apparent that the structure required for constructing such systems is. In addition, the embodiments of the present disclosure are not directed to any particular programming language either. It should be understood that the contents of the embodiments of the present disclosure described herein may be realized using various programming languages, and the description of the specific languages ​​above is intended to disclose the best mode of implementation of the embodiments of the present disclosure.

[0193] In the description provided herein, a large number of specific details are described. However, it is understood that the embodiments of the present disclosure can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.

[0194] Similarly, it should be understood that in order to streamline the present disclosure and aid in understanding one or more of the various inventive aspects, in the above description of the exemplary embodiments of the present disclosure, the various features of the embodiments of the present disclosure are sometimes grouped together into a single embodiment, figure, or description thereof. However, the disclosed method should not be interpreted as reflecting the following intention: the claimed embodiments of the present disclosure require more features than the features explicitly recited in each claim. More specifically, as reflected in the claims below, the inventive aspects lie in less than all the features of the single embodiment disclosed above. Therefore, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, with each claim itself serving as a separate embodiment of the embodiments of the present disclosure.

[0195] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.

[0196] The various component embodiments of the embodiments of the present disclosure may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or a digital signal processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components of the dynamic picture generation device according to the embodiments of the present disclosure. The embodiments of the present disclosure may also be implemented as a device or apparatus program for executing part or all of the methods described herein. Such a program implementing an embodiment of the present disclosure may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.

[0197] It should be noted that the above embodiments illustrate rather than limit the embodiments of the present disclosure, and that those skilled in the art may design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets should not be constructed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of multiple such elements. The embodiments of the present disclosure may be implemented by means of hardware including several different elements and by means of appropriately programmed computers. In a unit claim that lists several devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order. These words may be interpreted as names.

[0198] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0199] The above description is only a preferred embodiment of the embodiments of the present disclosure and is not intended to limit the embodiments of the present disclosure. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the embodiments of the present disclosure should be included in the protection scope of the embodiments of the present disclosure.

[0200] The above is only a specific implementation of the embodiment of the present disclosure, but the protection scope of the embodiment of the present disclosure is not limited thereto. Any technician familiar with the technical field can easily think of changes or replacements within the technical scope disclosed by the embodiment of the present disclosure, which should be included in the protection scope of the embodiment of the present disclosure. Therefore, the protection scope of the embodiment of the present disclosure should be based on the protection scope of the claims.

Claims

1. A method for training an image recognition model, characterized in that: include: Inputting sample data into a pre-trained image recognition model; wherein the sample data includes an image, an image truth value corresponding to the image, and an initial classification result corresponding to the image, and the image recognition model includes a deep feature processing layer and a detail feature guidance layer, wherein the detail feature guidance layer is only applied in the training phase of the image recognition model; Calling the deep feature processing layer to process the image to obtain deep feature information corresponding to the image; Calling the detail feature guiding layer to process the image according to the true value of the image to obtain a detail feature value corresponding to the image, and determining a detail loss value corresponding to the detail feature guiding layer according to the detail feature value; When the detail loss value is within a first preset range, fusing the deep feature information with the detail feature value to obtain a prediction classification result corresponding to the image; Calculating a loss value of the image recognition model according to the initial classification result and the predicted classification result; When the loss value is within the second preset range, the trained image recognition model is used as the target image recognition model.

2. The method according to claim 1, characterized in that The detail feature guiding layer includes: a detail true value generating unit and a detail loss guiding unit, The calling of the detail feature guiding layer to process the image according to the true value of the image to obtain a detail feature value corresponding to the image, and determining a detail loss value corresponding to the detail feature guiding layer according to the detail feature value, includes: Calling the detail true value generating unit to process the image to obtain image edge information corresponding to the image, and determining the detail feature value corresponding to the image according to the image edge information and the image true value; The detail loss guiding unit is called to perform dimensionality reduction processing on the detail feature value to obtain a predicted detail classification result corresponding to the detail feature value, and the detail loss value is calculated based on the predicted detail classification result and the detail feature value.

3. The method according to claim 2, characterized in that The detail truth value generation unit includes: a detail capture subunit and a weight fusion subunit, The calling of the detail true value generating unit to process the image to obtain image edge information corresponding to the image, and determining the detail feature value corresponding to the image according to the image edge information and the image true value, includes: Calling the detail capture subunit to capture edge information of the image using multiple preset step sizes to obtain edge information of the image at multiple scales, and determining an initial detail feature value according to the edge information and the true value of the image; Calling the weight fusion subunit to sample the initial detail feature values ​​using a plurality of preset sampling magnifications, and fusing the sampled detail feature values ​​to obtain fused detail feature values; The fused detail feature values ​​that are greater than a set threshold are screened out from the fused detail feature values ​​to serve as detail feature values ​​corresponding to the image.

4. The method according to claim 2, characterized in that: The calling of the detail loss guiding unit to perform dimensionality reduction processing on the detail feature value to obtain a predicted detail classification result corresponding to the detail feature value, and calculating the detail loss value according to the predicted detail classification result and the detail feature value, includes: Calling the detail loss guiding unit to perform dimensionality reduction processing on the detail feature value to obtain a reduced-dimensionality detail feature value, and obtaining the predicted detail classification result according to the reduced-dimensionality detail feature value; According to the predicted detail classification result and the detail feature value, a cross entropy loss value and a similarity coefficient difference loss value corresponding to the detail feature guidance layer are calculated; The detail loss value is determined according to the sum of the cross entropy loss value and the similarity coefficient difference loss value.

5. The method according to claim 1, characterized in that After determining the detail loss value corresponding to the detail feature guiding layer according to the detail feature value, the method further includes: When the detail loss value is not within the first preset range, the model parameters of the image recognition model are adjusted, and the step of calling the detail feature guiding layer to process the image according to the image true value to obtain the detail feature value corresponding to the image is executed.

6. An image recognition model training device, characterized in that: include: A sample data input module, used to input sample data into a pre-trained image recognition model; wherein the sample data includes an image, an image truth value corresponding to the image, and an initial classification result corresponding to the image; the image recognition model includes a deep feature processing layer and a detail feature guidance layer, wherein the detail feature guidance layer is only applied in the training phase of the image recognition model; A deep feature acquisition module, used for calling the deep feature processing layer to process the image to obtain deep feature information corresponding to the image; a detail loss determination module, configured to call the detail feature guiding layer to process the image according to the true value of the image, obtain a detail feature value corresponding to the image, and determine a detail loss value corresponding to the detail feature guiding layer according to the detail feature value; A prediction classification result acquisition module, configured to fuse the deep feature information and the detail feature value to obtain a prediction classification result corresponding to the image when the detail loss value is within a first preset range; A loss value calculation module, used to calculate the loss value of the image recognition model according to the initial classification result and the predicted classification result; The target recognition model acquisition module is used to use the trained image recognition model as the target image recognition model when the loss value is within a second preset range.

7. The device according to claim 6, characterized in that The detail feature guiding layer includes: a detail true value generating unit and a detail loss guiding unit, The detail loss determination module comprises: a detail feature determination submodule, configured to call the detail true value generation unit to process the image, obtain image edge information corresponding to the image, and determine a detail feature value corresponding to the image according to the image edge information and the image true value; The detail loss calculation submodule is used to call the detail loss guidance unit to perform dimensionality reduction processing on the detail feature value to obtain the predicted detail classification result corresponding to the detail feature value, and calculate the detail loss value based on the predicted detail classification result and the detail feature value.

8. The device according to claim 7, characterized in that The detail truth value generation unit includes: a detail capture subunit and a weight fusion subunit, The detail feature determination submodule includes: A detail feature value determination submodule, configured to call the detail capture subunit to capture edge information of the image using a plurality of preset step sizes, obtain edge information of the image at a plurality of scales, and determine an initial detail feature value according to the edge information and the true value of the image; A fused feature value acquisition submodule is used to call the weight fusion subunit to sample the initial detail feature value using multiple preset sampling magnifications, and fuse the sampled detail feature values ​​to obtain fused detail feature values; The detail feature value acquisition submodule is used to filter out fused detail feature values ​​greater than a set threshold from the fused detail feature values ​​to serve as the detail feature values ​​corresponding to the image.

9. The device according to claim 7, characterized in that The detail loss calculation submodule includes: A predicted detail classification result acquisition submodule is used to call the detail loss guiding unit to perform dimensionality reduction processing on the detail feature value to obtain a reduced-dimensionality detail feature value, and obtain the predicted detail classification result according to the reduced-dimensionality detail feature value; A loss value calculation submodule, used to calculate the cross entropy loss value and the similarity coefficient difference loss value corresponding to the detail feature guidance layer according to the predicted detail classification result and the detail feature value; The detail loss determination submodule is used to determine the detail loss value according to the sum of the cross entropy loss value and the similarity coefficient difference loss value.

10. The device according to claim 6, characterized in that The device also includes: A model parameter adjustment module is used to adjust the model parameters of the image recognition model and execute the detail loss determination module when the detail loss value is not within a first preset range.

11. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the image recognition model training method according to any one of claims 1 to 5 when executing the program.

12. A readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the image recognition model training method described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Image recognition model training method and device and electronic equipment

    CN111368788A

  • Semantic image segmentation method and system based on edge enhancement

    CN111462126A