Image analysis method and device based on artificial intelligence, computer equipment and medium
By employing an AI-based image analysis method, utilizing multi-scale feature extraction networks and semantic segmentation techniques, accurate background similarity is generated. This solves the accuracy problem of traditional methods under varying lighting conditions and dynamic occlusion, thus improving the accuracy of image background similarity calculation.
Patent Information
- Application Number
- CN202610030551.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-09
- Publication Date
- 2026-05-01
AI Technical Summary
Traditional image background similarity calculation methods have low accuracy under varying lighting conditions and dynamic occlusion, making them difficult to adapt to complex indoor scenes. This can lead to target loss or interaction errors, affecting the practical application of video surveillance and augmented reality.
An AI-based image analysis method is adopted, which uses a multi-scale feature extraction network, semantic segmentation and attention generation processing, combined with a dynamic similarity calculation engine to generate background similarity between images. It comprehensively considers semantic segmentation, contextual information and prior knowledge to accurately focus on the background region.
It improves the accuracy of image background similarity calculation, effectively identifies background areas in complex indoor scenes, and enhances the application effects in fields such as video surveillance and augmented reality.
Smart Images

Figure CN121962729A_ABST
Abstract
Description
Image analysis methods, devices, computer equipment, and media based on artificial intelligence Technical Field
[0001] This application relates to the field of artificial intelligence technology and can be applied to fields such as fintech and digital healthcare, particularly to image analysis methods, devices, computer equipment, and storage media based on artificial intelligence. Background Technology
[0002] In dynamic indoor scenes, background similarity calculation is a core technology for applications such as video surveillance and augmented reality, and its accuracy directly affects the performance of tasks such as scene analysis and target tracking. Traditional methods mainly rely on static matching of color histograms or texture features, quantifying background similarity by statistically analyzing the color distribution of image pixels or local texture patterns. However, such methods are highly sensitive to changes in lighting and dynamic occlusion. For example, when there are sudden changes in lighting intensity (such as switching indoor lights on and off) or when dynamic objects (such as pedestrians or moving furniture) occlude the background area, color histograms may produce mismatches due to local brightness differences, and texture features may lose key information due to occlusion, thus significantly reducing the accuracy of image background similarity calculation. This limitation makes traditional methods difficult to adapt to complex scenes containing moving people, especially in scenes requiring long-term stable monitoring. Misjudgment of the background can easily lead to target loss or interaction errors, restricting the practical application of related technologies.
[0003] For example, in remote underwriting scenarios in the financial insurance sector, it is necessary to verify the authenticity of the business premises by comparing real-time images of the client's office environment with pre-stored templates. Traditional methods may misjudge background similarity due to changes in indoor lighting (such as a mixture of natural and artificial light) or temporary obstructions (such as employees moving and obscuring signs), leading to interruptions in the underwriting process or missed fraud risks. In remote patient monitoring scenarios in the digital healthcare sector, it is necessary to monitor fall risk by comparing images of the patient's home environment at different times. Traditional methods may misjudge background differences due to furniture movement (such as changes in chair position) or fluctuations in lighting (such as turning on lights at night), delaying warnings of abnormal events and affecting patient safety.
[0004] Therefore, there is an urgent need to provide an intelligent background similarity calculation method to improve the robustness of background analysis in complex indoor scenes and meet the practical application needs of video surveillance, augmented reality and other fields. Summary of the Invention
[0005] The purpose of this application is to propose an image analysis method, device, computer equipment, and storage medium based on artificial intelligence, so as to solve the technical problem that the existing image background similarity calculation methods used in indoor scenes have low accuracy.
[0006] In a first aspect, an image analysis method based on artificial intelligence is provided, comprising: receiving input first image and second image to be processed; performing feature extraction on the first image based on a preset multi-scale feature extraction network to obtain a corresponding first feature pyramid, and performing feature extraction on the second image to obtain a corresponding second feature pyramid; performing semantic segmentation on the first feature pyramid to obtain a corresponding first semantic probability map, and performing semantic segmentation on the second feature pyramid to obtain a corresponding second semantic probability map; performing attention generation processing on the first semantic probability map to obtain a corresponding first attention weight map, and performing attention generation processing on the second semantic probability map to obtain a corresponding second attention weight map; generating a corresponding first foreground exclusion confidence score based on the first semantic probability map, and generating a corresponding second foreground exclusion confidence score based on the second semantic probability map; performing similarity calculation processing on the first feature pyramid, the second feature pyramid, the first attention weight map, the second attention weight map, the first foreground exclusion confidence score, and the second foreground exclusion confidence score based on a preset dynamic similarity calculation engine to generate a background similarity between the first image and the second image.
[0007] Secondly, an image analysis device based on artificial intelligence is provided, comprising: a receiving module for receiving input first and second images to be processed; an extraction module for performing feature extraction on the first image based on a preset multi-scale feature extraction network to obtain a corresponding first feature pyramid, and performing feature extraction on the second image to obtain a corresponding second feature pyramid; a segmentation module for performing semantic segmentation on the first feature pyramid to obtain a corresponding first semantic probability map, and performing semantic segmentation on the second feature pyramid to obtain a corresponding second semantic probability map; a processing module for performing attention generation processing on the first semantic probability map to obtain a corresponding first attention weight map, and performing attention generation processing on the second semantic probability map to obtain a corresponding second attention weight map; a generation module for generating a corresponding first foreground exclusion confidence score based on the first semantic probability map, and generating a corresponding second foreground exclusion confidence score based on the second semantic probability map; and a calculation module for performing similarity calculation processing on the first feature pyramid, the second feature pyramid, the first attention weight map, the second attention weight map, the first foreground exclusion confidence score, and the second foreground exclusion confidence score based on a preset dynamic similarity calculation engine, to generate a background similarity between the first image and the second image.
[0008] Thirdly, 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 implement the steps of the above-described artificial intelligence-based image analysis method.
[0009] Fourthly, a computer-readable storage medium is provided, which stores a computer program that, when executed by a processor, implements the steps of the aforementioned artificial intelligence-based image analysis method.
[0010] In the aforementioned scheme implemented by the AI-based image analysis method, apparatus, computer equipment, and storage medium, the input first image and second image to be processed are first received; then, based on a preset multi-scale feature extraction network, features are extracted from the first image to obtain a corresponding first feature pyramid, and features are extracted from the second image to obtain a corresponding second feature pyramid; then, semantic segmentation is performed on the first feature pyramid to obtain a corresponding first semantic probability map, and semantic segmentation is performed on the second feature pyramid to obtain a corresponding second semantic probability map; subsequently, attention generation processing is performed on the first semantic probability map to obtain a corresponding first attention weight map, and attention generation processing is performed on the second semantic probability map to obtain a corresponding second attention weight map; and a corresponding first foreground exclusion confidence score is generated based on the first semantic probability map, and a corresponding second foreground exclusion confidence score is generated based on the second semantic probability map; finally, a similarity calculation processing is performed on the first feature pyramid, the second feature pyramid, the first attention weight map, the second attention weight map, the first foreground exclusion confidence score, and the second foreground exclusion confidence score based on a preset dynamic similarity calculation engine to generate a background similarity between the first image and the second image. Based on the above automated processing flow, this application receives input first and second images to be processed, and then performs feature extraction, semantic segmentation, attention generation, and foreground exclusion confidence generation on the first and second images respectively. Furthermore, using a dynamic similarity calculation engine, it calculates the similarity between the obtained first feature pyramid, second feature pyramid, first attention weight map, second attention weight map, first foreground exclusion confidence, and second foreground exclusion confidence, thereby achieving efficient and accurate generation of background similarity between the first and second images. Thus, unlike existing image background similarity calculation methods that rely on static matching of color histograms or texture features, this application comprehensively considers semantic segmentation, contextual information, and prior knowledge to calculate image background similarity, accurately focusing on the background region and calculating a reasonable background similarity value, effectively improving the accuracy of image background similarity calculation. Attached Figure Description
[0011] To more clearly illustrate the solutions in this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1 is an exemplary system architecture diagram in which this application can be applied; Figure 2 is a flowchart of an embodiment of the AI-based image analysis method according to this application; Figure 3 is a structural schematic diagram of an embodiment of the AI-based image analysis device according to this application; Figure 4 is a structural schematic diagram of an embodiment of the computer device according to this application. Detailed Implementation
[0013] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein in the specification of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "comprising" and "having," and any variations thereof, in the specification, claims, and foregoing drawings of this application, are intended to cover non-exclusive inclusion. The terms "first," "second," etc., in the specification, claims, or foregoing drawings of this application are used to distinguish different objects, not to describe a particular order.
[0014] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0015] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
[0016] As shown in Figure 1, the system architecture 100 may include a terminal device 101, a network 102, and a server 103. The terminal device 101 may be a laptop computer 1011, a tablet computer 1012, or a mobile phone 1013. The network 102 is used as a medium to provide a communication link between the terminal device 101 and the server 103. The network 102 may include various connection types, such as wired or wireless communication links or fiber optic cables, etc.
[0017] Users can use terminal device 101 to interact with server 103 via network 102 to receive or send messages, etc. Various communication client applications can be installed on terminal device 101, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social media platform software, etc.
[0018] Terminal device 101 can be various electronic devices with a display screen and support web browsing. In addition to laptops 1011, tablets 1012, or mobile phones 1013, terminal device 101 can also be an e-book reader, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 player (Moving Picture Experts Group Audio Layer IV), a laptop computer, and a desktop computer, etc.
[0019] Server 103 can be a server that provides various services, such as a backend server that provides support for the pages displayed on terminal device 101.
[0020] It should be noted that the AI-based image analysis method provided in this application is generally executed by a server / terminal device, and correspondingly, the AI-based image analysis device is generally located in the server / terminal device.
[0021] It should be understood that the number of terminal devices, networks, and servers shown in Figure 1 is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0022] Referring again to Figure 2, a flowchart of an embodiment of the AI-based image analysis method according to this application is shown. The order of steps in this flowchart can be changed, and some steps can be omitted, depending on different needs. The AI-based image analysis method provided in this application can be applied to any scenario requiring image similarity analysis, and thus can be applied to products in these scenarios, such as image similarity analysis products in the financial insurance or digital healthcare fields. The AI-based image analysis method includes the following steps: Step S201, receiving input first and second images to be processed.
[0023] In this embodiment, the electronic device (e.g., the server / terminal device shown in Figure 1) on which the AI-based image analysis method runs can acquire the first and second images to be processed via wired or wireless connection. It should be noted that the aforementioned wireless connection methods may include, but are not limited to, 3G / 4G / 5G connections, WiFi connections, Bluetooth connections, WiMAX connections, Zigbee connections, UWB (ultra-wideband) connections, and other currently known or future-developed wireless connection methods. The executing entity of this application is specifically an image analysis system, which can be simply referred to as the system. The first and second images are two indoor images for which the background similarity is to be calculated, and are respectively denoted as the first image. Second image .
[0024] Furthermore, this application can be applied to image similarity analysis scenarios in the fintech and digital healthcare fields. In the financial insurance and digital healthcare fields, background similarity calculation for dynamic scenes (such as changes in lighting, dynamic occlusion, etc.) can be applied to tasks such as risk assessment, fraud detection, and remote monitoring. The following is an analysis of the types of images that need to be compared and their application scenarios in practical applications in these two fields: 1. For the financial insurance field. Scenario 1: On-site investigation in insurance claims. Objective: To verify the authenticity of the claim (e.g., whether scenes such as fire, water stains, collisions, etc., are consistent with the reported description) by comparing accident scene images with historical archived images. Image types to be compared may include: Accident scene images (e.g., the first image): Current accident scene photos taken by the user using a mobile phone (e.g., vehicle damage after a collision, wall burn marks after an indoor fire). Characteristics: May contain dynamic occlusion (e.g., bystanders, rescue equipment), and changes in lighting (e.g., photos taken with a flash during a nighttime accident). Historical archived images (e.g., the second image): Standard photos of the insured object (vehicle, house) archived by the insurance company at the time of insurance, or reference images from historical claims records. Features: High image quality (professionally shot), but may differ from the current scene's perspective and lighting conditions.
[0025] Applications include: Fraud detection: If the background similarity is extremely low (e.g., a report claims "indoor water pipe burst," but the wall layout in the current image is completely different from the archived image), a staged scene may exist. Loss assessment: By using background similarity to locate dynamically changing areas (e.g., newly added water stains, burn marks), damage assessment can be aided.
[0026] Scenario 2: Remote Identity Verification and Fraud Prevention. Objective: In scenarios such as online account opening and loan applications, verify identity authenticity by comparing a user's real-time captured ID photo / environment photo with a pre-stored template. Image types to be compared may include: Real-time captured images (e.g., Image 1): Photos of the user's ID card, bank card, or office environment (e.g., company sign, interior layout) taken via camera. Characteristics: May contain dynamic occlusions (e.g., fingers obscuring part of the document information) and uneven lighting (e.g., backlighting). Pre-stored template images (e.g., Image 2): Scanned copies of official documents previously submitted by the user, or standard office photos archived by financial institutions. Characteristics: Clean background (ID photo has a solid color background), but may differ from the real-time image in shooting angle and resolution.
[0027] Applications include: Liveness detection: If the background similarity is low (e.g., another person's face or unusual objects appear in a real-time image), it may indicate an AI face-swapping attack. Environmental consistency verification: Comparing the background layout of office space images (e.g., sign fonts, furniture placement) to prevent fake company registrations.
[0028] 2. For the field of digital healthcare. Scenario 1: Patient monitoring in telemedicine. Objective: To monitor changes in the patient's condition or environmental risks (such as fall warnings, medication storage compliance) by comparing images of the patient's home environment at different time points. Image types to be compared may include: Current monitoring image (e.g., first image): Images of the patient's activity area taken periodically by a smart camera (e.g., bedroom, living room), or images of abnormal events triggered by devices worn by the patient (e.g., smart bracelets) (e.g., sudden falls). Characteristics: May contain dynamic obstructions (e.g., furniture moving, pets passing by) and changes in lighting (e.g., turning lights on / off at night). Baseline reference image (e.g., second image): A standard photo of the home environment taken when the patient's health is stable, or a "safe area" template marked by the doctor (e.g., accessible pathways, medication storage cabinet location). Characteristics: Fixed background, but may have local differences due to seasonal changes (e.g., changing curtains).
[0029] Applications include: Fall detection: An alarm is triggered if the background similarity drops sharply (e.g., a human silhouette appears on a previously empty floor). Medication compliance: The background layout of medication storage cabinets (e.g., the quantity and location of medications) is compared to prevent patients from accidentally taking or missing medications.
[0030] Scenario 2: Medical Imaging-Assisted Diagnosis. Objective: To monitor disease progression or treatment response by comparing medical images (e.g., X-rays, MRIs) taken at different time points. Image types to be compared may include: Current images (e.g., first image): Recent chest X-rays (to monitor pneumonia absorption) or joint MRIs (to assess arthritis treatment effectiveness). Characteristics: Image differences may occur due to equipment parameters (e.g., exposure dose) and patient position (e.g., respiratory movement). Historical images (e.g., second image): Baseline images from the patient's previous diagnosis, or typical images from other patients with the same disease (for comparative analysis). Characteristics: Consistent image quality (taken with the same equipment), but may show significant differences due to different stages of the disease.
[0031] Applications include: Disease tracking: Locating lesion areas (e.g., changes in lung shadow extent) through background similarity, quantifying treatment effectiveness. Anomaly detection: If the background similarity is below a threshold (e.g., disappearance of normal tissue structure), it suggests the possible presence of new lesions.
[0032] Step S202: Based on a preset multi-scale feature extraction network, feature extraction is performed on the first image to obtain a corresponding first feature pyramid, and feature extraction is performed on the second image to obtain a corresponding second feature pyramid.
[0033] In this embodiment, the specific implementation process of extracting features from the first image based on a preset multi-scale feature extraction network to obtain the corresponding first feature pyramid will be further described in detail in subsequent specific embodiments of this application, and will not be elaborated on here.
[0034] Similarly, the specific implementation process of extracting features from the second image to obtain the corresponding second feature pyramid can refer to the aforementioned process of extracting features from the first image based on a preset multi-scale feature extraction network to obtain the corresponding first feature pyramid, which will not be elaborated on here.
[0035] Step S203: Perform semantic segmentation on the first feature pyramid to obtain the corresponding first semantic probability map, and perform semantic segmentation on the second feature pyramid to obtain the corresponding second semantic probability map.
[0036] In this embodiment, the specific implementation process of semantic segmentation of the first feature pyramid to obtain the corresponding first semantic probability map will be further described in detail in subsequent specific embodiments of this application, and will not be elaborated on here.
[0037] Similarly, the specific implementation process of semantic segmentation of the second feature pyramid to obtain the corresponding second semantic probability map can refer to the aforementioned process of semantic segmentation of the first feature pyramid to obtain the corresponding first semantic probability map, and will not be elaborated further here.
[0038] Step S204: Perform attention generation processing on the first semantic probability map to obtain the corresponding first attention weight map, and perform attention generation processing on the second semantic probability map to obtain the corresponding second attention weight map.
[0039] In this embodiment, the specific implementation process of performing attention generation processing on the first semantic probability graph to obtain the corresponding first attention weight graph will be further described in detail in subsequent specific embodiments of this application, and will not be elaborated on here.
[0040] Similarly, the specific implementation process of performing attention generation processing on the second semantic probability graph to obtain the corresponding second attention weight graph can refer to the aforementioned process of performing attention generation processing on the first semantic probability graph to obtain the corresponding first attention weight graph, and will not be elaborated further here.
[0041] Step S205: Generate a first foreground exclusion confidence level based on the first semantic probability map, and generate a second foreground exclusion confidence level based on the second semantic probability map.
[0042] In this embodiment, the specific implementation process of generating the corresponding first foreground exclusion confidence based on the first semantic probability map will be further described in detail in subsequent specific embodiments of this application, and will not be elaborated on here.
[0043] Similarly, the specific implementation process of generating the corresponding second foreground exclusion confidence based on the second semantic probability map can refer to the aforementioned processing process of generating the corresponding first foreground exclusion confidence based on the first semantic probability map, and will not be elaborated further here.
[0044] Step S206: Based on a preset dynamic similarity calculation engine, perform similarity calculation processing on the first feature pyramid, the second feature pyramid, the first attention weight map, the second attention weight map, the first foreground exclusion confidence, and the second foreground exclusion confidence to generate the background similarity between the first image and the second image.
[0045] In this embodiment, the specific implementation process of generating the background similarity between the first image and the second image by performing similarity calculation on the first feature pyramid, the second feature pyramid, the first attention weight map, the second attention weight map, the first foreground exclusion confidence, and the second foreground exclusion confidence based on the preset dynamic similarity calculation engine will be further described in detail in subsequent specific embodiments of this application, and will not be elaborated on here.
[0046] This application first receives a first image and a second image to be processed as input; then, based on a preset multi-scale feature extraction network, it performs feature extraction on the first image to obtain a corresponding first feature pyramid, and performs feature extraction on the second image to obtain a corresponding second feature pyramid; next, it performs semantic segmentation on the first feature pyramid to obtain a corresponding first semantic probability map, and performs semantic segmentation on the second feature pyramid to obtain a corresponding second semantic probability map; subsequently, it performs attention generation processing on the first semantic probability map to obtain a corresponding first attention weight map, and performs attention generation processing on the second semantic probability map to obtain a corresponding second attention weight map; and generates a corresponding first foreground exclusion confidence score based on the first semantic probability map, and generates a corresponding second foreground exclusion confidence score based on the second semantic probability map; finally, it performs similarity calculation processing on the first feature pyramid, the second feature pyramid, the first attention weight map, the second attention weight map, the first foreground exclusion confidence score, and the second foreground exclusion confidence score based on a preset dynamic similarity calculation engine to generate a background similarity between the first image and the second image. Based on the above automated processing flow, this application receives input first and second images to be processed, and then performs feature extraction, semantic segmentation, attention generation, and foreground exclusion confidence generation on the first and second images respectively. Furthermore, using a dynamic similarity calculation engine, it calculates the similarity between the obtained first feature pyramid, second feature pyramid, first attention weight map, second attention weight map, first foreground exclusion confidence, and second foreground exclusion confidence, thereby achieving efficient and accurate generation of background similarity between the first and second images. Thus, unlike existing image background similarity calculation methods that rely on static matching of color histograms or texture features, this application comprehensively considers semantic segmentation, contextual information, and prior knowledge to calculate image background similarity, accurately focusing on the background region and calculating a reasonable background similarity value, effectively improving the accuracy of image background similarity calculation.
[0047] In some alternative implementations, step S202 includes the following steps: invoking a preset multi-scale feature extraction network.
[0048] In this embodiment, the multi-scale feature extraction network described above can specifically be a multi-scale feature extraction network based on a hierarchical visual Transformer architecture.
[0049] Obtain the preset downsampling strategy.
[0050] In this embodiment, the downsampling strategy described above is specifically a four-level downsampling. The implementation process of the four-level downsampling includes: Block embedding: Dividing the image into 4×4 pixel blocks and linearly embedding them into a token sequence. Hierarchical processing: Each level is processed through a Transformer block, including self-attention and a feedforward network (FFN). Downsampling is achieved by merging adjacent tokens (e.g., 2×2 merging), with the resolution halved at each level (1 / Output feature pyramid: Each level generates a feature map. And the resolution is reduced to 1 / 3 of the original image. .
[0051] Based on the downsampling strategy, the multi-scale feature extraction network is used to extract multi-scale features from the first image to obtain corresponding multi-scale feature data.
[0052] In this embodiment, a multi-scale feature extraction network can be used to perform four levels of downsampling on the first image to output corresponding multi-scale feature data. , , , This is the first feature pyramid. The resolution of the l-th level feature map is reduced to 1 / 3 of the original image. .
[0053] The multi-scale feature data is used as the first feature pyramid.
[0054] This application invokes a preset multi-scale feature extraction network; then obtains a preset downsampling strategy; subsequently, based on the downsampling strategy, it uses the multi-scale feature extraction network to extract multi-scale features from the first image to obtain corresponding multi-scale feature data; and finally, it uses the multi-scale feature data as the first feature pyramid. This application, by using a multi-scale feature extraction network to extract multi-scale features from the first image based on the obtained downsampling strategy, can simulate the hierarchical perception of human vision, capturing texture details at low levels and encoding semantic information at high levels, thus ensuring the accuracy of the extracted first feature pyramid.
[0055] In some optional implementations of this embodiment, step S203 includes the following steps: invoking a preset feature pyramid network.
[0056] In this embodiment, the aforementioned feature pyramid network can specifically be an FPN network.
[0057] Based on the feature pyramid network, feature fusion processing is performed on the first feature pyramid to obtain the corresponding fused features.
[0058] In this embodiment, the above feature fusion processing includes: 1) upsampling and lateral connection: for high-level features (such as... Perform bilinear interpolation upsampling and compare it with low-level features (such as...) 1) Element-wise addition. The number of channels is adjusted using 1×1 convolutions to ensure consistent feature dimensions after fusion. 2) Multi-level fusion: Repeat the above process to generate fused features, with a resolution covering 1 / 16 of the original image. Among them, the FPN network fuses features at different scales, balancing semantic information (high-level) and spatial details (low-level), which can effectively improve the segmentation accuracy of small objects.
[0059] Obtain the semantic probability graph generation strategy corresponding to the preset objective function.
[0060] In this embodiment, the objective function is specifically the Softmax function. The goal of the semantic probability map generation strategy is to convert the fused features into a semantic probability map at the original image resolution. The corresponding strategy includes: 1. Upsampling to the original image resolution: For each layer of fused features, upsampling is performed to H×W using bilinear interpolation. 2. Multi-scale feature aggregation: All upsampled features are concatenated (or added) according to channels to obtain a comprehensive feature. The number of channels is then compressed to C (predefined number of categories) using a 1x1 convolution to obtain a logit map, i.e. , indicating position ( ) category 3. Softmax normalization: The original logit value. Applying Softmax along the category dimension generates a semantic probability map: , Indicates position ( ) belongs to category The probability of.
[0061] in, For position ( ) category The logit value. This application divides the category set into: background class B: {"wall", "floor", "ceiling"}, foreground class F: {"person", "pet", "moving object"}. Molecules To exponentiate each logit value, the original score is mapped to the positive real number range (0, +∞). This aims to address the issue of potentially negative logit values, ensure that the denominator in subsequent normalization is not zero, and amplify the difference between high and low scores (the exponential function is monotonically increasing and its growth rate accelerates). (Denominator) For position ( The sum of the indexed scores of all categories at a given location is used to reflect the total "confidence energy" of all categories at that location, serving as a benchmark for normalization.
[0062] Additionally, after Softmax normalization, the original score can be converted into a probability value, and the range can be output. ∈ (0,1).
[0063] The fused features are transformed based on the semantic probabilistic graph generation strategy to obtain the corresponding transformation results.
[0064] In this embodiment, the transformation processing of the above-mentioned fused features can be performed based on the strategy content of the semantic probability graph generation strategy, and the obtained transformation result can be used as the corresponding first semantic probability graph.
[0065] The transformation result is used as the first semantic probability map.
[0066] This application achieves automatic and accurate generation of high-resolution semantic probability maps by invoking a preset feature pyramid network, then performing feature fusion processing on the first feature pyramid based on the feature pyramid network to obtain corresponding fused features, then obtaining a semantic probability map generation strategy corresponding to a preset objective function, subsequently transforming the fused features based on the semantic probability map generation strategy to obtain corresponding transformation results, and using the transformation results as the first semantic probability map. Based on the above processing flow, this application obtains fused features by performing feature fusion processing on the first feature pyramid using a feature pyramid network, then transforms the fused features based on the semantic probability map generation strategy corresponding to the objective function, and uses the obtained transformation results as the corresponding first semantic probability map, thereby ensuring the data quality and accuracy of the obtained semantic probability map.
[0067] In some optional implementations, step S204 includes the following steps: performing semantic weight allocation processing on the first semantic probability graph to obtain the corresponding semantic weights.
[0068] In this embodiment, semantic weight allocation refers to: calculating a background class weighted sum for each pixel: . Can refer to the first image In the middle, pixels ( The background class weighted sum at position ) is used to measure the overall weight of the pixel belonging to the background category. Its function is to emphasize more stable background categories, such as walls being more important than moving objects. It plays a role in emphasizing background semantics when calculating attention weights in the subsequent process.
[0069] in, These are learnable parameters, and their initial values are set based on the background stability of the category (e.g., walls). =1.2, floor =1.0), This is a semantic probability graph. Indicates category Belongs to the background class collection Background categories typically include relatively stable object types such as walls and floors.
[0070] The semantic weight allocation process assigns semantic weights to each pixel based on the stability of different background categories.
[0071] The first image is subjected to spatial context enhancement processing based on a preset specified function to obtain the corresponding spatial context information.
[0072] In this embodiment, the specified function is specifically a radial basis function. The aforementioned spatial context enhancement processing refers to modeling local background consistency using radial basis functions, and the specific implementation formula includes: . Can refer to the first image In the middle, pixels ( The spatial context enhancement weight at () is used to measure the background consistency of the local region surrounding the pixel. Its function is to encourage adjacent pixels to have consistent background labels, enhancing the continuity and consistency of the background region, and emphasizing local background consistency in subsequent attention weight calculations.
[0073] in, : Represents a pixel Located in pixel neighborhood Inside, this neighborhood The 7x7 neighborhood defines the range for calculating local background consistency, enhancing the background weight of the current pixel by considering information from surrounding pixels. γ: A parameter of the radial basis function (RBF), here γ=1.5, controlling the decay rate of the RBF. The larger γ is, the faster the function decays, meaning that pixels farther from the center pixel have less influence on the current pixel. Neighborhood The background class with the highest probability within the neighborhood is the background class with the highest probability value. Its function is to determine the main background class in the neighborhood and to determine whether neighboring pixels belong to the same background class. Threshold, here =0.5. Its function is to determine the pixel value. Does it belong to the background category? If a pixel is considered to belong to the background category, it is considered to belong to the background category; otherwise, it is not. This step takes into account the spatial context information around the pixel, enhancing background consistency. ( This is an indicator function that evaluates to 1 if the condition within the parentheses is true, and 0 otherwise. Its function is to determine the threshold value. Determine whether neighboring pixels belong to the background category to decide whether to include them in the spatial context enhancement calculation.
[0074] Obtain the preset indoor layout statistics template.
[0075] In this embodiment, the specific implementation process of obtaining the preset indoor layout statistical template will be further described in detail in subsequent specific embodiments of this application, and will not be elaborated on here.
[0076] The semantic weights, spatial context information, and indoor layout statistical templates are fused based on a preset fusion strategy to obtain the corresponding fusion results.
[0077] In this embodiment, the aforementioned fusion strategy refers to a strategy for fusion of prior knowledge, and attention is calculated using the following fusion formula:
[0078] in, For the first image Medium pixels ( The final attention weight at the position is between [0,1] and its value ranges from [0,1]. It serves to combine semantic weight and spatial context enhancement weight, and together with the indoor layout template, to determine the importance of each pixel in background matching. This refers to the Sigmoid function. , To balance the hyperparameters (default α=0.7, β=0.3). This refers to semantic weights. This refers to spatial context information. This is a template for interior layout statistics.
[0079] Specifically, the semantic weights, spatial context information, and indoor layout statistical templates mentioned above can be substituted into the above fusion formula for calculation, and the resulting fusion result can be used as the corresponding first attention weight map.
[0080] The fusion result is used as the first attention weight map.
[0081] This application obtains semantic weights by performing semantic weight allocation processing on the first semantic probability map; then, it performs spatial context enhancement processing on the first image based on a preset specified function to obtain corresponding spatial context information; subsequently, it obtains a preset indoor layout statistical template; and then performs fusion processing on the semantic weights, spatial context information, and indoor layout statistical template based on a preset fusion strategy to obtain a corresponding fusion result; finally, it uses the fusion result as the first attention weight map. Based on the above processing flow, this application obtains semantic weights by performing semantic weight allocation processing on the first semantic probability map and obtains spatial context information by performing spatial context enhancement processing on the first image. Then, it performs fusion processing on the semantic weights, spatial context information, and the obtained indoor layout statistical template based on the use of a fusion strategy, and uses the obtained fusion result as the corresponding first attention weight map. This allows for efficient and accurate attention generation processing of the first semantic probability map. By introducing domain priors through the use of indoor layout statistical templates, it can balance data-driven semantic weights and spatial context, ensuring the data accuracy of the obtained first attention weight map.
[0082] In some optional implementations, obtaining the preset indoor layout statistics template includes the following steps: obtaining a specified number of indoor scene images.
[0083] In this embodiment, the selection of the specified quantity is not specifically limited and can be determined according to actual business needs; for example, 100,000 can be used. A specified number, such as 100,000, of labeled or unlabeled indoor scene images (e.g., living rooms, bedrooms, offices) can be collected to ensure that the images cover diverse layout types (e.g., furniture placement, room division, functional area division). Each image is uniformly resized (e.g., H×W) and converted to grayscale or binarized form to simplify subsequent processing. If the image has semantic segmentation annotations (e.g., walls, furniture, doors, windows), the annotation information can be directly used; if there are no annotations, structural features need to be extracted using computer vision methods (e.g., edge detection, depth estimation).
[0084] The indoor scene image is subjected to feature extraction and dimensionality reduction processing to obtain the corresponding feature vector.
[0085] In this embodiment, the above feature extraction and dimensionality reduction processing includes: 1) Structural feature extraction: using semantic segmentation: if the image is labeled, the category of each pixel (e.g., wall, floor, furniture) is encoded into a one-hot vector, and the spatial distribution of each category in the image is statistically analyzed (e.g., histogram or two-dimensional probability map). Using unsupervised feature extraction: if there is no label, edge detection (e.g., Canny) is used to extract contours, or a depth map is generated through depth estimation, and then the depth map is binarized (foreground / background) through threshold segmentation, or further segmented into near, middle, and far regions. 2) Feature dimensionality reduction: the two-dimensional spatial distribution (e.g., an H×W matrix) is compressed into a one-dimensional vector (e.g., through global average pooling, principal component analysis PCA), or local features are preserved (e.g., the image is divided into grids, and the feature distribution within each grid is statistically analyzed).
[0086] The feature vectors are grouped based on a preset clustering analysis strategy to obtain multiple corresponding cluster center templates.
[0087] In this embodiment, the above-mentioned clustering analysis strategy refers to grouping images with similar layouts to generate representative templates. The corresponding strategy includes: selecting the number of clusters K: determining the optimal number of clusters K using the Elbow Method or Silhouette Score, for example, K=100 (the specific value needs to be adjusted experimentally). Running K-means: inputting the feature vectors of all images into the K-means algorithm to divide the images into K clusters, each cluster representing a typical layout pattern. Generating cluster center templates: for each cluster, calculating the average spatial distribution of all images within that cluster (e.g., averaging over semantic segmentation categories or depth regions), obtaining K candidate templates { , ,…, }
[0088] Among them, the feature vectors can be grouped based on the above clustering analysis strategy to obtain multiple corresponding cluster center templates.
[0089] All the cluster center templates are subjected to template filtering and fusion processing to obtain the processed target template.
[0090] In this embodiment, the template selection and fusion process includes: Selecting high-frequency templates: Counting the number of images in each cluster, retaining the top N clusters with the most images (e.g., N=10), and using their cluster center templates as candidates. Template fusion: Weighted averaging: The templates are weighted according to the number of images within each cluster to generate a comprehensive template, which serves as the corresponding target template. The cluster weights can be calculated using the proportion of image counts. Binarization: Continuous value templates can be converted into binary templates through thresholding, where 1 represents high-frequency layout areas (e.g., furniture concentration areas) and 0 represents low-frequency areas (e.g., blank walls). Post-processing: Morphological operations (e.g., dilation, erosion) are performed on the templates to smooth edges, or key areas (e.g., door and window positions) are manually adjusted.
[0091] The target template is used as the indoor layout statistics template.
[0092] In this embodiment, the obtained target template can also be verified and optimized to ensure that the template can effectively constrain the attention distribution. The specific implementation process includes: visual inspection: randomly sampling a portion of the image and comparing its actual layout with the template. The overlap (e.g., Intersection over Union (IoU)). Attention constraint verification: During the training phase, through the loss function... =||A⊙ The attention weight A is set to A||^2. This is used to observe whether the model pays more attention to high-frequency regions in the template. Iterative optimization: If the results are unsatisfactory, the number of clusters K, the feature extraction method, or the fusion strategy can be adjusted, and the template can be regenerated.
[0093] This application acquires a specified number of indoor scene images; then performs feature extraction and dimensionality reduction on the indoor scene images to obtain corresponding feature vectors; subsequently, it groups the feature vectors based on a preset clustering analysis strategy to obtain multiple cluster center templates; subsequently, it performs template filtering and fusion processing on all the cluster center templates to obtain a processed target template; finally, it uses the target template as the indoor layout statistical template. Based on the above processing flow, this application obtains feature vectors by performing feature extraction and dimensionality reduction on the acquired indoor scene images, then groups the feature vectors based on a clustering analysis strategy to obtain multiple cluster center templates, then performs template filtering and fusion processing on the obtained cluster center templates, and uses the obtained target template as the corresponding indoor layout statistical template. This enables the automated generation of a general indoor layout statistical template, which can be used to constrain the model's attention distribution, improve the understanding of indoor scenes, and enhance the generation efficiency and accuracy of the indoor layout statistical template.
[0094] In some optional implementations of this embodiment, step S205 includes the following steps: calling a preset foreground exclusion confidence formula.
[0095] In this embodiment, the foreground exclusion confidence formula specifically includes: The foreground exclusion confidence formula is used to calculate the image... In position ( ) prospect exclusion confidence level This is used to distinguish between the background and foreground areas. ∈[0,1], the larger the value, the more likely the region is to be background.
[0096] In addition, the parameter interpretations for the foreground exclusion confidence formula include: For image The first semantic probability graph at position ( ) and categories The probability value is denoted as H×W×C, where H is the height, W is the width, and C is the total number of semantic categories (e.g., people, vehicles, sky, etc.). Represents pixels ( ) belongs to category The probability of. For It refers to a set of semantic categories. A certain category , indicating the foreground category. This is a predefined set of categories to be excluded (such as people, vehicles, animals, and other dynamic objects), used to focus only on the probability of foreground categories and ignore the influence of background categories (such as sky and roads). It is about position ( The probability of all foreground categories is taken at the maximum value. This refers to subtracting the maximum foreground probability from 1 to obtain the background confidence (i.e., foreground exclusion confidence), in order to dynamically adjust the weight of background similarity calculation and balance the strictness and robustness of foreground exclusion.
[0097] The first semantic probability map is calculated based on the foreground exclusion confidence formula to obtain the corresponding first calculation result.
[0098] In this embodiment, the first semantic probability map can be substituted into the foreground exclusion confidence formula for calculation, and the first calculation result can be used as the corresponding first foreground exclusion confidence.
[0099] The first calculation result is used as the confidence level for the first prospect exclusion.
[0100] In this embodiment, the foreground exclusion confidence formula is dynamically calculated using a semantic probability graph. The core idea is: "Subtract the highest foreground probability from 1 to obtain the background confidence," thus achieving the following in background similarity calculation: High-confidence foreground regions (e.g., clear human silhouettes): ρ→0, completely excluded from background similarity calculation. Blurred boundary regions (e.g., human shadows): ρ∈(0,1), contributing partial weight. Pure background regions: ρ→1, fully participating in matching. That is: High-confidence foreground: completely excluded (ρ≈0). High-confidence background: completely retained (ρ≈1). Blurred regions: partially retained (ρ∈(0,1)).
[0101] This application calls a preset foreground exclusion confidence formula; then, based on the foreground exclusion confidence formula, it calculates and processes the first semantic probability map to obtain a corresponding first calculation result; subsequently, the first calculation result is used as the first foreground exclusion confidence. Based on the above processing flow, this application, by using the foreground exclusion confidence formula, can dynamically calculate the corresponding foreground exclusion confidence through the semantic probability map, eliminating the interference of the foreground region on the background similarity calculation, thereby significantly improving the robustness of background matching and ensuring the accuracy of the obtained foreground exclusion confidence data.
[0102] In some optional implementations of this embodiment, step S206 includes the following steps: calling a preset similarity calculation formula based on the dynamic similarity calculation engine.
[0103] In this embodiment, the aforementioned dynamic similarity calculation engine is a pre-built processing engine with similarity calculation capabilities. The similarity calculation formula calculates the weighted semantic similarity of the background regions of two images after excluding foreground interference, and is suitable for tasks such as background matching, image retrieval, or video tracking. The similarity calculation formula includes:
[0104] in, The background similarity between the first and second images is typically between [0,1]. By combining feature similarity, attention weights, and foreground exclusion results, the final background similarity is calculated, achieving robust background matching. , These are the first attention weight map and the second attention weight map, respectively. , These are the first feature pyramid and the second feature pyramid, respectively. Excluding the confidence level for the first prospect, The confidence level is excluded for the second prospect. This is the feature similarity function.
[0105] Furthermore, the numerator of the aforementioned similarity calculation formula is the sum of the following terms (attention weight map, feature pyramid, and foreground exclusion confidence) of the two images, multiplied element-wise. This sum is used to comprehensively measure the degree of attention, semantic similarity, and foreground exclusion effect of the two images in the background region. Thus, through the combined effect of attention weight, feature similarity, and foreground exclusion confidence, the formula focuses on the semantic similarity of the "common background region" in the two images.
[0106] The denominator is calculated by multiplying the first and second attention weight maps element-wise with their corresponding first and second foreground exclusion confidence scores, respectively, and then using the L2 norm to normalize the numerator, stabilizing the similarity value within the range of [0,1]. This normalization ensures that the similarity value is unaffected by image size or the absolute value of the attention weights, reflecting only relative similarity.
[0107] Obtain the preset feature similarity function.
[0108] In this embodiment, the selection of the above-mentioned feature similarity function is not specifically limited, and can be determined according to the actual business needs. For example, cosine similarity, Euclidean distance, or similarity calculation can be used.
[0109] Based on the similarity calculation formula and the feature similarity function, similarity calculation is performed on the first feature pyramid, the second feature pyramid, the first attention weight map, the second attention weight map, the first foreground exclusion confidence score, and the second foreground exclusion confidence score to obtain the corresponding second calculation result.
[0110] In this embodiment, based on a determined feature similarity function, the first feature pyramid, the second feature pyramid, the first attention weight map, the second attention weight map, the first foreground exclusion confidence, and the second foreground exclusion confidence are substituted into the similarity calculation formula for calculation, and the resulting second calculation result is used as the background similarity between the first image and the second image.
[0111] The second calculation result is used as the background similarity between the first image and the second image.
[0112] This application utilizes a dynamic similarity calculation engine to invoke a preset similarity calculation formula; then, it obtains a preset feature similarity function; subsequently, based on the similarity calculation formula and the feature similarity function, it performs similarity calculations on the first feature pyramid, the second feature pyramid, the first attention weight map, the second attention weight map, the first foreground exclusion confidence score, and the second foreground exclusion confidence score to obtain a corresponding second calculation result; subsequently, the second calculation result is used as the background similarity between the first image and the second image. Based on the above processing flow, this application, by combining the similarity calculation formula and the feature similarity function, and by comprehensively considering the feature similarity, attention weight, and foreground exclusion confidence score of two images, achieves robust background matching and improves the accuracy of the generated background similarity data.
[0113] In some alternative implementations, the user information obtained is subject to user consent and complies with relevant laws and policies.
[0114] Furthermore, any software tools or components not belonging to our company that appear in the embodiments of this application are merely illustrative examples and do not represent actual use.
[0115] Furthermore, this application proposes an indoor image background similarity calculation method that integrates prior distribution of indoor scenes. By combining semantic segmentation with context-adaptive dynamic thresholding technology, the robustness of background similarity calculation in dynamic indoor environments is significantly improved. Moreover, the breakthrough of this application is reflected in the following dimensions: 1. Semantic-geometric joint modeling: For the first time, the global context capture capability of the visual Transformer is combined with a region-specific attention mechanism, solving the problem of the separation between semantic segmentation and similarity calculation processes in traditional methods.
[0116] 2. Dynamic Adaptive Mechanism: The proposed threshold adjustment strategy can update the calculation parameters in real time based on the local semantic confidence (such as the background confidence of the area occluded by the person), which significantly improves the robustness under the lighting change scenario compared with the fixed threshold method.
[0117] 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 the present invention.
[0118] It should be emphasized that, to further ensure the privacy and security of the aforementioned background similarity, the background similarity can also be stored in a node of a blockchain.
[0119] The blockchain referred to in this application is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Essentially, a blockchain is a decentralized database, a chain of data blocks linked together using cryptographic methods. Each data block contains information about a batch of network transactions, used to verify the validity of the information (anti-counterfeiting) and generate the next block. A blockchain can include an underlying blockchain platform, a platform product service layer, and an application service layer.
[0120] This application's embodiments can acquire and process relevant data based on artificial intelligence (AI) technology. AI is the theory, methods, technology, and application system that uses digital computers or computers-controlled machines to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results. Basic AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operating / interactive systems, and mechatronics. AI software technologies mainly include computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.
[0121] 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 instructing related hardware through computer-readable instructions. These computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above methods. The aforementioned storage medium can be a non-volatile storage medium such as a magnetic disk, optical disk, or read-only memory (ROM), or random access memory (RAM).
[0122] It should be understood that although the steps in the flowcharts of the accompanying figures are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the accompanying figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0123] Referring further to FIG3, as an implementation of the method shown in FIG2, this application provides an embodiment of an image analysis device based on artificial intelligence. This device embodiment corresponds to the method embodiment shown in FIG2, and the device can be specifically applied to various electronic devices.
[0124] As shown in Figure 3, the image analysis device 300 based on artificial intelligence described in this embodiment includes: a receiving module 301, an extraction module 302, a segmentation module 303, a processing module 304, a generation module 305, and a calculation module 306. The system comprises: a receiving module 301 for receiving input first and second images to be processed; an extraction module 302 for extracting features from the first image using a preset multi-scale feature extraction network to obtain a corresponding first feature pyramid, and extracting features from the second image to obtain a corresponding second feature pyramid; a segmentation module 303 for performing semantic segmentation on the first feature pyramid to obtain a corresponding first semantic probability map, and performing semantic segmentation on the second feature pyramid to obtain a corresponding second semantic probability map; a processing module 304 for performing attention generation processing on the first semantic probability map to obtain a corresponding first attention weight map, and performing attention generation processing on the second semantic probability map to obtain a corresponding second attention weight map; a generation module 305 for generating a corresponding first foreground exclusion confidence score based on the first semantic probability map, and generating a corresponding second foreground exclusion confidence score based on the second semantic probability map; and a calculation module 306 for performing similarity calculation processing on the first feature pyramid, the second feature pyramid, the first attention weight map, the second attention weight map, the first foreground exclusion confidence score, and the second foreground exclusion confidence score using a preset dynamic similarity calculation engine to generate a background similarity between the first image and the second image.
[0125] In this embodiment, the operations performed by the above modules or units correspond one-to-one with the steps of the artificial intelligence-based image analysis method in the aforementioned embodiments, and will not be repeated here.
[0126] In some optional implementations of this embodiment, the extraction module 302 includes: a first invocation submodule, used to invoke a preset multi-scale feature extraction network; a first acquisition submodule, used to acquire a preset downsampling strategy; an extraction submodule, used to perform multi-scale feature extraction on the first image based on the downsampling strategy using the multi-scale feature extraction network to obtain corresponding multi-scale feature data; and a first determination submodule, used to use the multi-scale feature data as the first feature pyramid.
[0127] In this embodiment, the operations performed by the above modules or units correspond one-to-one with the steps of the artificial intelligence-based image analysis method in the aforementioned embodiments, and will not be repeated here.
[0128] In some optional implementations of this embodiment, the segmentation module 303 includes: a second invocation submodule, used to invoke a preset feature pyramid network; a first fusion submodule, used to perform feature fusion processing on the first feature pyramid based on the feature pyramid network to obtain corresponding fused features; a second acquisition submodule, used to acquire a semantic probability graph generation strategy corresponding to a preset objective function; a transformation submodule, used to perform transformation processing on the fused features based on the semantic probability graph generation strategy to obtain corresponding transformation results; and a second determination submodule, used to use the transformation results as the first semantic probability graph.
[0129] In this embodiment, the operations performed by the above modules or units correspond one-to-one with the steps of the artificial intelligence-based image analysis method in the aforementioned embodiments, and will not be repeated here.
[0130] In some optional implementations of this embodiment, the processing module 304 includes: an allocation submodule, used to perform semantic weight allocation processing on the first semantic probability map to obtain corresponding semantic weights; an enhancement submodule, used to perform spatial context enhancement processing on the first image based on a preset specified function to obtain corresponding spatial context information; a third acquisition submodule, used to acquire a preset indoor layout statistical template; a second fusion submodule, used to perform fusion processing on the semantic weights, the spatial context information and the indoor layout statistical template based on a preset fusion strategy to obtain a corresponding fusion result; and a third determination submodule, used to use the fusion result as the first attention weight map.
[0131] In this embodiment, the operations performed by the above modules or units correspond one-to-one with the steps of the artificial intelligence-based image analysis method in the aforementioned embodiments, and will not be repeated here.
[0132] In some optional implementations of this embodiment, the third acquisition submodule includes: an acquisition unit for acquiring a specified number of indoor scene images; a first processing unit for performing feature extraction and dimensionality reduction processing on the indoor scene images to obtain corresponding feature vectors; a grouping unit for grouping the feature vectors based on a preset clustering analysis strategy to obtain multiple corresponding cluster center templates; a second processing unit for performing template filtering and fusion processing on all the cluster center templates to obtain a processed target template; and a determination unit for using the target template as the indoor layout statistical template.
[0133] In this embodiment, the operations performed by the above-mentioned modules or units correspond one-to-one with the steps of the artificial intelligence-based image analysis method in the aforementioned embodiments, and will not be repeated here. In some optional implementations of this embodiment, the generation module 305 includes: a third calling submodule, used to call a preset foreground exclusion confidence formula; a first calculation submodule, used to perform calculation processing on the first semantic probability map based on the foreground exclusion confidence formula to obtain a corresponding first calculation result; and a fourth determining submodule, used to use the first calculation result as the first foreground exclusion confidence.
[0134] In this embodiment, the operations performed by the above modules or units correspond one-to-one with the steps of the artificial intelligence-based image analysis method in the aforementioned embodiments, and will not be repeated here.
[0135] In some optional implementations of this embodiment, the calculation module 306 includes: a fourth calling submodule, used to call a preset similarity calculation formula based on the dynamic similarity calculation engine; a fourth obtaining submodule, used to obtain a preset feature similarity function; a second calculation submodule, used to perform similarity calculation processing on the first feature pyramid, the second feature pyramid, the first attention weight map, the second attention weight map, the first foreground exclusion confidence, and the second foreground exclusion confidence based on the similarity calculation formula and the feature similarity function, to obtain a corresponding second calculation result; and a fifth determining submodule, used to use the second calculation result as the background similarity between the first image and the second image.
[0136] In this embodiment, the operations performed by the above-mentioned modules or units correspond one-to-one with the steps of the artificial intelligence-based image analysis method in the aforementioned embodiments, and will not be repeated here. To solve the above-mentioned technical problems, this application embodiment also provides a computer device. Please refer to Figure 4 for details. Figure 4 is a basic structural block diagram of the computer device in this embodiment.
[0137] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are interconnected via a system bus. It should be noted that only the computer device 4 with components 41-43 is shown in the figure; however, it should be understood that it is not required to implement all the shown components, and more or fewer components can be implemented alternatively. Those skilled in the art will understand that the computer device described here is a device capable of automatically performing numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes, but is not limited to, microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.
[0138] The computer device can be a desktop computer, laptop, handheld computer, or cloud server, etc. The computer device can interact with the user via a keyboard, mouse, remote control, touchpad, or voice control.
[0139] The memory 41 includes at least one type of readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 41 may be an internal storage unit of the computer device 4, such as the hard disk or memory of the computer device 4. In other embodiments, the memory 41 may also be an external storage device of the computer device 4, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the computer device 4. Of course, the memory 41 may also include both the internal storage unit and its external storage device of the computer device 4. In this embodiment, the memory 41 is typically used to store the operating system and various application software installed on the computer device 4, such as computer-readable instructions for image analysis methods based on artificial intelligence. In addition, the memory 41 can also be used to temporarily store various types of data that have been output or will be output.
[0140] In some embodiments, the processor 42 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip. The processor 42 is typically used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to execute computer-readable instructions stored in the memory 41 or to process data, for example, to execute computer-readable instructions for the artificial intelligence-based image analysis method.
[0141] The network interface 43 may include a wireless network interface or a wired network interface, which is typically used to establish communication connections between the computer device 4 and other electronic devices.
[0142] Compared with the prior art, the embodiments of this application have the following beneficial effects: In the embodiments of this application, unlike the existing static matching image background similarity calculation methods that rely on color histograms or texture features, this application calculates image background similarity by comprehensively considering semantic segmentation, context information and prior knowledge, which can accurately focus on the background area and calculate a reasonable background similarity value, effectively improving the accuracy of image background similarity calculation.
[0143] This application also provides another embodiment, namely, providing a computer-readable storage medium storing computer-readable instructions that can be executed by at least one processor to cause the at least one processor to perform the steps of the artificial intelligence-based image analysis method described above.
[0144] Compared with the prior art, the embodiments of this application have the following advantages: In the embodiments of this application, unlike the existing static matching image background similarity calculation methods that rely on color histograms or texture features, this application calculates image background similarity by comprehensively considering semantic segmentation, context information and prior knowledge, which can accurately focus on the background area and calculate a reasonable background similarity value, thus effectively improving the accuracy of image background similarity calculation.
[0145] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0146] Obviously, the embodiments described above are only some embodiments of this application, not all embodiments. The accompanying drawings show preferred embodiments of this application, but do not limit the patent scope of this application. This application can be implemented in many different forms; rather, the purpose of providing these embodiments is to provide a more thorough and comprehensive understanding of the disclosure of this application. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing specific embodiments, or make equivalent substitutions for some of the technical features. Any equivalent structures made using the content of this application's specification and drawings, directly or indirectly applied to other related technical fields, are similarly within the scope of patent protection of this application.
Claims
1. An image analysis method based on artificial intelligence, characterized in that, The process includes the following steps: receiving input first and second images to be processed; performing feature extraction on the first image based on a preset multi-scale feature extraction network to obtain a corresponding first feature pyramid, and performing feature extraction on the second image to obtain a corresponding second feature pyramid; performing semantic segmentation on the first feature pyramid to obtain a corresponding first semantic probability map, and performing semantic segmentation on the second feature pyramid to obtain a corresponding second semantic probability map; performing attention generation processing on the first semantic probability map to obtain a corresponding first attention weight map, and performing attention generation processing on the second semantic probability map to obtain a corresponding second attention weight map; A first foreground exclusion confidence level is generated based on the first semantic probability map, and a second foreground exclusion confidence level is generated based on the second semantic probability map. Based on a preset dynamic similarity calculation engine, similarity calculation is performed on the first feature pyramid, the second feature pyramid, the first attention weight map, the second attention weight map, the first foreground exclusion confidence, and the second foreground exclusion confidence to generate the background similarity between the first image and the second image.
2. The image analysis method based on artificial intelligence according to claim 1, characterized in that, The step of extracting features from the first image based on a preset multi-scale feature extraction network to obtain the corresponding first feature pyramid specifically includes: calling the preset multi-scale feature extraction network; obtaining a preset downsampling strategy; using the multi-scale feature extraction network to extract multi-scale features from the first image based on the downsampling strategy to obtain corresponding multi-scale feature data; and using the multi-scale feature data as the first feature pyramid.
3. The image analysis method based on artificial intelligence according to claim 1, characterized in that, The step of semantically segmenting the first feature to obtain the corresponding first semantic probability map specifically includes: calling a preset feature pyramid network; performing feature fusion processing on the first feature pyramid based on the feature pyramid network to obtain the corresponding fused feature; obtaining a semantic probability map generation strategy corresponding to a preset objective function; performing transformation processing on the fused feature based on the semantic probability map generation strategy to obtain the corresponding transformation result; and using the transformation result as the first semantic probability map.
4. The image analysis method based on artificial intelligence according to claim 1, characterized in that, The step of performing attention generation processing on the first semantic probability map to obtain the corresponding first attention weight map specifically includes: performing semantic weight allocation processing on the first semantic probability map to obtain the corresponding semantic weights; performing spatial context enhancement processing on the first image based on a preset specified function to obtain the corresponding spatial context information; obtaining a preset indoor layout statistical template; performing fusion processing on the semantic weights, the spatial context information, and the indoor layout statistical template based on a preset fusion strategy to obtain the corresponding fusion result; and using the fusion result as the first attention weight map.
5. The image analysis method based on artificial intelligence according to claim 4, characterized in that, The step of obtaining the preset indoor layout statistical template specifically includes: obtaining a specified number of indoor scene images; performing feature extraction and dimensionality reduction processing on the indoor scene images to obtain corresponding feature vectors; grouping the feature vectors based on a preset clustering analysis strategy to obtain multiple corresponding cluster center templates; performing template filtering and fusion processing on all the cluster center templates to obtain the processed target template; and using the target template as the indoor layout statistical template.
6. The image analysis method based on artificial intelligence according to claim 1, characterized in that, The step of generating a corresponding first foreground exclusion confidence score based on the first semantic probability map specifically includes: calling a preset foreground exclusion confidence score formula; performing calculation processing on the first semantic probability map based on the foreground exclusion confidence score formula to obtain a corresponding first calculation result; and using the first calculation result as the first foreground exclusion confidence score.
7. The image analysis method based on artificial intelligence according to claim 1, characterized in that, The step of generating a background similarity between the first image and the second image by performing similarity calculation processing on the first feature pyramid, the second feature pyramid, the first attention weight map, the second attention weight map, the first foreground exclusion confidence score, and the second foreground exclusion confidence score based on a preset dynamic similarity calculation engine specifically includes: calling a preset similarity calculation formula based on the dynamic similarity calculation engine; obtaining a preset feature similarity function; performing similarity calculation processing on the first feature pyramid, the second feature pyramid, the first attention weight map, the second attention weight map, the first foreground exclusion confidence score, and the second foreground exclusion confidence score based on the similarity calculation formula and the feature similarity function to obtain a corresponding second calculation result; and using the second calculation result as the background similarity between the first image and the second image.
8. An image analysis device based on artificial intelligence, characterized in that, include: The receiving module is used to receive the input first image and second image to be processed; An extraction module is used to extract features from the first image based on a preset multi-scale feature extraction network to obtain a corresponding first feature pyramid, and to extract features from the second image to obtain a corresponding second feature pyramid; a segmentation module is used to perform semantic segmentation on the first feature pyramid to obtain a corresponding first semantic probability map, and to perform semantic segmentation on the second feature pyramid to obtain a corresponding second semantic probability map; a processing module is used to perform attention generation processing on the first semantic probability map to obtain a corresponding first attention weight map, and to perform attention generation processing on the second semantic probability map to obtain a corresponding second attention weight map. The generation module is used to generate a first foreground exclusion confidence level based on the first semantic probability map, and to generate a second foreground exclusion confidence level based on the second semantic probability map. The calculation module is used to perform similarity calculation processing on the first feature pyramid, the second feature pyramid, the first attention weight map, the second attention weight map, the first foreground exclusion confidence and the second foreground exclusion confidence based on a preset dynamic similarity calculation engine, and generate the background similarity between the first image and the second image.
9. A computer device, characterized in that, The method includes a memory and a processor, wherein the memory stores computer-readable instructions, and the processor executes the computer-readable instructions to implement the steps of the artificial intelligence-based image analysis method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the steps of the artificial intelligence-based image analysis method as described in any one of claims 1 to 7.