CN115049541B - Reversible gray scale method, system and device based on neural network and image steganography - Google Patents

Reversible gray scale method, system and device based on neural network and image steganography Download PDF

Info

Publication number
CN115049541B
CN115049541B CN202210834416.8A CN202210834416A CN115049541B CN 115049541 B CN115049541 B CN 115049541B CN 202210834416 A CN202210834416 A CN 202210834416A CN 115049541 B CN115049541 B CN 115049541B
Authority
CN
China
Prior art keywords
image
grayscale
reversible
code stream
color
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210834416.8A
Other languages
Chinese (zh)
Other versions
CN115049541A (en
Inventor
彭凌西
林焕然
彭绍湖
谢翔
林煜桐
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Maihao Network Technology Co ltd
Original Assignee
Guangzhou University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou University filed Critical Guangzhou University
Priority to CN202210834416.8A priority Critical patent/CN115049541B/en
Publication of CN115049541A publication Critical patent/CN115049541A/en
Application granted granted Critical
Publication of CN115049541B publication Critical patent/CN115049541B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/04Context-preserving transformations, e.g. by using an importance map
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/0021Image watermarking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T9/00Image coding
    • G06T9/002Image coding using neural networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Computation (AREA)
  • Multimedia (AREA)
  • Image Processing (AREA)

Abstract

The invention discloses a reversible gray scale method, a system and a device based on neural network and image steganography, which comprise the steps of carrying out reversible conversion on an original color image to obtain a gray scale component Y and color components U and V; performing neural network coding and arithmetic coding on the color components to obtain a characteristic code stream and a super prior code stream; according to the image steganography, the characteristic code stream and the super prior code stream are steganographically written into the gray component Y, and a reversible gray image A is generated; reading a characteristic code stream and a super prior code stream in the reversible gray scale image A, and taking the read gray scale image A as a gray scale component Y R of the color image to be reconstructed; performing neural network decoding and arithmetic decoding on the characteristic code stream and the super prior code stream to convert the characteristic code stream and the super prior code stream into color components U R and V R of a color image to be reconstructed; and combining the gray component of the color image to be reconstructed and the color component of the color image to be reconstructed, and performing reversible conversion to obtain a reconstructed color image I R. The invention can be realized in the reversible gray scale of the neural network and the image steganography.

Description

基于神经网络与图像隐写的可逆灰度方法、系统及装置Reversible grayscale method, system and device based on neural network and image steganography

技术领域Technical Field

本发明涉及可逆灰度领域,尤其是涉及一种基于神经网络与图像隐写的可逆灰度方法、系统及装置。The present invention relates to the field of reversible grayscale, and in particular to a reversible grayscale method, system and device based on neural network and image steganography.

背景技术Background technique

彩色图像生成灰度图像方法,在许多领域有着重要的应用,如印刷,雕刻,单色显示,图像处理等场景。其中常规类型的灰度图像生成方法注重的是感知因素,如对比度,纹理特征等方面。另外有一类称为可逆灰度的灰度生成方法,其主要目的在于生成灰度图像的同时,将彩色图像的颜色信息隐匿地编码在所生成的灰度,并在需要的时候可以尽量完美地还原出原本的彩色图像。The method of generating grayscale images from color images has important applications in many fields, such as printing, engraving, monochrome display, image processing and other scenarios. Among them, the conventional type of grayscale image generation method focuses on perceptual factors, such as contrast, texture features and so on. There is also a type of grayscale generation method called reversible grayscale, whose main purpose is to generate a grayscale image while encoding the color information of the color image in the generated grayscale, and to restore the original color image as perfectly as possible when needed.

2018年,Xia等人在ACM Transactions on Graphics上提出了一种可逆灰度方法,通过编码-解码网络,将图像脱色和着色过程建模为一个闭环。这种方法可以将颜色信息嵌入到生成的灰度图像中,从而使解码后的图像能够较准确地重构出与原始一致的颜色。In 2018, Xia et al. proposed a reversible grayscale method in ACM Transactions on Graphics, which modeled the image decolorization and colorization process as a closed loop through an encoding-decoding network. This method can embed color information into the generated grayscale image, so that the decoded image can accurately reconstruct the color consistent with the original.

2020年,Ye等人在IEEE Access上提出了一种双特征集合网络,使用了密集残差表示,集成局部残差学习和局部特征融合的能力,通过注意力机制抑制了由双路径模块产生的冗余特性,从而得到一致性更好的灰度图像及重建彩色图像。In 2020, Ye et al. proposed a dual feature set network in IEEE Access, which used dense residual representation, integrated local residual learning and local feature fusion capabilities, and suppressed the redundant characteristics generated by the dual-path module through the attention mechanism, thereby obtaining more consistent grayscale images and reconstructed color images.

2021年,Liu等人在IEEE Transactions on Visualization and ComputerGraphics上提出了一种JPEG鲁棒可逆灰度系统,该方法在编解码网络的基础上引入了对抗性训练和JPEG模拟器,使生成的灰度图像具备JPEG鲁棒性并且减少所生成图像的编码纹理。Zhao等人在IEEE Transactions on Image Processing上提出一种新的可逆灰度方法,该方法通过可逆神经网络将彩色图像正向映射成灰度图像与潜在变量,之后通过反向映射可将灰度图像和一组符合高斯分布的随机变量转换为与原来接近的彩色图像。In 2021, Liu et al. proposed a JPEG robust reversible grayscale system in IEEE Transactions on Visualization and Computer Graphics. This method introduced adversarial training and JPEG simulator based on the codec network, making the generated grayscale image JPEG robust and reducing the coding texture of the generated image. Zhao et al. proposed a new reversible grayscale method in IEEE Transactions on Image Processing. This method uses a reversible neural network to forward map a color image into a grayscale image and latent variables, and then uses reverse mapping to convert the grayscale image and a set of random variables that conform to the Gaussian distribution into a color image that is close to the original.

对于可逆灰度方法,最为关键的性能是生成的灰度图像、重建的彩色图像分别与目标灰度图像、原始彩色图像的相似程度。而现有的技术采用的是端到端的结构框架,在上述性能方面善不完美,存在明显的提升空间,而这主要归结于这些技术中主要的两方面不足:①未能真正高效地消除颜色信息的冗余,导致需编码内容的信息量较大。②颜色信息的编码过程中,灰度图像的信息损失较多。For the reversible grayscale method, the most critical performance is the similarity between the generated grayscale image and the reconstructed color image and the target grayscale image and the original color image respectively. The existing technology adopts an end-to-end structural framework, which is not perfect in the above performance and has obvious room for improvement. This is mainly attributed to the two main deficiencies in these technologies: ① Failure to truly and efficiently eliminate the redundancy of color information, resulting in a large amount of information to be encoded. ② In the process of encoding color information, the grayscale image loses a lot of information.

发明内容Summary of the invention

本发明的目的在于提供一种基于神经网络与图像隐写的可逆灰度方法、系统及装置,旨在解决图像可逆灰度。The purpose of the present invention is to provide a reversible grayscale method, system and device based on neural network and image steganography, aiming to solve the problem of reversible grayscale of images.

本发明提供一种基于神经网络与图像隐写的可逆灰度方法,包括:The present invention provides a reversible grayscale method based on neural network and image steganography, comprising:

S1、将原始彩色图像进行可逆RGB2YUV转换得到灰度分量Y和颜色分量U和V;S1, performing a reversible RGB2YUV conversion on the original color image to obtain the grayscale component Y and the color components U and V;

S2、对颜色分量U和V进行神经网络编码和算术编码得到特征码流和超先验码流;S2, performing neural network coding and arithmetic coding on the color components U and V to obtain a feature code stream and a super priori code stream;

S3、根据图像隐写将特征码流和超先验码流隐写入到灰度分量Y中,生成可逆灰度图像A;S3, according to the image steganography, the characteristic code stream and the super prior code stream are steganographically written into the grayscale component Y to generate a reversible grayscale image A;

S4、读取可逆灰度图像A中的特征码流和超先验码流,将读取后的灰度图像A作为待重建色彩图像的灰度分量YRS4, reading the characteristic code stream and the super-prior code stream in the reversible grayscale image A, and using the read grayscale image A as the grayscale component Y R of the color image to be reconstructed;

S5、将特征码流和超先验码流进行神经网络解码和算术解码转换为待重建彩色图像的颜色分量UR和VRS5, performing neural network decoding and arithmetic decoding on the feature code stream and the super priori code stream to convert them into color components UR and VR of the color image to be reconstructed;

S6、将待重建色彩图像的灰度分量和待重建色彩图像的颜色分量合并进行可逆YUV2RGB转换后,得到重建的彩色图像IRS6. Combining the grayscale component of the color image to be reconstructed and the color component of the color image to be reconstructed, and performing a reversible YUV2RGB conversion to obtain a reconstructed color image IR .

本发明还提供一种基于神经网络与图像隐写的可逆灰度系统,包括:The present invention also provides a reversible grayscale system based on neural network and image steganography, comprising:

转换模块:用于将原始彩色图像进行可逆RGB2YUV转换得到灰度分量Y和颜色分量U和V;Conversion module: used to perform reversible RGB2YUV conversion on the original color image to obtain grayscale component Y and color components U and V;

编码模块:用于对颜色分量U和V进行神经网络编码和算术编码得到特征码流和超先验码流;Coding module: used to perform neural network coding and arithmetic coding on color components U and V to obtain feature code stream and super priori code stream;

隐写模块:用于根据图像隐写将特征码流和超先验码流隐写入到灰度分量Y中,生成可逆灰度图像A;Steganography module: used to steganographically write the characteristic code stream and the super prior code stream into the grayscale component Y according to the image steganography to generate a reversible grayscale image A;

读取模块:用于读取可逆灰度图像A中的特征码流和超先验码流,将读取后的灰度图像A作为待重建色彩图像的灰度分量YRReading module: used to read the characteristic code stream and the super-prior code stream in the reversible grayscale image A, and use the read grayscale image A as the grayscale component Y R of the color image to be reconstructed;

解码模块:用于将特征码流和超先验码流进行神经网络解码和算术解码转换为待重建彩色图像的颜色分量UR和VRDecoding module: used to convert the feature code stream and the super-prior code stream into the color components UR and VR of the color image to be reconstructed by performing neural network decoding and arithmetic decoding;

重建模块:用于将待重建色彩图像的灰度分量和待重建色彩图像的颜色分量合并进行可逆YUV2RGB转换后,得到重建的彩色图像IRReconstruction module: used for combining the grayscale component of the color image to be reconstructed and the color component of the color image to be reconstructed and performing reversible YUV2RGB conversion to obtain a reconstructed color image IR .

本发明实施例还提供一种基于神经网络与图像隐写的可逆灰度装置,包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述计算机程序被所述处理器执行时实现上述方法的步骤。An embodiment of the present invention also provides a reversible grayscale device based on neural network and image steganography, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the steps of the above method are implemented when the computer program is executed by the processor.

本发明实施例还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有信息传递的实现程序,所述程序被处理器执行时实现上述方法的步骤。An embodiment of the present invention further provides a computer-readable storage medium, on which a program for implementing information transmission is stored, and when the program is executed by a processor, the steps of the above method are implemented.

第一方面,本发明设计了神经网络对彩色图像的颜色分量进行编码,提取了颜色分量的关键特征并对其概率模型进行建模,再通过算术编码将特征编码成二进制码流。对比于现有技术,这样的策略能够更高效地消除颜色信息的冗余并减少颜色信息的损失,解决了中间过程所需隐藏的信息过多,导致生成的灰度图像质量较差的问题。In the first aspect, the present invention designs a neural network to encode the color components of a color image, extracts the key features of the color components and models their probability models, and then encodes the features into a binary code stream through arithmetic coding. Compared with the prior art, such a strategy can more efficiently eliminate the redundancy of color information and reduce the loss of color information, solving the problem that too much information needs to be hidden in the intermediate process, resulting in poor quality of the generated grayscale image.

第二方面,本发明通过图像隐写技术将颜色信息写入(或读出)灰度分量,在灰度分量上以极小的改动将颜色信息嵌入其中,从而生成目标灰度图像。对比于现有技术,本发明生成的灰度图像视觉效果更理想,灰度信息损失更小。Secondly, the present invention writes (or reads) color information into the grayscale component through image steganography technology, embeds the color information into the grayscale component with minimal changes, and thus generates a target grayscale image. Compared with the prior art, the grayscale image generated by the present invention has a more ideal visual effect and less grayscale information loss.

第三方面,本发明利用可逆分量转换方法,将彩色图像分解为灰度分量和颜色分量进行正交处理,再结合神经网络和图像隐写,显著地提升了生成灰度图像及重建彩色图像两者的综合性能指标。Thirdly, the present invention utilizes a reversible component conversion method to decompose a color image into grayscale components and color components for orthogonal processing, and then combines neural networks and image steganography to significantly improve the comprehensive performance indicators of both generating grayscale images and reconstructing color images.

上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it is implemented in accordance with the contents of the specification, and in order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are specifically listed below.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

为了更清楚地说明本发明具体实施方式或现有技术中的技术方案,下面将对具体实施方式或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施方式,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

图1是本发明实施例的基于神经网络与图像隐写的可逆灰度方法的流程图;FIG1 is a flow chart of a reversible grayscale method based on neural network and image steganography according to an embodiment of the present invention;

图2是本发明实施例的基于神经网络与图像隐写的可逆灰度方法的框架示意图;FIG2 is a schematic diagram of a framework of a reversible grayscale method based on a neural network and image steganography according to an embodiment of the present invention;

图3是本发明实施例的基于神经网络与图像隐写的可逆灰度方法的神经网络示意图;FIG3 is a schematic diagram of a neural network of a reversible grayscale method based on a neural network and image steganography according to an embodiment of the present invention;

图4是本发明实施例的基于神经网络与图像隐写的可逆灰度方法的修改像素示意图;FIG4 is a schematic diagram of modifying pixels in a reversible grayscale method based on a neural network and image steganography according to an embodiment of the present invention;

图5是本发明实施例的基于神经网络与图像隐写的可逆灰度系统的示意图;FIG5 is a schematic diagram of a reversible grayscale system based on neural network and image steganography according to an embodiment of the present invention;

图6是本发明实施例的基于神经网络与图像隐写的可逆灰度装置的示意图。FIG6 is a schematic diagram of a reversible grayscale device based on neural network and image steganography according to an embodiment of the present invention.

具体实施方式Detailed ways

下面将结合实施例对本发明的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are 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.

方法实施例Method Embodiment

根据本发明实施例,提供了一种基于神经网络与图像隐写的可逆灰度方法,图1是本发明实施例的基于神经网络与图像隐写的可逆灰度方法的流程图,如图1所示,具体包括:According to an embodiment of the present invention, a reversible grayscale method based on neural network and image steganography is provided. FIG1 is a flow chart of a reversible grayscale method based on neural network and image steganography according to an embodiment of the present invention. As shown in FIG1 , the method specifically includes:

S1、将原始彩色图像进行可逆RGB2YUV转换得到灰度分量Y和颜色分量U和V;S1, performing a reversible RGB2YUV conversion on the original color image to obtain the grayscale component Y and the color components U and V;

S2、对颜色分量U和V进行神经网络编码和算术编码得到特征码流和超先验码流;S2, performing neural network coding and arithmetic coding on the color components U and V to obtain a feature code stream and a super priori code stream;

S3、根据图像隐写将特征码流和超先验码流隐写入到灰度分量Y中,生成可逆灰度图像A;S3, according to image steganography, the characteristic code stream and the super prior code stream are steganographically written into the grayscale component Y to generate a reversible grayscale image A;

S4、读取可逆灰度图像A中的特征码流和超先验码流,将读取后的灰度图像A作为待重建色彩图像的灰度分量YRS4, reading the characteristic code stream and the super-prior code stream in the reversible grayscale image A, and using the read grayscale image A as the grayscale component Y R of the color image to be reconstructed;

S5、将特征码流和超先验码流进行神经网络解码和算术解码转换为待重建彩色图像的颜色分量UR和VRS5, performing neural network decoding and arithmetic decoding on the feature code stream and the super priori code stream to convert them into color components UR and VR of the color image to be reconstructed;

S6、将待重建色彩图像的灰度分量和待重建色彩图像的颜色分量合并进行可逆YUV2RGB转换后,得到重建的彩色图像IRS6. Combining the grayscale component of the color image to be reconstructed and the color component of the color image to be reconstructed, and performing a reversible YUV2RGB conversion to obtain a reconstructed color image IR .

图2是本发明实施例的基于神经网络与图像隐写的可逆灰度方法的框架示意图,如图2所示,FIG. 2 is a schematic diagram of a framework of a reversible grayscale method based on a neural network and image steganography according to an embodiment of the present invention. As shown in FIG. 2 ,

彩色图像生成灰度图像过程:The process of generating grayscale images from color images:

步骤a:对原始彩色图像I进行可逆RGB2YUV转换,分解图像得到灰度分量Y和颜色分量U,V;Step a: Perform a reversible RGB2YUV conversion on the original color image I and decompose the image to obtain the grayscale component Y and color components U, V;

步骤b:颜色分量U,V通过神经网络进行分析及编码得到特征和超先验/>并建立特征/>的先验概率模型/>和超先验/>的独立概率模型/>然后结合算术编码将特征超先验/>分别转换为特征码流/>超先验码流/> Step b: The color components U and V are analyzed and encoded through a neural network to obtain features and super prior/> And create features/> The prior probability model of and super prior/> Independent probability model of/> Then, the features are combined with arithmetic coding Super Prior/> Convert to feature code streams respectively/> Super a priori code stream/>

步骤c:利用图像隐写方法将特征码流和超先验码流/>隐写入灰度分量Y中,生成可逆灰度图像A;Step c: Use image steganography to convert the feature code stream and super a priori code stream/> Steganographically write into the grayscale component Y to generate a reversible grayscale image A;

灰度图像重建彩色图像过程:Grayscale image reconstruction color image process:

步骤d:从灰度图像A中读取出特征码流和超先验码流/>读取后的灰度图像A作为待重建彩色图像的灰度分量YRStep d: Read the feature code stream from the grayscale image A and super a priori code stream/> The read grayscale image A is used as the grayscale component Y R of the color image to be reconstructed;

步骤e:根据独立概率模型将超先验码流/>算术解码为超先验/>然后通过神经网络解码得到特征/>的概率模型参数,进而得出先验概率模型/>并将特征码流/>算术解码为特征/>之后由神经网络对特征/>进行合成得到待重建彩色图像的颜色分量UR,VRStep e: According to the independent probability model The super-a priori code stream/> Arithmetic decoding as a super prior /> Then the features are obtained by neural network decoding/> The probability model parameters, and then the prior probability model is obtained/> And the feature code stream/> Arithmetic decoding as a feature/> Then the neural network analyzes the features Perform synthesis to obtain color components UR , VR of the color image to be reconstructed;

步骤f:将灰度分量YR和颜色分量UR,VR合并进行可逆YUV2RGB转换后,得到重建的彩色图像IRStep f: combine the grayscale component Y R and the color components UR and VR to perform reversible YUV2RGB conversion to obtain a reconstructed color image IR ;

优选的,所述步骤a的可逆RGB2YUV转换公式为:Preferably, the reversible RGB2YUV conversion formula of step a is:

其中,Y表示灰度分量值,U,V表示颜色分量值;R,G,B表示原始彩色图像的像素值;表示向下取整。Among them, Y represents the gray component value, U and V represent the color component values; R, G, and B represent the pixel values of the original color image; Indicates rounding down.

优选的,所述神经网络的内容实现如下:Preferably, the content of the neural network is implemented as follows:

图3是本发明实施例的基于神经网络与图像隐写的可逆灰度方法的神经网络示意图,如图3所示,FIG3 is a schematic diagram of a neural network of a reversible grayscale method based on a neural network and image steganography according to an embodiment of the present invention. As shown in FIG3 ,

神经网络包含四部分:特征分析网络、特征合成网络、超先验编码网络、超先验解码网络。The neural network consists of four parts: feature analysis network, feature synthesis network, super prior encoding network, and super prior decoding network.

特征分析网络提取出颜色分量的主要特征x,取整量化后记为特征特征/>在信息熵尽量小的情况下尽可能有利于特征合成网络对颜色分量进行有效重建;特征分析网络由卷积网络层和GDN(generalized divisive normalization)非线性层构成;假设输入的颜色分量维度为H×W×2,则特征分析网络的输出特征维度为/> The feature analysis network extracts the main feature x of the color component, rounds it to an integer and quantizes it into features Features/> When the information entropy is as small as possible, it is beneficial for the feature synthesis network to effectively reconstruct the color components; the feature analysis network is composed of a convolutional network layer and a GDN (generalized divisive normalization) nonlinear layer; assuming that the input color component dimension is H×W×2, the output feature dimension of the feature analysis network is/>

超先验编码网络实现对特征x进一步地编码并量化,计算出信息熵尽可能小的超先验并将其输入到超先验解码网络对特征x的概率模型进行准确地建模;超先验编码网络由卷积网络层和RELU非线性激活层构成,其对应输出的超先验维度为/> The super-prior coding network further encodes and quantizes the feature x and calculates the super-prior with the smallest possible information entropy. And input it into the super prior decoding network to accurately model the probability model of feature x; the super prior encoding network is composed of a convolutional network layer and a RELU nonlinear activation layer, and the corresponding output super prior dimension is/>

超先验解码网络实现对超先验进行解码,解码后的变量为特征x的正态分布概率模型参数/>进一步构建得到特征/>的先验概率模型/>超先验解码网络由转置卷积网络层和RELU非线性激活层构成,其输出概率模型参数为/>其中,先验概率模型/>的形式为:The super prior decoding network realizes the super prior Decode, the decoded variable is the normal distribution probability model parameter of feature x/> Further construct the feature/> The prior probability model of The super priori decoding network consists of a transposed convolutional network layer and a RELU nonlinear activation layer, and its output probability model parameters are /> Among them, the prior probability model/> The form is:

特征合成网络根据输入的特征进行合成,重建出尽量接近原始的颜色分量;特征合成网络由转置卷积网络层和IGDN(inversed generalized divisive normalization)非线性层构成,其输出的重建分量维度为H×W×2;The feature synthesis network is based on the input features Perform synthesis to reconstruct color components that are as close to the original as possible; the feature synthesis network consists of a transposed convolutional network layer and an IGDN (inversed generalized divisive normalization) nonlinear layer, and the dimension of the reconstructed component output is H×W×2;

优选的,所述图像隐写方法实现如下:Preferably, the image steganography method is implemented as follows:

载体灰度图像的像素按列扫描表示为P1,P2,P3,…,Pm;特征码流和超先验码流合并成二进制码流O且表示为b1,b2,b3,…,bn;按顺序取每3个像素和每3位二进制码为一组,第i组的3个像素分别表示为Pi_1,Pi_2,Pi_3,3位二进制码分别表示为bi_1,bi_2,bi_3The pixels of the carrier grayscale image are scanned by columns and represented as P 1 , P 2 , P 3 ,…, P m ; the feature code stream and super a priori code stream Merge into a binary code stream O and represent it as b 1 , b 2 , b 3 , … , b n ; sequentially take every 3 pixels and every 3-bit binary code as a group, the 3 pixels of the i-th group are represented as P i_1 , P i_2 , P i_3 , and the 3-bit binary code is represented as b i_1 , b i_2 , b i_3 ;

在步骤c中,所述隐写过程实现每组的3个像素嵌入3位二进制码信息,具体实现如下:In step c, the steganographic process embeds 3 bits of binary code information into each group of 3 pixels, which is specifically implemented as follows:

首先,根据3个像素的值计算出3位预测码:First, a 3-bit prediction code is calculated based on the values of the 3 pixels:

其中Bi_1,Bi_2,Bi_3表示第i组的3位预测码,表示第i组第n个像素pi_n的二进制值最低第j位,/>表示异或运算;Where Bi_1 , Bi_2 , Bi_3 represent the 3-bit prediction code of the i-th group, Indicates the lowest j-th bit of the binary value of the n-th pixel pi_n of the i-th group,/> Represents XOR operation;

如果预测码Bi_1,Bi_2,Bi_3与二进制码b i_1,b i_2,b i_3相等,则无需对像素做修改;否则通过修改像素Pi_1,P i_2,P i_3使预测码和二进制码相等,从而完成二进制码的隐写;If the predicted code Bi_1 , Bi_2 , Bi_3 is equal to the binary code Bi_1 , Bi_2 , Bi_3 , then there is no need to modify the pixel; otherwise, the predicted code and the binary code are made equal by modifying the pixel Pi_1 , Pi_2 , Pi_3 , thus completing the steganography of the binary code;

图4是本发明实施例的基于神经网络与图像隐写的可逆灰度方法的修改像素示意图,如图4所示,FIG4 is a schematic diagram of pixel modification of a reversible grayscale method based on a neural network and image steganography according to an embodiment of the present invention. As shown in FIG4 ,

Bi_1≠bi_1,Bi_2=bi_2,Bi_3=bi_3;如果Pi_2mod 2=0是,则Pi_2=Pi_2-1;如果Pi_2mod2=0否,则Pi_2=Pi_2+1; Bi_1bi_1 , Bi_2 = bi_2 , Bi_3 = bi_3 ; if Pi_2 mod 2 = 0, then Pi_2 = Pi_2 -1; if Pi_2 mod 2 = 0, then Pi_2 = Pi_2 +1;

此外,最后数量不满足3位的码流则是直接替换相应序列像素的最低二进制位实现隐写。In addition, if the last number of bits does not meet 3, the lowest binary bit of the corresponding sequence of pixels is directly replaced to achieve steganography.

在步骤d中,所述读取过程为:In step d, the reading process is:

按上述预测方法顺序计算P1到Pm每3个像素Pi_1,Pi_2,Pi_3的预测码,最后数量不满足3位的像素则是直接读取像素的最低二进制位代替对应预测码,从而读取出隐写在灰度图像中的二进制码流O,再分解后可得到特征码流和超先验码流/> According to the above prediction method, the prediction codes of every 3 pixels Pi_1 , Pi_2 , Pi_3 from P1 to Pm are calculated in sequence. For pixels that do not meet the 3-bit number, the lowest binary bit of the pixel is directly read to replace the corresponding prediction code, thereby reading the binary code stream O hidden in the grayscale image. After decomposition, the feature code stream can be obtained. and super a priori code stream/>

优选的,上述步骤f的可逆YUV2RGB转换公式为:Preferably, the reversible YUV2RGB conversion formula in step f above is:

其中,R,G,B表示彩色图像的像素值;Y表示灰度分量值,U,V表示颜色分量值;表示向下取整。Among them, R, G, B represent the pixel values of the color image; Y represents the gray component value, and U, V represent the color component value; Indicates rounding down.

具体地,本实施例通过Python进行实现,神经网络使用Pytorch深度学习框架进行构建并通过Adam优化器进行优化训练;训练集为Pascal VOC2012公开数据集中随机抽取的20000张图像且裁剪分辨率大小为512×512,测试集为Kodak Photo CD图像数据集;训练初始学习率设置为1×10-4,迭代2×106次后学习率衰减至1×10-5,继续迭代5×105次;训练过程通过损失函数对神经网络的优化方向进行约束,综合地减小颜色分量的转换损失和特征超先验/>的编码后码流长度。训练所使用的损失函数为:Specifically, this embodiment is implemented by Python, the neural network is constructed by using the Pytorch deep learning framework and optimized and trained by the Adam optimizer; the training set is 20,000 images randomly selected from the Pascal VOC2012 public data set and the cropping resolution is 512×512, and the test set is the Kodak Photo CD image data set; the initial learning rate of the training is set to 1× 10-4 , and the learning rate decays to 1× 10-5 after 2× 106 iterations, and continues to iterate 5× 105 times; the training process constrains the optimization direction of the neural network through the loss function, comprehensively reducing the conversion loss of the color component and the feature Super Prior/> The loss function used in training is:

其中,等式第一项为转换前的颜色分量U,V与转换后的颜色分量UR,VR之间的均方误差值;第二、三项分别为特征超先验/>的信息熵;The first term of the equation is the mean square error between the color components U, V before conversion and the color components UR , VR after conversion; the second and third terms are the feature Super Prior/> Information entropy of

综上所述,本实施例最终实现:原始彩色图像生成对应的可逆灰度图像,之后可由该灰度图像重建出与原来基本一致的彩色图像。In summary, this embodiment ultimately achieves: the original color image generates a corresponding reversible grayscale image, and then the grayscale image can be used to reconstruct a color image that is substantially consistent with the original one.

本发明提供的技术方案与现有技术相比至少具有以下优点:The technical solution provided by the present invention has at least the following advantages compared with the prior art:

第一方面,本发明设计了神经网络对彩色图像的颜色分量进行编码,提取了颜色分量的关键特征并对其概率模型进行建模,再通过算术编码将特征编码成二进制码流。对比于现有技术,这样的策略能够更高效地消除颜色信息的冗余并减少颜色信息的损失,解决了中间过程所需隐藏的信息过多,导致生成的灰度图像质量较差的问题。In the first aspect, the present invention designs a neural network to encode the color components of a color image, extracts the key features of the color components and models their probability models, and then encodes the features into a binary code stream through arithmetic coding. Compared with the prior art, such a strategy can more efficiently eliminate the redundancy of color information and reduce the loss of color information, solving the problem that too much information needs to be hidden in the intermediate process, resulting in poor quality of the generated grayscale image.

第二方面,本发明通过图像隐写技术将颜色信息写入(或读出)灰度分量,在灰度分量上以极小的改动将颜色信息嵌入其中,从而生成目标灰度图像。对比于现有技术,本发明生成的灰度图像视觉效果更理想,灰度信息损失更小。Secondly, the present invention writes (or reads) color information into the grayscale component through image steganography technology, embeds the color information into the grayscale component with minimal changes, and thus generates a target grayscale image. Compared with the prior art, the grayscale image generated by the present invention has a more ideal visual effect and less grayscale information loss.

第三方面,本发明利用可逆分量转换方法,将彩色图像分解为灰度分量和颜色分量进行正交处理,再结合神经网络和图像隐写,显著地提升了生成灰度图像及重建彩色图像两者的综合性能指标。Thirdly, the present invention utilizes a reversible component conversion method to decompose a color image into grayscale components and color components for orthogonal processing, and then combines neural networks and image steganography to significantly improve the comprehensive performance indicators of both generating grayscale images and reconstructing color images.

系统实施例System Example

根据本发明实施例,提供了一种基于神经网络与图像隐写的可逆灰度系统,图5是本发明实施例的基于神经网络与图像隐写的可逆灰度系统的示意图,如图5所示,具体包括:According to an embodiment of the present invention, a reversible grayscale system based on a neural network and image steganography is provided. FIG5 is a schematic diagram of a reversible grayscale system based on a neural network and image steganography according to an embodiment of the present invention. As shown in FIG5, the system specifically includes:

转换模块:用于将原始彩色图像进行可逆RGB2YUV转换得到灰度分量Y和颜色分量U和V;Conversion module: used to perform reversible RGB2YUV conversion on the original color image to obtain grayscale component Y and color components U and V;

编码模块:用于对颜色分量U和V进行神经网络编码和算术编码得到特征码流和超先验码流;Coding module: used to perform neural network coding and arithmetic coding on color components U and V to obtain feature code stream and super priori code stream;

隐写模块:用于根据图像隐写将特征码流和超先验码流隐写入到灰度分量Y中,生成可逆灰度图像A;Steganography module: used to steganographically write the characteristic code stream and the super prior code stream into the grayscale component Y according to the image steganography to generate a reversible grayscale image A;

读取模块:用于读取可逆灰度图像A中的特征码流和超先验码流,将读取后的灰度图像A作为待重建色彩图像的灰度分量YRReading module: used to read the characteristic code stream and the super-prior code stream in the reversible grayscale image A, and use the read grayscale image A as the grayscale component Y R of the color image to be reconstructed;

解码模块:用于将特征码流和超先验码流进行神经网络解码和算术解码转换为待重建彩色图像的颜色分量UR和VRDecoding module: used to convert the feature code stream and the super-prior code stream into the color components UR and VR of the color image to be reconstructed by performing neural network decoding and arithmetic decoding;

重建模块:用于将待重建色彩图像的灰度分量和待重建色彩图像的颜色分量合并进行可逆YUV2RGB转换后,得到重建的彩色图像IRReconstruction module: used for combining the grayscale component of the color image to be reconstructed and the color component of the color image to be reconstructed and performing reversible YUV2RGB conversion to obtain a reconstructed color image IR .

转换模块具体用于:The conversion module is specifically used for:

将原始彩色图像进行可逆RGB2YUV转换得到灰度分量Y和颜色分量U和V,其中可逆RGB2YUV转换公式如下:The original color image is reversibly converted to RGB2YUV to obtain the grayscale component Y and the color components U and V. The reversible RGB2YUV conversion formula is as follows:

其中,Y表示灰度分量值,U和V表示颜色分量值;R,G,B表示原始彩色图像的像素值;表示向下取整;Among them, Y represents the gray component value, U and V represent the color component values; R, G, B represent the pixel values of the original color image; Indicates rounding down;

编码模块具体用于:The encoding module is specifically used for:

颜色分量U,V通过神经网络进行分析和编码得到特征和超先验,并建立特征的先验概率模型和超先验的独立概率模型,然后结合算术编码将特征换热超先验分别转换为特征码流和超先验码流;The color components U, V are analyzed and encoded through neural networks to obtain features and super priors, and the feature prior probability model and super prior independent probability model are established. Then, the features and super priors are converted into feature code streams and super prior code streams respectively by combining arithmetic coding;

隐写模块具体用于:The steganography module is specifically used for:

灰度分量Y的像素按列扫描表示为P1,P2,P3,…,Pm,特征码流和超先验码流合并成二进制码流且表示为b1,b2,b3,…,bnThe pixels of the gray component Y are scanned by columns and represented as P 1 , P 2 , P 3 , ..., P m . The characteristic code stream and the super-prior code stream are combined into a binary code stream and represented as b 1 , b 2 , b 3 , ..., b n .

根据3个像素值预测出3位预测码,公式如下:The 3-bit prediction code is predicted based on the 3 pixel values. The formula is as follows:

其中Bi_1,Bi_2,Bi_3表示第i组的3位预测码,表示第i组第n个像素pi_n的二进制值最低第j位,/>表示异或运算;Where Bi_1 , Bi_2 , Bi_3 represent the 3-bit prediction code of the i-th group, Indicates the lowest j-th bit of the binary value of the n-th pixel pi_n of the i-th group,/> Represents the exclusive OR operation;

如果二进制码bi_1,bi_2,bi_3与预测码Bi_1,Bi_2,Bi_3相等,则无需对像素做修改,否则修改像素Pi_1,Pi_2,Pi_3至二进制码和预测码相等,从而完成二进制码的隐写,数量不满足3位的码流直接替换相应序列像素的最低二进制位实现隐写,完成将3个像素Pi_1,Pi_2,Pi_3隐藏3位二进制码bi_1,bi_2,bi_3,生成可逆灰度图像A;If the binary code bi_1 , bi_2 , bi_3 is equal to the predicted code Bi_1 , Bi_2 , Bi_3 , then there is no need to modify the pixel. Otherwise, modify the pixel Pi_1 , Pi_2 , Pi_3 until the binary code and the predicted code are equal, thereby completing the steganography of the binary code. If the number of code streams does not meet the 3-bit requirement, directly replace the lowest binary bit of the corresponding sequence pixel to achieve steganography, and complete the hiding of the 3-bit binary code bi_1 , bi_2 , bi_3 by the 3 pixels Pi_1 , Pi_2 , Pi_3 , and generate a reversible grayscale image A.

解码模块具体用于:The decoding module is specifically used for:

根据独立概率模型将超先验码流算术解码为超先验,然后通过神经网络解码得到特征的概率模型参数,从而得出先验概率模型并将特征码流算术解码为特征,之后由神经网络对特征进行合成得到待重建彩色图像的颜色分量UR,VRAccording to the independent probability model, the super-prior code stream is arithmetically decoded into the super-prior, and then the probability model parameters of the feature are obtained by decoding through the neural network, so as to obtain the a priori probability model and arithmetically decode the feature code stream into features, and then the neural network synthesizes the features to obtain the color components UR , VR of the color image to be reconstructed;

重建模块具体用于:The reconstruction module is specifically used to:

将待重建色彩图像的灰度分量和待重建色彩图像的颜色分量合并进行可逆YUV2RGB转换后,得到重建的彩色图像IRAfter combining the grayscale component of the color image to be reconstructed and the color component of the color image to be reconstructed and performing reversible YUV2RGB conversion, a reconstructed color image IR is obtained.

可逆YUV2RGB转换公式为:The reversible YUV2RGB conversion formula is:

其中,R,G,B表示彩色图像的像素值;Y表示灰度分量值,U,V表示颜色分量值;表示向下取整。Among them, R, G, B represent the pixel values of the color image; Y represents the gray component value, and U, V represent the color component value; Indicates rounding down.

本发明实施例是与上述方法实施例对应的系统实施例,各个模块的具体操作可以参照方法实施例的描述进行理解,在此不再赘述。The embodiment of the present invention is a system embodiment corresponding to the above-mentioned method embodiment. The specific operations of each module can be understood by referring to the description of the method embodiment, which will not be repeated here.

装置实施例一Device Example 1

本发明实施例提供一种基于神经网络与图像隐写的可逆灰度装置,如图5所示,包括:存储器50、处理器52及存储在存储器50上并可在处理器52上运行的计算机程序,计算机程序被处理器执行时实现上述方法实施例中的步骤。An embodiment of the present invention provides a reversible grayscale device based on neural network and image steganography, as shown in Figure 5, including: a memory 50, a processor 52, and a computer program stored in the memory 50 and executable on the processor 52. When the computer program is executed by the processor, the steps in the above method embodiment are implemented.

装置实施例二Device Example 2

本发明实施例提供一种计算机可读存储介质,计算机可读存储介质上存储有信息传输的实现程序,程序被处理器52执行时实现上述方法实施例中的步骤。An embodiment of the present invention provides a computer-readable storage medium, on which a program for implementing information transmission is stored. When the program is executed by the processor 52, the steps in the above method embodiment are implemented.

最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换本发明各实施例技术方案,并不使相应技术方案的本质脱离本方案的范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. These modifications or replacements of the technical solutions of the embodiments of the present invention do not cause the essence of the corresponding technical solutions to deviate from the scope of this solution.

Claims (8)

1.一种基于神经网络与图像隐写的可逆灰度方法,其特征在于,包括,1. A reversible grayscale method based on neural network and image steganography, characterized by comprising: S1、将原始彩色图像进行可逆RGB2YUV转换得到灰度分量Y和颜色分量U和V;S1, performing a reversible RGB2YUV conversion on the original color image to obtain the grayscale component Y and the color components U and V; S2、对颜色分量U和V进行神经网络编码和算术编码得到特征码流和超先验码流;S2, performing neural network coding and arithmetic coding on the color components U and V to obtain a feature code stream and a super priori code stream; S3、根据图像隐写将特征码流和超先验码流隐写入到灰度分量Y中,生成可逆灰度图像A;S3, according to the image steganography, the characteristic code stream and the super prior code stream are steganographically written into the grayscale component Y to generate a reversible grayscale image A; S4、读取可逆灰度图像A中的特征码流和超先验码流,将读取后的灰度图像A作为待重建色彩图像的灰度分量YRS4, reading the characteristic code stream and the super-prior code stream in the reversible grayscale image A, and using the read grayscale image A as the grayscale component Y R of the color image to be reconstructed; S5、将特征码流和超先验码流进行神经网络解码和算术解码转换为待重建彩色图像的颜色分量UR和VRS5, performing neural network decoding and arithmetic decoding on the feature code stream and the super priori code stream to convert them into color components UR and VR of the color image to be reconstructed; S6、将待重建色彩图像的灰度分量和待重建色彩图像的颜色分量合并进行可逆YUV2RGB转换后,得到重建的彩色图像IRS6, combining the grayscale component of the color image to be reconstructed and the color component of the color image to be reconstructed and performing a reversible YUV2RGB conversion to obtain a reconstructed color image IR ; 所述S2具体包括:The S2 specifically includes: 颜色分量U,V通过神经网络进行分析和编码得到特征和超先验,并建立特征的先验概率模型和超先验的独立概率模型,然后结合算术编码将特征换热超先验分别转换为特征码流和超先验码流;The color components U, V are analyzed and encoded through neural networks to obtain features and super priors, and the feature prior probability model and super prior independent probability model are established. Then, the features and super priors are converted into feature code streams and super prior code streams respectively by combining arithmetic coding; 所述S3具体包括:The S3 specifically includes: 灰度分量Y的像素按列扫描表示为P1,P2,P3,…,Pm,特征码流和超先验码流合并成二进制码流且表示为b1,b2,b3,…,bnThe pixels of the gray component Y are scanned by columns and represented as P 1 , P 2 , P 3 , …, P m . The characteristic code stream and the super-prior code stream are combined into a binary code stream and represented as b 1 , b 2 , b 3 , …, b n . 按顺序取每3个像素和每3位二进制码为一组,第i组的3个像素分别表示为Pi_1,Pi_2,Pi_3,3位二进制码分别表示为bi_1,bi_2,bi_3Take every 3 pixels and every 3-bit binary code as a group in order, the 3 pixels in the i-th group are represented as Pi_1 , Pi_2 , Pi_3 , and the 3-bit binary code is represented as bi_1 , bi_2 , bi_3 ; 在步骤c中,所述隐写过程实现每组的3个像素嵌入3位二进制码信息,具体实现如下:In step c, the steganographic process embeds 3 bits of binary code information into each group of 3 pixels, which is specifically implemented as follows: 首先,根据3个像素的值计算出3位预测码:First, a 3-bit prediction code is calculated based on the values of the 3 pixels: 其中Bi_1,Bi_2,Bi_3表示第i组的3位预测码,表示第i组第n个像素pi_n的二进制值最低第j位,/>表示异或运算;Where Bi_1 , Bi_2 , Bi_3 represent the 3-bit prediction code of the i-th group, Indicates the lowest j-th bit of the binary value of the n-th pixel pi_n of the i-th group,/> Represents XOR operation; 如果预测码Bi_1,Bi_2,Bi_3与二进制码b i_1,b i_2,b i_3相等,则无需对像素做修改;否则通过修改像素Pi_1,P i_2,P i_3使预测码和二进制码相等,从而完成二进制码的隐写;If the predicted code Bi_1 , Bi_2 , Bi_3 is equal to the binary code Bi_1 , Bi_2 , Bi_3 , then there is no need to modify the pixel; otherwise, the predicted code and the binary code are made equal by modifying the pixel Pi_1 , Pi_2 , Pi_3 , thus completing the steganography of the binary code; 数量不满足3位的码流直接替换相应序列像素的最低二进制位实现隐写,完成将3个像素Pi+1,Pi+2,Pi+3隐藏3位二进制码bi+1,bi+2,bi+3,生成可逆灰度图像A。The code streams whose number does not meet 3 bits directly replace the lowest binary bit of the corresponding sequence pixels to achieve steganography, and complete the hiding of 3 pixels Pi +1 , Pi +2 , Pi +3 into 3-bit binary codes bi +1 , bi +2 , bi +3 to generate a reversible grayscale image A. 2.根据权利要求1所述的方法,其特征在于,所述S1具体包括:2. The method according to claim 1, characterized in that the S1 specifically comprises: 将原始彩色图像进行可逆RGB2YUV转换得到灰度分量Y和颜色分量U和V,其中可逆RGB2YUV转换公式如下:The original color image is reversibly converted to RGB2YUV to obtain the grayscale component Y and the color components U and V. The reversible RGB2YUV conversion formula is as follows: 其中,Y表示灰度分量值,U和V表示颜色分量值;R,G,B表示原始彩色图像的像素值;表示向下取整。Among them, Y represents the gray component value, U and V represent the color component values; R, G, B represent the pixel values of the original color image; Indicates rounding down. 3.根据权利要求1所述的方法,其特征在于,所述S5具体包括:3. The method according to claim 1, characterized in that the S5 specifically comprises: 根据独立概率模型将超先验码流算术解码为超先验,然后通过神经网络解码得到特征的概率模型参数,从而得出先验概率模型并将特征码流算术解码为特征,之后由神经网络对特征进行合成得到待重建彩色图像的颜色分量UR,VRThe super-prior code stream is arithmetically decoded into a super-prior according to an independent probability model, and then the probability model parameters of the feature are obtained by decoding through a neural network, thereby obtaining a priori probability model and arithmetically decoding the feature code stream into features, and then the neural network synthesizes the features to obtain the color components UR , VR of the color image to be reconstructed. 4.根据权利要求3所述的方法,其特征在于,所述S6具体包括:4. The method according to claim 3, characterized in that said S6 specifically comprises: 将待重建色彩图像的灰度分量和待重建色彩图像的颜色分量合并进行可逆YUV2RGB转换后,得到重建的彩色图像IRAfter combining the grayscale component of the color image to be reconstructed and the color component of the color image to be reconstructed and performing reversible YUV2RGB conversion, a reconstructed color image IR is obtained. 可逆YUV2RGB转换公式为:The reversible YUV2RGB conversion formula is: 其中,R,G,B表示彩色图像的像素值;Y表示灰度分量值,U,V表示颜色分量值;表示向下取整。Among them, R, G, B represent the pixel values of the color image; Y represents the gray component value, and U, V represent the color component value; Indicates rounding down. 5.一种基于神经网络与图像隐写的可逆灰度系统,其特征在于,包括,5. A reversible grayscale system based on neural network and image steganography, characterized by comprising: 转换模块:用于将原始彩色图像进行可逆RGB2YUV转换得到灰度分量Y和颜色分量U和V;Conversion module: used to perform reversible RGB2YUV conversion on the original color image to obtain grayscale component Y and color components U and V; 编码模块:用于对颜色分量U和V进行神经网络编码和算术编码得到特征码流和超先验码流;Coding module: used to perform neural network coding and arithmetic coding on color components U and V to obtain feature code stream and super priori code stream; 隐写模块:用于根据图像隐写将特征码流和超先验码流隐写入到灰度分量Y中,生成可逆灰度图像A;Steganography module: used to steganographically write the characteristic code stream and the super prior code stream into the grayscale component Y according to the image steganography to generate a reversible grayscale image A; 读取模块:用于读取可逆灰度图像A中的特征码流和超先验码流,将读取后的灰度图像A作为待重建色彩图像的灰度分量YRReading module: used to read the characteristic code stream and the super-prior code stream in the reversible grayscale image A, and use the read grayscale image A as the grayscale component Y R of the color image to be reconstructed; 解码模块:用于将特征码流和超先验码流进行神经网络解码和算术解码转换为待重建彩色图像的颜色分量UR和VRDecoding module: used to convert the feature code stream and the super-prior code stream into the color components UR and VR of the color image to be reconstructed by performing neural network decoding and arithmetic decoding; 重建模块:用于将待重建色彩图像的灰度分量和待重建色彩图像的颜色分量合并进行可逆YUV2RGB转换后,得到重建的彩色图像IRReconstruction module: used for combining the grayscale component of the color image to be reconstructed and the color component of the color image to be reconstructed and performing reversible YUV2RGB conversion to obtain a reconstructed color image IR ; 编码模块具体用于:The encoding module is specifically used for: 颜色分量U,V通过神经网络进行分析和编码得到特征和超先验,并建立特征的先验概率模型和超先验的独立概率模型,然后结合算术编码将特征换热超先验分别转换为特征码流和超先验码流;The color components U, V are analyzed and encoded through neural networks to obtain features and super priors, and the feature prior probability model and super prior independent probability model are established. Then, the features and super priors are converted into feature code streams and super prior code streams respectively by combining arithmetic coding; 隐写模块具体用于:The steganography module is specifically used for: 灰度分量Y的像素按列扫描表示为P1,P2,P3,…,Pm,特征码流和超先验码流合并成二进制码流且表示为b1,b2,b3,…,bnThe pixels of the gray component Y are scanned by columns and represented as P 1 , P 2 , P 3 , …, P m . The characteristic code stream and the super-prior code stream are combined into a binary code stream and represented as b 1 , b 2 , b 3 , …, b n . 按顺序取每3个像素和每3位二进制码为一组,第i组的3个像素分别表示为Pi_1,Pi_2,Pi_3,3位二进制码分别表示为bi_1,bi_2,bi_3Take every 3 pixels and every 3-bit binary code as a group in order, the 3 pixels in the i-th group are represented as Pi_1 , Pi_2 , Pi_3 , and the 3-bit binary code is represented as bi_1 , bi_2 , bi_3 ; 在步骤c中,所述隐写过程实现每组的3个像素嵌入3位二进制码信息,具体实现如下:In step c, the steganographic process embeds 3 bits of binary code information into each group of 3 pixels, which is specifically implemented as follows: 首先,根据3个像素的值计算出3位预测码:First, a 3-bit prediction code is calculated based on the values of the 3 pixels: 其中Bi_1,Bi_2,Bi_3表示第i组的3位预测码,表示第i组第n个像素pi_n的二进制值最低第j位,/>表示异或运算;Where Bi_1 , Bi_2 , Bi_3 represent the 3-bit prediction code of the i-th group, Indicates the lowest j-th bit of the binary value of the n-th pixel pi_n of the i-th group,/> Represents XOR operation; 如果预测码Bi_1,Bi_2,Bi_3与二进制码b i_1,b i_2,b i_3相等,则无需对像素做修改;否则通过修改像素Pi_1,P i_2,P i_3使预测码和二进制码相等,从而完成二进制码的隐写;If the predicted code Bi_1 , Bi_2 , Bi_3 is equal to the binary code Bi_1 , Bi_2 , Bi_3 , then there is no need to modify the pixel; otherwise, the predicted code and the binary code are made equal by modifying the pixel Pi_1 , Pi_2 , Pi_3 , thus completing the steganography of the binary code; 数量不满足3位的码流直接替换相应序列像素的最低二进制位实现隐写,完成将3个像素Pi+1,Pi+2,Pi+3隐藏3位二进制码bi+1,bi+2,bi+3,生成可逆灰度图像A。The code streams whose number does not meet 3 bits directly replace the lowest binary bit of the corresponding sequence pixels to achieve steganography, and complete the hiding of 3 pixels Pi +1 , Pi +2 , Pi +3 into 3-bit binary codes bi +1 , bi +2 , bi +3 to generate a reversible grayscale image A. 6.根据权利要求5所述的系统,其特征在于,转换模块具体用于:6. The system according to claim 5, characterized in that the conversion module is specifically used for: 将原始彩色图像进行可逆RGB2YUV转换得到灰度分量Y和颜色分量U和V,其中可逆RGB2YUV转换公式如下:The original color image is reversibly converted to RGB2YUV to obtain the grayscale component Y and the color components U and V. The reversible RGB2YUV conversion formula is as follows: 其中,Y表示灰度分量值,U和V表示颜色分量值;R,G,B表示原始彩色图像的像素值;表示向下取整;Among them, Y represents the gray component value, U and V represent the color component values; R, G, B represent the pixel values of the original color image; Indicates rounding down; 解码模块具体用于:The decoding module is specifically used for: 根据独立概率模型将超先验码流算术解码为超先验,然后通过神经网络解码得到特征的概率模型参数,从而得出先验概率模型并将特征码流算术解码为特征,之后由神经网络对特征进行合成得到待重建彩色图像的颜色分量UR,VRAccording to the independent probability model, the super-prior code stream is arithmetically decoded into the super-prior, and then the probability model parameters of the feature are obtained by decoding through the neural network, so as to obtain the a priori probability model and arithmetically decode the feature code stream into features, and then the neural network synthesizes the features to obtain the color components UR , VR of the color image to be reconstructed; 重建模块具体用于:The reconstruction module is specifically used to: 将待重建色彩图像的灰度分量和待重建色彩图像的颜色分量合并进行可逆YUV2RGB转换后,得到重建的彩色图像IRAfter combining the grayscale component of the color image to be reconstructed and the color component of the color image to be reconstructed and performing reversible YUV2RGB conversion, a reconstructed color image IR is obtained. 可逆YUV2RGB转换公式为:The reversible YUV2RGB conversion formula is: 其中,R,G,B表示彩色图像的像素值;Y表示灰度分量值,U,V表示颜色分量值;表示向下取整。Among them, R, G, B represent the pixel values of the color image; Y represents the gray component value, and U, V represent the color component value; Indicates rounding down. 7.一种基于神经网络与图像隐写的可逆灰度装置,其特征在于,包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述计算机程序被所述处理器执行时实现如权利要求1至4中任一项所述的基于神经网络与图像隐写的可逆灰度方法的步骤。7. A reversible grayscale device based on neural network and image steganography, characterized in that it includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the steps of the reversible grayscale method based on neural network and image steganography as described in any one of claims 1 to 4 are implemented. 8.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有信息传递的实现程序,所述程序被处理器执行时实现如权利要求1至4中任一项所述的基于神经网络与图像隐写的可逆灰度方法的步骤。8. A computer-readable storage medium, characterized in that an implementation program for information transmission is stored on the computer-readable storage medium, and when the program is executed by a processor, the steps of the reversible grayscale method based on neural network and image steganography as described in any one of claims 1 to 4 are implemented.
CN202210834416.8A 2022-07-14 2022-07-14 Reversible gray scale method, system and device based on neural network and image steganography Active CN115049541B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210834416.8A CN115049541B (en) 2022-07-14 2022-07-14 Reversible gray scale method, system and device based on neural network and image steganography

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210834416.8A CN115049541B (en) 2022-07-14 2022-07-14 Reversible gray scale method, system and device based on neural network and image steganography

Publications (2)

Publication Number Publication Date
CN115049541A CN115049541A (en) 2022-09-13
CN115049541B true CN115049541B (en) 2024-05-07

Family

ID=83165878

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210834416.8A Active CN115049541B (en) 2022-07-14 2022-07-14 Reversible gray scale method, system and device based on neural network and image steganography

Country Status (1)

Country Link
CN (1) CN115049541B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116016794B (en) * 2022-12-07 2024-10-08 成都信息工程大学 A hierarchical image display method

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7253836B1 (en) * 1998-06-30 2007-08-07 Nikon Corporation Digital camera, storage medium for image signal processing, carrier wave and electronic camera
CN111696026A (en) * 2020-05-06 2020-09-22 华南理工大学 Reversible gray scale map algorithm and computing device based on L0 regular term
CN111882476A (en) * 2020-07-17 2020-11-03 广州大学 Image steganography method for automatically learning embedded cost based on deep reinforcement learning
CN112801922A (en) * 2021-04-01 2021-05-14 暨南大学 Color image-gray image-color image conversion method
CN113259676A (en) * 2020-02-10 2021-08-13 北京大学 Image compression method and device based on deep learning
WO2021164176A1 (en) * 2020-02-20 2021-08-26 北京大学 End-to-end video compression method and system based on deep learning, and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7253836B1 (en) * 1998-06-30 2007-08-07 Nikon Corporation Digital camera, storage medium for image signal processing, carrier wave and electronic camera
CN113259676A (en) * 2020-02-10 2021-08-13 北京大学 Image compression method and device based on deep learning
WO2021164176A1 (en) * 2020-02-20 2021-08-26 北京大学 End-to-end video compression method and system based on deep learning, and storage medium
CN111696026A (en) * 2020-05-06 2020-09-22 华南理工大学 Reversible gray scale map algorithm and computing device based on L0 regular term
CN111882476A (en) * 2020-07-17 2020-11-03 广州大学 Image steganography method for automatically learning embedded cost based on deep reinforcement learning
CN112801922A (en) * 2021-04-01 2021-05-14 暨南大学 Color image-gray image-color image conversion method

Non-Patent Citations (7)

* Cited by examiner, † Cited by third party
Title
emote Sensing Image Colorization Based on Multiscale SEnet GAN;Min Wu 等;2019 12th International Congress on Image and Signal Processing, BioMedical Engineering and Informatics (CISP-BMEI);20200123;全文 *
Generating High-Fidelity Images with Disentangled Adversarial VAEs and Structure-Aware Loss;Habibeh Naderi 等;2020 International Joint Conference on Neural Networks (IJCNN);20200928;全文 *
Invertible Grayscale;MENGHAN XIA 等;ACM Transactions on Graphics;20181130;第37卷(第6期);第246:1-246:10 *
基于神经网络编码和图像隐写术的可逆灰度方法;林焕然;中国优秀硕士学位论文全文数据库 信息科技辑;20240215;I138-134 *
基于颜色编码和图像隐 写术的可逆灰度方法;林焕然 等;计算机应用研究;20231117;第41卷(第5期);全文 *
用于盗版追踪的格雷码加密域可逆水印研究;石慧;冯斌;王相海;李明楚;宋传鸣;;中国图象图形学报;20181116(11);第23-39页 *
采用插值和排序的大容量可逆数据隐藏算法;熊祥光;曹永锋;欧卫华;刘彬;韦立;李伟岸;;计算机辅助设计与图形学学报;20181015(10);第173-184页 *

Also Published As

Publication number Publication date
CN115049541A (en) 2022-09-13

Similar Documents

Publication Publication Date Title
CN113658051A (en) A method and system for image dehazing based on recurrent generative adversarial network
CN108346125A (en) A kind of spatial domain picture steganography method and system based on generation confrontation network
CN114677304A (en) Image deblurring algorithm based on knowledge distillation and deep neural network
CN116681584A (en) A Multilevel Diffusion Image Super-resolution Algorithm
CN113934890A (en) Method and system for automatically generating scene video by characters
CN114332479B (en) A training method and related device for target detection model
CN109996073B (en) An image compression method, system, readable storage medium and computer device
Li et al. Research into an image inpainting algorithm via multilevel attention progression mechanism
Sadeeq et al. Image compression using neural networks: a review
CN115049541B (en) Reversible gray scale method, system and device based on neural network and image steganography
CN112991169B (en) Image compression method and system based on image pyramid and generation countermeasure network
CN112132158A (en) A visual image information embedding method based on self-encoding network
CN114363633A (en) Depth point cloud compression coding method based on full-automatic attention network
Wei et al. Generative steganographic flow
Wang et al. Raw image reconstruction with learned compact metadata
CN116091288A (en) Diffusion model-based image steganography method
CN110475039A (en) Lines, Artss draw method, equipment and the storage medium hidden and restored
CN117750021B (en) Video compression method, device, computer equipment and storage medium
CN111343458B (en) Sparse gray image coding and decoding method and system based on reconstructed residual
Im et al. FaceBERT: Face De-Identification Using VQGAN and BERT
CN113344786B (en) Video transcoding method, device, medium and equipment based on geometric generative model
CN105279728A (en) Intelligent mobile terminal image steganography method based on secret information encryption pretreatment
CN115797178A (en) Video super-resolution method based on 3D convolution
CN116112685A (en) Image steganography method based on diffusion probability model
EP4201064A1 (en) Video compression using optical flow

Legal Events

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

Effective date of registration: 20240726

Address after: 1003, Building A, Zhiyun Industrial Park, No. 13 Huaxing Road, Tongsheng Community, Dalang Street, Longhua District, Shenzhen City, Guangdong Province, 518000

Patentee after: Shenzhen Wanzhida Enterprise Management Co.,Ltd.

Country or region after: China

Address before: 510006 No. 230, Waihuan West Road, Guangzhou, Guangdong

Patentee before: Guangzhou University

Country or region before: China

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20240912

Address after: Building 7, No. 748, Erqiao Village, Fengcheng Town, Fengxian District, Shanghai, 200000

Patentee after: Shanghai Maihao Network Technology Co.,Ltd.

Country or region after: China

Address before: 1003, Building A, Zhiyun Industrial Park, No. 13 Huaxing Road, Tongsheng Community, Dalang Street, Longhua District, Shenzhen City, Guangdong Province, 518000

Patentee before: Shenzhen Wanzhida Enterprise Management Co.,Ltd.

Country or region before: China