Image steganography method
By performing content analysis of images and block priority classification, adaptive embedding strategies are generated, and the problem of unbalanced visual quality and embedding capacity in the prior art is solved, and the embedding capacity is improved by 30%-50% under the same visual quality, and efficient data processing performance is maintained.
Patent Information
- Application Number
- CN202510741345.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-05
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2045-06-05
AI Technical Summary
The existing image steganography technology does not fully consider the visual characteristics and content structure of the image, resulting in a significant decline in visual quality during the embedding process, the balance between embedding capacity and visual quality is not optimized enough, lacks flexibility, cannot adaptively adjust according to the image content, and does not consider the importance differences in different image areas.
By analyzing the content of the original image, dividing it into multiple blocks, calculating the standard deviation of grayscale value, edge density and color complexity, performing block priority classification, generating an adaptive embedding strategy, and embeding data layered into different regions and channels. Multi-plane embedding and mapping reconstruction technology are used to optimize the balance between embedding capacity and visual quality.
The embedding capacity is improved by 30%-50%, and the visual quality is maintained. The PSNR is above 45dB and the SSIM exceeds 0.98, which reduces memory footprint, and the data embedding and extraction time complexity is maintained at the O(n) level, achieving a balance strategy for high-quality and non-critical area capacity in key areas.
Smart Images

Figure CN120259066A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of digital image processing and information hiding, and particularly to an image steganography method. Background Art
[0002] Traditional image steganography techniques usually adopt the following methods:
[0003] LSB (Least Significant Bit) replacement method: Embed data in the least significant bit of image pixels, but with limited capacity and easy to be detected;
[0004] DCT (Discrete Cosine Transform) domain embedding: Embed data in the frequency domain of the image, with good anti-interference ability but complex implementation;
[0005] Spatial domain diffusion method: Uniformly distribute data in the entire image space, but without considering the characteristics of image content;
[0006] The main problems existing in the prior art include:
[0007] 1. Do not fully consider the visual characteristics and content structure of the image, and the embedding process may cause a significant decline in visual quality;
[0008] 2. The balance between embedding capacity and visual quality is not optimized enough;
[0009] 3. The embedding strategy lacks flexibility and cannot be adaptively adjusted according to the image content;
[0010] 4. Do not consider the importance differences of different image regions. Summary of the Invention
[0011] The technical problem to be solved by this application is to provide an image steganography method aiming at the deficiencies of the prior art, which can intelligently allocate the embedding regions and intensities according to the characteristics of the image content.
[0012] The technical solution of this application to solve the above technical problem is as follows:
[0013] An image steganography method, comprising:
[0014] Perform content analysis on the original image as the carrier;
[0015] Generate an adaptive embedding strategy according to the analysis result, and encode the embedding strategy into a compact binary format;
[0016] Embed the data to be embedded into different regions and channels of the original image in layers according to the embedding strategy to obtain an embedded image;
[0017] Extract the embedded data from the embedded image by decoding and mapping reconstruction of the embedding strategy.
[0018] Optionally, the content analysis of the original image as the carrier includes:
[0019] Dividing the original image into multiple blocks according to a preset size, and analyzing the content complexity and visual characteristics of each block;
[0020] Based on the results of the content complexity and visual characteristics analysis, classifying the multiple blocks by priority.
[0021] Optionally, the analysis of the content complexity and visual characteristics of each block includes:
[0022] By calculating the standard deviation of the gray values within the block, obtaining the pixel change frequency and intensity of each block;
[0023] By calculating the edge density of the block, identifying the areas within the block that reach the preset gradient edge information;
[0024] Evaluating the color complexity of each block by calculating the ratio of the number of different colors within the block to the total number of pixels.
[0025] Optionally, the calculation of the standard deviation of the gray values within the block includes:
[0026] Using a standard conversion formula to convert the RGB pixel values within the block into gray values;
[0027] Calculating the average value of all pixel gray values within the block;
[0028] Calculating the square of the difference between the gray value of each pixel and the average value;
[0029] Calculating the average value of the squared differences to obtain the variance;
[0030] Taking the square root of the variance to obtain the final standard deviation of the gray values.
[0031] Optionally, the calculation of the edge density of the block includes:
[0032] Initializing the number of edge pixels;
[0033] Traversing the internal pixels of the block excluding the boundary pixels;
[0034] For each internal pixel of the block, obtaining the gray values of its four adjacent pixels above, below, left, and right;
[0035] If the absolute value of the gray difference between the current internal pixel of the block and any adjacent pixel is greater than a preset threshold, then determining the pixel as an edge pixel and incrementing the edge count by 1;
[0036] After the traversal is completed, dividing the number of edge pixels by the total number of pixels in the block to obtain the edge density.
[0037] Optionally, the ratio of the number of different colors in the calculation block to the total number of pixels includes:
[0038] Initialize a set for storing different colors;
[0039] Traverse all pixels in the block;
[0040] For each pixel, obtain its RGB value and generate a unique color identifier;
[0041] Check whether the color already exists in the set, and if not, add it to the set;
[0042] After the traversal is completed, divide the size of the set by the total number of pixels in the block to obtain the color complexity.
[0043] Optionally, the embedding strategy includes: the width and height of the original image, the block size parameter, a block list containing the coordinates and priority classification information of each block, and the estimated maximum embedding capacity.
[0044] Optionally, the calculation process of the estimated maximum embedding capacity is as follows:
[0045] Calculate the block capacity of each classification area according to the categories after priority classification of multiple blocks;
[0046] Calculate the total capacity of the blocks in the classification area;
[0047] Before embedding the data to be embedded, compare the size of the data to be embedded with the calculated total capacity;
[0048] In the case of embedding multiple groups of data, the system automatically allocates the block capacity according to the priority classification information.
[0049] Optionally, the process of mapping reconstruction is as follows:
[0050] Group the priority classification information obtained by decoding the block according to the embedding strategy;
[0051] Record the coordinate information of each block and its index position within its respective group;
[0052] Construct a mapping function from the bit index to the pixel coordinate;
[0053] Use the mapping function to replace the table lookup operation to find the position of the embedded data.
[0054] Optionally, the embedding strategy further includes:
[0055] For the block with the first priority classification, the R channel uses the lowest 3 bits, the G channel of the block with the first priority classification uses the lowest 2 bits, the B channel of the block with the first priority classification uses the lowest 2 bits, and 7 bits of embedding capacity are allocated per pixel;
[0056] For the odd positions of the blocks with the priority classification of the second priority, the lowest 1 bit of the G channel is used; for the even positions of the blocks with the priority classification of the second priority, the lowest 1 bit of the R channel is used; the embedding capacity allocated per pixel does not exceed 1 bit.
[0057] Beneficial effects
[0058] 1. Compared with the traditional LSB (Least Significant Bit) method, under the same visual quality, the method of this application increases the embedding capacity by 30% - 50%;
[0059] 2. Through block adaptive processing, this application realizes a balanced embedding strategy of maintaining high quality in key areas and increasing capacity in non - key areas;
[0060] 3. The PSNR (Peak Signal - to - Noise Ratio) on the standard test image set remains above 45dB, and the SSIM (Structural Similarity Index) exceeds 0.98;
[0061] 4. The mapping reconstruction technology optimizes the traditional look - up table operation into a mathematical calculation, reducing the memory occupancy;
[0062] 5. The time complexity of the data embedding and extraction process remains at the O(n) level.
[0063] The advantages of the additional aspects of this application will be partially given in the following description, partially become obvious from the following description, or be learned through the practice of this application. Brief description of the drawings
[0064] To more clearly illustrate the technical solutions of the embodiments of this application, the following will briefly introduce the drawings required for the description of the embodiments of this application or the prior art. Obviously, the following described drawings are only some embodiments of this application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0065] Figure 1 It is a schematic flowchart of the image steganography method described in the embodiments of this application;
[0066] Figure 2 It is a schematic flowchart of the block division of the original image described in the embodiments of this application;
[0067] Figure 3 It is a schematic flowchart of calculating the edge density of the block described in the embodiments of this application;
[0068] Figure 4 It is a schematic flowchart of calculating the color complexity of the block described in the embodiments of this application;
[0069] Figure 5 Schematic diagram of the multi - surface embedding process described in the embodiments of the present application;
[0070] Figure 6 Schematic diagram of the generation process of the adaptive embedding strategy described in the embodiments of the present application;
[0071] Figure 7 Schematic diagram of the process for estimating the maximum embedding capacity described in the embodiments of the present application;
[0072] Figure 8 Schematic diagram of the process for embedding the data to be embedded into the original image described in the embodiments of the present application;
[0073] Figure 9 Schematic diagram of the mapping reconstruction process described in the embodiments of the present application;
[0074] Figure 10 Schematic diagram of the process for extracting pixel bits by combining strategy information described in the embodiments of the present application;
[0075] Figure 11 Schematic diagram of the process of the image steganography method of a specific example of the present application. Detailed implementation manners
[0076] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative efforts shall fall within the scope of protection of the present application.
[0077] Embodiment
[0078] An image steganography method, as Figure 1 shown, includes the following steps:
[0079] Step S1: Perform content analysis on the original image as the carrier; the specific steps are as follows:
[0080] Step S1.1: Divide the original image into multiple blocks according to a preset size, and analyze the content complexity and visual characteristics of each block;
[0081] Specifically in this embodiment, divide it into multiple blocks according to a fixed size of 8×8 pixels; as Figure 2 shown,
[0082] The whole process experiences:
[0083] Input image (i.e., the original image), block division <8×8 pixels>, texture analysis, edge detection (i.e., edge density detection), color complexity evaluation, comprehensive scoring, determine whether at least 2 conditions are met, mark as high-priority blocks and mark as low-priority blocks, and finally obtain the block classification result.
[0084] It can be seen from this that the analysis process of this embodiment uses three key indicators for evaluation:
[0085] Texture complexity evaluation: Calculate the standard deviation of the gray values within the block, which reflects the pixel change frequency and intensity;
[0086] Edge density detection: Calculate the proportion of edge pixels to the total number of pixels to identify regions containing important edge information;
[0087] Color complexity evaluation: Calculate the ratio of the number of different colors within the block to the total number of pixels;
[0088] Furthermore, by calculating the standard deviation of the gray values within the block, the pixel change frequency and intensity of each block are obtained; the specific calculation steps are as follows:
[0089] Use the standard conversion formula (the weighted sum of R multiplied by 0.299, G multiplied by 0.587, and B multiplied by 0.114) to convert the RGB pixel values within the block into gray values;
[0090] Calculate the average value of the gray values of all pixels within the block;
[0091] Calculate the square of the difference between the gray value of each pixel and the average value;
[0092] Calculate the average value of the squared differences to obtain the variance;
[0093] Take the square root of the variance to obtain the final standard deviation of the gray values.
[0094] By calculating the edge density of the block, identify the regions within the block that reach the preset gradient edge information;
[0095] The entire process is as Figure 3 shown, including: block pixel values, initialize edge count, traverse pixels, check the difference with neighboring pixels, determine whether it exceeds the threshold, if so, increment the count by 1, if not, continue to calculate the pixel values of other blocks, and calculate the edge density.
[0096] Specifically, the calculation steps are as follows:
[0097] Initialize the number of edge pixels; (initialize the edge pixel count to 0);
[0098] Traverse the internal pixels of the block excluding the boundary pixels;
[0099] For each pixel inside a block, obtain the grayscale values of its four adjacent pixels above, below, left, and right;
[0100] If the absolute value of the grayscale difference between the current pixel inside the block and any of its adjacent pixels is greater than a preset threshold (the threshold in this embodiment is set to 20), then determine this pixel as an edge pixel and increment the edge count by 1;
[0101] After the traversal is completed, divide the number of edge pixels by the total number of pixels in the block to obtain the edge density.
[0102] Evaluate the color complexity of each block by calculating the ratio of the number of different colors in the block to the total number of pixels.
[0103] The process is as Figure 4 shown, including: block, initialize color, traverse pixels, generate color identifier, determine whether it already exists, if not, add to the set, if so, continue, calculate complexity ratio.
[0104] Specifically, the steps are as follows:
[0105] Initialize a set for storing different colors;
[0106] Traverse all pixels inside the block;
[0107] For each pixel, obtain its RGB value and generate a unique color identifier;
[0108] Check whether this color already exists in the set, and if not, add it to the set;
[0109] After the traversal is completed, divide the size of the set (the number of different colors) by the total number of pixels in the block to obtain the color complexity.
[0110] The above calculation method content together constitutes the core of image analysis, which can effectively identify the regions in the image suitable for high-capacity embedding. The grayscale change reflects the brightness change situation, the edge density reflects the richness of structural information, and the color complexity reflects the richness of color change. The three indicators complement each other to jointly evaluate the visual characteristics and content complexity of the block.
[0111] Step S1.2: Based on the content complexity and visual characteristic analysis results, classify multiple blocks into different priorities;
[0112] Specifically in this embodiment, classify the visually sensitive regions of the identified original image as blocks with the first priority in the priority classification, and classify the visually non-sensitive regions as blocks with the second priority in the priority classification.
[0113] In the specific implementation process, based on the analysis results, divide the blocks into two categories:
[0114] High-priority blocks (blocks with the first priority in the priority classification): When at least two of the three indicators of a block exceed the preset threshold, it is determined as a high-priority block, which can carry more information to be embedded;
[0115] Low-priority blocks (blocks with the second priority in the priority classification): Blocks that do not meet the high-priority conditions, which only carry a small amount of information to be embedded;
[0116] The specific process of setting the preset threshold for each indicator is as follows:
[0117] The standard deviation of grayscale change ≥ 15, the edge density ≥ 0.2, and the color complexity ≥ 0.4.
[0118] Step S2: Generate an adaptive embedding strategy according to the analysis results and encode the embedding strategy into a compact binary format;
[0119] The embedding strategy includes: the width and height of the original image, the block size parameter (e.g., 8×8 pixels), and a block list containing the coordinates and priority classification information of each block.
[0120] In the specific implementation process, in addition to considering the above image characteristic factors, security factors and capacity factors are also considered;
[0121] Among them, the security factors mainly include: the balance between the embedding strength and the detection risk, avoiding excessive modification of visually important areas, and the interleaved mode of channel selection;
[0122] The capacity factors include: the number and distribution of high-priority blocks, the utilization efficiency of low-priority blocks, and the overall embedding capacity estimation (estimating the maximum embedding capacity).
[0123] In a feasible implementation manner, the concept of "multi-plane embedding" is introduced. According to the block priority and pixel position, different channels and bit depths are dynamically allocated for information embedding, specifically including:
[0124] For blocks with the first priority (high priority) in the priority classification, the lowest 3 bits are used for the R channel, the lowest 2 bits are used for the G channel, and the lowest 2 bits are used for the B channel, with 7 bits of embedding capacity allocated per pixel;
[0125] For blocks with the second priority (low priority) in the priority classification, the lowest 1 bit of the G channel is used for odd positions; the lowest 1 bit of the R channel is used for even positions; no more than 1 bit of embedding capacity is allocated per pixel.
[0126] When encoding channel and position information, the method of channel * 8 + bitPosition is adopted. Specifically, bits 0 - 7 represent the bits of the R channel, bits 8 - 15 represent the bits of the G channel, and bits 16 - 23 represent the bits of the B channel.
[0127] The multi-plane embedding process is as Figure 5 shown, including: pixel, acquisition target, belonging block, high-priority determination. If it is for high-density embedding (R: 3 bits, G: 2 bits, B: 2 bits), if not, parity judgment is performed. For even numbers, 1 bit of the R channel is selected, and for odd numbers, 1 bit of the G channel is selected, and the pixel is modified to complete.
[0128] Current experiments verify that the multi-plane embedding strategy achieves the optimal balance between embedding capacity and visual quality.
[0129] Specifically in this embodiment, the process of generating an adaptive embedding strategy is as Figure 6 shown, including:
[0130] Analyze the results, calculate the number of blocks, traverse the blocks, and perform priority determination; if the determination condition is met, transfer to high priority, if not, transfer to low priority, generate a strategy, and calculate the capacity.
[0131] Among them, the process of estimating the maximum embedding capacity has a process as Figure 7 shown, including: block classification, counting the number of high / low priority blocks, calculating the capacity of each area, summing up the total capacity, reserving 32-bit length information, and calculating the available capacity.
[0132] Specific details are as follows:
[0133] Calculate the block capacity of each classification area according to the categories after priority classification of multiple blocks;
[0134] Calculate the total capacity of the blocks in the classification area;
[0135] Before embedding the data to be embedded, compare the size of the data to be embedded with the calculated total capacity;
[0136] In the case of embedding multiple groups of data, the system automatically allocates block capacity according to the priority classification information.
[0137] Specifically, the capacity estimation adopts the following calculation method:
[0138] 1. Block capacity calculation
[0139] The capacity of each high-priority block = block size² × 7 bits / pixel;
[0140] The capacity of each low-priority block = block size² × 1 bit / pixel.
[0141] 2. Total capacity calculation
[0142] Total number of bits = (Number of high - priority blocks × Capacity of high - priority blocks)+(Number of low - priority blocks × Capacity of low - priority blocks);
[0143] Reserved capacity = 32 bits (for storing data length);
[0144] Actual available capacity (bits)=Total number of bits - Reserved capacity;
[0145] Actual available capacity (bytes)=Actual available capacity (bits)÷8.
[0146] 3. Data length verification
[0147] Before embedding, the system compares the size of the data to be embedded with the estimated capacity;
[0148] If the data exceeds the capacity, the system provides three processing options:
[0149] Automatic truncation: Only embed the data within the capacity range;
[0150] Compression processing: Try to compress the data to fit the available space;
[0151] Rejection processing: Return an error and request to reduce the amount of data.
[0152] 4. Dynamic capacity allocation:
[0153] When embedding multiple sets of data, the system can automatically allocate capacity according to the priority;
[0154] Important data is written to high - priority blocks first to ensure the storage security of key information;
[0155] Secondary data is allocated to the remaining space to achieve reasonable utilization of resources;
[0156] The capacity estimation function enables this technology to accurately understand the carrying capacity of the image before actual embedding, avoid data loss, and provide clear capacity guidance for users.
[0157] It can be understood that in the above embedding strategy, "block" refers to the block unit obtained by dividing the image by pixels, and "block size²" refers to "the square of the block size", indicating the total number of pixels contained in a block.
[0158] The storage method of the embedding strategy can be an independent storage method, that is, storing the encoded embedding strategy separately as a file or a database record; it can also adopt an embedded storage method, that is, embedding the strategy information in the reserved area of the image.
[0159] The formulated embedding strategy also has the following functions in the decoding stage:
[0160] 1. Determine the embedding position:
[0161] Determine high-capacity regions and low-capacity regions in the image through block priority information;
[0162] Guide the system to read the embedded data bits from the correct pixel positions and channel positions;
[0163] 2. Construct a position mapping:
[0164] Convert the linear bit index into specific pixel coordinates and channel positions;
[0165] For high-priority blocks, each pixel provides 7-bit storage space (3 bits for the R channel, 2 bits for the G channel, and 2 bits for the B channel);
[0166] For low-priority blocks, alternately use the least significant bit of the R or G channel according to the parity of the pixel position;
[0167] 3. Data length recovery:
[0168] Extract the first 32 bits as the data length value through the embedding strategy;
[0169] Verify the rationality of the length value to ensure it is within the embedding capacity;
[0170] 4. Channel and position decoding:
[0171] Decode the channels using the "channel * 8 + bitPosition" format;
[0172] That is, bits 0-7 of channel 0 (R), bits 8-15 of channel 1 (G), and bits 16-23 of channel 2 (B);
[0173] Ensure accurate positioning to the specific channels and positions of each pixel.
[0174] Step S3: Embed the data to be embedded into different regions and channels of the original image layer by layer according to the embedding strategy to obtain an embedded image;
[0175] In the specific implementation process, precisely control the modification of each pixel by combining the strategy information:
[0176] Data embedding principle:
[0177] 1. First, convert the data to be embedded into a binary bit sequence;
[0178] 2. Reserve 32 bits at the beginning position of the original image for storing the data length;
[0179] 3. Embed according to the block priority order divided by the embedding strategy;
[0180] 4. Embed 7-bit data per pixel in high-priority blocks and 1-bit data per pixel in low-priority blocks.
[0181] The implementation process is as Figure 8 shown, including: pixels, block priority, high-priority determination. If yes, modify the RGB three channels; if not, modify a single channel according to parity, and update the pixels.
[0182] This policy-based embedding method can intelligently control the modification of images: higher density embedding is used in important areas (such as monotone backgrounds), and only minor modifications are made to sensitive areas (such as edges and textures). The whole process follows the principle of "embedding high-priority blocks first" to ensure that important data is stored in more reliable areas.
[0183] When modifying a single pixel, the system creates an exact bitmask to modify only specific bits of the specified channel and keeps other bits unchanged, thus minimizing the impact on visual quality.
[0184] Step S4: Extract the embedded data from the embedded image by decoding and mapping reconstruction of the embedding policy.
[0185] Data extraction is the inverse operation of the embedding process and also requires relying on policy information to accurately restore the data: Data extraction principle:
[0186] 1. First, parse the policy information and reconstruct the block priority mapping;
[0187] 2. Read the 32-bit data length information at the start position of the image;
[0188] 3. Extract data bits according to the priority mapping in the original embedding order;
[0189] 4. Convert the binary bit sequence back to the original data format.
[0190] The detailed process of data extraction guided by the embedding policy is as follows:
[0191] 1. Embedding policy parsing and mapping reconstruction
[0192] The system first reads the embedding policy (from an independent file or a reserved area of the image);
[0193] Parse the header information of the embedding policy to obtain parameters such as image size and block size;
[0194] Reconstruct the priority distribution map of the blocks to distinguish high-priority and low-priority blocks;
[0195] Build the mapping relationship from bit index to pixel position.
[0196] 2. High-precision position positioning
[0197] The system traverses pixel positions in exactly the same order as when embedded;
[0198] For the i-th bit, accurately calculate its block, pixel coordinates, and channel position;
[0199] In high-priority blocks, position calculation takes into account a density of 7 bits / pixel;
[0200] In low-priority blocks, position calculation takes into account a density of 1 bit / pixel and an interlaced parity pattern.
[0201] 3. Multi-channel bit reading
[0202] In high-priority blocks, the system reads data from the RGB three channels respectively:
[0203] The R channel reads the lowest 3 bits;
[0204] The G channel reads the lowest 2 bits;
[0205] The B channel reads the lowest 2 bits;
[0206] In low-priority blocks, according to the parity of the pixel coordinates (x,y):
[0207] When (x + y) % 2 = 0, read the lowest bit from the R channel;
[0208] When (x + y) % 2 = 1, read the lowest bit from the G channel.
[0209] 4. Bit value extraction process
[0210] For each position, the system locates the specific channel of the corresponding pixel;
[0211] Read the current value of this channel;
[0212] Apply a bit mask (1 << bitPosition) to isolate the target bit;
[0213] Extract the bit value (0 or 1) and add it to the result array.
[0214] 5. Data integrity verification
[0215] The first 32 bits extracted are parsed as the data length;
[0216] The system verifies the rationality of this length value (not exceeding the maximum capacity);
[0217] Continue to extract the remaining data bits according to the verified length.
[0218] 6. Binary data decoding
[0219] Group the extracted binary bits into groups of 16 bits each;
[0220] Each group is parsed into a Unicode code point;
[0221] All the characters are concatenated to form the final text.
[0222] The process of pixel bit extraction is as Figure 10 shown, including: locating pixels, channel positions, reading values, bit mask extraction, and adding results.
[0223] During the extraction process of this application, the original image will not be modified, only the values at specific positions are read. The entire process depends on the precise guidance of the policy information to ensure that data is extracted according to exactly the same path, order, and method as when embedding, realizing the lossless recovery of information.
[0224] The embedding mapping is the conversion bridge for embedding policy information into the actual data positions and is also a key link in the extraction process. Through mapping reconstruction, the system can accurately extract each bit of hidden (embedded) data from the embedded image.
[0225] As Figure 9 shown, the specific process of mapping reconstruction in this embodiment includes: embedding policy decoding, parsing header information, extracting block priorities, separating high and low priority blocks, establishing a mapping from bit index to pixel, calculating the capacity of each region, and generating a complete mapping table.
[0226] In a feasible implementation manner, the process of the mapping reconstruction is as follows:
[0227] Step S4.1: Group the blocks according to the priority classification information obtained by decoding the embedding policy;
[0228] Specifically, after parsing the embedding policy, obtain the priority flag of each block; divide the blocks into two groups according to the priority: a high-priority block group and a low-priority block group; record the coordinate information (x, y) of each block and its index position within its respective group.
[0229] Step S4.2: Record the coordinate information of each block and its index position within its respective group;
[0230] Specifically, construct a mapping function from the bit index (bitIndex) to the pixel coordinates (x, y), and design a unique triple identifier for each bit: (pixel x coordinate, pixel y coordinate, channel bit encoding); the channel bit encoding uses the format (channel number × 8 + position), for example, the 0th bit of the R channel is 0, and the 1st bit of the G channel is 9;
[0231] Step S4.3: Construct a mapping function from the bit index to the pixel coordinates;
[0232] The specific content is as follows:
[0233] For bit index i, determine whether it belongs to the high-priority area or the low-priority area;
[0234] For the high-priority area:
[0235] Determine the block index where the bit is located: blockIndex = i ÷ (block size² × 7);
[0236] Obtain the coordinates (blockX, blockY) of this block;
[0237] Calculate the position within the block: localBitIndex = i % (block size² × 7);
[0238] Determine the pixel index: pixelIndex = localBitIndex ÷ 7;
[0239] Calculate the coordinates (pixelInBlockX, pixelInBlockY) of the pixel within the block;
[0240] The final pixel coordinates = (blockX × block size + pixelInBlockX, blockY × block size + pixelInBlockY);
[0241] Determine the channel and bit position: Allocate to the RGB three channels according to the value of localBitIndex % 7;
[0242] For the low-priority area:
[0243] Calculate the adjusted bit index in the low-priority area: adjustedBitIndex = i - total high-priority capacity;
[0244] Determine the block index where the bit is located: blockIndex = adjustedBitIndex ÷ (block size²);
[0245] The subsequent calculation process is similar to that of the high-priority area, but only 1 bit is used per pixel, and the least significant bit of either the R or G channel is selected according to the parity of the pixel coordinates;
[0246] Step S4.4: Use a mapping function instead of a table lookup operation to find the location of the embedded data.
[0247] Specifically, use a mathematical mapping instead of a table lookup operation to achieve position lookup with O(1) time complexity; pre-compute key parameters to reduce repeated calculations during the extraction process; moderately cache common mapping results to balance memory usage and performance.
[0248] During the specific implementation process, the process of mapping reconstruction can also perform capacity limit management, including:
[0249] Record the capacity boundaries of high-priority areas and low-priority areas;
[0250] Perform boundary checks when switching the bit index area to prevent out-of-bounds access;
[0251] Provide the percentage position of the current bit index in the total capacity for easy progress monitoring.
[0252] Through embedded mapping reconstruction, the system achieves precise positioning from a linear bit sequence to a two-dimensional pixel space, providing an accurate "navigation map" for data extraction. This mapping method based on mathematical calculations is more efficient than storing a complete pixel position table, significantly reducing memory occupancy while maintaining O(1) position lookup performance.
[0253] The following specific example shows that this mapping method can accurately reconstruct the pixel positions used during embedding during the extraction process, without storing a large amount of position information, achieving efficient data recovery.
[0254] Suppose there is an image of 32×32 pixels, divided into blocks of 8×8 pixel size, with a total of 16 blocks. After image analysis, 6 blocks are marked as high-priority and 10 blocks are marked as low-priority. Now demonstrate how to map the bit index to specific pixel positions:
[0255] Schematic diagram of the image layout (H represents high-priority block, L represents low-priority block):
[0256] |H0 | L0 | L1 | H1 |
[0257] |L2 | H2 | H3 | L3 |
[0258] |L4 | H4 | L5 | L6 |
[0259] |H5 | L7 | L8 | L9 |
[0260] Example 1: Bit index = 100 (within the high-priority area) Calculation process:
[0261] 1. Calculation of the capacity of high-priority blocks:
[0262] Capacity of each high-priority block = 8²×7 = 448 bits;
[0263] Total capacity of 6 high-priority blocks = 6×448 = 2,688 bits;
[0264] 2. Determine that 100 is within the high-priority area (because 100 < 2,688);
[0265] 3. Determine the block index:
[0266] blockIndex = 100 ÷ 448 = 0 (integer division);
[0267] Corresponding to the high - priority block H0 (the top - left block);
[0268] 4. Calculate the position within the block:
[0269] localBitIndex = 100 % 448 = 100;
[0270] pixelIndex = 100 ÷ 7 = 14 (integer division);
[0271] Indicating the 14th pixel within block H0;
[0272] 5. Calculate the pixel coordinates:
[0273] pixelInBlockX = 14 % 8 = 6;
[0274] pixelInBlockY = 14 ÷ 8 = 1 (integer division);
[0275] The coordinates of block H0 are (0, 0);
[0276] The final pixel coordinates = (0 × 8 + 6, 0 × 8 + 1) = (6, 1);
[0277] 6. Determine the channel and bit position:
[0278] bitInPixel = 100 % 7 = 2
[0279] Since 0, 1, 2 correspond to the three bits of the R channel, it is located at the 2nd bit of the R channel, and the channel bit code = 0 × 8 + 2 = 2 (the 2nd bit of the R channel);
[0280] 7. Final result: Bit index 100 maps to the 2nd bit of the R channel of the pixel at coordinates (6, 1).
[0281] Example 2: Calculation process for bit index = 3000 (within the low - priority area):
[0282] 1. Determine that 3000 is in the low - priority area (because 3000 > 2,688);
[0283] 2. Calculate the adjusted bit index in the low - priority area:
[0284] adjustedBitIndex = 3000 - 2688 = 312;
[0285] 3. Low - priority block capacity calculation:
[0286] Capacity of each low - priority block = 8² = 64 bits;
[0287] 4. Determine the block index:
[0288] blockIndex = 312÷64 = 4 (integer division);
[0289] Corresponding to the low - priority block L4;
[0290] 5. Calculate the position within the block:
[0291] localBitIndex = 312 % 64 = 56;
[0292] Indicating the 56th pixel within the L4 block;
[0293] 6. Calculate the pixel coordinates:
[0294] pixelInBlockX = 56 % 8 = 0;
[0295] pixelInBlockY = 56÷8 = 7 (integer division);
[0296] The coordinates of block L4 are (0, 2) (the first column of the third row);
[0297] The final pixel coordinates = (0×8 + 0, 2×8 + 7) = (0, 23);
[0298] 7. Determine the channel and bit position:
[0299] (0 + 23)%2 = 1 (odd), use the G channel;
[0300] Channel bit encoding = 1×8 + 0 = 8 (the 0th bit of the G channel);
[0301] 8. Final result: Bit index 3000 maps to the 0th bit of the G channel of the pixel at coordinates (0, 23).
[0302] The adaptive block multi - plane image steganography method proposed in this application adopts innovative technologies such as adaptive block division technology, multi - plane embedding mechanism, and efficient mapping reconstruction. The detailed process of a certain example is as Figure 11As shown (including: inputting the original image, analyzing the original image, generating the embedding strategy, encoding the embedding strategy and jointly performing data embedding with the data to be embedded, outputting the embedded image, decoding the embedding strategy, reconstructing the embedding strategy, extracting the data, and outputting the original data); a block classification mechanism based on three key metrics (gray-scale change, edge density, and color complexity), adopting a comprehensive determination method that meets at least two conditions to achieve differential processing of different image regions; and dynamically allocating the embedding bit depth according to the region characteristics (7 bits / pixel for high-priority regions and 1 bit / pixel for low-priority regions), designing a channel interleaving utilization strategy based on odd and even positions to reduce the modification of a single channel and achieve fine-grained embedding control at the bit level; finally, by designing an O(1) time complexity position lookup algorithm based on mathematical calculations, without storing the complete mapping table, achieving accurate positioning down to the bit through the triple identifier (pixel coordinates x, y, channel bit encoding), adopting an innovative block index conversion method to accurately calculate the actual pixel position corresponding to any bit index, and adopting a partition processing mechanism, using different addressing algorithms for high- and low-priority regions to balance efficiency and accuracy. Compared with the traditional LSB method, the method of this application can increase the embedding capacity by 30% - 50% under the same visual quality. Through block adaptive processing, it realizes a balance strategy of maintaining high quality in key regions and increasing capacity in non-key regions. The PSNR (peak signal-to-noise ratio) on the standard test image set remains above 45dB, and the SSIM (structural similarity) exceeds 0.98; by using the mapping reconstruction technology to optimize the traditional look-up table operation into a mathematical calculation, the memory occupancy is reduced, and the time complexity of the data embedding and extraction processes remains at the O(n) level. It realizes the balance between the embedding capacity and the visual quality and maximizes the calculation efficiency.
[0303] The above-described embodiments are only used to illustrate the technical solutions of this application, rather than to limit them; although this application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included in the protection scope of this application.
[0304] The above is only the specific implementation manner of this application, but the protection scope of this application is not limited thereto. Any person skilled in the art within the technical scope disclosed by this application can easily think of various equivalent modifications or replacements, and these modifications or replacements should all be covered by the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.
Claims
1. An image steganography method, characterized in that, It includes: Performing content analysis on the original image as the carrier; Generating an adaptive embedding strategy according to the analysis result and encoding the embedding strategy into a compact binary format; Layering and embedding the data to be embedded into different regions and channels of the original image according to the embedding strategy to obtain an embedded image; Extracting the embedded data from the embedded image by decoding and mapping reconstruction of the embedding strategy.
2. The image steganography method according to claim 1, characterized in that, The performing content analysis on the original image as the carrier includes: Dividing the original image into multiple blocks according to a preset size and performing content complexity and visual characteristic analysis on each block; Based on the content complexity and visual characteristic analysis results, classifying multiple blocks by priority.
3. The image steganography method according to claim 2, wherein The performing content complexity and visual characteristic analysis on each block includes: Calculating the standard deviation of the grayscale values within the block to obtain the pixel change frequency and intensity of each block; Identifying the regions within the block that reach the preset gradient edge information by calculating the edge density of the block; Evaluating the color complexity of each block by calculating the ratio of the number of different colors within the block to the total number of pixels.
4. The image steganography method according to claim 3, characterized in that, The calculating the standard deviation of the grayscale values within the block includes: Converting the RGB pixel values within the block to grayscale values using a standard conversion formula; Calculating the average value of all pixel grayscale values within the block; Calculating the square of the difference between the grayscale value of each pixel and the average value; Calculating the average value of the squared differences to obtain the variance; Taking the square root of the variance to obtain the final standard deviation of the grayscale values.
5. The image steganography method according to claim 4, wherein The calculating the edge density of the block includes: Initializing the number of edge pixels; Traversing the internal pixels of the block excluding the boundary pixels; For each internal pixel of the block, obtaining the grayscale values of its four adjacent pixels above, below, left, and right; If the absolute value of the grayscale difference between the current internal pixel of the block and any adjacent pixel is greater than a preset threshold, determining the pixel as an edge pixel and incrementing the edge count by 1; After the traversal is completed, dividing the number of edge pixels by the total number of pixels in the block to obtain the edge density.
6. The image steganography method according to claim 5, characterized in that, The calculating the ratio of the number of different colors within the block to the total number of pixels includes: Initializing a set for storing different colors; Traversing all pixels within the block; For each pixel, obtaining its RGB value and generating a unique color identifier; Checking whether the color already exists in the set, and adding it to the set if it does not exist; After the traversal is completed, dividing the size of the set by the total number of pixels in the block to obtain the color complexity.
7. The image steganography method according to claim 2, wherein The embedding strategy includes: the width and height of the original image, the block size parameter, a block list containing the coordinates and priority classification information of each block, and the estimated maximum embedding capacity.
8. The image steganography method according to claim 7, wherein The calculation process of the estimated maximum embedding capacity is as follows: Calculating the block capacity of each classification region according to the categories after classifying multiple blocks by priority; Calculating the total capacity of the block in the classification region; Comparing the size of the data to be embedded with the calculated total capacity before embedding the data to be embedded; In the case of embedding multiple groups of data, the system automatically allocates the block capacity according to the priority classification information.
9. The image steganography method according to claim 2, wherein The process of the mapping reconstruction is as follows: Grouping the blocks according to the priority classification information obtained by decoding the embedding strategy; Recording the coordinate information of each block and its index position within its respective group; Constructing a mapping function from the bit index to the pixel coordinates. Use a mapping function instead of a look-up table operation to find the location of the embedded data.
10. The image steganography method according to claim 7, wherein The embedding strategy further includes: For the R channel of the block with the first priority classification, the lowest 3 bits are used; for the G channel of the block with the first priority classification, the lowest 2 bits are used; for the B channel of the block with the first priority classification, the lowest 2 bits are used, and 7 bits of embedding capacity are allocated per pixel; For the odd positions of the block with the second priority classification, the lowest 1 bit of the G channel is used; for the even positions of the block with the second priority classification, the lowest 1 bit of the R channel is used; and no more than 1 bit of embedding capacity is allocated per pixel.
Citation Information
Patent Citations
A reversible data hiding method based on pixel multi-scale prediction
CN109948307A
Reversible information hiding method and device with contrast enhancement in combination with multi-layer difference expansion
CN110047029A
Image encryption method and device, image decryption method and device, equipment and readable storage medium
CN112040086A
Method and apparatus for embedding and reproducing watermark into and from contents data
US20020105839A1
Large capacity steganography
US6473516B1
Cited By
Identity, behavior and willingness authentication three-in-one digital handwriting video signing method and system
CN122369126A
Identity, behavior and intent authentication triad digital penmanship video signing method and system
CN122369126B