Image format conversion method and its device, equipment, medium and product

Through the preset image format conversion model and the neural network model with linear and nonlinear loss constraints, the format conversion of low information content images is performed, the features are extracted and processed, and high information content images are generated, which solves the problem of inability to improve images in the existing technology. quality issues, achieving higher quality image output.

CN114445511BActive Publication Date: 2024-10-25GUANGZHOU HUADUO NETWORK TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210106711.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-28
Publication Date
2024-10-25
Estimated Expiration
2042-01-28

AI Technical Summary

Technical Problem

The existing technology cannot generate a high-information image from a single low-information image, and cannot effectively improve the quality of the image.

Method used

The preset image format conversion model is used, and the neural network model is constrained to the convergence state through linear loss and nonlinear loss to convert the image format, and the convolution channel and attention layer are used to extract features, and perform mask features and convolution features. The dot product and addition operations are mapped through the hyperbolic tangent function to generate images with high information content.

Benefits of technology

It realizes the conversion of low information content images into high information content images, improves the quality of the images, breaks through the limitations of the hardware performance of the shooting device, and meets the user's demand for higher definition and richer colors images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114445511B_ABST
    Figure CN114445511B_ABST
Patent Text Reader

Abstract

This application discloses an image format conversion method, apparatus, computer device, and storage medium, comprising: acquiring a first target image in a first data format; inputting the first target image into a preset image format conversion model, wherein the image format conversion model is pre-constrained to a convergent state through linear and nonlinear loss, and is a neural network model used for image format conversion; and reading a second target image output by the image format conversion model, wherein the second target image is in a second data format, and the information load of the second data format is greater than that of the first data format. This method can rapidly improve image quality, overcome the limitations of the hardware performance of the shooting device, and meet user needs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to an image format conversion method, device, electronic device and computer-readable storage medium. Background Art

[0002] With the development and progress of science and technology, the widespread popularization of smart phones and the rapid development of the Internet, massive amounts of image data are constantly being generated and shared. At the same time, people's requirements for image quality are constantly increasing, and more people are pursuing higher-definition and more colorful display data.

[0003] The inventors of the present application discovered during their research that, in the prior art, after a low-information picture is captured by a photographing device, it is not possible to add information to the low-information picture, that is, it is not possible to generate a high-information image from a single low-information image. Summary of the invention

[0004] The present application provides an image format conversion method, device and computer-readable storage medium capable of obtaining a high-information-content image from a single low-information-content image.

[0005] To achieve the above object, the present application provides an image format conversion method, comprising:

[0006] Acquire a first target image in a first data format;

[0007] Inputting the first target image into a preset image format conversion model, wherein the image format conversion model is pre-constrained to a convergence state through linear loss and nonlinear loss, and is a neural network model for performing format conversion on the image;

[0008] A second target image output by the image format conversion model is read, wherein the second target image format is a second data format, and an information carrying capacity of the second data format is greater than an information carrying capacity of the first data format.

[0009] Optionally, the image format conversion model includes: a first convolution channel and a second convolution channel, and the feature output by the first convolution channel is a mask feature vector, and the feature output by the second convolution channel is a convolution feature vector.

[0010] Optionally, the first convolution channel includes: a first convolution layer and a first attention layer, the first convolution layer is cascaded with the first attention layer, and the first attention layer is connected to the output end of the first convolution layer, and the first attention layer includes a channel attention layer.

[0011] Optionally, the second convolution channel includes: a plurality of cascaded feature layers, the output end of each feature layer is connected to a second attention layer, and the second attention layer includes a channel attention layer and a spatial attention layer.

[0012] Optionally, each of the feature layers includes: a plurality of cascaded second convolutional layers, the output end of each of the second convolutional layers is connected to a linear rectification layer, and the output of any linear rectification layer serves as the input of all the second convolutional layers arranged after any linear rectification layer.

[0013] Optionally, reading the second target image output by the image format conversion model includes:

[0014] Reading the mask feature vector output by the first convolution channel;

[0015] Performing a dot product operation on the mask feature vector and the array vector matrix of the first target image;

[0016] Performing an addition operation on the result of the dot product operation and the feature vector output by the second convolution channel;

[0017] The result obtained by the addition operation is mapped through a preset hyperbolic tangent function to generate the second target image.

[0018] Optionally, the training method of the image format conversion model is:

[0019] Read the training samples to be processed;

[0020] According to a preset image enhancement strategy, performing image enhancement processing on the training sample;

[0021] Inputting the training samples after image enhancement processing into a preset non-convergence model, wherein the non-convergence model is an initialization model of the image format conversion model;

[0022] Reading the stress image output by the non-convergent model, and calculating the loss distance between the stress image and the annotated image in the training sample according to a preset linear loss function and a nonlinear loss function;

[0023] According to the loss distance and a preset feedback function, the weight value of the non-convergent model is called back and corrected so that the loss distance between the stress image and the annotated image approaches a preset target threshold.

[0024] To achieve the above object, the present application also provides an image format conversion device, comprising:

[0025] An acquisition module, used for acquiring a first target image in a first data format;

[0026] A processing module, used for inputting the first target image into a preset image format conversion model, wherein the image format conversion model is pre-constrained to a convergence state through linear loss and nonlinear loss, and is used for a neural network model for format conversion of an image;

[0027] An execution module is used to read a second target image output by the image format conversion model, wherein the second target image format is a second data format, and the information carrying capacity of the second data format is greater than the information carrying capacity of the first data format.

[0028] Optionally, the image format conversion model includes: a first convolution channel and a second convolution channel, and the feature output by the first convolution channel is a mask feature vector, and the feature output by the second convolution channel is a convolution feature vector.

[0029] Optionally, the first convolution channel includes: a first convolution layer and a first attention layer, the first convolution layer is cascaded with the first attention layer, and the first attention layer is connected to the output end of the first convolution layer, and the first attention layer includes a channel attention layer.

[0030] Optionally, the second convolution channel includes: a plurality of cascaded feature layers, the output end of each feature layer is connected to a second attention layer, and the second attention layer includes a channel attention layer and a spatial attention layer.

[0031] Optionally, each of the feature layers includes: a plurality of cascaded second convolutional layers, the output end of each of the second convolutional layers is connected to a linear rectification layer, and the output of any linear rectification layer serves as the input of all the second convolutional layers arranged after any linear rectification layer.

[0032] Optionally, the image format conversion device further includes:

[0033] A first reading submodule, used for reading the mask feature vector output by the first convolution channel;

[0034] A first operator module, configured to perform a dot product operation on the mask feature vector and the array vector matrix of the first target image;

[0035] A second operator module, used for performing an addition operation on a result of the dot product operation and a feature vector output by the second convolution channel;

[0036] The first generating submodule is used to generate the second target image by mapping the result obtained by the addition operation through a preset hyperbolic tangent function.

[0037] Optionally, the image format conversion device further includes:

[0038] A second reading submodule is used to read the training samples to be processed;

[0039] A first enhancement submodule, used for performing image enhancement processing on the training sample according to a preset image enhancement strategy;

[0040] A first processing submodule, used for inputting the training samples after image enhancement processing into a preset non-convergence model, wherein the non-convergence model is an initialization model of the image format conversion model;

[0041] A third calculation submodule is used to read the stress image output by the non-convergent model, and calculate the loss distance between the stress image and the annotated image in the training sample according to a preset linear loss function and a nonlinear loss function;

[0042] The first execution submodule is used to perform callback correction on the weight value of the non-convergence model according to the loss distance and a preset feedback function, so that the loss distance between the stress image and the annotated image approaches a preset target threshold.

[0043] In order to solve the above technical problems, an embodiment of the present application also provides a computer device, including a memory and a processor, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor executes the steps of the above-mentioned image format conversion method.

[0044] In order to solve the above technical problem, an embodiment of the present application further provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the above-mentioned image format conversion method.

[0045] A computer program product provided to meet another purpose of the present application includes a computer program / instruction, which, when executed by a processor, implements the steps of the image format conversion method described in any embodiment of the present application.

[0046] The beneficial effect of the embodiment of the present application is: by pre-training the image format conversion model, the image format conversion model is a neural network model, which can convert the format of the image input therein, improve the information carrying capacity of the input image, and increase the amount of information in the image. Therefore, when the user uses a shooting device to shoot a first target image in a first data format, the first target image is input into the image format conversion model, and the image format conversion model performs format conversion on the first target image, so that the first target image is converted into a second target image in a second data format. The information carrying capacity of the second data format is greater than the information carrying capacity of the first data format, and the second target image after format conversion has a higher image quality. The above method can quickly improve the image quality, break through the limitations of the hardware performance of the shooting device, and meet the needs of users. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0048] Figure 1 A schematic diagram of the basic flow of an image format conversion method according to a specific embodiment of the present application;

[0049] Figure 2 A schematic diagram of a process of generating a second target image according to a specific embodiment of the present application;

[0050] Figure 3 A schematic diagram of the training process of an image format conversion model according to a specific embodiment of the present application;

[0051] Figure 4 A schematic diagram of the basic structure of an image format conversion device according to a specific embodiment of the present application;

[0052] Figure 5 This is a basic structural block diagram of a computer device according to a specific embodiment of the present application. DETAILED DESCRIPTION

[0053] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be interpreted as limiting the present application.

[0054] Those skilled in the art will appreciate that, unless otherwise stated, the singular forms "a", "an", "said" and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present application refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.

[0055] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as those generally understood by those skilled in the art to which this application belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with those in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined as here.

[0056] It will be understood by those skilled in the art that the term "terminal" as used herein includes both devices with wireless signal receivers, which are devices with only wireless signal receivers without transmission capabilities, and devices with receiving and transmitting hardware, which are devices with receiving and transmitting hardware capable of performing two-way communications over a two-way communication link. Such devices may include: cellular or other communication devices, which have a single-line display or a multi-line display or a cellular or other communication device without a multi-line display; PCS (Personal Communications Service), which may combine voice, data processing, fax and / or data communication capabilities; PDA (Personal Digital Assistant), which may include a radio frequency receiver, a pager, Internet / intranet access, a web browser, a notepad, a calendar and / or a GPS (Global Positioning System) receiver; conventional laptop and / or palmtop computers or other devices, which have and / or include a conventional laptop and / or palmtop computer or other device with and / or including a radio frequency receiver. The "terminal" used here can be portable, transportable, installed in a vehicle (air, sea and / or land), or suitable for and / or configured to run locally, and / or in a distributed form, running at any other location on the earth and / or in space. The "terminal" used here can also be a communication terminal, an Internet terminal, a music / video playing terminal, for example, a PDA, a MID (Mobile Internet Device) and / or a mobile phone with a music / video playing function, or a smart TV, a set-top box and other devices.

[0057] The hardware referred to by the names such as "server", "client", and "service node" in this application is essentially an electronic device with the equivalent capabilities of a personal computer. It is a hardware device with the necessary components revealed by the von Neumann principle, such as a central processing unit (including an arithmetic unit and a controller), a memory, an input device, and an output device. The computer program is stored in its memory, and the central processing unit calls the program stored in the external memory into the internal memory for execution, executes the instructions in the program, and interacts with the input and output devices to complete specific functions.

[0058] It should be pointed out that the concept of "server" referred to in this application can also be extended to the case of server clusters. According to the network deployment principle understood by those skilled in the art, the servers should be logically divided. In physical space, these servers can be independent of each other but can be called through interfaces, or integrated into a physical computer or a set of computer clusters. Those skilled in the art should understand this flexibility, and should not use it to restrict the implementation of the network deployment method of this application.

[0059] Unless expressly specified, one or more technical features of the present application can be deployed on a server for implementation and accessed by a client through a remote call to obtain an online service interface provided by the server, or can be directly deployed and run on a client for access.

[0060] The neural network models referenced or may be referenced in this application, unless expressly specified, can be deployed on a remote server and remotely called on the client, or can be deployed and directly called on a client with sufficient device capabilities. In some embodiments, when it runs on the client, its corresponding intelligence can be obtained through transfer learning to reduce the requirements for the client's hardware operating resources and avoid excessive occupation of the client's hardware operating resources.

[0061] Unless explicitly specified, the various data involved in this application can be stored remotely on a server or on a local terminal device, as long as it is suitable for being called by the technical solution of this application.

[0062] Those skilled in the art should be aware that, although the various methods of the present application are described based on the same concept and thus present commonality to each other, unless otherwise specified, these methods can be independently executed. Similarly, for each embodiment disclosed in the present application, they are all proposed based on the same inventive concept, therefore, concepts with the same expression, and concepts that are appropriately changed for convenience despite different expressions, should be understood as equivalent.

[0063] Unless the mutually exclusive relationship between the embodiments to be disclosed in this application is explicitly stated, the relevant technical features involved in each embodiment can be cross-combined to flexibly construct a new embodiment, as long as such combination does not deviate from the creative spirit of this application and can meet the needs of the prior art or solve certain deficiencies in the prior art. Those skilled in the art should be aware of this flexibility.

[0064] See also Figure 1 , Figure 1 FIG. 2 is a schematic diagram of the basic flow of the image format conversion method of this embodiment. Figure 1 As shown, a method for image format conversion includes:

[0065] S1100, acquiring a first target image in a first data format;

[0066] In this embodiment, the shooting device used for image shooting is a mobile terminal, such as a mobile phone, a tablet computer or a DV device.

[0067] The mobile terminal needs to capture images in a specific shooting mode. The configuration parameters can be stored on the server side. After receiving the device information sent by the mobile terminal, the server side identifies the operating system or device information of the mobile terminal based on the device information, and then further configures the configuration parameters that match the mobile terminal based on the device information.

[0068] In some embodiments, the matching of configuration parameters needs to be matched according to the camera interface carried by the mobile terminal. First, the API interface of the mobile terminal camera is collected, searched in the configuration database, and after obtaining the parameters corresponding to the API interface, the configuration parameters are sent to the mobile terminal. When the corresponding configuration parameters cannot be found through the API interface, the SDK information of the shooting module in the mobile terminal device information is read, and the SDK information is searched in the configuration database. After obtaining the configuration parameters corresponding to the SDK, the corresponding configuration parameters are sent to the mobile terminal. Furthermore, when the configuration parameters cannot be matched through the SDK information, the configuration parameters can be matched according to the operating system type of the mobile terminal.

[0069] When the server receives the device information sent by the mobile terminal, it matches the configuration parameters corresponding to the mobile terminal according to the device information and sends the configuration parameters to the mobile terminal. After the mobile terminal obtains the configuration parameters, it configures the shooting parameters of the mobile terminal in the following manner: setting the shooting parameters of the mobile terminal.

[0070] The mobile terminal enters the set target shooting mode according to the configuration parameter setting. It should be noted that the target shooting mode is not a necessary mode for the mobile terminal to capture images. In some embodiments, the mobile terminal can capture the first target image in any shooting mode.

[0071] The image captured by the mobile terminal is the first target image, and the first data format is the SDR format. It should be pointed out that the first data format is not limited to the SDR format, but can also be a conventional image format such as JPG, PNG, etc.

[0072] S1200, inputting the first target image into a preset image format conversion model, wherein the image format conversion model is pre-constrained to a convergence state through linear loss and nonlinear loss, and is a neural network model for performing format conversion on an image;

[0073] After the first target image is acquired, the first target image is input into the image format conversion model. The image format conversion model is a neural network model that has been trained to a convergence state through supervised training in advance and can perform format conversion on the image input therein.

[0074] In some implementations, the image format conversion model is deployed in a mobile terminal. After the mobile terminal captures the first target image, the first target image is input into the local storage of the mobile terminal, and the image format conversion model converts the image format locally.

[0075] In some embodiments, the image format conversion model is deployed on the server side. After the mobile terminal acquires the first target image, the mobile terminal sends the first target image to the server side. The server side converts the image format of the first target image through the image format conversion model. After the image format conversion is completed, the server side sends the converted image to the mobile terminal.

[0076] In some embodiments, after the first target image is acquired, the acquired first target image needs to be screened. The screening method is: screening by the average brightness of the first target image. Specifically, a standard brightness interval value is set. The standard brightness interval value can be [30,230], but the standard brightness interval value is not limited thereto. Depending on the specific application scenario, the critical value of the standard brightness interval value can be larger or smaller.

[0077] The average brightness of the first target image is calculated, and the average brightness value corresponding to the first target image is compared to see whether it falls within the standard brightness range. If the average brightness value corresponding to the first target image falls within the standard brightness range, the first target image is input into the image format conversion model; otherwise, the first target image is deleted and the image is retaken.

[0078] The value range of the standard brightness interval value can be dynamically adjusted according to different shooting environments. Specifically, the first target image is input into a neural network model that is pre-trained to a convergence state and is used to recognize the scene in which the image is located, and the neural network model recognizes the shooting environment represented by the first target image, for example, different image scenes such as indoor, outdoor, cloudy, sunny, etc.

[0079] According to the image scene, a standard brightness interval value matching the image scene is searched in a preset scene database. By scene recognition of the first target image, the adaptability of the standard brightness interval value to the environment can be improved.

[0080] In some implementations, the image format conversion model is deployed in a mobile terminal. Since the performance of the mobile terminal is limited and a large-scale neural network model cannot be run, the image format conversion model needs to be lightweight. Specifically, the structure of the image format conversion model is as follows:

[0081] The image format conversion model includes: a first convolution channel and a second convolution channel, and the feature output by the first convolution channel is a mask feature vector, and the feature output by the second convolution channel is a convolution feature vector.

[0082] The first convolution channel includes: a first convolution layer and a first attention layer, the first convolution layer is cascaded with the first attention layer, and the first attention layer is connected to the output end of the first convolution layer, and the first attention layer includes a channel attention layer.

[0083] The second convolution channel includes: a plurality of cascaded feature layers, the output end of each feature layer is connected to a second attention layer, and the second attention layer includes a channel attention layer and a spatial attention layer. In some embodiments, the second convolution channel includes: 3 groups of cascaded feature layers and 3 groups of second attention layers, but the number of feature layers and second attention layers included in the second convolution channel is not limited thereto. Depending on the specific application scenario, in some embodiments, the number of feature layers and second attention layers included in the second convolution channel can be the maximum or less.

[0084] Each of the feature layers includes: a plurality of cascaded second convolutional layers, the output end of each of the second convolutional layers is connected to a linear rectification layer, and the output of any linear rectification layer is used as the input of all the second convolutional layers arranged after any of the linear rectification layers. In some embodiments, each feature layer includes: 5 groups of cascaded second convolutional layers and linear rectification layers, and a linear rectification function is provided in the linear rectification layer. The output of any linear rectification layer is used as the input of all the second convolutional layers arranged after any of the linear rectification layers. For example, the output of the first-ranked linear rectification layer is used as the input of the second, third, fourth and fifth second convolutional layers, and the output of the second-ranked linear rectification layer is used as the input of the third, fourth and fifth second convolutional layers, and so on, until the fourth-ranked linear rectification layer is input to the fifth-ranked second convolutional layer. It should be pointed out that the number of second convolutional layers and linear rectification layers included in the feature layer is not limited thereto. Depending on the specific application scenario, in some embodiments, the number of second convolutional layers and linear rectification layers can be more or less.

[0085] In this implementation, the image format conversion model includes a loss function, and the loss function includes a linear loss function and a nonlinear loss function.

[0086] Loss=Loss linear +Loss nonlinear

[0087] Among them, Loss represents the loss function, Loss linear Expressed as a linear loss function, Loss nonlinear It is expressed as a nonlinear loss function.

[0088] Both linear loss function and nonlinear loss function include color gamut loss function Loss color And the perceptual loss function Loss perceptual . Compared with the existing technology, the loss function is a single nonlinear loss function or a linear loss function. However, a single linear loss function cannot make the image format conversion model converge, and a single nonlinear loss function will put the image format conversion model in a distorted state. By mixing linear loss function and nonlinear loss function, the linear loss function can compensate for the model distortion caused by the nonlinear loss function, making the image format conversion model more robust and the converted image more stable.

[0089] Loss linear =Loss color +Loss perceptual

[0090] Loss nonlinear =Loss color +Loss perceptual

[0091] Perceptual loss refers to the difference in results between different feature layers of the image format conversion model. The difference is calculated using the L1 paradigm, where y is the labeled feature and y′ is the output of the image format conversion model.

[0092] Loss perceptual =L1|VGG 19 (y′-y)|

[0093] Color gamut loss uses three color gamuts for loss calculation, namely RGB, HSV, and LAB. RGB is the three primary color space, corresponding to the three colors of red, green, and blue respectively; HSV is the hue (H), saturation (S), and brightness (V) space, and the color is adjusted through the H and S channels to be closer to the color of the annotated image; in LAB, L is brightness, and AB is red and blue hue. Similar to HSV, the difference between the A and B channels is calculated to improve the accuracy of network color. The calculation of color gamut loss adopts the L1 paradigm, as shown in the following formula:

[0094] Loss color =L1|(y′ rgb -y rgb )|+L1|(y′ hsv -y hsv )|+L1|(y′ lab -y lab )|

[0095] The above-mentioned image format conversion model format is a lightweight model that can be deployed on mobile terminals, and the combination of linear and nonlinear losses reduces image distortion and over-enhancement, and increases the expressiveness and stability of the image output by the image format conversion model.

[0096] S1300. Read a second target image output by the image format conversion model, wherein the second target image format is a second data format, and an information carrying capacity of the second data format is greater than an information carrying capacity of the first data format.

[0097] The first target image is input into the image format conversion model, the input channel of the image format conversion model converts the first target image into an array vector matrix, and then the array vector matrix is ​​respectively input into the first convolution channel, the second convolution channel, and the output ends of the first convolution channel and the second convolution channel.

[0098] Among them, the first convolution layer and the first attention layer in the first convolution channel extract the features of the array vector matrix, and the extracted feature vector is the mask feature vector.

[0099] The feature layer and the second attention layer in the second convolution channel extract the features of the array vector matrix in a hierarchical manner. Among them, each second convolution layer and linear rectification layer in the feature layer extracts the convolution features in the array vector matrix in a hierarchical manner. Finally, the feature vector output by the second convolution channel is the convolution feature vector.

[0100] At the output end of the first convolution channel and the second convolution channel, the mask feature vector output by the first convolution channel is subjected to a dot product operation with the array vector matrix, that is, the eye mask feature matrix represented by the mask feature vector is multiplied with the array vector matrix.

[0101] After the mask feature vector output by the first convolution channel is dot-producted with the array vector matrix to obtain a dot product result, the vector matrix obtained by the dot product result is added to the feature vector output by the second convolution channel.

[0102] After the calculation result is obtained by the addition operation, the calculation result needs to be mapped. The mapping method is: the calculation result is mapped by the hyperbolic tangent function. The hyperbolic tangent function (tanh) is the ratio of the hyperbolic sine function (sinh) to the hyperbolic cosine function (cosh), which can map the calculation result obtained by the addition operation within the value range of [-1,1]. Finally, the mapped vector matrix is ​​pixelated to generate the second target image.

[0103] The data format of the second target image is the second data format. In this embodiment, the second data format is the HDR format. It should be noted that the format range of the second data format is not limited thereto. Depending on the specific application scenario, the second data format can also be (not limited to): TGA, BMP and other image formats.

[0104] The above-mentioned implementation method pre-trains the image format conversion model, which is a neural network model, and can convert the format of the image input therein, thereby increasing the information carrying capacity of the input image and the amount of information in the image. Therefore, when a user uses a shooting device to shoot a first target image in a first data format, the first target image is input into the image format conversion model, and the image format conversion model performs format conversion on the first target image, so that the first target image is converted into a second target image in a second data format. The information carrying capacity of the second data format is greater than the information carrying capacity of the first data format, and the second target image after format conversion has a higher image quality. The above-mentioned method can quickly improve the image quality, break through the limitations of the hardware performance of the shooting device, and meet the needs of users.

[0105] In some implementations, after the first target image is input into the image format conversion model, the first target image needs to be processed through the first convolution channel and the second convolution channel. Figure 2 , Figure 2 This is a schematic diagram of the process of generating a second target image in this embodiment.

[0106] like Figure 2 As shown, S1300 includes:

[0107] S1311, reading the mask feature vector output by the first convolution channel;

[0108] The first target image is input into the image format conversion model, the input channel of the image format conversion model converts the first target image into an array vector matrix, and then the array vector matrix is ​​respectively input into the first convolution channel, the second convolution channel, and the output ends of the first convolution channel and the second convolution channel.

[0109] Among them, the first convolution layer and the first attention layer in the first convolution channel extract the features of the array vector matrix, and the extracted feature vector is the mask feature vector.

[0110] S1312, performing a dot product operation on the mask feature vector and the array vector matrix of the first target image;

[0111] The feature layer and the second attention layer in the second convolution channel extract the features of the array vector matrix in a hierarchical manner. Among them, each second convolution layer and linear rectification layer in the feature layer extracts the convolution features in the array vector matrix in a hierarchical manner. Finally, the feature vector output by the second convolution channel is the convolution feature vector.

[0112] S1313, performing an addition operation on the result of the dot product operation and the feature vector output by the second convolution channel;

[0113] At the output end of the first convolution channel and the second convolution channel, the mask feature vector output by the first convolution channel is subjected to a dot product operation with the array vector matrix, that is, the eye mask feature matrix represented by the mask feature vector is multiplied with the array vector matrix.

[0114] S1314: Map the result obtained by the addition operation through a preset hyperbolic tangent function to generate the second target image.

[0115] After the mask feature vector output by the first convolution channel is dot-producted with the array vector matrix to obtain a dot product result, the vector matrix obtained by the dot product result is added to the feature vector output by the second convolution channel.

[0116] After the calculation result is obtained by the addition operation, the calculation result needs to be mapped. The mapping method is: the calculation result is mapped by the hyperbolic tangent function. The hyperbolic tangent function (tanh) is the ratio of the hyperbolic sine function (sinh) to the hyperbolic cosine function (cosh), which can map the calculation result obtained by the addition operation within the value range of [-1,1]. Finally, the mapped vector matrix is ​​pixelated to generate the second target image.

[0117] In some implementations, the image format conversion model needs to be trained by supervised training. For training methods, please refer to Figure 3 , Figure 3 Schematic diagram of the training process of the image format conversion model in this embodiment.

[0118] like Figure 3 As shown, the image format conversion model training method is as follows:

[0119] S1411, reading the training samples to be processed;

[0120] In this embodiment, a training sample is constructed, and the training sample includes a training image and an annotated image, wherein the training image is an image directly acquired by a mobile terminal, and the annotated image is a high-dynamic image synthesized from multiple sample images. Therefore, compared with the training image, the standard image has a higher information carrying capacity. The data format of the training image is a first data format, and the data format of the annotated image is a second data format. The training sample consisting of a pair of training images and annotated images can enable the supervised training model to have the ability to convert the first data format into the second data format.

[0121] In this embodiment, a training sample includes a training image and a labeled image, and the training sample is stored in a training set. The training set includes a plurality of training samples, and during training, a training sample is randomly selected to train the pre-trained model.

[0122] S1412, performing image enhancement processing on the training sample according to a preset image enhancement strategy;

[0123] In this embodiment, in order to make the trained image format conversion model more robust, the training images need to be enhanced before the training samples are input into the model. The enhancement processing method includes (but is not limited to): performing one or more image processing methods of rotating, flipping, cropping and brightness adjustment on the training samples. For example, the training images are subjected to [-10%, 10%] brightness adjustment processing.

[0124] S1413, inputting the training samples after image enhancement processing into a preset non-convergence model, wherein the non-convergence model is an initialization model of the image format conversion model;

[0125] The training image after image enhancement is input into the preset non-convergent model, which is the initialization model of the image format conversion model. The non-convergent model extracts features and converts data formats from the training image. However, since the non-convergent model is not trained, the output result is an impulsive output with high randomness, which cannot meet the needs of directional image format conversion.

[0126] S1414, reading the stress image output by the non-convergent model, and calculating the loss distance between the stress image and the annotated image in the training sample according to a preset linear loss function and a nonlinear loss function;

[0127] After the training samples are input into the non-convergent model, the stress image output by the non-convergent model is read, and then the loss distance between the stress image and the annotated image is calculated by setting the linear loss function and the non-linear loss function. The characteristics of the linear loss function and the non-linear loss function are as follows:

[0128] Loss=Loss linear +Loss nonlinear

[0129] Among them, Loss represents the loss function, Loss linear Expressed as a linear loss function, Loss nonlinear It is expressed as a nonlinear loss function.

[0130] Both linear loss function and nonlinear loss function include color gamut loss function Loss color And the perceptual loss function Loss perceptual . Compared with the existing technology, the loss function is a single nonlinear loss function or a linear loss function. However, a single linear loss function cannot make the image format conversion model converge, and a single nonlinear loss function will put the image format conversion model in a distorted state. By mixing linear loss function and nonlinear loss function, the linear loss function can compensate for the model distortion caused by the nonlinear loss function, making the image format conversion model more robust and the converted image more stable.

[0131] Loss linear =Loss color +Loss perceptual

[0132] Loss nonlinear =Loss color +Loss perceptual

[0133] Perceptual loss refers to the difference in results between different feature layers of the image format conversion model. The difference is calculated using the L1 paradigm, where y is the labeled feature and y′ is the output of the image format conversion model.

[0134] Loss perceptual =L1|VGG 19 (y′-y)|

[0135] Color gamut loss uses three color gamuts for loss calculation, namely RGB, HSV, and LAB. RGB is the three primary color space, corresponding to the three colors of red, green, and blue respectively; HSV is the hue (H), saturation (S), and brightness (V) space, and the color is adjusted through the H and S channels to be closer to the color of the annotated image; in LAB, L is brightness, and AB is red and blue hue. Similar to HSV, the difference between the A and B channels is calculated to improve the accuracy of network color. The calculation of color gamut loss adopts the L1 paradigm, as shown in the following formula:

[0136] Loss color =L1|(y′ rgb -y rgb )|+L1|(y′ hsv -y hsv )|+L1|(y′ lab -y lab )|

[0137] The combination of linear and nonlinear losses can reduce image distortion and over-enhancement, and increase the expressiveness and stability of the output image of the image format conversion model.

[0138] S1415. According to the loss distance and a preset feedback function, the weight value of the non-convergent model is corrected so that the loss distance between the stress image and the annotated image approaches a preset target threshold.

[0139] The loss distance between the stress image and the annotated image is calculated, and the loss distance is calculated by the feedback function to obtain the gradient value of this round of training correction. The weight value of the non-convergent model is called back and corrected by the calculated gradient value. The result of the callback correction can make the weight value in the non-convergent model be adjusted in a targeted manner. The purpose of the targeted adjustment is to make the loss distance between the stress image and the annotated image approach the preset target threshold. The target threshold can be set according to actual needs. The supervised training process is a gradient descent training process. The above S1411-S1415 process is a complete gradient descent process. Through several rounds of training samples, when the number of training times reaches the set value or the accuracy of the output image reaches the set threshold, the non-convergent model is trained to a convergent state and becomes an image format conversion model.

[0140] Please refer to Figure 4 , Figure 4 FIG. 1 is a schematic diagram of the basic structure of the image format conversion device of this embodiment.

[0141] like Figure 4 As shown, an image format conversion device includes: an acquisition module 1100, a processing module 1200 and an execution module 1300. The acquisition module 1100 is used to acquire a first target image in a first data format; the processing module 1200 is used to input the first target image into a preset image format conversion model, wherein the image format conversion model is pre-constrained to a convergence state through linear loss and nonlinear loss, and is a neural network model for format conversion of an image; the execution module 1300 is used to read a second target image output by the image format conversion model, wherein the second target image format is a second data format, and the information carrying capacity of the second data format is greater than the information carrying capacity of the first data format.

[0142] The image format conversion device pre-trains an image format conversion model, which is a neural network model, and can convert the format of the image input therein, thereby increasing the information carrying capacity of the input image and the amount of information in the image. Therefore, when a user uses a shooting device to shoot a first target image in a first data format, the first target image is input into the image format conversion model, and the image format conversion model performs format conversion on the first target image, so that the first target image is converted into a second target image in a second data format. The information carrying capacity of the second data format is greater than that of the first data format, and the second target image after format conversion has a higher image quality. The above method can quickly improve the image quality, break through the limitations of the hardware performance of the shooting device, and meet the needs of users.

[0143] Optionally, the image format conversion model includes: a first convolution channel and a second convolution channel, and the feature output by the first convolution channel is a mask feature vector, and the feature output by the second convolution channel is a convolution feature vector.

[0144] Optionally, the first convolution channel includes: a first convolution layer and a first attention layer, the first convolution layer is cascaded with the first attention layer, and the first attention layer is connected to the output end of the first convolution layer, and the first attention layer includes a channel attention layer.

[0145] Optionally, the second convolution channel includes: a plurality of cascaded feature layers, the output end of each feature layer is connected to a second attention layer, and the second attention layer includes a channel attention layer and a spatial attention layer.

[0146] Optionally, each of the feature layers includes: a plurality of cascaded second convolutional layers, the output end of each of the second convolutional layers is connected to a linear rectification layer, and the output of any linear rectification layer serves as the input of all the second convolutional layers arranged after any linear rectification layer.

[0147] Optionally, the image format conversion device further includes:

[0148] A first reading submodule, used for reading the mask feature vector output by the first convolution channel;

[0149] A first operator module, configured to perform a dot product operation on the mask feature vector and the array vector matrix of the first target image;

[0150] A second operator module, used for performing an addition operation on a result of the dot product operation and a feature vector output by the second convolution channel;

[0151] The first generating submodule is used to generate the second target image by mapping the result obtained by the addition operation through a preset hyperbolic tangent function.

[0152] Optionally, the image format conversion device further includes:

[0153] A second reading submodule is used to read the training samples to be processed;

[0154] A first enhancement submodule, used for performing image enhancement processing on the training sample according to a preset image enhancement strategy;

[0155] A first processing submodule, used for inputting the training samples after image enhancement processing into a preset non-convergence model, wherein the non-convergence model is an initialization model of the image format conversion model;

[0156] A third calculation submodule is used to read the stress image output by the non-convergent model, and calculate the loss distance between the stress image and the annotated image in the training sample according to a preset linear loss function and a nonlinear loss function;

[0157] The first execution submodule is used to perform callback correction on the weight value of the non-convergence model according to the loss distance and a preset feedback function, so that the loss distance between the stress image and the annotated image approaches a preset target threshold.

[0158] To solve the above technical problems, the present application also provides a computer device. Figure 5 , Figure 5 This is a basic structural block diagram of the computer device in this embodiment.

[0159] like Figure 5As shown, a schematic diagram of the internal structure of a computer device. The computer device includes a processor, a non-volatile storage medium, a memory, and a network interface connected via a system bus. Among them, the non-volatile storage medium of the computer device stores an operating system, a database, and computer-readable instructions. The database may store a control information sequence. When the computer-readable instructions are executed by the processor, the processor can implement an image format conversion method. The processor of the computer device is used to provide computing and control capabilities to support the operation of the entire computer device. The memory of the computer device may store computer-readable instructions. When the computer-readable instructions are executed by the processor, the processor can execute an image format conversion method. The network interface of the computer device is used to connect and communicate with a terminal. Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0160] In this embodiment, the processor is used to execute Figure 4 The memory stores the program codes and various data required to execute the above modules. The network interface is used to transmit data between user terminals or servers. The memory in this embodiment stores the program codes and data required to execute all submodules in the image format conversion device, and the server can call the program codes and data of the server to execute the functions of all submodules.

[0161] The computer device pre-trains an image format conversion model, which is a neural network model, and can convert the format of the image input therein, thereby increasing the information carrying capacity of the input image and the amount of information in the image. Therefore, when a user uses a shooting device to shoot a first target image in a first data format, the first target image is input into the image format conversion model, and the image format conversion model converts the format of the first target image, so that the first target image is converted into a second target image in a second data format. The information carrying capacity of the second data format is greater than that of the first data format, and the second target image after the format conversion has a higher image quality. The above method can quickly improve the image quality, break through the limitations of the hardware performance of the shooting device, and meet the needs of users.

[0162] The present application also provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the image format conversion method in any of the above embodiments.

[0163] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0164] Those skilled in the art will appreciate that the various operations, methods, steps, measures, and schemes in the processes discussed in this application may be alternated, altered, combined, or deleted. Further, other steps, measures, and schemes in the various operations, methods, and processes discussed in this application may also be alternated, altered, rearranged, decomposed, combined, or deleted. Further, the steps, measures, and schemes in the prior art that are similar to those disclosed in this application may also be alternated, altered, rearranged, decomposed, combined, or deleted.

[0165] The above description is only a partial implementation method of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for image format conversion, characterized in that: include: Acquire a first target image in a first data format; Inputting the first target image into a preset image format conversion model, wherein the image format conversion model is pre-constrained to a convergence state through linear loss and nonlinear loss, and is a neural network model for performing format conversion on the image; Reading a second target image output by the image format conversion model, wherein the second target image format is a second data format, and the information carrying capacity of the second data format is greater than the information carrying capacity of the first data format; The image format conversion model includes: a first convolution channel and a second convolution channel, wherein the feature output by the first convolution channel is a mask feature vector, and the feature output by the second convolution channel is a convolution feature vector; The reading of the second target image output by the image format conversion model comprises: Reading the mask feature vector output by the first convolution channel; Performing a dot product operation on the mask feature vector and the array vector matrix of the first target image; Performing an addition operation on the result of the dot product operation and the feature vector output by the second convolution channel; The result obtained by the addition operation is mapped through a preset hyperbolic tangent function to generate the second target image.

2. The image format conversion method according to claim 1, characterized in that: The first convolution channel includes: a first convolution layer and a first attention layer, the first convolution layer is cascaded with the first attention layer, and the first attention layer is connected to the output end of the first convolution layer, and the first attention layer includes a channel attention layer.

3. The image format conversion method according to claim 1, characterized in that: The second convolution channel includes: a plurality of cascaded feature layers, the output end of each feature layer is connected to a second attention layer, and the second attention layer includes a channel attention layer and a spatial attention layer.

4. The image format conversion method according to claim 3, characterized in that: Each of the feature layers includes: a plurality of cascaded second convolutional layers, the output end of each of the second convolutional layers is connected to a linear rectification layer, and the output of any linear rectification layer serves as the input of all the second convolutional layers arranged after any linear rectification layer.

5. The image format conversion method according to any one of claims 1 to 4, characterized in that: The training method of the image format conversion model is: Read the training samples to be processed; According to a preset image enhancement strategy, performing image enhancement processing on the training sample; Inputting the training samples after image enhancement processing into a preset non-convergence model, wherein the non-convergence model is an initialization model of the image format conversion model; Reading the stress image output by the non-convergent model, and calculating the loss distance between the stress image and the annotated image in the training sample according to a preset linear loss function and a nonlinear loss function; According to the loss distance and a preset feedback function, the weight value of the non-convergent model is called back and corrected so that the loss distance between the stress image and the annotated image approaches a preset target threshold.

6. An image format conversion device, characterized in that: include: An acquisition module, used for acquiring a first target image in a first data format; A processing module, used for inputting the first target image into a preset image format conversion model, wherein the image format conversion model is pre-constrained to a convergence state through linear loss and nonlinear loss, and is used for a neural network model for format conversion of an image; An execution module, configured to read a second target image output by the image format conversion model, wherein the second target image format is a second data format, and an information carrying capacity of the second data format is greater than an information carrying capacity of the first data format; The image format conversion model includes: a first convolution channel and a second convolution channel, wherein the feature output by the first convolution channel is a mask feature vector, and the feature output by the second convolution channel is a convolution feature vector; The image format conversion device also includes: A first reading submodule, used for reading the mask feature vector output by the first convolution channel; A first operator module, configured to perform a dot product operation on the mask feature vector and the array vector matrix of the first target image; A second operator module, used for performing an addition operation on a result of the dot product operation and a feature vector output by the second convolution channel; The first generating submodule is used to generate the second target image by mapping the result obtained by the addition operation through a preset hyperbolic tangent function.

7. A computer storage medium, characterized in that: When the computer-readable instructions are executed by one or more processors, the one or more processors are caused to perform the steps of the image format conversion method according to any one of claims 1 to 5.

8. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method described in any one of claims 1 to 5 are implemented.