CN116894884B - Color image processing method, system, equipment and medium based on weighted loss function - Google Patents

Color image processing method, system, equipment and medium based on weighted loss function Download PDF

Info

Publication number
CN116894884B
CN116894884B CN202311139655.2A CN202311139655A CN116894884B CN 116894884 B CN116894884 B CN 116894884B CN 202311139655 A CN202311139655 A CN 202311139655A CN 116894884 B CN116894884 B CN 116894884B
Authority
CN
China
Prior art keywords
loss function
gray
pixel point
calculating
image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311139655.2A
Other languages
Chinese (zh)
Other versions
CN116894884A (en
Inventor
周康
安志斌
公彬
苏珂
翟明昆
陈莹杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shandong University of Science and Technology
Original Assignee
Shandong University of Science and Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shandong University of Science and Technology filed Critical Shandong University of Science and Technology
Priority to CN202311139655.2A priority Critical patent/CN116894884B/en
Publication of CN116894884A publication Critical patent/CN116894884A/en
Application granted granted Critical
Publication of CN116894884B publication Critical patent/CN116894884B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/001Texturing; Colouring; Generation of texture or colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/774Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/10Internal combustion engine [ICE] based vehicles
    • Y02T10/40Engine management systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Computing Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Multimedia (AREA)
  • Image Analysis (AREA)
  • Color Image Communication Systems (AREA)

Abstract

The invention relates to a color image processing method, a system, equipment and a medium based on a weighted loss function, belonging to the technical field of deep learning and image processing, comprising the following steps: the step of calculating the weighted loss function includes: acquiring an original color image, and carrying out graying treatment on the original color image; calculating the gray standard deviation of each pixel point; calculating the error weight of each pixel point; finally, calculating a weighted loss function of the training sample; training a prediction model based on the weighted loss function; and outputting a predicted color image through the trained prediction model. According to the invention, the weight of each pixel point in the loss function is redistributed through the standard deviation of the gray value between the pixel point and the pixel point which is directly adjacent to the pixel point, the detail characteristics of rich overall color and severe local change of the color image are fully considered in a self-adaptive manner, and the learning capability of the U-Net network on the local abrupt change characteristics such as multi-classification boundaries of the color image is enhanced.

Description

Color image processing method, system, equipment and medium based on weighted loss function
Technical Field
The invention relates to the technical field of deep learning and image processing, in particular to a color image processing method, a color image processing system, color image processing equipment and color image processing media based on a weighted loss function.
Background
The U-Net network is a convolutional neural network proposed in 2015, the encoder-decoder structure of the convolutional neural network is similar to a letter U shape, and the convolutional neural network is widely applied to the related fields of target detection, semantic segmentation, image prediction and the like. The U-Net network carries out iterative training on a large number of marked sample images by taking the minimization of the loss function as a target, and continuously optimizes and adjusts network structure parameters until the loss function is not reduced any more, and converges to obtain an optimal prediction model. Wherein the loss function is used to evaluate the degree of deviation of the model predictive image from the real image.
The definition of the loss function directly determines the training effect of the U-Net network, and conventionally, the importance difference of the pixel points in the loss function cannot be considered because the loss function is not weighted reasonably according to the specific characteristics of different pixel points, so that the training effect of the U-Net network on the image details is poor. For this purpose, the relevant scholars propose a variety of loss functions for pixel weighting, including two-stage weighting, edge enhancement weighting, class difference weighting, etc. Aiming at the problem of unbalanced distribution of the number of foreground pixels and background pixels in an image, the two-stage weighting loss function increases the weight of foreground pixels and reduces the weight of background pixels. The edge enhancement weighting loss function weights according to the distance of the pixel point from the classification boundary, and the closer the distance is, the larger the weight is. The category difference weighting loss function weights the learning difficulty level of different label categories, so that the more difficult to learn category weight is larger.
However, the two-stage weighting loss function needs to manually calibrate the foreground pixels and the background pixels in advance, is suitable for the problems of two-class target detection and the like, but the color image prediction problem needs to acquire the color information of each pixel point, and has no obvious foreground and background distinction; the edge strengthening weighting loss function needs to manually pre-calibrate the position of the classified boundary and perform Euclidean distance calculation, but the classification number in the color image prediction problem with rich colors is huge, and the accurate position of the classified boundary cannot be manually pre-calibrated; the category difference weighted loss function needs to manually judge the learning difficulty of different label categories in advance, but labels are classified into hundreds of thousands in the actual color image prediction problem, and the learning difficulty is difficult to quantify in advance. Therefore, as the demand of color image prediction increases in various industries, it is highly desirable to establish a pixel point error weight determining method and a corresponding weighting loss function that are not limited by the number of label classifications and the variation characteristics, aiming at the image characteristics of rich overall colors and severe local variation.
Disclosure of Invention
Aiming at the defects of the prior art, the invention provides a color image processing method based on the deep learning of a weighted loss function, which fully considers the degree of change between pixel points and the pixel points directly adjacent to the pixel points according to the characteristics of rich overall color and severe local change of a color image, redistributes the weight of each pixel point in the loss function based on the gray value standard deviation, strengthens the learning training of a local area with severe image change, and improves the learning capability of a U-Net network on local abrupt change details of images such as multi-classification boundaries and the like.
The technical scheme of the invention is as follows:
a color image processing method based on the deep learning of the weighted loss function comprises the following steps:
the step of calculating the weighted loss function includes: acquiring an original color image, and carrying out graying treatment on the original color image; calculating the gray standard deviation of each pixel point; calculating the error weight of each pixel point; finally, calculating a weighted loss function of the training sample;
training a prediction model based on the weighted loss function;
and outputting a predicted color image through the trained prediction model.
According to the present invention, preferably, the graying process for the color label image includes: according to three RGB values of each pixel point of the color label image in the existing training sample, respectively calculating a gray value corresponding to each pixel point, and converting the color label image into a gray label image.
According to the present invention, preferably, calculating the gray standard deviation of each pixel includes: traversing all pixel points in each gray label image, and sequentially calculating each pixel point and the surrounding thereofkStandard deviation of gray values of the immediately adjacent pixels; wherein, for the pixel point on the boundary of the gray label image, the pixel point is calculated to be directly adjacent to the gray label image within the range of the gray label image and not more thankStandard deviation of gray values of individual pixels.
According to the present invention, preferably, calculating an error weight of each pixel includes: and calculating the error weight value of each pixel point in the loss function based on the gray standard deviation of each pixel point in the gray label image, and traversing and calculating the error weight values of all the pixel points in the gray label image to obtain an error weight map of the gray label image.
According to a preferred embodiment of the present invention, calculating a weighted loss function of training samples includes: and calculating a weighted loss function value representing the integral error of all the pixel points between the real label image and the prediction model prediction image based on the error weight value of each pixel point in the error weight map.
According to a preferred embodiment of the present invention, the training of the prediction model based on the weighted loss function comprises: based on the weighted loss function, carrying out deep learning training on the existing training sample by adopting the prediction model, continuously optimizing and adjusting the network structure weight parameter of the prediction model until the loss function is not reduced any more, converging to obtain the optimal network structure weight parameter of the prediction model, and obtaining the trained prediction model; and drawing a scattered point contrast graph of the real data value of the label image and the predicted data value of the prediction model, and analyzing the training effect of the prediction model.
According to the present invention, preferably, outputting a predicted color image by a trained prediction model includes: performing brightness and contrast adjustment and Laplace sharpening operation on an input image to be processed; and then, the processed image is imported into a trained prediction model, and a predicted color image is output.
According to the invention, the calculation formula of gray value of each pixel point is shown as formula (I):
(Ⅰ)
in the formula (I),Gr i,j is the pixel point in the gray imagei,j) Is used for the gray-scale value of (c),R i,j the color label is a pixel point in the color label image of three primary colorsi,j) Is used for the color of the red color of the color-sensitive material,G i,j the color label is a pixel point in the color label image of three primary colorsi,j) Is used for the color of the green color of the (c),B i,j color label for three primary colorsPixel point in imagei,j) Is used for the color of the blue color of the (c),、/>、/>the weighting coefficients of the gradation values are calculated based on the three primary colors, respectively.
It is further preferred that the composition of the present invention,the value of (2) is 0.2-0.3 #>The value of (2) is 0.55-0.75%>The value range of (2) is 0.05-0.15.
Most preferably, the first and second heat exchangers are arranged,、/>、/>the values of (2) are respectively 0.3, 0.6 and 0.1.
According to the invention, the calculation formula of gray standard deviation of each pixel point is shown as formula (II):
(Ⅱ)
in the formula (II),S i,j the method is characterized in that the method is used for obtaining the gray label imagei,j) Is defined by the gray scale standard deviation of (c),kis pixel point #)i,j) The number of pixels immediately adjacent to the periphery,is pixel point #)i,j) Gray values of the surrounding first immediately adjacent pixel, wherein +.>Representing pixel points in gray label imagei,j) Is a gray value of (a).
It is further preferred that the composition of the present invention,k=4 ork=8。
According to the invention, the calculation formula of the error weight of each pixel point is shown as formula (III):
(Ⅲ)
in the formula (III),w i,j the method is that pixel points in the real label image are [ ]i,j) Is used for the error weight of the (c),based on a as a base numbers i,j And m and n are the numbers of pixel points in two directions of the two-dimensional label image respectively as an exponential function of the variable.
Further preferably, the value of the base number a is in the range of 1 to 5.
Most preferably, the base a has a value of 2.5.
According to the invention, the calculation formula of the weighted loss function value is shown as the formula (IV):
(Ⅳ)
in the formula (IV) of the present invention,Lossin order to weight the loss function,f i,j is the pixel point in the label imagei,j) Is used to determine the true class value of (c),is pixel point #)i,j) Probability of being predicted as class c, +.>Image acquisitionElement point [ (element point)i,j) The maximum value in the normalized probability corresponding to all the classifications c is treated, arg () is a valued function used for obtaining the pixel point [ (]i,j) Prediction classification value corresponding to maximum normalized probability, < ->Is an exponential function.
According to the invention, the predictive model is preferably a U-Net network.
A computer device comprising a memory storing a computer program and a processor implementing the steps of a method of color image processing based on deep learning of a weighted loss function when the computer program is executed.
A computer readable storage medium having stored thereon a computer program which when executed by a processor implements the steps of a color image processing method of weight loss function based deep learning.
A weighted loss function based deep learning color image processing system, comprising:
a weighting loss function calculation module configured to: carrying out graying treatment on the color label image; calculating the gray standard deviation of each pixel point; calculating the error weight of each pixel point; finally, calculating a weighted loss function of the training sample;
training module of prediction model: training a prediction model based on the weighted loss function;
an image processing module: and outputting a predicted color image through the trained prediction model.
The beneficial effects of the invention are as follows:
1. the weight of each pixel point in the loss function is redistributed through the standard deviation of the gray value between the pixel point and the pixel point which is directly adjacent to the pixel point, so that the detail characteristics of the color image, such as rich overall color and severe local change, can be fully considered in a self-adaptive manner, and the problem that the prior weighting method needs to manually calibrate the foreground and the background or classify the boundary in advance is avoided.
2. The loss function is weighted through the standard deviation of the gray values of the pixel points, so that the problem that the existing method relies on label classification information to carry out weighting limitation is avoided, and therefore the determined weighting loss function can be applied to multi-classification color image learning training.
3. Through the weight loss function determined by the invention, the U-Net network training is more prone to learning training of multi-classification boundaries of images, is more sensitive to local details with severe data change in the images, and effectively improves learning training effects.
Drawings
FIG. 1 is a flow chart of a color image processing method based on the deep learning of a weighted loss function according to an embodiment of the present invention;
FIG. 2 is a gray scale map obtained after gray scale processing of a color label image in a training sample according to an embodiment of the present invention;
FIG. 3 is an error weight chart calculated after gray scale processing of a color label image according to an embodiment of the present invention;
FIG. 4 is a plot of predicted data versus true data scatter points trained using an unweighted loss function;
FIG. 5 is a plot of predicted data versus true data scatter plot using weighted loss function training.
Detailed Description
The invention is further defined by, but is not limited to, the following drawings and examples in conjunction with the specification.
Example 1
A color image processing method based on the deep learning of the weighted loss function, as shown in figure 1, comprises the following steps:
the step of calculating the weighted loss function includes: shooting an original color image used for acquiring a training sample through a camera, and carrying out graying treatment on the original color image; calculating the gray standard deviation of each pixel point; calculating the error weight of each pixel point; finally, calculating a weighted loss function of the training sample;
training a prediction model based on the weighted loss function;
and outputting a predicted color image through the trained prediction model.
Example 2
The color image processing method based on the weighted loss function for deep learning according to embodiment 1 is different in that:
graying processing is carried out on the color label image, and the graying processing comprises the following steps: in the embodiment, 100 sets of three primary color images are used as training samples, and each color label image comprises 700×700= 490000 pixel points; according to three RGB values of each pixel point of the color label image in the existing training sample, respectively calculating a gray value corresponding to each pixel point, and converting the color label image into a gray label image. One of the gray maps obtained after the conversion of the graying process is shown in fig. 2.
The calculation formula of the gray value of each pixel point is shown as formula (I):
(Ⅰ)
in the formula (I),Gr i,j is the pixel point in the gray imagei,j) Is used for the gray-scale value of (c),R i,j the color label is a pixel point in the color label image of three primary colorsi,j) Is used for the color of the red color of the color-sensitive material,G i,j the color label is a pixel point in the color label image of three primary colorsi,j) Is used for the color of the green color of the (c),B i,j the color label is a pixel point in the color label image of three primary colorsi,j) Is used for the color of the blue color of the (c),、/>、/>the weighting coefficients of the gradation values are calculated based on the three primary colors, respectively.
The value of (2) is 0.2-0.3 #>The value of (2) is 0.55-0.75%>The value range of (2) is 0.05-0.15.
、/>、/>The values of (2) are respectively 0.3, 0.6 and 0.1.
Calculating the gray standard deviation of each pixel point comprises the following steps: traversing all pixel points in each gray label image, and sequentially calculating each pixel point and the surrounding thereofkStandard deviation of gray values of the immediately adjacent pixels; wherein, for the pixel point on the boundary of the gray label image, the pixel point is calculated to be directly adjacent to the gray label image within the range of the gray label image and not more thankStandard deviation of gray values of individual pixels.
The calculation formula of the gray standard deviation of each pixel point is shown as formula (II):
(Ⅱ)
in the formula (II),S i,j the method is characterized in that the method is used for obtaining the gray label imagei,j) Is defined by the gray scale standard deviation of (c),kis pixel point #)i,j) The number of pixels immediately adjacent to the periphery,is pixel point #)i,j) Gray values of the surrounding first immediately adjacent pixel, wherein +.>Representing pixel points in gray label imagei,j) Is a gray value of (a).k=4 ork=8。
In the present embodiment of the present invention,k8, namely, for each non-boundary pixel, calculating the standard deviation of gray values of 8 pixels directly adjacent to the periphery; in particular, for boundary non-corner pixel points, only the standard deviation of the gray values of 5 pixel points directly adjacent to the periphery is calculated, and for corner pixel points, only the standard deviation of the gray values of 3 pixel points directly adjacent to the periphery is calculated.
Calculating the error weight of each pixel point comprises the following steps: and calculating the error weight value of each pixel point in the loss function based on the gray standard deviation of each pixel point in the gray label image, and traversing and calculating the error weight values of all the pixel points in the gray label image to obtain an error weight map of the gray label image. The calculation formula of the error weight of each pixel point is shown as formula (III):
(Ⅲ)
in the formula (III),w i,j the method is that pixel points in the real label image are [ ]i,j) Is used for the error weight of the (c),based on a as a base numbers i,j And m and n are the numbers of pixel points in two directions of the two-dimensional label image respectively as an exponential function of the variable.
The value range of the base number a is 1-5. In particular, when the value of a is 1, the error weight of each pixel point isI.e., each pixel is unweighted, the importance in the loss function is consistent, and the weighted loss function is degenerated to a conventional unweighted loss function expression.
In this embodiment, m=700, n=700, a=2.5, the error weights of all pixels are calculated for the gray label image shown in fig. 2, and then an error weight map is drawn, as shown in fig. 3.
Calculating a weighted loss function for the training samples, comprising: and calculating a weighted loss function value representing the integral error of all the pixel points between the real label image and the prediction model prediction image based on the error weight value of each pixel point in the error weight map. The calculation formula of the weighted loss function value is shown in the formula (IV):
(Ⅳ)
in the formula (IV) of the present invention,Lossin order to weight the loss function,f i,j is the pixel point in the label imagei,j) Is used to determine the true class value of (c),is pixel point #)i,j) Probability of being predicted as class c, +.>Solving the pixel pointsi,j) The maximum value in the normalized probability corresponding to all the classifications c is treated, arg () is a valued function used for obtaining the pixel point [ (]i,j) Prediction classification value corresponding to maximum normalized probability, < ->Is an exponential function.
Training of the predictive model based on the weighted loss function, comprising: based on the weighted loss function, carrying out deep learning training on the existing training sample by adopting the prediction model, continuously optimizing and adjusting the network structure weight parameter of the prediction model until the loss function is not reduced any more, converging to obtain the optimal network structure weight parameter of the prediction model, and obtaining the trained prediction model; and drawing a scattered point contrast graph of the real data value of the label image and the predicted data value of the prediction model, and analyzing the training effect of the prediction model.
The prediction model is a U-Net network structure described in the literature arXiv:1505.04597, a conventional unweighted loss function and a determined weighted loss function (formula (IV)) are respectively adopted to perform U-Net network deep learning training on 100 sets of training samples, a scatter point comparison graph of a tag image real data value and a U-Net network prediction data value is respectively drawn, fig. 4 shows a scatter point comparison graph of prediction data obtained by training with the unweighted loss function and real data, and fig. 5 shows a scatter point comparison graph of prediction data obtained by training with the weighted loss function determined by the embodiment and real data. As shown in fig. 4, in the region with severe change of the classification edge data value, the deviation between the predicted data obtained by training with the unweighted loss function and the real data is large, the decision coefficient is 0.7244 only, the training effect is poor, and further prediction application precision requirements are difficult to meet; in contrast, as shown in fig. 5, after training using the weighted loss function proposed in this embodiment, even in the region where the classification edge data value varies drastically, the predicted data is still relatively close to the real data, and the decision coefficient is raised to 0.9918.
Outputting the predicted color image by the trained prediction model, comprising: the brightness and contrast adjustment and the Laplace sharpening operation are carried out on the input image to be processed, so that the image is clearer; and then, the processed image is imported into a trained prediction model, downsampling is carried out through convolution and maximum pooling according to the weight parameters of the network structure, then upsampling is carried out through deconvolution and jump connection, and finally the predicted color image is output by the layer.
Example 3
A computer device comprising a memory storing a computer program and a processor implementing the steps of the method for color image processing based on weighted-loss function deep learning of embodiment 1 or 2 when the computer program is executed by the processor.
Example 4
A computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the color image processing method of weighted-loss-function-based deep learning described in embodiment 1 or 2.
Example 5
A weighted loss function based deep learning color image processing system, comprising:
a weighting loss function calculation module configured to: carrying out graying treatment on the color label image; calculating the gray standard deviation of each pixel point; calculating the error weight of each pixel point; finally, calculating a weighted loss function of the training sample;
training module of prediction model: training a prediction model based on the weighted loss function;
an image processing module: and outputting a predicted color image through the trained prediction model.

Claims (13)

1. A color image processing method based on weighted loss function for deep learning, comprising the steps of:
the step of calculating the weighted loss function includes: acquiring an original color image, and carrying out graying treatment on the original color image; calculating the gray standard deviation of each pixel point; calculating the error weight of each pixel point; finally, calculating a weighted loss function of the training sample;
training a prediction model based on the weighted loss function;
outputting a predicted color image through the trained prediction model;
graying processing is carried out on the color label image, and the graying processing comprises the following steps: according to three RGB values of each pixel point of a color label image in the existing training sample, respectively calculating a gray value corresponding to each pixel point, and converting the color label image into a gray label image;
calculating the gray standard deviation of each pixel point comprises the following steps: traversing all pixel points in each gray label image, and sequentially calculating standard deviation of gray values of each pixel point and k immediately adjacent pixel points around the pixel point; for pixel points on the boundary of the gray label image, calculating the standard deviation of gray values of the pixels which are directly adjacent to the gray label image within the range and not more than k pixels;
calculating the error weight of each pixel point comprises the following steps: calculating the error weight value of each pixel point in the loss function based on the gray standard deviation of each pixel point of the gray label image, and traversing and calculating the error weight values of all the pixel points in the gray label image to obtain an error weight map of the gray label image;
calculating a weighted loss function value for a training sample, comprising: calculating a weighted loss function value representing the integral error of all pixel points between the real label image and the prediction model prediction image based on the error weight value of each pixel point in the error weight map;
training of the predictive model based on the weighted loss function, comprising: based on the weighted loss function, carrying out deep learning training on the existing training sample by adopting the prediction model, continuously optimizing and adjusting the network structure weight parameter of the prediction model until the loss function is not reduced any more, converging to obtain the optimal network structure weight parameter of the prediction model, and obtaining the trained prediction model; drawing a scattered point contrast graph of a real data value of the tag image and a predicted data value of the prediction model, and analyzing the training effect of the prediction model;
outputting the predicted color image by the trained prediction model, comprising: performing brightness and contrast adjustment and Laplace sharpening operation on an input image to be processed; then, the processed image is imported into a trained prediction model, and a predicted color image is output;
the calculation formula of the gray value of each pixel point is shown as formula (I):
Gr i,j =αR i,j +βG i,j +γB i,j (I)
in the formula (I), gr i,j Is the gray value of the pixel point (i, j) in the gray image, R i,j For the red value, G, of pixel (i, j) in the three primary color label image i,j Is the green value of pixel point (i, j) in the three primary color label image, B i,j For the blue value of the pixel point (i, j) in the trichromatic color label image, alpha, beta and gamma are respectively weighting coefficients for calculating gray values based on the trichromatic colors.
2. The method for processing a color image based on deep learning of a weighted loss function according to claim 1, wherein the value of α is in the range of 0.2 to 0 . The value range of beta is 0.55-0.75, and the value range of gamma is 0.05-0.15.
3. The method for processing a color image for deep learning based on a weighted loss function according to claim 1, wherein values of α, αβ, γ are 0.3, 0.6, 0.1, respectively.
4. The color image processing method based on the deep learning of the weighted loss function according to claim 1, wherein the calculation formula of the gray standard deviation of each pixel point is as follows:
in the formula (II), S i,j The gray standard deviation of the pixel points (i, j) in the gray label image is that k is the number of the pixel points (i, j) which are directly adjacent around the pixel points (i, j),is the gray value of the first immediately adjacent pixel around pixel (i, j), wherein +.>And the gray value of the pixel point (i, j) in the gray label image is represented.
5. The method for color image processing based on deep learning of weighted loss function according to claim 4, wherein k=4 or k=8.
6. The color image processing method based on the deep learning of the weighted loss function according to claim 1, wherein the calculation formula of the error weight of each pixel point is shown as formula (iii):
in the formula (III), w ij Is the error weight of the pixel point (i, j) in the real label image,based on a and s ij And m and n are the numbers of pixel points in two directions of the two-dimensional label image respectively as an exponential function of the variable.
7. The method of color image processing for deep learning based on weighted loss function according to claim 6, wherein the base a has a value ranging from 1 to 5.
8. The method of color image processing for deep learning based on weighted loss function according to claim 6, wherein the value of the base a is 2.5.
9. The color image processing method based on the deep learning of the weighted loss function according to claim 1, wherein the calculation formula of the weighted loss function value is as shown in the formula (IV):
in the formula (IV), loss is a weighted Loss function, f ij For the true classification value of pixel (i, j) in the label image,for the possible probability of prediction as class c at pixel (i, j, ++>Solving the maximum value in the normalized probabilities corresponding to all the classifications c at the pixel point (i, j), wherein arg () is a valued function for obtaining the prediction classification value corresponding to the maximum normalized probability at the pixel point (i, j), e x Is an exponential functionA number.
10. The method for deep learning color image processing based on weighted loss function according to claim 1, wherein the prediction model is a U-Net network.
11. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the weighted-loss-function-based deep-learning color image processing method of any of claims 1-10 when the computer program is executed.
12. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method for color image processing based on weight loss function deep learning of any one of claims 1-10.
13. A color image processing system based on weighted loss function deep learning, comprising:
a weighting loss function calculation module configured to: carrying out graying treatment on the color label image; calculating the gray standard deviation of each pixel point; calculating the error weight of each pixel point; finally, calculating a weighted loss function of the training sample;
training module of prediction model: training a prediction model based on the weighted loss function;
an image processing module: outputting a predicted color image through the trained prediction model;
graying processing is carried out on the color label image, and the graying processing comprises the following steps: according to three RGB values of each pixel point of a color label image in the existing training sample, respectively calculating a gray value corresponding to each pixel point, and converting the color label image into a gray label image;
calculating the gray standard deviation of each pixel point comprises the following steps: traversing all pixel points in each gray label image, and sequentially calculating standard deviation of gray values of each pixel point and k immediately adjacent pixel points around the pixel point; for pixel points on the boundary of the gray label image, calculating the standard deviation of gray values of the pixels which are directly adjacent to the gray label image within the range and not more than k pixels;
calculating the error weight of each pixel point comprises the following steps: calculating the error weight value of each pixel point in the loss function based on the gray standard deviation of each pixel point of the gray label image, and traversing and calculating the error weight values of all the pixel points in the gray label image to obtain an error weight map of the gray label image;
calculating a weighted loss function value for a training sample, comprising: calculating a weighted loss function value representing the integral error of all pixel points between the real label image and the prediction model prediction image based on the error weight value of each pixel point in the error weight map;
training of the predictive model based on the weighted loss function, comprising: based on the weighted loss function, carrying out deep learning training on the existing training sample by adopting the prediction model, continuously optimizing and adjusting the network structure weight parameter of the prediction model until the loss function is not reduced any more, converging to obtain the optimal network structure weight parameter of the prediction model, and obtaining the trained prediction model; drawing a scattered point contrast graph of a real data value of the tag image and a predicted data value of the prediction model, and analyzing the training effect of the prediction model;
outputting the predicted color image by the trained prediction model, comprising: performing brightness and contrast adjustment and Laplace sharpening operation on an input image to be processed; then, the processed image is imported into a trained prediction model, and a predicted color image is output;
the calculation formula of the gray value of each pixel point is shown as formula (I):
Gr i,j =αR i,j +βG i,j +γB i,j (I)
in the formula (I), gr i,j Is the gray value of the pixel point (i, j) in the gray image, R i,j For the red value, G, of pixel (i, j) in the three primary color label image i,j Is of three primary colorsGreen value, B, of pixel (i, j) in color label image i,j For the blue value of the pixel point (i, j) in the trichromatic color label image, alpha, beta and gamma are respectively weighting coefficients for calculating gray values based on the trichromatic colors.
CN202311139655.2A 2023-09-06 2023-09-06 Color image processing method, system, equipment and medium based on weighted loss function Active CN116894884B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311139655.2A CN116894884B (en) 2023-09-06 2023-09-06 Color image processing method, system, equipment and medium based on weighted loss function

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311139655.2A CN116894884B (en) 2023-09-06 2023-09-06 Color image processing method, system, equipment and medium based on weighted loss function

Publications (2)

Publication Number Publication Date
CN116894884A CN116894884A (en) 2023-10-17
CN116894884B true CN116894884B (en) 2023-12-05

Family

ID=88313751

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311139655.2A Active CN116894884B (en) 2023-09-06 2023-09-06 Color image processing method, system, equipment and medium based on weighted loss function

Country Status (1)

Country Link
CN (1) CN116894884B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108492271A (en) * 2018-03-26 2018-09-04 中国电子科技集团公司第三十八研究所 A kind of automated graphics enhancing system and method for fusion multi-scale information
CN109741347A (en) * 2018-12-30 2019-05-10 北京工业大学 A kind of image partition method of the iterative learning based on convolutional neural networks
CN111046962A (en) * 2019-12-16 2020-04-21 中国人民解放军战略支援部队信息工程大学 Sparse attention-based feature visualization method and system for convolutional neural network model
CN112488104A (en) * 2020-11-30 2021-03-12 华为技术有限公司 Depth and confidence estimation system
CN112766379A (en) * 2021-01-21 2021-05-07 中国科学技术大学 Data equalization method based on deep learning multi-weight loss function
CN115063435A (en) * 2022-05-26 2022-09-16 复旦大学附属中山医院 Multi-scale inter-class based tumor and peripheral organ segmentation method
CN115240011A (en) * 2022-08-11 2022-10-25 昂坤视觉(北京)科技有限公司 Image classification method and device, computer readable storage medium and computer equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102184755B1 (en) * 2018-05-31 2020-11-30 서울대학교 산학협력단 Apparatus and Method for Training Super Resolution Deep Neural Network

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108492271A (en) * 2018-03-26 2018-09-04 中国电子科技集团公司第三十八研究所 A kind of automated graphics enhancing system and method for fusion multi-scale information
CN109741347A (en) * 2018-12-30 2019-05-10 北京工业大学 A kind of image partition method of the iterative learning based on convolutional neural networks
CN111046962A (en) * 2019-12-16 2020-04-21 中国人民解放军战略支援部队信息工程大学 Sparse attention-based feature visualization method and system for convolutional neural network model
CN112488104A (en) * 2020-11-30 2021-03-12 华为技术有限公司 Depth and confidence estimation system
CN112766379A (en) * 2021-01-21 2021-05-07 中国科学技术大学 Data equalization method based on deep learning multi-weight loss function
CN115063435A (en) * 2022-05-26 2022-09-16 复旦大学附属中山医院 Multi-scale inter-class based tumor and peripheral organ segmentation method
CN115240011A (en) * 2022-08-11 2022-10-25 昂坤视觉(北京)科技有限公司 Image classification method and device, computer readable storage medium and computer equipment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Compact Substrate-Integrated Waveguide Triplexer Based on a Common Triple-Mode Cavity;kang zhou ET AL;《2018 IEEE/MTT-S International Microwave Symposium - IMS》;全文 *
基于加权损失函数的多尺度对抗网络图像语义分割算法;张宏钊等人;《计算机应用与软件》;全文 *

Also Published As

Publication number Publication date
CN116894884A (en) 2023-10-17

Similar Documents

Publication Publication Date Title
CN111046962A (en) Sparse attention-based feature visualization method and system for convolutional neural network model
CN112241699A (en) Object defect category identification method and device, computer equipment and storage medium
CN111986125A (en) Method for multi-target task instance segmentation
CN110503140B (en) Deep migration learning and neighborhood noise reduction based classification method
WO2022199710A1 (en) Image fusion method and apparatus, computer device, and storage medium
CN111239137B (en) Grain quality detection method based on transfer learning and adaptive deep convolution neural network
CN111476744B (en) Underwater image enhancement method based on classification and atmospheric imaging model
CN116091823A (en) Single-feature anchor-frame-free target detection method based on fast grouping residual error module
CN111047618B (en) Multi-scale-based non-reference screen content image quality evaluation method
CN109949334B (en) Contour detection method based on deep reinforced network residual error connection
CN114882011A (en) Fabric flaw detection method based on improved Scaled-YOLOv4 model
CN114187515A (en) Image segmentation method and image segmentation device
CN116894884B (en) Color image processing method, system, equipment and medium based on weighted loss function
CN116563862A (en) Digital identification method based on convolutional neural network
CN114926420B (en) Target crusty pancake identification and counting method based on cross-level feature enhancement
CN116363461A (en) Depth network incremental learning method for classifying tumor pathological images of multi-view children
CN112991236B (en) Image enhancement method and device based on template
KR20190058753A (en) Image processing method and image processor performing the same
CN107680068A (en) A kind of digital image enhancement method for considering image naturalness
CN113077525A (en) Image classification method based on frequency domain contrast learning
CN110443259B (en) Method for extracting sugarcane from medium-resolution remote sensing image
CN112950655A (en) Land use information automatic extraction method based on deep learning
CN110647898B (en) Image processing method, image processing device, electronic equipment and computer storage medium
CN112541397A (en) Flame detection method based on improved ViBe algorithm and lightweight convolutional network
CN114863095B (en) Answer sheet image segmentation method based on color conversion

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant