Image tampering detection method and processor
By generating a hash value in the first channel of the image and embedding verification information into the second channel, the problem of low accuracy in image tampering detection is solved, and active protection and high-precision detection of the image are achieved during the image generation process.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ALIBABA (CHINA) CO LTD
- Filing Date
- 2022-09-23
- Publication Date
- 2026-05-12
AI Technical Summary
Existing image tampering detection technologies struggle to identify tampering after images have undergone compression or scaling attacks, resulting in low detection accuracy and failing to meet robustness requirements.
The target image is generated by generating the original hash value on the first image channel and embedding the verification information into the second image channel. The verification information is then used to verify the target image to determine whether it has been tampered with.
It enables proactive image protection while keeping the original image generation process under control, improving the accuracy of tamper detection and accurately determining whether an image has been tampered with without saving lengthy original hash values.
Smart Images

Figure CN115527101B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing, and more specifically, to a method and processor for detecting image tampering. Background Technology
[0002] Currently, an increasing number of image editing software programs make it easy for people to edit image content. As a carrier of information, the authenticity of images is seriously threatened. Once maliciously tampered images are spread on platforms such as the Internet, they will cause certain losses to personal life, social order and other aspects. For example, there are acts such as fraudsters tampering with screenshots of transfer pages or altering chat content by taking screenshots of chat records.
[0003] After an image is tampered with, it often undergoes common attacks such as compression and scaling during transmission, making the traces of tampering weaker as the attack intensifies. However, for image editing, relevant technologies are only passive tamper detection techniques. These passive tamper detection techniques are difficult to identify images after compression, scaling, and other attack operations. Therefore, they cannot meet the requirements for robustness in tamper detection, resulting in low accuracy in image tamper detection.
[0004] There is currently no effective solution to the above problems. Summary of the Invention
[0005] This invention provides an image tampering detection method and processor to at least solve the technical problem of low accuracy in image tampering detection.
[0006] According to one aspect of the present invention, an image tampering detection method is provided, comprising: acquiring an original image to be detected, wherein the original image includes image content to be protected; determining the original hash value of the image content on a first image channel of the original image; generating verification information based on the original hash value, and embedding the verification information into a second image channel of the original image other than the first image channel; generating a target image based on the first image channel and the embedded second image channel, wherein the verification information is used to verify the target image to obtain a detection result, the detection result including: a result indicating that the target image has not been tampered with, and a result indicating that the target image has been tampered with.
[0007] According to one aspect of the present invention, another image tampering detection method is also provided, comprising: acquiring a target image to be detected, wherein the target image is generated based on a first image channel of an original image and a second image channel in the original image in which verification information is embedded, the verification information being generated based on the original hash value of the image content to be protected in the original image on the first image channel; extracting the verification information from the target image; verifying the target image based on the verification information to obtain a detection result, the detection result including: a result indicating that the target image has not undergone tampering operation, and a result indicating that the target image has undergone tampering operation.
[0008] According to one aspect of the present invention, another image tampering detection method is also provided, comprising: displaying an original image to be detected on the presentation screen of a virtual reality (VR) device or an augmented reality (AR) device, wherein the original image includes image content to be protected; the VR device or AR device determining the original hash value of the image content on a first image channel of the original image; after generating verification information based on the original hash value and embedding the verification information into a second image channel of the original image other than the first image channel, driving the VR device or AR device to render and display a target image generated based on the first image channel and the embedded second image channel, wherein the verification information is used to verify the target image to obtain a detection result, the detection result including: a result that the target image has not been tampered with, and a result that the target image has been tampered with.
[0009] According to one aspect of the present invention, another image tampering detection method is also provided, comprising: obtaining an original image to be detected by calling a first interface, wherein the original image includes image content to be protected, the first interface includes a first parameter, the parameter value of the first parameter being the original image; determining the original hash value of the image content on a first image channel of the original image; generating verification information based on the original hash value, and embedding the verification information into a second image channel of the original image other than the first image channel; generating a target image based on the first image channel and the embedded second image channel, wherein the verification information extracted from the target image and the determined target hash value of the image content on the luminance channel of the target image are used to verify the target image to obtain a detection result, the detection result including: a result that the target image has not been tampered with, and a result that the target image has been tampered with; and outputting the target image by calling a second interface, wherein the second interface includes a second parameter, the value of the second parameter being the target image.
[0010] According to one aspect of the present invention, an image tampering detection apparatus is provided, comprising: a first acquisition unit, configured to acquire an original image to be detected, wherein the original image includes image content to be protected; a first determination unit, configured to determine the original hash value of the image content on a first image channel of the original image; a first processing unit, configured to generate verification information based on the original hash value, and embed the verification information into a second image channel of the original image other than the first image channel; and a first generation unit, configured to generate a target image based on the first image channel and the embedded second image channel, wherein the verification information is used to verify the target image to obtain a detection result, the detection result including: a result indicating that the target image has not been tampered with, and a result indicating that the target image has been tampered with.
[0011] According to one aspect of the present invention, another image tampering detection apparatus is also provided, comprising: a second acquisition unit, configured to acquire a target image to be detected, wherein the target image is generated based on a first image channel of an original image and a second image channel in which verification information is embedded, the verification information being generated based on the original hash value of the image content to be protected in the original image on the first image channel; a second processing unit, configured to extract the verification information from the target image; and a verification unit, configured to verify the target image based on the verification information to obtain a detection result, the detection result including: a result indicating that the target image has not undergone tampering, and a result indicating that the target image has undergone tampering.
[0012] According to one aspect of the present invention, another image tampering detection apparatus is also provided, comprising: a display unit for displaying an original image to be detected on a presentation screen of a virtual reality (VR) device or an augmented reality (AR) device, wherein the original image includes image content to be protected; a second determining unit for the VR device or AR device to determine the original hash value of the image content on a first image channel of the original image; and a third processing unit for generating verification information based on the original hash value and embedding the verification information into a second image channel of the original image other than the first image channel, and then driving the VR device or AR device to render and display a target image generated based on the first image channel and the embedded second image channel, wherein the verification information is used to verify the target image to obtain a detection result, the detection result including: a result that the target image has not been tampered with, and a result that the target image has been tampered with.
[0013] According to one aspect of the present invention, another image tampering detection apparatus is also provided, comprising: a calling unit, configured to obtain an original image to be detected by calling a first interface, wherein the original image includes image content to be protected, the first interface includes a first parameter, and the parameter value of the first parameter is the original image; a third determining unit, configured to determine the original hash value of the image content on a first image channel of the original image; a fourth processing unit, configured to generate verification information based on the original hash value, and embed the verification information into a second image channel of the original image other than the first image channel; a second generating unit, configured to generate a target image based on the first image channel and the embedded second image channel, wherein the verification information is used to verify the target image to obtain a detection result, the detection result including: a result that the target image has not been tampered with, and a result that the target image has been tampered with; and an output unit, configured to output the target image by calling a second interface, wherein the second interface includes a second parameter, and the value of the second parameter is the target image.
[0014] According to another aspect of the present invention, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored program, wherein, when the program is executed, it controls the device where the storage medium is located to execute the image tampering detection method of any of the above-mentioned methods.
[0015] According to another aspect of the present invention, a processor is also provided, which is used to run a program, wherein the image tampering detection method of any one of the above-mentioned methods is executed when the program is running.
[0016] In this embodiment of the invention, an original image to be detected is obtained, wherein the original image includes image content to be protected; the original hash value of the image content on a first image channel of the original image is determined; verification information is generated based on the original hash value, and the verification information is embedded into a second image channel of the original image other than the first image channel; a target image is generated based on the first image channel and the embedded second image channel, wherein the verification information is used to verify the target image to obtain a detection result, the detection result including: the result that the target image has not been tampered with, and the result that the target image has been tampered with. In other words, this embodiment of the invention generates verification information from the original hash value of the original image in the first image channel, and embeds the verification information into the second image channel of the original image, which is independent of the hash calculation, to obtain the target image after modifying the original image. In this way, when a suspicious target image is obtained, the verification information extracted from the target image and the target hash value of the image content in the first image channel of the target image can be used to verify whether the target image has been maliciously tampered with, without the need to save the lengthy original hash value. It can also accurately determine whether the target image has been tampered with, thereby achieving the purpose of actively protecting the original image under the controllable original image generation process, and thus achieving the technical effect of improving the accuracy of image tamper detection, solving the technical problem of low accuracy of image tamper detection. Attached Figure Description
[0017] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this invention, illustrate exemplary embodiments of the invention and are used to explain the invention, but do not constitute an undue limitation of the invention. In the drawings:
[0018] Figure 1 This is a hardware structure block diagram of a computer terminal (or mobile device) for an image tampering detection method according to an embodiment of the present invention.
[0019] Figure 2 This is a flowchart of an image tampering detection method according to an embodiment of the present invention;
[0020] Figure 3 This is a flowchart of another image tampering detection method according to an embodiment of the present invention;
[0021] Figure 4 This is a schematic diagram of the hardware environment of a virtual reality device according to an embodiment of the present invention for an image tampering detection method;
[0022] Figure 5 This is a flowchart of another image tampering detection method according to an embodiment of the present invention;
[0023] Figure 6This is a schematic diagram of the processing result of an image tampering detection method according to an embodiment of the present invention;
[0024] Figure 7 This is a flowchart of another image tampering detection method according to an embodiment of the present invention;
[0025] Figure 8 This is a schematic diagram of image processing by a computer device according to an embodiment of the present invention;
[0026] Figure 9 This is a flowchart of an active image tampering detection method according to an embodiment of the present invention;
[0027] Figure 10 This is a schematic diagram of an overall image hash according to an embodiment of the present invention;
[0028] Figure 11 This is a schematic diagram of image local hashing according to an embodiment of the present invention.
[0029] Figure 12 This is a schematic diagram of an image text hash according to an embodiment of the present invention;
[0030] Figure 13 This is a schematic diagram of an image hash calculation according to an embodiment of the present invention;
[0031] Figure 14 This is a flowchart of processing an image with an embedded watermark according to an embodiment of the present invention;
[0032] Figure 15 This is a flowchart of a suspicious image detection method according to an embodiment of the present invention;
[0033] Figure 16 This is a structural block diagram of a computing environment according to an embodiment of the present invention;
[0034] Figure 17 This is a structural block diagram of the service grid for an image tampering detection method according to an embodiment of the present invention;
[0035] Figure 18 This is a schematic diagram of an image tampering detection device according to an embodiment of the present invention;
[0036] Figure 19 This is a schematic diagram of another image tampering detection device according to an embodiment of the present invention;
[0037] Figure 20 This is a schematic diagram of another image tampering detection device according to an embodiment of the present invention;
[0038] Figure 21 This is a schematic diagram of another image tampering detection device according to an embodiment of the present invention;
[0039] Figure 22 This is a structural block diagram of a computer terminal according to an embodiment of the present invention. Detailed Implementation
[0040] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0041] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0042] First, some nouns or terms that appear in the description of the embodiments of the present invention shall be interpreted as follows:
[0043] Tampering detection is a technique that uses algorithms to locate tampered areas in an image. It typically includes two parts: detecting whether an image has been maliciously tampered with (smearing, copying, pasting, cropping, etc.) and locating the tampered image area.
[0044] Image hashing algorithms map an input image into a short sequence of numbers, which is usually called the hash of the input image;
[0045] Digital watermarking adds subtle, imperceptible digital information to digital media such as images, audio, and video to protect copyright, prove authenticity, track piracy, or add extra information to products.
[0046] Example 1
[0047] According to an embodiment of the present invention, an embodiment of an image tampering detection method is also provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0048] The method embodiment provided in Embodiment 1 of the present invention can be executed in a mobile terminal, computer terminal or similar computing device. Figure 1 This is a hardware structure block diagram of a computer terminal (or mobile device) for an image tampering detection method according to an embodiment of the present invention. Figure 1 As shown, the computer terminal 10 (or mobile device 10) may include one or more processors 102 (shown as 102a, 102b, ..., 102n in the figure) (processor 102 may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission module 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of a BUS bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0049] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 10 (or mobile device). As involved in the embodiments of the present invention, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).
[0050] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the image tampering detection method in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby implementing the above-mentioned application vulnerability detection method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0051] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0052] The display can be, for example, a touchscreen liquid crystal display (LCD) that allows the user to interact with the user interface of the computer terminal 10 (or mobile device).
[0053] It should be noted here that, in some optional embodiments, the above... Figure 1 The computer device (or mobile device) shown may include hardware elements (including circuitry), software elements (including computer code stored on a computer-readable medium), or a combination of both hardware and software elements. It should be noted that... Figure 1 This is only one instance of a specific particular instance and is intended to illustrate the types of components that may exist in the aforementioned computer device (or mobile device).
[0054] exist Figure 1 In the operating environment shown, this invention provides a method for application on the active protection side, such as... Figure 2 The image tampering detection method shown is illustrated. It should be noted that the image tampering detection method in this embodiment can be derived from... Figure 1 The mobile terminal in the illustrated embodiment is executed.
[0055] Figure 2 This is a flowchart of an image tampering detection method according to an embodiment of the present invention. Figure 2 As shown, the method may include the following steps:
[0056] Step S202: Obtain the original image to be detected, wherein the original image includes the image content to be protected.
[0057] In the technical solution provided by step S202 of the present invention, the original image to be detected can be acquired. The original image can be various types of images acquired in various application scenarios, such as poster images in news application scenarios, facial images in urban traffic application scenarios, images in software pages in program application scenarios, certificate images, etc., and can be natural images, remote sensing images, color medical images, network-generated images, screenshots, etc. No specific limitations are placed on the specific acquisition scenario and type of the original image. In this embodiment, the original image can be an image including image content to be protected; the image content to be protected can be the object to be protected in the image, such as the entire original image, text in the original image, or a partial image in the original image.
[0058] Optionally, since the definition of malicious tampering varies in different application scenarios, the image content to be protected can also be different. The image content to be protected can be adjusted according to actual needs and usage scenarios. The image content to be protected can be combined with multiple content detection methods as needed. For example, the image content to be protected for news poster images can be a combination of faces and text.
[0059] Step S204: Determine the original hash value of the image content on the first image channel of the original image.
[0060] In the technical solution provided by step S204 of the present invention, the original image can be decomposed into channels to obtain a first image channel. A hash function can be used to determine the original hash value of the original image on the first image channel. The first image channel can be a luminance channel or a chrominance channel, such as a chrominance channel U channel, a chrominance channel V channel, a luminance channel Y channel, etc. This is only an example and no specific limitation is made on the channel type. The hash function can be used to map the image content to be protected into a sequence of 0s and 1s. The original hash value can be a value composed of a sequence of 0s and 1s, such as 1, or 01011110, etc.
[0061] Optionally, the image content to be protected in the original image can be processed using a hash function to obtain the original hash value on the first image channel.
[0062] For example, when the original image to be detected is obtained, if the content of the image to be protected is text information in the image, the text information in the original image can be obtained by using an Optical Character Recognition (OCR) algorithm, and the text information can be processed by a hash algorithm to obtain the original hash value corresponding to the text information in the image as 1100001...
[0063] Step S206: Generate verification information based on the original hash value, and embed the verification information into the second image channel of the original image other than the first image channel.
[0064] In the technical solution provided in step S206 of the present invention, the original hash value is obtained, and verification information can be generated based on the original hash value. The verification information can be used as watermark information and embedded into the second image channel of the original image other than the first image channel by setting the embedding strength. When the first image channel is a luminance channel, the second image channel can be a chrominance channel. When the first image channel is a chrominance channel, the second image channel is a luminance channel. The verification information can be used for image tampering detection. It can be a single number, a string of check codes, or a verification information of appropriate length selected according to actual needs. For example, when the storage capacity of the original image is small, a verification information of appropriate length can be selected to reduce the storage capacity of the image and ensure a certain degree of robustness. The verification information can be obtained by Hamming code verification, Reed-Solomon code (RS code) verification, parity check, etc. This is only an example and does not impose specific restrictions on the acquisition of verification information.
[0065] Optionally, the original hash value of the image content on the first image channel can be determined, and verification information can be generated based on the original hash value. The generated verification information can be embedded into a second image channel in the original image other than the first image channel.
[0066] For example, if even parity is used to verify the verification information, when the original hash value on the first image channel is 11001100, a one-bit check code 0 can be generated. Then, the number 0 is used as watermark information and embedded into the second image channel of the image through an image digital watermarking algorithm. The image digital watermarking algorithm can be spatial domain watermarking or frequency domain digital watermarking. No specific restrictions are placed on the algorithm for embedding the watermark here.
[0067] For example, when the first image channel is the luminance channel and the second image channel is the chroma channel, the original hash value of the luminance channel can be embedded into the chroma channel of the image using a digital watermarking algorithm, and the hash value can be used as verification information. When the first image channel is the chroma channel and the second image channel is the luminance channel, the original hash value of the first image channel can be embedded into the second image channel (luminance channel) of the original image using a digital watermarking algorithm, and the hash value can be used as verification information. After processing the original image using the above methods, when the original image is maliciously tampered with, the location of the error in the hash value can be checked through the verification information, thereby quickly determining the location of the tampering in the original image.
[0068] In this embodiment of the invention, verification information is generated based on the original hash value and embedded into the channel of the original image. This maintains detection sensitivity while allowing the image hash value to represent the image itself. Processing the hash value effectively reduces image storage costs and computational complexity, thus achieving efficient image data processing. Furthermore, it eliminates the need to store the original hash value of the original image locally, making it more widely applicable, easier to use, and more suited to real-world scenarios. In this embodiment, the luminance channel and chrominance channel are interchangeable, allowing for the selection of the appropriate channel based on actual conditions, further expanding the scope of application of this invention. However, since attacks typically target the luminance channel and rarely target the chrominance channel, in this embodiment, the first image channel can be the luminance channel to conform to practical applications.
[0069] Step S208: Based on the first image channel and the embedded second image channel, a target image is generated. The verification information is used to verify the target image and obtain the detection result. The detection result includes: the result that the target image has not been tampered with, and the result that the target image has been tampered with.
[0070] In the technical solution provided by step S208 of the present invention, a first image channel and an embedded second image channel can be obtained, and the first image channel and the second image channel after embedding verification information can be fused to obtain a target image, wherein the target image can be a protected image that has completed active protection.
[0071] Optionally, verification information can be extracted from the target image, and the verification information can be verified against the target hash value of the target image to obtain the detection result of the target image. The detection result can indicate whether the target image has been tampered with or not.
[0072] In this embodiment, the target hash value can be verified based on the verification information extracted from the target image. If the verification passes, it means that the target image has not been tampered with. If the verification fails, the tampering detection result can be output. For example, a verification failure prompt message can be displayed on the mobile terminal, along with the specific location or location information of the verification failure. This is only an example and no specific restrictions are placed on the location and content of the output tampering detection result.
[0073] For example, verification information is generated based on the original hash value, and the verification information is embedded into a second image channel in the original image other than the first image channel. The first image channel and the embedded second image channel are obtained. After fusing the first image channel and the second image channel with embedded verification information to obtain the target image, when detecting the target image, the target hash value on the first image channel of the target image can be determined. If the verification information extracted from the target image is the same as the target hash value, it can be said that the target image was obtained by embedding the original hash value into the original image. Therefore, the extracted verification information and the calculated target hash value can be directly compared bit by bit. If every position of the two is the same, it means that the target image has not been tampered with; if there are differences, the position (image block) corresponding to the different hash values is the position where the target image has been tampered with.
[0074] The method described in this embodiment is an active tamper detection method, which can include active protection and tamper detection. The difference between it and passive tamper detection lies in whether the image is modified and protected in advance. Passive tamper detection requires the ability to obtain the image source. When the source image is available, the tampering can be seen by comparison with the human eye. However, in general, the cost of obtaining the source image is very high (e.g., a large number of searches are required) or there is no source image (e.g., various certificates, invoices, real-time camera shots, program front-end pages, etc.). In these cases, watermark information is embedded instantly when the image is generated, and there is no watermark-free image version saved locally. Since it is difficult to compare with the source image, passive detection protection has the technical problem of low efficiency in image tamper detection.
[0075] Through steps S202 to S208 of the present invention, the original hash value of the original image in the first image channel is used to generate verification information. The verification information is then embedded into the second image channel of the original image, which is independent of the hash calculation, to obtain the target image after modification of the original image. This achieves active protection of the original image. When a suspicious image is obtained, the hash value can be extracted and the extracted hash value can be verified against the verification information to verify whether the target image has been maliciously tampered with. It can accurately determine whether tampering has occurred without having to save the lengthy original hash value. Thus, this embodiment actively protects the original image while keeping the original image generation process under control, thereby improving the accuracy of image tamper detection and solving the technical problem of low accuracy in image tamper detection.
[0076] The method described in this embodiment will be further described below.
[0077] As an optional implementation, step S204, determining the original hash value of the image content on the first image channel of the original image, includes: determining multiple target image block sets corresponding to the image content in multiple image block sets of the original image, wherein the multiple image blocks in the image block sets have the same size; generating one or more bits of hash value in the original hash value based on the pixel value of any target image block in the target image block set on the first image channel, and the pixel values of the adjacent target image blocks of the target image block on the first image channel, wherein the adjacent target image blocks are the image blocks adjacent to the target image block in the multiple image block sets.
[0078] In this embodiment, the size of the blocks in the original image can be determined based on the detection accuracy. The original image is then divided equally based on the determined size to obtain multiple image blocks of the same size, resulting in multiple image block sets of the original image. The image content of the original image is determined, thereby determining multiple target image block sets corresponding to the image content. The pixel values of any target image block in the target image block set on the first image channel, as well as the pixel values of adjacent target image blocks on the first image channel, are determined. Based on the pixel values of the target image block on the first image channel and the pixel values of its adjacent target image blocks on the first image channel... The value generates one or more bits of the original hash value. The image patch set can contain multiple image patches of the same size. For example, it can be a 32*32 region composed of multiple image patches of the same size. This is just an example and there are no specific restrictions on the size and shape of the image patch set. The pixel value can be a hash value. The adjacent target image patch can be an image patch that is adjacent to the target image patch among multiple image patches. For example, it can be an image patch located at the left, top left, top right, or top position of the target image patch in the original image. Image patches that are adjacent to the target image patch can be adjacent target image patches of the target image patch. There are no specific restrictions on the adjacency here.
[0079] Optionally, the original image can be divided into image blocks of a fixed size to obtain at least one set of image blocks of the original image. Each segmented image block can be calculated sequentially according to the raster scanning order to obtain the pixel value of each image block. Multiple sets of image blocks in the segmented image blocks that correspond to the image content of the original image can be determined to obtain the target image block set. One or more hash values in the original hash value can be obtained based on the pixel values of the target image blocks in the target image block set on the first image channel and the pixel values of multiple adjacent target image blocks on the first image channel.
[0080] In this embodiment, the size of the original image or target image segmentation can be a pre-set size. The smaller the segmentation size, the higher the detection accuracy. Therefore, the size of the segmentation to be determined can be determined according to the required detection accuracy. For example, if the original image is pre-set to be a 1080P image, the original image can be divided into 32*32 image blocks. If the tampering is done to an area smaller than 32*32, it may not be detected. Therefore, the required level of accuracy can be selected based on actual needs, thereby significantly improving the accuracy of malicious image tampering detection and the efficiency of image data processing.
[0081] As an optional implementation, based on the pixel values of any target image block in the target image block set on the first image channel, and the pixel values of neighboring target image blocks on the first image channel, one or more bits of the original hash value are generated, including: in response to the average pixel value of the target image block on the first image channel being greater than the average pixel value of neighboring target image blocks on the first image channel, determining one or more bits of the first target value as one or more bits of the hash value; in response to the average pixel value of the target image block on the first image channel not being greater than the average pixel value of neighboring target image blocks on the first image channel, determining one or more bits of the second target value that is different from the one or more bits of the first target value as one or more bits of the hash value.
[0082] In this embodiment, the average pixel value of the target image block itself on the first image channel and the average pixel values of multiple adjacent target image blocks on the first image channel can be obtained. It is then determined whether the average pixel value of the target image block is greater than the average pixel values of the multiple adjacent target image blocks. If the average pixel value of the target image block is greater than the average pixel values of the adjacent target image blocks on the first image channel, then in response to the average pixel value of the target image block on the first image channel being greater than the average pixel values of the multiple adjacent target image blocks on the first image channel, one or more first target values can be determined as one or more hash values of the target image block on the first image channel. If the average pixel value of the target image block is not greater than the average pixel value of multiple adjacent target image blocks in the first image channel, then in response to the average pixel value of the target image block in the first image channel being not greater than the average pixel value of multiple adjacent target image blocks in the first image channel, one or more second target values can be determined as one or more hash values of the target image block in the first image channel. Here, the average pixel value can be the hash average value, which can be calculated by the average hash algorithm (aHash); the first target value can be a preset value, for example, it can be 1; the second target value can be a preset value that is different from the first target value, for example, it can be 0.
[0083] In this embodiment of the invention, the hash value of the target image block on the first image channel is determined by the average pixel value of the target image block, thereby improving the robustness of the target image. Here, the hash value of the target image block on the first image channel can be determined by the difference hash algorithm, the perceptual hash algorithm, etc. This is only an example and is not a specific limitation.
[0084] For example, a perceptual hash algorithm can be used to determine one or more hash values of the target image block in the first image channel. A discrete cosine transform can be performed on the original image. At this time, the energy of the original image may be concentrated in the low-frequency part located in the upper left corner. The target image block set in the upper left corner can be selected, for example, it can be an 8*8 image block set. The target image block in the target image block set is determined. There are no specific restrictions on the size and shape of the image block set. The average value of the target image block set can be calculated, and the pixel values of the target image blocks in the target image block set can be binarized according to the average value to obtain the original hash value of the image content in the first image channel of the original image.
[0085] Optionally, the original image can be divided into blocks of a fixed size. Each segmented image block can be calculated sequentially according to the raster scanning order, thereby obtaining the hash value h corresponding to each image block. The average pixel value a1 of the target image block can be calculated using an average hash algorithm. At the same time, the average pixel value a2 of the region composed of the left, top left, top, and top right image blocks in multiple adjacent target image blocks of the target image block is calculated. If a1 > a2, the hash value corresponding to the target image block is 1; otherwise, it is 0. The fixed size can be a pre-set size. The smaller the fixed size, the higher the detection accuracy. The size of the image segmentation can be determined according to the detection accuracy, thereby improving the efficiency of image tampering detection.
[0086] As an optional implementation, the first image channel is adjusted based on the image content, wherein the original hash value of the image content affected by interference information remains unchanged in the adjusted first image channel; the target image is generated based on the embedded second image channel and the adjusted first image channel.
[0087] In this embodiment, the first image channel can be adjusted based on the image content, and the target image can be generated based on the embedded second image channel and the adjusted first image channel. The original hash value of the image content interfered with by the interference information on the adjusted first image channel remains unchanged. The interference information can be a malicious tampering attack, such as deletion, compression, or other attacks.
[0088] As an optional implementation, adjusting the first image channel based on image content includes: adjusting the first image channel in response to the difference between the average pixel value of the target image block in the original image on the first image channel and the average pixel value of adjacent target image blocks on the first image channel being less than a threshold, wherein the adjusted first image channel makes the difference between the average pixel value of the target image block on the first image channel and the average pixel value of adjacent target image blocks on the first image channel not less than the threshold, and the adjacent target image blocks are image blocks adjacent to the target image block in the original image block set.
[0089] In this embodiment, it can be determined whether the difference between the average pixel value of the target image block in the first image channel and the average pixel value of multiple adjacent target image blocks in the first image channel is less than a threshold. If the difference between the average pixel value of the target image block in the first image channel and the average pixel value of multiple adjacent target image blocks in the first image channel is less than the threshold, the first image channel is adjusted until the difference between the average pixel value of the target image block in the first image channel and the average pixel value of multiple adjacent target image blocks in the first image channel is not less than the threshold. The target image can be generated based on the embedded second image channel and the adjusted first image channel. The threshold can be a value set according to actual needs. The difference information can be used to represent the distance between the average value of the target image block and the adjacent target image blocks, such as the Hamming distance, etc. The specific form of the difference information is not limited here.
[0090] Since the difference between the target image block and its neighboring target image blocks becomes very small after the target image undergoes non-malicious tampering attacks (such as deletion, compression, etc.), the robustness of the obtained hash value is relatively poor, making the target image easy to change. Therefore, in this embodiment of the invention, the first image channel can be adjusted as described above to increase the difference information between the average pixel value of the target image block on the first image channel and the average pixel value of multiple neighboring target image blocks on the first image channel. This makes the relationship between the target image block and multiple neighboring target image blocks less likely to be changed, ensuring that the original hash value of the image content affected by interference remains unchanged on the adjusted first image channel, thus improving the robustness of the hash value of the target image block.
[0091] Optionally, since not all directly calculated hash values are robust, the Y chroma channel can be adjusted appropriately based on the robustness of each hash value. For example, if the hash values between two image blocks are very close, it indicates that the robustness between the two regions is poor. Therefore, the first image channel can be adjusted to increase the distance between the average pixel value of the target image block and the average pixel value of the adjacent target image blocks, thereby adjusting the first image channel of the original image and increasing the robustness of the image block hash values.
[0092] As an optional implementation, generating a target image based on the embedded second image channel and the adjusted first image channel includes: merging the embedded second image channel and the adjusted first image channel to obtain the target image.
[0093] In this embodiment, a second image channel with embedded verification information and an adjusted first image channel are obtained. The embedded second image channel and the adjusted first image channel are then fused to obtain the target image. The fusion method of the first image channel and the second image channel can be a merging of two channels or a weighted average of the pixel values of the two channels to achieve the purpose of merging the channels. The fusion method described here is only for illustrative purposes and no specific limitation is made on the fusion method.
[0094] In this embodiment of the invention, based on the independent split channels, the hash value of a certain second image channel can be extracted, the value of the corresponding first image channel can be fine-tuned, and the verification information can be embedded into the second image channel that is independent of the hash calculation, thereby achieving the purpose of strengthening hash robustness. Digital watermarking is used to embed the verification information into the channel that is independent of the hash value calculation, so as to protect the copyright of the target image, prove the authenticity and reliability of the target image, and not affect the viewability and integrity of the target image. The modified values of the second image channel and the first image channel are fused together, and accurate tamper location can be achieved without additionally saving the lengthy hash value, thereby achieving the technical effect of improving the accuracy of image tamper detection and solving the technical problem of low accuracy of image tamper detection.
[0095] As an optional implementation, step S206, embedding the verification information into a second image channel in the original image other than the first image channel, includes: determining the verification information as watermark information based on the key; and embedding the watermark information into the second image channel.
[0096] In this embodiment, the verification information can be determined as watermark information based on the key, and the watermark information can be embedded into the second image channel. The key can be pre-generated or pre-obtained and can be used for embedding and extracting watermark information. The watermark information can be a kind of identification information, which can be embedded into the original image through a digital watermarking algorithm.
[0097] Optionally, the verification information can be embedded as watermark information into the chroma channel U and chroma channel V using a key to obtain the watermarked chroma channel U1 and chroma channel V1. The image digital watermarking algorithm can be spatial domain watermarking or frequency domain digital watermarking. No specific restrictions are placed on the algorithm for embedding the watermark here.
[0098] In this embodiment of the invention, when the original image generation process is controllable, watermark information is generated using the hash value of the original image, and the watermark information is embedded into the second image channel. This allows the embedded watermark information to be used to verify whether the target image has been maliciously tampered with and to locate the tampered area.
[0099] As an optional implementation, an attack operation is performed on the embedded second image channel; in response to the successful extraction of watermark information from the attacked second image channel, it is determined that the verification information has been successfully embedded into the second image channel.
[0100] In this embodiment, an attack operation is performed on the second image channel after the watermark information is embedded, and the watermark information is extracted from the attacked second image channel. In response to the successful extraction of the watermark information from the attacked second image channel, it can be determined that the verification information has been successfully embedded into the second image channel. The attack operation can be compression, scaling, enhancement, or other operations.
[0101] Optionally, taking the need to resist transmission by social media software as an example, if you want to test whether the embedding strength can resist the transmission by social media software, you can manually upload the target image after embedding the watermark, and then download it back to extract it and see the accuracy of the extraction. However, when testing on a large amount of image data, it is very impractical to manually upload and download because it is impossible to call various social media software programs. Therefore, an automated approximation attack method can be implemented locally, using simulation tools (such as black box applications) to simulate the attack operations that these software programs would perform on the image.
[0102] Optionally, simulation tools from open-source libraries can be used to perform similar attack operations on the target image to achieve a similar attack effect to the software on the local machine. After the watermark is embedded, even if a certain attack is performed on the target image containing the watermark, it is desirable to be able to extract the watermark information from the attacked target image. Therefore, the watermark information in the attacked target image can be extracted to obtain the verification information of the target image. If the watermark information is successfully extracted, the second image channel U1 and V1 after watermark embedding is obtained; if the watermark information extraction fails, the embedding strength of the target image is adjusted until the verification information of the target image can be successfully extracted, thereby ensuring that the verification information is successfully embedded into the second image channel.
[0103] As an optional implementation, generating verification information based on the original hash value includes: determining the original hash value as verification information; or converting the original hash value into verification information based on the error correction code.
[0104] In this embodiment, the original hash value can be determined as the verification information, or the original hash value can be converted into verification information based on the error correction code. The error correction code can be Hamming code, Reed-Solomon code, etc., and no specific restrictions are placed on the type of error correction code here.
[0105] Optionally, the longer the generated verification information is, the more error bits it can tolerate. Therefore, appropriate error correction codes can be selected according to the amount of content information to be detected, or the code can be designed independently according to the type of tampering to be detected. There is no specific limitation on the length of the verification information here. For example, Hamming codes, RS codes, and other methods can be used to accurately determine whether the image has been tampered with and to quickly locate the location of the tampering.
[0106] For example, Hamming codes can be used to convert hash values into check information. When dealing with hash values of length n, a checksum satisfying 2 can be embedded. k Verification information of length k ≥ n+k+1.
[0107] For another example, the hash value can be used as verification information, and a digital watermarking algorithm can be used to embed the hash value into the second image channel of the original image.
[0108] In this embodiment of the invention, by actively protecting the original image while keeping the original image generation process controllable, and by generating verification information using the original hash value of the original image in the first image channel, and embedding the verification information into the second image channel which is independent of the hash calculation, a target image modified from the original image is obtained. Thus, when a suspicious target image is obtained, the verification information and hash are extracted from the target image to verify whether the target image has been maliciously tampered with. It is not necessary to save the lengthy original hash value to accurately determine whether it has been tampered with, thereby improving the technical effect of improving the accuracy of image tamper detection and solving the technical problem of low accuracy in image tamper detection.
[0109] The image tampering detection method of this invention will be described below from the image detection end. It should be noted that the image detection end and the active protection end can be deployed on the same side or on different sides. For example, they can both be deployed on the mobile terminal side, or they can be deployed on the client and server respectively. No specific restrictions are made on the deployment location of the image tampering detection method here.
[0110] Figure 3 This is a flowchart of another image tampering detection method according to an embodiment of the present invention. Figure 3 As shown, the method may include the following steps:
[0111] Step S302: Obtain the target image to be detected, wherein the target image is generated based on the first image channel of the original image and the second image channel in which verification information is embedded, and the verification information is generated based on the original hash value of the image content to be protected in the first image channel.
[0112] In the technical solution provided by step S302 of the present invention, the original image is decomposed into a first image channel and a second image channel, the image content to be protected in the original image is determined, verification information is generated based on the original hash value of the image content to be protected in the first image channel, the verification information is embedded into the second image channel, the second image channel is fused with the first image channel to obtain the target image, and the target image after active protection processing is obtained. The target image can also be called a suspicious image.
[0113] Step S304: Extract verification information from the target image.
[0114] In the technical solution provided by step S304 of the present invention, the target image can be spatially transformed and decomposed to obtain a first image channel and a second image channel. Verification information can be obtained from the second image channel, and the target hash value of the image content on the first image channel of the target image can be determined; or the verification information can be obtained from the first image channel, and the target hash value of the image content on the second image channel of the target image can be determined.
[0115] Step S306: Verify the target image based on the verification information to obtain the detection result. The detection result includes: the result that the target image has not been tampered with, and the result that the target image has been tampered with.
[0116] In the technical solution provided by step S306 of the present invention, the target image is verified based on the verification information and the target hash value to obtain the detection result. The detection result can be the result that the target image has not been tampered with, or the result that the target image has been tampered with.
[0117] For example, the target hash value can be verified based on the verification information. If the verification passes, it means that the target image has not been tampered with, and the "Target image has not been tampered with" flag can be displayed on the screen. If the verification fails, the tampering detection result can be output based on the verification result. For example, the "Target image has been tampered with" flag can be displayed on the screen, or the location and content information of the tampering can be displayed. There are no specific restrictions on the display location, content and form of the detection result here.
[0118] The method described in this embodiment will be further described below.
[0119] As an optional implementation, the target hash value of the image content on the luminance channel of the target image is determined; the target image is verified based on the verification information to obtain a detection result, including: in response to the target hash value matching the verification information, determining that the detection result is that the target image has not been tampered with; in response to the target hash value not matching the verification information, determining that the detection result is that the target image has been tampered with.
[0120] In this embodiment, the target hash value of the image content on the luminance channel of the target image can be determined. The target hash value is then matched with verification information. If the target hash value matches the verification information, it can be determined that the target image has not been tampered with, and the detection result is that the target image has not been tampered with. If the target hash value does not match the verification information, it can be determined that the target image has been tampered with, and the detection result is that the target image has been tampered with.
[0121] Optionally, the target hash value can correspond to the verification information in the active image protection process. It can be the same as the target hash value, or it can satisfy the verification rules of the error correction code, etc.
[0122] For example, if error-correcting codes or other verification methods are used, taking the Hamming code for detecting a single error as an example, when the target hash value differs from the verification information by only one bit, the Hamming code can detect the difference, and the image block associated with that position is the location where the tampering occurred. When the number of errors exceeds the error detection capability of the Hamming code, it will only detect that the protected area of the image has been tampered with, and will not be able to determine the location of the tampering. In this case, a more powerful error detection method can be used to detect the image, such as RS codes, etc. No specific restrictions are placed on the verification method here.
[0123] As an optional implementation, in response to the detection result indicating that a tampering operation has been performed on the target image, the location where the target hash value has been tampered with relative to the original hash value is determined based on the verification information extracted from the target image.
[0124] In this embodiment, when the detection result indicates that the target image has been tampered with, the location where the target hash value has been tampered with relative to the original hash value can be determined based on the verification information extracted from the target image.
[0125] Optionally, a verification module can be used to compare the verification information with the extracted target hash value to determine the location where the target hash value has been tampered with relative to the original hash value.
[0126] For example, if the embedded verification information is the original hash value, that is, the target image is obtained by directly embedding the original hash value into the original image, then the extracted target hash value and the verification information can be compared bit by bit. If they are the same, then the image block at that position in the target image has not been tampered with; if they are different, then the position (image block) corresponding to the different hash values is the position in the target image where tampering has occurred.
[0127] As an optional implementation, step S304, extracting verification information and determining the target hash value from the target image, includes: extracting watermark information from the second image channel of the target image based on the key, and determining the watermark information as verification information.
[0128] In this embodiment, watermark information can be extracted from the second image channel of the target image based on a key, and the extracted watermark information can be determined as verification information. The target hash value of the image content on the first image channel of the target image can be determined based on the verification information.
[0129] Optionally, watermark information (verification information) can be obtained from the second image channel of the target image using a key. If the verification information is successfully extracted, the target hash value of the image content on the first image channel of the target image can be calculated using the same hash function based on the image content to be protected in the image.
[0130] In this embodiment of the invention, a target image to be detected is obtained based on a second image channel embedded with verification information and a first image channel. The verification information is extracted from the target image, and the target hash value of the image content on the first image channel of the target image is determined. The target image is verified based on the verification information and the target hash value to obtain the detection result. By actively protecting the original image under the controllable original image generation process, the technical effect of improving the accuracy of image tampering detection is achieved, thereby solving the technical problem of low accuracy of image tampering detection.
[0131] As another alternative embodiment, Figure 4 This is a schematic diagram of the hardware environment of a virtual reality device according to an embodiment of the image tampering detection method of the present invention. Figure 4 As shown, the virtual reality device 404 is connected to the terminal 406, and the terminal 406 is connected to the server 402 via a network. The virtual reality device 404 is not limited to: virtual reality headsets, virtual reality glasses, virtual reality all-in-one machines, etc. The terminal 406 is not limited to PCs, mobile phones, tablets, etc. The server 402 can be a server corresponding to a media file operator. The network includes, but is not limited to: wide area network, metropolitan area network, or local area network.
[0132] Optionally, the virtual reality device 404 in this embodiment includes a memory, a processor, and a transmission device. The memory stores an application program that can be used to perform: acquiring an original image to be detected; determining the original hash value of the image content on a first image channel of the original image; generating verification information based on the original hash value; and embedding the verification information into a second image channel of the original image other than the first image channel; and generating a target image based on the first image channel and the embedded second image channel.
[0133] Optionally, the terminal in this embodiment can be used to display the original image to be detected on the presentation screen of a virtual reality (VR) device or an augmented reality (AR) device, wherein the original image includes image content to be protected; the VR device or AR device determines the original hash value of the image content on the first image channel of the original image; after generating verification information based on the original hash value and embedding the verification information into a second image channel in the original image other than the first image channel, the VR device or AR device is driven to render and display the target image generated based on the first image channel and the embedded second image channel.
[0134] Optionally, the virtual reality device 404 in this embodiment includes an eye-tracking head-mounted display (HMD) and an eye-tracking module that function the same as in the embodiments described above. That is, the screen in the HMD displays real-time images, and the eye-tracking module in the HMD acquires the real-time movement path of the user's eyes. In this embodiment, the terminal acquires the user's position and movement information in real three-dimensional space through a tracking system, and calculates the three-dimensional coordinates of the user's head in virtual three-dimensional space, as well as the user's field of vision orientation in virtual three-dimensional space.
[0135] Figure 4 The hardware structure block diagram shown can serve not only as an exemplary block diagram of the aforementioned AR / VR device (or mobile device), but also as an exemplary block diagram of the aforementioned server. In the operating environment described above, the present invention also provides, for example... Figure 5 The image tampering detection method shown can be applied to virtual reality (VR) devices or augmented reality (AR) devices, and the model can be used to analyze video segments in VR or AR devices. It should be noted that the image tampering detection method in this embodiment can be... Figure 5 The mobile terminal in the illustrated embodiment is executed.
[0136] Figure 5 This is a flowchart of another image tampering detection method according to an embodiment of the present invention, such as... Figure 5As shown, the method may include the following steps.
[0137] Step S502: Display the original image to be detected on the presentation screen of the virtual reality (VR) device or augmented reality (AR) device, wherein the original image includes the image content to be protected.
[0138] In step S504, the VR device or AR device determines the original hash value of the image content on the first image channel of the original image.
[0139] Step S506: After generating verification information based on the original hash value and embedding the verification information into the second image channel of the original image (excluding the first image channel), drive the VR device or AR device to render and display the target image generated based on the first image channel and the embedded second image channel. The verification information is used to verify the target image and obtain the detection result. The detection result includes: the result that the target image has not been tampered with, and the result that the target image has been tampered with.
[0140] Optionally, in this embodiment, the image tampering detection method described above can be applied to a hardware environment consisting of a server and a virtual reality device. The original image to be detected on the display screen of the virtual reality device or augmented reality device can be a server corresponding to a media file operator. The aforementioned network includes, but is not limited to, a wide area network (WAN), a metropolitan area network (MAN), or a local area network (LAN). The aforementioned virtual reality device is not limited to, for example, a virtual reality headset, virtual reality glasses, or a standalone virtual reality device.
[0141] It should be noted that the above-described method for processing medical images in VR or AR devices may include... Figure 5 The method of the illustrated embodiment is used to drive a VR device or AR device to display a target image generated based on a first image channel and an embedded second image channel.
[0142] Optionally, the processor in this embodiment can invoke the application stored in the memory via the transmission device to perform the above steps. The transmission device can receive media files sent by the server via a network, and can also be used for data transmission between the processor and the memory.
[0143] Optionally, in a virtual reality device, there is a head-mounted display with eye tracking. The screen in the HMD is used to display the video footage. The eye-tracking module in the HMD is used to acquire the real-time movement path of the user's eyes. The tracking system is used to track the user's position and movement information in real three-dimensional space. The computing and processing unit is used to acquire the user's real-time position and movement information from the tracking system and calculate the three-dimensional coordinates of the user's head in the virtual three-dimensional space, as well as the user's field of vision orientation in the virtual three-dimensional space.
[0144] In this embodiment of the invention, the virtual reality device can be connected to a terminal, and the terminal and the server are connected through a network. The virtual reality device is not limited to: virtual reality helmet, virtual reality glasses, virtual reality all-in-one machine, etc. The terminal is not limited to PC, mobile phone, tablet computer, etc. The server can be the server corresponding to the media file operator. The network includes, but is not limited to: wide area network, metropolitan area network or local area network.
[0145] Figure 6 This is a schematic diagram illustrating the processing result of an image tampering detection method according to an embodiment of the present invention, as shown below. Figure 6 As shown, the VR or AR device generates a watermarked target image based on the first image channel and the embedded second image channel.
[0146] In this embodiment of the invention, the original image to be detected is displayed on the presentation screen of a virtual reality (VR) device or an augmented reality (AR) device. The VR device or AR device determines the original hash value of the image content on the first image channel of the original image. After generating verification information based on the original hash value and embedding the verification information into the second image channel of the original image, the VR device or AR device is driven to render and display the target image generated based on the first image channel and the embedded second image channel. This achieves the technical effect of improving the accuracy of image tampering detection and solves the technical problem of low accuracy in image tampering detection.
[0147] This invention also provides another method for detecting image tampering, which can be applied to the software-as-a-service (SaaS) side.
[0148] Figure 7 This is a flowchart of another image tampering detection method according to an embodiment of the present invention, such as... Figure 7 As shown, the method may include the following steps.
[0149] Step S702: Obtain the original image to be detected by calling the first interface, wherein the original image includes the image content to be protected, and the first interface includes a first parameter, the value of which is the original image.
[0150] In the technical solution provided in step S702 of the present invention, the first interface can be an interface for data interaction between the server and the client. The client can transmit the original image to be detected into the first interface as a first parameter of the first interface to achieve the purpose of obtaining the original image to be detected.
[0151] Step S704: Determine the original hash value of the image content on the first image channel of the original image.
[0152] Step S706: Generate verification information based on the original hash value, and embed the verification information into the second image channel of the original image, excluding the first image channel.
[0153] Step S708: Based on the first image channel and the embedded second image channel, a target image is generated. The verification information extracted from the target image and the target hash value of the determined image content on the first image channel of the target image are used to verify the target image and obtain the detection result. The detection result includes: the result that the target image has not been tampered with, and the result that the target image has been tampered with.
[0154] Step S710: Output the target image by calling the second interface, wherein the second interface includes a second parameter, and the value of the second parameter is the target image.
[0155] In the technical solution provided by step S710 of the present invention, the second interface can be an interface for data interaction between the server and the client. The server can transmit the target image into the second interface as a parameter of the second interface to achieve the purpose of sending the target image to the client.
[0156] Figure 8 This is a schematic diagram of image processing using a computer device according to an embodiment of the present invention, such as... Figure 8 As shown, the original image to be detected can be obtained by calling the first interface. The computer device determines the original hash value of the image content on the first image channel of the original image, generates verification information based on the original hash value, and embeds the verification information into the second image channel of the original image. Based on the first image channel and the embedded second image channel, the target image is generated, and the obtained target image can be output by calling the second interface.
[0157] Optionally, the platform can output the target image by calling a second interface, which can be used to deploy and connect the original image to the system to be measured via the Internet, thereby outputting the target image.
[0158] In this embodiment of the invention, the original image to be detected is obtained by calling a first interface, wherein the original image includes image content to be protected, the first interface includes a first parameter, and the parameter value of the first parameter is the original image; the original hash value of the image content on the first image channel of the original image is determined; verification information is generated based on the original hash value and embedded into the second image channel of the original image; and a target image is generated based on the first image channel and the embedded second image channel, thereby achieving the technical effect of improving the accuracy of image tampering detection and solving the technical problem of low accuracy in image tampering detection.
[0159] Example 2
[0160] The preferred implementation of the method described above in this embodiment will be further described below, specifically using a robust active tamper detection and location method based on digital watermarking and hashing.
[0161] In the rapidly developing information age, the speed and breadth of information dissemination exceed people's imagination. The increasing availability of image editing software allows people to easily manipulate image content, severely threatening the authenticity of images as a carrier of information. For example, fraudsters tamper with screenshots of money transfer pages or chat logs. Once maliciously altered images are disseminated on online platforms, they can cause serious damage to personal lives and social order. Therefore, research on image tampering detection is of great significance, and providing tampering detection and location services is crucial in identifying fraud and in various evidentiary scenarios.
[0162] After images are tampered with, they often undergo common attacks such as compression and scaling during transmission on social media. The traces of tampering become weaker and weaker as the attacks become more sophisticated, making it difficult for passive tampering detection technologies to meet the robustness requirements for image tampering detection.
[0163] To address the aforementioned issues, a face-swapping detection technology for a platform is proposed. This technology involves three distinct detection stages: analyzing images and videos from low-level pixel and texture features to high-level features with global semantic information. This multi-faceted and multi-layered analysis covers various artificial intelligence (AI) face-swapping algorithms, significantly improving detection accuracy. However, this method is a passive tampering detection technique, requiring high precision in detecting AI-based face-swapping tampering. It is also vulnerable to attacks such as compression and scaling after the image has been tampered with. Furthermore, its detection range is limited to the face region, resulting in a narrow applicability.
[0164] In related technologies, a method for generating image hashes and detecting and locating image tampering based on conformal transformation has been proposed. This method is an active protection technology. It obtains and calculates the hash value of the received image through wavelet transform and edge detection, and estimates the tampering of the image by comparing the hash value of the received image with the hash value of the received image. However, this method is an active tampering detection technology, which requires the transmission of auxiliary information during the detection process. This is very inconvenient in practical use scenarios. Furthermore, it directly calculates the proportion of edge pixels in the local area to generate the hash value without modifying the image. When dealing with the transmission and processing of social media, its tampering detection accuracy is poor, and it is difficult to distinguish between malicious tampering and partial pixel changes caused by normal use. Therefore, it has the technical problem of low accuracy in detecting image tampering.
[0165] In related technologies, a passive tampering detection method based on deep learning has also been proposed. This method uses a convolutional residual network to obtain the features of the image to be detected, adds an attention module to weight the features of different channels, and finally classifies each pixel. However, this method is an end-to-end deep learning method, which has dataset bias and is prone to overfitting, resulting in performance degradation in real-world applications. At the same time, it suffers from insufficient robustness of passive tampering detection, leading to low accuracy in image tampering detection.
[0166] To address the aforementioned issues, this invention proposes a robust proactive tampering detection and location method based on digital watermarking and hashing, applicable to various scenarios (e.g., proactive protection of posters, facial images, software pages, and certificate-related images).
[0167] In this embodiment of the invention, under the condition that the original image generation process is controllable, watermark information is generated using the image's hash value. When a suspicious image is obtained, the watermark information and hash are extracted to verify whether the image has been maliciously tampered with and to locate the tampered area. For example, for certain qualified images obtained, image processing technology can be actively used for protection to obtain higher detection robustness, thereby achieving the technical effect of improving the accuracy of image tamper detection and solving the technical problem of low accuracy in image tamper detection.
[0168] In this embodiment of the invention, an active tamper detection method is used to protect images. This method is applicable to both global image tamper detection and localization, as well as the detection of tampering of sensitive local content. This embodiment of the invention modifies the image itself based on the hash value, thereby improving the robustness of the hash. Compared with passive tamper detection technology, this method improves the robustness of the detection technology, can resist multiple transmissions of real social media, and can detect multiple tampering techniques simultaneously.
[0169] On the other hand, by detecting suspicious images, images that have been actively tampered with can be detected. Optionally, by embedding the verification information of the hash value into the image, the robustness can be enhanced while maintaining the detection sensitivity and reducing the capacity of the watermark information. Furthermore, it does not require the original hash value of the image to be stored locally, making it more widely applicable, more convenient to use, and more in line with the needs of real-world scenarios.
[0170] This invention modifies the image itself based on the hash value, thereby improving the robustness of the hash. The method for active image protection will be further described below.
[0171] Optionally, the active tamper detection can be active detection, which may include active protection and tamper detection. In this embodiment of the invention, verification information is generated based on the original hash value on the first image channel, and the verification information is embedded in the second image channel of the original image, thereby completing the active protection of the original image. The first image channel can be a luminance channel or a chrominance channel, and the second image channel can be a luminance channel or a chrominance channel. When the first image channel is a luminance channel, the second image channel can be a chrominance channel; or when the first image channel is a chrominance channel, the second image channel can be a luminance channel. When the modified original image is maliciously tampered with, the maliciously tampered original image is detected, which can accurately determine whether the original image has been tampered with and the tampered area, thereby improving the efficiency of image tamper detection.
[0172] Figure 9 This is a flowchart of an active image tampering detection method according to an embodiment of the present invention, such as... Figure 9 As shown, the active tampering detection method for the image to be protected may include the following steps:
[0173] Step S901: Obtain the image and key K.
[0174] In this embodiment, the input image I to be detected and the key K are obtained. The image I to be detected can be of various types, such as natural images, remote sensing images, color medical images, web-generated images, screenshots, etc. No specific restrictions are placed on the type of image or the method of acquisition. The key K can be used for embedding and extracting watermark information, and can be pre-generated or pre-acquired.
[0175] Optionally, since the embodiments of the present invention embed watermark information into the chroma channel for subsequent processing, and grayscale images only have a first image channel and no chroma channel, the embodiments of the present invention are applicable to color images, and grayscale images are not within the scope of consideration of the embodiments of the present invention.
[0176] Step S902: Perform color space conversion and channel decomposition on the image.
[0177] In this embodiment, color space conversion and channel decomposition are performed on image I to obtain the luminance channel (Y) and chrominance channels (U, V) respectively.
[0178] For example, if the image is in RGB format instead of YUV format, the image can be converted to YUV space, and the Y, U, and V channels can be extracted to complete the color space conversion and channel decomposition.
[0179] It should be noted that the processing procedure of this embodiment is illustrated using the YUV channel of a natural image. The core method of this embodiment is also applicable to other color channels of other images, and no specific limitations are made here.
[0180] Step S903: Obtain the original hash value corresponding to the image.
[0181] In this embodiment, the original hash value (h) of the image on the luminance channel (Y) can be calculated based on the image content (c) to be protected in the image using a hash function (F). The image content to be protected can be the entire image, text in the image, or a partial image, etc. In different application scenarios, since the definition of malicious tampering is different, the image content to be protected is also different. The hash function can be used to map the image content to be protected into a sequence of 0s and 1s.
[0182] For example, the content to be protected in an image can be the entire image; that is, the face area, the text "This is Xiaoming," and the image background can all be protected. Figure 10 This is a schematic diagram of an overall image hash according to an embodiment of the present invention, such as... Figure 10 As shown, the entire image can be protected, and the original hash value of the entire image can be obtained as 0101001...
[0183] Optionally, common tampering techniques such as smearing, replacement, and insertion should also be included in the scope of tamper detection.
[0184] For another example, the image content to be protected can be a local area of the image, such as a face region. Figure 11 This is a schematic diagram of image local hashing according to an embodiment of the present invention, such as... Figure 11 As shown, face detection can be performed on the image. The obtained face is processed by a hash algorithm to obtain the hash value of the face as 1100001... When performing tampering detection, malicious tampering of the face can be detected. For example, face-swapping technology can be detected, and tampering of non-face areas can be ignored.
[0185] As an alternative example, the content to be protected in an image can be the text content (text information) within the image. Figure 12 This is a schematic diagram of an image text hash according to an embodiment of the present invention, such as... Figure 12 As shown, text information in an image can be determined by a text recognition algorithm, and the text information can be processed by a hash algorithm to obtain the original hash value corresponding to the text information in the image as 1100001... This embodiment of the invention can detect text tampering operations such as deletion, insertion, and modification in text information, but does not detect tampering of non-textual nature.
[0186] It is important to note that the robustness of the algorithm will vary depending on the content to be protected. In other words, the smaller the area to be protected, the more accurate the algorithm will be in detecting tampering in that area. For example, if the entire image is protected, the algorithm may not be able to detect tampering after ten compressions. However, if only the face area in the image is protected, the algorithm may still be able to detect tampering even after more than ten compressions.
[0187] In this embodiment of the invention, depending on the specific scenario, the image content to be protected can also be combined with multiple content detection methods as needed. For example, the image content to be protected for news poster images can be a combination of a face and text.
[0188] It should be noted that, in the embodiments of the present invention, changes in hash values can be used to detect whether the content to be protected has been maliciously tampered with. However, hash functions that are too fragile are not suitable for the embodiments of the present invention. For example, if the image of a cryptographic hash function (MD5) is slightly compressed, the hash value will change drastically, making it impossible to distinguish between malicious and non-malicious tampering, and even more impossible to locate the tampered area. Common perceptual hashing algorithms (such as aHash, dHash, pHash, etc.) can be applied to the embodiments of the present invention. The above perceptual hashing algorithms are for illustrative purposes only, and no specific limitations are imposed on the perceptual hashing algorithms used here.
[0189] In this embodiment, since directly calculated hash values are not always robust, the Y channel can be adjusted appropriately based on the robustness of each hash value. For example, if the hash values of two regions are very close, it indicates that the robustness between the two regions is poor. Therefore, the robustness of the hash values can be increased by adjusting the image to increase the distance between the hash values.
[0190] Optionally, Figure 13 This is a schematic diagram of an image hash calculation according to an embodiment of the present invention, such as... Figure 13As shown, an image can be divided into blocks of fixed size. For each image block, a one-bit or multi-bit hash value is generated. Taking image block a as an example, the average value a1 of image block a is calculated. At the same time, the average value a2 of the region A composed of the four image blocks to the left, top left, top, and top right of image block a is calculated. If a1 > a2, the hash value corresponding to image block a is 1; otherwise, it is 0. Each block can be calculated sequentially according to the raster scanning order, thereby obtaining the hash value h corresponding to each image block. The fixed size can be a pre-set size. The smaller the fixed size, the higher the detection accuracy. The size of the image segmentation can be determined according to the detection accuracy. For example, if a 1080P image is pre-set, the image can be divided into 32*32 image blocks. If the tampering is done to a region smaller than 32*32, it may not be detected. Therefore, the required level of accuracy can be selected based on actual needs, thereby significantly improving the accuracy of malicious tampering detection and the efficiency of data processing.
[0191] Optionally, if the size relationship between a1 and a2 becomes uncertain under some non-malicious tampering attacks (such as social media transmissions), resulting in a very small difference between a1 and a2, the robustness of the obtained hash value will be very poor, and this size relationship can be easily broken. Therefore, the image can be adjusted to make the distance between a1 and a2 slightly larger, so that the relative size relationship between a1 and a2 is not easily broken, thereby adjusting the value of a1 to obtain good robustness.
[0192] Step S904: Generate the corresponding verification information e from the hash value h.
[0193] In this embodiment, the hash value obtained in step S903 can be directly selected. The hash value can be embedded into the color channel of the image through a digital watermarking algorithm, and the hash value can be used as verification information. That is, e = h. When the image is maliciously tampered with, the location of the error in the hash value can be checked through the verification information, thereby quickly determining the location of the image tampering.
[0194] Since digital watermarking algorithms can achieve higher robustness by reducing capacity, the shorter the verification information, the higher the robustness. In this embodiment, the capacity of the watermarking algorithm can be reduced by selecting verification information of appropriate length to obtain higher robustness. For example, verification information can be obtained through Hamming code, Solomon code (RS code), parity check, etc.
[0195] For example, Hamming codes can be used to obtain verification information. When the length of the hash value extracted in step S903 is n, a hash value satisfying 2 can be embedded. k Verification information of length k ≥ n+k+1.
[0196] For example, if even parity is used, when the hash value is 11001100, a one-bit checksum of 0 can be generated, and this 0 can then be embedded as watermark information into the image's chroma channel. When the image is tampered with, assuming the hash value becomes 11001101, extracting the watermark information from the tampered image yields 1, which does not satisfy even parity, thus confirming that the image has been tampered with.
[0197] However, since the length of the even parity check information is 1, it is impossible to determine which specific bit has been tampered with. Furthermore, it is possible that multiple bits of the hash value may change after tampering, but the even parity check is still satisfied. Therefore, it can be deduced that the longer the length of the generated check information, the more error bits can be tolerated. Thus, in this embodiment of the invention, appropriate error correction codes can be selected according to the number of tampered areas to be detected, or the codes can be designed independently according to the type of tampering to be detected. No specific limit is placed on the length of the check information here. For example, Hamming codes, RS codes, and other methods can be used to achieve the purpose of accurately determining whether the image has been tampered with and quickly locating the location of the tampering.
[0198] Step S905: Embed the verification information e as a watermark into the chroma channels U and V.
[0199] In this embodiment, the verification information e can be embedded as a watermark into the chroma channels U and V using the key K to obtain the watermarked chroma channels U1 and V1. The image digital watermarking algorithm can be spatial domain watermarking or frequency domain digital watermarking. No specific restrictions are placed on the algorithm for embedding the watermark here.
[0200] Figure 14 This is a flowchart illustrating the processing of an image with an embedded watermark according to an embodiment of the present invention, such as... Figure 14 As shown, the image with the embedded watermark can be processed through the following steps.
[0201] Step S1401: Enhance the embedding intensity of the input image.
[0202] In this embodiment, the value of the embedding strength determines the robustness of the watermarking method; increasing the embedding strength can improve the robustness of the watermarking method.
[0203] Optionally, the embedding strength of the input image can be enhanced to achieve the purpose of embedding the verification information e as a watermark into the chroma channels U and V using the key K.
[0204] Step S1402: Perform a visual quality test on the image with the embedded watermark.
[0205] In this embodiment, a visual quality test is performed on the image with the embedded watermark. If the visual quality test is passed, step S1403 is executed; if the visual quality is too poor, a bad case is output.
[0206] Step S1403: Attack the image with the embedded watermark using a simulation tool.
[0207] In this embodiment, after the watermark is embedded, a simulation tool can be used to attack the image with the embedded watermark, thereby determining the accuracy of hash value extraction from the image at the corresponding embedding strength.
[0208] Optionally, taking the need to resist transmission by social media software as an example, if you want to test whether the embedding strength can resist the transmission of social media software, you can manually upload the image with the embedded watermark, download it back and extract it, and see the extraction accuracy. However, when testing on a large amount of image data, it is very impractical to manually upload and download because it is impossible to call various social media software programs. Therefore, an automated approximation attack method can be implemented locally. A simulation tool (for example, a black box application) can be used to simulate the attack operations that these software programs would perform on the image. The attack operations can be operations such as image compression, scaling, and enhancement.
[0209] Alternatively, simulation tools from open-source libraries can be used to perform similar attack operations on the image to achieve a similar attack effect to the software on the local machine.
[0210] Step S1404: Extract the watermark information from the attacked image.
[0211] As an alternative embodiment, after the watermark is embedded, even if an attack is launched on the image containing the watermark, it is desirable that the watermark information can be extracted from the attacked image.
[0212] Optionally, the watermark information in the attacked image is extracted to obtain the image verification information. If the extraction is successful, the color channels U1 and V1 after embedding the watermark are obtained. If the extraction fails, the embedding strength of the image is adjusted, and steps S1401 to S1404 are repeated until the extraction is successful.
[0213] Step S906: Output the protected image.
[0214] In this embodiment, the adjusted luminance channel and the chroma channel containing watermark information are merged to obtain the protected image.
[0215] This invention also detects actively tampered images by detecting suspicious images. The method for detecting suspicious images will be further described below.
[0216] Optionally, for suspicious images, i.e., images to be detected, it can be combined with passive tampering detection. Figure 15 This is a flowchart of a suspicious image detection method according to an embodiment of the present invention, such as... Figure 15 As shown, suspicious images are actively detected through the following steps.
[0217] Step S1501: Obtain the suspicious image I2 and the key K.
[0218] Optionally, a suspicious image I2 and a key K output after active protection processing can be obtained, wherein the key K here is the same as the key K mentioned above, and both can be obtained in advance.
[0219] Step S1502: Perform color space conversion and channel decomposition on the suspicious image.
[0220] In this embodiment, the suspicious image is subjected to color space conversion and channel decomposition to obtain the luminance channel Y2 and the chrominance channels U2 and V2.
[0221] Step S1503: Extract watermark information from the chroma channel.
[0222] In this embodiment, watermark information (verification information e2) can be obtained from the chroma channel using key K. If extraction is successful, step S1504 is executed; otherwise, the detection failure is output, or passive detection can be selected to detect the image. Figure 14 The steps in this section extract watermark information from the image. No specific restrictions are placed on the method of watermark information extraction here. Passive detection can be used to directly detect tampering by combining the detection of watermark residue traces on the unprotected image.
[0223] For example, a suspicious image and key can be input into a black box for watermark extraction. If the extraction is successful, it will output the success of extraction and the extracted watermark information; if the extraction fails, it will output the failure of extraction. There are some mechanisms in the black box to ensure the accuracy of the success or failure results.
[0224] In this embodiment, watermark information extraction is not always successful. When extraction fails, active tampering detection cannot be performed, and a passive detection scheme can only be adopted.
[0225] For example, an image is cut out from a watermark-free image, pasted onto a watermarked image, and post-processed to create a tampered image. If the watermark detection fails due to attacks during post-processing, traces of the embedded watermark can usually be detected in untouched areas of the image. Since the tampered area was cut from a clean image, it will not have any watermark traces. Therefore, a watermark trace detection method can be designed to detect tampering by examining these watermark traces. This achieves the goal of determining whether an image has been tampered with by detecting residual watermark traces.
[0226] Step S1504: Determine the hash value h2 of the suspicious image.
[0227] In this embodiment, watermark information (verification information e2) can be obtained from the chroma channel using key K. If the verification information is successfully extracted, the hash value h2 of the content to be protected on the luminance channel Y2 can be calculated using the same hash function F according to the image content c to be protected as agreed in step S903. The image content c can be the object to be protected in the image, such as the entire original image, text in the original image, or a partial image in the original image.
[0228] Step S1505: Output the tampering detection results.
[0229] In this embodiment, h2 can be verified based on the verification information e2. If the verification passes, it means that the image has not been tampered with. If the verification fails, the tampering detection result is output according to the verification capability.
[0230] Optionally, the verification module can process the verification information and hash value to obtain the tampering detection result.
[0231] For example, if the embedded verification information e = h, that is, the suspicious image directly embeds the hash value into the image, then the extracted watermark information e2 and the calculated h2 can be compared bit by bit. If e2 and h2 are the same, it means that the image has not been tampered with; if they are different, then the position (image block) corresponding to the different hash values is the position where the image has been tampered with.
[0232] For example, if error-correcting codes or other verification methods are used, taking the Hamming code for detecting a single-bit error as an example, when h2 differs from h by only one bit, the Hamming code can detect the difference, and the image block associated with that position is the location where the tampering occurred. When the number of errors exceeds the error detection capability of the Hamming code, it will only detect that the protected area of the image has been tampered with, but will not be able to determine the location of the tampering. In this case, a more powerful error detection method can be used to detect the image, such as RS code, BCH code, etc. No specific restrictions are placed on the verification method here.
[0233] In this invention, on the one hand, under the condition that the original image generation process is controllable, a method for actively protecting images is proposed. Based on the independent split channels, the hash value of a certain channel is extracted, and the value of the corresponding channel is fine-tuned. That is, the original hash value of the original image in the luminance channel is used to generate verification information, and the verification information is embedded in the chroma channel, which is independent of the hash calculation, thereby achieving the purpose of strengthening hash robustness. On the other hand, when a suspicious image is obtained, the strengthened hash value is verified, and the verification information is embedded in the channel independent of the hash value calculation using digital watermarking. The modified values of multiple channels are fused, and the visual effect is adaptively optimized based on the characteristics of human vision to obtain the final image. It can achieve accurate tamper location without additionally saving lengthy hash values, thereby achieving the technical effect of improving the accuracy of image tamper detection and solving the technical problem of low accuracy in image tamper detection.
[0234] In another alternative embodiment, Figure 16 The use of the above is illustrated in a block diagram. Figure 1 The computer terminal 30 (or mobile device) shown is an embodiment of a computing node in computing environment 1601. Figure 16 This is a structural block diagram of a computing environment according to an embodiment of the present invention, such as... Figure 16 As shown, computing environment 1601 includes multiple compute nodes (such as servers) running on a distributed network (represented in the diagram as 1610-1, 1610-2, ...,). Each compute node contains local processing and memory resources, and end user 1602 can remotely run applications or store data within computing environment 1601. Applications can be provided as multiple services 1620-1, 1620-2, 1620-3, and 1620-4 within computing environment 1601, representing services "A", "D", "E", and "H", respectively.
[0235] End user 1602 can provide and access services through a web browser or other software application on a client. In some embodiments, the provisioning and / or requests of end user 1602 can be provided to ingress gateway 1630. Ingress gateway 1630 may include a corresponding agent to handle provisioning and / or requests for service 1620 (one or more services provided in computing environment 1601).
[0236] Service 1620 is provided or deployed based on various virtualization technologies supported by computing environment 1601. In some embodiments, service 1620 may be provided based on virtual machine (VM)-based virtualization, container-based virtualization, and / or similar methods. Virtual machine-based virtualization may involve simulating a real computer by initializing a virtual machine, executing programs and applications without directly accessing any actual hardware resources. While the machine is virtualized by a virtual machine, container-based virtualization may launch containers to virtualize an entire operating system (OS), allowing multiple workloads to run on a single OS instance.
[0237] In one embodiment based on container virtualization, several containers of service 1620 can be assembled into a POD (e.g., a Kubernetes POD). For example, such as Figure 16 As shown, service 1620-2 can be equipped with one or more PODs 1640-1, 1640-2, ..., 1640-N (collectively referred to as POD 1640). Each POD 1640 can include a proxy 1645 and one or more containers 1642-1, 1642-2, ..., 1642-M (collectively referred to as container 1642). One or more containers 1642 in POD 1640 handle requests related to one or more corresponding functions of the service, and the proxy 1645 typically controls service-related network functions such as routing and load balancing. Other services 1620 can also be accompanied by PODs similar to POD 1640.
[0238] During operation, executing a user request from end user 1602 may require calling one or more services 1620 in computing environment 1601. Executing one or more functions of one service 1620 requires calling one or more functions of another service 1620. For example... Figure 16 As shown, service "A" 1620-1 receives user requests from terminal user 1602 from ingress gateway 1630. Service "A" 1620-1 can call service "D" 1620-2, and service "D" 1620-2 can request service "E" 1620-3 to perform one or more functions.
[0239] The aforementioned computing environment can be a cloud computing environment, where resource allocation is managed by cloud services, allowing functionality development without needing to consider implementation, adjustment, or server scaling. This computing environment allows developers to execute event-responsive code without building or maintaining complex infrastructure. Services can be partitioned into a set of functions that can automatically and independently scale, rather than scaling a single hardware device to handle potential loads.
[0240] In another alternative embodiment, Figure 17 The use of the above is illustrated in a block diagram. Figure 1 The computer terminal (or mobile device) shown is an example of a service mesh. Figure 17 This is a structural block diagram of the service mesh for an image tampering detection method according to an embodiment of the present invention, such as... Figure 17 As shown, the Service Mesh 1700 is mainly used to facilitate secure and reliable communication between multiple microservices. Microservices refer to the decomposition of an application into multiple smaller services or instances, which are distributed across different clusters / machines.
[0241] like Figure 17 As shown, a microservice may include application service instance A and application service instance B, which together form the functional application layer of service mesh 1700. In one implementation, application service instance A runs as a container / process 1708 on machine / workload container group 1714 (POD), and application service instance B runs as a container / process 1710 on machine / workload container group 1716 (POD).
[0242] In one implementation, application service instance A can be a product query service, and application service instance B can be a product order placement service.
[0243] like Figure 17 As shown, application service instance A and grid agent (sidecar) 1703 coexist in machine workload container group 1714, and application service instance B and grid agent 1705 coexist in machine workload container 1714. Grid agents 1703 and 1705 form the data plane layer of service mesh 1700. Grid agents 1703 and 1705 run as container / process 1704, which can receive requests 1712 for product query services, and as grid agent 1706. Grid agent 1703 and application service instance A can communicate bidirectionally, as can grid agent 1705 and application service instance B. Furthermore, grid agents 1703 and 1705 can also communicate bidirectionally.
[0244] In one implementation, all traffic from application service instance A is routed to the appropriate destination via mesh proxy 1703, and all network traffic from application service instance B is routed to the appropriate destination via mesh proxy 1705. It should be noted that the network traffic mentioned here includes, but is not limited to, Hypertext Transfer Protocol (HTTP), Representational State Transfer (REST), high-performance, general-purpose open-source frameworks (gRPC), and open-source in-memory data structure storage systems (Redis).
[0245] In one implementation, the functionality of the extended data plane layer can be achieved by writing custom filters for the proxy (Envoy) in service mesh 1700. The service mesh proxy configuration can enable the service mesh to correctly proxy service traffic, achieving service interoperability and service governance. Mesh proxies 1703 and 1705 can be configured to perform at least one of the following functions: service discovery, health checking, routing, load balancing, authentication and authorization, and observability.
[0246] like Figure 17 As shown, the service mesh 1700 also includes a control plane layer. This control plane layer can consist of a set of services running in a dedicated namespace, hosted by a managed control plane component 1701 within a machine / workload container group (machine / Pod) 1702. For example... Figure 17As shown, the managed control plane component 1701 communicates bidirectionally with grid agents 1703 and 1705. The managed control plane component 1701 is configured to perform several control and management functions. For example, the managed control plane component 1701 receives telemetry data transmitted by grid agents 1703 and 1705 and can further aggregate this telemetry data. In addition to these services, the managed control plane component 1701 can also provide a user-facing application programming interface (API) to facilitate manipulation of network behavior and provision of configuration data to grid agents 1703 and 1705. It should be noted that, for the foregoing method embodiments, for the sake of simplicity, they are all described as a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, because according to the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention.
[0247] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, because according to the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention.
[0248] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0249] Example 3
[0250] According to embodiments of the present invention, a method for implementing the above is also provided. Figure 2 The image tampering detection method shown is an image tampering detection device.
[0251] Figure 18 This is a schematic diagram of an image tampering detection device according to an embodiment of the present invention. Figure 18As shown, the image tampering detection device 1800 may include: a first acquisition unit 1802, a first determination unit 1804, a first processing unit 1806, and a first generation unit 1808.
[0252] The first acquisition unit 1802 is used to acquire the original image to be detected, wherein the original image includes the image content to be protected;
[0253] The first determining unit 1804 is used to determine the original hash value of the image content on the first image channel of the original image.
[0254] The first processing unit 1806 is used to generate verification information based on the original hash value and embed the verification information into a second image channel in the original image other than the first image channel.
[0255] The first generation unit 1808 is used to generate a target image based on the first image channel and the embedded second image channel. The verification information is used to verify the target image and obtain a detection result. The detection result includes: the result that the target image has not been tampered with, and the result that the target image has been tampered with.
[0256] It should be noted that the first acquisition unit 1802, the first determination unit 1804, the first processing unit 1806, and the first generation unit 1808 mentioned above correspond to steps S202 to S208 in Embodiment 1. The four units and the corresponding steps implement the same instances and application scenarios, but are not limited to the content disclosed in Embodiment 1. It should be noted that the above units, as part of the device, can run in the computer terminal provided in Embodiment 1.
[0257] According to embodiments of the present invention, a method for implementing the above is also provided. Figure 3 The image tampering detection method shown is an image tampering detection device.
[0258] Figure 19 This is a schematic diagram of another image tampering detection device according to an embodiment of the present invention, such as... Figure 19 As shown, the image tampering detection device 1900 may include: a second acquisition unit 1902, a second processing unit 1904, and a verification unit 1906.
[0259] The second acquisition unit 1902 is used to acquire the target image to be detected, wherein the target image is generated based on the original image channel and the second image channel in which verification information is embedded, and the verification information is generated based on the original hash value of the image content to be protected in the original image on the first image channel.
[0260] The second processing unit 1904 is used to extract verification information from the target image.
[0261] The verification unit 1906 is used to verify the target image based on the verification information and obtain the detection result. The detection result includes: the result that the target image has not been tampered with, and the result that the target image has been tampered with.
[0262] It should be noted that the second acquisition unit 1902, the second processing unit 1904, and the verification unit 1906 mentioned above correspond to steps S302 to S306 in Embodiment 1. The three units and their corresponding steps implement the same instances and application scenarios, but are not limited to the content disclosed in Embodiment 1. It should be noted that the above units, as part of the device, can run in the computer terminal provided in Embodiment 1.
[0263] According to embodiments of the present invention, a method for implementing the above is also provided. Figure 5 The image tampering detection method shown is an image tampering detection device that can be applied to virtual reality (VR) devices or augmented reality (AR) devices, and the model can be used to perform predictive analysis on images to be analyzed in VR devices or AR devices.
[0264] Figure 20 This is a schematic diagram of another image tampering detection device according to an embodiment of the present invention. Figure 20 As shown, the image tampering detection device 2000 may include: a display unit 2002, a second determination unit 2004, and a third processing unit 2006.
[0265] The display unit 2002 is used to display the original image to be detected on the presentation screen of a virtual reality (VR) device or an augmented reality (AR) device, wherein the original image includes image content to be protected.
[0266] The second determining unit 2004 is used by VR devices or AR devices to determine the original hash value of the image content on the first image channel of the original image.
[0267] The third processing unit 2006 is used to generate verification information based on the original hash value and embed the verification information into the second image channel of the original image other than the first image channel, and then drive the VR device or AR device to render and display the target image generated based on the first image channel and the embedded second image channel. The verification information is used to verify the target image and obtain the detection result. The detection result includes: the result that the target image has not been tampered with, and the result that the target image has been tampered with.
[0268] It should be noted that the above-mentioned display unit 2002, first determining unit 2004, and third processing unit 2006 correspond to steps S502 to S506 in Embodiment 1. The three units and their corresponding steps implement the same instances and application scenarios, but are not limited to the content disclosed in Embodiment 1. It should be noted that the above-mentioned units, as part of the device, can run in the computer terminal provided in Embodiment 1.
[0269] According to embodiments of the present invention, a method for implementing the above is also provided. Figure 7 The image tampering detection method shown is an image tampering detection device.
[0270] Figure 21 This is a schematic diagram of another image tampering detection device according to an embodiment of the present invention. Figure 21 As shown, the image tampering detection device 2100 may include: a calling unit 2102, a third determining unit 2104, a fourth processing unit 2106, a second generating unit 2108, and an output unit 2110.
[0271] Calling unit 2102 is used to obtain the original image to be detected by calling the first interface, wherein the original image includes the image content to be protected, and the first interface includes a first parameter, the parameter value of which is the original image.
[0272] The third determining unit 2104 is used to determine the original hash value of the image content on the first image channel of the original image.
[0273] The fourth processing unit 2106 is used to generate verification information based on the original hash value and embed the verification information into the second image channel of the original image other than the first image channel.
[0274] The second generation unit 2108 is used to generate a target image based on the first image channel and the embedded second image channel. The verification information is used to verify the target image and obtain a detection result. The detection result includes: the result that the target image has not been tampered with, and the result that the target image has been tampered with.
[0275] The output unit 2110 is used to output the target image by calling the second interface, wherein the second interface includes a second parameter, and the value of the second parameter is the target image.
[0276] It should be noted that the aforementioned calling unit 2102, third determining unit 2104, fourth processing unit 2106, second generating unit 2108, and output unit 2110 correspond to steps S702 to S710 in Embodiment 1. The five units and their corresponding steps implement the same instances and application scenarios, but are not limited to the content disclosed in Embodiment 1. It should also be noted that the aforementioned units, as part of the device, can run on the computer terminal provided in Embodiment 1.
[0277] In the image tampering detection device of this embodiment, the original image's original hash value in the first image channel is used to generate verification information. This verification information is then embedded into the second image channel of the original image, which is independent of the hash calculation, to obtain the target image modified from the original image. Thus, when a suspicious image is acquired, the verification information and hash are extracted to verify whether the image has been maliciously tampered with. This eliminates the need to store lengthy original hash values to accurately determine whether tampering has occurred. By actively protecting the original image while keeping the original image generation process under control, the accuracy of image tampering detection is improved, thereby achieving the technical effect of improving the accuracy of image tampering detection and solving the technical problem of low accuracy in image tampering detection.
[0278] Example 4
[0279] Embodiments of the present invention may provide a processor, which may include a computer terminal, which may be any one of a group of computer terminals. Optionally, in this embodiment, the computer terminal may also be replaced by a mobile terminal or other terminal device.
[0280] Optionally, in this embodiment, the computer terminal may be located in at least one of a plurality of network devices in a computer network.
[0281] In this embodiment, the computer terminal described above can execute the program code for the following steps in the image processing method of the application: acquiring the original image to be detected, wherein the original image includes image content to be protected; determining the original hash value of the image content on the first image channel of the original image; generating verification information based on the original hash value, and embedding the verification information into a second image channel in the original image other than the first image channel; generating a target image based on the first image channel and the embedded second image channel, wherein the verification information is used to verify the target image to obtain a detection result, the detection result including: the result that the target image has not been tampered with, and the result that the target image has been tampered with.
[0282] Optionally, Figure 22 This is a structural block diagram of a computer terminal according to an embodiment of the present invention. Figure 22As shown, the computer terminal A may include one or more (only one is shown in the figure) processors 2202, memory 2204, and transmission devices 2206.
[0283] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the image tampering detection method and apparatus in this embodiment of the invention. The processor executes various functional applications and predictions by running the software programs and modules stored in the memory, thereby realizing the aforementioned image tampering detection method. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to terminal A via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0284] The processor can invoke information and application programs stored in the memory via a transmission device to perform the following steps: acquiring the original image to be detected, wherein the original image includes the image content to be protected; determining the original hash value of the image content on a first image channel of the original image; generating verification information based on the original hash value and embedding the verification information into a second image channel of the original image other than the first image channel; generating a target image based on the first image channel and the embedded second image channel, wherein the verification information is used to verify the target image to obtain a detection result, the detection result including: the result that the target image has not been tampered with, and the result that the target image has been tampered with.
[0285] Optionally, the processor may also execute program code that performs the following steps: in the image block set of the original image, determine the target image block set corresponding to the image content, wherein multiple image blocks in the image block set have the same size; based on the pixel value of any target image block in the target image block set on the first image channel, and the pixel value of the adjacent target image blocks of the target image block on the first image channel, generate one or more bits of hash value in the original hash value, wherein the adjacent target image blocks are the image blocks in the image block set that are adjacent to the target image block.
[0286] Optionally, the processor may also execute program code that performs the following steps: in response to the average pixel value of the target image block on the first image channel being greater than the average pixel value of the adjacent target image blocks on the first image channel, determining one or more first target values as one or more hash values; in response to the average pixel value of the target image block on the first image channel not being greater than the average pixel value of the adjacent target image blocks on the first image channel, determining one or more second target values that are different from one or more first target values as one or more hash values.
[0287] Optionally, the processor may also execute program code that performs the following steps: adjusting the first image channel based on the image content, wherein the original hash value of the image content affected by interference information remains unchanged in the adjusted first image channel; and generating a target image based on the embedded second image channel and the adjusted first image channel.
[0288] Optionally, the processor may also execute program code that performs the following steps: in response to the difference between the average pixel value of the target image block in the original image on the first image channel and the average pixel value of the adjacent target image blocks on the first image channel being less than a threshold, the first image channel is adjusted, wherein the adjusted first image channel makes the difference between the average pixel value of the target image block on the first image channel and the average pixel value of the adjacent target image blocks on the first image channel not less than the threshold, and the adjacent target image blocks are the image blocks adjacent to the target image block in the image block set of the original image.
[0289] Optionally, the processor may also execute program code that merges the embedded second image channel and the adjusted first image channel to obtain the target image.
[0290] Optionally, the processor may also execute program code that performs the following steps: determining the verification information as watermark information based on the key; and embedding the watermark information into the second image channel.
[0291] Optionally, the processor may also execute program code that performs the following steps: attacking the embedded second image channel; and in response to successfully extracting the watermark information from the attacked second image channel, determining that the verification information has been successfully embedded into the second image channel.
[0292] Optionally, the processor may also execute program code that performs the following steps: determining the original hash value as verification information; or converting the original hash value into verification information based on the error correction code.
[0293] As an alternative example, the processor can invoke information and application programs stored in memory via a transmission device to perform the following steps: acquiring a target image to be detected, wherein the target image is generated based on a first image channel of the original image and a second image channel in the original image in which verification information is embedded, and the verification information is generated based on the original hash value of the image content to be protected in the original image on the first image channel; extracting the verification information from the target image; verifying the target image based on the verification information to obtain a detection result, the detection result including: a result indicating that the target image has not been tampered with, and a result indicating that the target image has been tampered with.
[0294] Optionally, the processor may also execute program code that performs the following steps: determining the target hash value of the image content on the luminance channel of the target image; verifying the target image based on the verification information to obtain a detection result, including: determining that the detection result is that the target image has not been tampered with in response to the target hash value matching the verification information; and determining that the detection result is that the target image has been tampered with in response to the target hash value not matching the verification information.
[0295] Optionally, the processor may also execute program code that performs the following steps: in response to the detection result indicating that the target image has been tampered with, the processor determines the location where the target hash value has been tampered with relative to the original hash value based on the verification information extracted from the target image.
[0296] Optionally, the processor may also execute program code that extracts watermark information from the second image channel of the target image based on the key, and determines the watermark information as verification information.
[0297] As an alternative example, the processor can invoke information and applications stored in memory via a transmission device to perform the following steps: displaying the original image to be detected on the presentation screen of a virtual reality (VR) device or an augmented reality (AR) device, wherein the original image includes image content to be protected; the VR device or AR device determines the original hash value of the image content on a first image channel of the original image; after generating verification information based on the original hash value and embedding the verification information into a second image channel of the original image other than the first image channel, the processor drives the VR device or AR device to render and display the target image generated based on the first image channel and the embedded second image channel, wherein the verification information is used to verify the target image to obtain a detection result, the detection result including: the result that the target image has not been tampered with, and the result that the target image has been tampered with.
[0298] As an optional example, the processor can invoke information and application programs stored in memory via a transmission device to perform the following steps: acquiring the original image to be detected by calling a first interface, wherein the original image includes image content to be protected, the first interface includes a first parameter, the value of which is the original image; determining the original hash value of the image content on a first image channel of the original image; generating verification information based on the original hash value, and embedding the verification information into a second image channel of the original image other than the first image channel; generating a target image based on the first image channel and the embedded second image channel, wherein the verification information is used to verify the target image to obtain a detection result, the detection result including: a result indicating that the target image has not been tampered with, and a result indicating that the target image has been tampered with; and outputting the target image by calling a second interface, wherein the second interface includes a second parameter, the value of which is the target image.
[0299] In this embodiment of the invention, the original image's original hash value in the first image channel is used to generate verification information. This verification information is then embedded into the second image channel of the original image, which is independent of the hash calculation, to obtain the target image modified from the original image. Thus, when a suspicious image is obtained, the verification information and hash are extracted to verify whether the image has been maliciously tampered with. This eliminates the need to store lengthy original hash values, enabling accurate determination of whether tampering has occurred. By proactively protecting the original image while keeping the original image generation process under control, the accuracy of image tamper detection is improved, thereby achieving the technical effect of improving the accuracy of image tamper detection and solving the technical problem of low accuracy in image tamper detection.
[0300] Those skilled in the art will understand that Figure 22 The structure shown is for illustrative purposes only. Computer terminal A can also be a smartphone (such as an Android phone, iOS phone, etc.), tablet computer, mobile internet device (MID), PAD and other terminal devices. Figure 22 This does not limit the structure of the aforementioned computer terminal A. For example, computer terminal A may also include components that are more complex than those described above. Figure 22 Showing more or fewer components (such as network interfaces, display devices, etc.), or having the same Figure 22 The different configurations shown.
[0301] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0302] Example 5
[0303] Embodiments of the present invention also provide a computer-readable storage medium. Optionally, in this embodiment, the computer-readable storage medium can be used to store the program code executed by the image processing method provided in Embodiment 1.
[0304] Optionally, in this embodiment, the computer-readable storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.
[0305] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for performing the following steps: acquiring an original image to be detected, wherein the original image includes image content to be protected; determining the original hash value of the image content on a first image channel of the original image; generating verification information based on the original hash value, and embedding the verification information into a second image channel of the original image other than the first image channel; generating a target image based on the first image channel and the embedded second image channel, wherein the verification information is used to verify the target image to obtain a detection result, the detection result including: a result that the target image has not been tampered with, and a result that the target image has been tampered with.
[0306] Optionally, the computer-readable storage medium may also execute program code that performs the following steps: determining a target image block set corresponding to the image content in the image block set of the original image, wherein multiple image blocks in the image block set have the same size; generating one or more bit hash values in the original hash value based on the pixel value of any target image block in the target image block set on the first image channel, and the pixel values of the adjacent target image blocks of the target image block on the first image channel, wherein the adjacent target image blocks are the image blocks in the image block set that are adjacent to the target image block.
[0307] Optionally, the computer-readable storage medium may also execute program code that performs the following steps: in response to the average pixel value of the target image block on the first image channel being greater than the average pixel value of adjacent target image blocks on the first image channel, determining one or more first target values as one or more hash values; in response to the average pixel value of the target image block on the first image channel not being greater than the average pixel value of adjacent target image blocks on the first image channel, determining one or more second target values that are different from one or more first target values as one or more hash values.
[0308] Optionally, the aforementioned computer-readable storage medium may also execute program code that performs the following steps: adjusting a first image channel based on image content, wherein the original hash value of the image content interfered with by interference information remains unchanged in the adjusted first image channel; generating a target image based on the embedded second image channel and the adjusted first image channel.
[0309] Optionally, the computer-readable storage medium may also execute program code that performs the following steps: in response to the difference between the average pixel value of the target image block in the original image on the first image channel and the average pixel value of the adjacent target image blocks on the first image channel being less than a threshold, the first image channel is adjusted, wherein the adjusted first image channel makes the difference between the average pixel value of the target image block on the first image channel and the average pixel value of the adjacent target image blocks on the first image channel not less than the threshold, and the adjacent target image blocks are the image blocks adjacent to the target image block in the image block set of the original image.
[0310] Optionally, the computer-readable storage medium may also execute program code that performs the following steps: merging the embedded second image channel and the adjusted first image channel to obtain the target image.
[0311] Optionally, the computer-readable storage medium may also execute program code that performs the following steps: determining the verification information as watermark information based on the key; embedding the watermark information into the second image channel.
[0312] Optionally, the computer-readable storage medium may also execute program code that performs the following steps: performing an attack operation on the embedded second image channel; and determining that the verification information has been successfully embedded into the second image channel in response to the successful extraction of watermark information from the attacked second image channel.
[0313] Optionally, the computer-readable storage medium may also execute program code that performs the following steps: determining the original hash value as verification information; or converting the original hash value into verification information based on error correction codes.
[0314] As an optional example, a computer-readable storage medium is configured to store program code for performing the following steps: acquiring a target image to be detected, wherein the target image is generated based on a first image channel of an original image and a second image channel in the original image in which verification information is embedded, the verification information being generated based on the original hash value of the image content to be protected in the original image on the first image channel; extracting the verification information from the target image; verifying the target image based on the verification information to obtain a detection result, the detection result including: a result indicating that the target image has not been tampered with, and a result indicating that the target image has been tampered with.
[0315] Optionally, the aforementioned computer-readable storage medium may also execute program code that performs the following steps: determining a target hash value of the image content on the luminance channel of the target image; verifying the target image based on verification information to obtain a detection result, including: determining that the detection result is that the target image has not been tampered with in response to a match between the target hash value and the verification information; and determining that the detection result is that the target image has been tampered with in response to a mismatch between the target hash value and the verification information.
[0316] Optionally, the computer-readable storage medium may also execute program code that performs the following steps: in response to the detection result indicating that a tampering operation has been performed on the target image, determining the location where the target hash value has been tampered with relative to the original hash value based on the verification information extracted from the target image.
[0317] Optionally, the computer-readable storage medium may also execute program code that performs the following steps: extracting watermark information from the second image channel of the target image based on a key, and determining the watermark information as verification information.
[0318] As an optional example, a computer-readable storage medium is configured to store program code for performing the following steps: displaying an original image to be detected on a presentation screen of a virtual reality (VR) device or an augmented reality (AR) device, wherein the original image includes image content to be protected; the VR device or AR device determines the original hash value of the image content on a first image channel of the original image; after generating verification information based on the original hash value and embedding the verification information into a second image channel of the original image other than the first image channel, driving the VR device or AR device to render and display a target image generated based on the first image channel and the embedded second image channel, wherein the verification information is used to verify the target image to obtain a detection result, the detection result including: a result that the target image has not been tampered with, and a result that the target image has been tampered with.
[0319] As an optional example, a computer-readable storage medium is configured to store program code for performing the following steps: acquiring an original image to be detected by calling a first interface, wherein the original image includes image content to be protected, the first interface includes a first parameter, the value of which is the original image; determining the original hash value of the image content on a first image channel of the original image; generating verification information based on the original hash value and embedding the verification information into a second image channel of the original image other than the first image channel; generating a target image based on the first image channel and the embedded second image channel, wherein the verification information extracted from the target image and the determined target hash value of the image content on the first image channel of the target image are used to verify the target image to obtain a detection result, the detection result including: a result indicating that the target image has not been tampered with, and a result indicating that the target image has been tampered with; and outputting the target image by calling a second interface, wherein the second interface includes a second parameter, the value of which is the target image.
[0320] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0321] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0322] In the several embodiments provided by this invention, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection of units or modules may be electrical or other forms.
[0323] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0324] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0325] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0326] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for detecting image tampering, characterized in that, include: Obtain the original image to be detected, wherein the original image includes the image content to be protected; Determine the original hash value of the image content on the first image channel of the original image, wherein the first image channel is a luminance channel or a chrominance channel; Verification information is generated based on the original hash value, and the verification information is embedded into a second image channel in the original image other than the first image channel. A target image is generated based on the first image channel and the embedded second image channel. The verification information is used to verify the target image to obtain a detection result. The detection result includes: the result that the target image has not been tampered with, and the result that the target image has been tampered with.
2. The method according to claim 1, characterized in that, Determining the original hash value of the image content on the first image channel of the original image includes: In the image patch set of the original image, a target image patch set corresponding to the image content is determined, wherein multiple image patches in the image patch set have the same size; Based on the pixel value of any target image block in the target image block set on the first image channel, and the pixel value of the neighboring target image blocks of the target image block on the first image channel, one or more bits of hash value are generated in the original hash value, wherein the neighboring target image blocks are the image blocks in the image block set that are adjacent to the target image block.
3. The method according to claim 2, characterized in that, Based on the pixel values of any target image block in the target image block set on the first image channel, and the pixel values of adjacent target image blocks of the target image block on the first image channel, generate one or more bits of hash value in the original hash value, including: In response to the average pixel value of the target image block in the first image channel being greater than the average pixel value of the adjacent target image blocks in the first image channel, one or more first target values are determined as the one or more hash values; In response to the fact that the average pixel value of the target image block in the first image channel is not greater than the average pixel value of the adjacent target image blocks in the first image channel, one or more second target values that are different from the one or more first target values are determined as the one or more hash values.
4. The method according to claim 1, characterized in that, The method further includes: The first image channel is adjusted based on the image content, wherein the original hash value of the image content that is interfered with by the interference information remains unchanged in the adjusted first image channel; The target image is generated based on the embedded second image channel and the adjusted first image channel.
5. The method according to claim 4, characterized in that, Adjusting the first image channel based on the image content includes: In response to the difference between the average pixel value of the target image block in the original image on the first image channel and the average pixel value of the adjacent target image blocks on the first image channel being less than a threshold, the first image channel is adjusted, wherein the adjusted first image channel makes the difference between the average pixel value of the target image block on the first image channel and the average pixel value of the adjacent target image blocks on the first image channel not less than the threshold, and the adjacent target image blocks are the image blocks adjacent to the target image block in the image block set of the original image.
6. The method according to claim 4, characterized in that, The target image is generated based on the embedded second image channel and the adjusted first image channel, including: The embedded second image channel and the adjusted first image channel are merged to obtain the target image.
7. The method according to claim 1, characterized in that, Embedding the verification information into a second image channel of the original image, excluding the first image channel, includes: The verification information is determined as watermark information based on the key; The watermark information is embedded into the second image channel.
8. The method according to claim 7, characterized in that, The method further includes: Attack operations are performed on the embedded second image channel; In response to the successful extraction of the watermark information from the second image channel after the attack, it is determined that the verification information has been successfully embedded into the second image channel.
9. The method according to any one of claims 1 to 8, characterized in that, Verification information is generated based on the original hash value, including: The original hash value is determined as the verification information; or The original hash value is converted into the verification information based on the error correction code.
10. A method for detecting image tampering, characterized in that, include: The target image to be detected is obtained, wherein the target image is generated based on a first image channel of the original image and a second image channel in the original image in which verification information is embedded, and the verification information is generated based on the original hash value of the image content to be protected in the original image on the first image channel, and the first image channel is a luminance channel or a chrominance channel; Extract the verification information from the target image; The target image is verified based on the verification information to obtain a detection result. The detection result includes: the result that the target image has not been tampered with, and the result that the target image has been tampered with.
11. The method according to claim 10, characterized in that, The method further includes: determining the target hash value of the image content on a first image channel of the target image; Verifying the target image based on the verification information to obtain a detection result includes: determining that the detection result is that the target image has not been tampered with, in response to the target hash value matching the verification information; and determining that the detection result is that the target image has been tampered with, in response to the target hash value not matching the verification information.
12. The method according to claim 10, characterized in that, Extracting the verification information from the target image includes: The watermark information is extracted from the second image channel of the target image based on the key, and the watermark information is determined as the verification information.
13. A method for detecting image tampering, characterized in that, include: The original image to be detected is displayed on the screen of a virtual reality (VR) device or an augmented reality (AR) device, wherein the original image includes image content to be protected; The VR device or AR device determines the original hash value of the image content on a first image channel of the original image, wherein the first image channel is a luminance channel or a chrominance channel; After generating verification information based on the original hash value and embedding the verification information into a second image channel in the original image other than the first image channel, the VR device or the AR device is driven to render and display a target image generated based on the first image channel and the embedded second image channel. The verification information is used to verify the target image and obtain a detection result. The detection result includes: the result that the target image has not been tampered with, and the result that the target image has been tampered with.
14. A method for detecting image tampering, characterized in that, include: The original image to be detected is obtained by calling the first interface, wherein the original image includes the image content to be protected, and the first interface includes a first parameter, the value of which is the original image. Determine the original hash value of the image content on the first image channel of the original image, wherein the first image channel is a luminance channel or a chrominance channel; Verification information is generated based on the original hash value, and the verification information is embedded into a second image channel in the original image other than the first image channel. A target image is generated based on the first image channel and the embedded second image channel. The verification information is used to verify the target image to obtain a detection result. The detection result includes: a result that the target image has not been tampered with, and a result that the target image has been tampered with. The target image is output by calling a second interface, wherein the second interface includes a second parameter, the value of which is the target image.
15. A processor, characterized in that, The processor is used to run a program, wherein the program, when running, performs the method according to any one of claims 1 to 14.