Construction method and device of image retrieval database, electronic equipment and medium
By dynamically adjusting the grid size and combining visual features with spatial position features, an image retrieval database is constructed, which solves the shortcomings of fixed grid division in remote sensing image processing and realizes efficient and accurate retrieval of remote sensing images, which is suitable for a variety of complex scenarios.
Patent Information
- Application Number
- CN202511241400.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-02
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2045-09-02
AI Technical Summary
In existing remote sensing image processing technologies, fixed grid division strategies cannot adapt to the complexity and non-uniformity of object distribution, resulting in the fragmentation of key feature areas or redundant division of non-significant areas, affecting the accuracy of remote sensing image matching and retrieval.
The spatial grid size is dynamically adjusted according to population density and area type. Through adaptive grid division, combined with visual features and spatial location features, an image retrieval database is constructed to achieve accurate matching and retrieval of remote sensing images.
It achieves efficient and accurate retrieval of remote sensing images, supports high-precision data support for complex scenarios such as disaster emergency response, smart city management, and agricultural resource monitoring, and improves the retrieval efficiency and accuracy of remote sensing images.
Smart Images

Figure CN120744166A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of remote sensing imaging technology, and in particular to a method, device, electronic equipment, and medium for constructing an image retrieval database. Background Art
[0002] Remote sensing imagery, as an essential means of acquiring surface information, has been widely used in a variety of fields, including urban planning, environmental monitoring, disaster warning, and resource surveys. With the rapid development of remote sensing technology and the increasing variety of satellite sensors, remote sensing data has become multi-source, multi-temporal, multi-resolution, and multi-modal. Faced with the ever-increasing volume of remote sensing image data, efficient and accurate image retrieval has become a crucial research topic in remote sensing information processing. Summary of the Invention
[0003] In view of this, one aspect of the present application provides a method for constructing an image retrieval database, the method comprising: Obtain the population density of the area to be processed, the current area type and the remote sensing image to be processed; Determining a current spatial grid size according to the population density and the current area type; and dividing the area to be processed based on the current spatial grid size to obtain grid areas; Matching the remote sensing image to be processed with the grid area to obtain a candidate grid area whose matching degree meets a preset condition; Extracting visual features of the remote sensing image to be processed in the candidate grid area; Based on the visual features, an image retrieval database is constructed.
[0004] Optionally, determining the current spatial grid size according to the population density and the current area type includes: Obtaining a current reference grid size and a pre-established mapping relationship; wherein the mapping relationship is a correspondence between region types and region weighting factors; the higher the population density represented by the region type, the larger the corresponding region weighting factor; Determining a current region weighting factor according to the mapping relationship and the current region type; The current spatial grid size is determined by the current reference grid size, the current regional weighting factor and the population density; wherein the population density is negatively correlated with the current spatial grid size; and the current regional weighting factor is positively correlated with the current spatial grid size.
[0005] Optionally, get the current base grid size, including: determining whether the population density is greater than a density threshold; If it is larger, the first size is used as the current reference grid size; If not, determine whether the population density is greater than a preset multiple of the density threshold; the preset multiple is less than 1; if greater, use the second size as the current reference grid size; if not greater, use the third size as the current reference grid size; wherein the first size is smaller than the second size, and the second size is smaller than the third size.
[0006] Optionally, matching the remote sensing image to be processed with the grid area to obtain a candidate grid area whose matching degree meets a preset condition includes: Determining a first spatial consistency index between the remote sensing image to be processed and the grid area; and determining whether there is a target grid whose first spatial consistency index is 100%; If so, taking the target grid as the candidate grid area; If it does not exist, perform the following steps: Reconstructing the missing data in the grid area to obtain a reconstructed grid area; A second spatial consistency index between the reconstructed grid area and the remote sensing image to be processed is determined; and an area where the second spatial consistency index is greater than an index threshold is used as the candidate grid area.
[0007] Optionally, constructing an image retrieval database based on the visual features includes: Assigning a unique spatial identifier to the grid area, and assigning a unique image identifier to the image corresponding to the grid area; Acquiring spatial attribute information of the candidate grid area; and preprocessing the visual features to obtain a visual feature vector; constructing an association relationship between the visual feature vector and the spatial attribute information according to the spatial identifier and the image identifier; Based on the visual feature vector, a visual index based on vector similarity is constructed; based on the spatial attribute information, a position index based on spatial topology is constructed; and based on the association relationship, a joint index of the visual space is constructed to obtain the image retrieval database.
[0008] Optionally, before matching the remote sensing image to be processed with the grid area, the method includes: Extracting image metadata from the remote sensing image to be processed; Parsing the image metadata; and determining whether the remote sensing image to be processed contains coordinate reference system information based on the parsing result; If included, based on the coordinate reference system information, read the spatial geographic information of the remote sensing image to be processed; and enter the step of matching the remote sensing image to be processed with the grid area.
[0009] Optionally, if the coordinate reference system information does not exist, the method includes: Extracting keywords from the file name of the remote sensing image to be processed; Matching the file name keywords in a pre-built coordinate reference system database; Determining, based on the matching result, whether a matching target coordinate reference system exists in the coordinate reference system database; If so, based on the target coordinate reference system, read the spatial geographic information and enter the step of matching the remote sensing image to be processed with the grid area; If not, the remote sensing image to be processed is converted into a default coordinate reference system, and the step of matching the remote sensing image to be processed with the grid area is entered.
[0010] Another aspect of the present application provides a device for constructing an image retrieval database, the device comprising: The target acquisition module is used to obtain the population density of the area to be processed, the current area type and the remote sensing image to be processed; a spatial grid size determination module, configured to determine a current spatial grid size based on the population density and the current area type; and to divide the area to be processed based on the current spatial grid size to obtain grid areas; A grid matching module, configured to match the remote sensing image to be processed with the grid area to obtain a candidate grid area whose matching degree meets a preset condition; A visual feature extraction module, configured to extract visual features of the remote sensing image to be processed in the candidate grid area; The database construction module is used to construct an image retrieval database based on the visual features.
[0011] Another aspect of the present application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the computer program, the steps of the method for constructing the image retrieval database are implemented.
[0012] Another aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the method for constructing an image retrieval database when the program is executed by a processor.
[0013] The present application provides a method, device, electronic device, and medium for constructing an image retrieval database, which has the following beneficial effects: dynamically dividing spatial grids based on geographic semantic features such as population density and regional type in different regions, that is, automatically adjusting the grid granularity to ensure fine division of high-density population areas and efficient division of low-density population areas, and performing precise grid planning based on the actual geographic features of different regions, thereby meeting the differentiated needs of complex geographic scenes. Furthermore, remote sensing images are matched based on the dynamically adjusted spatial grid, visual features in candidate grid areas are accurately extracted, and an image retrieval database is established based on the visual features, providing accurate data support for remote sensing image retrieval, thereby achieving efficient and accurate retrieval of remote sensing images. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 A flowchart of a method for constructing an image retrieval database provided in an embodiment of the present application; Figure 2 A schematic diagram of the principle of a method for constructing an image retrieval database provided in an embodiment of the present application; Figure 3 A schematic diagram of the principle of a method for obtaining the current reference grid size provided in an embodiment of the present application; Figure 4 A schematic diagram illustrating the principle of a method for constructing an image retrieval database provided in another embodiment of the present application; Figure 5 A schematic diagram of the structure of a device for constructing an image retrieval database provided in an embodiment of the present application; Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0015] The reference numerals are as follows: 50 is a target acquisition module, 51 is a spatial grid size determination module, 52 is a grid matching module, 53 is a visual feature extraction module, 54 is a database construction module, 60 is a memory, 61 is a processor, 62 is a display screen, 63 is an input and output interface, 64 is a communication interface, 65 is a power supply, 66 is a communication bus, 601 is a computer program, 602 is an operating system, and 603 is data. DETAILED DESCRIPTION
[0016] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. As used in this application and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include the plural forms, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
[0017] It should be understood that although the terms first, second, third, etc. may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0018] Figure 1 A flowchart of a method for constructing an image retrieval database provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the method includes: S10: Obtaining the population density of the area to be processed, the current area type and the remote sensing image to be processed; Current image spatial partitioning methods generally rely on a fixed grid partitioning strategy, which segments remote sensing images according to predetermined rules, such as fixed-size slices. While this approach is simple to implement, it ignores the complexity and heterogeneity of object distribution within the image. For example, urban areas may contain densely populated buildings, while suburban areas may be sparsely populated. A fixed grid struggles to adaptively reflect this spatial heterogeneity, resulting in the fragmentation of key feature areas or redundant partitioning of non-significant areas. This not only affects the integrity of subsequent feature representation but also reduces the accuracy of remote sensing image matching and retrieval.
[0019] Figure 2 The schematic diagram of the principle of a method for constructing an image retrieval database provided in the embodiment of the present application is provided. In order to solve the above technical problems, Figure 2 As shown, in an optional embodiment, the method for constructing an image retrieval database provided by the present application includes constructing an adaptive grid area.
[0020] Specifically, it is understood that different geographical areas have different population densities and different area types. In order to ensure different requirements for division accuracy in different areas, in an optional embodiment, the population density of the area to be processed, the current area type, and the remote sensing image to be processed are obtained.
[0021] The area to be processed can be an area in a city or an area in the suburbs. This application does not limit the division rules and area size of the area to be processed. The area type refers to the type of area to be processed. In specific embodiments, it can be divided according to administrative regions (provinces, cities, counties, communities), or divided according to urban and rural settlements. This application does not limit this. For example, in an optional embodiment, the area type can be divided into urban, suburban, rural, and mountainous areas.
[0022] It should be noted that the remote sensing images to be processed refer to images related to the area to be processed obtained from an open source remote sensing image database. This application does not limit the acquisition method, quantity, or manner of the remote sensing images to be processed. Furthermore, it should be noted that in an optional embodiment, the population density of the area to be processed can be obtained based on a GIS (Geographic Information System Database).
[0023] S11: Determine the current spatial grid size according to the population density and the current area type; and divide the area to be processed based on the current spatial grid size to obtain grid areas; Furthermore, to meet the accuracy requirements for partitioning different regions, the current spatial grid size used to partition the processing area is determined based on population density and the current region type. It is understandable that in areas with high population density, higher requirements for partitioning accuracy are required, so a smaller current spatial grid size can be selected. Region type is also closely related to population density. If the region type indicates a higher level of development in the processing area, the population density is often higher, so a smaller current spatial grid size can be selected.
[0024] After determining the current spatial grid size, the area to be processed is divided based on the size to obtain a large number of grid areas. The obtained grid areas can be of any shape, for example, a rectangle, which is not limited in this application. However, to facilitate subsequent calculations and processing for database construction, in a preferred embodiment, the grid areas are squares, and accordingly, the current spatial grid size refers to the side length of the square grid areas.
[0025] In an optional embodiment, an adaptive grid is generated in real time based on GIS attribute data, supporting grid computing caching and distributed computing (eg, edge node execution).
[0026] S12: matching the remote sensing image to be processed with the grid area to obtain a candidate grid area whose matching degree meets a preset condition; On the basis of the above embodiment, in order to construct the relationship between the grid area and the remote sensing image to be processed, an image retrieval database is established to provide data support for subsequent image retrieval. Specifically, Figure 2 As shown, further, the image and the grid are matched, the remote sensing image to be processed is matched with the divided grid area, and according to the matching result, the candidate grid area whose matching degree meets the preset conditions is extracted.
[0027] In an optional embodiment, the matching degree calculation can be a calculation of spatial relationships such as area coverage, longitude and latitude consistency, etc., which is not limited in this application. The higher the matching degree, the closer the image is to the geographic location corresponding to the grid area, that is, the more likely the image is from the corresponding grid geographic location.
[0028] S13: extracting visual features of the remote sensing image to be processed in the candidate grid area; S14: Build an image retrieval database based on visual features.
[0029] In order to realize the retrieval of remote sensing images, it is necessary to establish a correspondence between the remote sensing images and the actual geographical locations, that is, to establish a correspondence between the remote sensing images to be processed and the candidate grid areas. Figure 2 As shown, the visual features of the remote sensing image to be processed corresponding to the candidate grid area are extracted so as to establish an image retrieval database based on the visual features. Thus, in subsequent practical applications, image retrieval can be performed in the image retrieval database based on the visual features.
[0030] It should be noted that in an optional embodiment, to improve data processing efficiency, visual features of the remote sensing imagery to be processed in the candidate grid area can be extracted in parallel. Specifically, multiple GPU nodes can be deployed to perform feature extraction in parallel, supporting multiple models such as ResNet and ViT.
[0031] The image retrieval database construction method provided in the embodiments of this application can be applied to the massive amount of high-temporal and spatial resolution data generated by high-resolution satellites and drone remote sensing. The image retrieval database constructed based on this application can quickly locate changed areas during disaster emergency response and accurately identify illegal construction targets in smart city management, providing efficient and reliable retrieval support for the intelligent application of remote sensing imagery.
[0032] The method provided in this application can also be applied to scenarios of refined urban governance. Specifically, it supports dynamic grid division with millimeter-level geographic entity perception, can automatically identify micro-change areas during urban renewal, and achieve sub-pixel detection of elements such as building outline evolution and road topology changes.
[0033] It can also be applied to disaster emergency response scenarios. That is, through the alignment of multimodal features with unified time and space benchmarks, it can complete three-dimensional dynamic comparative analysis of the disaster impact range across time phases, and support real-time quantitative assessment of factors such as post-earthquake building damage and flood inundation range.
[0034] In addition, it can also be applied to agricultural resource monitoring scenarios. Specifically, by integrating multispectral time series features with spatial autocorrelation models, it can realize spatial clustering analysis of crop growth in a large area of farmland, and support precision agriculture applications such as growth cycle anomaly detection and yield prediction.
[0035] For remote sensing data assetization scenarios, a joint visual, spatial, and semantic embedding space can be constructed to automatically screen high-quality image slices that meet specific spatial distribution patterns, significantly improving the efficiency of building remote sensing data cubes.
[0036] Therefore, the method for constructing an image retrieval database provided in the embodiment of the present application dynamically divides the spatial grid according to geographic semantic features such as population density and area type in different areas. That is, the grid granularity is automatically adjusted to ensure fine division of high-population density areas and efficient division of low-population density areas. Accurate grid planning is performed based on the actual geographic characteristics of different areas, thereby meeting the differentiated needs of complex geographic scenes. Furthermore, remote sensing images are matched based on the dynamically adjusted spatial grid, visual features in candidate grid areas are accurately extracted, and an image retrieval database is established based on the visual features, providing accurate data support for remote sensing image retrieval, thereby achieving efficient and accurate retrieval of remote sensing images.
[0037] In an optional embodiment, determining the current spatial grid size based on population density and current area type includes: Obtain the current benchmark grid size and the pre-built mapping relationship; the mapping relationship is the correspondence between the region type and the region weighting factor; the higher the population density represented by the region type, the larger the corresponding region weighting factor; Determine the current region weighting factor based on the mapping relationship and the current region type; The current spatial grid size is determined by the current benchmark grid size, the current regional weighting factor and the population density; among which, the population density is negatively correlated with the current spatial grid size; and the current regional weighting factor is positively correlated with the current spatial grid size.
[0038] In an optional embodiment, in order to accurately calculate the current spatial grid size of different to-be-processed regions, a correspondence between region types and region weighting factors is pre-established to obtain a mapping relationship. This mapping relationship can be stored in a table or text format, which is not limited in this application.
[0039] In a specific embodiment, the higher the population density represented by the region type, that is, the higher the corresponding population density, that is, the higher the development level of the area to be processed, the larger the corresponding region weighting factor. In fact, it can be understood that there is a positive correlation between population density and region weighting factor.
[0040] For example, for cities and suburbs, the population density of cities is higher than that of suburbs. When performing adaptive grid division, the accuracy requirement of cities is higher than that of suburbs. Therefore, the regional weighting factor corresponding to cities is greater than the regional weighting factor corresponding to suburbs.
[0041] In an optional embodiment, the region types include urban, suburban and rural areas, and the regional weighting factor corresponding to the city is 1.0±0.1, the regional weighting factor corresponding to the suburb is 0.5±0.1, and the regional weighting factor corresponding to the rural area is 0.2±0.1.
[0042] It is understandable that based on the pre-built mapping relationship, the current region weighting factor corresponding to the current region type can be found in the mapping relationship. Furthermore, the current spatial grid size is determined by the current reference grid size, the current region weighting factor, and the population density. In an optional embodiment, the specific calculation formula is formula (1): (1) in, is the current spatial grid size, is the current base grid size, is the current region weighting factor, is the adjustment coefficient, is the density threshold, is the population density. In an optional embodiment, the adjustment coefficient The zero adjustment factor can be set to 0.01. In an optional embodiment, the current reference grid size The value range is 500 meters to 5000 meters.
[0043] According to formula (1), in a specific embodiment, the population density With the current spatial grid size negatively correlated, i.e., population density The larger the size, the corresponding current space grid size The smaller the current area weighting factor With the current spatial grid size Positively correlated, that is, the current regional weighting factor The larger the size, the larger the current space grid size. The bigger.
[0044] It should be noted that the density threshold is a preset population density threshold, and the density threshold With the current spatial grid size In a specific embodiment, the selection can be made according to actual business needs. For example, for scenarios with high accuracy requirements, a smaller density threshold can be selected. , thereby improving the grid division accuracy. In an optional embodiment, the density threshold The value range can be set from 500 people / square kilometer to 2000 people / square kilometer.
[0045] Furthermore, it should be noted that, in an optional embodiment, when the rate of change in population density reaches a preset value, adaptive grid division is triggered, thereby dynamically updating the image retrieval database and ensuring its accuracy. However, it is worth noting that in specific embodiments, population density changes may occur in certain areas. To conserve computing resources, grid re-division and image retrieval database updates can be performed only in target areas where the rate of change in population density reaches the preset value.
[0046] Figure 3 This is a schematic diagram of the principle of a method for obtaining the current reference grid size provided in an embodiment of the present application. Based on the above embodiment, as an optional embodiment, Figure 3 As shown, get the current base grid size, including: Determine whether the population density is greater than a density threshold; If it is larger, the first size is used as the current base grid size; If not, determine whether the population density is greater than a preset multiple of the density threshold; the preset multiple is less than 1; if greater, use the second size as the current benchmark grid size; if not greater, use the third size as the current benchmark grid size; wherein the first size is smaller than the second size, and the second size is smaller than the third size.
[0047] Based on the above embodiment, and based on formula (1), it can be seen that the current reference grid size is closely related to the current spatial grid size, that is, they are positively correlated. Therefore, in order to further improve the accuracy of the current spatial grid size, in an optional embodiment, a current reference grid size that is more suitable for the area to be processed is obtained based on the population density and density threshold.
[0048] Specifically, in a specific embodiment, Figure 3 As shown, it is determined whether the population density is greater than the density threshold. If so, the first size is used as the current base grid size. Otherwise, it is further determined whether the population density is greater than a preset multiple of the density threshold, for example, determining whether the population density is greater than one-third of the density threshold. If so, the second size is used as the current base grid size. If still not, the third size is used as the current base grid size.
[0049] It should be noted that the first size is smaller than the second size, and the second size is smaller than the third size. For example, the first size is 1000 meters, the second size is 2000 meters, and the third size is 5000 meters. It is understood that as the population density increases, the corresponding size decreases. In other words, population density is negatively correlated with the current baseline grid size.
[0050] As an optional embodiment, matching the remote sensing image to be processed with the grid area to obtain a candidate grid area whose matching degree meets a preset condition includes: Determining a first spatial consistency index between the remote sensing image to be processed and the grid area; and determining whether there is a target grid with a first spatial consistency index of 100%; If it exists, the target grid is used as the candidate grid area; If it does not exist, perform the following steps: Reconstruct the missing data in the grid area to obtain a reconstructed grid area; A second spatial consistency index between the reconstructed grid area and the remote sensing image to be processed is determined; and an area where the second spatial consistency index is greater than an index threshold is used as a candidate grid area.
[0051] like Figure 2 As shown, in a specific embodiment, in order to improve the matching accuracy between the remote sensing image to be processed and the grid area, and thereby ensure the data support of the subsequent image retrieval database, the image grid matching method provided in this application is a two-level matching strategy.
[0052] Specifically, in a specific embodiment, the first spatial consistency index of the remote sensing image to be processed and the grid area is first calculated, wherein the first spatial consistency index is used to reflect the spatial consistency between the remote sensing image to be processed and the grid area, and the first spatial consistency index may include but is not limited to area coverage and longitude and latitude consistency, which is not limited in this application.
[0053] Furthermore, in the two-level matching strategy, the core concept of the first-level strategy is to achieve complete coverage as much as possible, that is, to use completely consistent grid areas as candidate grid areas. It is understood that a first spatial consistency index can be calculated between different grid areas and corresponding sub-areas of the remote sensing image to be processed, thereby obtaining multiple first spatial consistency indices.
[0054] Therefore, further, in a specific embodiment, it is determined whether there are 100% target grids in all the calculated first spatial consistency indicators, that is, it is determined whether there are grid areas that completely match the remote sensing images to be processed. If so, these target grids are used as candidate grid areas.
[0055] In another optional embodiment, if a 100% target grid does not exist, a second-level strategy can be implemented to ensure sufficient data in the image retrieval database. Specifically, the missing data in the grid area can be reconstructed to obtain a reconstructed grid area. It is understood that the failure to obtain a 100% target grid may be due to factors such as insufficient pixel values in certain areas of the remote sensing image being processed. In this case, the missing data in the grid area can be reconstructed, i.e., filled.
[0056] In an optional embodiment, the second-level strategy may be to calculate the real-time spatial relationship between the remote sensing image and the grid area using the PostGIS-based ST_Intersects spatial predicate, and select grid areas with coverage greater than a coverage threshold as candidate grid areas. ST_Intersects is one of the OGC standard spatial predicates used to determine whether two geometric objects have any intersection. Furthermore, in an optional embodiment, the coverage threshold ranges from 0.7 to 1, and the corresponding coverage threshold can be selected based on actual needs.
[0057] Furthermore, the second spatial consistency index between the reconstructed grid area and the remote sensing image to be processed is calculated again, so that the areas where the second spatial consistency index is greater than the index threshold are selected as candidate grid areas. Of course, it should be noted that if there is no area greater than the index threshold, the current remote sensing image to be processed is discarded to ensure the quality of the image retrieval database.
[0058] In an optional embodiment, an image retrieval database is constructed based on visual features, including: Assign a unique spatial identifier to the grid area and assign a unique image identifier to the image corresponding to the grid area; Obtain spatial attribute information of the candidate grid area; and preprocess the visual features to obtain a visual feature vector; According to the spatial identifier and the image identifier, the association relationship between the visual feature vector and the spatial attribute information is constructed; Based on the visual feature vector, a visual index based on vector similarity is constructed; based on the spatial attribute information, a position index based on spatial topology is constructed; and based on the association relationship, a joint index of the visual space is constructed to obtain an image retrieval database.
[0059] At present, at the level of feature expression and retrieval mechanisms, existing methods mostly use independent feature extraction techniques, for example, extracting texture, color, shape or spectral features separately, and performing similarity matching based on a single modality. Such methods ignore the inherent correlation between visual features and spatial attributes in remote sensing images and fail to build an effective collaborative retrieval mechanism. For example, the same feature may show similar spatial distribution patterns and contextual relationships in different images, but if only relying on pixel-level feature matching, it is difficult to capture this high-level semantic information. At the same time, the lack of comprehensive modeling of factors such as spatial topological relationships, directionality, and scale changes limits the system's generalization ability in cross-modal and cross-temporal data.
[0060] Therefore, in order to solve the above technical problems, in an optional embodiment, as Figure 2As shown, visual features are combined with spatial position features to provide a dual-driven retrieval mechanism based on the semantic similarity of visual content and the spatial topological association.
[0061] Specifically, in this embodiment, to enable rapid identification and retrieval of grid areas and their corresponding images, each grid area is assigned a unique spatial identifier (i.e., a grid ID), and each corresponding image is assigned a unique image identifier (i.e., an image ID). It will be appreciated that, based on the above embodiment, each candidate grid area has a unique spatial identifier and a corresponding unique image identifier.
[0062] At the same time, based on the spatial identifier, spatial attribute information is extracted from the candidate grid area, where the spatial attribute information may include but is not limited to the grid center coordinates, spatial consistency index, and area type. In an optional embodiment, the area type may be in the form of a number or text, which is not limited in this application. In addition, in an optional embodiment, a deep convolutional neural network can be used to extract visual features from the candidate grid area. Further, after pre-processing such as normalization of the visual features, a visual feature vector is obtained.
[0063] In an optional embodiment, the deep convolutional neural network can be an improved model based on the ResNet34 deep convolutional neural network. The model's last fully connected layer is replaced with a 512-dimensional feature output layer. A multimodal feature fusion strategy is used to fuse the output features of the conv3_x and conv4_x layers. Convolutional layers of different depths, conv3_x and conv4_x, can extract visual features at different levels of abstraction (for example, conv3_x may capture more detailed edges and textures, while conv4_x captures more abstract semantic information).
[0064] In a specific embodiment, pre-trained image features are used to extract the backbone network. The feature output layer dynamically adapts to the grid size, and the feature output layer dimensions are adjusted based on the grid spatial resolution. In an optional embodiment, intermediate layer features from different depths of the neural network can be fused, and the fused features are weighted by channel attention, thereby improving the accuracy of visual feature extraction.
[0065] Furthermore, an association between the visual feature vector and the spatial attribute information is constructed based on the spatial identifier and the image identifier. Thus, a composite key consisting of the spatial identifier and the image identifier can be assigned to each candidate grid region, and the association between the spatial attribute information and the visual feature vector of the candidate grid region can be vectorized and stored, for example, in a Milvus vector database.
[0066] It should be noted that in an optional embodiment, a composite key can be generated by concatenating the grid ID and the image file hash value. In other words, the unique identifier of each grid cell in the database is created as a composite primary key. This primary key is composed of two parts and has a fixed format of grid ID_image hash value.
[0067] like Figure 2 As shown in the example, in this embodiment, the resulting image retrieval database includes three retrieval methods: visual retrieval, location-based retrieval, and joint retrieval. Therefore, when constructing the image retrieval database, a visual index based on vector similarity is constructed based on visual feature vectors, and a location index based on spatial topology is constructed based on spatial attribute information. Furthermore, a joint index of the visual space is constructed based on association relationships.
[0068] Thus, the image retrieval database constructed in this application can provide a multi-dimensional retrieval interface. In the joint index interface, it supports combined query conditions based on both grid spatial attributes and visual feature similarity. In an optional embodiment, the combined query condition can include a grid identifier condition and a visual vector similarity threshold condition connected by a logical operator.
[0069] In an optional embodiment, for an interface based on visual retrieval, a feature vector neighbor search based on visual similarity may be performed, and for an interface based on location retrieval, a query may be performed based on grid attribute conditions of a spatial location.
[0070] Therefore, the image retrieval database construction method provided in the embodiment of the present application, the multimodal feature fusion mechanism combined with the visual feature extraction and spatial topology analysis of the deep convolutional network, realizes the two-dimensional retrieval of content and location, enabling the system to flexibly respond to the query requirements of different application scenarios.
[0071] Figure 4 A schematic diagram of the principle of a method for constructing an image retrieval database provided in another embodiment of the present application, before matching the remote sensing image to be processed with the grid area, the method includes: Extract image metadata from remote sensing images to be processed; Parse the image metadata; and based on the parsing results, determine whether the remote sensing image to be processed contains coordinate reference system information; If included, the spatial geographic information of the remote sensing image to be processed is read based on the coordinate reference system information; and the step of matching the remote sensing image to be processed with the grid area is entered.
[0072] Currently, in terms of multi-source data fusion and coordinate system standardization, remote sensing images often come from different sensor platforms (e.g., optical, radar, and hyperspectral), with different projection methods, coordinate systems (e.g., WGS84, UTM, and Albers), and geographic reference information. Current processing workflows typically rely on a single, linear coordinate system conversion process, where all images are uniformly reprojected to a standard coordinate system before subsequent processing. This process is not only computationally expensive, especially when processing large-scale or high-resolution images, but also prone to introducing geometric distortion and interpolation errors during frequent coordinate transformations, affecting spatial positioning accuracy. Furthermore, this process lacks support for real-time requirements, making it difficult to meet the needs of application scenarios such as emergency response and dynamic monitoring, which require high processing timeliness.
[0073] Therefore, in order to solve the above technical problems, this application provides a unified processing method for multiple remote coordinate systems. Figure 4 As shown, in an optional embodiment, Coordinate Reference System (CRS) information is preferentially parsed from image metadata. Specifically, the CRS information used by the remote sensing image is read and parsed from the image metadata. Image metadata describes the properties of the image itself and is typically stored in text within the image file.
[0074] Parse the extracted image metadata. If the remote sensing image to be processed already contains CRS information, the spatial geographic center information (including but not limited to longitude and latitude information) of the remote sensing image to be processed can be directly read based on the CRS information. After completing the spatial geographic information reading, further matching can be performed based on the read spatial geographic information with the grid area.
[0075] Therefore, the method for constructing the image retrieval database provided by this application gives priority to using the CRS information of the image itself to avoid geometric distortion caused by the unified projection conversion process, thereby reducing the accuracy of the image retrieval database.
[0076] Based on the above embodiment, as an optional embodiment, if the coordinate reference system information does not exist, the method includes: Extract keywords from the file name of the remote sensing image to be processed; Match the file name keywords in the pre-built coordinate reference system database; According to the matching result, determine whether there is a matching target coordinate reference system in the coordinate reference system database; If it exists, the spatial geographic information is read based on the target coordinate reference system, and the step of matching the remote sensing image to be processed with the grid area is entered; If it does not exist, the remote sensing image to be processed is converted to the default coordinate reference system, and the step of matching the remote sensing image to be processed with the grid area is entered.
[0077] It is understandable that in the above embodiment, it may be impossible to obtain the CRS information of the image based on the image metadata. In order to solve this technical problem, based on the above embodiment, as an optional embodiment, the file name keywords of the remote sensing image to be processed are further extracted and matched in the pre-built CRS database, which can also be understood as matching with the pre-defined CRS template.
[0078] It should be noted that the CRS types supported in the CRS database include but are not limited to EPSG:4326, EPSG:32651, and CGCS2000. When matching file name keywords, the corresponding projected coordinate system can be matched when UTM is included, and the geographic coordinate system can be matched when WGS84 is included. This application does not limit this.
[0079] If there is a matching target CRS, the spatial geographic information of the remote sensing image to be processed is read based on the target CRS. If there is no matching target CRS, the remote sensing image to be processed can be converted to the default CRS.
[0080] Therefore, this application provides a three-level coordinate recognition mechanism: image metadata parsing, file name matching, and default CRS conversion. To address the heterogeneity of multi-source remote sensing data, multi-level coordinate recognition and a two-level spatial matching strategy significantly improve data integration efficiency, while the distributed architecture ensures real-time processing of large-scale, high-resolution imagery.
[0081] In the above embodiments, the method for constructing an image retrieval database is described in detail. The present application also provides an embodiment corresponding to a device for constructing an image retrieval database.
[0082] Figure 5 This is a schematic diagram of a structure of a device for constructing an image retrieval database provided in an embodiment of the present application, as shown in FIG. Figure 5 As shown, the device includes: The target acquisition module 50 is used to obtain the population density of the area to be processed, the current area type and the remote sensing image to be processed; The spatial grid size determination module 51 is used to determine the current spatial grid size according to the population density and the current area type; and to divide the area to be processed based on the current spatial grid size to obtain grid areas; A grid matching module 52 is used to match the remote sensing image to be processed with the grid area to obtain a candidate grid area whose matching degree meets a preset condition; A visual feature extraction module 53 is used to extract visual features of the remote sensing image to be processed in the candidate grid area; The database construction module 54 is used to construct an image retrieval database based on visual features.
[0083] In addition, the apparatus for constructing an image retrieval database provided in the embodiment of the present application further includes: The first acquisition module is used to obtain the current reference grid size and a pre-established mapping relationship; wherein the mapping relationship is a correspondence between the region type and the region weighting factor; the higher the population density represented by the region type, the larger the corresponding region weighting factor; A weighting factor determination module is used to determine the current region weighting factor according to the mapping relationship and the current region type; The size determination module is used to determine the current spatial grid size through the current reference grid size, the current regional weighting factor and the population density; wherein the population density is negatively correlated with the current spatial grid size; and the current regional weighting factor is positively correlated with the current spatial grid size.
[0084] The reference grid size determination module is used to determine whether the population density is greater than a density threshold; if so, the first size is used as the current reference grid size; if not, determine whether the population density is greater than a preset multiple of the density threshold; the preset multiple is less than 1; if greater, the second size is used as the current reference grid size; if not, the third size is used as the current reference grid size; wherein the first size is smaller than the second size, and the second size is smaller than the third size.
[0085] The first processing module is used to determine the first spatial consistency index between the remote sensing image to be processed and the grid area; and determine whether there is a target grid with a first spatial consistency index of 100%; if so, use the target grid as a candidate grid area; if not, perform the following steps: reconstruct the missing data in the grid area to obtain a reconstructed grid area; determine the second spatial consistency index between the reconstructed grid area and the remote sensing image to be processed; and use the area where the second spatial consistency index is greater than the index threshold as a candidate grid area.
[0086] an identifier allocation module, configured to allocate a unique spatial identifier to the grid area and allocate a unique image identifier to the image corresponding to the grid area; The second acquisition module is used to obtain spatial attribute information of the candidate grid area and pre-process the visual features to obtain a visual feature vector; An association relationship building module is used to build an association relationship between a visual feature vector and spatial attribute information based on a spatial identifier and an image identifier; The index construction module is used to construct a visual index based on vector similarity based on visual feature vectors; to construct a position index based on spatial topology based on spatial attribute information; and to construct a joint index of visual space based on association relationships to obtain an image retrieval database.
[0087] Image metadata extraction module, used to extract image metadata from remote sensing images to be processed; The image metadata parsing module is used to parse the image metadata; and based on the parsing results, it determines whether the remote sensing image to be processed contains coordinate reference system information; if it does, it reads the spatial geographic information of the remote sensing image to be processed based on the coordinate reference system information; and calls the grid matching module.
[0088] File name keyword extraction module, used to extract the file name keywords of the remote sensing image to be processed; Coordinate system matching module, used to match file name keywords in a pre-built coordinate reference system database; The second processing module is used to determine whether there is a matching target coordinate reference system in the coordinate reference system database based on the matching results; if so, read the spatial geographic information based on the target coordinate reference system and call the grid matching module; if not, convert the remote sensing image to be processed into the default coordinate reference system and call the grid matching module.
[0089] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, such as Figure 6 As shown, the electronic device includes: a memory 60 for storing computer programs; The processor 61 is configured to implement the steps of the method for constructing an image retrieval database as described in the above embodiment when executing a computer program.
[0090] The electronic device provided in this embodiment may include but is not limited to a laptop computer or a desktop computer.
[0091] Among them, the processor 61 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 61 can be implemented in at least one hardware form of a digital signal processor (DSP), a field programmable gate array (FPGA), and a programmable logic array (PLA). The processor 61 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 61 may be integrated with a graphics processing unit (GPU), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 61 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.
[0092] The memory 60 may include one or more computer-readable storage media, which may be non-transitory. The memory 60 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 60 is at least used to store the following computer program 601, wherein, after the computer program is loaded and executed by the processor 61, it can implement the relevant steps of the method for constructing an image retrieval database disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 60 may also include an operating system 602 and data 603, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 602 may include Windows, Unix, Linux, etc. The data 603 may include but is not limited to the relevant data involved in the method for constructing an image retrieval database, etc.
[0093] In some embodiments, the electronic device may further include a display screen 62 , an input / output interface 63 , a communication interface 64 , a power supply 65 , and a communication bus 66 .
[0094] Those skilled in the art will understand that Figure 2 The structure shown in the figure does not constitute a limitation of the electronic device, and may include more or fewer components than shown in the figure.
[0095] The electronic device provided in the embodiment of the present application includes a memory and a processor. When the processor executes the program stored in the memory, it can implement the method for constructing the image retrieval database in the above embodiment.
[0096] It should be noted that although operations are depicted in a particular order in the accompanying drawings, this should not be understood as requiring that these operations be performed in the particular order shown or performed sequentially, or that all illustrated operations be performed to achieve the desired results. In some cases, multitasking and parallel processing may be advantageous. In addition, the separation of various system modules and components in the above-described embodiments should not be understood as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product, or packaged into multiple software products.
Claims
1. A method for constructing an image retrieval database, characterized in that: The method comprises: Obtain the population density of the area to be processed, the current area type and the remote sensing image to be processed; Determining a current spatial grid size according to the population density and the current area type; and dividing the area to be processed based on the current spatial grid size to obtain grid areas; Matching the remote sensing image to be processed with the grid area to obtain a candidate grid area whose matching degree meets a preset condition; Extracting visual features of the remote sensing image to be processed in the candidate grid area; Based on the visual features, an image retrieval database is constructed.
2. The method for constructing an image retrieval database according to claim 1, wherein: The determining of the current spatial grid size according to the population density and the current area type includes: Obtaining a current reference grid size and a pre-established mapping relationship; wherein the mapping relationship is a correspondence between region types and region weighting factors; the higher the population density represented by the region type, the larger the corresponding region weighting factor; Determining a current region weighting factor according to the mapping relationship and the current region type; The current spatial grid size is determined by the current reference grid size, the current regional weighting factor and the population density; wherein the population density is negatively correlated with the current spatial grid size; and the current regional weighting factor is positively correlated with the current spatial grid size.
3. The method for constructing an image retrieval database according to claim 2, wherein: Get the current base grid size, including: determining whether the population density is greater than a density threshold; If it is larger, the first size is used as the current reference grid size; If not, determine whether the population density is greater than a preset multiple of the density threshold; the preset multiple is less than 1; if greater, use the second size as the current reference grid size; if not greater, use the third size as the current reference grid size; wherein the first size is smaller than the second size, and the second size is smaller than the third size.
4. The method for constructing an image retrieval database according to claim 1, wherein: The matching of the remote sensing image to be processed with the grid area to obtain a candidate grid area whose matching degree meets a preset condition includes: Determining a first spatial consistency index between the remote sensing image to be processed and the grid area; and determining whether there is a target grid whose first spatial consistency index is 100%; If so, taking the target grid as the candidate grid area; If it does not exist, perform the following steps: Reconstructing the missing data in the grid area to obtain a reconstructed grid area; A second spatial consistency index between the reconstructed grid area and the remote sensing image to be processed is determined; and an area where the second spatial consistency index is greater than an index threshold is used as the candidate grid area.
5. The method for constructing an image retrieval database according to claim 1, wherein: The step of constructing an image retrieval database based on the visual features includes: Assigning a unique spatial identifier to the grid area, and assigning a unique image identifier to the image corresponding to the grid area; Acquiring spatial attribute information of the candidate grid area; and preprocessing the visual features to obtain a visual feature vector; constructing an association relationship between the visual feature vector and the spatial attribute information according to the spatial identifier and the image identifier; Based on the visual feature vector, a visual index based on vector similarity is constructed; based on the spatial attribute information, a position index based on spatial topology is constructed; and based on the association relationship, a joint index of the visual space is constructed to obtain the image retrieval database.
6. The method for constructing an image retrieval database according to claim 1, wherein: Before matching the remote sensing image to be processed with the grid area, the method includes: Extracting image metadata from the remote sensing image to be processed; Parsing the image metadata; and determining whether the remote sensing image to be processed contains coordinate reference system information based on the parsing result; If included, based on the coordinate reference system information, read the spatial geographic information of the remote sensing image to be processed; and enter the step of matching the remote sensing image to be processed with the grid area.
7. The method for constructing an image retrieval database according to claim 6, wherein: If the coordinate reference system information does not exist, the method includes: Extracting keywords from the file name of the remote sensing image to be processed; Matching the file name keywords in a pre-built coordinate reference system database; Determining, based on the matching result, whether a matching target coordinate reference system exists in the coordinate reference system database; If so, based on the target coordinate reference system, read the spatial geographic information and enter the step of matching the remote sensing image to be processed with the grid area; If not, the remote sensing image to be processed is converted into a default coordinate reference system, and the step of matching the remote sensing image to be processed with the grid area is entered.
8. A device for constructing an image retrieval database, characterized in that: The device comprises: The target acquisition module is used to obtain the population density of the area to be processed, the current area type and the remote sensing image to be processed; a spatial grid size determination module, configured to determine a current spatial grid size based on the population density and the current area type; and to divide the area to be processed based on the current spatial grid size to obtain grid areas; A grid matching module, configured to match the remote sensing image to be processed with the grid area to obtain a candidate grid area whose matching degree meets a preset condition; A visual feature extraction module, configured to extract visual features of the remote sensing image to be processed in the candidate grid area; The database construction module is used to construct an image retrieval database based on the visual features.
9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, wherein: When the processor executes the computer program, the steps of the method for constructing an image retrieval database according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method for constructing an image retrieval database according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Remote sensing image classification and retrieval method
CN108537238A
Space-time coding method, space-time index and query method and device
CN109992636A
Method and device for landmark matching in remote sensing image
CN114998755A
Remote sensing satellite image data management method and related equipment
CN116701676A
Remote sensing image optimization method and device based on space subdivision grid
CN118135275A