Coder-decoder training method, device and equipment based on machine vision model

Through the codec training method based on the machine vision model, the matching degree of the codec and the machine vision model is improved through weighted training, which solves the problem of low image accuracy in intelligent tasks in the existing technology and achieves higher accuracy. Mission accuracy.

CN118828010APending Publication Date: 2024-10-22CHINA TELECOM CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310431267.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-04-20
Publication Date
2024-10-22

AI Technical Summary

Technical Problem

Existing video/image compression and coding technology cannot meet the application requirements for high accuracy, low latency and abstract semantics of machine vision for intelligent analysis tasks, resulting in poor performance of encoded and decoded images when performing intelligent tasks.

Method used

The codec training method based on the machine vision model is used to perform weighted training through the features output by the machine vision model and the mean square error loss of the codec to improve the matching between the codec and the machine vision model, thereby improving the image quality. Accuracy in intelligent tasks.

Benefits of technology

Through joint training, the accuracy of the output of the codec in performing intelligent tasks in the machine vision model is improved, and the performance of the image in intelligent tasks is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118828010A_ABST
    Figure CN118828010A_ABST
Patent Text Reader

Abstract

The invention provides a coder-decoder training method, device and equipment based on a machine vision model, and relates to the technical field of computers, and the method specifically comprises the steps: obtaining the mean square error loss of machine vision model features through the machine vision model features outputted by the machine vision model, and obtaining the mean square error loss of the machine vision model features through the original mean square error loss of the coder-decoder. And training the coder-decoder according to the weighted sum of the mean square error loss of the machine vision model features. According to the method, the machine vision model features are utilized to carry out joint training on the coder and the decoder, and back propagation is carried out on the training process of the coder and the decoder, so that the matching degree between the coder and the decoder and the machine vision model can be improved, and the precision of the output of the trained coder and the decoder when an intelligent task is executed in the machine vision model is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] Traditional video / image compression coding is oriented towards human vision and is mostly used for entertainment purposes. It focuses on signal fidelity and high frame rate, and cannot match the application requirements of machine vision for intelligent analysis tasks, such as high accuracy, low latency, and abstract semantics. Video / image compression coding oriented towards human vision and machine vision differ greatly in application scenarios, evaluation mechanisms, information processing, and information use.

[0003] In July 2019, the Video Coding for Machines (VCM) standard group was established during the 128th MPEG meeting in Gothenburg, Sweden, aiming to study compression coding technology suitable for machine vision and human-machine hybrid vision scenarios with intelligent applications as the goal. Figure 1 shown.

[0004] Before images / videos are used to perform intelligent tasks, they need to be compressed and decompressed in order to reduce the amount of data transmission. Related technologies only focus on the compression ratio and the difference between the compressed image and the original image. After some images pass through the codec (Codec), the effect of using them for machine vision models to perform intelligent tasks is not good.

[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0006] The present disclosure provides a codec training method, device and equipment based on a machine vision model, which can at least improve the accuracy of encoded and decoded images when performing intelligent tasks.

[0007] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.

[0008] In a first aspect, an embodiment of the present disclosure provides a codec training method based on a machine vision model, the method comprising:

[0009] Obtaining a mean square error loss of the machine vision model feature through the machine vision model feature output by the machine vision model;

[0010] The encoder-decoder is trained by a weighted sum of the original mean square error loss of the encoder-decoder and the mean square error loss of the machine vision model features.

[0011] In a possible embodiment, obtaining the mean square error loss of the machine vision model feature through the machine vision model feature output by the machine vision model includes:

[0012] Processing the image training set of the codec through the machine vision model to obtain machine vision model features corresponding to the image training set;

[0013] Processing the feature vector output by the encoder / decoder through the machine vision model to obtain the machine vision model feature corresponding to the feature vector;

[0014] The mean square error loss between the machine vision model features corresponding to the image training set and the machine vision model features corresponding to the feature vector is used as the mean square error loss of the machine vision model features.

[0015] In a possible embodiment, the machine vision model includes a backbone network; the machine vision model features are shallow features output by the backbone network;

[0016] The method of obtaining a mean square error loss of the machine vision model feature by using the machine vision model feature output by the machine vision model further includes:

[0017] The method of obtaining a mean square error loss of the machine vision model feature by using the machine vision model feature output by the machine vision model further includes:

[0018] Processing the image training set of the encoder and decoder through the backbone network of the machine vision model to obtain shallow features corresponding to the image training set;

[0019] Processing the feature vector output by the encoder / decoder through the backbone network of the machine vision model to obtain shallow features corresponding to the feature vector;

[0020] The mean square error loss between the shallow features corresponding to the image training set and the shallow features corresponding to the feature vector is used as the mean square error loss of the machine vision model features.

[0021] In a possible embodiment, the codec includes an encoder and a decoder connected in sequence; wherein the encoder is used to encode the original image of the training sample in the image training set to obtain a compressed code stream file; and the decoder is used to decode the compressed code stream file output by the encoder to obtain a feature vector;

[0022] The training of the encoder-decoder by a weighted sum of an original mean square error loss of the encoder-decoder and a mean square error loss of the machine vision model feature comprises:

[0023] Determining the original mean square error loss by using the image training set and the feature vector;

[0024] Determining the pixel depth loss of the encoder through the image training set and the compressed bitstream file;

[0025] The encoder-decoder is trained by taking a weighted sum of the pixel depth loss, the original mean square error loss and the mean square error loss of the machine vision model feature as the joint loss.

[0026] In a possible embodiment, taking the weighted sum of the pixel depth loss, the original mean square error loss and the mean square error loss of the machine vision model feature as a joint loss to train the encoder-decoder includes:

[0027] Determining a weighted sum of the original mean square error loss and the mean square error loss of the machine vision model feature according to a mean square error loss weighting parameter;

[0028] Determine, according to a pixel depth loss weighting parameter, a weighted sum of the pixel depth loss and a weighted sum of the original mean square error loss and the mean square error loss of the machine vision model feature;

[0029] The encoder-decoder is trained by taking the weighted sum of the pixel depth loss and the weighted sum of the original mean square error loss and the mean square error loss of the machine vision model feature as the joint loss.

[0030] In a possible embodiment, the method further includes:

[0031] If there are multiple mean square error losses of the machine vision model features, a weighted sum of the original mean square error loss and the mean square error losses of the multiple machine vision model features is determined by using multiple mean square error loss weighting parameters;

[0032] Determine, according to a pixel depth loss weighting parameter, a weighted sum of the pixel depth loss and a weighted sum of the original mean square error loss and mean square error losses of multiple machine vision model features;

[0033] The encoder-decoder is trained by taking a weighted sum of the pixel depth loss and a weighted sum of the original mean square error loss and the mean square error losses of multiple machine vision model features as a joint loss.

[0034] In a possible embodiment, the training of the encoder / decoder includes:

[0035] If the joint loss does not meet the preset loss value, the network parameters of the convolutional layer in the encoder and the network parameters of the convolutional layer in the decoder in the encoder and decoder are adjusted until the joint loss meets the preset loss value, thereby obtaining a trained encoder and decoder.

[0036] In a second aspect, an embodiment of the present disclosure provides a codec training device based on a machine vision model, comprising:

[0037] A determination unit, configured to obtain a mean square error loss of the machine vision model feature through the machine vision model feature output by the machine vision model;

[0038] A training unit is used to train the codec by using the weighted sum of the original mean square error loss of the codec and the mean square error loss of the machine vision model feature.

[0039] In a possible embodiment, the determining unit is further configured to:

[0040] The image training set of the encoder and decoder is processed through the machine vision model to obtain the machine vision model features corresponding to the image training set; the feature vector output by the encoder and decoder is processed through the machine vision model to obtain the machine vision model features corresponding to the feature vector; the mean square error loss between the machine vision model features corresponding to the image training set and the machine vision model features corresponding to the feature vector is used as the mean square error loss of the machine vision model features.

[0041] In a possible embodiment, the machine vision model includes a backbone network; the machine vision model features are shallow features output by the backbone network;

[0042] The determination unit is also used to: process the image training set of the encoder and decoder through the backbone network of the machine vision model to obtain shallow features corresponding to the image training set; process the feature vector output by the encoder and decoder through the backbone network of the machine vision model to obtain shallow features corresponding to the feature vector; and use the mean square error loss between the shallow features corresponding to the image training set and the shallow features corresponding to the feature vector as the mean square error loss of the machine vision model features.

[0043] In a possible embodiment, the codec includes an encoder and a decoder connected in sequence; wherein the encoder is used to encode the original image of the training sample in the image training set to obtain a compressed code stream file; and the decoder is used to decode the compressed code stream file output by the encoder to obtain a feature vector;

[0044] The training unit is also used to: determine the original mean square error loss through the image training set and the feature vector; determine the pixel depth loss of the encoder through the image training set and the compressed code stream file; and use the weighted sum of the pixel depth loss, the original mean square error loss and the mean square error loss of the machine vision model feature as a joint loss to train the encoder and decoder.

[0045] In a possible embodiment, the training unit is further used for:

[0046] According to the mean square error loss weighting parameter, determine the weighted sum of the original mean square error loss and the mean square error loss of the machine vision model feature; according to the pixel depth loss weighting parameter, determine the weighted sum between the pixel depth loss and the weighted sum of the original mean square error loss and the mean square error loss of the machine vision model feature; use the weighted sum between the pixel depth loss and the weighted sum of the original mean square error loss and the mean square error loss of the machine vision model feature as the joint loss to train the encoder and decoder.

[0047] In a possible embodiment, the training unit is further used for:

[0048] If there are multiple mean square error losses for machine vision model features, the weighted sum of the original mean square error loss and the mean square error losses of the multiple machine vision model features is determined by using multiple mean square error loss weighting parameters; according to the pixel depth loss weighting parameter, the weighted sum between the pixel depth loss and the weighted sum of the original mean square error loss and the mean square error losses of the multiple machine vision model features is determined; the weighted sum between the pixel depth loss and the weighted sum of the original mean square error loss and the mean square error losses of the multiple machine vision model features is used as the joint loss to train the encoder and decoder.

[0049] In a possible embodiment, the training unit is further used for:

[0050] If the joint loss does not meet the preset loss value, the network parameters of the convolutional layer in the encoder and the network parameters of the convolutional layer in the decoder in the encoder and decoder are adjusted until the joint loss meets the preset loss value, thereby obtaining a trained encoder and decoder.

[0051] In a third aspect, an embodiment of the present disclosure provides an electronic device, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the method described in the first aspect above by executing the executable instructions.

[0052] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the method described in the first aspect when executed by a processor.

[0053] In a fifth aspect, according to an embodiment of the present disclosure, a computer program product or a computer program is provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method described in the first aspect above.

[0054] The embodiments of the present disclosure provide a method, device and equipment for training a codec based on a machine vision model. The method specifically includes: obtaining the mean square error loss of the machine vision model features through the machine vision model features output by the machine vision model, and training the codec through the weighted sum of the original mean square error loss of the codec and the mean square error loss of the machine vision model features. The codec training process is back-propagated using the machine vision model, and joint training is performed to improve the matching degree between the codec and the machine vision model, thereby improving the accuracy of the output of the trained codec when performing intelligent tasks in the machine vision model.

[0055] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.

[0057] Figure 1 A schematic diagram of a process for executing an intelligent task in an embodiment of the present disclosure is shown;

[0058] Figure 2 A flowchart of a codec training method based on a machine vision model in an embodiment of the present disclosure is shown;

[0059] Figure 3 A flow chart of determining the mean square error loss of machine vision model features in an embodiment of the present disclosure is shown;

[0060] Figure 4 A schematic diagram showing a codec training method based on a machine vision model in an embodiment of the present disclosure;

[0061] Figure 5 A flowchart showing another encoder-decoder training method based on a machine vision model in an embodiment of the present disclosure is shown;

[0062] Figure 6 A schematic diagram showing the structure of a backbone network in an embodiment of the present disclosure is shown;

[0063] Figure 7 A schematic diagram showing the structure of another backbone network in an embodiment of the present disclosure is shown;

[0064] Figure 8 A schematic diagram showing the structure of a codec training device based on a machine vision model in an embodiment of the present disclosure is shown;

[0065] Fig. 9 A schematic structural diagram of an electronic device in an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0066] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0067] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0068] To avoid ambiguity, the terms appearing in this disclosure are explained.

[0069] Compression: Reducing the size of data using some technical means.

[0070] Decompression: Restoring data to its original form and size after reducing its size through some technical means.

[0071] Coding: It is a specific technical means of compression.

[0072] Decoding: It is a specific means of decompression.

[0073] Machine vision model: A machine vision model, also known as a machine vision task network, is a network model used to perform intelligent tasks together with a codec.

[0074] Because images / videos need to be compressed and decompressed before being used to perform intelligent tasks in order to reduce the amount of data transmission, related technologies only focus on the compression ratio and the difference between the compressed image and the original image, resulting in some images not being effective in performing intelligent tasks after being encoded and decoded by the codec.

[0075] Based on this, the present disclosure provides a codec training method based on a machine vision model, the method specifically comprising: obtaining the mean square error loss of the machine vision model features through the machine vision model features output by the machine vision model, and training the codec through the weighted sum of the original mean square error loss of the codec and the mean square error loss of the machine vision model features. By using the machine vision model to perform back propagation on the codec training process and perform joint training, the matching degree between the codec and the machine vision model can be improved, thereby improving the accuracy of the output of the trained codec when performing intelligent tasks in the machine vision model.

[0076] The present exemplary implementation is described in detail below with reference to the accompanying drawings and embodiments.

[0077] First, an embodiment of the present disclosure provides a codec training method based on a machine vision model. The method can be executed by any electronic device with computing and processing capabilities. The following process takes the electronic device as a server as an example.

[0078] Figure 2 A flow chart of a codec training method based on a machine vision model in an embodiment of the present disclosure is shown. Figure 2 As shown, the encoder-decoder training method based on the machine vision model provided in the embodiment of the present disclosure includes the following steps:

[0079] S202: Obtain a mean square error loss of the machine vision model features through the machine vision model features output by the machine vision model.

[0080] The machine vision model is a model that performs intelligent tasks on the feature vectors output by the codec. The codec is used to encode and decode images / videos.

[0081] It should be noted that after the codec is trained, the method provided by the present disclosure can be used to process images or videos.

[0082] In a possible embodiment, before training the codec, it is necessary to obtain an image training set used for training the codec, and train the codec.

[0083] Exemplarily, the encoder-decoder is trained through an image training set, wherein one training process may be: extracting training sample original images from the image training set according to a set dimension, and inputting the training sample original images into the encoder-decoder for iterative training.

[0084] The dimension of the encoder / decoder can be set by (B, X, H, W), where B represents the number of original images of training samples extracted by the encoder / decoder each time during the training process; X represents the number of color channels. If X is 1, it can be understood that the images in the image training set are grayscale images. If X is 3, it can be understood that the images in the image training set are RGB images, where R (red) represents red, G (green) represents green, and B (blue) represents blue; (H, W) represents the size of the images in the image training set, where H represents height and W represents width.

[0085] The dimensions in the training process of the present disclosure can be set to: (16, 3, H, W). The specific dimensions are not limited and can be selected according to the actual situation.

[0086] The codec includes an encoder and a decoder.

[0087] After obtaining the image training set for training, the original image of the training sample can be extracted through the set dimension, and the restored image and the feature vector corresponding to the restored image can be output. Among them, the feature vector corresponding to the restored image is used to determine the mean square error loss of the machine vision model feature.

[0088] The following explanation is given by taking one training process in the iterative training process as an example.

[0089] During a training process, the specific process of training the encoder and decoder is as follows: extract the original image of the training sample from the image training set according to the set dimension, input the original image of the training sample into the encoder of the encoder and decoder for encoding, and obtain a compressed code stream file, and decode the compressed code stream file through the decoder to obtain the restored image corresponding to the original image of the training sample and the feature vector corresponding to the restored image.

[0090] In the process of obtaining the feature vector corresponding to the restored image, the pixel depth loss can be determined as follows: the pixel depth loss in a training process is determined by the original image of the training sample extracted from the image training set in a training process and its corresponding compressed code stream file. Specifically, as shown in formula (1):

[0091]

[0092] Among them, BPP Loss represents pixel depth loss.

[0093] In the process of obtaining the feature vector corresponding to the restored image, the original mean square error loss between the restored image and the original image of the training sample in a training process can also be determined, as shown in formula (2):

[0094]

[0095] Among them, MSE Loss1 represents the original mean square error loss; s represents the original image of the training sample extracted in a training process in the image training set; y represents the restored image corresponding to the original image of the training sample; t represents any common feature between the original image and the restored image of the training sample used to calculate the mean square error, and m represents the total number of all common features between the original image and the restored image of the training sample.

[0096] Furthermore, after obtaining the feature vector of the restored image, the feature vector of the restored image can be used to determine the mean square error loss of the machine vision model feature. The specific method for determining the mean square error loss of the machine vision model feature is as follows: Figure 3 As shown, the following steps are included:

[0097] S302: Processing the image training set of the encoder / decoder through the machine vision model to obtain machine vision model features corresponding to the image training set.

[0098] In a possible embodiment, the image training set of the codec is also used as the input of the machine vision model. According to the codec method, the same training sample original images as those in the codec are extracted to obtain the machine vision model features corresponding to the training sample original images in the image training set. The training sample original images of the same batch size can also be input into the machine vision model as input.

[0099] S304: Processing the feature vector output by the encoder / decoder through the machine vision model to obtain machine vision model features corresponding to the feature vector.

[0100] In a possible embodiment, a feature vector obtained by a codec according to an original image of a training sample is used as an input of a machine vision model, and a machine vision model feature corresponding to the feature vector can be obtained.

[0101] S306: The mean square error loss between the machine vision model features corresponding to the image training set and the machine vision model features corresponding to the feature vector is used as the mean square error loss of the machine vision model features.

[0102] In a possible embodiment, the mean square error loss of the machine vision model features can be determined by the following formula (3) using the machine vision model features corresponding to the image training set and the machine vision model features corresponding to the feature vector.

[0103]

[0104] Among them, MSE Loss2 represents the mean square error loss of the machine vision model features; s′ represents the machine vision model features corresponding to the original images of the training samples extracted in a training process in the image training set; y′ represents the machine vision model features corresponding to the feature vector; i represents any common feature between the machine vision model features corresponding to the original images of the training samples and the machine vision model features corresponding to the feature vector used to calculate the mean square error; k represents the total number of all common features between the original images of the training samples and the restored images.

[0105] The mean square error loss of the machine vision model features can be obtained in the above manner.

[0106] In another possible embodiment, the mean square error loss of the machine vision model features can be determined by using the shallow features output by the backbone network in the machine vision model as the machine vision model features. The backbone network can include any one of ResNet50, ResNet101 and VGG-16.

[0107] Among them, shallow features are closer to the features of the original image input to the backbone network, and contain more pixel information. Some fine-grained information is some color, texture, edge, and angular information of the image. Shallow networks vary according to the backbone network. For example, the features output by the feature layers of the two stages before Stage 2 in the ResNet50 network can be used as shallow features.

[0108] Furthermore, the machine vision model usually includes a detection head and a backbone network. The detection head can select a detection network, a segmentation network, a classification network, etc. Specifically, for example, when performing dense prediction, you can select networks such as FCOS (Fully Convolutional One-Stage object detection) or SSD (Single Shot MultiBoxDetector). When performing sparse prediction, you can select Faster R-CNN (Regions with CNNfeatures) or R-FCN (Region-based Fully Convolutional Networks) networks.

[0109] The mean square error loss of the machine vision model features can be determined in the following ways:

[0110] The image training set of the encoder and decoder is processed through the backbone network of the machine vision model to obtain the shallow features corresponding to the image training set. The feature vector output by the encoder and decoder is processed through the backbone network of the machine vision model to obtain the shallow features corresponding to the feature vector. The mean square error loss between the shallow features corresponding to the image training set and the shallow features corresponding to the feature vector is used as the mean square error loss of the machine vision model features.

[0111] Because during the training process, the machine vision model can only select one backbone network to process the input feature vector and the original image, but the final output machine vision model features of different backbone networks are very different. For example, if ResNet50 is selected as the backbone network during the training process, after the codec training is completed, if the machine vision model uses VGG-16 as the backbone network during the execution of the intelligent task, the execution effect of the intelligent task may not be very good and the accuracy is not high. Based on this consideration, the inventor believes that since shallow features generally extract texture information, the shallow features of different network models will be relatively similar, and shallow features can also be called shallow common features. Therefore, in the present disclosure, during the training process, the mean square error loss of the machine vision model features is determined by the shallow features output by the backbone network of the machine vision model, and participates in the training process of the codec. After the codec training is completed, the trained codec can have good universality. After the training is completed, no matter which backbone network is used by the machine vision model, the trained codec in the present disclosure can perform intelligent tasks together with it, which can play a role in improving the accuracy of the encoded and decoded image when performing intelligent tasks.

[0112] The machine vision model features in the following steps are explained using shallow features as an example.

[0113] After the mean square error loss of the machine vision model feature is determined in the above manner, step S204 may be performed.

[0114] S204: The encoder-decoder is trained by a weighted sum of the original mean square error loss of the encoder-decoder and the mean square error loss of the machine vision model feature.

[0115] In a possible embodiment, the mean square error loss of the machine vision model features is involved in the training process of the encoder-decoder. Specifically, the weighted sum of the pixel depth loss, the original mean square error loss and the mean square error loss of the machine vision model features is used as the joint loss to train the encoder-decoder.

[0116] There are two cases:

[0117] Case 1: The machine vision model features are the features output by a feature layer in the backbone network.

[0118] Specifically, according to the mean square error loss weighting parameter, the weighted sum of the original mean square error loss and the mean square error loss of the machine vision model features is determined, and according to the pixel depth loss weighting parameter, the weighted sum between the pixel depth loss and the weighted sum of the original mean square error loss and the mean square error loss of the machine vision model features is determined. The weighted sum between the pixel depth loss and the weighted sum of the original mean square error loss and the mean square error loss of the machine vision model features is used as the joint loss to train the encoder and decoder.

[0119] The formula (4) for determining the joint loss in case 1 is as follows:

[0120] Loss=λ(MSE Loss1+βMSE Loss2)+BPP Loss (4)

[0121] Among them, Loss represents the joint loss in case 1; λ represents the pixel depth loss weighting parameter; β represents the mean square error loss weighting parameter.

[0122] Case 2: The machine vision model features include features output by multiple feature layers in the backbone network. For example, the two shallow layers of features before Stage 2 in the backbone network are selected as the machine vision model features.

[0123] Specifically, the mean square error loss of multiple machine vision model features can be determined through the machine vision model features output by multiple feature layers, and the weighted sum of the original mean square error loss and the mean square error losses of multiple machine vision model features can be determined through multiple mean square error loss weighting parameters. According to the pixel depth loss weighting parameter, the weighted sum between the pixel depth loss and the weighted sum of the original mean square error loss and the mean square error losses of multiple machine vision model features is determined. The weighted sum between the pixel depth loss and the weighted sum of the original mean square error loss and the mean square error losses of multiple machine vision model features is used as the joint loss to train the encoder and decoder.

[0124] The formula (5) for determining the joint loss in case 2 is as follows:

[0125] Loss′=λ(MSE Loss1+∑β j MSE Loss2 j )+BPP Loss (5)

[0126] Among them, ∑β j MSE Loss2 j represents the weighted sum of the mean squared error losses of multiple machine vision model features; Loss′ represents the joint loss in case 2.

[0127] The above two formulas need to be explained, where λ and β are weight parameters, and λ represents a pixel depth loss weighting parameter, which is used to represent the weight ratio of the encoder and decoder in the encoder-decoder training process. The size of λ can affect the compression ratio of the encoder-decoder. The larger the λ is, the greater the compression ratio of the trained encoder-decoder will be, that is, the compressed code stream file obtained after compression by the encoder will be smaller, and the image quality of the restored image obtained after decoding by the decoder will be better. During the training process, the value of λ can be given according to the actual situation. As the training process proceeds, it can be adjusted according to the compressed code stream file. If you want the encoder-decoder after training to pay more attention to the image quality of the restored image, you can increase the value of λ appropriately during the training process. If you want the encoder-decoder after training to pay more attention to compression, you can reduce the value of λ appropriately. The value of λ can be optimally changed between 0.0005-0.2. In the present disclosure, it can be changed from 0.0005 to 0.16 according to different actual conditions. The change in the value of λ can be doubled each time, for example, 0.0005 changes to 0.001.

[0128] Furthermore, since the mean square error loss of the new machine vision model feature is introduced to participate in the training of the codec during the training process, there may be an order of magnitude difference between the mean square error loss of the newly introduced machine vision model feature and the original mean square error loss, or there may be other numerical differences in non-training aspects, which can be adjusted by the introduced mean square error weight parameter β. The mean square error weight parameter β introduced between the mean square error loss of the machine vision model feature and the original mean square error loss in the present disclosure can be 0.01.

[0129] In the process of training the codec, the condition for the end of training is that the joint loss meets the preset loss value. If the joint loss does not meet the preset loss value, the network parameters of the convolution layer in the encoder and the network parameters of the convolution layer in the decoder are adjusted in the codec until the joint loss meets the preset loss value, thereby obtaining a trained codec.

[0130] The training process for the encoder / decoder in the present disclosure can be as follows: Figure 4 As shown, the machine vision model feature is taken as a shallow feature layer as an example, and the encoder and decoder are taken as an example of an AI encoder and decoder, which includes an AI encoder and an AI decoder. Among them, the decoder output feature is the feature vector of the restored image corresponding to each training sample in the image training set.

[0131] MES Loss2 is used in the training of the encoder and decoder to adjust the joint loss. After each training, it can be back-propagated to the encoder and decoder to instruct the encoder and decoder to adjust the network parameters of the convolutional layer. After adjustment, a new feature vector can be obtained during the training process, and then MSE Loss2 is re-determined and back-propagated to the encoder and decoder. The training is iterated continuously until the joint loss meets the preset loss value and converges. It should be noted that during the iterative training process, the machine vision model features are involved in the training, but the network parameters of the convolutional layer in the machine vision model do not need to be adjusted.

[0132] Since the machine vision model features participate in the training during the whole process, the MSE Loss2 after training will also reach convergence, which means that the mean square error between the machine vision model features obtained by inputting the restored image output by the trained encoder and decoder into the machine vision model and the machine vision model features obtained by inputting the original image of the training sample into the machine vision model has converged, indicating that the difference in texture information and image features between the two machine vision model features is relatively small, and the accuracy of the restored image when performing intelligent tasks is basically the same as that of the original image of the training sample.

[0133] In a possible implementation, Figure 5, the embodiment of the present disclosure provides a flowchart of another encoder-decoder training method based on a machine vision model, which specifically includes the following steps:

[0134] S502: Obtain an image training set for training a codec.

[0135] Among them, a machine vision task training dataset can be selected as an image training set for training the encoder-decoder.

[0136] S504: extracting a training sample original image from the image training set, inputting the image into the codec, and determining the pixel depth loss and the original mean square error loss through the encoder and decoder included in the codec.

[0137] Among them, the pixel depth loss is the loss between the original image of the training sample and the compressed bitstream file corresponding to the original image of the training sample output by the encoder; the original mean square error loss is the loss between the original image of the training sample and the restored image corresponding to the original image of the training sample output by the decoder.

[0138] In a possible embodiment, the Cheng2020 model can be selected as the encoder-decoder, and the batch size during training is set to 16.

[0139] In another possible embodiment, the Mbt2018-mean model may be selected as the encoder-decoder, and the batch size during training is set to 16.

[0140] S506: Processing the original image of the training sample through the backbone network of the machine vision model to obtain machine vision model features corresponding to the original image of the training sample.

[0141] S508: Processing the feature vector corresponding to the restored image through the backbone network of the machine vision model to obtain the machine vision model features corresponding to the feature vector.

[0142] In a possible embodiment, when the Cheng2020 model is selected as the codec, the backbone network can choose to use the ResNet50 network. The structural diagram of the ResNet50 network is as follows: Figure 6 As shown, the specific structure will not be repeated here.

[0143] When using the ResNet50 network, the input is the feature vector output by the decoder. When the machine vision model features use shallow features, the shallow features can be selected Figure 6 Features output by the feature layer in the two stages before Stage 2.

[0144] For example, the feature vector output by the decoder is input to the output of the Stem layer in the ResNet50 network as F′ stem , the output of the original image of the training sample input to the Stem layer in the ResNet50 network is F″ stem ; The feature vector output by the decoder is input to the output of the Stage 1 layer in the ResNet50 network as F′ stage , the output of the original image of the training sample input to the Stage 1 layer of the ResNet50 network is F″ stage .

[0145] In another possible embodiment, when the Mbt2018-mean model is selected as the codec, the backbone network can choose to use the ResNet50+FPN network. The backbone network can be understood as a ResNet50 network with an FPN module. The structural diagram of ResNet50+FPN is shown in FIG. Figure 7 As shown, the specific structure will not be repeated here.

[0146] When using the ResNet50+FPN network, the input is the feature vector output by the decoder. When the machine vision model features use shallow features, the shallow features can be selected Figure 7 The output of the Stem layer before entering the FPN module.

[0147] For example, the feature vector output by the decoder is input to the output of the Stem layer in the ResNet50+FPN network as F′ stem1 , the output of the original image of the training sample input to the Stem layer in the ResNet50 network is F″ stem1 .

[0148] S510: Determine the mean square error loss of the machine vision model features by using the machine vision model features corresponding to the original image of the training sample and the machine vision model features corresponding to the feature vector.

[0149] S512: Determine the joint loss of the encoder and decoder by taking the weighted sum of the pixel depth loss, the original mean square error loss and the mean square error loss of the machine vision model feature.

[0150] In one possible embodiment, when the encoder-decoder is trained using the Cheng2020 model and the ResNet50 network, F′ stem , F″ stem , F′ stage , F″ stage , respectively determine the mean square error loss of the Stem layer, the machine vision model features, and the mean square error loss of the Stage1 layer, the machine vision model features.

[0151] When there are multiple mean square error losses of machine vision model features, the mean square error losses of multiple machine vision model features, pixel depth loss and original mean square error loss are calculated using formula (5) to obtain the joint loss.

[0152] Specifically, it can be shown as formula (6):

[0153] Loss′=λ(MSE Loss1+β1MSE Loss21+β2MSE Loss22)+BPP Loss(6)

[0154] Among them, MSE Loss21 represents the mean square error loss of the machine vision model features corresponding to the Stem layer; MSELoss22 represents the mean square error loss of the machine vision model features corresponding to the Stage1 layer; β1 and β2 represent the corresponding mean square error loss weight parameters respectively.

[0155] In another possible embodiment, when the encoder-decoder is trained using the Mbt2018-mean model and the ResNet50+FPN network, F′ stem1 and F″ stem1 , determine the mean square error loss of the Stem layer and the machine vision model features.

[0156] Then, the mean square error loss, pixel depth loss and original mean square error loss of the machine vision model features are calculated using formula (4) to obtain the joint loss.

[0157] S514: Determine whether the combined loss meets the preset loss value; if not, execute step S516; if so, execute step S518.

[0158] S516: Adjust the network parameters of the convolutional layer in the encoder and the network parameters of the convolutional layer in the decoder in the encoder and decoder, and return to execute S504.

[0159] S518: Obtain a trained codec according to the network parameters of the convolutional layer in the encoder and the network parameters of the convolutional layer in the decoder in the current codec.

[0160] Through the encoder-decoder training method based on the machine vision model disclosed in the present invention, not only the machine vision model and the encoder-decoder are jointly trained, but also the mean square error loss of the machine vision model features is determined by the machine vision model features output by the machine vision model to participate in the training. During the training process, the feature vector output by the decoder makes the process of joint training of the machine vision model and the encoder-decoder continuous. During the entire training process, the mean square error loss of the machine vision model features, the pixel depth loss and the original mean square error loss are used to jointly calculate the joint loss. Back propagation is used to adjust the network parameters of the convolutional layers in the encoder and decoder. By adjusting the network parameters, the feature vector output by the decoder changes, which then affects the mean square error loss of the machine vision model features. The training process is a continuous iterative process, and there is no need to adjust the network parameters of the machine vision model during the training process.

[0161] Furthermore, the training process in the present invention can also deepen the focus on the universality between the encoder-decoder and all machine vision models. By utilizing the shallow features output by the backbone network in the machine vision model to determine the mean square error loss of the machine vision model features and participate in training, the texture information of the shallow features of most network models will be relatively similar. The trained encoder-decoder can adapt to most machine vision models and improve the accuracy of executing intelligent tasks.

[0162] Based on the same inventive concept, the embodiments of the present disclosure also provide a codec training device based on a machine vision model, such as the following embodiments. Since the principle of solving the problem in the device embodiment is similar to that in the above method embodiment, the implementation of the device embodiment can refer to the implementation of the above method embodiment, and the repeated parts will not be repeated.

[0163] Figure 8 A schematic diagram of the structure of a codec training device based on a machine vision model in an embodiment of the present disclosure is shown. Figure 8 As shown, the device 80 includes:

[0164] A determination unit 801 is used to obtain a mean square error loss of the machine vision model feature through the machine vision model feature output by the machine vision model;

[0165] The training unit 802 is used to train the codec by using the weighted sum of the original mean square error loss of the codec and the mean square error loss of the machine vision model feature.

[0166] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as "circuits", "modules" or "systems".

[0167] Refer to the following Fig. 9 The electronic device 900 according to this embodiment of the present disclosure is described. Fig. 9 The electronic device 900 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0168] like Fig. 9 As shown, the electronic device 900 is in the form of a general computing device. The components of the electronic device 900 may include but are not limited to: at least one processing unit 910, at least one storage unit 920, and a bus 930 connecting different system components (including the storage unit 920 and the processing unit 910).

[0169] The storage unit stores program codes, which can be executed by the processing unit 910, so that the processing unit 910 performs the steps of various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification. For example, the processing unit 910 can perform any step of the above method embodiments.

[0170] The storage unit 920 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 9201 and / or a cache storage unit 9202 , and may further include a read-only storage unit (ROM) 9203 .

[0171] The storage unit 920 may also include a program / utility 9204 having a set (at least one) of program modules 9205, such program modules 9205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0172] Bus 930 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0173] The electronic device 900 may also communicate with one or more external devices 940 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 900, and / or may communicate with any device that enables the electronic device 900 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 950. Furthermore, the electronic device 900 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 960. As shown, the network adapter 960 communicates with other modules of the electronic device 900 via a bus 930. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 900, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.

[0174] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0175] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer program product or a computer program, which includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method in the above embodiment.

[0176] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, which may be a readable signal medium or a readable storage medium. A program product capable of implementing the above method of the present disclosure is stored thereon. In some possible implementations, various aspects of the present disclosure may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary implementations of the present disclosure described in the above “Exemplary Method” section of this specification.

[0177] More specific examples of computer-readable storage media in the present disclosure may include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0178] In the present disclosure, a computer readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, wherein a readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A readable signal medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0179] Alternatively, the program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.

[0180] In a specific implementation, the program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).

[0181] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0182] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.

[0183] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0184] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the appended claims.

Claims

1. A codec training method based on machine vision model, It is characterized in that The method comprises: Obtaining a mean square error loss of the machine vision model feature through the machine vision model feature output by the machine vision model; The encoder-decoder is trained by a weighted sum of the original mean square error loss of the encoder-decoder and the mean square error loss of the machine vision model features.

2. The method according to claim 1, It is characterized in that The step of obtaining a mean square error loss of the machine vision model feature through the machine vision model feature output by the machine vision model includes: Processing the image training set of the codec through the machine vision model to obtain machine vision model features corresponding to the image training set; Processing the feature vector output by the encoder / decoder through the machine vision model to obtain the machine vision model feature corresponding to the feature vector; The mean square error loss between the machine vision model features corresponding to the image training set and the machine vision model features corresponding to the feature vector is used as the mean square error loss of the machine vision model features.

3. The method according to claim 1, It is characterized in that The machine vision model includes a backbone network; the machine vision model features are shallow features output by the backbone network; The method of obtaining a mean square error loss of the machine vision model feature by using the machine vision model feature output by the machine vision model further includes: Processing the image training set of the encoder and decoder through the backbone network of the machine vision model to obtain shallow features corresponding to the image training set; Processing the feature vector output by the encoder / decoder through the backbone network of the machine vision model to obtain shallow features corresponding to the feature vector; The mean square error loss between the shallow features corresponding to the image training set and the shallow features corresponding to the feature vector is used as the mean square error loss of the machine vision model features.

4. The method according to claim 1, It is characterized in that The codec includes an encoder and a decoder connected in sequence; wherein the encoder is used to encode the original image of the training sample in the image training set to obtain a compressed code stream file; the decoder is used to decode the compressed code stream file output by the encoder to obtain a feature vector; The training of the encoder-decoder by a weighted sum of an original mean square error loss of the encoder-decoder and a mean square error loss of the machine vision model feature comprises: Determining the original mean square error loss by using the image training set and the feature vector; Determining the pixel depth loss of the encoder through the image training set and the compressed bitstream file; The encoder-decoder is trained by taking a weighted sum of the pixel depth loss, the original mean square error loss and the mean square error loss of the machine vision model feature as the joint loss.

5. The method according to claim 4, It is characterized in that The step of training the encoder-decoder by taking the weighted sum of the pixel depth loss, the original mean square error loss and the mean square error loss of the machine vision model feature as a joint loss comprises: Determining a weighted sum of the original mean square error loss and the mean square error loss of the machine vision model feature according to a mean square error loss weighting parameter; Determine, according to a pixel depth loss weighting parameter, a weighted sum of the pixel depth loss and a weighted sum of the original mean square error loss and the mean square error loss of the machine vision model feature; The encoder-decoder is trained by taking the weighted sum of the pixel depth loss and the weighted sum of the original mean square error loss and the mean square error loss of the machine vision model feature as the joint loss.

6. The method according to claim 5, It is characterized in that The method further comprises: If there are multiple mean square error losses of the machine vision model features, a weighted sum of the original mean square error loss and the mean square error losses of the multiple machine vision model features is determined by using multiple mean square error loss weighting parameters; Determine, according to a pixel depth loss weighting parameter, a weighted sum of the pixel depth loss and a weighted sum of the original mean square error loss and mean square error losses of multiple machine vision model features; The encoder-decoder is trained by taking a weighted sum of the pixel depth loss and a weighted sum of the original mean square error loss and the mean square error losses of multiple machine vision model features as a joint loss.

7. The method according to any one of claims 4 to 6, It is characterized in that The training of the encoder / decoder comprises: If the joint loss does not meet the preset loss value, the network parameters of the convolutional layer in the encoder and the network parameters of the convolutional layer in the decoder in the encoder and decoder are adjusted until the joint loss meets the preset loss value, thereby obtaining a trained encoder and decoder.

8. A codec training device based on machine vision model, It is characterized in that include: A determination unit, configured to obtain a mean square error loss of the machine vision model feature through the machine vision model feature output by the machine vision model; A training unit is used to train the codec by using the weighted sum of the original mean square error loss of the codec and the mean square error loss of the machine vision model feature.

9. An electronic device, It is characterized in that include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 7 by executing the executable instructions.

10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.