Method, device, equipment and medium for embedding and authenticating invisible image identity code

By embedding identification codes into images and utilizing orthogonal coding and singular value decomposition techniques, the problems of easy counterfeiting and insufficient robustness of existing anti-counterfeiting methods are solved, achieving invisible embedding and efficient anti-counterfeiting traceability.

CN115730952BActive Publication Date: 2026-02-27BEIJING BODA GREEN HIGH TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110983171.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-25
Publication Date
2026-02-27
Estimated Expiration
2041-08-25

AI Technical Summary

Technical Problem

Existing visible anti-counterfeiting methods are easily counterfeited, while invisible anti-counterfeiting methods lack robustness and traceability, resulting in poor anti-counterfeiting effectiveness.

Method used

By embedding the identity code into the image, and using orthogonal coding and singular value decomposition techniques, the invisible embedding and authentication of the identity code are achieved while maintaining the image quality. The Hadamard matrix is ​​used for encoding scrambling, and the identity code is embedded into the singular matrix of the image through singular value decomposition.

Benefits of technology

It achieves the invisible embedding of identity codes, ensuring that image quality is not affected, and can still accurately extract identity codes when facing attacks. It has high robustness and flexibility, supports the embedding of codes for different products, and realizes anti-counterfeiting and traceability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115730952B_ABST
    Figure CN115730952B_ABST
Patent Text Reader

Abstract

The application discloses an invisible image identity code embedding and authentication method, device, equipment and medium, the method comprises an identity code embedding image method and an image identity code authentication method, the identity code is embedded into the image, the invisibility of the identity code is realized, the identity code embedding image method comprises the following steps: generating a quadrature code according to an original image size and scrambling a quadrature code serial number, obtaining a scrambled quadrature code library; obtaining an identity code from the scrambled quadrature code library; embedding the identity code into the original image to obtain an image with the identity code; when the image identity code is authenticated, the identity code is extracted from the image with the identity code through cross verification. The invisible image identity code embedding and authentication method, device, equipment and medium disclosed by the application have the advantages of small influence on the quality of the original image after the identity code is embedded, high recognition stability, high accuracy, high flexibility, wide use range and the like.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to a kind of invisible image identity code embedding and authentication method, belong to anti-counterfeiting technology and digital image processing field. BACKGROUND

[0002] The authenticity of commodity is generally identified using commodity supervision code and anti-counterfeiting two-dimensional code, etc., but these visible anti-counterfeiting methods can be scanned and counterfeited by modern high-precision instruments.

[0003] In addition, the prior art also has invisible anti-counterfeiting method, which is mostly using digital watermarking technology to process product image, and hides the corresponding identification information. However, the hidden identification image will cause color distortion of the embedded watermark host image, and only can identify the authenticity of product, cannot trace the source of counterfeit and shoddy products, and the robustness of anti-counterfeiting image product representation information is poor.

[0004] Due to the above reasons, the present application has been studied in depth, and a kind of invisible image identity code embedding and authentication method is proposed, which realizes invisible anti-counterfeiting of image product and realizes the traceability of product. SUMMARY

[0005] In order to overcome the above problems, the present application has been studied in depth, and a kind of invisible image identity code embedding and authentication method is designed, which includes identity code embedding image method and image identity code authentication method, and realizes the invisibility of identity code by embedding identity code into image.

[0006] In a preferred embodiment, the identity code embedding image method comprises the following steps:

[0007] S1, generating orthogonal code library and shuffling according to original image size, obtaining shuffled orthogonal code library;

[0008] S2, obtaining identity code from shuffled orthogonal code library;

[0009] S3, embedding identity code into original image to obtain image with identity code.

[0010] According to a preferred embodiment of the present application, in step S1, the code is orthogonal code, and the shuffling refers to disturbing the arrangement order of elements in orthogonal code library while maintaining the orthogonality of orthogonal code.

[0011] According to a preferred embodiment of the present application, in step S1, the original image is subjected to color channel separation to obtain a plurality of single-channel color images, and the plurality of single-channel color images are converted into a plurality of single-channel matrices.

[0012] According to a preferred embodiment of the present application, in step S2, an element in a certain row or column of the scrambled orthogonal encoding library is selected and converted into the identity code.

[0013] According to a preferred embodiment of the present application, S3 comprises the following sub-steps:

[0014] S31, singular value decomposition is performed on the single-channel matrix converted from the original image to obtain a left singular matrix of the original image, a diagonal matrix of the original image, and a right singular matrix of the original image, and singular value decomposition is performed on the identity code matrix to obtain a right singular matrix of the identity code;

[0015] S32, the right singular matrix of the identity code is embedded into the right singular matrix of the original image to obtain an embedded right singular matrix;

[0016] S33, the single-channel color image is restored according to the left singular matrix of the original image, the diagonal matrix of the original image, and the embedded right singular matrix to obtain the image with the identity code.

[0017] According to a preferred embodiment of the present application, the image identity code authentication method comprises the following steps:

[0018] S4, an encoding library suspected to contain an image with an identity code is obtained, and a row or column vector with the embedded identity code in the encoding library is extracted;

[0019] S5, the extracted row or column vector with the embedded identity code is detected to locate the identity code.

[0020] On the other hand, the present application also discloses an invisible image identity code embedding and authentication device, characterized in that it comprises an embedding device and an authentication device,

[0021] The embedding device comprises an image encoding scrambling module, an identity code acquisition module, and an identity code embedding module,

[0022] The image encoding scrambling module is used to encode and scramble according to the size of the original image to obtain a scrambled encoding library.

[0023] The identity code acquisition module is used to acquire the identity code from the scrambled orthogonal encoding library.

[0024] The identity code embedding module is used to embed the identity code into the original image to obtain an image with the identity code.

[0025] The authentication device comprises an identity code extraction module and an identity code positioning module,

[0026] The identity code extraction module is used to acquire an encoding library of an image with an embedded identity code, and extract a row or column vector with the embedded identity code in the encoding library.

[0027] The identity code positioning module is used for detecting the extracted identity code embedded row or column vector, and positioning the identity code.

[0028] In addition, the present application also provides an electronic device comprising:

[0029] at least one processor; and

[0030] a memory in communication with the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the above method.

[0031] In addition, the present application also provides a computer readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to perform the above method.

[0032] The present application has the beneficial effects including:

[0033] (1) The present application uses the orthogonality of orthogonal coding, and innovatively uses orthogonal coding as image authentication code. Since orthogonal coding can achieve a small value, the image identity code has less impact on the quality of the original image, that is, the imperceptibility of the watermark is better.

[0034] (2) Since orthogonal codes have strong difference between each other, and the singular value decomposition method used in the present application has certain stability, the image identity code can still extract and determine the original image identity authentication code after strong attack and correlation detection, that is, the identity code embedded in the image has high robustness.

[0035] (3) Since the code length, code quantity and implementation method of orthogonal coding have great flexibility, the present application can embed different codes for different commodities to achieve the purpose of anti-counterfeiting and tracing the source.

[0036] (4) The above characteristics make the present application not only applicable to digital image products, but also applicable to analog image printed packaging products or files. BRIEF DESCRIPTION OF DRAWINGS

[0037] Figure 1 A flow chart of embedding and authentication method of invisible image identity code according to a preferred embodiment of the present application is shown;

[0038] Figure 2 The original picture in Example 1 is shown;

[0039] Figure 3 The image with identity code obtained in Example 1 is shown;

[0040] Figure 4Pictures obtained by performing a random noise attack on the obtained image with the identity code in Example 1 are shown.

[0041] Figure 5 Pictures obtained by performing a cutting attack on the obtained image with the identity code in Example 1 are shown.

[0042] Figure 6 Pictures obtained by performing a rotation attack on the obtained image with the identity code in Example 1 are shown.

[0043] Figure 7 An element diagram of the matrix retM obtained in Example 1 is shown. DETAILED DESCRIPTION

[0044] The application will be further described in detail below with the aid of the accompanying drawings and examples. The features and advantages of the application will become more apparent from these descriptions.

[0045] The term "exemplary" is used herein to mean "serving as an example, instance, or illustration." Any implementation described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other implementations. Unless specifically stated otherwise, the drawings are not drawn to scale and the appended examples are not intended to be limiting.

[0046] According to the present application, a method for embedding and authenticating a hidden image identity code is provided, which includes an image identity code embedding method and an image identity code authentication method.

[0047] The identity code is a series of digital codes for identifying product information and is one of the common means for anti-counterfeiting inquiries.

[0048] In traditional anti-counterfeiting, the identity code is often packaged or photocopied on the product in a clear code manner or is set on the product image in a watermark manner, which is extremely easy to be counterfeited and has poor anti-counterfeiting effect.

[0049] In the present application, the identity code is embedded in the image to realize the invisibility of the identity code.

[0050] Specifically, the image identity code embedding method includes the following steps:

[0051] S1. generating a scrambled orthogonal code library according to the size of an original image;

[0052] S2. obtaining an identity code from the scrambled orthogonal code library;

[0053] S3. embedding the identity code in the original image to obtain an image with the identity code.

[0054] In step S1, the original image is an image to be printed on a product;

[0055] The coding is preferably orthogonal coding, more preferably orthogonal coding selected according to the pixel size of the original image.

[0056] The scrambling refers to scrambling the arrangement order of elements in the orthogonal coding library while maintaining the orthogonality of the orthogonal coding. Preferably, the scrambling of the arrangement order is achieved by scrambling the row order of elements in the orthogonal coding library or scrambling the column order of elements.

[0057] In a preferred embodiment, the orthogonal coding is performed using a Hadamard matrix.

[0058] In a preferred embodiment, step S1 comprises the following sub-steps:

[0059] S11, obtaining the size of the original image;

[0060] S12, performing orthogonal coding according to the image size to generate an orthogonal coding library;

[0061] S13, scrambling the orthogonal coding library.

[0062] In S11, the size of the original image refers to the size of the dot matrix when the original image is represented using a row and column dot matrix, for example, when the original image is represented using a pixel dot matrix, the size of the original image is the pixel size.

[0063] Further, each dot in the row and column dot matrix can be one pixel or multiple pixels as one dot, preferably one pixel is one dot in the row and column dot matrix.

[0064] In a preferred embodiment, the original image is subjected to color channel separation to obtain a plurality of single-channel color images, each single-channel color image can be represented as a row and column dot matrix, wherein the number of rows of the image is represented as M and the number of columns is represented as N, then the original image can be represented as a plurality of M*N matrices, for example, according to the r(red), g(green), b(blue) color channel separation, an r primary color single-channel matrix, a g primary color single-channel matrix, and a b primary color single-channel matrix can be obtained, the size of the original image is M*N, and the size of the single-channel matrix is the same as the size of the original image.

[0065] Further, each dot in the row and column dot matrix can be one pixel or multiple pixels as one dot, preferably one pixel is one dot in the row and column dot matrix.

[0066] In a preferred embodiment, the original image is read and the color channels are separated by using matlab.

[0067] In S12, according to the image size or the single-channel matrix size, the size is denoted as M*N, M*N length orthogonal codes can be generated, which can be expressed as (M*N) rows and (M*N) columns, and the code library is called orthogonal code library.

[0068] Further, the orthogonal code library has a plurality of which corresponds to a plurality of single-channel color images one by one, which is called single-channel orthogonal code library in the application, for example, three single-channel color images can be obtained by separating r, g, b color channels, and then three single-channel orthogonal code libraries are obtained.

[0069] In S13, the plurality of single-channel orthogonal codes are scrambled respectively to obtain a plurality of single-channel scrambled orthogonal code libraries, and specifically, the scrambling is realized by disordering the arrangement order of different orthogonal codes in the orthogonal code library.

[0070] Preferably, a random number sequence of 1-n is generated, and n orthogonal codes in the orthogonal code library are rearranged according to the random sequence to realize the scrambling of the orthogonal codes.

[0071] Further, the random number sequence of 1-n used in scrambling different single-channel orthogonal codes is different.

[0072] According to the application, when the image is separated into r, g, b color channels, the scrambled orthogonal code library obtained after scrambling the r primary color orthogonal codes is denoted as randH1, the scrambled orthogonal code library obtained after scrambling the g primary color orthogonal codes is denoted as randH2, and the scrambled orthogonal code library obtained after scrambling the b primary color orthogonal codes is denoted as randH3.

[0073] In order to make the identity code have good robustness, the traditional identity code needs to increase the strength of embedding the identity code, that is, increase the identity code number, so that after the identity code is embedded into the original image, the color of the embedded image is distorted.

[0074] In step S2, the identity code is obtained from the scrambled orthogonal code library. Since the identity code is obtained from the orthogonal code library, the identity code itself has strong anti-interference ability and good robustness, so that the identity code value can be controlled between 0.001 and 1, and the identity code value is adjustable. While ensuring good robustness, it also has good imperceptibility. After embedding the identity code into the original image, the influence on the quality of the original image is small.

[0075] Further, according to the application, the randomness of the obtained identity code is ensured by scrambling the orthogonal codes, so that the identity code is difficult to be cracked, and the anti-counterfeiting effect is ensured.

[0076] Further, since the code length, code quantity and implementation method of the orthogonal code have great flexibility, the application can embed different codes for different goods.

[0077] Specifically, in step S2, the identity code comprises a plurality of single-channel identity code matrices, each single-channel identity code matrix corresponding to a single-channel scrambled orthogonal code library.

[0078] Further, the single-channel identity code matrix is obtained by deforming the elements of the xth row or column of the single-channel orthogonal code library:

[0079] In the single-channel scrambled orthogonal code library, the elements in the xth row or column of each orthogonal code are taken, and the elements in the row or column are denoted as H xi Since the number of elements in the xth row or column of each orthogonal code is M*N, H xi can be deformed into a matrix of M rows and N columns, which is the corresponding single-channel identity code matrix, wherein when the xth row of each orthogonal code is taken, x∈[2, M]; when the xth column of each orthogonal code is taken, x∈[2, N].

[0080] In the present application, the set of a plurality of single-channel identity code matrices is a group of identity codes, which is also called an embedding matrix, denoted as M j where j represents different channels, for example, when separating an image according to r, g, and b color channels, j = r, g, and b.

[0081] Preferably, the deformation refers to splitting all ordered elements of the orthogonal code into a matrix form matching the image pixel matrix, for example, splitting the elements into a one-dimensional array with a length of N in order, and arranging the split one-dimensional array in columns in order.

[0082] According to the present application, after obtaining the identity code, the identity code is matched with the product to be prevented from being counterfeited and recorded in a traceability table, preferably, a group of identity codes is only used to represent one product, so as to realize the traceability of the product.

[0083] In a preferred embodiment, a plurality of groups of identity codes are obtained, different rows or columns in the orthogonal code are selected when each group of identity codes is obtained, and the plurality of groups of identity codes are matched with one product at the same time, so as to improve the anti-counterfeiting effect.

[0084] The inventor found that when there is only one group of identity codes, false positives may occur in the subsequent identification process, that is, no identity code is embedded in the image to be identified, but the identity code is identified. The simultaneous use of multiple groups of identity codes can solve this problem.

[0085] In S3, the following sub-steps are included:

[0086] S31, singular value decomposition is performed on the matrix obtained by converting the original image to obtain an original left singular matrix, an original diagonal matrix, and an original right singular matrix, and singular value decomposition is performed on the identity code matrix to obtain an identity right singular matrix;

[0087] S32, embedding the identity right singular matrix into the original graph right singular matrix to obtain an embedded right singular matrix;

[0088] S33, restoring the image according to the original graph left singular matrix, the original graph diagonal matrix and the embedded right singular matrix to obtain the image with the identity code.

[0089] In step S31, the original image is converted into a matrix in the same manner as in step S11, and further, singular value decomposition is performed on different single-channel matrices respectively to obtain an original graph left singular matrix U j , an original graph diagonal matrix S j and an original graph right singular matrix V j , where j represents different single channels.

[0090] Further, the original graph right singular matrix V j is saved for subsequent authentication of the identity code.

[0091] The single-channel identity code matrix is subjected to singular value decomposition to obtain a single-channel left singular matrix U mj , a single-channel diagonal matrix S mj and a single-channel identity right singular matrix V mj .

[0092] The singular value decomposition (Singular Value Decomposition, SVD) is a decomposition method of a matrix. Any matrix W can be expressed as W = USV T after singular value decomposition, where U is a left singular matrix, V is a right singular matrix, and S is a diagonal matrix.

[0093] In step S32, the identity right singular matrix is embedded into the original graph right singular matrix by the following formula:

[0094] V wmj = V j + a * V mj

[0095] where V wmj represents the embedded right singular matrix; a represents the embedding strength, and the specific value can be determined by multiple tests by those skilled in the art, which is not particularly limited in the present application.

[0096] In step S33, inverse operation of singular value decomposition is performed according to the following formula to restore the single-channel image:

[0097] I wmj = U j S j V wmj T

[0098] wherein I wmj represents the reduced single-channel color image.

[0099] Further, the reduced single-channel color image is merged into one image, and the merged image is the image with the identity code.

[0100] Further, when multiple sets of identity codes are obtained in step S2, step S3 is repeated multiple times, so that each set of identity codes is embedded into the original image.

[0101] In a more preferred embodiment, it is also assumed that a non-specific attacker will perform image attacks on the image with the identity code obtained in step S3 in order to attempt to weaken the identity code.

[0102] The image attack can be one or more of a random noise attack, a pulse noise attack, a Gaussian noise attack, a Gaussian filter attack, a clipping attack, and a rotation attack, which are not particularly limited in the present application. These image attack methods are conventional methods and will not be described in detail in the present application.

[0103] The image identity code authentication method is used to identify the identity code implied in the image with the identity code.

[0104] The image identity code authentication method includes the following steps:

[0105] S4, obtaining an encoding library of images suspected of containing identity codes, and extracting a row or column vector embedded with the identity code in the encoding library;

[0106] S5, detecting the extracted row or column vector embedded with the identity code, and locating the identity code.

[0107] The image will not only deform after image attack, but also deform after printing and use. Noise, image type conversion, digital-to-analog conversion, etc. How to identify the identity code implied in the image in the state of image deformation is one of the problems to be solved by the present application.

[0108] The step S4 includes the following sub-steps:

[0109] S41, singular value decomposition is performed on the image suspected of containing the identity code to obtain a right singular matrix of the image;

[0110] S42, obtaining an embedding matrix of the image to be identified;

[0111] S43, obtaining an encoding row vector of the image to be identified.

[0112] In step S41, color channel separation is performed on the image suspected of containing the identity code to obtain multiple single-channel matrices of the image to be identified.

[0113] Furthermore, the method for obtaining multiple single-channel matrices is exactly the same as the method used in step S1.

[0114] Furthermore, singular value decomposition is performed on multiple single-channel matrices to obtain the right singular matrix V′ of the image to be recognized. wmj .

[0115] In step S42, based on the original graph right singular matrix V j With the right singular matrix V′ of the image to be identified wmj Obtain the embedding matrix M′ of the graph to be identified. j .

[0116] Specifically, the embedding matrix M′ is extracted using the following formula. j The right singular value matrix V′ mj :

[0117] V′ mj =(V′) wmj -V j ) / α

[0118] Where α is the embedding strength, which is the same as the embedding strength in step S32.

[0119] Furthermore, the embedding matrix M′ of the graph to be identified is obtained by performing the inverse operation of singular value decomposition using the following formula. j :

[0120] M′ j =U mj S mj V′ mj T

[0121] Among them, U mj For a single-channel left singular matrix, S mj It is a single-channel diagonal matrix, with the same value as in step S31, M′ j Each contains multiple single-channel embedding matrices, for example, when separating an image by the r, g, and b color channels, M′ j Contains the r-primal color map embedding matrix M′ r , g-base color image embedding matrix M′ g b-base color image embedding matrix M′ b .

[0122] In step S43, the image to be identified is embedded into matrix M′. j Each single-channel embedding matrix is ​​rearranged in rows or columns, and each single-channel embedding matrix can form a row vector or column vector of size M*N.

[0123] Further, when the steps S1-S3 are arranged according to rows, the step S43 is also arranged according to rows; when the steps S1-S3 are arranged according to columns, the step S43 is also arranged according to columns.

[0124] The steps S42 and S43 are repeated, and a plurality of row vectors or column vectors can be obtained for each single channel. A matrix He is formed by the plurality of row vectors or column vectors of each single channel.

[0125] Since the image suspected to contain the identity code can be attacked and the identity code can be changed, the identity code needs to be detected for correlation and positioned. Further, if there are multiple positions, it indicates that there is a false detection. In this case, the positions formed by the plurality of single channel matrices can be cross-verified to determine the final identity code.

[0126] In the step S5, the following sub-steps are included:

[0127] S51, correlation detection is performed;

[0128] S52, multiple cross-verifications are performed;

[0129] S53, the identity code is determined.

[0130] In the step S51, each row of each single channel matrix He is correlated with each orthogonal code in the corresponding single channel orthogonal code library one by one. The detection can be expressed as:

[0131]

[0132] where h i is the i-th element of the m-th row of the matrix He, H ji is the i-th element of the j-th row of the orthogonal code library; sum j indicates summation of the j-th row, m∈[1,M] and n∈[1,N].

[0133] Through the above formula, the correlation between the first row to the n-th row of the orthogonal code matrix and the matrix He can be obtained, i.e., sum1, sum2, sum3, … sum n If the m-th row of the orthogonal code library has the maximum correlation with the m-th row of He, i.e., sum m is the largest, m is likely to be the source of the embedded identity code image. The row number is recorded as ret, and the first to n-th rows are traversed. N row numbers with the same sum m are obtained, and the row numbers are recorded one by one.

[0134] In step S52, the row numbers obtained in different single channels in step S51 are combined into a new matrix retM, and the matrix retM is a matrix of C*D size, wherein C is the number of single channels, for example, C is 3 when separating an image into r, g and b color channels, and D is an empirical value, preferably the number of columns N of the image.

[0135] In step S53, the value element R with the most repeated occurrences in the matrix retM is determined, that is, the xth row or column in step S2, and the identity code can be obtained by repeating step S2, and the anti-counterfeiting query and traceability of the product can be realized by matching the identity code with the traceability table.

[0136] In another aspect, the present application also provides a hidden image identity code embedding device, comprising an image encoding and scrambling module, an identity code acquisition module and an identity code embedding module.

[0137] The image encoding and scrambling module is used for encoding and scrambling according to the size of the original image to obtain a scrambled and encoded library.

[0138] The identity code acquisition module is used for acquiring the identity code from the scrambled and orthogonal encoded library.

[0139] The identity code embedding module is used for embedding the identity code into the original image to obtain an image with the identity code.

[0140] The present application also provides a hidden image identity code authentication device, comprising an identity code extraction module and an identity code positioning module.

[0141] The identity code extraction module is used for acquiring the encoded library of the image with the hidden identity code, and extracting the row or column vector with the embedded identity code in the encoded library.

[0142] The identity code positioning module is used for detecting the extracted row or column vector with the embedded identity code to locate the identity code.

[0143] After the identity code positioning module locates the identity code, the identity code can be obtained through the identity code acquisition module in the hidden image identity code embedding device, so as to realize the anti-counterfeiting query and traceability of the product.

[0144] The various embodiments of the methods and apparatuses described above in this disclosure can be implemented in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a load programmable logic device (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.

[0145] Program code to implement methods of the disclosure can be written in any combination of one or more programming languages. The program code can be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the program code, when executed by the processor or controller, produces the functions / operations specified in the flowcharts and / or the block diagrams. The program code can be executed entirely on a machine, partially on a machine, partially on a machine as a stand-alone software package, and partially on a remote machine or a server.

[0146] In the context of the present disclosure, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include but is not limited to an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium will include one or more lines of electrical connections, portable computer disks, hard disk drives, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or Flash memory), optical fibers, portable compact disc read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0147] To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.

[0148] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.

[0149] The computer system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. A server can be a cloud server, also known as cloud computing server or cloud host, which is a host product in the cloud computing service system, to solve the defects of large management difficulty and weak business scalability in traditional physical host and VPS (Virtual Private Server, or VPS for short). The server can also be a server of a distributed system, or a server combined with a blockchain.

[0150] It should be understood that various forms of flow shown above can be used with orders of steps reordered, steps added, or steps deleted. For example, steps recited in the present disclosure can be performed in parallel, in series, or in a different order, without limitation herein, as long as the desired results of the technical solutions of the present disclosure can be achieved.

[0151] Embodiments

[0152] Embodiment 1

[0153] Embedding identity code to picture lena, the picture is as shown in Figure 2 The picture size is 32*32 pixels, and the embedding is performed through the following steps:

[0154] S1, generating orthogonal code library and shuffling according to the original image size, and obtaining shuffled orthogonal code library;

[0155] S2, obtaining identity code from the shuffled orthogonal code library;

[0156] S3, embedding the identity code into the original image to obtain the image with the identity code.

[0157] Further, step S1 includes the following sub-steps:

[0158] S11, converting the original image into a matrix;

[0159] S12, finding appropriate orthogonal codes according to the size of the image matrix to generate an orthogonal code library;

[0160] S13, shuffling the orthogonal code library.

[0161] In S11, the original image is read by matlab and each color channel is separated.

[0162] In step S12, Hadamard matrix is used for orthogonal coding to generate three Hadamard matrices with a size of 1024*1024 elements.

[0163] In step S13, the randperm() function is used to generate three random number sequences of 1-1024, and the three Hadamard matrices are shuffled according to the random number sequence in units of rows to obtain matrices randH1, randH2, and randH3.

[0164] In step S2, the 450th row code is taken from the Hadamard matrices randH1, randH2, and randH3 to obtain vectors H1, H2, and H3, and the three vectors are reshaped into a 32*32 matrix according to the column value as the embedding matrix M r , M g , M b .

[0165] In step S3, the following sub-steps are included:

[0166] S31, singular value decomposition is performed on the matrix of the original image to obtain the left singular matrix of the original image, the diagonal matrix of the original image, and the right singular matrix of the original image, and singular value decomposition is performed on the identity code matrix to obtain the right singular matrix of the identity code;

[0167] S32, embedding the right singular matrix of the identity code into the right singular matrix of the original image to obtain the embedded right singular matrix;

[0168] S33, performing matrix operation on the original graph left singular matrix, the original graph diagonal matrix and the embedding right singular matrix to restore the image, to obtain an image with an identity code, as shown in Figure 3 .

[0169] From Figure 3 it can be seen that the image identity code in the method has less impact on the quality of the original image, that is, the imperceptibility of the watermark is better.

[0170] Further, a random noise attack is performed on the obtained image with an identity code, and the result is as shown in Figure 4 .

[0171] A cutting attack is performed on the obtained image with an identity code, and the result is as shown in Figure 5 .

[0172] A rotation attack is performed on the obtained image with an identity code, and the result is as shown in Figure 6 .

[0173] The Figure 3 , 4 , 5, 6 are respectively subjected to image identity code authentication, and the authentication method comprises the following steps:

[0174] S4, obtaining an image suspected to contain an identity code, and comparing the image with an original image to obtain an identity code which may be changed due to factor modulus conversion or attack.

[0175] S5, searching for an image library containing an identity code, and performing identity code comparison to locate the identity code.

[0176] The step S4 comprises the following sub-steps:

[0177] S41, performing singular value decomposition on an image containing an identity code to obtain a right singular matrix of the image;

[0178] S42, obtaining an embedding matrix of a to-be-identified image;

[0179] S43, obtaining an encoding row vector of the to-be-identified image.

[0180] Further, in the step S41, the RGB color channels are separated and singular value decomposition is performed thereon to obtain matrices U wmj , S wmj , V wmj (j=r, g, b). The m-th row of the Hadamard matrix after permutation, m∈(2, 1024), is deformed into a 32*32 matrix, and singular value decomposition is performed on the matrix to obtain matrices U m , S m , V m . The embedding matrix M' is extracted by the following formulaj the right singular value matrix V' mj :

[0181] V' mj = (V' wmj - V j ) / α

[0182] Further, inverse operation of singular value decomposition is performed by the following formula to obtain the to-be-identified graph embedding matrix M' j :

[0183] M' j = U mj S mj V' mj T

[0184] In step S42, the matrix M' j is rearranged by row into a row vector of size 1*(1024), denoted as matrix He.

[0185] The He is detected for correlation with all row vectors except the first row in the corresponding Hadamard matrix to obtain the maximum row number ret.

[0186] In step S5, the following sub-steps are included:

[0187] S51, performing correlation detection;

[0188] S52, performing multiple cross-validation;

[0189] S53, determining the identity code.

[0190] In step S51, each row of each base color matrix He is detected for correlation with each orthogonal code in the base color orthogonal code library one by one, and the detection can be represented as:

[0191]

[0192] In step S52, the row numbers obtained in step S51 for different base colors are combined into a new matrix retM, and the elements of the matrix retM obtained by Figure 3 、 4 , 5, 6 are as shown in Figure 7 . As can be seen from the figure, the 450th row code appears in the three base color detections, that is, the identity code of the image is determined to be the 450th row of the three scrambling Hadamard matrices, which is consistent with the row number selected in step 2, proving that the identity code recognition is accurate.

[0193] From Figures 3 to 6The result shows that the recognition stability of the application is strong, even if the image is damaged and deformed to a certain extent, the original image identity authentication code can still be accurately extracted and determined, that is, the identity code embedded in the image has high robustness.

[0194] The above characteristics make the application capable of being used in digital image products and in printed packaging products or files of analog images.

[0195] In the description of the present application, it should be noted that the terms "upper", "lower", "inner", "outer", "front", "back" and the like indicate the orientation or positional relationship in the working state of the present application, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the devices or elements referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as a limitation on the present application. In addition, the terms "first", "second", "third", "fourth" are only for the purpose of description, and cannot be understood as indicating or implying relative importance.

[0196] In the description of the present application, it should be noted that unless otherwise explicitly specified and limited, the terms "mounting", "connecting", "connection" should be understood broadly, for example, it can be fixed connection, or detachable connection, or integral connection; it can be mechanical connection, or electrical connection; it can be direct connection, or indirect connection through intermediate medium; it can be the communication inside two elements. For those skilled in the art, the specific meaning of the above terms in the present application can be understood according to the specific circumstances.

[0197] The above describes the present application in combination with the preferred embodiments, but these embodiments are only exemplary and serve only to illustrate. On this basis, various substitutions and improvements can be made to the present application, which all fall within the protection scope of the present application.

Claims

1. A method for embedding and authenticating an invisible image identity code, characterized in that, This includes a method for embedding identity codes into images and a method for authenticating identity codes within images. The method achieves the invisibility of the identity code by embedding it into an image. The method for embedding identity codes into images includes the following steps: S1. Generate an orthogonal coding library based on the original image size and scramble it to obtain a scrambled orthogonal coding library. Scrambling refers to changing the order of elements in the orthogonal coding library while maintaining the orthogonality of the orthogonal coding. S2. Obtain the identity code from the scrambled orthogonal coding library; S3. Embed the identification code into the original image to obtain an image with the identification code; In step S1, the original image is subjected to color channel separation to obtain multiple single-channel color images, and the multiple single-channel color images are converted into multiple single-channel matrices. In step S2, elements from a row or column in the scrambled orthogonal coding library are selected and converted into identity codes; S3 includes the following sub-steps: S31. Perform singular value decomposition on the single-channel matrix of the original image to obtain the original image left singular matrix, the original image diagonal matrix, and the original image right singular matrix. Perform singular value decomposition on the identity code matrix to obtain the identity right singular matrix. S32. Embed the identity right singular matrix into the original graph right singular matrix to obtain the embedded right singular matrix; S33. Reconstruct a single-channel color image based on the left singular matrix of the original image, the diagonal matrix of the original image, and the embedded right singular matrix to obtain an image with an identification code; The image-based identity code authentication method includes the following steps: S4. Obtain the encoding library of images suspected of containing identity codes, and extract the row or column vectors of the embedded identity codes in the encoding library; S5. Detect the extracted row or column vectors containing the identity code and locate the identity code.

2. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method of claim 1.

3. A computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to claim 1.

Citation Information

Patent Citations

  • Digital watermarking algorithm for solving false positive problem

    CN112561772A

  • Color image digital watermark embedding and extracting method suitable for QR code

    CN112884629A