Image background similarity analysis method and device, computer equipment and storage medium

By combining a twin encoder and an edge-aware attention mechanism, the foreground region is suppressed and feature fusion is performed, which solves the accuracy problem of image background similarity analysis and achieves higher accuracy background similarity calculation.

CN121904408APending Publication Date: 2026-04-21PING AN TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
PING AN TECH (SHENZHEN) CO LTD
Filing Date
2026-01-14
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Existing image background similarity analysis methods are insufficient in terms of accuracy, cannot effectively reflect the global similarity of the background, and are sensitive to noise, changes in illumination, and geometric transformations.

Method used

A twin encoder is used for multi-scale feature extraction, and an edge-aware attention mechanism is used to suppress the foreground region. Background similarity calculation results are generated through feature fusion and a pre-trained model.

Benefits of technology

It improves the accuracy and robustness of image background similarity calculation, and can more comprehensively reflect the similarity and differences of the background, making it suitable for the analysis of complex image backgrounds.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121904408A_ABST
    Figure CN121904408A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of artificial intelligence, can be applied to business system platforms of medical health, financial science and technology and the like, and discloses an image background similarity analysis method and device, computer equipment and a storage medium, and the method comprises the steps: obtaining a first image and a second image which are input by a target user and are to be subjected to background similarity calculation; performing feature extraction on the first image and the second image by using a twin encoder to obtain a first image feature and a second image feature; respectively carrying out foreground region suppression on the first image feature and the second image feature based on an edge perception attention mechanism to obtain a first target image feature and a second target image feature; fusing the first target image feature and the second target image feature to generate a corresponding comprehensive feature representation; generating a background similarity calculation result of the first image and the second image by using a background similarity calculation model based on the comprehensive feature representation; therefore, the accuracy of image background similarity calculation can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, specifically to an image background similarity analysis method, apparatus, computer device, and computer-readable storage medium. Background Technology

[0002] Currently, image background similarity analysis is a crucial task in image processing and computer vision. It helps us understand image content and identify background information, thus supporting various applications. For example, in image retrieval, comparing the similarity of image backgrounds can quickly find images with backgrounds similar to the target image; in video analysis, background similarity analysis can be used to detect background changes in videos, enabling functions such as target tracking and anomaly detection.

[0003] However, traditional image background similarity analysis methods have some limitations. First, these methods often only extract local features of the image, ignoring overall background information. This results in inaccurate reflection of global background similarity when comparing background similarity. Second, traditional methods are typically based on simple pixel-level comparisons or feature vector distance metrics, which are sensitive to image noise, lighting variations, and geometric transformations. Therefore, in practical applications, the accuracy of these methods often falls short of current needs.

[0004] In the healthcare field, image background similarity analysis has important applications in medical image processing. For example, in pathological image analysis, comparing the similarity of background tissue structures in different pathological sections can help doctors quickly identify the differences between lesion areas and normal tissues, aiding in pathological diagnosis. In radiological imaging (such as X-rays, CT scans, and MRI), background similarity analysis can be used to detect contrast changes between lesion sites and surrounding normal tissues, thereby enabling early detection and diagnosis of lesions. Furthermore, in medical image registration and fusion, background similarity analysis can help accurately align medical images from different time points or different modalities, providing more comprehensive information support for clinical diagnosis and treatment.

[0005] In the fintech field, image background similarity analysis plays a crucial role in identity verification and anti-fraud technologies. For example, in facial recognition systems, analyzing the background similarity of facial images can detect background tampering or composite images, thereby improving the security of identity verification. In financial document processing, background similarity analysis can be used to detect abnormal backgrounds in document images, preventing forged or tampered documents from being used for fraudulent transactions. Furthermore, in financial surveillance systems, background similarity analysis can be used to monitor abnormal background changes in surveillance videos in real time, promptly identifying potential security threats and fraudulent activities.

[0006] However, current image background similarity analysis methods still fall short in terms of accuracy in calculating image background similarity, whether in the fields of healthcare, fintech, or other applications.

[0007] Therefore, how to provide an image background similarity analysis method, apparatus, computer device, and computer-readable storage medium that can effectively improve the accuracy of image background similarity calculation is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0008] In view of the shortcomings of the prior art, the purpose of this invention is to provide an image background similarity analysis method, apparatus, computer device and computer-readable storage medium, aiming to solve the problem of how to effectively improve the accuracy of image background similarity calculation.

[0009] To achieve the above objectives, the present invention adopts the following technical solution: In a first aspect, the present invention provides an image background similarity analysis method, comprising: Obtain the first and second images input by the target user for background similarity calculation; Using a twin encoder, features are extracted from the first image and the second image respectively to obtain the features of the first image and the features of the second image; Based on the edge-aware attention mechanism, foreground region suppression is performed on the first image features and the second image features respectively to obtain the first target image features and the second target image features; By fusing the features of the first target image and the features of the second target image, a corresponding comprehensive feature representation is generated; Based on the comprehensive feature representation, the background similarity calculation results of the first image and the second image are generated using the background similarity calculation model.

[0010] Secondly, the present invention provides an image background similarity analysis device, comprising: The image acquisition module is used to acquire the first and second images input by the target user for background similarity calculation. The feature extraction module is used to extract features from the first image and the second image respectively using a twin encoder to obtain the first image features and the second image features; The region suppression module is used to perform foreground region suppression on the first image features and the second image features based on the edge-aware attention mechanism, respectively, to obtain the first target image features and the second target image features; The feature fusion module is used to fuse the features of the first target image and the features of the second target image to generate a corresponding comprehensive feature representation; The result generation module is used to generate background similarity calculation results between the first image and the second image based on the comprehensive feature representation and using the background similarity calculation model.

[0011] Thirdly, the present invention provides a computer device, 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 implement the image background similarity analysis method as described above.

[0012] Fourthly, the present invention provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the image background similarity analysis method as described above.

[0013] Compared to existing technologies, this invention provides an image background similarity analysis method, apparatus, computer device, and computer-readable storage medium. The method involves acquiring a first image and a second image input by a target user for background similarity calculation; using a twin encoder, extracting features from the first and second images respectively to obtain first image features and second image features; applying edge-aware attention mechanism to the first and second image features for foreground region suppression to obtain first target image features and second target image features; fusing the first and second target image features to generate a corresponding comprehensive feature representation; and using a background similarity calculation model based on the comprehensive feature representation to generate the background similarity calculation results for the first and second images. Therefore, this invention effectively improves the accuracy of image background similarity calculation. Attached Figure Description

[0014] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0015] Figure 1 This is a schematic diagram illustrating the application environment of an image background similarity analysis method provided in an embodiment of the present invention.

[0016] Figure 2 This is a flowchart illustrating an image background similarity analysis method according to an embodiment of the present invention.

[0017] Figure 3 This is a schematic diagram of the program modules of an image background similarity analysis device provided in an embodiment of the present invention.

[0018] Figure 4 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention.

[0019] Figure 5 This is another structural schematic diagram of a computer device provided in an embodiment of the present invention. Detailed Implementation

[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0021] It should be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.

[0022] It should also be understood that the term “and / or” as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0023] As used in this specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if [the described condition or event] is detected" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once [the described condition or event] is detected," or "in response to detection of [the described condition or event]."

[0024] Furthermore, in the description of this invention and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0025] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of the invention include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0026] It should be understood that the sequence number of each step in the following 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 the present invention.

[0027] To illustrate the technical solution of the present invention, specific embodiments are described below.

[0028] An embodiment of the present invention provides an image background similarity analysis method, which can be applied to, for example... Figure 1 In the application environment shown, the client and server communicate via a network. The client includes, but is not limited to, handheld computers, desktop computers, laptops, ultra-mobile personal computers (UMPCs), netbooks, cloud computing devices, and personal digital assistants (PDAs). The server can be a standalone server or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.

[0029] Please see Figure 2 An embodiment of the present invention provides an image background similarity analysis method, wherein the method includes the following steps: S100: Obtain the first and second images input by the target user for background similarity calculation; S200. Using a twin encoder, feature extraction is performed on the first image and the second image respectively to obtain the first image features and the second image features; S300. Based on the edge-aware attention mechanism, foreground region suppression is performed on the first image features and the second image features respectively to obtain the first target image features and the second target image features. S400: Fuse the features of the first target image and the features of the second target image to generate a corresponding comprehensive feature representation; S500. Based on the comprehensive feature representation, the background similarity calculation results of the first image and the second image are generated using the background similarity calculation model.

[0030] In practical implementation, the image background similarity analysis method of this embodiment can effectively improve the accuracy of image background similarity calculation through a series of innovative steps and technical features, mainly reflected in the following aspects: 1. Multi-scale feature extraction In step S200, a twin encoder is used to extract features from the first and second images respectively, obtaining multi-scale image features. The twin encoder can process two images simultaneously and extract their multi-scale features, which not only preserves the local details of the images but also captures the overall structural information of the background. The extraction of multi-scale features allows the background similarity calculation to comprehensively consider background features at different scales, thus reflecting the similarity of the background more comprehensively.

[0031] 2. Foreground region suppression In step S300, foreground region suppression is performed on the extracted image features based on an edge-aware attention mechanism. The edge-aware attention mechanism can identify edge information in the image and generate an attention mask accordingly. By applying the attention mask to the image features, foreground features are effectively suppressed, while background features are highlighted. This process reduces the interference of foreground information on background similarity calculation, allowing the similarity calculation to focus more on the background region.

[0032] 3. Feature Fusion and Optimization In step S400, the features of the first target image after foreground region suppression and the features of the second target image are fused to generate a comprehensive feature representation. This feature fusion process not only integrates the background features of the two images but also further improves the quality of the features through optimization techniques (such as feature normalization and dimensionality reduction). The comprehensive feature representation can more accurately reflect the similarity and differences of the backgrounds of the two images, providing high-quality input for subsequent similarity calculations.

[0033] 4. Application of pre-trained models In step S500, the comprehensive feature representation is processed using a pre-trained background similarity calculation model to generate background similarity calculation results. The pre-trained model, trained on a large-scale image dataset, learns the complex relationships between background features. This model can automatically identify the similarities and differences between background features and output accurate similarity scores. The application of the pre-trained model further improves the accuracy and robustness of background similarity calculation.

[0034] Therefore, through the synergistic effect of the above steps, this method can effectively improve the accuracy of image background similarity calculation. Multi-scale feature extraction ensures the comprehensiveness of background features, foreground region suppression reduces the interference of the foreground on background similarity calculation, feature fusion and optimization improve the quality of features, and the application of pre-trained models further improves the accuracy and robustness of similarity calculation. The combination of these technical features makes this method perform excellently when processing complex image backgrounds, and can meet the high-precision requirements of background similarity calculation in various practical application scenarios.

[0035] Understandably, the image background similarity analysis method provided in this embodiment of the invention can be applied to image background similarity analysis scenarios related to the medical and health field. The following is a specific example: In the medical and health field, the image background similarity analysis method of this invention can be applied to the auxiliary diagnosis of medical images. For example, in pathological image analysis, doctors need to compare the background tissue structures of different pathological slides to identify the differences between lesion areas and normal tissues. Using the method of this invention, firstly, two pathological slide images (a first image and a second image) input by the target user are acquired. Multi-scale features of these two images are extracted using a twin encoder, and then foreground regions (such as cell nuclei) are suppressed based on an edge-aware attention mechanism to highlight the features of the background tissue structures. Next, the background features of the two images are fused to generate a comprehensive feature representation. Finally, a pre-trained background similarity calculation model is used to calculate the similarity of the backgrounds of the two pathological slide images. If the similarity is low, it may indicate the presence of lesion areas, allowing doctors to further examine these areas, thereby improving the accuracy and efficiency of diagnosis.

[0036] Understandably, the image background similarity analysis method provided in this embodiment of the invention can also be applied to image background similarity analysis scenarios related to the fintech field. The following is a specific example: In the fintech field, the image background similarity analysis method of this invention can be applied to identity verification and anti-fraud detection of financial documents. For example, during the verification process of a customer's submitted ID card photo, financial institutions need to ensure that the submitted ID card photo and the standard ID card template stored in the system have a high degree of similarity in background to prevent forgery or tampering. Using the method of this invention, the first step is to obtain the ID card photo (first image) input by the target user and the standard ID card template (second image). Multi-scale features of these two images are extracted using a twin encoder, and then foreground regions (such as text and patterns on the ID card) are suppressed based on an edge-aware attention mechanism to highlight background features. Next, the background features of the two images are fused to generate a comprehensive feature representation. Finally, a pre-trained background similarity calculation model is used to calculate the similarity of the backgrounds of the two images. If the similarity is lower than a set threshold, the system will issue an alert, indicating potential fraudulent activity, thereby improving the security of financial transactions.

[0037] Furthermore, in one embodiment, the image background similarity analysis method, wherein obtaining the first image and the second image input by the target user for background similarity calculation specifically includes the following steps: The client receives the first and second raw images input by the target user. The first and second original images are preprocessed by denoising, contrast enhancement and size normalization. Using image registration technology, feature calibration processing is performed on the preprocessed first original image and the second original image to obtain the first image and the second image to be used for background similarity calculation.

[0038] Furthermore, the image background similarity analysis method, wherein the step of using image registration technology to perform feature calibration processing on the preprocessed first original image and the second original image to obtain the first image and the second image to be used for background similarity calculation, specifically includes the following steps: Feature points in the preprocessed first and second original images are detected using a feature extraction algorithm. Calculate the matching relationship between feature points of the preprocessed first original image and the second original image, and generate a matching result; Based on the matching result, an affine transformation is performed to spatially align the preprocessed first original image and the second original image, resulting in a first image and a second image for background similarity calculation.

[0039] In practice, the specific implementation process of this embodiment is roughly as follows: Step 1: The client receives the original image. The system receives a first and a second original image uploaded by the target user via client software (such as a mobile app or web page). Users can input images into the system (the image background similarity analysis system corresponding to the method of this invention) by taking photos, uploading local images, or other means.

[0040] Step 2: Image Preprocessing 1. Denoising Processing: A deep learning-based denoising algorithm (such as DnCNN) is used to denoise the first and second original images. This algorithm can effectively remove random noise from the images while preserving their detailed information.

[0041] 2. Contrast Enhancement: Adaptive Histogram Equalization (CLAHE) is used to enhance the contrast of the denoised image. This method improves the brightness distribution of the image, making the details clearer.

[0042] 3. Size Normalization: Adjust the contrast-enhanced image to a uniform resolution (e.g., 256×256 pixels) for subsequent processing. This step ensures the consistency of the input image size.

[0043] Step 3: Feature Point Detection Feature extraction algorithms (such as SIFT, ORB, or SURF) are used to detect feature points in the preprocessed first and second original images. These algorithms can automatically identify key points in the image, such as corner points and edge points, and extract their feature descriptors.

[0044] Step 4: Feature Point Matching Calculate the matching relationship between feature points in the preprocessed first and second original images. Use a feature matching algorithm (such as FLANN or BFMatcher) to find similar feature point pairs in the two images and generate matching results. This step determines the spatial correspondence between the two images.

[0045] Step 5: Image Alignment Affine transformation is performed based on the feature point matching results. By calculating the geometric transformation relationship (such as translation, rotation, and scaling) between the matched feature point pairs, the first and second original images are spatially aligned using an affine transformation matrix. The resulting aligned images are the first and second images for which background similarity calculation is performed.

[0046] The above steps realize the complete process from image acquisition to feature calibration, providing a high-quality input image for subsequent background similarity calculation.

[0047] Furthermore, in one embodiment, the image background similarity analysis method, wherein the step of using a twin encoder to extract features from the first image and the second image respectively to obtain first image features and second image features specifically includes the following steps: Load the pre-trained twin encoder; The first image and the second image are respectively input into the two branches of the twin encoder for multi-scale feature extraction to obtain the first original image features and the second original image features; The extracted first and second original image features are subjected to feature dimensionality reduction and feature enhancement processing to obtain the first image features and the second image features.

[0048] In practice, the specific implementation process of this embodiment is roughly as follows: Step 1: Load the Siamese encoder model Load a pre-trained Siamese encoder model from a storage device or network. Siamese encoders are typically based on deep convolutional neural network architectures such as ResNet, VGG, or Inception. These models are pre-trained on large-scale image datasets and are capable of extracting rich image features.

[0049] Step 2: Input image to twin encoder The preprocessed first and second images are input into the two branches of the twin encoder, respectively. Each branch processes one image independently to ensure consistency in the feature extraction process.

[0050] Each branch of the Siamese encoder contains multiple convolutional layers, pooling layers, and activation functions. Through the combination of these layers, the model is able to extract multi-scale features of the image.

[0051] Step 3: Multi-scale feature extraction In the twin encoder, multi-scale features of the first and second images are extracted through multi-scale convolutional kernels and a feature pyramid structure. These features can capture local details and global structural information in the images.

[0052] Step 4: Feature Dimensionality Reduction The extracted first and second original image features are subjected to feature dimensionality reduction processing. Principal component analysis (PCA) or autoencoders are used to remove redundant information and improve feature compactness.

[0053] Step 5: Feature Enhancement Enhancement processing is applied to the dimensionality-reduced features. Attention mechanisms or feature fusion techniques are used to enhance the representation of key features. For example, attention mechanisms can be used to weight features of the background region to further highlight background information.

[0054] The above steps complete the entire process from loading the Siamese encoder to feature extraction, dimensionality reduction, and enhancement. These steps ensure that the extracted image features are of high quality, providing a solid foundation for subsequent background similarity calculations.

[0055] Furthermore, in one embodiment, the image background similarity analysis method, wherein the foreground region suppression based on the edge-aware attention mechanism is applied to the first image features and the second image features respectively to obtain the first target image features and the second target image features, specifically includes the following steps: Based on the edge-aware attention mechanism, a first attention mask and a second attention mask corresponding to the first image feature and the second image feature are generated respectively; The first attention mask is applied to the first image feature, and the features of its foreground region are suppressed by a weighting operation to obtain the first target image feature; The second attention mask is applied to the second image feature, and the features of its foreground region are suppressed by weighting operations to obtain the second target image feature.

[0056] In practice, the specific implementation process of this embodiment is roughly as follows: Step 1: Edge Detection Edge detection is performed on the first and second image features respectively. Classical edge detection algorithms (such as Canny edge detection) or deep learning-based edge detection networks can be used. The purpose of edge detection is to extract obvious edge information in the image, which usually corresponds to the contours of foreground objects.

[0057] Step 2: Attention Mask Generation Based on the edge detection results, a first attention mask and a second attention mask are generated using an edge-aware attention mechanism. The attention mechanism dynamically allocates attention weights by learning the relationship between feature maps and edge information.

[0058] Step 3: Apply attention mask The generated first attention mask is applied to the first image feature, and the second attention mask is applied to the second image feature. Features in the foreground region are suppressed through a weighted operation.

[0059] The specific operation involves multiplying the attention mask element-wise with the feature map. For example, if the attention mask's value range is [0,1], then the foreground region has a lower weight (closer to 0), and the background region has a higher weight (closer to 1). In this way, the features of the foreground region are suppressed, while the features of the background region are preserved.

[0060] Step 4: Obtain the features of the first target image After weighting, the foreground region in the first image feature is suppressed, resulting in the first target image feature. The first target image feature focuses more on the background region.

[0061] Step 5: Obtain the features of the second target image Similarly, after weighting, the foreground region in the second image feature is suppressed, resulting in the second target image feature. The second target image feature is also more focused on the background region.

[0062] Through the above steps, foreground region suppression based on the edge-aware attention mechanism is achieved. These steps ensure that the features of the foreground region are effectively suppressed and the features of the background region are highlighted, thus providing a high-quality foundation for subsequent background similarity calculation.

[0063] Furthermore, in one embodiment, the image background similarity analysis method, wherein fusing the features of the first target image and the features of the second target image to generate a corresponding comprehensive feature representation specifically includes the following steps: Spatial alignment processing is performed on the first target image features and the second target image features; The spatially aligned features of the first and second target images are standardized. According to the preset feature fusion strategy, the standardized features of the first target image and the features of the second target image are fused to generate a corresponding comprehensive feature representation.

[0064] In practice, the specific implementation process of this embodiment is roughly as follows: Step 1: Spatial Alignment Spatial alignment is performed on the features of the first target image and the features of the second target image. This step ensures that the two feature maps are spatially consistent for subsequent fusion operations.

[0065] Step 2: Feature Standardization The spatially aligned features of the first and second target images are standardized. This step ensures that the two feature maps are consistent in numerical scale, improving the fusion effect.

[0066] Step 3: Select a fusion strategy According to a preset feature fusion strategy, the standardized features of the first target image and the features of the second target image are fused. Common fusion strategies include weighted averaging, feature concatenation, and feature fusion networks.

[0067] Step 4: Generate comprehensive feature representation Based on the selected feature fusion strategy, a comprehensive feature representation is generated. This comprehensive feature representation will then serve as input for subsequent background similarity calculations.

[0068] The above steps achieve a complete process from spatial alignment to feature standardization and then to feature fusion. These steps ensure the consistency of the features of the first and second target images in terms of spatial location and numerical scale, and generate a high-quality comprehensive feature representation through a preset feature fusion strategy. The comprehensive feature representation can more accurately reflect the similarity and differences between the backgrounds of the two images, providing a solid foundation for subsequent background similarity calculations.

[0069] Further, in one embodiment, the image background similarity analysis method, wherein generating the background similarity calculation results of the first image and the second image based on the comprehensive feature representation using a background similarity calculation model specifically includes the following steps: Load the pre-trained background similarity calculation model; The comprehensive feature representation is input into the background similarity calculation model to generate the background similarity calculation results of the first image and the second image; The background similarity calculation results are formatted according to the client's configuration information; The formatted background similarity calculation results are sent to the client and displayed to the target user according to a preset result display strategy.

[0070] In practice, the specific implementation process of this embodiment is roughly as follows: Step 1: Load the background similarity calculation model A pre-trained background similarity calculation model is loaded from a storage device or network. This model is typically a deep learning model, such as a convolutional neural network (CNN) or a Transformer architecture, specifically designed to calculate the similarity between an image's background.

[0071] Step 2: Input the comprehensive feature representation The comprehensive feature representation is input into a pre-trained background similarity calculation model. The model learns the similarities and differences between background features and outputs a similarity score, typically a value between 0 and 1. 1 represents complete similarity, and 0 represents complete dissimilarity.

[0072] Step 3: Formatting Based on the client's configuration information, the background similarity calculation results are formatted. This step ensures that the results are returned in a format supported by the client.

[0073] Step 4: Send and display the results The formatted background similarity calculation results are sent to the client and displayed to the target user according to the preset result display strategy.

[0074] The above steps complete the entire process from loading the pre-trained model to calculating background similarity, formatting the results, and sending and displaying them. These steps ensure that the background similarity calculation results are presented to the target user in a user-friendly manner.

[0075] As can be seen from the above method embodiments, the image background similarity analysis method provided by the present invention includes: acquiring a first image and a second image input by a target user for background similarity calculation; using a twin encoder to extract features from the first image and the second image respectively, obtaining first image features and second image features; based on an edge-aware attention mechanism, performing foreground region suppression on the first image features and the second image features respectively, obtaining first target image features and second target image features; fusing the first target image features and the second target image features to generate a corresponding comprehensive feature representation; and based on the comprehensive feature representation, using a background similarity calculation model to generate the background similarity calculation results of the first image and the second image. Thus, the method of the present invention can effectively improve the accuracy of image background similarity calculation.

[0076] It should be understood that although this application provides the method operation steps as described in the embodiments or flowcharts, conventional or non-inventive labor may include more or fewer operation steps, and these operation steps are not necessarily executed sequentially according to the order of the embodiments or flowcharts. The order of steps listed in the embodiments or flowcharts is merely one way of executing many steps and does not represent the only execution order. It should be noted that there is no necessary sequential order between the above steps. Those skilled in the art can understand from the description of the embodiments of the present invention that the above steps may have different execution orders in different embodiments, that is, they may be executed in parallel or in exchange, etc. Moreover, at least some steps in the embodiments or flowcharts may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but may be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but may be executed in turn, alternately, or synchronously with other steps or at least a part of the sub-steps or stages of other steps.

[0077] Based on the above method embodiments, please refer to Figure 3 Another embodiment of the present invention also provides an image background similarity analysis device, wherein the device includes: Image acquisition module 11 is used to acquire the first image and the second image to be used for background similarity calculation, which are input by the target user; Feature extraction module 12 is used to extract features from the first image and the second image respectively using a twin encoder to obtain first image features and second image features; The region suppression module 13 is used to perform foreground region suppression on the first image features and the second image features based on the edge-aware attention mechanism to obtain the first target image features and the second target image features. Feature fusion module 14 is used to fuse the features of the first target image and the features of the second target image to generate a corresponding comprehensive feature representation; The result generation module 15 is used to generate background similarity calculation results of the first image and the second image based on the comprehensive feature representation and using the background similarity calculation model.

[0078] Furthermore, in one embodiment, the image background similarity analysis device, wherein acquiring the first image and the second image input by the target user for background similarity calculation specifically includes: The client receives the first and second raw images input by the target user. The first and second original images are preprocessed by denoising, contrast enhancement and size normalization. Using image registration technology, feature calibration processing is performed on the preprocessed first original image and the second original image to obtain the first image and the second image to be used for background similarity calculation.

[0079] Furthermore, in the aforementioned image background similarity analysis device, the step of using image registration technology to perform feature calibration processing on the preprocessed first original image and the second original image to obtain a first image and a second image to be used for background similarity calculation specifically includes: Feature points in the preprocessed first and second original images are detected using a feature extraction algorithm. Calculate the matching relationship between feature points of the preprocessed first original image and the second original image, and generate a matching result; Based on the matching result, an affine transformation is performed to spatially align the preprocessed first original image and the second original image, resulting in a first image and a second image for background similarity calculation.

[0080] Further, in one embodiment, the image background similarity analysis device, wherein the step of using a twin encoder to extract features from the first image and the second image respectively to obtain first image features and second image features specifically includes: Load the pre-trained twin encoder; The first image and the second image are respectively input into the two branches of the twin encoder for multi-scale feature extraction to obtain the first original image features and the second original image features; The extracted first and second original image features are subjected to feature dimensionality reduction and feature enhancement processing to obtain the first image features and the second image features.

[0081] Further, in one embodiment, the image background similarity analysis device, wherein the foreground region suppression based on the edge-aware attention mechanism is applied to the first image features and the second image features respectively to obtain the first target image features and the second target image features, specifically includes: Based on the edge-aware attention mechanism, a first attention mask and a second attention mask corresponding to the first image feature and the second image feature are generated respectively; The first attention mask is applied to the first image feature, and the features of its foreground region are suppressed by a weighting operation to obtain the first target image feature; The second attention mask is applied to the second image feature, and the features of its foreground region are suppressed by weighting operations to obtain the second target image feature.

[0082] Furthermore, in one embodiment, the image background similarity analysis device, wherein fusing the first target image features and the second target image features to generate a corresponding comprehensive feature representation specifically includes: Spatial alignment processing is performed on the first target image features and the second target image features; The spatially aligned features of the first and second target images are standardized. According to the preset feature fusion strategy, the standardized features of the first target image and the features of the second target image are fused to generate a corresponding comprehensive feature representation.

[0083] Further, in one embodiment, the image background similarity analysis apparatus, wherein generating background similarity calculation results between the first image and the second image based on the comprehensive feature representation and using a background similarity calculation model specifically includes: Load the pre-trained background similarity calculation model; The comprehensive feature representation is input into the background similarity calculation model to generate the background similarity calculation results of the first image and the second image; The background similarity calculation results are formatted according to the client's configuration information; The formatted background similarity calculation results are sent to the client and displayed to the target user according to a preset result display strategy.

[0084] It should be noted that, in the device embodiments of the present invention, the information interaction and execution process between the above modules are based on the same concept as in the method embodiments of the present invention. For details on their specific functions and the resulting technical effects, please refer to the aforementioned method embodiments section, which will not be repeated here.

[0085] Based on the above method embodiments, another embodiment of the present invention also provides a computer device, which can be a server, and its internal structure diagram can be as follows. Figure 4 As shown. The computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements the functions or steps of the image background similarity analysis method server-side as described in any of the above method embodiments.

[0086] Based on the above method embodiments, another embodiment of the present invention also provides a computer device, which can be a client, and its internal structure diagram can be as follows. Figure 5 As shown, the computer device includes a processor, memory, network interface, display screen, and input device connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface is used to communicate with external terminals via a network connection. When executed by the processor, the computer program implements the functions or steps of the image background similarity analysis method on the client side as described in any of the above method embodiments.

[0087] Those skilled in the art will understand that Figure 4 and Figure 5 The structural schematic diagram shown is only a schematic diagram of a part of the structure related to the present invention and does not constitute a limitation on the computer device on which the present invention is applied. The specific computer device may include more components than shown in the figure, or combine certain components, or have different component arrangements.

[0088] The processor referred to herein can be a CPU, but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.

[0089] The memory includes readable storage media, internal memory, etc., where internal memory can be the RAM of a computer device. Internal memory provides an environment for the operation of the operating system and computer-readable instructions stored in the readable storage media. The readable storage media can be the hard drive of the computer device, or in other embodiments, it can be an external storage device of the computer device, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, the memory can include both internal storage units and external storage devices of the computer device. The memory is used to store the operating system, applications, bootloader, data, and other programs, such as program code for computer programs. The memory can also be used to temporarily store data that has been output or will be output.

[0090] Based on the above method embodiments, another embodiment of the present invention provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the image background similarity analysis method as described in any of the above method embodiments. The computer-readable storage medium may be non-volatile or volatile.

[0091] It should be noted that the functions or steps that can be achieved by the computer-readable storage medium or computer device, and the technical effects brought about by the functions / steps, can be referred to the relevant descriptions in the foregoing method embodiments. To avoid repetition, they will not be described one by one here.

[0092] 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, and when executed, it 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 can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various 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. The disclosed memory components or memories of the operating environment described herein are intended to include one or more of these and / or any other suitable types of memory.

[0093] Those skilled in the art will understand that, for the sake of convenience and brevity, the embodiments of the device of the present invention are only illustrated by the division of the above-mentioned functional units and modules. 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. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of the present invention. The specific working process of the units and modules in the above device can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here. If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.

[0094] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0095] In the embodiments provided by this invention, it should be understood that the disclosed apparatus / computer devices and methods can be implemented in other ways. For example, the apparatus / computer device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0096] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0097] It should be noted that if any software tools or components not belonging to this company appear in the embodiments of this application, they are merely illustrative examples and do not represent actual use. The above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention 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 technical features; and these 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 the present invention, and should all be included within the protection scope of the present invention.

Claims

1. An image background similarity analysis method, characterized in that, include: Obtain the first and second images input by the target user for background similarity calculation; Using a twin encoder, features are extracted from the first image and the second image respectively to obtain the features of the first image and the features of the second image; Based on the edge-aware attention mechanism, foreground region suppression is performed on the first image features and the second image features respectively to obtain the first target image features and the second target image features; By fusing the features of the first target image and the features of the second target image, a corresponding comprehensive feature representation is generated; Based on the comprehensive feature representation, the background similarity calculation results of the first image and the second image are generated using the background similarity calculation model.

2. The image background similarity analysis method according to claim 1, characterized in that, The process of obtaining the first and second images input by the target user for background similarity calculation includes: The client receives the first and second raw images input by the target user. The first and second original images are preprocessed by denoising, contrast enhancement and size normalization. Using image registration technology, feature calibration processing is performed on the preprocessed first original image and the second original image to obtain the first image and the second image to be used for background similarity calculation.

3. The image background similarity analysis method according to claim 2, characterized in that, The step of using image registration technology to perform feature calibration processing on the preprocessed first original image and the second original image to obtain a first image and a second image for background similarity calculation includes: Feature points in the preprocessed first and second original images are detected using a feature extraction algorithm. Calculate the matching relationship between feature points of the preprocessed first original image and the second original image, and generate a matching result; Based on the matching result, an affine transformation is performed to spatially align the preprocessed first original image and the second original image, resulting in a first image and a second image for background similarity calculation.

4. The image background similarity analysis method according to claim 1, characterized in that, The step of using a twin encoder to extract features from the first image and the second image respectively to obtain first image features and second image features includes: Load the pre-trained twin encoder; The first image and the second image are respectively input into the two branches of the twin encoder for multi-scale feature extraction to obtain the first original image features and the second original image features; The extracted first and second original image features are subjected to feature dimensionality reduction and feature enhancement processing to obtain the first image features and the second image features.

5. The image background similarity analysis method according to claim 1, characterized in that, The edge-aware attention mechanism performs foreground region suppression on the first image features and the second image features respectively to obtain the first target image features and the second target image features, including: Based on the edge-aware attention mechanism, a first attention mask and a second attention mask corresponding to the first image feature and the second image feature are generated respectively; The first attention mask is applied to the first image feature, and the features of its foreground region are suppressed by a weighting operation to obtain the first target image feature; The second attention mask is applied to the second image feature, and the features of its foreground region are suppressed by weighting operations to obtain the second target image feature.

6. The image background similarity analysis method according to claim 1, characterized in that, The process of fusing the features of the first target image and the features of the second target image to generate a corresponding comprehensive feature representation includes: Spatial alignment processing is performed on the first target image features and the second target image features; The spatially aligned features of the first and second target images are standardized. According to the preset feature fusion strategy, the standardized features of the first target image and the features of the second target image are fused to generate a corresponding comprehensive feature representation.

7. The image background similarity analysis method according to claim 1, characterized in that, The step of generating background similarity calculation results between the first image and the second image based on the comprehensive feature representation and using a background similarity calculation model includes: Load the pre-trained background similarity calculation model; The comprehensive feature representation is input into the background similarity calculation model to generate the background similarity calculation results of the first image and the second image; The background similarity calculation results are formatted according to the client's configuration information; The formatted background similarity calculation results are sent to the client and displayed to the target user according to a preset result display strategy.

8. An image background similarity analysis device, characterized in that, include: The image acquisition module is used to acquire the first and second images input by the target user for background similarity calculation. The feature extraction module is used to extract features from the first image and the second image respectively using a twin encoder to obtain the first image features and the second image features; The region suppression module is used to perform foreground region suppression on the first image features and the second image features based on the edge-aware attention mechanism, respectively, to obtain the first target image features and the second target image features; The feature fusion module is used to fuse the features of the first target image and the features of the second target image to generate a corresponding comprehensive feature representation; The result generation module is used to generate background similarity calculation results between the first image and the second image based on the comprehensive feature representation and using the background similarity calculation model.

9. 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 image background similarity analysis method as described in any one of claims 1-7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the image background similarity analysis method as described in any one of claims 1-7.