Image signal processing method and system and storage medium

By dividing the image signal processing process into two parts: traditional and artificial intelligence-based, and using the preset image signal processing model to process the image again, the problem of a large parameter library and long development cycle in the existing technology is solved, and the image quality is significantly improved. The quality, especially in terms of peak signal-to-noise ratio and structural similarity index, is good.

CN118803434APending Publication Date: 2024-10-18SHENZHEN KANDAO TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410824639.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-25
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

Existing image signal processing systems face problems such as large parameter libraries, difficulty in debugging, and long development cycles. Especially when image processing scenarios become complex and special requirements for image quality increase, it is difficult to effectively improve image quality.

Method used

The image signal processing process is divided into the first image signal processing related to the non-shared parameters of the shooting device using traditional methods, combined with the image signal processing model based on artificial intelligence for the second image signal processing, and the preset image signal processing model is used to perform the second image signal processing. After the first processing, the image is processed again to generate a display format image.

Benefits of technology

The image quality is significantly improved, especially in terms of peak signal-to-noise ratio, structural similarity index and chroma channel, and it simplifies the parameter debugging and development process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118803434A_ABST
    Figure CN118803434A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses an image signal processing method and system and a storage medium, and is applied to the technical field of image processing. According to the image signal processing system, ISP processing carried out on an image in an original shooting format is divided, one part of first image signal processing related to non-shared parameters of a shooting device is carried out by adopting a traditional method, and the other part of second image signal processing is carried out by adopting a mode based on artificial intelligence. Namely, a preset image signal processing model is adopted for processing. Compared with the quality of the display format images obtained by adopting the method of the embodiment and the quality of the display format images obtained by adopting the traditional ISP processing, the quality of the display format images obtained by adopting the method of the embodiment can be well improved, and particularly, the quality of the display format images obtained by adopting the method of the embodiment is excellent in the aspects of peak signal-to-noise ratio, structural similarity index, chromaticity channel and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to an image signal processing method, system and storage medium. Background Art

[0002] The optical image of natural objects generated by the camera lens (Lens) is projected onto the surface of the image sensor (Color Filter Array Sensor) using a color filter array. It is first converted into an analog electrical signal through photoelectric conversion, and then converted into a digital image signal through an analog to digital converter (A / D), that is, a Bayer format image. It is then sent to the digital signal processing chip (Digital Signal Processor, DSP) for image signal processing (Image Signal Processing, ISP) to form an RGB format image.

[0003] General ISP processing may include: black level compensation, lens shading correction, bad pixel correction, color interpolation, Bayer noise removal, white balance correction, color correction, Gamma correction, color space conversion, color noise removal and edge enhancement in YUV color space, color and contrast enhancement, etc. With the increasing complexity of image processing scenarios and the improvement of special requirements for image quality, general ISP faces challenges such as huge parameter library, difficult debugging and long development cycle. Summary of the invention

[0004] The embodiments of the present invention provide an image signal processing method, system and storage medium, which improve the quality of processed images.

[0005] An embodiment of the present invention provides an image signal processing method, including:

[0006] Get the original image format;

[0007] Performing a first image signal processing on the original shooting format image to obtain a first processed image; the first image signal processing is a processing related to non-shared parameters of the shooting device;

[0008] The image after the first processing is processed again according to a preset image signal processing model to obtain a display format image. The image signal processing model is used to perform a second image signal processing on the image after the first processing, and the second image signal processing is other image signal processing other than the first image signal processing.

[0009] Another aspect of the present invention provides an image signal processing system, including:

[0010] The original image unit is used to obtain the original shooting format image;

[0011] a first processing unit, configured to perform a first image signal processing on the original shooting format image to obtain a first processed image; the first image signal processing is a processing related to non-shared parameters of the shooting device;

[0012] A reprocessing unit is used to reprocess the image after the first processing according to a preset image signal processing model to obtain a display format image. The image signal processing model is used to perform a second image signal processing on the image after the first processing, and the second image signal processing is other image signal processing other than the first image signal processing.

[0013] Another aspect of the embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a plurality of computer programs, wherein the computer programs are suitable for being loaded by a processor and executing the image signal processing method as described in one aspect of the embodiment of the present invention.

[0014] In the method of this embodiment, the image signal processing system divides the ISP processing of the original shooting format image, a part of the first image signal processing related to the non-shared parameters of the shooting device is performed by a traditional method, and another part of the second image signal processing is processed by an artificial intelligence-based method, that is, a preset image signal processing model is used. The quality of the display format image obtained by the method of this embodiment and the traditional ISP processing is compared. The quality of the display format image obtained by the method of this embodiment can be well improved, especially in terms of peak signal-to-noise ratio, structural similarity index and chromaticity channel. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0016] Figure 1 is a schematic diagram of an image signal processing method provided by an embodiment of the present invention;

[0017] Figure 2 is a flow chart of an image signal processing method provided by an embodiment of the present invention;

[0018] Figure 3 is a flow chart of a method for training an image signal processing model in one embodiment of the present invention;

[0019] Figure 4 is a schematic diagram of an initial model for image signal processing in one embodiment of the present invention;

[0020] Figure 5 is a schematic diagram of a VGG16 network in one embodiment of the present invention;

[0021] Figure 6 is a schematic diagram of calculating the adversarial loss function in one embodiment of the present invention;

[0022] Figure 7 is a flow chart of an image signal processing method provided by a specific application embodiment of the present invention;

[0023] Figure 8 is a flowchart of training an image signal processing model in a specific application embodiment of the present invention;

[0024] Fig. 9 is a schematic diagram of the logical structure of an image signal processing system provided by an embodiment of the present invention;

[0025] Fig.10 It is a schematic diagram of the logical structure of a server provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0026] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0027] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can, for example, be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0028] The embodiment of the present invention provides an image signal processing method, which can be mainly applied to the process of processing the original shooting format image to obtain the display format image after the image is shot by the shooting device, such as Figure 1 As shown, the image signal processing system can perform the following image signal processing:

[0029] Acquire an original shooting format image; perform a first image signal processing on the original shooting format image to obtain a first processed image; the first image signal processing is a processing related to non-shared parameters of a shooting device; and re-process the first processed image according to a preset image signal processing model to obtain a display format image, wherein the image signal processing model is used to perform a second image signal processing on the first processed image, and the second image signal processing is other image signal processing other than the first image signal processing.

[0030] Among them, the image signal processing system can be applied to terminal devices or servers. The terminal devices may include but are not limited to the following electronic devices that require image processing: mobile phones, computers, intelligent voice interaction devices, smart home appliances, car terminals, etc.

[0031] The above preset image signal processing model is a machine learning model based on artificial intelligence, which can be trained by certain methods. Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that the machines have the functions of perception, reasoning and decision-making.

[0032] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics and other technologies. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, machine learning and / deep learning.

[0033] Machine Learning (ML) is a multi-disciplinary subject that involves probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and teaching learning.

[0034] In this way, the quality of the display format image obtained by the method of this embodiment and the quality of the display format image obtained by traditional ISP processing are compared. The quality of the display format image obtained by the method of this embodiment can be greatly improved, especially in terms of peak signal-to-noise ratio, structural similarity index and chromaticity channel.

[0035] An embodiment of the present invention provides an image signal processing method, which is mainly a method executed by an image signal processing system. The flow chart is as follows: Figure 2 As shown, including:

[0036] Step 101: Acquire an image in the original shooting format.

[0037] It can be understood that when the shooting device shoots an image, the optical image of the object generated by the camera lens is projected onto the surface of the image sensor using the color filter array, which is first converted into an analog electrical signal through photoelectric conversion, and then converted into a digital image signal after passing through an analog-to-digital converter, that is, an image in Bayer format. In this embodiment, the image in Bayer format can be used as the original shooting format image. In order to meet the special scene requirements and special quality requirements of different users for shooting images, it is necessary to perform image signal processing, that is, ISP processing, on the original shooting format image to obtain a display format image, such as a lossy compression format (joint photographic experts group, IPEG) image.

[0038] Specifically, the image signal processing performed on the original shooting format image may include but is not limited to the following processing: black level compensation (Black Level Compensation), lens shading correction (Lens Shading Correction), bad pixel correction (Bad Pixel Correction), color interpolation (Demosaic), Bayer noise removal, white balance (Auto white balance, AWB) correction, color correction (Color Correction Matrix, CCM), Gamma correction, demosaicing (Demosaicing), color space conversion (RGB to YUV), color noise removal and edge enhancement in YUV color space, color and contrast enhancement, and automatic exposure control in the middle.

[0039] Step 102 , performing a first image signal processing on the original shooting format image to obtain a first processed image. Here, the first image signal processing is a processing related to non-shared parameters of the shooting device.

[0040] The first image signal processing here mainly refers to the processing related to the non-shared parameters of the shooting device. The non-shared parameters here do not refer to the parameters that are shared (i.e., the same) by all shooting devices. The non-shared parameters of different shooting devices are different, and the shooting device refers to the device used to shoot the above-mentioned original shooting format image. For example, black level correction, normalization, automatic white balance, color correction, de-mosaicing, etc., mainly involve basic color correction, color space conversion and color detail restoration and other processing, which have high requirements for accuracy and stability, and different shooting devices have different parameters based on these processing, which are related to the non-shared parameters of the shooting device. In this embodiment, the first image signal processing of the original shooting format image is performed by the traditional method, which can provide accurate and stable processing results, because it is based on long-term accumulated experience, strict mathematical models and optimized algorithms.

[0041] Step 103, reprocessing the image after the first processing according to a preset image signal processing model to obtain a display format image, the image signal processing model is used to perform a second image signal processing on the image after the first processing, and the second image signal processing is other image signal processing other than the above-mentioned first image signal processing.

[0042] Here, the image signal processing model is a machine learning model based on artificial intelligence, which can be trained through a certain training method, and the running program of the image signal processing model is pre-set to the image signal processing system. When the image signal processing flow of this embodiment is initiated, the image signal processing model can be directly called to realize re-processing of the image after the first processing.

[0043] The second image signal processing here refers to other image signal processing in addition to the above-mentioned first image signal processing, which is generally related to the shared parameters of the shooting device. The shared parameters here refer to the parameters that can be shared (i.e., the same) by all shooting devices, such as parameters focusing on color restoration, detail texture restoration, brightness adjustment, contrast adjustment, and noise removal. These processes contain complex data features such as color, texture, brightness, contrast, and noise. The parameters based on these processes of different shooting devices can be the same.

[0044] It can be seen that in the method of this embodiment, the image signal processing system divides the ISP processing of the original shooting format image, a part of the first image signal processing related to the non-shared parameters of the shooting device is performed by a traditional method, and the other part of the second image signal processing is processed by an artificial intelligence-based method, that is, a preset image signal processing model is used. The quality of the display format image obtained by the method of this embodiment and the traditional ISP processing is compared. The quality of the display format image obtained by the method of this embodiment can be well improved, especially in terms of peak signal-to-noise ratio, structural similarity index and chromaticity channel.

[0045] In a specific embodiment, the training of the image signal processing model used in the above step 103 can be implemented according to the following supervised training method, as shown in the flowchart: Figure 3 As shown, including:

[0046] Step 201: determine an initial model for image signal processing.

[0047] It can be understood that when the image signal processing system determines the initial model of image signal processing, it will determine the multi-layer structure included in the initial model of image signal processing and the initial values ​​of the parameters in each layer structure. Among them, the parameters of the initial model of image signal processing refer to the fixed parameters used in the calculation process of each layer structure in the initial model of image signal processing, which do not need to be assigned at any time, such as parameter scale, weight value, user vector length and other parameters.

[0048] Specifically, the image signal processing initial model is specifically used to perform a second image signal processing on the first processed image (obtained after the first image signal processing) and output a display format image. In the specific implementation process, Figure 3 As shown, the image signal processing initial model may include an image signal processing network based on a multi-level wavelet transform of a convolutional network for image segmentation (Convolutional Networks for Biomedical Image Segmentation, U-Net), which may include a multi-layer U-Net ( Figure 3In the figure, a two-layer U-Net is used as an example. Each layer of U-Net may include: a wavelet transform downsampling layer, a wavelet transform upsampling layer, a convolution and activation layer, and a residual module. In a multi-layer U-Net, any layer of U-Net is nested in another layer of U-Net.

[0049] Among them, the residual module can be specifically composed of a residual channel attention module (RCAB), which can minimize the information loss in these layers.

[0050] Step 202: determine training samples, where the training samples include multiple groups of sample images, and each group of sample images includes an original captured sample image and its corresponding displayed sample image.

[0051] Specifically, when determining the training samples, each original shot sample image can be directly subjected to traditional ISP processing in the shooting device to obtain the corresponding display sample image; or the original shot sample image can be processed using an image editing program (such as PS software, etc.) to obtain the corresponding display sample image.

[0052] Step 203: adjust the initial image signal processing model according to the initial image signal processing model and the training samples to obtain the above-mentioned preset image signal processing model.

[0053] Specifically, the image signal processing system can first perform the above-mentioned first image signal processing on each original captured sample image to obtain a first processed image, and then perform a second image signal processing on the first processed image through the image signal processing initial model to obtain a corresponding display format image; then, based on each display format image obtained by the image signal processing initial model and the corresponding display sample image in the training sample, calculate the loss function related to the image signal processing initial model; and then adjust the parameter values ​​in the image signal processing initial model according to the calculated loss function.

[0054] Furthermore, the training process of the image signal processing model is to minimize the value of the above loss function. The training process continuously optimizes the parameter values ​​of the parameters in the image signal processing initial model determined in the above step 201 through a series of mathematical optimization methods such as back propagation derivation and gradient descent, and reduces the calculated value of the above loss function to the minimum.

[0055] It should be noted that the above steps 202 to 203 are an adjustment of the parameter values ​​in the initial model of image signal processing for each display format image obtained by the initial model of image signal processing. In actual applications, it is necessary to continuously loop through the above steps 202 to 203 until the adjustment of the parameter values ​​meets certain stop conditions.

[0056] Therefore, after executing steps 201 to 203 of the above embodiment, the image signal processing system also needs to determine whether the current adjustment of the parameter value meets the preset stop condition. If it does, the process ends and the parameter value of the image signal processing initial model adjusted in step 203 is used as the parameter value in the image signal processing model obtained by the final training; if it does not meet the condition, the image signal processing initial model after the parameter value is adjusted returns to execute steps 202 to 203, that is, a batch of training samples is changed, and the parameter value in the image signal processing initial model is adjusted according to the changed training samples. The preset stop condition includes but is not limited to any one of the following conditions: the difference between the currently adjusted parameter value and the last adjusted parameter value is less than a threshold value, that is, the adjusted parameter value reaches convergence; and the number of parameter value adjustments is equal to the preset number of times, etc.

[0057] Among them, the loss function calculated by the image signal processing system in the process of adjusting the parameter values ​​of the initial model of image signal processing can be specifically used to indicate: the difference between the various display format images obtained by the initial model of image signal processing and the display sample images with better quality actually obtained based on the corresponding original captured sample images (i.e., the display sample images in the training samples), for example, it can be represented by a cross entropy loss function, etc.

[0058] In a specific embodiment, when the image signal processing system calculates the loss function related to the initial image signal processing model based on the display format image obtained by the initial image signal processing model and the display sample image in the training sample, it can first calculate but not limited to one or more of the following loss functions, and then calculate a first loss function as the loss function related to the initial image signal processing model based on these loss functions. For example, the first loss function is the weighted sum of these loss functions. Specifically, these loss functions may include:

[0059] (1) Pixel loss function Loss L1

[0060] The pixel loss function L1 is a loss function that measures the difference between the display format image obtained by the initial model of image signal processing and the corresponding display sample image in the training sample at the pixel level. The pixel loss function helps to improve the stability and detail retention ability of the initial model of image signal processing for the image. Through the characteristics of noise resistance, image detail maintenance, sparsity, etc., the generated display format image is more in line with human eye perception, clearer and more stable. For an original captured sample image, the pixel loss function is calculated as follows: With the corresponding display sample image y i The average of the absolute differences between them is shown in the following formula 1, where n is the number of original sample images in the training sample:

[0061]

[0062] (2) Perceptual Loss Function vgg

[0063] The perceptual loss function is also called the mean square error (MSE), which is a common indicator for measuring the difference between two values. In this embodiment, it is the mean square value of the difference between the high-order features of the display format image obtained by the initial model of image signal processing and the high-order features of the corresponding display sample image in the training sample. It can be specifically expressed by the following formula 2:

[0064]

[0065] In this embodiment, X and Y in the above formula 2 can be respectively the high-order feature features of the display format image obtained by the initial model of image signal processing and the corresponding display sample image in the training sample. y and Specifically, a pre-trained Visual Geometry Group (VGG) 16 network can be used to extract features from the display format image obtained by the initial model of image signal processing and the corresponding display sample image in the training sample.

[0066] Among them, Figure 5 As shown in the figure, the VGG16 network is a deep neural network that can extract high-order features. It can include 16 hidden layers (13 convolutional layers and 3 fully connected layers). The use of the perceptual loss function based on the VGG16 network helps the initial model of image signal processing to learn the detailed information of the image.

[0067] (3) Structural loss function Loss ssim

[0068] The structural loss function is also called the structural similarity index (SSIM) loss function, which is an indicator for measuring the similarity between two images. In this embodiment, the two images are specifically display format images obtained by the initial model of image signal processing. The sample image y is displayed corresponding to the training sample. The SSIM of the two images takes into account multiple aspects of information such as brightness, contrast and structure. The value range of SSIM is usually between [0,1]. The closer to 1, the more similar the two images are. This structural loss function helps the initial model of image signal processing capture the structure and texture in the image, thereby generating a high-quality image that takes into account the image features more comprehensively. Among them, the SSIM of the two images can be obtained by the following formula:

[0069] Formula 3 is used to express:

[0070]

[0071] Where C1 = (K1L) 2 , C2=(K2L) 2 , L = 2 B -1,u y , They represent the mean of the two images respectively. They represent the variance of the two images, represents the covariance of the two images, C1 and C2 are stability coefficients, K1 and K2 are the default parameters 0.01 and 0.03, and B is the image bit depth. The structural loss function includes the display format image obtained by the initial model of image signal processing. The SSIM between the corresponding display sample image y in the training sample can be specifically expressed by the following formula 4:

[0072] Loss ssim =1-SSIM (4)

[0073] Further, in order to enable the trained image signal processing model to process the image signal more accurately, after adjusting the parameter values ​​in the image signal processing initial model through the first loss function calculated in the above steps 201 to 203, a preliminary image signal processing initial model is obtained. In other embodiments, the parameter values ​​in the preliminary image signal processing initial model may be further fine-tuned. The fine-tuning method is similar to the above method of adjusting the parameter values ​​in the image signal processing initial model through the first loss function. The difference is that in the fine-tuning process, one or more of the following loss functions are mainly calculated first, but not limited to, and then a second loss function is calculated based on these loss functions as a loss function related to the image signal processing initial model. For example, the second loss function is a weighted sum of these loss functions, or the second loss function is a weighted sum of these loss functions and the above first loss function. Specifically, these loss functions may include:

[0074] (1) Chroma channel loss function Loss UV

[0075] The chroma channel (UV) loss function is a method for measuring the difference between the generated image and the target image in the UV color space. Compared with the RGB channel, the UV channel is more sensitive to color changes, and these changes can more effectively affect the human eye's perception of color. In this embodiment, the UV loss function is used as a measure of the difference between the display format image of the initial model of image signal processing and the chroma channel of the corresponding display sample image in the training sample. The introduction of the UV loss function can enable the image signal processing model to learn and adjust the color more carefully, thereby reducing the perceived color error.

[0076] Specifically, the Gaussian blur operator G(x) with a mean of 0 and a variance of σ of 20 as shown in the following formula 5 is used to blur the display format image obtained by the initial model of image signal processing and the display sample image in the training sample to obtain the blurred image; then the blurred image is mapped from RGB to YUV color space using linear transformation to obtain and G(y) i ; Finally, the loss function between the UV channels of the display format image obtained by the initial model of image signal processing is calculated, as shown in the following formula 6:

[0077]

[0078] (2) Adversarial Loss Function GAN

[0079] The adversarial loss function L1 is a loss function obtained based on a generative adversarial network (GAN). The GAN network is a deep learning framework consisting of a generator and a discriminator. The generator and the discriminator are trained in the GAN network through adversarial training.

[0080] In this embodiment, the generator is specifically the above-mentioned initial model for image signal processing, and its purpose is to make the display format image generated by the initial model for image signal processing close to the display sample image in the training sample, and the discriminator discriminates the display format image as the display sample image. The purpose of the discriminator is to accurately discriminate whether the input image is a display sample image or a display format image generated by the generator. The scalar real=1 is usually used to indicate that the discriminator is very sure that the input image is a display sample image, and the scalar fake=0 is used to indicate that the discriminator is very sure that the input image is a non-display sample image.

[0081] Specifically, in this embodiment, the PatchGAN structure is mainly used for the selection of the discriminator, because the PatchGAN discriminator discriminates the local area of ​​the image, and its output is an N*N matrix X. Each element X[i][j] of the matrix X is also called a local area (Patch), which represents the discriminant output of the discriminator for a local receptive field of the input image. Finally, the mean of each patch is taken as the discriminant output of the discriminator PatchGAN for the input image. This local area judgment helps the initial model of image signal processing to better generate realistic local details and textures of the image in the adversarial learning process, which is of great significance to improving the overall quality and authenticity of the display format image obtained by the image signal processing model.

[0082] In the training process of this embodiment, the generator (i.e., the initial model of image signal processing) and the discriminator are trained alternately so that they compete with each other and learn from each other, and eventually the display format image obtained by the initial model of image signal processing is close to the display sample image in the training sample, and the discriminator cannot accurately distinguish the difference between the display format image and the display sample image.

[0083] Specific as Figure 6 The adversarial training of the generator and the discriminator shown in the figure, in this process, the image signal is first processed by the initial model to obtain the display format image The input is passed to the discriminator for judgment, and the output judgment is the probability of displaying the sample image The adversarial loss function Loss is calculated using this probability GAN , the parameters of the initial model (i.e., generator) for image signal processing are updated through optimization algorithms such as back propagation and gradient descent. The adversarial loss function includes the probability that the display format image obtained by the initial model of the image signal is discriminated as the corresponding display sample image by the discriminator, aiming to minimize the probability that the display format image is discriminated as a non-display sample image by the discriminator, and is used to guide the display format image obtained by the generator to approach the display sample image. Specifically, it can be expressed by the following formulas 7 and 8, where real is 1, indicating that the discriminator is very sure that the display format image A sample image is displayed:

[0084]

[0085] Furthermore, after completing the update of the generator parameters, the display format image obtained by the image signal processing initial model is and the displayed sample image y in the training sample are input into the discriminator to obtain the corresponding probabilities and P y , and calculate the loss function L2 with real and fake respectively, and get two loss functions loss realand loss fake , and finally the average is obtained to obtain the adversarial loss function Loss of the discriminator PatchGAN , which aims to minimize the probability that the display sample image is mistakenly identified as a non-display sample image, and minimize the probability that the display format image is mistakenly identified as a display sample image. Specifically, it can be expressed by the following formulas 9 to 11:

[0086] loss real =L2(PatchGAN(y),real) (9)

[0087]

[0088] After calculating the adversarial loss function of the discriminator, the parameters of the discriminator are updated through optimization algorithms such as back propagation and gradient descent. The steps of updating the initial model of the image signal (i.e., the generator) and updating the discriminator are performed alternately. This alternating training method helps to balance the learning process of the generator and the discriminator, preventing one of them from being too powerful and causing unstable training. At the same time, such a strategy also enables the generator and the discriminator to confront and learn from each other, and ultimately achieve the goal of generating images that are close to good quality.

[0089] The following is a specific application example to illustrate the image signal processing method in the embodiment of the present invention. Figure 7 As shown, the specific process may include the following:

[0090] Step 301: Acquire an image in an original shooting format shot by a shooting device, which may specifically be an image in a Bayer format.

[0091] Step 302, performing black level correction and normalization processing on the original shooting format image to obtain a normalized image, specifically:

[0092] The sensors and hardware configurations of different shooting devices may be quite different, resulting in different black level and white level values. In this embodiment, the traditional black level correction and normalization processing is adopted. Specifically, the original shooting format image Image unit16The data type is converted from uint16 to float32 to ensure that there is no overflow in numerical calculations. Then, the black level value is subtracted from each pixel of the converted image, and the value less than 0 is truncated to 0, which is the BLC process; finally, the corrected image value is divided by the difference between the white level white_level and the black level black_level, and the dynamic range of the image is normalized to [0,1] to obtain the normalized image. This is convenient for subsequent numerical calculations and allows the image to present appropriate contrast and details under different lighting conditions. Specifically, it can be expressed by the following formula 12: The above process is expressed by the following formula:

[0093]

[0094] Step 303, performing a demosaicing process on the normalized image to obtain a demosaiced image. Specifically:

[0095] The original shooting format, namely the Bayer format image, is a color filter array image that supports different formats. Each pixel contains only red, green, and blue (R, G, B) monochromatic light, rather than complete RGB information. Therefore, it is necessary to convert the single-channel image into a complete RGB color image through a demosaicing algorithm to obtain a demosaiced image. Among them, demosaicing mainly reconstructs the original shooting format image into a complete RGB image by interpolation. Taking the bilinear interpolation algorithm as an example, it interpolates in the horizontal and vertical directions and estimates the missing color channel by weighted averaging of the surrounding pixels. Specifically, interpolation can be performed in the horizontal and vertical directions to estimate the G channel pixels by the following formula 13:

[0096]

[0097] As shown in Equation 14 below, interpolation is performed in the diagonal direction to estimate the R and B channel pixels:

[0098]

[0099] As shown in the following formula 15, the complete RGB image is obtained by using the interpolated G, R, and B channel values:

[0100]

[0101] Since the Bayer format is not fixed and there are many different formats, different cameras will choose different Bayer formats. The de-mosaicing process for each Bayer format involves complex image features, nonlinear relationships, etc. The traditional de-mosaicing process has unique advantages because it can directly restore the complete RGB information through interpolation, support different Bayer formats, have good anti-aliasing effects, retain image details and edges, and accurately restore color information.

[0102] Step 304, performing white balance processing on the demosaiced image to obtain a white balanced image. Specifically:

[0103] Cameras usually use red gain (R Gain ), Green Gain (G Gain ), Blue Gain (B Gain ) to adjust the white balance so that the white points in the image appear to be neutral white under various lighting conditions. Specifically, the original RGB value of each pixel is multiplied by the corresponding color gain to achieve the white balance adjustment effect. Since different camera systems use different white balance algorithms, they have different color gain parameters. In this embodiment, by directly reading the color gain parameters inside the camera, for the demosaiced image, the R, G, and B values ​​of each pixel in the demosaiced image are multiplied by the corresponding color gain to obtain the white balanced image Image wb .

[0104] Step 305, color correction is performed on the image after white balance processing to obtain a corrected image, which is the image after the first processing mentioned above. Specifically:

[0105] The camera color space is designed and implemented by the camera manufacturer to represent and process the color information captured by the camera. Different camera manufacturers may use different sensors, image processing processes, and color models, so their camera color spaces will be different. In order to ensure the color consistency of images on different hardware devices, it is necessary to map the image from the camera color space to the standard color space through color correction. The camera's color correction matrix is ​​obtained by the camera manufacturer through calibration. By multiplying the original color vector of the image by the color correction matrix, it can be mapped from the camera color space to the standard color space, so that the image presents standard colors on different devices.

[0106] Since different cameras have different color correction matrices, in this embodiment, the color correction matrix of the camera is directly read to obtain the image after white balance processing. wb Multiply by the color correction matrix M to get the corrected image Image corrected, as shown in the following formula 16:

[0107]

[0108] Step 306: Process the corrected image again according to a preset image signal processing model to obtain a display format image.

[0109] It should be noted that during the training process, the preset image signal processing model can first perform the first image signal processing in steps 302 to 305 on the original sample images according to the traditional method, which can provide a more accurate reference for the training of the image signal processing model, so that the image signal processing model can better adapt to the characteristics and hardware differences of different cameras, and improve the generalization ability of the model for different cameras. Specifically, Figure 8 As shown, the image signal processing model can be trained through the following steps:

[0110] Step 401, determining each layer structure included in the image signal processing initial model and the initial values ​​of the parameters in each layer structure. Specifically, the structure of the image signal processing initial model can be as follows: Figure 3 As shown, no further description is given here.

[0111] Step 402: determine training samples, where the training samples include multiple groups of sample images, and each group of sample images includes an original captured sample image and its corresponding displayed sample image.

[0112] Step 403, after performing the above-mentioned first image signal processing (such as the processing described in the above steps 302 to 305) on each original captured sample image to obtain a first processed image, the first processed image is subjected to a second image signal processing through the image signal processing initial model to obtain a corresponding display format image.

[0113] Step 404, calculate the above pixel loss function Loss according to each display format image obtained by the image signal processing initial model and the corresponding display sample image in the training sample L1 , Perceptual loss function Loss vgg , structural loss function Loss ssim , the first loss function is calculated according to the weighted sum of the pixel loss function, the perceptual loss function and the structural loss function, which can be specifically shown in the following formula 17:

[0114] Loss pretrain =loss L1 +loss vgg +loss ssim *0.15 (17)

[0115] Among them, the pixel loss function focuses on the precise matching of the underlying pixel level, which is an important part of ensuring the quality of the generated image, while the perceptual loss function considers the high-level perceptual features of the image, making the generated image more consistent with human eye perception. In the research of the second image signal processing based on deep learning, it is a common practice to set their weights to 1. Such a weight setting comprehensively considers information at different levels and ensures that the generated image achieves a good balance in both the underlying and high-level features.

[0116] The structural loss function further improves the structural integrity. The overall structure of the image involves the relationship between different elements, for example, the relative position between objects, the coherence of textures, etc. In this embodiment, on the basis of maintaining pixel-level and perceptual similarity, the structural loss function is introduced to participate in the training, which further promotes the generated image to better maintain the structural similarity with the displayed sample image as a whole. During the training process, it was found that the value of the structural loss function was large (of the order of 1e-1). In order to avoid excessive emphasis on the structural loss function during the training process and ignore the pixel loss function and the perceptual loss function (both of the order of 1e-2), the weight of the structural loss function was adjusted to 0.15 to keep its numerical magnitude consistent with the other two. This helps to ensure that the model takes into account detail accuracy, human eye perception similarity, and overall structural similarity when generating images.

[0117] Step 405 , adjusting the initial values ​​of the parameters in the initial model of image signal processing according to the first loss function, wherein the purpose of the adjustment is to minimize the first loss function.

[0118] Step 406, determining whether the adjustment of the parameter values ​​in the initial model of image signal processing satisfies the preset stop condition. If so, the parameter values ​​of the initial model of signal processing adjusted in the above step 405 are used as the parameter values ​​in the trained image signal processing model. If not, returning to execute the above step 402 for the initial model of image signal processing after adjusting the parameter values, that is, changing a batch of training samples, and adjusting the parameter values ​​in the initial model of image signal processing according to the changed training samples.

[0119] It should be noted that, through the above steps 401 to 406, the image signal processing model can be trained and obtained, and the image signal processing model can be tested on the test set, and the calculated peak signal-to-noise ratio (PSNR), structural similarity coefficient (SSIM) and UV value are 23.49, 0.8865 and 0.0125 respectively, that is, there is still a color error between the display format image obtained by the trained image signal processing model and the display sample image.

[0120] Thus, in a specific embodiment, the trained image signal processing model needs to be further fine-tuned. Specifically, the image signal processing model can be fine-tuned according to the above steps 402 to 406. In this process, a second loss function can be introduced, specifically a chrominance channel loss function. That is, when the parameter value in the image signal processing model is fine-tuned according to the first loss function in the above step 405, a loss function can be calculated according to the following formula 18, and the parameter value in the above trained image signal processing model can be adjusted according to the calculated loss function:

[0121] Loss finetrain =Loss pretrain +α×loss UV (18)

[0122] Among them, α represents the weight value of the chromaticity channel loss function. Since the chromaticity channel loss function is at the same order of magnitude as the pixel loss function and the perceptual loss function, in order to allow the image signal processing model to focus more on color restoration and reducing color errors during the fine-tuning stage, a relatively large weight value is assigned to the chromaticity loss function in this embodiment. When the weight values ​​of the chromaticity channel loss function are set to 1, 4, 10, 15, and 20, respectively, the results on the test set are shown in Table 1 below. It is found that when the weight value is 10, not only the UV color error can be further reduced, but also the PSNR and SSIM values ​​can be further improved.

[0123] Weight value of chroma channel loss function PSNR SSIM UV 0 23.49 0.8865 0.0125 1 23.26 0.8885 0.0119 5 23.31 0.8897 0.0122 10 24.23 0.8971 0.0113 15 24.12 0.891 0.0118 20 23.6 0.88 0.012

[0124] Table 1

[0125] In another specific embodiment, after the image signal processing model is trained through the above steps 401 to 406, in order to further enable the image signal processing model to obtain a more realistic display format image with a certain stylized effect. In this embodiment, the adversarial loss function Loss is further introduced in the fine-tuning stage. GAN ,Due to the instability of GAN network training, setting a smaller weight value of the adversarial loss function is a reasonable choice, especially in the fine-tuning stage. Because during fine-tuning, the main goal is to maintain the accurate restoration and authenticity of the image without overemphasizing the authenticity of the GAN network generation.

[0126] In this case, when further fine-tuning the trained image signal processing model, specifically, the image signal processing model can be fine-tuned according to the steps 402 to 406 above. In this process, another second loss function can be introduced, specifically an adversarial loss function, that is, when fine-tuning the parameter value in the image signal processing model according to the first loss function in the above step 405, a loss function can be calculated according to the following formula 19, and the parameter value in the above trained image signal processing model can be adjusted according to the calculated loss function:

[0127] Loss finetrain =Loss pretrain +α×loss UV +β×loss GAN (19)

[0128] In the fine-tuning stage, it is found that the numerical magnitude of the adversarial loss function is 1e-1. In order to make its numerical magnitude smaller than other loss functions, in this embodiment, the weight values ​​of the adversarial loss function are set to 0.0001, 0.001, 0.01 and 0.1 respectively. The PSNR, SSIM and UV values ​​calculated on the test set are shown in Table 2 below. It is found that when the weight value is set to 0.0001, the adversarial loss function has little effect on the image signal processing model (that is, the second row of data is close to the first row). When the weight value is set to 0.001, it can not only further reduce the UV color error, but also further improve the PSNR and SSIM values.

[0129]

[0130] Table 2

[0131] The embodiment of the present invention further provides an image signal processing system, the structural diagram of which is shown in FIG. Fig. 9 As shown, it may specifically include:

[0132] The original image unit 10 is used to obtain an image in an original shooting format.

[0133] The first processing unit 11 is used to perform a first image signal processing on the original shooting format image obtained by the original image unit 10 to obtain a first processed image; the first image signal processing is a processing related to the non-shared parameters of the shooting device. The first image signal processing may include: black level correction and normalization, white balance processing, demosaicing and color correction, etc.

[0134] The reprocessing unit 12 is used to reprocess the first processed image obtained by the first processing unit 11 according to a preset image signal processing model to obtain a display format image, and the image signal processing model is used to perform a second image signal processing on the first processed image, and the second image signal processing is other image signal processing other than the first image signal processing. The second image signal processing may include: color restoration, detail texture restoration, brightness adjustment, contrast adjustment and noise removal.

[0135] Furthermore, the image signal processing system may further include:

[0136] The training unit 13 is used to determine an initial model for image signal processing; determine training samples, wherein the training samples include multiple groups of sample images, each group of sample images includes an original captured sample image and its corresponding displayed sample image; and adjust the initial model for image signal processing according to the initial model for image signal processing and the training samples to obtain a preset image signal processing model used by the reprocessing unit 12 for the second image signal processing.

[0137] Among them, when the training unit 13 determines the initial model of image signal processing, it is specifically used to determine that the initial model of image signal processing includes: a multi-layer image segmentation convolutional network, each layer of the image segmentation convolutional network includes a wavelet transform downsampling layer, a wavelet transform upsampling layer, a convolution and activation layer and a residual module; wherein, any layer of the image segmentation convolutional network in the multi-layer image segmentation convolutional network is nested in another layer of the image segmentation convolutional network.

[0138] When the training unit 13 adjusts the initial image signal processing model according to the initial image signal processing model and the training samples, it is specifically used to perform the first image signal processing on each of the original shot sample images to obtain a first processed image, and then perform the second image signal processing on the first processed image through the initial image signal processing model to obtain a corresponding display format image; calculate the loss function related to the initial image signal processing model according to each display format image obtained by the initial image signal processing model and the corresponding display sample image in the training samples; and adjust the parameter value in the initial image signal processing model according to the loss function.

[0139] Among them, when calculating the loss function related to the initial image signal processing model according to each display format image obtained by the initial image signal processing model and the corresponding display sample image in the training sample, the specific training unit 13 is specifically used to calculate the pixel loss function, and the pixel loss function includes: the average value of the absolute difference between the display format image obtained by the initial image signal processing model and the corresponding display sample image in the training sample; calculate the perceptual loss function, and the perceptual loss function includes: the mean square value of the difference between the high-order features of the display format image obtained by the initial image signal processing model and the high-order features of the corresponding display sample image in the training sample; calculate the structural loss function, and the structural loss function includes: the structural similarity index between the display format image obtained by the initial image signal processing model and the corresponding display sample image in the training sample; calculate the first loss function as the loss function related to the initial image signal processing model according to the pixel loss function, the perceptual loss function and the structural loss function.

[0140] Furthermore, the training unit 13 is also used to calculate a chromaticity channel loss function, which is used to indicate the difference between the chromaticity channel of the display format image obtained by the image signal processing initial model and the corresponding display sample image in the training sample; calculate an adversarial loss function, which includes: the probability that the display format image obtained by the image signal initial model is discriminated by the discriminator as the corresponding display sample image; calculate a second loss function based on the chromaticity channel loss function and the adversarial loss function; and fine-tune the parameter values ​​in the image signal processing initial model based on the second loss function to obtain the preset image signal processing model.

[0141] The system of this embodiment divides the ISP processing of the original shooting format image, and a part of the first image signal processing related to the non-shared parameters of the shooting device is performed by the first processing unit 11 using a traditional method, and another part of the second image signal processing is processed by the second processing unit 12 using an artificial intelligence-based method, that is, using a preset image signal processing model. The quality of the display format image obtained by the image signal processing system of this embodiment and the traditional ISP processing is compared. The quality of the display format image obtained by the image signal processing system of this embodiment can be well improved, especially in terms of peak signal-to-noise ratio, structural similarity index and chromaticity channel.

[0142] The embodiment of the present invention further provides a server, the structural diagram of which is shown in Fig.10As shown, the server may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 20 (for example, one or more processors) and memory 21, and one or more storage media 22 (for example, one or more mass storage devices) storing application programs 221 or data 222. Among them, the memory 21 and the storage medium 22 can be short-term storage or permanent storage. The program stored in the storage medium 22 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the server. Furthermore, the central processing unit 20 can be configured to communicate with the storage medium 22 and execute a series of instruction operations in the storage medium 22 on the server.

[0143] Specifically, the application 221 stored in the storage medium 22 includes an application for image signal processing, and the program may include the original image unit 10, the first processing unit 11, the second processing unit 12 and the training unit 13 in the above-mentioned image signal processing system, which will not be described in detail here. Furthermore, the central processing unit 20 can be configured to communicate with the storage medium 22, and execute a series of operations corresponding to the application for image signal processing stored in the storage medium 22 on the server.

[0144] The server may also include one or more power supplies 23, one or more wired or wireless network interfaces 24, one or more input and output interfaces 25, and / or one or more operating systems 223, such as Windows Server TM, Mac OS X TM, Unix TM, Linux TM, FreeBSD TM, etc.

[0145] The steps performed by the image signal processing system in the above method embodiment can be based on the Fig.10 The structure of the server is shown.

[0146] Furthermore, an embodiment of the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a plurality of computer programs, wherein the computer programs are suitable for being loaded by a processor and executing the image signal processing method executed by the above-mentioned image signal processing system.

[0147] An embodiment of the present invention further provides a server, comprising a processor and a memory; the memory is used to store multiple computer programs, the computer programs are used to be loaded by the processor and execute the image signal processing method performed by the above-mentioned image signal processing system; the processor is used to implement each computer program in the multiple computer programs.

[0148] A person skilled in the art may understand that all or part of the steps in the various methods of the above-mentioned embodiments may be completed by instructing the relevant hardware through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.

[0149] The above is a detailed introduction to an image signal processing method, system, storage medium and server provided in an embodiment of the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for a person skilled in the art, according to the idea of ​​the present invention, there may be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A method for processing an image signal, It is characterized in that include: Get the original image format; Performing a first image signal processing on the original shooting format image to obtain a first processed image; The first image signal processing is processing related to non-shared parameters of the camera; The first processed image is processed again according to a preset image signal processing model to obtain a display format image. The image signal processing model is used to perform a second image signal processing on the first processed image. The second image signal processing is other image signal processing other than the first image signal processing.

2. The method according to claim 1, It is characterized in that The first image signal processing includes: black level correction and normalization, white balance processing, demosaicing and color correction; The second image signal processing includes: color restoration, detail texture restoration, brightness adjustment, contrast adjustment and noise removal.

3. The method according to claim 1 or 2, It is characterized in that The method further comprises: Determine the initial model of image signal processing; Determine a training sample, wherein the training sample includes a plurality of groups of sample images, each group of sample images includes an original captured sample image and its corresponding displayed sample image; According to the image signal processing initial model and the training samples, the image signal processing initial model is adjusted to obtain the preset image signal processing model.

4. The method according to claim 3, It is characterized in that Determine the initial model of image signal processing, including: Determining that the image signal processing initial model includes: a multi-layer image segmentation convolutional network, each layer of the image segmentation convolutional network includes a wavelet transform downsampling layer, a wavelet transform upsampling layer, a convolution and activation layer and a residual module; Among them, any layer of the convolutional network for image segmentation in the multi-layer convolutional network for image segmentation is nested in another layer of the convolutional network for image segmentation.

5. The method according to claim 4, It is characterized in that The adjusting the image signal processing initial model according to the image signal processing initial model and the training sample specifically includes: Performing the first image signal processing on each of the original shot sample images to obtain a first processed image, and then performing a second image signal processing on the first processed image using the image signal processing initial model to obtain a corresponding display format image; Calculating a loss function related to the initial image signal processing model according to each display format image obtained by the initial image signal processing model and the corresponding display sample images in the training samples; The parameter values ​​in the initial model for image signal processing are adjusted according to the loss function.

6. The method according to claim 5, It is characterized in that The step of calculating the loss function related to the initial image signal processing model according to each display format image obtained by the initial image signal processing model and the corresponding display sample image in the training sample specifically includes: Calculating a pixel loss function, the pixel loss function comprising: an average value of absolute differences between a display format image obtained by the image signal processing initial model and a corresponding display sample image in the training sample; Calculating a perceptual loss function, the perceptual loss function comprising: a mean square value of a difference between a high-order feature of a display format image obtained by the initial image signal processing model and a high-order feature of a display sample image corresponding to the training sample; Calculating a structural loss function, the structural loss function comprising: a structural similarity index between a display format image obtained by the image signal processing initial model and a corresponding display sample image in the training sample; A first loss function is calculated according to the pixel loss function, the perceptual loss function and the structural loss function as a loss function associated with the image signal processing initial model.

7. The method according to claim 6, It is characterized in that The method further comprises: Calculating a chroma channel loss function, where the chroma channel loss function is used to indicate the difference between the chroma channels of the display format image obtained by the image signal processing initial model and the corresponding display sample image in the training sample; Calculating an adversarial loss function, the adversarial loss function comprising: a probability that the display format image obtained by the image signal initial model is discriminated by the discriminator as a corresponding display sample image; Calculating a second loss function according to the chrominance channel loss function and the adversarial loss function; The parameter values ​​in the initial image signal processing model are fine-tuned according to the second loss function to obtain the preset image signal processing model.

8. An image signal processing system, It is characterized in that include: The original image unit is used to obtain the original shooting format image; a first processing unit, configured to perform a first image signal processing on the original shooting format image to obtain a first processed image; the first image signal processing is a processing related to non-shared parameters of the shooting device; A reprocessing unit is used to reprocess the image after the first processing according to a preset image signal processing model to obtain a display format image. The image signal processing model is used to perform a second image signal processing on the image after the first processing, and the second image signal processing is other image signal processing other than the first image signal processing.

9. The system of claim 8, It is characterized in that The system further comprises: A training unit is used to determine an initial model for image signal processing; determine training samples, wherein the training samples include multiple groups of sample images, each group of sample images includes an original captured sample image and its corresponding displayed sample image; and adjust the initial model for image signal processing according to the initial model for image signal processing and the training samples to obtain the preset image signal processing model.

10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a plurality of computer programs, and the computer programs are suitable for being loaded by a processor and executing the image signal processing method according to any one of claims 1 to 7.