Image processing method, device and computer equipment based on deep learning

By introducing the fairness loss term into the loss function of the multi-layer convolutional neural network, the problem of data bias and insufficient model fairness in image processing is solved, the accuracy and fairness of image classification are improved, and the model is guaranteed to be accurate in different categories. fair performance.

CN118429780BActive Publication Date: 2024-09-27SHENZHEN HUAFANG INFORMATION IND CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202410879013.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-02
Publication Date
2024-09-27
Estimated Expiration
2044-07-02

AI Technical Summary

Technical Problem

Existing technologies have problems with data bias and insufficient model fairness in image processing, resulting in inaccurate and unfair classification.

Method used

The fairness loss term is introduced into the loss function of the multi-layer convolutional neural network, and the fairness and accuracy of the model between different image categories are optimized by comparing the loss function and the mean difference loss function.

Benefits of technology

It significantly improves the classification performance of the image processing model on images of different groups, enhances the fairness and reliability of the model, and ensures the consistency and fairness of the image classification results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118429780B
    Figure CN118429780B
Patent Text Reader

Abstract

The present invention relates to an image processing method, device, computer equipment and storage medium based on deep learning, which solves the problems of inaccurate and unfair classification caused by data bias and insufficient model fairness. First, diverse and comprehensive target image data are obtained to provide rich training and test samples for the model. Then, the data is input into a model containing a multi-layer convolutional neural network structure, and the loss function of the model introduces a fairness loss term to ensure the consistency and fairness of the results. In this way, the model not only focuses on overall accuracy, but also especially optimizes fairness among different groups. Finally, the image processing result data output by the improved model is obtained to improve the reliability and fairness of the model in practical applications. In short, by introducing the fairness loss term, the problem of unfair classification caused by the bias in the training data can be effectively alleviated, and the fairness and reliability of the performance and application of the model in various image processing tasks can be significantly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular to an image processing method, apparatus, computer equipment and storage medium based on deep learning. Background Art

[0002] In the field of image processing, the widespread application of deep learning technology enables us to achieve efficient and accurate image classification, object detection, and image segmentation. However, existing technologies still face challenges in handling these tasks, especially in terms of data bias and model fairness.

[0003] Take image classification as an example: existing image classification models, such as AlexNet, VGG, ResNet, etc., rely on a large amount of labeled data to learn and extract image features. However, if there is a bias in the training data, for example, the number of images of some groups is significantly less than that of other groups, the classification performance of the model on these minority groups may be poor, resulting in unfair classification. This bias will affect the reliability and fairness of the model in practical applications.

[0004] Although existing deep learning-based image processing techniques have made significant progress, data bias remains a key challenge. Although image resampling and image enhancement can alleviate data bias to a certain extent, these methods cannot completely eliminate bias, especially when the data volume is large and the data sources are complex. In addition, traditional loss functions mainly optimize overall accuracy and ignore fairness among different groups, making it difficult to balance performance and fairness at the same time.

[0005] Through in-depth analysis of existing technologies, it can be seen that it is difficult to fully solve the fairness problem of deep learning image processing models by relying solely on traditional data preprocessing methods and loss function design. Summary of the invention

[0006] The main purpose of the present invention is to provide an image processing method, apparatus, computer device and storage medium based on deep learning to solve the deficiencies of the existing technology in the field of image processing in terms of data bias and model fairness when processing tasks.

[0007] To achieve the above-mentioned purpose, the present invention provides an image processing method based on deep learning, comprising the following steps: obtaining target image data to be processed; inputting the target image data into a preset multi-layer convolutional neural network image processing model, wherein a fairness loss term is introduced into the loss function of the multi-layer convolutional neural network image processing model, and the fairness loss term is used to reduce the deviation of the multi-layer convolutional neural network image processing model when processing different image categories, thereby ensuring the consistency of processing results of images of different categories; obtaining image processing result data output by the multi-layer convolutional neural network image processing model.

[0008] Furthermore, after inputting the target image data into a preset multi-layer convolutional neural network image processing model, the image processing method also includes: collecting initial image data and preprocessing the initial image data; constructing an initial multi-layer convolutional neural network image processing model based on the preprocessed initial image data; introducing a fairness loss term into the initial loss function of the initial multi-layer convolutional neural network image processing model to obtain a target loss function; and retraining the initial multi-layer convolutional neural network image processing model based on the loss target loss function to obtain a final multi-layer convolutional neural network image processing model.

[0009] Furthermore, initial image data is collected and preprocessed, including: collecting initial image data, grouping the initial image data according to a plurality of preset attributes to obtain initial image data corresponding to different image categories; performing consistency correction processing on label information of the initial image data to obtain initial image data with complete and accurate label information; and using the initial image data that has at least undergone the grouping processing and the consistency correction processing as preprocessed initial image data.

[0010] Furthermore, based on the preprocessed initial image data, an initial multi-layer convolutional neural network image processing model is constructed, including: based on the preprocessed initial image data, a multi-layer convolutional neural network image processing basic model is constructed; using a gradient descent-based optimization algorithm to train the multi-layer convolutional neural network image processing basic model, wherein an initial loss function is used to optimize the model during the training of the basic multi-layer convolutional neural network image processing model; and an initial multi-layer convolutional neural network image processing model whose accuracy meets preset conditions is obtained.

[0011] Further, a fairness loss term is introduced into the initial loss function of the initial multi-layer convolutional neural network image processing model to obtain a target loss function, including: constructing the fairness loss term, wherein the fairness loss term includes: a contrast loss function and a mean difference loss function, and the contrast loss function is: ,in, Indicates whether samples i and j belong to the same image category (1 if yes, 0 if no). represents the distance between samples i and j, m is a threshold, indicating the minimum distance between different image categories, and N is the number of sample pairs; the mean difference loss function is: , where G represents the set of all image categories, and Represents image categories and The output mean of Indicates that only the differences between different image categories are considered; the fairness loss term is introduced into the initial loss function to obtain the target loss function, where the target loss function is: ,in, represents a traditional loss function (such as cross entropy loss or mean squared error loss), and are the weight parameters of contrast loss and mean difference loss, respectively, which are used to balance the importance of each part.

[0012] Further, based on the target loss function, the initial multi-layer convolutional neural network image processing model is retrained to obtain the final multi-layer convolutional neural network image processing model, including: obtaining the contrast loss weight parameter and the mean difference loss weight parameter Within the range, multiple sets of contrast loss weight parameters are generated and the mean difference loss weight parameter ; Based on multiple sets of parameter combinations to be adjusted, the initial multi-layer convolutional neural network image processing model is iteratively trained by back propagation until the target loss function of the initial multi-layer convolutional neural network image processing model converges, thereby obtaining a final multi-layer convolutional neural network image processing model.

[0013] Furthermore, after retraining the initial multi-layer convolutional neural network image processing model based on the target loss function to obtain the final multi-layer convolutional neural network image processing model, the image processing method further includes: obtaining sample image data of different image categories; using the final multi-layer convolutional neural network image processing model to process the sample image data of different image categories to obtain image data processing results of different image categories; based on the image data processing results of different image categories, performing fairness analysis on the final multi-layer convolutional neural network image processing model to obtain image processing model fairness analysis data; based on the image processing model fairness analysis data, providing the final image processing model with the best image processing performance. The final multi-layer convolutional neural network image processing model is subjected to fairness scoring processing to obtain a fairness evaluation score of the final multi-layer convolutional neural network image processing model; whether the fairness evaluation score of the final multi-layer convolutional neural network image processing model is lower than a first threshold is determined; if it is lower than the first threshold, the step of "retraining the initial multi-layer convolutional neural network image processing model based on the target loss function to obtain the final multi-layer convolutional neural network image processing model" is re-executed; if it is not lower than the first threshold, the step of "inputting the target image data into the preset multi-layer convolutional neural network image processing model" is executed using the final multi-layer convolutional neural network image processing model.

[0014] The present invention also provides an image processing device based on deep learning, comprising: an acquisition unit, used to acquire target image data to be processed; an input unit, used to input the target image data into a preset multi-layer convolutional neural network image processing model, wherein a fairness loss term is introduced into the loss function of the multi-layer convolutional neural network image processing model, and the fairness loss term is used to reduce the deviation of the multi-layer convolutional neural network image processing model when processing different image categories, thereby ensuring the consistency of processing results of images of different categories; a processing unit, used to obtain image processing result data output by the multi-layer convolutional neural network image processing model.

[0015] The present invention also provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the above methods when executing the computer program.

[0016] The present invention also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned methods are implemented.

[0017] The present invention provides an image processing method, device, computer equipment and storage medium based on deep learning, which aims to solve the problem of inaccurate and unfair image classification caused by data bias and insufficient model fairness in the prior art. The specific steps include the following aspects: First, the target image data to be processed is obtained. This step is the starting point of the whole method. By collecting and preparing the image data to be processed, a basis for subsequent image processing is provided. In this step, it is key to ensure the diversity and comprehensiveness of the data, so as to provide a rich training and test samples for the model. Next, the target image data is input into a preset multi-layer convolutional neural network image processing model. This model is designed to include a multi-layer convolutional neural network structure so as to fully extract and learn the features in the image. At the same time, the key innovation is that a fairness loss term is introduced into the loss function of the model. This fairness loss term is specifically used to reduce the deviation of the model when processing different image categories, aiming to ensure that the processing results of different categories of images are more consistent and fair. Through this improvement, the model not only focuses on overall accuracy, but also particularly optimizes fairness between different groups. Finally, the image processing result data output by the multi-layer convolutional neural network image processing model is obtained. At this stage, the improved model can output more fair and accurate image classification results, thereby improving the reliability and fairness of the model in practical applications.

[0018] In general, the technical solution of the present invention effectively alleviates the problem of unfair classification caused by bias in training data by introducing a fairness loss term in the convolutional neural network model, and significantly improves the classification performance of the image processing model on images of different groups. In this way, not only the performance of the model in various image processing tasks is enhanced, but also the fairness and reliability of the model applied to actual scenarios are greatly improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 is a schematic diagram of the steps of an image processing method based on deep learning in one embodiment of the present invention;

[0020] Figure 2 is a structural block diagram of an image processing device based on deep learning in one embodiment of the present invention;

[0021] Figure 3 It is a schematic block diagram of the structure of a computer device according to an embodiment of the present invention.

[0022] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0023] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0024] Reference Figure 1 , an embodiment of the present invention provides an image processing method based on deep learning, comprising the following steps:

[0025] S1, obtaining target image data to be processed.

[0026] S2, inputting the target image data into a preset multi-layer convolutional neural network image processing model, wherein a fairness loss term is introduced into the loss function of the multi-layer convolutional neural network image processing model, and the fairness loss term is used to reduce the deviation of the multi-layer convolutional neural network image processing model when processing different image categories, thereby ensuring the consistency of processing results of images of different categories.

[0027] S3, obtaining image processing result data output by the multi-layer convolutional neural network image processing model.

[0028] That is, the embodiment of the present invention provides an image processing method based on deep learning, which aims to solve the problem of inaccurate and unfair image classification caused by data bias and insufficient model fairness in the prior art. The specific steps include the following aspects: First, the target image data to be processed is obtained. This step is the starting point of the entire method. By collecting and preparing the image data to be processed, a basis for subsequent image processing is provided. In this step, it is key to ensure the diversity and comprehensiveness of the data, so as to provide a rich training and test samples for the model. Next, the target image data is input into a preset multi-layer convolutional neural network image processing model. This model is designed to include a multi-layer convolutional neural network structure so as to fully extract and learn the features in the image. At the same time, the key innovation is that a fairness loss term is introduced into the loss function of the model. This fairness loss term is specifically used to reduce the deviation of the model when processing different image categories, aiming to ensure that the processing results of different categories of images are more consistent and fair. Through this improvement, the model not only focuses on overall accuracy, but also particularly optimizes fairness between different groups. Finally, the image processing result data output by the multi-layer convolutional neural network image processing model is obtained. At this stage, the improved model can output more fair and accurate image classification results, thereby improving the reliability and fairness of the model in practical applications.

[0029] In general, the technical solution of the present invention effectively alleviates the problem of unfair classification caused by bias in training data by introducing a fairness loss term in the convolutional neural network model, and significantly improves the classification performance of the image processing model on images of different groups. In this way, not only the performance of the model in various image processing tasks is enhanced, but also the fairness and reliability of the model applied to actual scenarios are greatly improved.

[0030] It should be noted that in the above technical solution, there are several key verbs and nouns that need to be explained in order to better understand the entire solution. The target image data refers to the set of images to be processed, which is the basis of the entire processing process. For example, if we want to classify different types of flowers, the photos of these flowers are the target image data. The multi-layer convolutional neural network is a complex neural network structure that contains multiple convolutional layers. Each layer processes the input image to extract features at different levels. For example, the initial layer may recognize simple edges and colors, while deeper layers may recognize complex shapes and objects. This multi-layer structure enables the network to understand and analyze the details and overall features of the image. The loss function is a function used to measure the difference between the predicted results and the actual results during the model training process. The traditional loss function mainly focuses on the overall prediction accuracy, while the "fairness loss term" introduced in the present invention specifically considers the balance between different categories. For example, if there are a large number of cat photos in the training data, but only a small number of dog photos, the ordinary loss function may cause the model to classify cats more accurately and dogs poorly. After introducing the fairness loss term, the model will pay more attention to the balanced performance on these two types of images, ensuring that both cats and dogs can be accurately classified. Input and output are also very important in this process. "Inputting" the target image data into the convolutional neural network means sending these images into the network for processing. And "output" refers to the processed result data, such as classification labels or segmented images.

[0031] In one example, after inputting the target image data into a preset multi-layer convolutional neural network image processing model, the image processing method further includes: collecting initial image data and preprocessing the initial image data; constructing an initial multi-layer convolutional neural network image processing model based on the preprocessed initial image data; introducing a fairness loss term into the initial loss function of the initial multi-layer convolutional neural network image processing model to obtain a target loss function; and retraining the initial multi-layer convolutional neural network image processing model based on the loss target loss function to obtain a final multi-layer convolutional neural network image processing model.

[0032] In this example, the image processing method includes several key steps to ensure that the model is not only highly accurate but also fair across categories. First, collect initial image data, which is the basis for model training. For example, we collect photos of various flowers, including roses, tulips, sunflowers, etc. These photos need to cover as many types and samples as possible to ensure data diversity. Next, preprocess the initial image data. The preprocessing steps can include image normalization, resizing, and denoising. The purpose of this step is to convert the raw data into a format suitable for input to the neural network. For example, all flower photos are resized to a uniform size and color standardized so that the model can better extract features. Then, based on the preprocessed initial image data, build an initial multi-layer convolutional neural network image processing model. This model includes multiple convolutional layers, each layer is used to extract different features in the image, such as edges, textures, and shapes. The design and training of the initial model relies on a large amount of preprocessed data and aims to build a basic image classifier. In the initial model, a fairness loss term is introduced into the initial loss function to obtain the target loss function. The role of the fairness loss term is to ensure the balance of the model between different categories. For example, if the model performs unevenly when classifying roses and tulips, the fairness loss term will help adjust the model to make its performance more consistent across these categories. Finally, the initial multi-layer convolutional neural network image processing model is retrained based on the target loss function. The retraining process continuously adjusts the parameters of the model through multiple iterations to maximize the overall accuracy while minimizing the deviation between different categories. Through this process, a multi-layer convolutional neural network image processing model is finally obtained.

[0033] In one example, initial image data is collected and preprocessed, including: collecting initial image data, grouping the initial image data according to a plurality of preset attributes to obtain initial image data corresponding to different image categories; performing consistency correction processing on label information of the initial image data to obtain initial image data with complete and accurate label information; and using the initial image data that has undergone at least the grouping processing and the consistency correction processing as preprocessed initial image data.

[0034] In this example, the steps of collecting and preprocessing the initial image data are to ensure the quality and consistency of the data so that the subsequent model training can achieve better results. The following is a specific explanation: First, collect the initial image data. This step involves obtaining a large amount of image data from various sources, and the image data should cover different categories as much as possible. For example, if we want to classify different varieties of flowers, we need to collect a large number of photos of different kinds of flowers, such as roses, tulips, sunflowers, etc. Next, the initial image data is grouped according to multiple preset attributes to obtain initial image data corresponding to different image categories. The preset attributes may include the category of the image, the shooting angle, the lighting conditions, etc. The purpose of the grouping process is to group images with similar features together for better subsequent processing. For example, we can divide the images into rose groups, tulip groups, and sunflower groups according to the types of flowers. After that, the label information of the initial image data is corrected for consistency to obtain initial image data with complete and accurate label information. Label information refers to the category label corresponding to each image. In this step, it is very important to ensure that the label information of all images is accurate. If the label information of some images is incomplete or wrong, correction processing is required to ensure the consistency and accuracy of the data. For example, if some photos of roses are mislabeled as tulips, this step will correct these wrong labels. Finally, the initial image data that has undergone at least the grouping process and consistency correction process is used as the preprocessed initial image data. These preprocessed data will be used to build and train the initial multi-layer convolutional neural network model. Through the preprocessing step, the quality and consistency of the input data are ensured, thereby improving the efficiency and effect of model training.

[0035] It should be added that the preprocessing mentioned above includes not only grouping and consistency correction, but also data enhancement and image standardization. Data enhancement is to generate new image data by performing various transformations on the original image, such as rotation, flipping, scaling, translation, and adding noise. This process can increase the diversity of training data, help the model to generalize better, and thus improve its robustness under different conditions. For example, by rotating and flipping photos of flowers, images of various angles can be generated to increase the adaptability of the model to different perspectives. Image standardization is another important preprocessing step, which includes normalizing the image pixel values. By adjusting the pixel values ​​to a fixed range (such as 0 to 1 or -1 to 1), the brightness and contrast differences between different images can be eliminated, making it easier for the model to learn features in the image. Standardization can also include mean zeroing and variance normalization to make the image data on the same scale, which helps to speed up the model training process and improve the convergence speed of the model. In addition, data cleaning is also an important part of preprocessing. This step includes removing blurred, incomplete, or poor quality image data to ensure the high quality of training data. Some images that may have incorrect or duplicate labels also need to be checked and cleaned to ensure the accuracy and uniqueness of the training data. For example, delete photos of flowers with blurry shooting angles or obvious noise to ensure that clear, high-quality images are used for model training. Comprehensive preprocessing including these steps can greatly improve the quality and diversity of the data, and enhance the training effect and generalization ability of the model. Ultimately, these preprocessing steps work together to make the trained multi-layer convolutional neural network model more accurate and reliable in classification tasks, and better cope with various complex situations and challenges in practical applications.

[0036] In one example, an initial multi-layer convolutional neural network image processing model is constructed based on the preprocessed initial image data, including: constructing a multi-layer convolutional neural network image processing basic model based on the preprocessed initial image data; using a gradient descent-based optimization algorithm to train the multi-layer convolutional neural network image processing basic model, wherein an initial loss function is used to optimize the model during the training of the basic multi-layer convolutional neural network image processing model; and obtaining an initial multi-layer convolutional neural network image processing model whose accuracy meets preset conditions.

[0037] In this example, an initial multi-layer convolutional neural network image processing model is constructed based on the preprocessed initial image data, including the following steps: First, a multi-layer convolutional neural network image processing basic model is constructed based on the preprocessed initial image data. The purpose of this step is to establish a basic neural network structure, including multiple convolutional layers, pooling layers, and fully connected layers. The convolutional layer is used to extract local features of the image, the pooling layer is used for downsampling to reduce the amount of data and computational complexity, and the fully connected layer is used to integrate the extracted features and output the classification results. For example, in the flower classification task, this basic model can extract features such as the shape, color, and texture of the flower layer by layer, and finally output the type of flower corresponding to each image. Next, the multi-layer convolutional neural network image processing basic model is trained using an optimization algorithm based on gradient descent. Gradient descent is an iterative optimization algorithm that gradually adjusts the parameters to minimize the loss function by calculating the gradient of the loss function relative to the model parameters. During the training process, the parameters of the model are adjusted at each iteration to make its prediction of the training data more accurate. For example, by continuously adjusting the weights of the convolution kernel, the model can better identify the features of the flower. During the training of the basic multi-layer convolutional neural network image processing model, an initial loss function is used to optimize the model. The initial loss function is a function used to measure the difference between the model's prediction results and the actual labels, such as the cross entropy loss function. During the training process, the model will optimize its parameters and improve the prediction accuracy by minimizing this loss function. For the flower classification task, this means that the model will gradually improve the correct classification rate of various flowers. Through these steps, an initial multi-layer convolutional neural network image processing model with accuracy that meets the preset conditions is finally obtained. The preset condition can be that the classification accuracy of the model on the validation data set reaches a certain threshold. For example, the preset condition can be that the accuracy of the model on the validation set reaches 90%. When the model meets this condition, it means that it has a high accuracy in processing image classification tasks.

[0038] In one example, a fairness loss term is introduced into the initial loss function of the initial multi-layer convolutional neural network image processing model to obtain a target loss function, including: constructing the fairness loss term, wherein the fairness loss term includes: a contrast loss function and a mean difference loss function, and the contrast loss function is: ,in, Indicates whether samples i and j belong to the same image category (1 if yes, 0 if no). represents the distance between samples i and j, m is a threshold, indicating the minimum distance between different image categories, and N is the number of sample pairs. The mean difference loss function is: , where G represents the set of all image categories, and Represents image categories and The output mean of Indicates that only the differences between different image categories are considered. The fairness loss term is introduced into the initial loss function to obtain the target loss function, where the target loss function is: ,in, represents a traditional loss function (such as cross entropy loss or mean squared error loss), and are the weight parameters of contrast loss and mean difference loss, respectively, which are used to balance the importance of each part.

[0039] In this example, in order to introduce a fairness loss term into the initial loss function of the initial multi-layer convolutional neural network image processing model and obtain the target loss function, the following steps are specifically included: First, construct a fairness loss term. The fairness loss term mainly includes the contrast loss function and the mean difference loss function. The purpose of the contrast loss function is to measure the distance difference between samples of the same category and samples of different categories. By calculating the distance between samples, it can be ensured that the distance between samples of the same category is small, while the distance between samples of different categories is large. For example, if sample i and sample j belong to the same image category, the distance between them should be as small as possible; if sample i and sample j belong to different image categories, the distance between them should be greater than a threshold m to ensure the clarity of category distinction. The purpose of the mean difference loss function is to measure the difference between the output means of different image categories. By calculating the output mean of each category, it can be ensured that the output means of different categories are as different as possible, thereby enhancing the distinction between categories. For example, if we have two image categories A and B, we hope that all images of category A have similar means on the output, while all images of category B have another similar but different means on the output. This calculation of mean difference only considers the difference between different categories, which further ensures the fairness of the model when processing different categories. Then, the fairness loss term is introduced into the initial loss function to obtain the target loss function. The target loss function combines the traditional loss function and the fairness loss term, where the traditional loss function can be cross entropy loss or mean square error loss, etc., to optimize the overall accuracy of the model. After introducing the fairness loss term, the target loss function not only considers the overall accuracy, but also pays special attention to the balance between different categories. The construction of the target loss function combines the traditional loss function with the contrast loss and the mean difference loss in a weighted manner. The contrast loss and the mean difference loss have their own weight parameters, which are used to balance the importance of each part in the target loss function. The adjustment of these weight parameters can ensure that the model can achieve fairness between different categories while ensuring accuracy according to the needs of specific tasks. Through these steps, the target loss function can effectively improve the fairness of the model when processing different image categories, ensuring that the model not only has high accuracy, but also maintains consistent performance between categories, thereby providing more reliable and fair classification results in practical applications.

[0040] In one example, based on the target loss function, the initial multi-layer convolutional neural network image processing model is retrained to obtain the final multi-layer convolutional neural network image processing model, including: obtaining the contrast loss weight parameter and the mean difference loss weight parameter Within the range, multiple sets of contrast loss weight parameters are generated and the mean difference loss weight parameter ; Based on multiple sets of parameter combinations to be adjusted, the initial multi-layer convolutional neural network image processing model is iteratively trained by back propagation until the target loss function of the initial multi-layer convolutional neural network image processing model converges, thereby obtaining a final multi-layer convolutional neural network image processing model.

[0041] In this example, in order to retrain the initial multi-layer convolutional neural network image processing model based on the target loss function to obtain the final multi-layer convolutional neural network image processing model, the following steps are included: First, the range interval of the contrast loss weight parameter and the mean difference loss weight parameter is obtained. The purpose of this step is to determine the possible value ranges of these two weight parameters so that they can be adjusted during the model training process. These weight parameters are used to balance different parts in the target loss function to ensure that the model finds the best balance between accuracy and fairness. For example, the range interval of the contrast loss weight parameter may be from 0.1 to 1.0, while the range interval of the mean difference loss weight parameter may be from 0.01 to 0.1. Next, within these range intervals, multiple sets of parameter combinations to be adjusted for the contrast loss weight parameter and the mean difference loss weight parameter are generated. By taking different values ​​within a predetermined range, multiple parameter combinations are generated, each of which corresponds to a possible model training scheme. The purpose of this is to find the best parameter combination to optimize the target loss function. For example, we can generate ten different parameter combinations, each with different contrast loss weights and mean difference loss weights. Then, based on these multiple sets of parameter combinations to be adjusted, the initial multi-layer convolutional neural network image processing model is iteratively trained by back propagation. Back propagation is the core process of deep learning model training. By calculating the gradient of the loss function and adjusting the model parameters according to the gradient, the loss is gradually reduced. In each round of iteration, the model is trained using the current parameter combination and the model weights are updated. This process continues until the target loss function converges, that is, the loss function value no longer decreases significantly, indicating that the model has reached a stable state. Finally, through the above steps, the final multi-layer convolutional neural network image processing model is obtained. During the training process, this model not only optimizes the overall accuracy, but also significantly improves the fairness of the model between different categories by introducing contrast loss and mean difference loss. In this way, the final model not only has efficient classification performance, but also shows consistent effects when processing images of different categories, ensuring reliability and fairness in the application. Overall, this process adjusts the weight parameters of contrast loss and mean difference loss, performs iterative back propagation training, and finally obtains an image processing model that performs well in both accuracy and fairness.

[0042] In one example, after retraining the initial multi-layer convolutional neural network image processing model based on the target loss function to obtain the final multi-layer convolutional neural network image processing model, the image processing method further includes: obtaining sample image data of different image categories; using the final multi-layer convolutional neural network image processing model to process the sample image data of different image categories to obtain image data processing results of different image categories; based on the image data processing results of different image categories, performing fairness analysis on the final multi-layer convolutional neural network image processing model to obtain image processing model fairness analysis data; based on the image processing model fairness analysis data, The final multi-layer convolutional neural network image processing model is subjected to fairness scoring processing to obtain a fairness assessment score of the final multi-layer convolutional neural network image processing model; it is determined whether the fairness assessment score of the final multi-layer convolutional neural network image processing model is lower than a first threshold; if it is lower than the first threshold, the step of "retraining the initial multi-layer convolutional neural network image processing model based on the target loss function to obtain the final multi-layer convolutional neural network image processing model" is re-executed; if it is not lower than the first threshold, the final multi-layer convolutional neural network image processing model is used to execute the step of "inputting the target image data into a preset multi-layer convolutional neural network image processing model".

[0043] In this example, after the image processing method retrains the initial multi-layer convolutional neural network image processing model based on the target loss function to obtain the final multi-layer convolutional neural network image processing model, it also includes the following steps: First, obtain sample image data of different image categories. These data are used to evaluate the fairness of the final model. For example, if the model processes different types of flowers, we need to collect sample image data of each flower, including roses, tulips, and sunflowers. Next, the final multi-layer convolutional neural network image processing model is used to process the sample image data of different image categories to obtain image data processing results of different image categories. Through this step, we can obtain the processing effect of the model on each category of images, including performance indicators such as classification accuracy and recall rate. Then, based on these image data processing results, the final multi-layer convolutional neural network image processing model is subjected to fairness analysis. The purpose of fairness analysis is to evaluate whether the performance of the model is consistent across different image categories. For example, analyze whether there is a significant difference in the classification accuracy of the model for roses and tulips. Through this analysis, we can obtain fairness data of the model when processing images of different categories. Based on the fairness analysis data, the final multi-layer convolutional neural network image processing model is subjected to fairness scoring to obtain the fairness evaluation score of the model. This scoring process will comprehensively consider the processing effects of each category and give a score that reflects the overall fairness of the model. The higher the fairness evaluation score, the more balanced the performance of the model among different categories. Next, determine whether the fairness evaluation score of the final model is lower than the preset first threshold. If the score is lower than the first threshold, it means that the fairness of the model has not yet reached the expected standard and further optimization is required. In this case, it is necessary to re-execute the step of "retraining the initial multi-layer convolutional neural network image processing model based on the target loss function" to adjust the model parameters again and optimize the fairness of the model. If the fairness evaluation score is not lower than the first threshold, it means that the fairness of the model has reached the expected standard and the final model can be used to perform actual image processing tasks. In this case, continue to execute the step of "inputting the target image data into the preset multi-layer convolutional neural network image processing model" for actual image processing applications. Through the above steps, it is ensured that the model not only performs well in overall accuracy, but also performs fairly among different categories. The iterative optimization of this process enables the final image processing model to provide more reliable and fair classification results in practical applications.

[0044] Reference Figure 2 , an embodiment of the present invention provides an image processing device based on deep learning, including.

[0045] The acquisition unit 1 is used to acquire target image data to be processed.

[0046] Input unit 2 is used to input the target image data into a preset multi-layer convolutional neural network image processing model, wherein a fairness loss term is introduced into the loss function of the multi-layer convolutional neural network image processing model, and the fairness loss term is used to reduce the deviation of the multi-layer convolutional neural network image processing model when processing different image categories, thereby ensuring the consistency of processing results of images of different categories.

[0047] Processing unit 3 is used to obtain the image processing result data output by the multi-layer convolutional neural network image processing model.

[0048] In this embodiment, for the specific implementation of each unit in the above device embodiment, please refer to the above method embodiment, which will not be repeated here.

[0049] Reference Figure 3 In an embodiment of the present invention, a computer device is also provided. The computer device may be a server, and its internal structure may be as follows: Figure 3 As shown. The computer device includes a processor, a memory, a display screen, an input device, a network interface and a database connected through a system bus. Among them, the processor designed by the computer is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store the corresponding data in this embodiment. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the above method is implemented.

[0050] Those skilled in the art will understand that Figure 3 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present invention, and does not constitute a limitation on the computer device to which the solution of the present invention is applied.

[0051] An embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the above method is implemented. It can be understood that the computer-readable storage medium in this embodiment can be a volatile readable storage medium or a non-volatile readable storage medium.

[0052] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media provided by the present invention and used in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double-speed data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM.

[0053] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the presence of other identical elements in the process, device, article or method including the element.

[0054] The above description is only a preferred embodiment of the present invention, and does not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. An image processing method based on deep learning, characterized in that: The following steps are involved: Acquire target image data to be processed; Inputting the target image data into a preset multi-layer convolutional neural network image processing model, wherein a fairness loss term is introduced into the loss function of the multi-layer convolutional neural network image processing model, and the fairness loss term is used to reduce the deviation of the multi-layer convolutional neural network image processing model when processing different image categories, thereby ensuring the consistency of processing results of images of different categories; Obtaining image processing result data output by the multi-layer convolutional neural network image processing model; Wherein, after the target image data is input into the preset multi-layer convolutional neural network image processing model, the image processing method further includes: collecting initial image data and preprocessing the initial image data; constructing an initial multi-layer convolutional neural network image processing model based on the preprocessed initial image data; introducing a fairness loss term into the initial loss function of the initial multi-layer convolutional neural network image processing model to obtain a target loss function; based on the target loss function, retraining the initial multi-layer convolutional neural network image processing model to obtain a final multi-layer convolutional neural network image processing model; Wherein, a fairness loss term is introduced into the initial loss function of the initial multi-layer convolutional neural network image processing model to obtain a target loss function, including: Constructing the fairness loss term, the fairness loss term includes: a contrast loss function and a mean difference loss function, The contrast loss function is: ,in, Indicates whether samples i and j belong to the same image category. 1 means yes, 0 means no. represents the distance between samples i and j, m is a threshold, indicating the minimum distance between different image categories, and N is the number of sample pairs; The mean difference loss function is: , where G represents the set of all image categories, and Represents image categories and The output mean of It means that only the differences between different image categories are considered; The fairness loss term is introduced into the initial loss function to obtain the target loss function, where the target loss function is: ,in, is the cross entropy loss or mean square error loss, and are the weight parameters of contrast loss and mean difference loss, respectively, which are used to balance the importance of each part.

2. The image processing method according to claim 1, characterized in that: The collecting of initial image data and preprocessing of the initial image data includes: Collecting initial image data, and grouping the initial image data according to a plurality of preset attributes to obtain initial image data corresponding to different image categories; Performing consistency correction processing on the label information of the initial image data to obtain initial image data with complete and accurate label information; The initial image data that has at least undergone the grouping process and the consistency correction process is used as the pre-processed initial image data.

3. The image processing method according to claim 1, characterized in that: The method comprises constructing an initial multi-layer convolutional neural network image processing model based on the preprocessed initial image data, comprising: Based on the preprocessed initial image data, construct a multi-layer convolutional neural network image processing basic model; The multi-layer convolutional neural network image processing basic model is trained by using a gradient descent-based optimization algorithm, wherein an initial loss function is used to optimize the model during the training of the basic multi-layer convolutional neural network image processing model; An initial multi-layer convolutional neural network image processing model is obtained whose accuracy meets the preset conditions.

4. The image processing method according to claim 1, characterized in that: The initial multi-layer convolutional neural network image processing model is retrained based on the target loss function to obtain a final multi-layer convolutional neural network image processing model, including: Get the contrast loss weight parameter and the mean difference loss weight parameter The range interval; Generate multiple sets of contrast loss weight parameters within the range and the mean difference loss weight parameter The combination of parameters to be adjusted; Based on multiple groups of parameter combinations to be adjusted, the initial multi-layer convolutional neural network image processing model is iteratively trained by back propagation until the target loss function of the initial multi-layer convolutional neural network image processing model converges, thereby obtaining a final multi-layer convolutional neural network image processing model.

5. The image processing method according to claim 1, characterized in that: After retraining the initial multi-layer convolutional neural network image processing model based on the target loss function to obtain a final multi-layer convolutional neural network image processing model, the image processing method further includes: Obtain sample image data of different image categories; Using the final multi-layer convolutional neural network image processing model to process the sample image data of the different image categories to obtain image data processing results of the different image categories; Based on the image data processing results of the different image categories, performing fairness analysis on the final multi-layer convolutional neural network image processing model to obtain image processing model fairness analysis data; Based on the image processing model fairness analysis data, a fairness scoring process is performed on the final multi-layer convolutional neural network image processing model to obtain a fairness evaluation score of the final multi-layer convolutional neural network image processing model; Determining whether the fairness assessment score of the final multi-layer convolutional neural network image processing model is lower than a first threshold; If it is lower than the first threshold, re-executing the step of "retraining the initial multi-layer convolutional neural network image processing model based on the target loss function to obtain a final multi-layer convolutional neural network image processing model"; If it is not lower than the first threshold, the final multi-layer convolutional neural network image processing model is used to execute the step of "inputting the target image data into the preset multi-layer convolutional neural network image processing model".

6. An image processing device based on deep learning, characterized in that: include: An acquisition unit, used for acquiring target image data to be processed; An input unit, used to input the target image data into a preset multi-layer convolutional neural network image processing model, wherein a fairness loss term is introduced into the loss function of the multi-layer convolutional neural network image processing model, and the fairness loss term is used to reduce the deviation of the multi-layer convolutional neural network image processing model when processing different image categories, so as to ensure the consistency of processing results of different categories of images; A processing unit, used to obtain image processing result data output by the multi-layer convolutional neural network image processing model; Wherein, after the target image data is input into the preset multi-layer convolutional neural network image processing model, it also includes: collecting initial image data and preprocessing the initial image data; constructing an initial multi-layer convolutional neural network image processing model based on the preprocessed initial image data; introducing a fairness loss term into the initial loss function of the initial multi-layer convolutional neural network image processing model to obtain a target loss function; based on the target loss function, retraining the initial multi-layer convolutional neural network image processing model to obtain a final multi-layer convolutional neural network image processing model; Wherein, a fairness loss term is introduced into the initial loss function of the initial multi-layer convolutional neural network image processing model to obtain a target loss function, including: Constructing the fairness loss term, the fairness loss term includes: a contrast loss function and a mean difference loss function, The contrast loss function is: ,in, Indicates whether samples i and j belong to the same image category. 1 means yes, 0 means no. represents the distance between samples i and j, m is a threshold, indicating the minimum distance between different image categories, and N is the number of sample pairs; The mean difference loss function is: , where G represents the set of all image categories, and Represents image categories and The output mean of It means that only the differences between different image categories are considered; The fairness loss term is introduced into the initial loss function to obtain the target loss function, where the target loss function is: ,in, is the cross entropy loss or mean square error loss, and are the weight parameters of contrast loss and mean difference loss, respectively, which are used to balance the importance of each part.

7. A computer device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Image restoration evidence obtaining method combining discrete cosine transform and neural network

    CN110223273A

  • Small data cross-domain action recognition method based on double-chain deep double-flow network

    CN110458038A

  • Visible light image and infrared image fusion ship classification method and device based on deep learning

    CN113610180A

  • SAR (Synthetic Aperture Radar) target identification method and device based on distribution correction

    CN114997238A

  • Semi-supervised video fire detection method based on consistency regularization and distribution alignment

    CN117274881A