An image quality evaluation method and device, electronic equipment and storage medium
By performing various blurring processes on online vehicle damage assessment images to generate blurred label images and training model parameters, the problems of high difficulty in labeling online vehicle damage assessment image quality datasets and low model accuracy are solved, thus achieving efficient image quality evaluation.
Patent Information
- Application Number
- CN202211353686.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-01
- Publication Date
- 2025-12-23
- Estimated Expiration
- 2042-11-01
AI Technical Summary
Existing online vehicle damage assessment image quality datasets suffer from problems such as large workload, low timeliness, and low model accuracy.
By acquiring images of the target quality level and performing various blurring processes, multiple images with blur labels are generated as training samples. The preset model is then trained, and the model parameters are updated using the blur labels and predicted blur levels to generate a target model for image quality evaluation.
It reduces the workload of image annotation, improves the accuracy of model recognition, and enhances the accuracy and efficiency of image quality assessment of vehicle damage areas.
Smart Images

Figure CN116152150B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of online vehicle damage assessment, and in particular relates to an image quality evaluation method and device, an electronic device and a storage medium. BACKGROUND
[0002] With the rapid growth of the number of cars, the volume of vehicle insurance claims is also increasing year by year, and many insurance companies have launched online video insurance claims business. Business staff can guide the car owner to shoot images of damaged parts at different distances and angles through video connection for subsequent claims. However, due to various reasons, the quality of the damage assessment images submitted by the car owner is often uneven, such as unclear focus, backlight, too dark, overexposure, etc., which leads to the inability to proceed with subsequent claims.
[0003] However, there is a common problem with image quality evaluation based on deep networks, which is the need for training sample collection. Current sample collection still requires manual annotation of a large number of images as a data set, which is time-consuming and labor-intensive. SUMMARY
[0004] Therefore, the present application aims to provide an image quality evaluation method to solve the problem of large annotation workload and low timeliness of existing vehicle online damage assessment image quality data sets.
[0005] To achieve the above-mentioned purpose, the technical solution of the present application is as follows:
[0006] First, an image quality evaluation method is provided, comprising:
[0007] obtaining a first image of a target quality level, and performing a plurality of blurring processes on the first image to obtain a plurality of second images corresponding to each blurring process; wherein each second image carries a blur label corresponding to the blurring process; the blur label is used to represent the blur degree of the blurring process;
[0008] using the plurality of second images as training samples to train a preset model to obtain a target model, the target model being used for quality evaluation of an input image;
[0009] wherein, during the training of the preset model, the parameters of the preset model are updated based on the blur label corresponding to the second image and the predicted blur level output by the preset model.
[0010] Further, different types of blurring processes are used to blur the first image in different types, including one or more of Gaussian blur, motion blur, local darkening and local overexposure.
[0011] Further, the first image is subjected to a plurality of blur processing, and the blur processing includes:
[0012] In each of the blur processing, the first image is subjected to different levels of processing respectively corresponding to the blur processing, and the higher the level of processing, the higher the blur degree.
[0013] Further, the first image is subjected to a plurality of blur processing, and the blur processing includes:
[0014] Obtain a plurality of convolution kernels corresponding to the blur processing respectively;
[0015] Based on the plurality of convolution kernels, the first image is processed to obtain a plurality of second images corresponding to each blur processing.
[0016] Further, obtaining a plurality of convolution kernels corresponding to the blur processing respectively includes:
[0017] In obtaining the convolution kernel corresponding to each blur processing, a plurality of sub-convolution kernels corresponding to the convolution kernel are obtained, and different sub-convolution kernels correspond to different blur levels;
[0018] Based on the plurality of convolution kernels, the first image is processed to obtain a plurality of second images corresponding to each blur processing, including:
[0019] In processing the first image based on each of the convolution kernels, a plurality of sub-convolution kernels corresponding to the convolution kernel are used to process the first image, and a plurality of second images corresponding to different blur levels under the same blur processing are obtained.
[0020] Further, the plurality of second images are used as training samples to train a preset model to obtain a target model, including:
[0021] Obtain a pre-trained model pre-trained on a preset image recognition database;
[0022] Change the last layer of the pre-trained model to a fully connected layer and an activation function layer to obtain the preset model;
[0023] The plurality of second images are sent into the preset model for training to obtain the target model.
[0024] Further, the plurality of second images are used as training samples to train a preset model to obtain a target model, including:
[0025] After the preset model performs blur classification on a plurality of second images input in a current batch, the predicted blur level corresponding to each of the second images is output;
[0026] Based on the predicted blur level corresponding to each of the plurality of second images input in the current batch and the blur label corresponding to each of the plurality of second images input in the current batch, an average loss value and a cross-entropy value are obtained; the cross-entropy value is used to represent the gap between the predicted blur level and the blur label, and the average loss value is used to represent the average gap corresponding to the plurality of second images input in the current batch;
[0027] Based on the average loss value and the cross-entropy value, the parameters of the preset model are updated to obtain the target model.
[0028] Compared with the prior art, the in-vehicle makeup assisting method has the following advantages:
[0029] The application obtains a first image of a target quality level, and performs a plurality of blur processing on the first image to obtain a plurality of second images corresponding to each blur processing; wherein each second image carries a blur label corresponding to the blur processing; the plurality of second images are used as training samples to train a preset model to obtain a target model, which is used for quality evaluation of an input image; wherein when the preset model is trained, the parameters of the preset model are updated based on the blur label corresponding to the second image and the predicted blur level output by the preset model. Since a plurality of second images corresponding to the blur label are obtained by performing a plurality of blur processing on the first image to train the preset model as a data set, the number of first images required is small, and the workload of labeling is also small. The parameters of the preset model are continuously updated by the second image and different preset blur levels to obtain optimal model parameters, thereby improving the accuracy of model recognition.
[0030] Another object of the application is to provide a vehicle damage site image quality evaluation device to solve the problems of large data set labeling difficulty and low model precision in the prior art.
[0031] To achieve the above object, the technical scheme of the application is as follows:
[0032] A vehicle damage site image quality evaluation device comprises:
[0033] An acquisition module is configured to acquire a first image of a target level;
[0034] A blur processing module is configured to perform a plurality of blur processing on the first image to obtain a plurality of second images corresponding to each blur processing; wherein each second image carries a blur label corresponding to the blur processing;
[0035] The training module is configured to train a preset model by taking the plurality of second images as training samples to obtain a target model, and the target model is configured to perform quality evaluation on images.
[0036] During the training of the preset model, the parameters of the preset model are updated based on the blur label corresponding to the second image and the predicted blur level output by the preset model.
[0037] The vehicle damage site image quality evaluation device has the same advantages as the vehicle damage site image quality evaluation method, and thus, the description is not repeated here.
[0038] Another object of the present application is to provide an electronic device to solve the problem of large difficulty in labeling vehicle damage image quality data set and low model precision.
[0039] To achieve the above object, the technical solution of the present application is as follows:
[0040] An electronic device comprises a processor, a memory, and a computer program stored in the memory and executable on the processor, and the processor implements the image quality evaluation method when executing the program.
[0041] The electronic device has the same advantages as the vehicle damage site image quality evaluation method, and thus, the description is not repeated here.
[0042] Another object of the present application is to provide a storage medium to solve the problem of large difficulty in labeling vehicle damage image quality data set and low model precision.
[0043] To achieve the above object, the technical solution of the present application is as follows:
[0044] A computer-readable storage medium, characterized in that when the instructions in the storage medium are executed by the processor of an electronic device, the electronic device can execute the image quality evaluation method.
[0045] The storage medium has the same advantages as the vehicle damage site image quality evaluation method, and thus, the description is not repeated here. BRIEF DESCRIPTION OF DRAWINGS
[0046] The accompanying drawings, which form a part of the present application, are intended to provide further understanding of the present application, and the illustrative embodiments of the present application and their description serve the purpose of explaining the present application. The accompanying drawings should not be construed as an inappropriate limitation on the present application. In the drawings:
[0047] Figure 1 A step flowchart of an image quality evaluation method according to an embodiment of the present application is shown.
[0048] Figure 2 A flow chart of a fuzzy processing step of a quality evaluation method of an image according to another embodiment of the present application is shown;
[0049] Figure 3 A flow chart of a step of training a preset model to obtain a target model of a quality evaluation method of an image according to another embodiment of the present application is shown;
[0050] Figure 4 A flow chart of a step of training a preset model to obtain a target model of a quality evaluation method of an image according to another embodiment of the present application is shown;
[0051] Figure 5 A flow chart of a model training of a quality evaluation method of an image according to another embodiment of the present application is shown;
[0052] Figure 6 A flow chart of a quality evaluation of an image according to another embodiment of the present application is shown;
[0053] Figure 7 A quality evaluation device of an image according to the second embodiment of the present application is shown. DETAILED DESCRIPTION
[0054] It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.
[0055] The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0056] Embodiment one
[0057] Reference Figure 1 , Figure 1 A flow chart of a quality evaluation method of an image according to the first embodiment of the present application is shown, wherein the method can be executed by an electronic device, which can be a computer, a server, or the like intelligent device, and the quality evaluation method of the image can be applied to vehicle online loss assessment, such as Figure 1 as shown, comprising:
[0058] Step 101: obtaining a first image of a target quality level, and performing a plurality of fuzzy processing on the first image to obtain a plurality of second images corresponding to each fuzzy processing; wherein each second image carries a fuzzy label corresponding to the fuzzy processing; the fuzzy label is used to represent the fuzzy degree of the fuzzy processing.
[0059] Step 102: taking a plurality of second images as training samples, training a preset model to obtain a target model, and the target model is used for quality evaluation of an input image.
[0060] In a specific implementation, when training the preset model, parameters of the preset model are updated based on the blur label corresponding to the second image and a predicted blur level output by the preset model.
[0061] When a vehicle is involved in a collision or scratch requiring insurance compensation, the insurance company needs to determine the damage degree first, which is called loss assessment, and the compensation amount is determined according to the loss assessment result. In recent years, online loss assessment has gradually matured. Online loss assessment relies on the vehicle owner to independently shoot images of the damaged parts, and an algorithm determines the damage degree according to the shot images.
[0062] In the embodiment of the present application, the image quality evaluation method is used to evaluate the quality of the images of the damaged parts of the vehicle independently shot by the user, and can be executed by an electronic device such as a computer, a server, etc., which is not limited herein, and will be described in detail below taking the server as an example:
[0063] First, the server obtains a first image of a target quality level as an original data set, and the number of first images can be small. After the first image is labeled by a labeling personnel, the server performs a plurality of preset blur processing on the first image, each blur processing can obtain a plurality of corresponding second images, and the target model for evaluating the quality of the images of the damaged parts of the vehicle is obtained by training the preset model using the second images as training samples.
[0064] The blur processing refers to low-quality image generation method to low-quality the first image, and the low-quality image generation method can be, for example, Gaussian blur, motion blur, etc., and can also be other filtering methods or noise adding methods, which are not limited herein.
[0065] In the embodiment of the present application, the first image of the target quality level is obtained, and a plurality of blur processing is performed on the first image to obtain a plurality of second images corresponding to each blur processing. Each second image carries a blur label corresponding to the blur processing. The plurality of second images are used as training samples to train a preset model to obtain a target model for quality evaluation of an input image. When training the preset model, the parameters of the preset model are updated based on the blur label corresponding to the second image and the predicted blur level output by the preset model. Since the first image is subjected to a plurality of blur processing to obtain a plurality of second images corresponding to the blur label as a data set to train the preset model, the number of first images required is small, and the amount of labeling work is also small. The parameters of the preset model are constantly updated by the second image and different preset blur levels to obtain optimal model parameters, and the accuracy of model recognition is improved.
[0066] In an optional embodiment, in each blur processing, different levels of blur processing are further included for the first image, and the higher the level of blur processing, the higher the blur degree. The blur levels are described below:
[0067] Each blur processing is preset with different blur levels, and when the first image is subjected to blur processing, different levels of blur processing are performed to obtain multiple second images with different blur degrees. For example, the Gaussian blur processing is preset with three blur levels, i.e., level 1, level 2, and level 3, corresponding to sequentially increasing blur intensities. After the Gaussian blur processing is performed on the first image, the obtained second images include a second image with blur level 1, a second image with blur level 2, and a second image with blur level 3, corresponding to sequentially increasing blur intensities, which indicates that the corresponding image blur degrees are sequentially increased. The second image with level 2 is more blurred than the second image with level 1, and the second image with level 3 is more blurred than the second image with level 2.
[0068] Based on the fact that the second image carries a blur label corresponding to the blur processing, the second image is sent as a training sample to a preset model for training. The preset model outputs a result and also outputs a predicted blur level corresponding to each second image. After back propagation, the parameters of the preset model are updated.
[0069] In the embodiment of the present application, different levels of blur processing are performed on the first image, and the higher the level of blur processing, the higher the blur degree. Because different levels of blur processing are performed on the first image, a considerable number of second images that meet different requirements can be obtained for training of the target model, so that the number of first images required can be small, and the workload of annotation is small.
[0070] Referring to Figure 2 , Figure 2 A flowchart of a blur processing step of a vehicle damage site image quality evaluation method according to another embodiment of the present application is shown in FIG. 6, which includes the following steps. Figure 2
[0071] Step 201: Obtain multiple convolution kernels corresponding to the respective blur processing.
[0072] Step 202: Obtain multiple second images corresponding to each blur processing based on the multiple convolution kernels and the first image.
[0073] When the first image is subjected to blur processing, the server first obtains the convolution kernel corresponding to the blur processing to be performed, and performs blur processing on the first image through the obtained convolution kernel. Each blur processing can obtain multiple second images, and the number of obtained second images is determined according to requirements and is not limited herein.
[0074] For example, in the case of Gaussian blur on the first image, the server obtains the Gaussian blur corresponding Gaussian blur kernel, and performs Gaussian blur processing on the first image based on the Gaussian blur kernel to obtain a plurality of Gaussian blurred second images.
[0075] The embodiment of the application obtains a plurality of convolution kernels corresponding to each of the blur processing; and obtains a plurality of second images corresponding to each of the blur processing based on the plurality of convolution kernels and the first image. Since the first image is subjected to a plurality of blur processing, a considerable number of second images meeting different requirements can be obtained for training of the target model, so that the number of first image requirements can be small, greatly reducing the workload of labeling and improving the accuracy of labeling.
[0076] In an optional embodiment, the different types of blur processing include Gaussian blur, motion blur, local overexposure, and local overexposure. The plurality of blur processing is described one by one as follows:
[0077] First, Gaussian blur. Gaussian blur is a kind of image distortion often encountered in damage images, mainly occurring in the case of shooting too far, shooting too close, or shooting images when the lens is not successfully focused. In the Gaussian blur processing of the first image, a plurality of sub-kernels corresponding to the Gaussian blur kernel are obtained, and the sub-kernels correspond to different blur levels. Specifically, the Gaussian blur kernel formula is
[0078]
[0079] Wherein, G(x,y) represents the Gaussian blur kernel, x represents the horizontal coordinate of the Gaussian blur kernel, y represents the vertical coordinate of the Gaussian blur kernel, and σ represents the blur intensity. For example, the plurality of Gaussian blur sub-kernels σ take values 3, 7, and 9 respectively.
[0080] Second, motion blur. Motion blur is also a kind of image distortion commonly encountered in damage images, mainly occurring in the case of shooting images when the lens is not stable. In the motion blur processing of the first image, a plurality of sub-kernels corresponding to the motion blur kernel are obtained, and the sub-kernels correspond to different blur levels. Specifically, the motion blur kernel formula is
[0081]
[0082] Wherein, G(x,y) represents the motion blur kernel, x represents the horizontal coordinate of the motion blur kernel, y represents the vertical coordinate of the motion blur kernel, and d represents the blur intensity. For example, the plurality of motion blur sub-kernels d take values 3, 7, and 9 respectively.
[0083] Third: local overdark. The dark part of the image cannot clearly present the image texture, mainly appearing in the loss assessment image of dark vehicles. In the local overdark processing of the first image, a plurality of sub-convolution kernels corresponding to the local overdark convolution kernel are obtained, and the sub-convolution kernels correspond to different blur levels. Specifically, the local overdark convolution kernel formula is
[0084]
[0085] Wherein, G(x, y) represents the local overdark convolution kernel, f(x, y) represents the pixel value of the first image at the horizontal coordinate x and the vertical coordinate y, and alpha represents the blur intensity. For example, the plurality of local overdark sub-convolution kernels alpha take values 0.9, 0.7, 0.5 respectively.
[0086] Fourth: local overexposure. The bright part of the image cannot clearly present the image texture, mainly appearing in the loss assessment image of light-colored vehicles. In the local overexposure processing of the first image, a plurality of sub-convolution kernels corresponding to the local overexposure convolution kernel are obtained, and the sub-convolution kernels correspond to different blur levels. Specifically, the local overexposure convolution kernel formula is
[0087]
[0088] Wherein, G(x, y) represents the local overexposure convolution kernel, f(x, y) represents the pixel value of the first image at the horizontal coordinate x and the vertical coordinate y, and alpha represents the blur intensity. For example, the plurality of local overexposure sub-convolution kernels alpha take values 1.2, 1.4, 1.6 respectively.
[0089] The embodiment of the application obtains a plurality of convolution kernels corresponding to each of the plurality of blur processes; and obtains a plurality of second images corresponding to each of the plurality of blur processes based on the plurality of convolution kernels and the first image. The training data can be infinitely expanded by controlling the blur processing parameters, so that the number of required first images can be small, thereby greatly reducing the workload of labeling and improving the accuracy of labeling.
[0090] In an optional embodiment, obtaining a plurality of convolution kernels corresponding to each of the plurality of blur processes comprises: obtaining a plurality of sub-convolution kernels corresponding to each of the plurality of convolution kernels, wherein different sub-convolution kernels correspond to different blur levels.
[0091] Processing the first image based on the plurality of convolution kernels to obtain a plurality of second images corresponding to each of the plurality of blur processes comprises: processing the first image by using a plurality of sub-convolution kernels corresponding to each of the plurality of convolution kernels to obtain a plurality of second images corresponding to different blur levels under the same blur process.
[0092] In the embodiment of the present application, when different types and different levels of blur processing are performed on the first image, the server can obtain a plurality of sub-convolution kernels corresponding to each type of convolution kernel when obtaining the convolution kernel corresponding to each type of blur processing, and perform blur processing on the first image based on the plurality of sub-convolution kernels to obtain a plurality of second images with different blur levels under each type of blur processing.
[0093] The following is described in detail with an example:
[0094] For example, in the case of Gaussian blur processing on the first image, the server obtains a plurality of Gaussian blur sub-convolutions corresponding to the Gaussian blur convolution kernel corresponding to the Gaussian blur processing when obtaining the Gaussian blur convolution kernel, and each sub-convolution kernel corresponds to a different blur level. The number of sub-convolution kernels is not limited. For example, sub-convolution kernel 1 corresponds to blur level 1, sub-convolution kernel 2 corresponds to blur level 2, and sub-convolution kernel 3 corresponds to blur level 3. Blur level 1, blur level 2, and blur level 3 are not equal.
[0095] After the server obtains the plurality of sub-convolution kernels, it performs blur processing on the first image based on each sub-convolution kernel. After processing the first image based on the Gaussian blur sub-convolution kernel 1, a second image with Gaussian blur level 1 is obtained. After processing the first image based on the Gaussian blur sub-convolution kernel 2, a second image with Gaussian blur level 2 is obtained. After processing the first image based on the Gaussian blur sub-convolution kernel 3, a second image with Gaussian blur level 3 is obtained. The number of second images is determined by the requirement and is not limited.
[0096] The embodiment of the present application obtains a plurality of convolution kernels corresponding to each type of blur processing, including: obtaining a plurality of sub-convolution kernels corresponding to each type of convolution kernel when obtaining the convolution kernel corresponding to each type of blur processing, different sub-convolution kernels corresponding to different blur levels; processing the first image based on a plurality of convolution kernels to obtain a plurality of second images corresponding to each type of blur processing, including: when processing the first image based on each convolution kernel, processing the first image using a plurality of sub-convolution kernels corresponding to the convolution kernel to obtain a plurality of second images corresponding to different blur levels under the same type of blur processing. By performing blur processing on the first image based on different sub-convolution kernels of each type of blur processing, a plurality of second images with different blur levels under the same type of blur processing are obtained, which can obtain infinitely amplified training data, so that the number of required first images can be small, greatly reducing the workload of labeling and improving the accuracy of labeling.
[0097] Reference Figure 3 , Figure 3 The present application shows another embodiment of a quality evaluation method of an image. The flow chart of the step of training a preset model to obtain a target model is shown in FIG. 2. Figure 3As shown in the figure, comprising:
[0098] Step 301: obtaining a pre-trained model pre-trained on an image recognition database;
[0099] Step 302: changing the last layer of the pre-trained model into a full connection layer and an activation function layer to obtain the preset model;
[0100] Step 303: sending multiple second images into the preset model for training to obtain the target model.
[0101] In the embodiment of the application, the preset model is obtained by changing a pre-trained model pre-trained on an image recognition database ImageNet. For example, the pre-trained model can be a ResNet, MobileNet, EfficientNet network model, or an AlexNet series, VGG series, SqueezeNet series, DenseNet series, Inception series network model.
[0102] After obtaining any of the above pre-trained models, the last layer of the pre-trained model is changed into a full connection layer and an activation function softmax layer to obtain a preset model. Multiple second images are sent into the preset model as training samples to obtain a target model.
[0103] The embodiment of the application obtains a pre-trained model pre-trained on an image recognition database; changes the last layer of the pre-trained model into a full connection layer and an activation function layer to obtain the preset model; and sends multiple second images into the preset model for training to obtain the target model. Since the preset model is obtained by changing the last layer of the pre-trained model pre-trained on the image recognition database ImageNet into a full connection layer and an activation function softmax layer, the model output adopts a discrete distribution, rather than a single classification or regression, which improves the generalization of the model, and the end-to-end model design is more convenient for training and deployment, and improves the precision of the actual application of the model.
[0104] Referring to Figure 4 , Figure 4 A step flow chart of training a target model from a preset model in a quality evaluation method of an image according to another embodiment of the application is shown in FIG. 4. Figure 4 As shown in the figure, comprising:
[0105] Step 401: obtaining a predicted fuzzy level corresponding to each second image output by the preset model after fuzzy classification of multiple second images input by the preset model in a current batch;
[0106] Step 402: Based on the predicted blur level corresponding to each of the multiple second images input in the current batch, and the blur label corresponding to each of the multiple second images input in the current batch, obtain the average loss value and the cross-entropy value; the cross-entropy value is used to characterize the difference between the predicted blur level and the blur label, and the average loss value is used to characterize the average difference between the multiple second images input in the current batch.
[0107] Step 403: Based on the average loss value and the cross-entropy value, update the parameters of the preset model to obtain the target model.
[0108] The following is a detailed explanation of the steps involved in training a pre-defined model to obtain the target model:
[0109] First, multiple second images from the current batch are input into a preset model. After the preset model obtains the input second images, it performs fuzzy classification on the second images in the batch to distinguish which second images belong to which type of fuzzing. For example, the first to 300 second images belong to Gaussian blur, and the 301st to 600th images belong to motion blur. The second images in the same batch can contain one or more types of fuzzed images at the same time, which is not limited here.
[0110] Next, multiple discrete values are output using the formula of the preset model:
[0111]
[0112] Where μ represents the average of the plurality of discrete values, σ represents the variance of the plurality of discrete values, the plurality of discrete values follow a Gaussian distribution, and x represents the output value.
[0113] Based on the predicted blur level and blur label corresponding to each of the multiple second images input in the current batch, the average loss value and cross-entropy value are obtained; the cross-entropy value is used to characterize the difference between the predicted blur level and the blur label, and the average loss value is used to characterize the average difference between the multiple second images input in the current batch.
[0114] Then, through backpropagation, the calculation is iterated until the loss no longer decreases, and the optimal solution of the model is obtained.
[0115] The following is a specific example for illustration. Figure 5 , Figure 5 This diagram illustrates a model training flowchart for a vehicle damage area image quality assessment method according to another embodiment of the present invention, as shown below. Figure 5 As shown, it includes:
[0116] Given three Gaussian blurred second images with different blur levels as input training samples, the preset model yields three sets of output representations. wherein μ represents the average value of the output, σ represents the variance of the output, and x represents the output value.
[0117] The three sets of outputs satisfy the following loss function:
[0118] L = αL r + βL kl
[0119] L r = max(0, μ3- μ1+ ε) + max(0, μ2- μ1+ ε)
[0120]
[0121] wherein L r is the average value loss function, L kl is the cross-entropy loss function, α and β are hyperparameters, which can be set to 0.5, 0.5 in this example. ε represents a constant parameter greater than 0. i represents the serial number of the multiple discrete output values, and x 1i represents the i-th value output by the model after the first image is input, and x 2i represents the i-th value output by the model after the second image is input, and x 3i represents the i-th value output by the model after the third image is input.
[0122] When μ1> μ2> μ3, L r is zero, otherwise, L r is greater than zero.
[0123] Then, through back propagation, the optimal solution of the current model is obtained by iterative calculation until L no longer decreases.
[0124] In the embodiment of the application, the predicted blur levels of each second image output by the preset model after fuzzy classification of the multiple second images input in the current batch are obtained; the average loss value and the cross-entropy value are obtained based on the predicted blur levels corresponding to the multiple second images input in the current batch respectively and the blur labels corresponding to the multiple second images input in the current batch respectively; the cross-entropy value is used to represent the gap between the predicted blur levels and the blur labels, and the average loss value is used to represent the average gap corresponding to the multiple second images input in the current batch; the parameters of the preset model are updated based on the average loss value and the cross-entropy value, and the target model is obtained. Since the parameters of the preset model are updated based on the blur labels and the blur levels of the second images, the model has the evaluation ability for different types of distorted images and different degrees of distorted images, and the precision and the generality of the model for quality evaluation are improved.
[0125] Referring to Figure 6 , Figure 6 A flow chart of an image quality evaluation method of an image is shown in FIG. 1, which shows another embodiment of the present application, and includes the following steps: Figure 6
[0126] After the user takes an image of a damaged part of a vehicle, the server uploads the taken image to the cloud for image quality evaluation to determine whether the taken image is qualified in quality, and only the image qualified in quality can be used for subsequent online damage assessment business.
[0127] If the taken image is qualified in quality, the flow ends.
[0128] If the taken image is not qualified in quality, the user is returned a result of disqualification and prompted to take the image again.
[0129] The embodiment of the present application greatly improves the progress and efficiency of damage assessment and claim by using the image qualified in evaluation for subsequent online damage assessment, returning the image not qualified in evaluation to the user and prompting the user to take the image again.
[0130] Embodiment two
[0131] Referring to Figure 7 , Figure 7 A device for evaluating the quality of an image is shown in FIG. 2, which shows the second embodiment of the present application, and includes the following steps: Figure 7
[0132] The acquisition module 701 is configured to acquire a first image of a target level.
[0133] The blur processing module 702 is configured to perform a plurality of blur processing on the first image to obtain a plurality of second images corresponding to each blur processing, and each second image carries a blur label corresponding to the blur processing.
[0134] The training module 703 is configured to use the plurality of second images as training samples to train a preset model to obtain a target model, and the target model is used for quality evaluation of an image.
[0135] Optionally, the blur processing module 702 includes:
[0136] The first blur processing module is configured to perform different types of blur on the first image, and the different types of blur include one or more of Gaussian blur, motion blur, local overdarkening and local overexposure.
[0137] Optionally, the blur processing module 702 further includes:
[0138] The second blur processing module is configured to perform different levels of processing on the first image respectively by using the blur processing, and the higher the level of processing, the higher the blur degree.
[0139] Optionally, the blur processing module 702 further includes:
[0140] The first obtaining module is configured to obtain a plurality of convolution kernels corresponding to the blur processing respectively.
[0141] The third blur processing module is configured to perform processing on the first image based on the plurality of convolution kernels to obtain a plurality of second images corresponding to each blur processing.
[0142] Optionally, the first obtaining module includes:
[0143] The first obtaining submodule is configured to obtain a plurality of sub-convolution kernels corresponding to the convolution kernel when obtaining the convolution kernel corresponding to each blur processing, and different sub-convolution kernels correspond to different blur levels.
[0144] Optionally, the third blur processing module includes:
[0145] The third blur processing submodule is configured to perform processing on the first image by using a plurality of sub-convolution kernels corresponding to each convolution kernel when performing processing on the first image based on the convolution kernel, to obtain a plurality of second images corresponding to different blur levels under the same blur processing.
[0146] Optionally, the training module 703 includes:
[0147] The second obtaining module is configured to obtain a pre-training model pre-trained on a preset image recognition database.
[0148] The model changing module is configured to change the last layer of the pre-training model into a fully connected layer and an activation function layer to obtain the preset model.
[0149] The training submodule is configured to input the plurality of second images into the preset model for training to obtain the target model.
[0150] Optionally, the training module 703 further includes:
[0151] The third obtaining module is configured to obtain a predicted blur level corresponding to each second image output by the preset model after the preset model performs blur classification on a plurality of second images input in a current batch.
[0152] The fourth acquisition module is configured to acquire an average loss value and a cross-entropy value based on the predicted blur levels corresponding to the plurality of second images in the current batch and the blur labels corresponding to the plurality of second images in the current batch; the cross-entropy value is used to represent the gap between the predicted blur levels and the blur labels, and the average loss value is used to represent the average gap corresponding to the plurality of second images in the current batch.
[0153] The parameter updating module is configured to update the parameters of the preset model based on the average loss value and the cross-entropy value to obtain the target model.
[0154] Based on the same inventive concept, the embodiment of the present application also provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the image quality evaluation method of any one of the above-mentioned embodiments when executing the program.
[0155] Based on the same inventive concept, the embodiment of the present application also provides a computer-readable storage medium, comprising: when the instructions in the storage medium are executed by the processor of an electronic device, the electronic device can execute the image quality evaluation method of any one of the above-mentioned embodiments.
[0156] The above is only the preferred embodiment of the present application, and is not used to limit the present application, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.
[0157] For the method embodiments, in order to simply describe, they are all expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited to the action sequence described, because according to the present application, certain steps can be performed in other sequences or at the same time. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions and components involved are not necessarily necessary for the present application.
[0158] The above provides a detailed description of the image quality evaluation method, device, electronic device and storage medium provided by the present application. The principle and implementation mode of the present application are described by applying specific examples in this paper. The above embodiment description is only used to help understand the method and core idea of the present application; at the same time, for those skilled in the art, according to the idea of the present application, the specific implementation mode and application range will be changed; in conclusion, the content of the specification should not be understood as a limitation of the present application.
Claims
1. A method of quality evaluation of an image, characterized by, A method for evaluating the quality of an image of a vehicle damage site autonomously photographed by a user, the method comprising: obtaining a first image of a target quality level, the first image being an image passed by image quality evaluation in the cloud, the image being obtained based on user uploading, and performing a plurality of blur processes on the first image to obtain a plurality of second images corresponding to each blur process; wherein each of the second images carries a blur label corresponding to the blur process; the blur label is used to represent the blur degree of the blur process; different types of blur processes are used to blur the first image in different types, and the different types of blur include one or more of Gaussian blur, motion blur, local overdarkness and local overexposure; training a preset model using the plurality of second images as training samples to obtain a target model, the target model being used for quality evaluation of images; wherein, during the training of the preset model, the parameters of the preset model are updated based on the blur label corresponding to the second image and the predicted blur level output by the preset model; the training of the preset model using the plurality of second images as training samples to obtain a target model, comprising: obtaining a pre-trained model pre-trained on a preset image recognition database; changing the last layer of the pre-trained model into a fully connected layer and an activation function layer to obtain the preset model; sending the plurality of second images into the preset model for training to obtain the target model.
2. The method of claim 1, wherein, The plurality of blur processes performed on the first image further comprise: when performing each of the blur processes, the first image is processed in different levels by using the blur process, and the higher the level, the higher the blur degree.
3. The method of claim 1, wherein, The plurality of blur processes performed on the first image to obtain a plurality of second images corresponding to each blur process comprise: obtaining a plurality of convolution kernels corresponding to each of the blur processes; processing the first image based on the plurality of convolution kernels to obtain a plurality of second images corresponding to each blur process.
4. The method of claim 3, wherein, Obtaining a plurality of convolution kernels corresponding to each of the blur processes comprises: when obtaining the convolution kernel corresponding to each blur process, a plurality of sub-convolution kernels corresponding to the convolution kernel are obtained, and different sub-convolution kernels correspond to different blur levels; processing the first image based on the plurality of convolution kernels to obtain a plurality of second images corresponding to each blur process comprises: when processing the first image based on each of the convolution kernels, the first image is processed by using a plurality of sub-convolution kernels corresponding to the convolution kernel to obtain a plurality of second images corresponding to different blur levels under the same blur process.
5. The method of claim 1, wherein, The training of the preset model using the plurality of second images as training samples to obtain a target model comprises: obtaining the predicted blur level corresponding to each second image output by the preset model after the preset model performs blur classification on a plurality of second images input in a current batch; The average loss value and the cross-entropy value are obtained based on the predicted blur levels corresponding to the plurality of second images input in the current batch and the blur labels corresponding to the plurality of second images input in the current batch; the cross-entropy value is used to represent the gap between the predicted blur levels and the blur labels, and the average loss value is used to represent the average gap corresponding to the plurality of second images input in the current batch; The parameters of the preset model are updated based on the average loss value and the cross-entropy value, to obtain the target model.
6. An image quality evaluation device characterized by comprising: The device for evaluating the quality of images of vehicle damage parts autonomously photographed by a user comprises: An acquisition module is configured to acquire a first image of a target level, the first image being an image that passes image quality evaluation by a cloud, and the image being obtained based on user uploading; A blur processing module is configured to perform a plurality of blur processes on the first image to obtain a plurality of second images corresponding to each blur process; each second image carries a blur label corresponding to the blur process; A training module is configured to use the plurality of second images as training samples to train a preset model to obtain a target model, the target model being used for image quality evaluation; During the training of the preset model, the parameters of the preset model are updated based on the blur labels corresponding to the second images and predicted blur levels output by the preset model; The blur processing module comprises: A first blur processing module is configured to perform different types of blur on the first image, the different types of blur including one or more of Gaussian blur, motion blur, local overdarkening, and local overexposure; The training module comprises: A second acquisition module is configured to acquire a pre-trained model pre-trained on a preset image recognition database; A model changing module is configured to change the last layer of the pre-trained model into a fully connected layer and an activation function layer to obtain the preset model; A training submodule is configured to input the plurality of second images into the preset model for training to obtain the target model.
7. An electronic device, comprising: The electronic device comprises: A processor, a memory, and a computer program stored on the memory and executable on the processor, the processor implementing the image quality evaluation method of any one of claims 1 to 5 when executing the program.
8. A computer-readable storage medium, characterized in that, When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device can execute the image quality evaluation method of any one of claims 1 to 5.
Citation Information
Patent Citations
Image processing model training method and device, electronic equipment and storage medium
CN113139942A