Perceptual hash-based similar image search method, system, device and medium thereof

By constructing a multi-scale space and using the difference of Gaussians pyramid to screen stable key points, extracting multimodal features, and generating hash strings, the problem of missing search results for screenshot images in similar image searches is solved, achieving highly accurate and robust similar image search.

CN120892594BActive Publication Date: 2026-02-03GUANGDONG KINGPOINT DATA SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511416319.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-30
Publication Date
2026-02-03
Estimated Expiration
2045-09-30

AI Technical Summary

Technical Problem

Existing similar image search technologies based on perceptual hashing suffer from omissions in search results when processing screenshots. In particular, due to large differences in hash strings caused by size cropping and content truncation, the original images cannot be effectively matched, affecting the comprehensiveness and accuracy of search results.

Method used

By constructing a multi-scale spatial Gaussian difference pyramid, stable keypoints are selected, multimodal features are extracted, and joint feature vectors are generated. Combined with the Hamming distance threshold determination and keypoint density screening mechanism of hash strings, hash strings are generated, optimizing the image preprocessing and feature extraction process and enhancing the reliability of search results.

Benefits of technology

It significantly improves the accuracy and comprehensiveness of screenshot image search results, enabling accurate matching even with slight deformation or noise interference, reducing false detection rate, and enhancing the robustness and accuracy of similar image retrieval.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120892594B_ABST
    Figure CN120892594B_ABST
Patent Text Reader

Abstract

The application discloses a similar image search method, system and device based on perceptual hashing and a medium thereof. The method comprises constructing a multi-scale space for an input initial image and generating a Gaussian pyramid based on the multi-scale space, obtaining a Gaussian difference pyramid based on the Gaussian pyramid, screening stable key points in the Gaussian difference pyramid, delimiting a densest region in the initial image and intercepting a minimum circumscribed rectangle as a target screenshot image according to the distribution density of the screened stable key points, extracting multi-modal features of the initial image, performing feature splicing to generate a joint feature vector, preprocessing the initial image and the target screenshot image, generating corresponding hash strings based on the preprocessed images and the joint feature vector, comparing hash strings of images to be searched with a hash set in a database, and outputting images with a hamming distance less than or equal to a preset threshold as similar results. The application improves the search accuracy of screenshot images to obtain complete original image information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and in particular to a method, system, device and medium for similar image search based on perceptual hashing. Background Technology

[0002] Currently, with the rapid increase in image data on the Internet, similar image search technology has become crucial. Among them, similar image search methods based on perceptual hashing have attracted attention due to their efficiency.

[0003] However, existing image search technologies based on perceptual hashing often suffer from missing search results when the input image is a screenshot of an original image. Specifically, traditional methods compare hash strings generated from the entire image, but operations such as cropping and content truncation of screenshots can disrupt the global feature consistency of the original image, leading to significant differences in hash strings. This makes it difficult to effectively match the original image, hindering users from obtaining complete original image information when searching for the source of a screenshot and affecting the comprehensiveness and accuracy of search results. Summary of the Invention

[0004] To improve the accuracy of searching screenshot images and obtain complete original image information, this application provides a similar image search method, system, device and medium based on perceptual hashing.

[0005] Firstly, the objective of this invention is achieved through the following technical solution:

[0006] Similar image search methods based on perceptual hashing include:

[0007] A multi-scale space is constructed from the input initial image, and a Gaussian pyramid is generated through Gaussian convolution operation. A Gaussian difference pyramid is then obtained based on the Gaussian pyramid.

[0008] Stable key points are selected from the difference of Gaussians pyramid.

[0009] Based on the selected stable key point distribution density, the densest region is delineated in the initial image and the smallest bounding rectangle is cropped as the target screenshot image.

[0010] Extract the multimodal features from the initial image, and concatenate the multimodal features to generate a joint feature vector;

[0011] The initial image and the target screenshot image are preprocessed respectively; a corresponding hash string is generated based on the preprocessed image and the joint feature vector;

[0012] The hash string of the image to be retrieved is compared with the hash set in the database, and images with a Hamming distance less than or equal to a preset threshold are output as similar results.

[0013] By adopting the above technical solution, in order to improve the search accuracy of screenshot images, this application effectively extracts the essential features of screenshot images through the construction of a Gaussian difference pyramid and the selection of stable key points. Compared with traditional methods that rely solely on global hash comparison, this application locates the screenshot area through the distribution of local key points, avoiding the problem of feature loss caused by screenshot scaling and content cropping, making the search results closer to the visual core area of ​​the original image. At the same time, in order to obtain complete original image information and improve the comprehensiveness and accuracy of search results, this application also combines the Hamming distance threshold determination of hash strings and the key point density selection mechanism, which doubles the guarantee of the reliability of search results. Even if the user-input search screenshot has slight deformation or noise interference, it can still achieve accurate matching through the spatial distribution features of stable key points, enhancing the robustness of similar image determination based on perceptual hashing and reducing the false detection rate.

[0014] In a preferred embodiment of this application, the step of screening stable key points in the difference of Gaussian pyramid includes:

[0015] The Hessian matrix is ​​calculated for each layer of the Gaussian difference pyramid image, and local extrema are detected by second derivative as candidate key points.

[0016] A non-maximum suppression algorithm is used to correct the position of candidate key points in three-dimensional scale space and retain the extreme point with the largest response value.

[0017] Calculate the principal curvature ratio of the candidate key points, eliminate edge response points whose principal curvature ratio is greater than a preset ratio, and retain candidate key points whose response value is higher than the neighborhood mean 3σ as stable key points.

[0018] By adopting the above technical solution, this application employs the following processing steps in the process of screening stable key points in the Gaussian difference pyramid: Hessian matrix calculation, nonmaximum suppression algorithm, and principal curvature ratio calculation. This not only ensures the positional accuracy and stability of candidate key points, but also effectively removes edge response points, thereby improving the accuracy and reliability of key point detection.

[0019] In a preferred embodiment of this application, the preprocessing of the initial image and the target screenshot image includes:

[0020] Adjust the image compression size based on the joint feature vector;

[0021] A contrast-limited adaptive histogram equalization algorithm is used to enhance the contrast of the initial image and the target screenshot image at multiple scales.

[0022] Multi-scale Retinex dehazing is performed on the compressed image to unify the image brightness benchmark.

[0023] By adopting the above technical solutions, and sequentially using image compression size adjustment, contrast-limited adaptive histogram equalization algorithm, and multi-scale Retinex dehazing processing, the image quality and visual effect can be significantly improved.

[0024] In a preferred embodiment of this application: the generation of the corresponding hash string based on the preprocessed image and the joint feature vector includes:

[0025] The joint feature vector is concatenated with the preprocessed image at the channel level to form a multi-channel input.

[0026] A two-dimensional discrete cosine transform is performed on the spliced ​​multi-channel input, and the first K largest amplitude coefficients are retained to form a low-frequency feature matrix.

[0027] Calculate the mean and standard deviation of the low-frequency feature matrix, and generate a dynamic threshold by combining the global statistics of the joint feature vector; based on the dynamic threshold, perform threshold binarization on the K largest amplitude coefficients to generate a binary hash sequence;

[0028] Run-length encoding is performed on the binary hash sequence and the joint feature vector, and consecutive identical elements are merged into triples to compress the hash string length;

[0029] The binary hash sequence is XORed with the semantic hash label extracted by the deep residual network to generate a composite hash feature; the semantic hash label is generated based on the high-level semantic features of the image.

[0030] The weights of the joint feature vector are dynamically adjusted by color and texture complexity through an attention mechanism that weights the composite hash features.

[0031] By adopting the above technical solution, in the process of generating the corresponding hash string based on the preprocessed image and joint feature vector, low-frequency features are first preserved by two-dimensional discrete cosine transform, then binarized by dynamic thresholding, and finally semantic hash labels are extracted by deep residual network and XORed with them to form composite hash features. This not only enhances the analytical precision of image feature representation, but also optimizes feature weight allocation through attention mechanism, so that the final generated hash string can more accurately reflect the essential features of the image and improve the efficiency of similar image retrieval.

[0032] In a preferred embodiment, this application further includes:

[0033] Obtain hash strings of the image to be retrieved and candidate images, wherein the hash strings contain hashed representations of color moments, LBP texture, and DCT low-frequency features; parse multimodal features from the hash strings;

[0034] Using the image to be retrieved and each of the candidate images as basic processing units, extract their respective multimodal image features, and calculate the initial image similarity score based on the multimodal image features;

[0035] The sub-similarity scores corresponding to the multimodal features are weighted and fused according to a preset first weighting strategy to obtain a fused similarity score;

[0036] The preset similarity scoring model is optimized based on the fused similarity score and user feedback information, and the final image similarity score result is output.

[0037] By adopting the above technical solutions, this application achieves feature reuse and elimination of computational redundancy by reverse parsing multimodal features through hash strings; the multimodal similarity weighted fusion mechanism integrates global features of deep semantics, texture details and color distribution, solves the problem of single features being easily interfered with, and also improves the discriminativeness of the initial similarity score.

[0038] In a preferred embodiment of this application: the step of extracting multimodal image features from the image to be retrieved and each of the candidate images as basic processing units, and calculating an initial image similarity score based on the multimodal image features, includes:

[0039] Convolutional neural networks are used to extract deep semantic features of images, local binary patterns are used to extract texture features of images, and color moments are used to extract color features of images.

[0040] Using each image to be retrieved and candidate image as a basic processing unit, the Euclidean distance similarity between deep semantic features, the Hamming distance similarity between texture features, and the similarity between color features are calculated respectively to obtain the sub-similarity scores under each modality.

[0041] The sub-similarity scores are normalized to obtain the initial image similarity score.

[0042] By adopting the above technical solution, deep semantic features, texture features, and color features construct feature spaces from three dimensions: high-level semantics, mid-level texture, and low-level color. By calculating the sub-similarity scores under each modality and then performing normalization processing, the initial image similarity score is obtained, so as to comprehensively evaluate the similarity between images from multiple different dimensions and improve the accuracy of image retrieval.

[0043] In a preferred embodiment of this application: the step of weighting and fusing the sub-similarity scores corresponding to the multimodal features according to a preset first weighting strategy to obtain a fused similarity score includes:

[0044] Set the initial weight coefficients for the deep semantic features, texture features, and color features;

[0045] The weight optimization model is trained using historical user click data, and the weight coefficients of each feature mode are adjusted using gradient descent.

[0046] The normalized sub-similarity scores are weighted and summed with the adjusted weight coefficients to obtain the fusion similarity score.

[0047] By adopting the above technical solution, dynamic adjustment of the importance of different features is realized. The weight optimization model based on historical click data dynamically adjusts the feature weights through gradient descent. For example, the weight of semantic features in clothing image retrieval is increased to 42%, while the weight of texture features in industrial parts retrieval is reduced to 18%, so as to achieve scene adaptation of feature weights and make the final output similarity score more in line with the actual needs of users.

[0048] Secondly, the objective of this invention is achieved through the following technical solution:

[0049] A similar image search system based on perceptual hashing, applied to the similar image search method based on perceptual hashing as described above, the system comprising:

[0050] The multi-scale space construction module is used to construct a multi-scale space for the input initial image, and generate a Gaussian pyramid through Gaussian convolution operation, and obtain a Gaussian difference pyramid based on the Gaussian pyramid;

[0051] The key point detection module is used to screen stable key points in the difference of Gaussian pyramid;

[0052] The target screenshot extraction module is used to delineate the densest region in the initial image and extract the smallest bounding rectangle as the target screenshot image based on the selected stable key point distribution density.

[0053] The multimodal feature extraction and fusion module is used to extract multimodal features from the initial image, concatenate the multimodal features, and generate a joint feature vector.

[0054] The hash encoding module is used to preprocess the initial image and the target screenshot image respectively; and generate a corresponding hash string based on the preprocessed image and the joint feature vector.

[0055] The similar image retrieval module compares the hash string of the image to be retrieved with the hash set in the database, and outputs images with a Hamming distance less than or equal to a preset threshold as similar results.

[0056] Thirdly, the objective of this invention is achieved through the following technical solution:

[0057] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the steps of the above-described perceptual hash-based similar image search method.

[0058] Fourthly, the objective of this invention is achieved through the following technical solution:

[0059] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described perceptual hash-based similar image search method.

[0060] In summary, this application includes at least one of the following beneficial technical effects:

[0061] 1. By constructing a multi-scale space and generating a Gaussian difference pyramid, it can effectively capture the local feature differences of images at different scales; combined with stable keypoint filtering and target region cropping, it significantly improves the localization accuracy of feature regions; combined with the Hamming distance threshold determination of hash strings and keypoint density filtering mechanism, it doubles the reliability of search results. Even if the search screenshot entered by the user has slight deformation or noise interference, it can still achieve accurate matching through the spatial distribution features of stable keypoints.

[0062] 2. Convolutional neural networks are used to extract deep semantic features, local binary patterns are used to extract texture features, and color moments are used to extract color features. Sub-similarity scores are calculated for each modality, and then normalization is performed to obtain the initial image similarity score. This application comprehensively utilizes a variety of advanced image processing technologies, which can comprehensively evaluate the similarity between images from multiple dimensions, thereby improving the accuracy of retrieval. Attached Figure Description

[0063] Figure 1 This is a flowchart of a similar image search method based on perceptual hashing in one embodiment of this application;

[0064] Figure 2 This is another flowchart of a similar image search method based on perceptual hashing in one embodiment of this application;

[0065] Figure 3 This is a schematic diagram of a device according to one embodiment of this application. Detailed Implementation

[0066] The present application will be further described in detail below with reference to the accompanying drawings.

[0067] In one embodiment, such as Figure 1 As shown, this application discloses a similar image search method based on perceptual hashing, which specifically includes the following steps:

[0068] S1: Construct a multi-scale space for the input initial image, generate a Gaussian pyramid through Gaussian convolution operation, and obtain a Gaussian difference pyramid based on the Gaussian pyramid.

[0069] In this embodiment, the multi-scale space uses Gaussian kernel blurring images of different scales to simulate the human eye's observation effect on objects at different distances; the Gaussian pyramid is a hierarchical structure composed of images of different resolutions, with the top layer being a low-resolution coarse-grained representation; the Gaussian difference pyramid is a DoG (Difference of Gaussians) pyramid, which is a difference image obtained by subtracting adjacent Gaussian pyramid layers and is used to detect scale-invariant features.

[0070] Specifically, the initial input image is scaled to 256×256 pixels while maintaining the aspect ratio, and five Gaussian kernels with different standard deviations (σ=1, 2, 4, 8, 16) are constructed. These five Gaussian kernels are then convolved sequentially onto the original input image to generate a five-layer Gaussian pyramid, where each layer is scaled down proportionally to half the size of the previous layer. Next, the difference in Gaussian pyramid (DoG) of four layers is obtained by subtracting adjacent Gaussian layers, corresponding to scale differences σ=1, 2, 4, and 8. This five-layer scale space construction allows for the detection of stable keypoints with scale changes ranging from 0.5 to 4 times.

[0071] S2: Select stable key points in the difference of Gaussian pyramid.

[0072] Specifically, step S2 includes:

[0073] S21: Calculate the Hessian matrix for each layer of the Gaussian difference pyramid image, and use the second derivative to detect local extrema as candidate keypoints.

[0074] In this embodiment, the Hessian matrix is ​​also called the Hessian matrix; the Hessian matrix is ​​a 3x3 matrix used for second derivative detection, and its calculation formula is: ,in , , These are the second derivatives of the image. Local extrema are candidate keypoints whose response values ​​are greater than those of their 26 neighboring points in a 3D scale space that includes the image location and scale.

[0075] Specifically, each pixel in each layer of the DoG pyramid image is traversed to detect local extrema and calculate the difference between the current pixel and its 8 neighboring pixels and the corresponding pixels in the upper and lower layers. If the response value of the current pixel is greater than that of the surrounding 26 points, the pixel is determined to be a local maximum, i.e., a local extrema, and is then marked as a candidate keypoint.

[0076] Furthermore, Taylor expansion is performed on the candidate keypoints to calculate the sub-pixel level coordinate offset. Update keypoint coordinates as follows The Gaussian kernel size is generated according to σ=1.6×(2^k) (k=0,1,...,4).

[0077] S22: A non-maximum suppression algorithm is used to correct the position of candidate key points in three-dimensional scale space and retain the extreme point with the largest response value.

[0078] In this embodiment, the three-dimensional scale space is a three-dimensional space composed of image position (x, y) and scale σ, and the response value refers to the value of the DoG function at the candidate keypoint, reflecting the feature saliency.

[0079] Specifically, a 3D neighborhood window is constructed centered on the candidate keypoint. The 3D neighborhood window has a spatial radius of 2 pixels × a scale radius of 1σ, a size of 3×3×3 in space, and 3 scale layers (current layer ±1σ). Then, the DoG response values ​​of the candidate keypoint are compared with those of all points in the neighborhood. If the current point has the maximum value in the neighborhood, it is retained; otherwise, it is discarded.

[0080] Calculate the determinant of the Hessian matrix of candidate points Heji ,like <0 or If it is an edge response point, it will be removed.

[0081] Furthermore, the edge response threshold is .

[0082] S23: Calculate the principal curvature ratio of candidate key points, remove edge response points whose principal curvature ratio is greater than the preset ratio, and retain candidate key points whose response value is higher than the neighborhood mean 3σ as stable key points.

[0083] In this embodiment, the principal curvature ratio is used to measure the degree of curvature change in the neighborhood of a stable key point, and the calculation formula is as follows: Using the 3σ criterion, if the response value of a candidate key point is less than three times the standard deviation of the neighborhood mean, it is judged as noise.

[0084] Specifically, the Hessian matrix eigenvalues ​​and principal curvature ratios are calculated for the neighborhood of candidate keypoints (5×5 window), where the principal curvature ratio threshold is R=10 and the signal-to-noise ratio threshold is T=μ+3σ.

[0085] S3: Based on the selected stable key point distribution density, delineate the densest region in the initial image and extract the smallest bounding rectangle as the target screenshot image.

[0086] In this embodiment, the stable key point distribution density refers to the number of stable key points per unit area, and the calculation formula is as follows: N is the number of key points, and W and H are the width and height in the image size.

[0087] Specifically, the initial image is divided into a 16×16 pixel grid. The number of stable keypoints within each pixel grid is counted, and a distribution density heatmap is generated. Then, the DBSCAN clustering algorithm is used to extract the continuous regions with the highest density. The minimum region area is set to 15% of the image area to complete the region delineation. The cluster center coordinates based on the DBSCAN clustering algorithm are extracted, and the minimum bounding rectangle centered at the cluster center coordinates is cropped. The minimum bounding rectangle must contain at least 80% of the cluster keypoints. The cropping size is fixed at 20% of the original image, with a minimum size of 128×128 pixels, and is used as the target cropping image. This target cropping method improves the background interference removal rate.

[0088] S4: Extract multimodal features from the initial image, concatenate the multimodal features, and generate a joint feature vector.

[0089] In this embodiment, multimodal feature extraction includes feature extraction of color moments (C), LBP texture (T), and DCT low-frequency features (D). The joint feature vector is obtained by concatenating C (9 dimensions) + T (59 dimensions) + D (64 dimensions) into a 132-dimensional joint feature vector. Compared with single features, the combination of multimodal features enhances the image representation capability.

[0090] Specifically, color moment extraction refers to converting the image to the YCbCr color space and calculating the first-order mean μ, second-order variance σ², and third-order skewness γ for each channel. LBP texture extraction refers to calculating the 8-neighborhood texture using Uniform LBP and calculating a 59-dimensional histogram. DCT low-frequency feature extraction refers to performing DCT transformation on image blocks (8×8 pixels), retaining 10% of the coefficients in the top left corner, and then performing multimodal feature stitching.

[0091] S5: Preprocess the initial image and the target screenshot image respectively; generate the corresponding hash string based on the preprocessed image and the joint feature vector.

[0092] In this embodiment, the joint feature vector includes color moments, LBP texture, and DCT low-frequency features. The color moments include RGB three-channel statistics of mean, variance, and skewness. The LBP texture is a binary pattern of the center pixel and neighboring pixels within a 3×3 window. The DCT low-frequency features are the first 10% amplitude coefficients retained after two-dimensional discrete cosine transform (DCT transform).

[0093] Specifically, step S5 includes:

[0094] S51: Adjust image compression size based on joint feature vectors.

[0095] In this embodiment, the joint feature vector is a 132-dimensional feature vector concatenated from color moments (C), LBP texture (T), and DCT low-frequency features (D). Image compression is a content-sensitive compression operation, an intelligent compression strategy that dynamically adjusts compression parameters based on the complexity of the image content. A density threshold is set. It is 0.03, when Greater than It was identified as a high-density area.

[0096] Specifically, the compression parameter rules include: for high-density areas, the original resolution needs to be maintained; for medium-density areas (0.01 < ρ ≤ 0.03), the image is scaled down to 70% of the original size; and for low-density areas (ρ ≤ 0.01), the image is scaled down to 40% of the original size. The final output size is uniformly 640 × 480 pixels, while maintaining the aspect ratio.

[0097] S52: A contrast-limited adaptive histogram equalization algorithm is used to enhance the contrast of the initial image and the target screenshot image at multiple scales.

[0098] In this embodiment, the adaptive histogram equalization algorithm is CLAHE (Contrast Limited Adaptive Histogram Equalization), which prevents oversaturation by limiting contrast. Multi-scale processing refers to independently enhancing contrast at different spatial scales.

[0099] Specifically, the preprocessed image is divided into 8×8 pixel non-overlapping sub-blocks, a local histogram is calculated for each sub-block, and CLAHE processing is performed on each sub-block. The clipLimit is set to 2.0, tileGridSize to (8, 8), and a contrast limiting function is applied. Where T=250 is the preset contrast limit. Multi-scale fusion refers to Gaussian weighted fusion (σ=2.0) of the enhancement results of adjacent sub-blocks, and iteratively performing multi-scale enhancement three times to smooth the boundaries.

[0100] S53: Perform multi-scale Retinex dehazing on the compressed image to unify the image brightness benchmark.

[0101] In this embodiment, the Retinex theory is a light-reflection separation algorithm based on the retinal cortex visual model. The multi-scale Gaussian kernel refers to simulating the human eye's perception of different ranges of illumination using Gaussian filters of different scales.

[0102] Specifically, during illumination estimation, the image is sequentially convolved with Gaussian kernels of five scales (σ=15, 30, 60, 120, 240) to calculate the multi-scale illumination components for each pixel. ,in The original input image, Let be the Gaussian kernel at the k-th scale (σ=15, 30, ..., 240). For multi-scale illumination components, this application uses Gaussian kernel convolutions of different scales to separate illumination components of different ranges in the image. Small σ convolution kernels capture local illumination (such as reflections from objects), while large σ convolution kernels capture global illumination (such as overall brightness attenuation caused by haze). Logarithmic domain processing: ,in The reflection component represents the material and color information of the object itself. A white balance algorithm is used to restore the RGB channel ratios for color correction. Since haze images often suffer from color distortion due to atmospheric scattering, the RGB channel ratios are adjusted through white balance to make white objects appear as neutral gray or white in the image. Then, the RGB mean values ​​of gray areas (such as the sky or solid-color objects) in the image are calculated, and the channel values ​​are normalized to the same ratio to eliminate color deviations caused by haze and improve the accuracy of subsequent image analysis. Dynamic range compression can be achieved by applying Gamma correction to the reflection component. , Saturation enhancement can be achieved by multiplying the saturation channels in the HSV color space by a factor of 1.2.

[0103] Specifically, the degradation model for haze images is usually as follows: ,in For fog-free images, Transmittance, This is atmospheric light. The Retinex algorithm in this application approximates the multiplicative illumination effect as additive noise through a logarithmic transformation:

[0104] ,in Approximate global illumination component , This includes the object's reflection properties and local shadow details.

[0105] For example, the similar image retrieval method of this application embodiment can improve visibility to 150 meters in a car image test taken in hazy weather, while maintaining edge clarity.

[0106] S6: Compare the hash string of the image to be retrieved with the hash set in the database, and output images with a Hamming distance less than or equal to a preset threshold as similar results.

[0107] In this embodiment, the Hamming distance refers to the number of corresponding bits that differ between two binary strings of equal length.

[0108] Specifically, the hash values ​​of images in the database are stored in an LSH (Locality-Sensitive Hashing) table, with each hash bucket storing the top-100 similar hashes. After generating a hash for the image to be retrieved, the Hamming distance between it and all hashes in the hash bucket is calculated. A preset threshold of T=5 is set, and candidate images with a Hamming distance less than or equal to T are selected. Next, feature-level fusion is performed on the candidate images, namely deep feature fusion and hash feature fusion. The FAISS library is used to accelerate the nearest neighbor search. After obtaining the search results, a re-ranking optimization is performed, where the first ranked result is the most similar image obtained from the search. The top-50 similar results are returned as the similarity results output.

[0109] In one embodiment, step S5, which generates a corresponding hash string based on the preprocessed image and joint feature vector, includes:

[0110] S501: The joint feature vector is concatenated with the preprocessed image at the channel level to form a multi-channel input.

[0111] In this embodiment, channel-level stitching refers to mapping low-dimensional features to the image channel space to form a multi-channel input matrix with multiple input channels.

[0112] Specifically, the feature dimensions are first expanded: the 132-dimensional joint feature vector is reshaped into a 3-channel × 44-row (132 = 3 × 44) matrix, and expanded to the same spatial resolution as the preprocessed image using zero-padding (e.g., 256 × 256 × 3). Next, channel fusion is performed: the expanded feature matrix is ​​added pixel-by-pixel to the preprocessed image (RGB three channels) to form a 6-channel input, i.e., RGB + 44 × 3 feature channels. Through feature channel fusion, hash encoding can simultaneously capture spatial texture details and global statistical features, improving intra-class similarity in clothing image retrieval.

[0113] S502: Perform a two-dimensional discrete cosine transform on the spliced ​​multi-channel input, and retain the first K largest amplitude coefficients to form a low-frequency feature matrix.

[0114] In this embodiment, the two-dimensional discrete cosine transform (DCT transform) is a mathematical tool for converting an image from the spatial domain to the frequency domain. The low-frequency feature matrix retains the low-frequency components concentrated in the image energy, reflecting the global structural features. K is 50.

[0115] Specifically, the 6-channel input image is first divided into 8×8 pixel non-overlapping sub-blocks. After block processing, DCT transformation is performed independently on each sub-block. Then, the DCT coefficients are arranged in Zig-Zag order, and the first 50 coefficients with the largest amplitude are retained to form a low-frequency feature matrix. The first 50 coefficients with the largest amplitude are normalized to 0~1 to complete the selection of coefficients with the largest amplitude.

[0116] S503: Calculate the mean and standard deviation of the low-frequency feature matrix, combine it with the global statistics of the joint feature vector, and generate a dynamic threshold; based on the dynamic threshold, perform threshold binarization on the K largest amplitude coefficients to generate a binary hash sequence.

[0117] In this embodiment, the dynamic threshold is a binarized threshold generated based on low-frequency matrix statistics and joint feature global statistics. The formula for generating the dynamic threshold T is: ,in The mean of the low-frequency feature matrix. Let T be the standard deviation and CI be the color complexity. If T is greater than 1, truncate to 1; if T < 0, truncate to 0 to complete the threshold binarization process and generate a 128-bit binary hash sequence.

[0118] S504: Performs run-length encoding on the binary hash sequence and the joint feature vector, merging consecutive identical elements into triples to compress the hash string length.

[0119] In this embodiment, run-length encoding refers to replacing consecutive identical numerical sequences with triples of (value, length); triple compression reduces storage space by merging consecutive identical numerical sequences.

[0120] Specifically, the encoding of the binary hash sequence is scanned from left to right, recording the length of consecutive 1s or 0s. Sequences of consecutive identical values ​​are replaced with (value, length) triples; for example, "11110000" is merged into (1, 4) and (0, 4). The triple sequence is then converted to a compact binary format and further compressed using Huffman coding to complete the compressed storage of the binary hash sequence.

[0121] S505: Perform an XOR operation between the binary hash sequence and the semantic hash label extracted through a deep residual network to generate a composite hash feature; the semantic hash label is generated based on the high-level semantic features of the image.

[0122] In this embodiment, the deep residual network is a pre-trained ResNet-50 network. The semantic hash label is a 128-bit binary code obtained by hashing the 2048-dimensional semantic features extracted by the ResNet-50 network. The XOR operation refers to performing a bitwise logical XOR operation to fuse low-level perceptual features with high-level semantic information.

[0123] Specifically, semantic feature extraction uses a pre-trained ResNet-50 to extract 2048-dimensional features from the image, reduces the dimensionality to 128-dimensional using PCA, and then binarizes the data to obtain semantic hash labels. The binary hash generated in step S504 is then XORed bit by bit with the semantic hash to obtain composite hash features.

[0124] S506: Weighted composite hash features are applied through an attention mechanism, and the weights of the joint feature vectors are dynamically adjusted by color and texture complexity.

[0125] In this embodiment, the weights of the joint feature vector are dynamic weights, which are feature channel weights adjusted in real time based on color complexity (CI) and texture complexity (TI). The feature channel weights are normalized using the Softmax normalization method, mapping the weight values ​​to the [0, 1] interval and normalizing them.

[0126] Specifically, the formula for calculating color complexity (CI) is: CI = , The standard deviation of the color feature. This represents the mean of color features, reflecting the central trend of color distribution. For example, it's the RGB three-channel mean of a color moment; a larger value indicates a brighter overall color. The formula for calculating texture complexity is: , W represents the length of the LBP texture histogram, W and H represent the histogram width and height, respectively, and W×H represents the image area. The initial weights include color feature weights. Texture complexity feature weights and DCT low-frequency feature weights For example, the initial weights are set to 0.4, 0.3, and 0.3 respectively.

[0127] In this embodiment, the weights of the joint feature vector are dynamically adjusted by color and texture complexity, and the dynamic adjustment formula is as follows: The weighted sum of each characteristic channel of the composite hash is performed, and the final hash value is... .

[0128] In one embodiment, such as Figure 2 As shown, similar image search methods based on perceptual hashing also include:

[0129] S10: Obtain the hash strings of the image to be retrieved and the candidate images. The hash strings contain hashed representations of color moments, LBP texture, and DCT low-frequency features; parse the multimodal features from the hash strings.

[0130] Specifically, the hash string is a 128-bit binary code composed of color moments (48 bits), LBP texture (64 bits), and DCT low-frequency features (16 bits); multimodal feature parsing refers to the reverse decoding of the original multimodal feature parameters from the hash string.

[0131] The hash segmentation decoding method is used: the 128-bit hash string is divided into a color matrix segment (bits 1-48) + an LBP texture segment (bits 49-112) + a DCT low-frequency segment (bits 113-128). The color matrix segment (bits 1-48) refers to the mean (16 bits / channel) + variance (16 bits / channel) + skewness (8 bits / channel) of the RGB three channels. The LBP texture segment (bits 49-112) refers to the 64-dimensional binary histogram. The DCT low-frequency segment (bits 113-128) refers to the 16-bit binary code.

[0132] Each feature is dequantized: for example, binary is converted to decimal, and the mean, variance, and skewness are calculated; for the LBP texture segment, the percentage of 1s in the binary histogram is counted; for the DCT low-frequency segment, 64 low-frequency coefficients are restored by looking up a table.

[0133] S20: Using the image to be retrieved and each candidate image as the basic processing unit, extract their respective multimodal image features, and calculate the initial image similarity score based on the multimodal image features.

[0134] In this embodiment, the following operations are performed on the image to be retrieved and the candidate images respectively:

[0135] Input ResNet-50 to extract 2048-dimensional features to obtain deep semantic features; LBP texture features are obtained by calculating the uniform pattern LBP histogram of an 8×8 window; color features are obtained by extracting the mean, variance and skewness of the RGB three channels.

[0136] In this embodiment, the image to be retrieved and each candidate image are used as basic processing units to extract their respective multimodal image features. An initial image similarity score is calculated based on these multimodal image features, including:

[0137] S201: A convolutional neural network is used to extract the deep semantic features of the image, a local binary mode is used to extract the texture features of the image, and the color moment method is used to extract the color features of the image.

[0138] In this embodiment, the multimodal features also include deep semantic features; the deep semantic features are extracted by adjusting the input image size to 224×224 pixels while keeping the aspect ratio unchanged, using a pre-trained ResNet-50 model to extract features, truncating the output of the global average pooling layer, the 2048-dimensional feature vector, and then normalizing it to a unit vector using the L2 norm to obtain the deep semantic features.

[0139] Texture features are obtained by using the uniform mode LBP operator, employing an 8-neighborhood and a 1-bit contrast threshold, calculating the LBP code of an 8×8 non-overlapping window, statistically analyzing a 59-dimensional histogram, and then performing L1 normalization on the histogram, with the sum being 1, to obtain the LBP texture feature vector.

[0140] Color matrix feature extraction requires converting the image to the HSV color space, calculating the first moment (mean), second moment (variance), and third moment (skewness) of each channel, and then concatenating them into a 48-dimensional feature vector to obtain the color matrix feature vector.

[0141] S202: Using each image to be retrieved and candidate image as a basic processing unit, calculate the Euclidean distance similarity between deep semantic features, the Hamming distance similarity between texture features, and the similarity between color features to obtain the sub-similarity score for each modality.

[0142] S203: Normalize the sub-similarity scores to obtain the initial image similarity score.

[0143] Specifically, the initial image similarity score includes semantic similarity score, texture similarity score, and color similarity score. The semantic similarity score is obtained by calculating the Euclidean distance between deep features, normalizing the mapped similarity value, and mapping it to the [0, 1] interval. The texture similarity score is obtained by calculating the Hamming distance between LBP histograms, normalizing the mapped similarity value, and mapping it to the [0, 1] interval. The color similarity score is obtained by calculating the cosine similarity of the three color elements, normalizing the mapped similarity value, and mapping it to the [0, 1] interval. The formula for mapping the three similarity values ​​to the [0, 1] interval is as follows: Where s is the original score, To find the global minimum of the similarity score, if the Hamming distance of the LBP texture is used, Possibly 0 (complete match); To find the global maximum similarity score, if the Euclidean distance of the color moments is used... It could be the maximum possible difference between the mean values ​​of each color channel. During calculation, the output range of the color similarity calculation is [-1, 1], which is mapped to 0, 1 using the sigmoid function.

[0144] For example, the formula for calculating semantic similarity score is: Where f is a 2048-dimensional feature vector, and d=2048 is the feature dimension. and These represent the deep semantic feature vectors of the image to be retrieved (query image) and the candidate image, respectively. The formula for calculating texture similarity is: Where H is 59, it is the LBP histogram, and L=59. and Here are the LBP texture histograms of the image to be retrieved and the candidate images. The color similarity score is... Where C is the normalized statistic for the mean, variance, and skewness of the three color elements. and Let represent the color feature vectors of the image to be retrieved and the candidate image, respectively.

[0145] S30: According to the preset first weighting strategy, the sub-similarity scores corresponding to the multimodal features are weighted and fused to obtain the fused similarity score.

[0146] In this embodiment, the first weighting strategy includes an initial weight preset based on historical search click-through rates, and the gradient descent method is a machine learning algorithm that optimizes the weights through a loss function.

[0147] For example, color feature weights Texture complexity feature weights and DCT low-frequency feature weights Let's set the values ​​to 0.4, 0.3, and 0.3 respectively. The cross-entropy loss function in gradient descent is:

[0148] in, Click on the tags for the user (1 = relevant, 0 = irrelevant). To predict similarity, the Adam optimizer is used to iteratively update the weights during weight optimization, with a learning rate set to 0.001 and the following constraints: .

[0149] Specifically, the weighted fusion formula is as follows:

[0150] .

[0151] S40: Optimize the preset similarity scoring model based on the fusion of similarity scores and user feedback information, and output the final image similarity score result.

[0152] In this embodiment, user feedback information includes multi-dimensional signals such as click behavior, dwell time (>3 seconds + 0.5 points, >10 seconds + 1 point), and explicit rating (1-5 stars mapped to 1-5 points). The preset similarity rating model is a dynamic feedback optimization model, employing a linear weighted feedback model, with the formula as follows: ,in The feedback correction term is calculated using the following formula: Where C is the click correction value, 0 or +1, and +1 if the user clicks; T is the duration correction value, 0, 0.5 or 1, which is graded according to the dwell time; C is the rating correction value, 1-5 stars directly mapped to a 1-5 point system. For example, the corresponding weights are 0.4, 0.3, and 0.3 respectively.

[0153] In one embodiment, in step S30, the sub-similarity scores corresponding to the multimodal features are weighted and fused according to a preset first weighting strategy to obtain a fused similarity score, including:

[0154] S301: Set the initial weight coefficients for the deep semantic features, texture features, and color features.

[0155] In this embodiment, the initial weight coefficient is based on the feature contribution weight preset from historical retrieval data, and the specific value can be customized as needed. The sum of the weight values ​​of deep semantic features, texture features, and color features is 1.

[0156] S302: Train a weight optimization model using historical user click data, and adjust the weight coefficients of each feature mode using gradient descent.

[0157] In this embodiment, historical user click data includes click behavior, dwell time, and explicit ratings.

[0158] Specifically, the weight optimization model adopts a linear weighted feedback model: The optimization objective is to minimize the difference between the predicted similarity and the user feedback. ,in For sample index, The number of samples; For the true scores of the sample, To predict similarity scores.

[0159] S303: The normalized sub-similarity scores are weighted and summed with the adjusted weight coefficients to obtain the fusion similarity score.

[0160] For example, the dynamic adjustment of weighting coefficients can also be combined with confidence weights. calculate: The final weights are: ,in Let be the global average weight. Then the dynamically adjusted weighted fusion formula is:

[0161] ,in To integrate similarity scores, These are the dynamically adjusted equal weighting coefficients.

[0162] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0163] In one embodiment, a similar image search system based on perceptual hashing is provided, which corresponds to the similar image search method based on perceptual hashing in the above embodiments.

[0164] The perceptual hash-based similar image search system includes a multi-scale spatial construction module, a keypoint detection module, a target screenshot extraction module, a multi-modal feature extraction and fusion module, a hash encoding module, and a similar image retrieval module. Detailed descriptions of each functional module are as follows:

[0165] The multi-scale space construction module is used to construct a multi-scale space for the input initial image, and generate a Gaussian pyramid through Gaussian convolution operation, and obtain a Gaussian difference pyramid based on the Gaussian pyramid;

[0166] The key point detection module is used to screen stable key points in the difference of Gaussian pyramid;

[0167] The target screenshot extraction module is used to delineate the densest region in the initial image and extract the smallest bounding rectangle as the target screenshot image based on the distribution density of the selected stable key points.

[0168] The multimodal feature extraction and fusion module is used to extract multimodal features from the initial image, concatenate the multimodal features, and generate a joint feature vector.

[0169] The hash encoding module is used to preprocess the initial image and the target screenshot image respectively; and to generate the corresponding hash string based on the preprocessed image and the joint feature vector.

[0170] The similar image retrieval module compares the hash string of the image to be retrieved with the hash set in the database, and outputs images with a Hamming distance less than or equal to a preset threshold as similar results.

[0171] For specific limitations regarding the perceptual hash-based similar image search system, please refer to the limitations of the perceptual hash-based similar image search method above, which will not be repeated here. Each module in the above-mentioned perceptual hash-based similar image search system can be implemented entirely or partially through software, hardware, or a combination thereof. Each module can be embedded in the processor of the computer device in hardware form or independent of it, or it can be stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of each module.

[0172] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 3 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and the database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores stable key points, target screenshots, and joint feature vectors, etc. The network interface is used for communication with external terminals via a network connection. When executed by the processor, the computer program implements a perceptual hash-based similar image search method.

[0173] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps:

[0174] S1: Construct a multi-scale space for the initial input image, generate a Gaussian pyramid through Gaussian convolution, and obtain a Gaussian difference pyramid based on the Gaussian pyramid;

[0175] S2: Select stable key points in the difference of Gaussian pyramid;

[0176] S3: Based on the distribution density of the selected stable key points, delineate the densest region in the initial image and extract the smallest bounding rectangle as the target screenshot image;

[0177] S4: Extract multimodal features from the initial image, concatenate the multimodal features, and generate a joint feature vector;

[0178] S5: Preprocess the initial image and the target screenshot image respectively; generate the corresponding hash string based on the preprocessed image and the joint feature vector;

[0179] S6: Compare the hash string of the image to be retrieved with the hash set in the database, and output images with a Hamming distance less than or equal to a preset threshold as similar results.

[0180] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0181] S1: Construct a multi-scale space for the initial input image, generate a Gaussian pyramid through Gaussian convolution, and obtain a Gaussian difference pyramid based on the Gaussian pyramid;

[0182] S2: Select stable key points in the difference of Gaussian pyramid;

[0183] S3: Based on the distribution density of the selected stable key points, delineate the densest region in the initial image and extract the smallest bounding rectangle as the target screenshot image;

[0184] S4: Extract multimodal features from the initial image, concatenate the multimodal features, and generate a joint feature vector;

[0185] S5: Preprocess the initial image and the target screenshot image respectively; generate the corresponding hash string based on the preprocessed image and the joint feature vector;

[0186] S6: Compare the hash string of the image to be retrieved with the hash set in the database, and output images with a Hamming distance less than or equal to a preset threshold as similar results.

[0187] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0188] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0189] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A similar image search method based on perceptual hashing, characterized in that, include: A multi-scale space is constructed from the input initial image, and a Gaussian pyramid is generated through Gaussian convolution operation. A Gaussian difference pyramid is then obtained based on the Gaussian pyramid. Stable key points are selected from the difference of Gaussians pyramid. Based on the selected stable key point distribution density, the densest region is delineated in the initial image and the smallest bounding rectangle is cropped as the target screenshot image. Extract the multimodal features from the initial image, and concatenate the multimodal features to generate a joint feature vector; The initial image and the target screenshot image are preprocessed respectively; Generate a corresponding hash string based on the preprocessed image and the joint feature vector; The hash string of the image to be retrieved is compared with the hash set in the database, and images with a Hamming distance less than or equal to a preset threshold are output as similar results. The generation of the corresponding hash string based on the preprocessed image and the joint feature vector includes: The joint feature vector is concatenated with the preprocessed image at the channel level to form a multi-channel input. A two-dimensional discrete cosine transform is performed on the spliced ​​multi-channel input, and the first K largest amplitude coefficients are retained to form a low-frequency feature matrix. Calculate the mean and standard deviation of the low-frequency feature matrix, and generate a dynamic threshold by combining the global statistics of the joint feature vector; based on the dynamic threshold, perform threshold binarization on the K largest amplitude coefficients to generate a binary hash sequence; Run-length encoding is performed on the binary hash sequence and the joint feature vector, and consecutive identical elements are merged into triples to compress the hash string length; The binary hash sequence is XORed with the semantic hash label extracted by the deep residual network to generate a composite hash feature; the semantic hash label is generated based on the high-level semantic features of the image. The weights of the joint feature vector are dynamically adjusted by color and texture complexity through an attention mechanism that weights the composite hash features.

2. The similar image search method based on perceptual hashing according to claim 1, characterized in that, The process of selecting stable key points in the Gaussian difference pyramid includes: The Hessian matrix is ​​calculated for each layer of the Gaussian difference pyramid image, and local extrema are detected by second derivative as candidate key points. A non-maximum suppression algorithm is used to correct the position of candidate key points in three-dimensional scale space and retain the extreme point with the largest response value. Calculate the principal curvature ratio of the candidate key points, eliminate edge response points whose principal curvature ratio is greater than a preset ratio, and retain candidate key points whose response value is higher than the neighborhood mean 3σ as stable key points.

3. The similar image search method based on perceptual hashing according to claim 1, characterized in that, The preprocessing of the initial image and the target screenshot image includes: Adjust the image compression size based on the joint feature vector; A contrast-limited adaptive histogram equalization algorithm is used to enhance the contrast of the initial image and the target screenshot image at multiple scales. Multi-scale Retinex dehazing is performed on the compressed image to unify the image brightness benchmark.

4. The similar image search method based on perceptual hashing according to claim 1, characterized in that, The method also includes: Obtain hash strings of the image to be retrieved and candidate images, wherein the hash strings contain hashed representations of color moments, LBP texture, and DCT low-frequency features; parse multimodal features from the hash strings; Using the image to be retrieved and each of the candidate images as basic processing units, extract their respective multimodal image features, and calculate the initial image similarity score based on the multimodal image features; The sub-similarity scores corresponding to the multimodal features are weighted and fused according to a preset first weighting strategy to obtain a fused similarity score; The preset similarity scoring model is optimized based on the fused similarity score and user feedback information, and the final image similarity score result is output.

5. The similar image search method based on perceptual hashing according to claim 4, characterized in that, The process of extracting multimodal image features from the image to be retrieved and each candidate image as a basic processing unit, and calculating an initial image similarity score based on the multimodal image features, includes: Convolutional neural networks are used to extract deep semantic features of images, local binary patterns are used to extract texture features of images, and color moments are used to extract color features of images. Using each image to be retrieved and candidate image as a basic processing unit, the Euclidean distance similarity between deep semantic features, the Hamming distance similarity between texture features, and the similarity between color features are calculated respectively to obtain the sub-similarity scores under each modality. The sub-similarity scores are normalized to obtain the initial image similarity score.

6. The similar image search method based on perceptual hashing according to claim 5, characterized in that, The step of weighting and fusing the sub-similarity scores corresponding to the multimodal features according to a preset first weighting strategy to obtain a fused similarity score includes: Set the initial weight coefficients for the deep semantic features, texture features, and color features; The weight optimization model is trained using historical user click data, and the weight coefficients of each feature mode are adjusted using gradient descent. The normalized sub-similarity scores are weighted and summed with the adjusted weight coefficients to obtain the fusion similarity score.

7. A similar image search system based on perceptual hashing, characterized in that, The system, applied to the perceptual hash-based similar image search method as described in any one of claims 1 to 6, comprises: The multi-scale space construction module is used to construct a multi-scale space for the input initial image, and generate a Gaussian pyramid through Gaussian convolution operation, and obtain a Gaussian difference pyramid based on the Gaussian pyramid; The key point detection module is used to screen stable key points in the difference of Gaussian pyramid; The target screenshot extraction module is used to delineate the densest region in the initial image and extract the smallest bounding rectangle as the target screenshot image based on the selected stable key point distribution density. The multimodal feature extraction and fusion module is used to extract multimodal features from the initial image, concatenate the multimodal features, and generate a joint feature vector. The hash encoding module is used to preprocess the initial image and the target screenshot image respectively; and generate a corresponding hash string based on the preprocessed image and the joint feature vector. The similar image retrieval module compares the hash string of the image to be retrieved with the hash set in the database, and outputs images with a Hamming distance less than or equal to a preset threshold as similar results. The generation of the corresponding hash string based on the preprocessed image and the joint feature vector includes: The joint feature vector is concatenated with the preprocessed image at the channel level to form a multi-channel input. A two-dimensional discrete cosine transform is performed on the spliced ​​multi-channel input, and the first K largest amplitude coefficients are retained to form a low-frequency feature matrix. Calculate the mean and standard deviation of the low-frequency feature matrix, and generate a dynamic threshold by combining the global statistics of the joint feature vector; based on the dynamic threshold, perform threshold binarization on the K largest amplitude coefficients to generate a binary hash sequence; Run-length encoding is performed on the binary hash sequence and the joint feature vector, and consecutive identical elements are merged into triples to compress the hash string length; The binary hash sequence is XORed with the semantic hash label extracted by the deep residual network to generate a composite hash feature; the semantic hash label is generated based on the high-level semantic features of the image. The weights of the joint feature vector are dynamically adjusted by color and texture complexity through an attention mechanism that weights the composite hash features.

8. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the perceptual hash-based similar image search method as described in any one of claims 1 to 6.

9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the perceptual hash-based similar image search method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method and device for searching similar image based on perceptual hash

    CN105956020A

  • Hash cross-modal information retrieval method based on dictionary pair learning

    CN111984800A