Image semantic matching method and device, equipment and storage medium
By using depth information to assign weights to the feature map in image semantic matching, a depth feature representation map is generated, and the similarity and uncertainty perceptual information entropy comparison loss value is calculated, the problem of low matching accuracy in the prior art is solved, and more accurate semantic matching is achieved.
Patent Information
- Application Number
- CN202510324729.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-19
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2045-03-19
AI Technical Summary
Existing image semantic matching methods are difficult to correctly understand the object geometry and make full use of a variety of feature maps, resulting in low matching accuracy.
By obtaining the depth information of the image to be matched, weights are assigned to the feature map, a depth feature representation map is generated, and a target image descriptor is generated based on this, the image similarity and fusion uncertainty perceived information entropy comparison loss value are calculated, and the matching result is determined.
Improve the perception of object geometric structures, find more semantic matching results, and achieve more accurate semantic matching.
Smart Images

Figure CN119850986A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image analysis technology, and in particular to an image semantic matching method, device, equipment and storage medium. Background Art
[0002] Existing image semantic matching methods often extract features from extracted images by constructing a feature extractor based on a convolutional neural network. The quality of the features depends on the designed network architecture. It is difficult to correctly understand the geometric structure of the object and make full use of multiple feature maps, resulting in low matching accuracy. Summary of the invention
[0003] The main purpose of this application is to provide an image semantic matching method, device, equipment and storage medium, aiming to solve the technical problem that existing semantic matching methods have difficulty in correctly understanding the geometric structure of objects and making full use of multiple feature maps, resulting in low matching accuracy.
[0004] To achieve the above objectives, the present application proposes an image semantic matching method, which includes: Acquire depth information of the image to be matched, and assign weights to the feature map of the image to be matched according to the depth information to obtain a depth feature representation map; Generate a target image descriptor of the image to be matched based on the deep feature representation graph; The image similarity and the fused uncertainty perception information entropy contrast loss value of the pixel points in the to-be-matched image are calculated according to the target image descriptor, and the matching result is determined based on the image similarity and the fused uncertainty perception information entropy contrast value.
[0005] Optionally, the step of generating a target image descriptor of the image to be matched based on the deep feature representation graph includes: Inputting the deep feature representation graph into a target feature fusion network to perform feature channel fusion to generate an initial image descriptor; Calculating the cosine similarity and Gaussian kernel function similarity of the initial image descriptor, constructing a joint similarity matrix and a fusion uncertainty perception information entropy comparison function; The initial fusion weights in the target feature fusion network are optimized based on the joint similarity matrix and the fusion uncertainty perception information entropy comparison function to generate a target image descriptor.
[0006] Optionally, the step of optimizing the initial fusion weights in the target feature fusion network based on the joint similarity matrix and the fusion uncertainty-aware information entropy contrast function to generate a target image descriptor includes: Determining a first optimization objective by comparing the fused uncertainty-aware information entropy loss function; Predicting the positions of key points according to the joint similarity matrix, and determining an error loss function through the positions to generate a second optimization objective; The initial fusion weights in the target feature fusion network are optimized based on the first optimization objective and the second optimization objective to generate a target image descriptor.
[0007] Optionally, the step of optimizing the initial fusion weights in the target feature fusion network based on the first optimization objective and the second optimization objective to generate a target image descriptor includes: Determining the gradient of the initial fusion weight in the target feature fusion network according to the first optimization objective and the second optimization objective; Optimizing the initial fusion weights by using the gradients to obtain target fusion weights, and updating the target feature fusion network based on the target fusion weights; The deep feature representation map is input again into the updated target feature fusion network to generate a target image descriptor.
[0008] Optionally, the step of inputting the deep feature representation map into a target feature fusion network to perform feature channel fusion to generate an initial image descriptor includes: Instantiate the entry channel of the preset feature fusion network according to the number of channels of the deep feature representation map to obtain a target feature fusion network; Inputting the deep feature representation graph into the target feature fusion network for calculation to obtain a feature graph to be fused; The feature maps to be fused with the same number of channels are fused through initial fusion weights to generate an initial image descriptor.
[0009] Optionally, the step of acquiring depth information of the image to be matched, and assigning weights to the feature map of the image to be matched according to the depth information to obtain a depth feature representation map includes: Performing relative depth estimation on the obtained image to be matched to obtain depth information of the image to be matched; Obtaining a depth estimation feature map according to the depth information, and applying a normalized exponential function to the depth estimation feature map to establish a depth distribution model for each pixel in the image to be matched, wherein the depth distribution model is used to calculate the probability that the pixel falls within each depth interval; Applying a maximum index function to the depth distribution model to determine a target depth interval corresponding to each of the pixel points when the probability is maximum; The relative depth weight of the image to be matched is calculated based on the target depth interval, and the relative depth weight is multiplied pixel by pixel by the feature map of the image to be matched to obtain a depth feature representation map.
[0010] Optionally, the step of calculating the image similarity and the fused uncertainty perception information entropy contrast loss value of the pixel points in the to-be-matched image according to the target image descriptor, and determining the matching result based on the image similarity and the fused uncertainty perception information entropy contrast value includes: Calculate the image similarity of the pixels in the to-be-matched image and the fusion uncertainty-aware information entropy contrast loss function value according to the target image descriptor; The pixel points are scored by comparing the image similarity and the fused uncertainty-aware information entropy with the loss function value, and the point with the highest score is selected from the pixel points as the predicted key point of the current semantic matching.
[0011] In addition, to achieve the above-mentioned purpose, the present application also proposes an image semantic matching device, which includes: A feature extraction module, used to obtain depth information of the image to be matched, and assign weights to the feature map of the image to be matched according to the depth information to obtain a depth feature representation map; A feature fusion module, used to generate a target image descriptor of the image to be matched based on the deep feature representation graph; The matching output module is used to calculate the image similarity and the fused uncertainty perception information entropy comparison loss value of the pixel points in the to-be-matched image according to the target image descriptor, and determine the matching result based on the image similarity and the fused uncertainty perception information entropy comparison value.
[0012] In addition, to achieve the above-mentioned purpose, the present application also proposes an image semantic matching device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the image semantic matching method described above.
[0013] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the image semantic matching method described above are implemented.
[0014] The present application discloses the method of obtaining the depth information of the image to be matched, assigning weights to the feature map of the image to be matched according to the depth information, and obtaining a depth feature representation map; generating a target image descriptor of the image to be matched based on the depth feature representation map; calculating the image similarity of the pixels in the image to be matched and the contrast loss value of the fused uncertainty perception information entropy according to the target image descriptor, and determining the matching result based on the image similarity and the contrast value of the fused uncertainty perception information entropy. By embedding the depth information into the feature map, the perception of the geometric structure of the object is improved, so as to find more semantic matching results, and then achieve accurate semantic matching. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0016] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0017] Figure 1 This is a flowchart of the first embodiment of the image semantic matching method of the present application; Figure 2 A schematic diagram of the process of matching based on the target image descriptor in the image semantic matching method of the present application; Figure 3 This is a flow chart of the second embodiment of the image semantic matching method of the present application; Figure 4 This is a schematic diagram of the principle of deep distribution modeling of the image semantic matching method of this application; Figure 5 A schematic diagram of generating an initial image descriptor for the image semantic matching method of this application; Figure 6 This is a flowchart of the third embodiment of the image semantic matching method of the present application; Figure 7 Flow chart of feature fusion in the target feature fusion network of this application; Figure 8 This is a schematic diagram of the module structure of the image semantic matching device according to an embodiment of the present application; Fig. 9 Schematic diagram of the device structure of the hardware operating environment involved in the image semantic matching method in the embodiment of the present application.
[0018] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0019] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0020] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0021] The main solution of the embodiment of the present application is: obtaining the depth information of the image to be matched, and assigning weights to the feature map of the image to be matched according to the depth information to obtain a depth feature representation map; generating a target image descriptor of the image to be matched based on the depth feature representation map; calculating the image similarity and fused uncertainty perception information entropy contrast loss value of the pixel points in the image to be matched according to the target image descriptor, and determining the matching result based on the image similarity and the fused uncertainty perception information entropy contrast value.
[0022] With the rapid development of autonomous driving technology, accurate perception of the vehicle's surrounding environment has become the key to ensuring driving safety and optimizing driving decisions. Traditional two-dimensional image processing is easily affected by lighting changes, occlusions and dynamic targets in complex road environments, such as multi-lane, high-speed driving, night or bad weather conditions, resulting in reduced recognition and matching accuracy. Therefore, semantic correspondence is used with pixel-by-pixel matching technology as the core, so that when the posture and appearance of objects in the image change, the computer can still establish pixel-by-pixel matching results based on semantic information. However, existing methods often extract features from extracted images by constructing a feature extractor based on a convolutional neural network. The quality of the features depends on the designed network architecture. At the same time, existing feature extractors are difficult to correctly understand the geometric structure of objects in the case of deep ambiguity, resulting in low matching accuracy.
[0023] Therefore, the present application provides a semantic matching method that can perceive the geometric structure of an object while making full use of multiple features. By embedding depth information into the feature map, the perception of the geometric structure of the object is improved, so as to find more semantic matching results and achieve accurate image semantic matching.
[0024] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, etc. The following takes the semantic matching unit as an example to illustrate this embodiment and the following embodiments.
[0025] Based on this, the present application embodiment provides an image semantic matching method, referring to Figure 1 , Figure 1This is a flowchart of the first embodiment of the image semantic matching method of the present application.
[0026] In this embodiment, the image semantic matching method includes: Step S10, obtaining depth information of the image to be matched, and assigning weights to the feature map of the image to be matched according to the depth information to obtain a depth feature representation map.
[0027] It should be noted that the images to be matched are two or more pictures that need to be matched in the image semantic matching task. They can be images of the same scene or similar scenes taken from different perspectives, at different times or under different conditions. For example, in the autonomous driving scenario, the images to be matched can be road images taken by the front camera of the vehicle at consecutive time points, or images of the same area taken by cameras at different angles. The objects in these images (such as vehicles, pedestrians, traffic signs, etc.) may change in appearance, posture or position, but have certain semantic associations. Depth information describes the position of objects or pixels in the image relative to the camera in three-dimensional space, indicating the distance of the objects or pixels from the camera. The depth feature representation graph is a new image representation obtained by integrating depth information into the feature graph. It not only contains the feature information in the original feature graph, but also reflects the influence of depth information on the features, that is, the features of different depth areas have different weights or importance in the graph.
[0028] It is understandable that the weights assigned to the feature maps of the image to be matched according to the depth information can be obtained by dividing the depth information into several intervals, for example, it can be divided into depth intervals such as near view, middle view, and far view according to the characteristics and needs of the scene, and then a weight value is set for each interval according to the importance of different intervals or the degree of influence on semantic matching. In the autonomous driving scene, the near view area (such as a few meters to more than ten meters in front of the vehicle) is more critical for driving decisions and will be given a higher weight, because the vehicles, pedestrians and other targets in this area directly affect the driving safety of the vehicle; while the weight of the far view area is relatively low. In the subsequent semantic matching process, the deep feature representation map can provide a more distinguishing and geometric structure perception feature representation for feature fusion and matching. For example, in the target recognition task of autonomous driving, the deep feature representation map can help better identify targets such as vehicles and pedestrians at different depths, improve the accuracy of semantic matching, and thus provide a more reliable basis for the vehicle's driving decisions (such as avoidance, acceleration, deceleration, etc.).
[0029] Step S20: generating a target image descriptor of the image to be matched based on the deep feature representation graph.
[0030] It should be noted that the target image descriptor is a description form of image features generated after operations such as feature channel fusion. It summarizes the key features of the image after depth information integration and feature fusion processing, and can be used for subsequent similarity calculation, comparative learning and other operations between different images, thereby determining the semantic matching relationship between images.
[0031] It should be understood that in the process of generating the target image descriptor, features from different feature extractors (such as self-supervised feature extractors and diffusion model feature extractors) will be fused. Different feature extractors can often mine the feature information of images from different angles and levels. By adding and fusion the features extracted by them after processing them with the above-mentioned deep feature representation graph and operating the feature channel fusion network, it is possible to make full use of various feature resources, avoid the limitations of a single feature extraction method, enrich the semantic information contained in the target image descriptor, and enhance its ability to represent image semantics.
[0032] Step S30, calculating the image similarity and the fused uncertainty perception information entropy contrast loss value of the pixel points in the to-be-matched image according to the target image descriptor, and determining the matching result based on the image similarity and the fused uncertainty perception information entropy contrast value.
[0033] It is important to understand that the matching result is the semantic correspondence between the images to be matched after a series of calculations and analyses. In the image semantic matching task, it is ultimately necessary to clarify which pixels or areas in different images correspond to each other. For example, in an autonomous driving scenario, it is necessary to find the corresponding pixel positions of the same car, the same pedestrian, or the same traffic sign in road images taken from different perspectives, in order to assist in subsequent decision-making, such as target positioning, trajectory analysis, etc.
[0034] It should be understood that when determining the matching results, it is not just based on the image similarity indicator, but a comprehensive consideration of the image similarity and contrast loss value. This can avoid the misjudgment that may be caused by relying on a single indicator. For example, only looking at pixels with high image similarity may result in incorrect matching (because there are some similar but not semantically corresponding parts in the image), and combining the contrast loss value for screening can further eliminate these unreasonable matches, more accurately determine the pixels that are truly semantically corresponding, and make the final matching results more reliable.
[0035] It can be understood that when determining the matching result based on the image similarity and the fused uncertainty perception information entropy contrast loss value, the SoftArgmax function can be used to convert the calculated similarity matrix into a flow field, thereby determining the corresponding predicted key point position of each pixel point on the target image in the source image, and at the same time, combining the fused uncertainty perception information entropy contrast loss function value to screen out those pixels with lower contrast loss values. Finally, the pixels with the highest similarity score and the lowest fused uncertainty perception information entropy contrast loss function loss value or the key points determined by these pixels are used as predicted key points for semantic matching, so as to determine the semantic matching results between the images to be matched.
[0036] In one example, reference Figure 2 , Figure 2 This is a schematic diagram of the process of matching based on the target image descriptor in the image semantic matching method of this application. Starting from the target image descriptor, the cosine and Gaussian kernel joint similarity matrix is calculated. Subsequently, the process is divided into two parallel scoring directions. On the one hand, it is based on the information entropy guidance of uncertainty perception, and on the other hand, it is based on the average endpoint error of the optical flow field. These two goals are intended to score image matching from different angles. Finally, based on the results of the above calculations, the matching degree of each pixel is scored to determine the semantic matching of the image.
[0037] Furthermore, in order to more accurately determine the key points in the image that are most likely to match, step S30 may include: The image similarity and the fused uncertainty-aware information entropy contrast loss function value of the pixel points in the image to be matched are calculated according to the target image descriptor; the pixel points are scored according to the image similarity and the fused uncertainty-aware information entropy contrast loss function value, and the point with the highest score is selected from the pixel points as the predicted key point for the current semantic matching.
[0038] In one example, the image processing module in the autonomous driving system performs feature extraction and feature fusion operations on the collected road images A and B to generate the corresponding target image descriptor, which contains rich feature information, including the shape, color, position and other features of a car in front of the image and the texture features of the road. Then the semantic matching unit calculates the image similarity of the pixels in the two images. For each pixel in the image, taking pixel a as an example, the corresponding target image descriptor vector is calculated with the target image descriptor vector corresponding to all pixels in image B by cosine similarity and Gaussian kernel function similarity, and the obtained similarity matrix is applied to the fusion uncertainty perception information entropy contrast loss function to calculate the fusion uncertainty perception information entropy contrast loss value. After obtaining the image similarity matrix and the loss value of the fusion uncertainty perception information entropy contrast loss function, the prediction key points for semantic matching are screened. Traverse all the pixels in image A and image B, and find those pixels with the highest image similarity score and the lowest loss value of the fusion uncertainty perception information entropy contrast loss function. Assume that in image A and image B, it is found that for pixel b representing the center position of the left front wheel of a car in front, its similarity with a certain pixel in image B is the highest among all the pixels compared with it, reaching 0.95. At the same time, the loss value of the fusion uncertainty perception information entropy contrast loss function corresponding to this pair of pixels is also extremely low, which is more in line with the optimization requirements than other pairs of pixels with high similarity. Then pixel b and is the corresponding position of the center of the left front wheel of the car in the two images, and this pixel can be determined as the prediction key point of semantic matching.
[0039] In this embodiment, the depth information of the image to be matched is obtained, and a weight is assigned to the feature map of the image to be matched according to the depth information to obtain a depth feature representation map; a target image descriptor of the image to be matched is generated based on the depth feature representation map; the image similarity of the pixels in the image to be matched and the contrast loss value of the fused uncertainty perception information entropy are calculated according to the target image descriptor, and the matching result is determined based on the image similarity and the contrast value of the fused uncertainty perception information entropy. By embedding the depth information into the feature map, the perception of the geometric structure of the object is improved, so that more semantic matching results can be found, and accurate semantic matching can be achieved.
[0040] Reference Figure 3 , Figure 3 This is a flow chart of the second embodiment of the image semantic matching method of the present application. Based on the above-mentioned first embodiment, the second embodiment of the image semantic matching method of the present application is proposed. In the second embodiment, the step S10 includes: Step S101 : performing relative depth estimation on the obtained image to be matched to obtain depth information of the image to be matched.
[0041] It should be noted that relative depth estimation is a process of inferring the relative depth information of pixels in an image through image analysis technology, that is, determining the distance between different objects or areas in the image relative to the camera in three-dimensional space, and estimating the depth order or relative depth range of each pixel based on various visual clues in the image, such as texture gradients, light and shadow changes, object size, and perspective relationships.
[0042] It is understandable that relative depth estimation of the obtained image to be matched can conduct a comprehensive visual clue analysis of the image to be matched. For example, texture gradients can provide information about changes in the depth direction of the object surface; the distribution of the illuminated and backlit surfaces of the object can imply its shape and position relationship, and then infer the depth; according to the perspective principle, distant objects will appear smaller in the image, while nearby objects will appear relatively large. By comparing the size ratio of different objects in the image, their relative depth order can be preliminarily determined. After analyzing various visual clues, it is necessary to extract relevant features from the image and integrate these features to obtain depth information. In this process, the depth information provided by different clues will be weighted and fused to obtain a more accurate and reliable depth estimation result. For example, areas with clear textures and obvious light and shadow changes are given higher weights because these areas can usually provide more accurate depth information.
[0043] Step S102, obtaining a depth estimation feature map according to the depth information, and applying a normalized exponential function to the depth estimation feature map to establish a depth distribution model for each pixel in the image to be matched, wherein the depth distribution model is used to calculate the probability that the pixel falls within each depth interval.
[0044] It should be noted that the normalized exponential function converts a real number vector into a vector representing the probability distribution of each category, so that each element in the vector is between 0 and 1, and the sum of all elements is 1. The depth distribution model describes the probability that the depth value of the pixel point falls within each pre-set depth interval. For example, several different depth intervals are pre-set, such as near-field intervals, mid-field intervals, and distant field intervals, and the probability of each pixel point being in these intervals is given by calculation.
[0045] Step S103: Apply a maximum index function to the depth distribution model to determine a target depth interval corresponding to each pixel point when the probability is maximum.
[0046] It should be noted that the maximum index function returns the index value corresponding to the maximum value of a certain objective function in a given set of values. In the application scenario of the depth distribution model, the input is the probability vector of each depth interval corresponding to each pixel point, and the output is the index corresponding to the depth interval with the highest probability. Through this index, the depth interval where the pixel point is most likely to be located can be determined.
[0047] In one example, reference Figure 4 , Figure 4 This is a schematic diagram of the depth distribution modeling principle of the image semantic matching method of this application. For the image of the road in front of the vehicle, after determining the target depth interval corresponding to each pixel through the index function, different weights can be assigned to the pixels in different depth intervals (such as assigning higher weights to the pixels in the depth interval where nearby vehicles, pedestrians, etc. are located), which is used for subsequent image feature processing and semantic matching, and assists the automatic driving system to make reasonable driving decisions, such as timely braking to avoid nearby obstacles. The left part of the figure is a scene of the road in front of a vehicle, which includes elements such as vehicles, pedestrians, and traffic lights. In this scene, the target depth interval corresponding to each pixel can be determined through a certain index function. The image in the middle part shows the annotation of different targets, such as vehicles and pedestrians are marked with boxes of different colors, indicating that different targets can be identified when processing the image. The chart on the right shows the weight distribution of different depth intervals. For example, the red curve represents the weight distribution of nearby targets, and its peak is in the closer depth interval, which means that the system assigns higher weights to nearby targets. The green and blue curves may represent the weight distribution of targets at different distances, with their peaks in relatively distant depth intervals. Through this depth distribution modeling, the system can process image features more accurately in autonomous driving scenarios. Higher weights are given to pixels in the depth intervals where nearby vehicles and pedestrians are located, allowing the system to pay more attention to these key targets when making semantic matches and decisions. For example, when the system detects nearby pedestrians or vehicles, it can make reasonable driving decisions such as braking avoidance in a timely manner, thereby improving the safety and reliability of autonomous driving.
[0048] Step S104: Calculate the relative depth weight of the image to be matched based on the target depth interval, and multiply the relative depth weight by the feature map of the image to be matched pixel by pixel to obtain a depth feature representation map.
[0049] It should be noted that the relative depth weight is the weight value assigned to the pixel points in the image to be matched according to the target depth range. Usually, the pixel points corresponding to the depth range closer to the camera will be assigned a higher weight because they have a greater impact on the overall image understanding and related decisions; while the pixel points farther away from the camera have relatively lower weights. This weight setting is used to highlight the differences in the importance of features in different depth regions.
[0050] It can be understood that, according to the image to be matched, a depth estimation feature map can be obtained based on depth estimation, a normalized exponential function is applied to the depth estimation feature map, and a depth distribution model is established for each pixel. The depth distribution interval is defined in advance as D discrete intervals, such as The depth distribution describes the probability that the depth value of a pixel falls within each depth interval. Applying the depth distribution Function, obtain the most likely depth interval of each pixel in the depth distribution, and obtain the relative depth weight of the image to be matched. Then the relative depth weight is multiplied pixel by pixel with the feature map of the image to be matched obtained from the self-supervised feature extractor and the diffusion model feature extractor to obtain a depth feature representation map weighted by the depth information.
[0051] In one example, reference Figure 5 , Figure 5 This is a schematic diagram of generating the initial image descriptor of the image semantic matching method of this application. First, the image to be matched is processed by the feature extractor and the relative depth estimator respectively to obtain a feature map and depth distribution modeling. The depth weight is obtained by depth distribution modeling. Based on the depth weight, the feature map is combined into a deep feature representation map, and the deep feature representation map is then processed by a feature fusion network. During the processing, an optimization method based on uncertainty perception and information entropy guidance is used to finally generate an initial image descriptor.
[0052] In this embodiment, a relative depth estimation is performed on the obtained image to be matched to obtain the depth information of the image to be matched; a depth estimation feature map is obtained based on the depth information, and a normalized exponential function is applied to the depth estimation feature map to establish a depth distribution model for each pixel in the image to be matched, wherein the depth distribution model is used to calculate the probability that the pixel falls within each depth interval; a maximum index function is applied to the depth distribution model to determine the target depth interval corresponding to each pixel when the probability is maximum; the relative depth weight of the image to be matched is calculated based on the target depth interval, and the relative depth weight is multiplied pixel by pixel with the feature map of the image to be matched to obtain a depth feature representation map. By using the depth estimation feature map to establish a depth distribution model, the possibility of each pixel in different depth intervals is described in a probabilistic form, which can more accurately grasp their distribution in depth and enhance the ability of the depth feature representation map to express the geometric structure of the object.
[0053] Reference Figure 6 , Figure 6 This is a flow chart of the third embodiment of the image semantic matching method of the present application. Based on the above second embodiment, the third embodiment of the image semantic matching method of the present application is proposed. In the third embodiment, the step S20 includes: Step S201, input the deep feature representation map into the target feature fusion network to perform feature channel fusion to generate an initial image descriptor.
[0054] It should be noted that the target feature fusion network is a network structure used to perform feature fusion operations on deep feature representation graphs, and is usually composed of multiple layers with different functions. The initial image descriptor is a form of description of image features generated after operations such as feature channel fusion. It summarizes the key features of the image after deep information integration and feature fusion processing, and can be used for subsequent operations such as similarity calculation and comparative learning between different images, thereby determining the semantic matching relationship between images.
[0055] It is understandable that the target feature fusion network needs to use the characteristics of the convolution layer to extract and fuse features during the feature fusion process. The deep convolution layer uses a larger convolution kernel (such as size 7) to perform feature fusion in the depth direction to capture more macroscopic feature relationships; while the 1×1 convolution layer is used to flexibly adjust the number of channels and refine the feature representation, and the activation layer introduces nonlinearity, allowing the network to learn complex and diverse image semantic features, and achieve effective feature fusion through such progressive convolution operations.
[0056] Furthermore, in order to achieve adaptive matching between the network structure and the input data, the step S201 may include: According to the number of channels of the deep feature representation map, the entry channel of the preset feature fusion network is instantiated to obtain the target feature fusion network; the deep feature representation map is input into the target feature fusion network for calculation to obtain the feature map to be fused; the feature maps to be fused with the same number of channels are fused through the initial fusion weights to generate an initial image descriptor.
[0057] It should be noted that the number of channels is the number of image features described from different dimensions or angles. The initial fusion weight is the weight parameter initially set in the feature fusion process to determine the proportion of different feature maps to be fused during fusion.
[0058] It should be understood that the initial fusion weights can be randomly initialized, and then continuously adjusted through the back-propagation algorithm in the subsequent training process according to specific optimization objectives (such as fusion uncertainty perception information entropy contrast loss function, etc.), so that the fused image descriptor can better reflect the semantic information of the image and improve the accuracy of semantic matching.
[0059] In one example, reference Figure 7 , Figure 7This is a flow chart of feature fusion in the target feature fusion network of this application. First, according to the number of channels of the k input feature representation maps, k feature fusion networks with different numbers of inlet channels are instantiated. The number of outlet channels of the feature fusion network can be unified to 768, which is convenient for the subsequent descriptor operation of the image to be matched. The feature fusion network consists of the following layers from the first layer to the last layer: a deep convolution layer with a convolution kernel size of 7, a convolution layer with a convolution kernel size of 1, an activation layer, and a convolution layer with a convolution kernel size of 1. After obtaining the feature map to be fused with the same number of channels, multiply the feature map to be fused by the learnable fusion weight of the feature fusion network. , and then add the features of k aligned channels to obtain the target image descriptor of the image to be matched.
[0060] Step S202, calculating the cosine similarity and Gaussian kernel function similarity of the initial image descriptor, constructing a joint similarity matrix and a fusion uncertainty perception information entropy comparison function.
[0061] It should be noted that in image semantic matching, image features are usually represented as vectors, and cosine similarity is used to measure the similarity between two image feature vectors. Gaussian kernel function similarity is used to measure the spatial similarity of image features. The joint similarity matrix is a matrix obtained by combining cosine similarity and Gaussian kernel function similarity according to certain rules. Each element in the matrix corresponds to the joint similarity between two image features. The fusion uncertainty-aware information entropy comparison function is used to evaluate and optimize the matching results by comparing information entropy in the image matching process to deal with uncertainty and noise in image data.
[0062] In one example, the cosine similarity and Gaussian kernel function are calculated for the image descriptors to be matched, and by weighted fusion of the cosine similarity and the similarity based on the kernel function, the characteristics of both can be utilized to construct a new joint similarity index. Specifically:
[0063] in, represents the cosine similarity matrix, is the image descriptor to be matched, represents the source image, represents the target image, Represents different pixels of the descriptor.
[0064]
[0065] in, represents the Gaussian kernel function similarity matrix, is the smoothing parameter of the Gaussian kernel.
[0066] Then the two similarity matrices are weighted and fused into a joint similarity matrix :
[0067] At this point, uncertainty is introduced to measure the credibility of the model prediction. A noise parameter is added based on the joint similarity matrix, assuming that the noise conforms to the normal distribution:
[0068] in, represents the variance corresponding to the uncertainty.
[0069] Probability distribution considering uncertainty for:
[0070]
[0071] in, Indicates the source image The strength of a potential match between a location and the target image. Indicates the target image The strength of a potential match between a location and the source image.
[0072] Calculate the information entropy contrast loss function :
[0073]
[0074] Based on the similarity calculation of the initial image descriptor and the application of the fusion uncertainty-aware information entropy comparison function, the uncertainty can be optimized by optimizing the probability distribution of uncertainty and feature similarity. Contrastive learning can shorten the feature distance of similar samples and extend the feature distance of dissimilar samples, thereby optimizing the feature embedding space and making the subsequent matching process more accurate and stable.
[0075] Step S203, optimizing the initial fusion weights in the target feature fusion network based on the joint similarity matrix and the fusion uncertainty-aware information entropy comparison function to generate a target image descriptor.
[0076] It should be understood that the initial fusion weights in the target feature fusion network can be optimized by training all images and key points in a preset data set, and when the training is completed until the network converges, the network weights after the training are saved.
[0077] Furthermore, in order to guide the network to learn a feature embedding space that makes similar sample features closer and dissimilar sample features farther apart during training, and enhance the accuracy and stability of semantic matching, the step S203 may include: The first optimization target is determined by comparing the fusion uncertainty perception information entropy with the loss function; the position of the key point is predicted according to the joint similarity matrix, and the error loss function is determined by the position to generate the second optimization target; based on the first optimization target and the second optimization target, the initial fusion weights in the target feature fusion network are optimized to generate a target image descriptor.
[0078] It can be understood that by predicting the key point position based on the similarity matrix, the Euclidean distance between the predicted key point and the true key point can be used to optimize its flow consistency based on the consistency loss of optical flow matching, and the distance is used as the average endpoint error loss function.
[0079] In one example, the contrast loss from the source image to the target image and from the target image to the source image are calculated respectively, and the two are added together as the first optimization objective: , and its calculation formula is as follows: =
[0080]
[0081]
[0082] in, 1 represents the contrast loss from source image to target image, 2 represents the contrastive loss from the target image to the source image, and N represents the total number of samples. It is the weight that determines the degree of participation of information entropy. The derivation formula of 1 is: 1=
[0083] in, Represents different pixels of the descriptor, Representation and Positive sample pixels with the same label, N represents the total number of samples.
[0084] Accordingly, The derivation formula of 2 is: 2=
[0085] For semantic matching, in order to obtain more accurate matching results, the contrast loss value needs to be minimized.
[0086] The Euclidean distance between the key point and the true key point is used as the average endpoint error loss function to determine the second optimization objective: Based on the obtained gradient of the second optimization target, the back propagation principle can be used to optimize the initial fusion weight parameters in the target feature fusion network. The calculation process is as follows:
[0087]
[0088] in, To add uncertainty to the joint similarity matrix, For the corresponding predicted key points on the target image, represents the real key point, It is the uncertainty regularization term, which controls the uncertainty size during prediction.
[0089] Furthermore, in order to enable the updated network to better capture the semantic features of objects in the image and improve its adaptability to different scenes and targets, the step of optimizing the initial fusion weights in the target feature fusion network based on the first optimization target and the second optimization target to generate the target image descriptor may include: The gradient of the initial fusion weight in the target feature fusion network is determined according to the first optimization target and the second optimization target; the initial fusion weight is optimized by the gradient to obtain the target fusion weight, and the target feature fusion network is updated based on the target fusion weight; the deep feature representation map is input into the updated target feature fusion network again to generate a target image descriptor.
[0090] In one example, the total optimization function is first determined by weighting the two optimization objective functions. : = +β
[0091] Among them, α and β are pre-set optimization weight coefficients.
[0092] Then calculate the total optimization function Regarding the gradient of the initial fusion weight in the target feature fusion network, if the initial fusion weight is expressed as a vector , n is the number of weights, then the gradient of the initial fusion weight is:
[0093] According to the calculated gradient, the optimization algorithm is used to update the initial fusion weights. AdamW is used as the optimizer, the cosine annealing learning rate planner, the learning rate is set to 1e-3, the batch size is 2, and the updated target fusion weights are calculated. The obtained target fusion weights are applied to the target feature fusion network to replace the original initial fusion weights to complete the network update. Then, the previously obtained deep feature representation graph is input again into the updated target feature fusion network to generate the target image descriptor.
[0094] In this embodiment, the deep feature representation map is input into the target feature fusion network for feature channel fusion to generate an initial image descriptor; the cosine similarity and Gaussian kernel function similarity of the initial image descriptor are calculated to construct a joint similarity matrix and a fusion uncertainty perception information entropy comparison function; based on the joint similarity matrix and the fusion uncertainty perception information entropy comparison function, the initial fusion weights in the target feature fusion network are optimized to generate a target image descriptor. Based on the joint similarity matrix, the fusion uncertainty perception information entropy comparison loss function and the similarity matrix are determined, and the optimization target is further determined by the fusion uncertainty perception information entropy comparison loss function, guiding the network to learn the feature embedding space that makes similar sample features closer and dissimilar sample features farther apart during the training process, thereby enhancing the accuracy and stability of semantic matching.
[0095] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the image semantic matching method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0096] This application also provides an image semantic matching device, please refer to Figure 8 , the image semantic matching device comprises: The feature extraction module 10 is used to obtain the depth information of the image to be matched, and assign weights to the feature map of the image to be matched according to the depth information to obtain a depth feature representation map; A feature fusion module 20, configured to generate a target image descriptor of the image to be matched based on the deep feature representation graph; The matching output module 30 is used to calculate the image similarity and fused uncertainty perception information entropy contrast loss value of the pixel points in the to-be-matched image according to the target image descriptor, and determine the matching result based on the image similarity and the fused uncertainty perception information entropy contrast value.
[0097] The image semantic matching device provided by the present application adopts the image semantic matching method in the above-mentioned embodiment, which can solve the problem that the existing semantic matching method has difficulty in correctly understanding the geometric structure of the object and making full use of multiple feature maps, resulting in the technical problem of low matching accuracy. Compared with the prior art, the beneficial effects of the image semantic matching device provided by the present application are the same as the beneficial effects of the image semantic matching method provided by the above-mentioned embodiment, and the other technical features in the image semantic matching device are the same as the features disclosed in the above-mentioned embodiment method, which will not be repeated here.
[0098] The present application provides an image semantic matching device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the image semantic matching method in the above-mentioned embodiment one.
[0099] Reference below Fig. 9 , which shows a schematic diagram of the structure of an image semantic matching device suitable for implementing an embodiment of the present application. The image semantic matching device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig. 9 The image semantic matching device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0100] like Fig. 9As shown, the image semantic matching device may include a processing device 1001 (such as a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the image semantic matching device are also stored. The processing device 1001, ROM1002 and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the image semantic matching device to communicate with other devices wirelessly or by wire to exchange data. Although the image semantic matching device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0101] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0102] The image semantic matching device provided by the present application adopts the image semantic matching method in the above embodiment, which can solve the problem that the existing semantic matching method has difficulty in correctly understanding the geometric structure of the object and making full use of multiple feature maps, resulting in the technical problem of low matching accuracy. Compared with the prior art, the beneficial effects of the image semantic matching device provided by the present application are the same as the beneficial effects of the image semantic matching method provided by the above embodiment, and the other technical features in the image semantic matching device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0103] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0104] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0105] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, wherein the computer-readable program instructions are used to execute the image semantic matching method in the above-mentioned embodiment.
[0106] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.
[0107] The computer-readable storage medium may be included in the image semantic matching device; or may exist independently without being assembled into the image semantic matching device.
[0108] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the image semantic matching device, the image semantic matching device executes the image semantic matching method described above.
[0109] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0110] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0111] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0112] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned image semantic matching method, and can solve the technical problem that the existing semantic matching method has difficulty in correctly understanding the geometric structure of the object and making full use of multiple feature maps, resulting in low matching accuracy. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the image semantic matching method provided by the above-mentioned embodiment, and will not be repeated here.
[0113] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A method for image semantic matching, characterized in that: The image semantic matching method comprises: Acquire depth information of the image to be matched, and assign weights to the feature map of the image to be matched according to the depth information to obtain a depth feature representation map; Generate a target image descriptor of the image to be matched based on the deep feature representation graph; The image similarity and the fused uncertainty perception information entropy contrast loss value of the pixel points in the to-be-matched image are calculated according to the target image descriptor, and the matching result is determined based on the image similarity and the fused uncertainty perception information entropy contrast value.
2. The image semantic matching method according to claim 1, characterized in that: The step of generating a target image descriptor of the image to be matched based on the deep feature representation graph comprises: Inputting the deep feature representation graph into a target feature fusion network to perform feature channel fusion to generate an initial image descriptor; Calculating the cosine similarity and Gaussian kernel function similarity of the initial image descriptor, constructing a joint similarity matrix and a fusion uncertainty perception information entropy comparison function; The initial fusion weights in the target feature fusion network are optimized based on the joint similarity matrix and the fusion uncertainty perception information entropy comparison function to generate a target image descriptor.
3. The image semantic matching method according to claim 2, characterized in that: The step of optimizing the initial fusion weights in the target feature fusion network based on the joint similarity matrix and the fusion uncertainty perception information entropy comparison function to generate a target image descriptor includes: Determining a first optimization objective by comparing the fused uncertainty-aware information entropy loss function; Predicting the positions of key points according to the joint similarity matrix, and determining an error loss function through the positions to generate a second optimization objective; The initial fusion weights in the target feature fusion network are optimized based on the first optimization objective and the second optimization objective to generate a second image descriptor.
4. The image semantic matching method according to claim 3, characterized in that: The step of optimizing the initial fusion weights in the target feature fusion network based on the first optimization objective and the second optimization objective to generate a second image descriptor comprises: Determining the gradient of the initial fusion weight in the target feature fusion network according to the first optimization objective and the second optimization objective; Optimizing the initial fusion weights by using the gradients to obtain target fusion weights, and updating the target feature fusion network based on the target fusion weights; The deep feature representation map is input again into the updated target feature fusion network to generate a second image descriptor.
5. The image semantic matching method according to claim 2, characterized in that: The step of inputting the deep feature representation map into a target feature fusion network to perform feature channel fusion to generate an initial image descriptor comprises: Instantiate the entry channel of the preset feature fusion network according to the number of channels of the deep feature representation map to obtain a target feature fusion network; Inputting the deep feature representation graph into the target feature fusion network for calculation to obtain a feature graph to be fused; The feature maps to be fused with the same number of channels are fused through initial fusion weights to generate an initial image descriptor.
6. The image semantic matching method according to claim 1, characterized in that: The step of obtaining the depth information of the image to be matched, and assigning a weight to the feature map of the image to be matched according to the depth information to obtain a depth feature representation map includes: Performing relative depth estimation on the obtained image to be matched to obtain depth information of the image to be matched; Obtaining a depth estimation feature map according to the depth information, and applying a normalized exponential function to the depth estimation feature map to establish a depth distribution model for each pixel in the image to be matched, wherein the depth distribution model is used to calculate the probability that the pixel falls within each depth interval; Applying a maximum index function to the depth distribution model to determine a target depth interval corresponding to each of the pixel points when the probability is maximum; The relative depth weight of the image to be matched is calculated based on the target depth interval, and the relative depth weight is multiplied pixel by pixel by the feature map of the image to be matched to obtain a depth feature representation map.
7. The image semantic matching method according to any one of claims 1 to 6, characterized in that: The step of calculating the image similarity and the fused uncertainty perception information entropy contrast loss value of the pixel points in the to-be-matched image according to the target image descriptor, and determining the matching result based on the image similarity and the fused uncertainty perception information entropy contrast loss value comprises: Calculate the image similarity of the pixels in the to-be-matched image and the fusion uncertainty-aware information entropy contrast loss function value according to the target image descriptor; The pixel points are scored by comparing the image similarity and the fused uncertainty-aware information entropy with the loss function value, and the point with the highest score is selected from the pixel points as the predicted key point of the current semantic matching.
8. An image semantic matching device, characterized in that: The device comprises: A feature extraction module, used to obtain depth information of the image to be matched, and assign weights to the feature map of the image to be matched according to the depth information to obtain a depth feature representation map; A feature fusion module, used to generate a target image descriptor of the image to be matched based on the deep feature representation graph; The matching output module is used to calculate the image similarity and fused uncertainty perception information entropy contrast loss value of the pixel points in the to-be-matched image according to the target image descriptor, and determine the matching result based on the image similarity and the fused uncertainty perception information entropy contrast loss value.
9. An image semantic matching device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the image semantic matching method according to any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the image semantic matching method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Image matching method and device, equipment and storage medium
CN110781911A
Image feature matching method, system and device and computer storage medium
CN119251527A
Air conditioner for greenhouse
KR1020240013369A
Binocular matching method and apparatus, device and storage medium
US20210042954A1
Image processing method and apparatus, computer device, and storage medium
WO2023273102A1