Structured corpus generation method and device for geological map multi-modal large model training
By constructing a semantically aligned geological dataset and configuring parameter terms to generate geological map samples, the data bottleneck in training multimodal large models of geological maps was solved, realizing the automatic generation of geological map training corpus throughout the entire process, improving sample diversity and standardization, and enhancing the model's adaptability.
Patent Information
- Application Number
- CN202511893600.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-16
- Publication Date
- 2026-03-17
- Estimated Expiration
- 2045-12-16
AI Technical Summary
Existing technologies lack high-quality, diverse training samples and structured information annotations for training multimodal large-scale geological maps, resulting in data bottlenecks and making it difficult to achieve intelligent processing of geological maps.
By constructing a semantically aligned geological dataset and configuring parameters to generate geological map samples, including randomly adjusting the viewport, annotation text, symbol style, and map layout, combined with pixel-level mask annotation, the automatic generation of geological map samples is achieved.
It achieves fully automated generation of geological map training corpora, improves the diversity and standardization of samples, reduces the cost of manual mapping and annotation, and enhances the adaptability and generalization ability of multimodal large models.
Smart Images

Figure CN121353573B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of artificial intelligence, data science, computer vision, and GIS (Geographic Information System), specifically to a method and apparatus for generating structured corpora for training multimodal large models of geological maps. Background Technology
[0002] Geological maps, as the core carriers recording the composition, geological structure, and evolutionary history of the Earth's surface rocks, are the cornerstone of geological surveys, resource exploration, and disaster assessment. Traditional geological map interpretation and analysis heavily rely on the experience and knowledge of professional geologists, resulting in low efficiency and strong subjectivity, making it difficult to meet the needs of rapid extraction and intelligent application of massive amounts of geological information. With the rapid development of artificial intelligence technology, utilizing machines to automatically understand geological map information has shown enormous potential.
[0003] In recent years, multimodal large-scale models have made significant breakthroughs in image and text understanding and generation tasks, providing new possibilities for the intelligent processing of geological maps. These models can integrate image and text information, and are expected to achieve complex tasks such as automatic recognition, relational reasoning, knowledge-based question answering, and assisted map compilation of geological maps. However, the successful application of multimodal large-scale models to the highly specialized field of geological mapping faces a key bottleneck: publicly available, large-scale, high-quality, and labeled training corpora are extremely scarce.
[0004] Geological maps are highly complex multimodal information complexes, encompassing not only simple images but also precise vector graphic elements, rich spatial topological relationships, and densely packed specialized annotation text. These heterogeneous modal information types possess strict semantic relationships, making it difficult to directly apply general-domain multimodal corpora to the training of large-scale multimodal geological map models. Furthermore, currently available publicly available geological map datasets are limited in size and lack structured semantic associations at the element level. Therefore, there is an urgent need for an automated method and apparatus capable of efficiently generating diverse geological map samples on demand, simultaneously extracting their structured information accurately and aligning them with multimodal annotations. This would address the data bottleneck in training large-scale multimodal geological map models, thereby unlocking their potential and promoting the intelligent application of geological information. Summary of the Invention
[0005] The purpose of this invention is to address the problems of scarcity of high-quality and diverse geological map training samples and the difficulty of accurately annotating the complex semantics and spatial information of geological maps in the existing technology, and to provide a structured corpus generation method and apparatus for training multimodal large models of geological maps.
[0006] The objective of this invention is achieved through the following technical solution: The first aspect of this invention provides a structured corpus generation method for training multimodal large-scale models of geological maps, comprising the following steps:
[0007] (1) Preprocess geological vector data and construct a semantically aligned geological dataset;
[0008] (2) Based on the geological dataset, load vector data in sequence and unify the geospatial coordinate system; at the same time, configure viewport selection parameters to randomly generate the geospatial range and map viewport size of the map viewport according to the threshold range constraint of the number of elements.
[0009] (3) Configure the annotation text parameter items to integrate the real attribute fields and the synthetic text, generate the layer and legend dual annotation text of the feature, and adjust the annotation text style of different dimensions based on the controllable randomization mechanism and the map viewport size;
[0010] (4) Configure symbol style parameter items to randomly select the baseline style for different categories of elements, perform multi-level group rendering of face elements, and perform multi-dimensional random adjustment of point and line element styles to complete the parametric symbol rendering of each element.
[0011] (5) Configure map pieces and layout parameters to randomly add map pieces, randomly determine the position of each piece in the map based on the layout rules, and parametrically adjust the visual appearance of each piece within the map area;
[0012] (6) Configure output parameters to continuously export the engineering operation results after adjusting the annotation text parameters, symbol style parameters, and map and layout parameters as geological map samples;
[0013] (7) Extract multidimensional attribute information from geological map samples to construct structured metadata annotation data, and extract the pixel-level spatial distribution of point, line and surface element symbols to construct geological element mask annotation files.
[0014] Furthermore, step (1) specifically includes:
[0015] Raw geological vector data is obtained from official data sources of geological survey institutions; point, line, and polygon vector data are integrated for the target geographic area to construct a multi-layer dataset with spatial relationships; core geological feature layers in the multi-layer dataset are retained, and auxiliary mapping layers are removed; layer names and attribute field names are standardized, and abbreviations are converted to full names; geometric errors in each layer are checked and corrected, and for data that cannot be corrected, new feature classes are created and valid attributes are migrated to obtain preprocessed geological vector data; semantically aligned geological datasets are constructed based on the preprocessed geological vector data.
[0016] Furthermore, step (2) specifically includes:
[0017] Based on the geological dataset, vector data is loaded in the order of overlay of point, line, and area elements, and a unified geospatial coordinate system is established;
[0018] Calculate the global spatial bounding box extent of the loaded vector data layer;
[0019] The viewport size is determined based on the preset viewport ratio parameters and the global spatial bounding box range, and an initial viewport is generated at a random position within the global spatial bounding box range. Based on the number of point, line, and polygon features in the current viewport, the viewport size is iteratively adjusted according to the preset threshold range of the number of point, line, and polygon features, and the viewport position is randomly changed. The iteration continues until a viewport that meets the constraint conditions of the threshold range of the number of point, line, and polygon features is obtained, and the map viewport geospatial range and map viewport size are set based on the selected viewport.
[0020] Furthermore, step (3) specifically includes:
[0021] Random generation of layer label text: If the preset configuration of the label text parameter item specifies a real attribute field, the original value of the specified field is extracted from the attribute table of the feature as the layer label text; otherwise, Chinese or English layer label text is randomly generated for each feature by synthesizing text and written into the newly created layer label field in the attribute table of the corresponding feature.
[0022] Randomly adjust the text style of layer labels in different dimensions: dynamically control the number of visible labels according to the preset scale factor of the feature type, and randomly adjust the visual attributes of the layer label text.
[0023] Legend label text is generated randomly: If the preset configuration of the label text parameter item specifies a real attribute field, the original value of the specified field is extracted from the attribute table of the feature as the legend label text; otherwise, legend label text is randomly generated for each feature by synthesizing text and written into the newly added unique value rendering field in the attribute table of the corresponding feature type.
[0024] Randomly adjust the legend label text style for different dimensions: For polygon features, select the category where the area of all polygon features in the map viewport area is greater than or equal to the preset area ratio threshold to display the legend label text, and randomly adjust the visual attributes of the legend label text.
[0025] Furthermore, the step of randomly generating Chinese or English layer label text for each feature by synthesizing text specifically includes:
[0026] Characters are randomly selected from a preset simplified Chinese character library to generate Chinese text strings with a length within a preset range as Chinese layer annotation text; English text strings consisting of one or more words are randomly generated according to a preset range of word count and the length range of each word as English layer annotation text.
[0027] The method of randomly generating legend label text for each feature by synthesizing text specifically includes:
[0028] For point, line, and polygon features, generate a number of text strings equal to the total number of their preset unique value categories as candidate annotation texts. Construct a candidate annotation text pool for each feature type. Each text string is composed of a number of characters randomly selected from a preset candidate character library within a preset character length range. For each feature, randomly select one candidate annotation text from the candidate annotation text pool of its corresponding feature type as the legend annotation text.
[0029] Furthermore, step (4) specifically includes:
[0030] Based on preset line feature length thresholds and area thresholds for polygon features, the features are classified according to size, and a unique baseline style is randomly selected from the preset style library for each category of point, line, and polygon features according to the classification results.
[0031] Based on the corresponding baseline style, the background color, texture color, and boundary style of the face elements are randomly rendered to achieve multi-level group rendering of face elements.
[0032] Based on the corresponding baseline style, the attributes of point and line feature styles are randomly adjusted in multiple dimensions within their preset range to achieve parametric symbol rendering of point and line feature styles.
[0033] Furthermore, the background color, texture color, and border style of the opposite element are rendered randomly, specifically including:
[0034] For background color, all categories rendered by unique value are randomly grouped according to the preset range of the number of categories in the group, and a base color is generated for each group; the background color of each type of face feature in the group is randomly selected and rendered within the preset fluctuation range of the base color, so that different categories in the same group have similar but different background tones.
[0035] For texture colors, either grayscale mode or analogous color mode is randomly selected for rendering; grayscale mode renders texture colors by using the grayscale value corresponding to the base color, while analogous color mode renders texture colors by using the offset color of the current background color.
[0036] For boundary styles, the color and width of the boundary lines of opposite elements are randomly rendered within their preset range;
[0037] The attributes of the point and line element styles are randomly adjusted in multiple dimensions within their preset range, specifically including:
[0038] For point feature styles, at least one attribute of the point feature style is randomly adjusted within the preset range corresponding to its attributes, including size, fill color, outline color, outline width, and rotation angle.
[0039] For line feature styles, at least one attribute of the line feature style is randomly adjusted within the preset range corresponding to its attributes, including line color, line width, and legend / graphic style.
[0040] Furthermore, step (5) specifically includes:
[0041] For map elements including legend, scale, compass, latitude and longitude lines, the addition of them to the map is determined independently and randomly based on their preset probabilities.
[0042] For the legend, the legend is randomly selected to be placed on the right side, bottom, or one of the four corners inside the viewport, based on its preset weight; for the scale bar, the scale bar's position on the map is randomly determined based on the legend's position; for the compass, it is randomly placed in one of the four corners inside the viewport.
[0043] The legend size, scale width, compass height, and latitude / longitude intervals are randomly adjusted to achieve parametric random adjustment of the visual appearance of each map element within the map area.
[0044] Furthermore, the random adjustment of the legend size, scale bar width, compass height, and latitude / longitude intervals specifically includes:
[0045] For legend dimensions, the legend dimensions are randomly generated within the preset legend aspect ratio range and the constraints of minimum width and minimum height; the font size and line break width of the legend label text are automatically set by dynamically adapting the number of lines and line width of the legend label text; and the number of legend column numbers is randomly and adaptively adjusted according to the legend position under the constraints of map viewport size.
[0046] For the scale width, randomly select the unit system of the scale to adjust the length of the main scale within its preset width range;
[0047] For the compass height, randomly select the compass height within the preset range;
[0048] For the interval between latitude and longitude lines, the unit system of latitude and longitude lines is randomly selected, the number of latitude and longitude lines is randomly determined within the preset number of latitude and longitude lines, and the interval between latitude and longitude lines is automatically calculated based on the geographic spatial range coordinates of the map viewport.
[0049] Furthermore, the structured meta-information annotation data includes: the geographic spatial range and size of the map viewport, the feature type, spatial coordinates, original symbol color, text label, and pixel-level bounding box coordinates of the map in the map for each legend item, as well as the pixel-level bounding box coordinates of each map element in the map.
[0050] The construction of the geological element mask annotation file specifically includes: uniformly setting all pixels of the map to black; traversing each legend item and setting the relevant element symbol pixels to white until the mask image corresponding to all legend items is obtained, so as to obtain the geological element mask annotation file.
[0051] A second aspect of this invention provides a structured corpus generation apparatus for training multimodal large-scale models of geological maps, used to implement the aforementioned structured corpus generation method for training multimodal large-scale models of geological maps, comprising:
[0052] The data processing module is used to preprocess geological vector data and construct semantically aligned geological datasets;
[0053] The sample generation module is used to load vector data sequentially based on a geological dataset and unify the geospatial coordinate system; at the same time, it configures viewport selection parameters to randomly generate the geospatial range and size of the map viewport according to the threshold range of the number of elements; under the configuration constraints of annotation text parameters, symbol style parameters, map and layout parameters, and output parameters, it automatically generates geological map samples.
[0054] The annotation construction module is used to extract multi-dimensional attribute information from geological map samples to construct structured metadata annotation data, and extract the pixel-level spatial distribution of point, line, and polygon element symbols to construct geological element mask annotation files.
[0055] The scheduling and control module is used to coordinate and integrate the execution flow of the data processing module, sample generation module, and annotation construction module, and control the multi-process parallel iteration of the generation of structured corpus for geological maps across multiple datasets.
[0056] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0057] (1) This invention is aimed at the training task of multimodal large model of geological map. It proposes an automated construction method and device for structured corpus. It innovatively integrates parameter-driven controllable randomized sample map generation mechanism, parameterized viewport multi-constraint optimization algorithm, map symbol and map element perturbation strategy that supports multi-dimensional fine-grained adjustment, and pixel-level mask map and structured meta-information synchronous generation method. It forms a highly flexible process from geological vector data to semantic image and annotation integrated output. Users can configure preset parameters (fixed values, thresholds, interval ranges, candidate options, weights, switches, etc.) to accurately control the visual features, symbol semantics and complex element combination logic of geological map from the source of data generation, realize highly free and on-demand customized geological map generation, and significantly improve the intelligent level of data generation and the diversity and standardization of samples.
[0058] (2) This invention constructs a modular, multi-dimensional parameter-driven automated processing system to sequentially complete the semantic standardization processing of geological vector data, random generation of map viewports, symbolic rendering of geological elements, generation of text annotations, and insertion and layout of map pieces. Subsequently, it automatically extracts the map spatial range, legend-feature mapping relationship and map piece boundary information, and finally generates a precisely aligned binary mask based on these structured metadata, thereby realizing the flexible organization and synchronous generation of sample images and structured annotations.
[0059] (3) This invention realizes the automatic generation of geological map training data throughout the entire process, which greatly reduces the cost of manual mapping and annotation. The generated samples have visual diversity and semantic consistency, which significantly improves the adaptability and generalization ability of multimodal large models to geological map data during training. At the same time, the output structured metadata has high pixel-level accuracy and complete semantic information. These data can be widely used for intelligent tasks such as image segmentation, legend analysis, and map recognition, and have good scalability, engineering application value and scientific research support capabilities. Attached Figure Description
[0060] Figure 1 This is a flowchart of the structured corpus generation method for training multimodal large models of geological maps according to the present invention;
[0061] Figure 2 This is an example diagram of the binary mask for surface features generated by this invention;
[0062] Figure 3 This is a schematic diagram of the structured corpus generation device for training multimodal large models of geological maps according to the present invention. Detailed Implementation
[0063] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. In the following description, when referring to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. It is obvious that the drawings used in the following description are merely some embodiments of the invention, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the invention as detailed in the appended claims.
[0064] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The singular forms “a,” “the,” and “the” used in this invention and the appended claims are also 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 includes any or all possible combinations of one or more of the associated listed items.
[0065] It should be understood that although the terms first, second, third, etc., may be used in this invention to describe various information, this information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first information may also be referred to as second information without departing from the scope of this invention, 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 "when," "when," or "in response to a determination."
[0066] The present invention will now be described in detail with reference to the accompanying drawings. Unless otherwise specified, the features of the following embodiments and implementations can be combined with each other.
[0067] See Figure 1 The structured corpus generation method for training multimodal large models of geological maps of the present invention specifically includes the following steps:
[0068] (1) Preprocess geological vector data and construct a standardized semantically aligned geological dataset.
[0069] (1.1) Obtain raw geological vector data: Obtain raw geological vector data from official data sources of geological survey agencies, such as downloading raw geological vector data packages from the U.S. Geological Survey.
[0070] (1.2) Feature layer integration: For the target geographic area, integrate the point, line and surface vector data in the original geological vector data to construct a multi-layer dataset with spatial correlation.
[0071] (1.3) Core Layer Filtering: Each dataset contains multiple feature classes. For each dataset, i.e., a multi-layer dataset, the core geological feature layer is retained while the auxiliary mapping layers are removed. The core geological feature layer includes attitude, faults, geological bodies, etc.; the auxiliary mapping layers include leader lines, bar charts, profiles, institutional identifiers, etc.
[0072] (1.4) Standardized naming: Standardize the naming of layer names and attribute fields, convert abbreviations to full names, and ensure that the semantics of legend-related text are clear and unambiguous.
[0073] Specifically, the geologically significant field values in the attribute table are corrected, including: removing invalid whitespace characters, correcting typos and spelling errors, clearing garbled characters and illegal characters, and standardizing terminology. This is to change the abbreviations of the layer names of the core geological element layers and the field names in the attribute table to full names with clear geological semantics and no ambiguity, ensuring that the semantics of the legend-related text are clear and unambiguous.
[0074] (1.5) Geometric Error Correction: Check and correct geometric errors in each layer. For data that cannot be corrected, create a new feature class and migrate valid attributes. A feature class is a GIS term referring to a collection of geographic features with the same spatial characteristics (e.g., all points, all lines, or all polygons) and the same attribute structure (consistent field types and names). Valid attributes refer to attribute fields with geological or geographical significance. An attribute table contains several fields; some are geologically significant, such as latitude and longitude, geological age, etc.; others are not geologically significant, such as URLs, etc. Creating a new feature class and migrating attributes is equivalent to copying the spatial and attribute information from the original data into the new data. Since the data in this embodiment is used to train a multimodal geological map model, only geologically relevant attributes need to be retained.
[0075] (1.6) Based on the preprocessed geological vector data obtained in step (1.5), construct a standardized semantically aligned geological dataset.
[0076] It should be understood that after the original geological vector data is processed by steps (1.2) to (1.5), preprocessed geological vector data can be obtained, and the preprocessed geological vector data can be used to construct a standardized semantically aligned geological dataset.
[0077] (2) Based on the geological dataset, load vector data in sequence and unify the geospatial coordinate system; at the same time, configure viewport selection parameters to randomly generate the geospatial range and map viewport size of the map viewport according to the threshold range constraint of the number of elements.
[0078] It should be understood that viewports can be randomly generated based on the threshold range of the number of features through the configured viewport selection parameters, and the geographic spatial range and map viewport size can be dynamically selected.
[0079] (2.1) Data loading: Based on the geological dataset, vector data is loaded in the order of superposition of point, line and surface elements.
[0080] (2.2) Coordinate System 1: Check whether the coordinate systems of the loaded layers are consistent. If there is any inconsistency, select any layer coordinate system as the target coordinate system and convert the remaining layers to the target coordinate system to unify the geospatial coordinate systems of all loaded vector data layers. Specifically, when converting the remaining layers to the target coordinate system, if there are conversion barriers between coordinate systems, if the target coordinate system is a geographic coordinate system, convert all layers to the WGS 84 coordinate system; if the target coordinate system is a projected coordinate system, convert all layers to the WGS 84 Web Mercator coordinate system.
[0081] (2.3) Global spatial extent calculation: Calculate the global spatial bounding box extent of the loaded vector data layer, including the left, right, bottom, and top boundaries of the global spatial bounding box, as well as its width and height.
[0082] Specifically, obtain the spatial boundary coordinates of all loaded layers, and take the minimum and maximum values of all X-coordinates, as well as the minimum and maximum values of all Y-coordinates, as the left, right, bottom, and top boundaries of the global spatial bounding box, respectively, as follows:
[0083]
[0084]
[0085]
[0086]
[0087] In the formula, i represents the index of the loaded layer, and N represents the total number of loaded layers. Let X, Y, and Z represent the minimum, maximum, minimum, and maximum values of the X and Y coordinates within the spatial range of the i-th layer, respectively. Describes the minimum value function. Represents the maximum value function. Let X represent the minimum X value (left boundary), maximum X value (right boundary), minimum Y value (bottom boundary), and maximum Y value (top boundary) of the global bounding box, respectively. Then, the width and height of the global bounding box are calculated based on the coordinates of its left, right, bottom, and top boundaries, and are expressed as follows:
[0088]
[0089]
[0090] In the formula, and These represent the width of the global bounding box in the X direction and the height in the Y direction, respectively.
[0091] (2.4) Randomly generate the initial viewport: Determine the width and height of the viewport according to the preset viewport ratio parameters and the global spatial bounding box range, and generate the initial viewport at a random position within the global spatial bounding box range.
[0092] Specifically, firstly, the threshold range for the viewport slenderness parameter is preset: , ,in and These represent the minimum and maximum values of the viewport proportion parameter, respectively. Then, the map viewport proportion parameters in width and height are randomly selected: , ,in This represents the percentage of the map viewport's width relative to the global bounding box width. This represents the percentage of the map viewport's height relative to the global bounding box height. This represents a random generation function. This indicates that a value is randomly selected uniformly within the interval [a, b]. Next, the width and height of the map viewport are calculated based on the proportions of the map viewport in width and height and the global spatial bounding box range, as follows:
[0093]
[0094]
[0095] In the formula, and These represent the width and height of the map viewport, respectively. Finally, an initial viewport is generated based on the random positions of the map viewport's width and height within the global bounding box, and these positions are represented as follows:
[0096]
[0097]
[0098] In the formula, and These represent the X and Y coordinates of the lower left corner of the initial viewport, respectively.
[0099] (2.5) Preset the threshold range of the number of elements: Set the threshold range of the number of points, lines and surfaces respectively, and calculate the threshold range of the number of all elements.
[0100] The threshold range for the number of point features is expressed as follows: The threshold range for the number of line elements is expressed as: The threshold range for the number of surface features is expressed as: In this embodiment, the minimum threshold for the number of point features. Set to 1, the maximum threshold for the number of point features. Set to 5; minimum threshold for the number of line features. Set to 1, the maximum threshold for the number of line features. Set to 5; minimum threshold for the number of facet features. Set to 4, the maximum threshold for the number of polygon features. Set it to 15.
[0101] The threshold range for the total number of elements is expressed as follows: The calculation formulas are as follows:
[0102]
[0103]
[0104] In the formula, The minimum threshold representing the total number of elements. This represents the maximum threshold for the total number of elements.
[0105] (2.6) Iterative optimization of the viewport: First, count the number of point, line, and polygon features within the current viewport, and calculate the total number of all features. The calculation formula is as follows:
[0106]
[0107] In the formula, This indicates the total number of all elements within the current viewport. , , These represent the number of point, line, and polygon features within the current viewport, respectively. Then, based on the number of point, line, and polygon features within the current viewport and the total number of all features, the viewport size (i.e., the width and height of the viewport) is iteratively adjusted according to preset threshold ranges for the number of point, line, and polygon features and the total number of features, while the viewport position (i.e., the left, right, bottom, and top boundaries of the viewport) is randomly changed: if the total number of all features within the current viewport is greater than the upper limit of the threshold range for the total number of features, i.e., if... Then the viewport size is reduced proportionally, for example, by reducing the viewport ratio parameter by 0.5 times. If the total number of all features within the current viewport is less than the lower limit of the total feature number threshold range, i.e., if Then the viewport size is enlarged proportionally, for example, by doubling the viewport ratio parameter, i.e. Finally, repeat steps (2.4) to (2.6) above to iteratively optimize the viewport size and viewport position until the number of point, line, and polygon features within the viewport meets its corresponding threshold constraint conditions, that is, the number of point, line, and polygon features meets the constraint conditions of the corresponding threshold range of point, line, and polygon feature numbers, that is, the number of point, line, and polygon feature numbers is within the corresponding threshold range of point, line, and polygon feature numbers.
[0108] (2.7) Based on the final selected viewport size and viewport location obtained after iterative optimization, set the map viewport geospatial range and map viewport size based on the selected result.
[0109] (3) Configure the annotation text parameter items to integrate the real attribute fields and the synthetic text, generate the layer and legend dual annotation text of the feature, and adjust the annotation text style of different dimensions based on the controllable randomization mechanism and the map viewport size.
[0110] It should be understood that, under the constraints of the configured annotation text parameters, the real attribute fields and synthetic text are merged to generate dual annotation text for geological elements, including layers and legends. Then, the annotation text styles of different dimensions are adjusted based on a controllable randomization mechanism. This can enhance the diversity of annotation text and the robustness of training large geological map models.
[0111] (3.1) Random generation of layer label text: If the preset configuration of the label text parameter item specifies a real attribute field, the original value of the specified field is extracted from the attribute table of the feature as the layer label text; otherwise, Chinese or English layer label text is randomly generated for each feature through text synthesis, and written into the newly created layer label field in the attribute table of the corresponding feature type. Specifically, this includes the following sub-steps:
[0112] (3.1.1) Select to merge real attribute fields: If you want to use the real attribute fields of the layer as the layer label text, you can specify the original field name in the attribute table in the preset configuration of the label text parameter item, and then extract the original value of the specified field from the attribute table of the feature as the layer label text according to the configuration settings of the label text parameter item.
[0113] (3.1.2) Select dynamic composite text: If the default configuration of the label text parameter does not specify the real attribute field as the layer label text, then the composite text will randomly generate Chinese or English layer label text for each feature and write it into the newly created layer label field in the corresponding attribute table of the feature. That is, a new field LAYER_LABEL will be created in the attribute table as the layer label field, and then the randomly generated Chinese or English layer label text for each feature will be written into the layer label field LAYER_LABEL in its corresponding attribute table.
[0114] Specifically, first, a commonly used simplified Chinese character library is preset. Then, the length range of the text annotations for Chinese and English layers is preset. ,in This indicates the minimum length of the text used for Chinese and English layer annotations. This indicates the maximum length of text labeled in Chinese and English layers; for example, it can be preset. The value of is 2. The value is 5. This sets the preset range for the number of words contained in the English layer annotation text. ,in This represents the minimum number of words contained in the English layer annotation text. This indicates the maximum number of words contained in the English layer annotation text; for example, it can be preset. The value of is 1. The value is 2. Then, for each feature's new layer label field, randomly select either Chinese or English as the layer label field value: for Chinese layer label text, randomly select the text length. L characters are randomly selected from a preset library of commonly used simplified Chinese characters and concatenated into a string to generate a Chinese text string of a preset length, which serves as the layer annotation field value; this is the Chinese layer annotation text. For English layer annotation text, an English text string consisting of one or more words is randomly generated based on a preset range of word count and word length. Then, for each word, a text length is randomly selected. Randomly select L letters from the 26 uppercase and lowercase letters of the English alphabet and concatenate them into a string to form the word content. Each word is concatenated to form an English text string, which is then used as the value of the layer label field, resulting in the English layer label text. Finally, the generated random text string is written into the newly added layer label field in the attribute table of the corresponding feature.
[0115] (3.2) Randomly adjust the style of layer label text in different dimensions: dynamically control the number of visible labels according to the preset scale factor of the feature type, and randomly adjust the visual attributes of layer label text, including font size, font, color, and placement of label text for line / polygon features.
[0116] (3.2.1) Randomly control the number of features displayed in the layer: dynamically control the number of visible labels based on the preset scaling factor of the feature type (point / line / polygon).
[0117] Specifically, firstly, preset the scale factors for displaying layer labels for point, line, and polygon features respectively, for example, the preset scale factor for point features. Preset scaling factor for line elements Preset scaling factor for surface elements Subsequently, the layer annotation text is randomly sampled and displayed from each layer's annotation text pool according to the corresponding preset scaling factor.
[0118] It should be understood that a percentage is preset as a scaling factor for point, line, and polygon features in the configuration file. The size of this scaling factor controls the proportion of features with and without labels. For example, when the preset scaling factor for point features is set to 0.4, features are randomly selected based on this scaling factor. ( The layer labels are displayed for each point feature (total number of point features in the viewport). Layer labels will not be displayed for single-point features. Setting this scaling factor can effectively control the density of label text and prevent overlapping of label text when there are many features.
[0119] (3.2.2) Randomization of visual attributes of layer annotation text: Based on step (3.2.1), further diversify the style of the displayed layer annotation text by performing at least one of the following operations on the layer annotation text:
[0120] (a) Based on the preset font size range, font candidates, and color RGB range, randomly adjust the font size, font, and color of the layer annotation text.
[0121] (b) Randomly set the placement method of the annotation text of line and surface elements according to the preset placement method candidates, such as the horizontal, straight, curved, vertical, centered, and offset placement methods of line elements, and the horizontal, straight, and curved placement methods of surface elements.
[0122] (c) Randomly determine whether to add a background to the layer annotation text and adjust the background transparency. Specifically, the default probability of adding a background to the layer annotation text is... Generate a random number r in the interval [0,1]. This adds a white semi-transparent background to the layer label text.
[0123] (3.3) Random generation of legend annotation text: If the preset configuration of the annotation text parameter item specifies a real attribute field, the original value of the specified field is extracted from the attribute table of the feature as the legend annotation text; otherwise, the legend annotation text is randomly generated for each feature by synthesizing text and written into the newly added unique value rendering field in the attribute table of the corresponding feature type.
[0124] It should be noted that the legend label is the field value on which the unique value rendering of the layer is based, and it is also the category name and label text of the generated legend item.
[0125] (3.3.1) Generate unique value category labels: If you want to use the actual attribute fields of the layer as legend label text, you can specify the original field name in the attribute table in the preset configuration of the label text parameter item. Then, according to the configuration settings of the label text parameter item, the original value of the specified field is extracted from the attribute table of the feature as legend label text, which is also the category label in unique value rendering.
[0126] (3.3.2) Candidate pool construction and random allocation: If the default configuration of the annotation text parameter does not specify the real attribute field as the legend annotation text, then the candidate annotation text is randomly generated for each feature by synthesizing text and written into the newly added unique value rendering field in the attribute table of its corresponding feature type. That is, a new field LEGEND_LABEL is created in the attribute table as the unique value rendering field, and then characters are randomly generated for each feature as the legend annotation text and written into the unique value rendering field LEGEND_LABEL in its corresponding attribute table.
[0127] Specifically, the first step is to construct a candidate character library containing uppercase and lowercase letters, numbers, and commonly used Greek letters. Then, the character length range for the legend annotation text is preset. ,in This indicates the minimum character length of the legend label text. This indicates the maximum character length of the legend label text; for example, it can be preset. The value of is 1. The value is 10. Secondly, the total number of unique value categories for point, line, and polygon elements is preset, for example... , , , These represent the total number of unique value categories for point, line, and polygon features, respectively. Then, based on the total number of unique value categories for point, line, and polygon features, a sufficient number of candidate annotation texts are generated for each feature type. Specifically, a number of text strings equal to the total number of unique value categories for each point, line, and polygon feature are generated as candidate annotation texts, thus constructing a corresponding candidate annotation text pool for each feature type. Each text string is formed by randomly selecting a random number of characters within a preset character length range from a candidate character library. The random number can be determined by the formula... Confirmed. Finally, the annotation text is randomly assigned, that is: for each feature, a candidate annotation text is randomly selected from the annotation text candidate pool of its corresponding feature type as the legend annotation text and written into the newly added unique value rendering field LEGEND_LABEL in its corresponding attribute table. This text is represented as the legend item label for each category in the unique value rendering of the geological map.
[0128] It should be understood that the total number of unique value categories for point, line, and polygon features is related to the number of legend items, which is an empirical value summarized from actual geological maps. For example, taking a polygon feature layer as an example, when the total number of unique value categories is set to 5, a candidate pool of label text containing 5 different text strings will be generated. For each polygon feature in this layer, one is randomly selected from this candidate pool as the attribute value of the LEGEND_LABEL field. Unique value rendering will be based on this field. Since this field has 5 different field values, 5 different styles will be generated during rendering.
[0129] It should be noted that rendering refers to displaying spatial features (points, lines, and polygons) on a map in different styles (colors, patterns, and symbols) based on the attributes of the data, in order to achieve visual classification and comparison. Unique value rendering is one of the commonly used rendering methods. The unique value rendering field is a key field used to classify and render features according to their attribute values, and each unique value corresponds to a visualization style.
[0130] (3.4) Randomly adjust the legend label text style of different dimensions: For polygon features, select the category in which the area of all polygon features in the map viewport area is greater than or equal to the preset area ratio threshold to display the legend label text, and randomly adjust the visual attributes of the legend label text, including font size, font, color, superscript / subscript conversion, etc.
[0131] (3.4.1) Spatial constraint filtering: Legend annotation is mainly for polygon features. After excluding polygon features that have already added layer annotation text, legend annotation text is added to the remaining polygon features. The legend annotation text is displayed in the category of unique value rendering category (which can be obtained from the legend annotation text) where the proportion of the area of all polygon features in the map viewport area is greater than or equal to the preset area proportion threshold (ensuring that the polygon features have enough space to display the legend annotation text).
[0132] Specifically, firstly, a minimum area ratio threshold is preset for polygon features that can have legend annotations added. Then, for the polygon features remaining after excluding those with added layer label text, the area of each polygon feature is obtained, and the proportion of that area in the entire map viewport area is calculated using the following formula:
[0133]
[0134] In the formula, P represents the proportion of the area of the polygon feature in the map viewport area. Represents the area (square) of a polygon. and Let these represent the width and height of the map viewport obtained in step (2), respectively. Then, when rendering a unique value, the area percentage of all polygon features within the category is calculated. If the text is in the correct format, add a legend label to the polygon feature of that category; otherwise, do not add one.
[0135] (3.4.2) Randomization of visual attributes of legend annotation text: Based on step (3.4.2), further diversify the style of the displayed legend annotation text, and perform at least one of the following operations on the displayed legend annotation text:
[0136] (a) Based on the preset font size range, font candidates, and color RGB range, randomly adjust the font size, font, and color of the legend annotation text.
[0137] (b) Randomly convert some characters in the legend annotation text into superscripts or subscripts. Specifically, the probability of a character in the legend annotation text being a superscript or subscript is preset. For each character in the legend annotation text, generate a random number r in the interval [0,1]. If the character is set randomly, it will be either a superscript or a subscript.
[0138] (c) Randomly determine whether to add a background to the legend label text. Specifically, the preset probability of adding a background to the legend label text is... Generate a random number r in the interval [0,1]. This adds a white background to the legend label text.
[0139] (d) Randomly set the maximum number of characters displayed in the legend to extract the legend annotation text.
[0140] (e) Randomly adjust the positional offset of the legend label text within the legend drawing. Specifically, first calculate the maximum horizontal and vertical offset of the legend label text based on the legend drawing dimensions and the height of the legend label text. The calculation formula is as follows:
[0141]
[0142]
[0143] In the formula, and These represent the width and height of the legend drawing, respectively. Indicates the height of the legend label text. and These represent the maximum offsets of the legend label text X in the horizontal and vertical Y directions, respectively. Then, randomly selecting the offsets of the legend label text in the horizontal and vertical directions, they can be represented as follows:
[0144]
[0145]
[0146] In the formula, and These represent the horizontal and vertical offsets of the randomly generated legend label text, respectively.
[0147] (4) Configure symbol style parameter items to randomly select the baseline style for different categories of elements, perform multi-level group rendering of face elements, and perform multi-dimensional random adjustment of point and line element styles to complete the parametric symbol rendering of each element.
[0148] It should be understood that, based on standard legend styles, parametric symbol rendering, which involves random selection based on benchmark styles, multi-level grouping and rendering of surface elements, and multi-dimensional random adjustment of point and line elements, can effectively improve the visual diversity of the generated corpus.
[0149] (4.1) Randomly generate differentiated unique value rendering fields based on size classification: Based on the preset line feature length threshold and surface feature area threshold, the features are classified according to size, and according to the feature size classification results, the reference styles that are not repeated are randomly selected from the preset style library for each category of point, line and surface features.
[0150] (4.1.1) Geographic Feature Size Classification: Based on the preset line feature length threshold (ratio relative to the viewport perimeter) and polygon feature area threshold (ratio relative to the map viewport area), features are divided into small-sized features and large-sized features. Specifically, the geographic size of features in each layer is analyzed and statistically analyzed. Features whose geographic size is less than or equal to the corresponding threshold (i.e., line feature length threshold or polygon feature area threshold) are classified as small-sized features, and the rest are large-sized features. The unique value rendering fields for small-sized features and large-sized features are randomly generated and written into the attribute table according to the legend annotation text generation method introduced in step (3.3) above.
[0151] Specifically, firstly, a preset line feature length threshold is set. Preset area threshold for surface features Then, obtain the length of each line feature and calculate its proportion within the entire map viewport perimeter, which can be expressed as:
[0152]
[0153] In the formula, This indicates the proportion of the line feature length within the entire map viewport perimeter. Indicates the length of the polyline element. and These represent the width and height of the map viewport obtained in step (2), respectively; if If the line feature is small, it is considered a small-sized line feature; otherwise, it is considered a large-sized line feature. Then, the area of each polygon feature is obtained, and the proportion of that area within the entire map viewport area is calculated. The calculation formula is the same as P in step (3.4.1), and can be expressed as:
[0154]
[0155] In the formula, This indicates the percentage of the area of a polygon feature within the entire map viewport area. If... If the value is small, then the surface feature is considered a small-sized surface feature; otherwise, it is considered a large-sized surface feature.
[0156] (4.1.2) Differentiated Selection of Baseline Styles: Based on the feature size classification results, a unique baseline style is randomly selected from the preset style library (which includes a general feature style library, a simple line feature style library, and a dedicated contour line style library) for each category of point, line, and polygon features. Two special rules apply when selecting the baseline style: small-sized line features (i.e., line features shorter than the preset viewport perimeter threshold) must have their baseline style randomly selected from the dedicated simple line feature style library; contour line features must have their baseline style selected from the preset dedicated contour line style library.
[0157] It should be understood that classifying elements by size facilitates differentiated processing in subsequent rendering. For example, small elements can be rendered using only simple styles to prevent incomplete style rendering due to the small size of the elements.
[0158] (4.2) Multi-level grouping and random rendering of surface element styles: Based on the corresponding baseline styles, the key visual attributes of surface elements are further parametrically and randomly adjusted to achieve multi-level grouping and rendering of surface elements. Among them, the key visual attributes of surface elements include background color, texture color, and boundary style.
[0159] (4.2.1) Background color rendering: All categories in the unique value rendering are randomly divided into several groups, and the number of categories in each group is within the preset range of the number of categories in the group. Randomly determined within the range, among which This represents the lower limit of the range of categories within a group (for example, it can be preset to 1). This represents the upper limit of the range of categories within a group (e.g., it can be preset to 5). Further, a base color is generated for each group, ensuring that the colors are unique and that the color space distance is greater than a preset value. The background color of each category of polygon features within the group is randomly selected and rendered within the preset fluctuation range of the base color. Specifically, for each category of polygon features within the group, a color is randomly generated and rendered within the preset fluctuation range of its base color. The preset RGB value fluctuation upper limit is... Then the preset fluctuation range of its base color is For each category within the group, the R, G, and B values of the base color are respectively... Within a controlled range, a new color close to the base color is generated as the background color of the polygon feature in that category, so that polygon features of different categories within the same group have similar but different background tones.
[0160] (4.2.2) Texture color rendering: Randomly select one of the following two modes for rendering the texture color: grayscale mode or analogous color mode, which can visually fade the texture. Among them, grayscale mode renders the texture color by using the grayscale value of the base color; analogous color mode renders the texture color by using the offset color of the current background color.
[0161] Specifically, for each category of surface elements, a preset texture fading ratio is applied. Generate a random number r in the interval [0,1]. If the texture color of the face feature style needs to be diluted, then one of the following two modes is randomly selected for rendering: grayscale mode or similar color mode. When grayscale mode is selected for texture rendering, the grayscale value corresponding to the base color of the category is calculated, and this grayscale value is used as the texture color for the face feature style. When similar color mode is selected for texture rendering, the background color of the face feature in that category is used... Apply an offset of +15 (or -15 if the result is greater than 255) to obtain similar colors. Use a similar color as the texture color for the surface feature style during rendering.
[0162] (4.2.3) Boundary style rendering: The color and width of the boundary line of the opposite element are randomly rendered within its preset range. For example, the preset grayscale range of the color of the boundary line of the opposite element is (0,155), and the preset line width range is (1,3), and it is randomly rendered within this range.
[0163] (4.3) Perform multi-dimensional random perturbation on point and line element styles: Based on the corresponding baseline style, further perform multi-dimensional random adjustment on the attributes of point and line element styles within their preset range to achieve parametric symbol rendering of point and line element styles.
[0164] (4.3.1) Point Feature Disturbance Dimension: Based on the baseline style corresponding to the point feature style, preset ranges are set for the size, fill color, outline color, outline width, rotation angle, and other attributes of the point feature. Within the preset range corresponding to the attributes, at least one attribute of the point feature style is randomly adjusted to complete the parametric symbol rendering of the point feature style. Among them, the attributes of the point feature style include size, fill color, outline color, outline width, rotation angle, etc.
[0165] (4.3.2) Line Feature Disturbance Dimension: Based on the baseline style corresponding to the line feature style, preset the range of attributes such as line color, line width, and legend / graphic style of the line feature. Within the preset range corresponding to the attributes, randomly adjust at least one attribute of the line feature style to complete the parametric symbol rendering of the line feature style. Among them, the attributes of the line feature style include line color, line width, legend / graphic style, etc.
[0166] (5) Configure map pieces and layout parameters to randomly add map pieces, randomly determine the position of each piece in the map based on the layout rules, and parametrically adjust the visual appearance of each piece within the map area.
[0167] (5.1) Randomly add map elements: For map elements including legend, scale, compass, latitude and longitude lines, decide independently and randomly whether to add them to the map based on their preset probabilities.
[0168] Specifically, the probabilities of adding a legend, scale bar, north arrow, and latitude / longitude lines to the map are preset. For example, the probability of adding a legend to the map is... The probability of adding a map scale The probability of adding a compass to the map The probability of adding latitude and longitude lines to the map For each type of map, generate a random number r in the interval [0,1]. If r is less than or equal to its preset probability, then add the map.
[0169] (5.2) Random positioning based on layout rules: For the legend position, the legend is randomly selected to be placed on the right side, bottom, or four corners inside the viewport according to its preset weight; specifically, the probability weights of the legend being located on the right side, bottom, or four corners inside the viewport are preset respectively. For example, the probability weight of the legend being located on the right side of the map is... The legend is located below the map, representing the probability weights. The legend is located at the four corners inside the viewport, representing probability weights. Then, based on the preset weights corresponding to each location, a style is randomly selected from three layout styles to place the legend, choosing to place it on the right side, bottom, or one of the four corners inside the viewport. For the scale bar, its position on the map is randomly determined based on the legend's location: if the legend is on the right side of the map, the scale bar is placed inside the viewport or on the right side of the map; if the legend is at the bottom of the map, the scale bar is placed inside the viewport or at the bottom of the map; if the legend is at one of the four corners inside the viewport, the scale bar is placed inside the viewport. For the north arrow, it is randomly placed at one of the four corners inside the viewport.
[0170] (5.3) Randomization of map parameters: Randomly adjust the legend size, scale width, compass height, and latitude and longitude intervals to achieve parametric random adjustment of the visual appearance of each map.
[0171] (5.3.1) Legend size control: Under the constraints of the preset legend aspect ratio range and minimum width and minimum height, the legend size is randomly generated; the font size and line break width of the legend item label text are automatically set by dynamically adapting the number of lines and line width of the legend item label text; the number of legend item columns is randomly and adaptively adjusted according to the legend position under the constraints of the map viewport size.
[0172] (5.3.1.1) Set the dimensions of the legend surface: Under the constraints of the preset legend surface aspect ratio range and minimum width and minimum height, randomly generate the dimensions of the legend surface, that is, the width and height of the legend surface.
[0173] Specifically, the aspect ratio range of the preset legend drawing is defined. ,in and These represent the lower and upper limits of the aspect ratio range for the legend drawing, for example... , Minimum width of the preset legend drawing surface and minimum height ,For example , Randomly select an aspect ratio value within the preset aspect ratio range of the legend drawing. And, under the constraints of minimum width and minimum height, calculate the width and height of the legend drawing surface. The calculation formula is as follows:
[0174]
[0175]
[0176] In the formula, and These represent the width and height of the legend drawing, respectively.
[0177] (5.3.1.2) Setting the font size and line break width of the legend item label text: By dynamically adapting the number of lines and line width of the legend item label text, the font size and line break width of the legend item label text are automatically set. That is: short text does not wrap and the font size is scaled, with the font size proportional to the height of the legend figure. For medium to long texts, set maximum line count constraints for line breaks according to length levels, and determine the font size and line break width, where the font size is proportional to the height of the legend or figure. The ratio to the number of rows.
[0178] Specifically, first, iterate through the annotation text of all legend items, calculate their width based on font size and string length, and then count the maximum width of the legend item text. , can be represented as:
[0179]
[0180] In the formula, Indicates the first The width of the annotation text for each legend item. This indicates the total number of legend items. Then, based on the height of the legend image and the maximum width of the legend item text, the font size of the legend item text is automatically adjusted. and line break width :when When, do not break the line. ;when At this time, a maximum of two lines of text are allowed to be displayed. , ;when At this time, a maximum of three lines of text are allowed to be displayed. , .
[0181] (5.3.1.3) Adaptive Legend Item Column Number: The number of legend item columns is randomly and adaptively adjusted according to the legend position under the constraint of map viewport size.
[0182] Specifically, if the legend is on the right side of the map, it starts with 1 column. The number of columns is increased when the legend height is greater than the map viewport height to ensure that the legend does not exceed the map range in the vertical direction. If the legend is below the map, it starts with 1 row. The number of columns is reduced (i.e., the number of rows is increased) when the legend width is greater than the map viewport width to ensure that the legend does not exceed the map range in the horizontal direction. If the legend is inside the map viewport, the number of columns is dynamically set according to the legend item quantity threshold to ensure that the legend does not exceed the map viewport range. The height and width of the map viewport are the map viewport dimensions calculated in step (2).
[0183] (5.3.2) Scale width control: Randomly select the unit system of the scale to adjust the length of the main scale within its preset width range.
[0184] Specifically, first, a unit system (meter / kilometer / mile) is randomly selected, and the main scale length is initialized based on the selected unit. and step size For example, when the unit is meters, , When the unit is kilometers, , When the unit is miles, , Then, its width range is preset according to the scale. When the map scale is located inside the viewport or below the map, the width range of the map scale is related to the width of the map viewport, for example, the lower limit of the map scale width range. The upper limit of the scale width range When the scale bar is located on the right side of the map, the width range of the scale bar is related to the width of the legend, for example... , ,in The legend width is determined by the dimensions of the legend map, the font size and line break width of the legend item text, and the number of columns in the legend item. Finally, if the scale width... If the width exceeds the threshold, the preset maximum number of iterations is 19. The main scale length is then adjusted cyclically until the scale width meets the preset width range or the maximum number of iterations is reached. hour, ;when hour, .
[0185] (5.3.3) Compass height control: Randomly select the compass height within the preset compass height range.
[0186] Specifically, the height range of the compass is preset according to the height of the map viewport. The lower limit of the compass altitude range The upper limit of the compass altitude range And randomly select an altitude value from them as the compass altitude. .
[0187] (5.3.4) Latitude and longitude control: Randomly select the unit system of latitude and longitude, randomly determine the number of latitude and longitude lines within the preset number of latitude and longitude lines, and automatically calculate the latitude and longitude line intervals based on the geographic spatial range coordinates of the map viewport.
[0188] Specifically, randomly select the unit system (decimal system / degree-minute / degree-minute-second) for latitude and longitude lines; preset the range of latitude and longitude lines. and ,in It is a preset range of the number of meridians. It is a preset range of the number of latitude lines. and These are the lower and upper limits of the range of the number of meridians, respectively. and These are the lower and upper limits of the range of latitude lines, for example... , Randomly select a number of latitude and longitude lines from a preset range; the selected number of latitude and longitude lines... Number of selected latitude lines Based on the map viewport geospatial range set in step (2), the minimum X value (left boundary), maximum X value (right boundary), minimum Y value (lower boundary), and maximum Y value (upper boundary) are determined. Calculate and set the latitude and longitude intervals using the following formula:
[0189]
[0190]
[0191] In the formula, Indicates the interval between meridians. Indicates the interval between parallels of latitude.
[0192] (6) Configure output parameters (resolution / color mode / file format) to continuously export the engineering results after adjusting the annotation text parameters, symbol style parameters, map and layout parameters described in steps (3) to (5) as standardized geological map samples with arbitrary resolution, arbitrary color mode, and arbitrary file format. Among them, the configured output parameters support multiple data formats and arbitrary image resolution.
[0193] Specifically, configure the output parameters: resolution dpi=300, color mode color=8-bit AdaptivePalette, file format type=TIFF; after adjusting and continuously iterating the annotation text parameters, symbol style parameters, map and layout parameters in steps (3) to (5), export the engineering operation results of each iteration as a geological map sample.
[0194] (7) Extract multidimensional attribute information from geological map samples to construct structured metadata annotation data. Based on the structured metadata annotation data, extract the pixel-level spatial distribution of point, line, and polygon element symbols to construct a geological element mask annotation file. A type of polygon element mask annotation file is generated, such as... Figure 2 As shown.
[0195] Furthermore, the structured metadata annotation data includes: ① Map spatial information: Recording the geographic spatial range and map viewport size set in step (2). ② Legend item association information: For each legend item, recording its corresponding geological element attributes and visualization information, including element type (point / line / polygon), spatial coordinates of the element (point coordinates, line node string, polygon ring), original symbol color of the element (RGBA value), text label of the legend item (legend item text description), and pixel-level bounding box coordinates of the legend map in the map. ③ Map element information: Recording the pixel-level bounding box coordinates of map elements (legend box / scale bar / north arrow / map frame) in the map, used for the identification and elimination of occluded areas during masking post-processing.
[0196] In this embodiment, constructing the geological element mask annotation file specifically includes the following sub-steps:
[0197] (7.1) Set all pixels of the map to black.
[0198] Specifically, first, hide all text labels on all layers to eliminate text obscuring feature symbols. Then, uniformly set all feature symbols on all layers of the map to black: for point and line features, iterate through the layers that make up their symbols (such as fill layers / stroke layers / marker layers), setting each layer to black; for polygon features, replace their original symbol layers with pure black fill symbols. Finally, set the map background color to black to cover areas without features, creating a uniform background color.
[0199] (7.2) Traverse each legend item and set the relevant feature symbol pixels to white until the mask image corresponding to all legend items is obtained, so as to obtain the geological feature mask annotation file.
[0200] Specifically, the process begins by iterating through each legend item and locating its instance feature on the map. Then, the symbol for that instance feature is temporarily set to white, while the symbols for other features remain black: for point and line features, each layer is set to white; for polygon features, their original symbol layers are replaced with pure white filled symbols. Next, the current map layout is exported as a temporary image, and the following post-processing is performed: non-target areas (the legend frame / scale bar / north arrow inside the main map frame, and outside the main map frame) are covered with black rectangles; this results in a black and white binary mask image containing only the instance of that legend item. Finally, the instance feature symbol is restored to black, and the iteration continues to process the next legend item.
[0201] Furthermore, when unifying the map background and feature symbol colors to black, and when setting each layer of features to white, the following methods are used: For point and line features, traverse the style symbol composition layers (fill layer / stroke layer / marker layer) and set each layer to black or white; for polygon features, replace all layers of the original symbol with pure black or pure white fill symbols.
[0202] Furthermore, when post-processing non-target areas, the following method is used: based on the pixel-level bounding box coordinates of the map elements in the structured metadata annotation data, identify and cover the legend box / scale bar / north arrow area with a black rectangle; set the area outside the map frame to black pixel by pixel.
[0203] It is worth mentioning that this embodiment of the invention also provides a structured corpus generation device for training multimodal large-scale models of geological maps, used to implement the structured corpus generation method for training multimodal large-scale models of geological maps described in the above embodiments. For example... Figure 3 As shown, the device includes a data processing module, a sample generation module, a labeling construction module, and a scheduling and control module.
[0204] In this embodiment, the data processing module is used to preprocess geological vector data and construct a semantically aligned geological dataset. Specifically, this data processing module can perform standardized reconstruction of geological vector data, integrate point, line, and surface features to construct a spatially correlated layer set, and output a high-quality geological dataset with consistent semantics by filtering core geological features, correcting geometric errors, and standardizing semantic naming, thus providing a data foundation for other modules.
[0205] In this embodiment, the sample generation module is used to load vector data sequentially based on a geological dataset and unify the geospatial coordinate system. Simultaneously, it configures viewport selection parameters to randomly generate the map viewport geospatial range and map viewport size according to the threshold range constraints of the number of elements. Under the configuration constraints of annotation text parameters, symbol style parameters, map and layout parameters, and output parameters, it automatically generates geological map samples. Specifically, this sample generation module can intelligently construct diverse geological map corpus samples. Under the configuration constraints of multi-dimensional parameters, it automatically completes the selection of the geospatial framework, the synthesis and style perturbation of multi-type annotations of geological elements, the differentiated rendering of the symbol system, and the randomized layout of auxiliary elements, ultimately outputting a standardized main map and legend map combination sample.
[0206] In this embodiment, the annotation construction module is used to extract multi-dimensional attribute information from geological map samples to construct structured metadata annotation data, and to extract the pixel-level spatial distribution of point, line, and polygon element symbols to construct a geological element mask annotation file. Specifically, this annotation construction module can intelligently generate structured annotations for map samples, automatically extract structured metadata of map spatial range, element spatial attributes, and visual features; through dynamic symbol visibility control and region masking technology, it accurately separates and outputs binary mask images of each legend item instance, constructing pixel-level annotation data that is strictly aligned with the main map, supporting diverse multimodal model training needs.
[0207] In this embodiment, the scheduling and control module coordinates and integrates the execution flow of the data processing module, sample generation module, and annotation construction module, controlling the multi-process parallel iteration of structured corpus generation for geological maps across multiple datasets. Within each iteration cycle, the following actions are performed: reading and injecting viewport selection parameters, annotation text parameters, symbol style parameters, map and layout parameters, and output parameters from the configuration file; initializing the operating rules of each module; driving each module to execute randomized generation logic within preset boundaries through a parameter loading mechanism; and clearing temporary variables and dynamic parameters after the map samples and annotation data are generated, restoring the initial state.
[0208] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A structured corpus generation method for geological map multi-modal large model training, characterized in that, The method comprises the following steps: (1) preprocessing geological vector data, and constructing a semantically aligned geological data set; (2) based on the geological data set, sequentially loading the vector data, and unifying the geographic spatial coordinate system; meanwhile, configuring a viewport selection parameter item to constrain the random generation of the geographic spatial range and the size of the map viewport according to the element quantity threshold interval; (3) configuring a labeling text parameter item to fuse the real attribute field and the synthesized text, generate the double-labeled text of the layer and the legend of the element, and adjust the labeling text style of different dimensions based on the controllable randomization mechanism and the size of the map viewport; (4) configuring a symbol style parameter item to randomly select a reference style for different categories of elements, perform multi-level grouping rendering on the surface elements, and perform multi-dimensional random adjustment on the symbol style of the point and line elements, thereby completing the parameterized symbol rendering of each element; (5) configuring a map and layout parameter item to randomly add a map, randomly determine the position of each map in the map based on the layout rule, and perform parameterized random adjustment on the visual performance of each map in the map range; (6) configuring an output parameter item to continuously export the engineering running results adjusted by the labeling text parameter item, the symbol style parameter item, and the map and layout parameter item as a geological map sample; (7) extracting multi-dimensional attribute information of the geological map sample to construct structured meta-information labeling data, and extracting the pixel-level spatial distribution of the symbols of the point, line, and surface elements to construct a geological element mask labeling file.
2. The method of claim 1, wherein the method is performed by a computer system. The step (1) specifically comprises: obtaining original geological vector data from an official data source of a geological survey institution; integrating point, line, and surface vector data for a target geographic region to construct a multi-layer data set having a spatial correlation relationship; retaining a core geological element layer in the multi-layer data set and removing auxiliary mapping layers; standardizing layer names and attribute field names by converting abbreviations into full names; checking and repairing geometric errors of each layer, and for data that cannot be repaired, creating a new element class and migrating valid attributes to obtain preprocessed geological vector data; and constructing a semantically aligned geological data set based on the preprocessed geological vector data.
3. The method of claim 1, wherein the method is implemented by a computer system. The step (2) specifically comprises: loading vector data in the order of point, line, and surface elements based on the geological data set, and unifying the geographic spatial coordinate system; calculating the global spatial bounding box range of the loaded vector data layers; determining the size of the viewport according to the preset viewport proportion parameter and the global spatial bounding box range, and generating an initial viewport at a random position in the global spatial bounding box range; based on the number of point, line, and surface elements in the current viewport, adjusting the size of the viewport according to the preset point, line, and surface element quantity threshold interval, and randomly changing the position of the viewport; iteratively adjusting until a viewport satisfying the point, line, and surface element quantity threshold interval constraint condition is obtained, and setting the geographic spatial range and the size of the map viewport based on the selected viewport.
4. The method of claim 1, wherein the method is implemented by a computer system. The step (3) specifically comprises: Random generation of layer label text: if the specified real attribute field in the preset configuration of the label text parameter item is designated, the original value of the specified field is extracted from the attribute table of the feature as the layer label text; otherwise, Chinese or English layer label text is randomly generated for each feature by synthesizing text, and is written into the newly created layer label field of the corresponding feature attribute table; Random adjustment of layer label text styles of different dimensions: the number of visual labels is dynamically controlled according to the preset scale factor of the feature type, and the visual properties of the layer label text are randomly adjusted; Random generation of legend label text: if the specified real attribute field in the preset configuration of the label text parameter item is designated, the original value of the specified field is extracted from the attribute table of the feature as the legend label text; otherwise, the legend label text is randomly generated for each feature by synthesizing text, and is written into the newly added unique value rendering field of the attribute table of the corresponding feature type; Random adjustment of legend label text styles of different dimensions: for area features, the legend label text is displayed for all area features in the unique value rendering category whose area proportion in the map viewport area is greater than or equal to the preset area proportion threshold, and the visual properties of the legend label text are randomly adjusted.
5. The method of claim 4, wherein the method further comprises: The random generation of Chinese or English layer label text for each feature by synthesizing text specifically includes: Randomly extracting characters from a preset simplified Chinese character library to randomly generate a Chinese text string with a length within a preset length range as Chinese layer label text; according to a preset word quantity range and a length range of each word, an English text string composed of one or more words is randomly generated as English layer label text; The random generation of legend label text for each feature by synthesizing text specifically includes: For point, line and area features, a number of text strings equal to the total number of preset unique value categories are generated as candidate label texts to build a label text candidate pool for each feature type, wherein each text string is combined by randomly extracting a number of characters within a preset character length range from a preset candidate character library; each feature randomly selects a candidate label text from the label text candidate pool of its corresponding feature type as the legend label text.
6. The method of claim 1, wherein the method is implemented by a computer system. The step (4) specifically includes: Based on preset line feature length thresholds and area feature area thresholds, the features are classified by size, and according to the classification results, the reference styles are randomly selected from the preset style library for each category of point, line and area features; On the basis of the corresponding reference style, the background color, texture color and boundary style of the area feature are randomly rendered to realize multi-level grouping rendering of the area feature; On the basis of the corresponding reference style, the attributes of the point and line feature styles are randomly adjusted within their preset ranges to realize parameterized symbol rendering of the point and line feature styles.
7. The method of claim 6, wherein the method further comprises: The random rendering of the background color, texture color and boundary style of the area feature specifically includes: For the background color, all categories in the unique value rendering are randomly grouped into preset groups according to the preset category number interval, and a reference color is generated for each group; the background color of each category in the group is randomly selected and rendered within the preset fluctuation range of the reference color, so that the background color of different categories in the same group is similar but different; For the texture color, a gray mode or a similar color mode is randomly selected for rendering; wherein the gray mode renders the texture color by using the gray value color corresponding to the reference color, and the similar color mode renders the texture color by using the offset color of the current background color; For the border style, the color and width of the border line of the surface feature are randomly rendered within their preset ranges; The attributes of the point and line feature styles are randomly adjusted in multiple dimensions within their preset ranges, specifically including: For the point feature style, at least one attribute of the point feature style is randomly adjusted within the preset range corresponding to the attribute, including size, fill color, outline color, outline width, and rotation angle; For the line feature style, at least one attribute of the line feature style is randomly adjusted within the preset range corresponding to the attribute, including line color, line width, and legend map style.
8. The method of claim 1, wherein the method is implemented by a computer system. The step (5) specifically includes: For the map drawing containing legends, scales, compasses, and meridians, it is independently randomly decided whether to add them to the map according to their preset probabilities; For the legend, the legend is randomly placed on the right side, below, or inside the four corners of the viewport according to its preset weight; for the scale, the position of the scale in the map is randomly determined according to the position of the legend; for the compass, it is randomly placed in the four corners of the viewport; The size of the legend, the width of the scale, the height of the compass, and the interval between the meridians and the latitudes are randomly adjusted to achieve parameterized random adjustment of the visual performance of each drawing in the map range.
9. The method of claim 8, wherein the method further comprises: The random adjustment of the size of the legend, the width of the scale, the height of the compass, and the interval between the meridians and the latitudes specifically includes: For the size of the legend, the size of the legend map is randomly generated within the preset aspect ratio range of the legend map and the constraints of the minimum width and minimum height; the font size and line width of the legend item label text are automatically set by dynamically adapting the number of lines and line width of the legend label text; the number of legend columns is randomly and adaptively adjusted according to the position of the legend in the map viewport size; For the width of the scale, the unit system of the scale is randomly selected to adjust the length of the main scale within its preset width range; For the height of the compass, the height of the compass is randomly selected within the preset compass height range; For the interval between the meridians and the latitudes, the unit system of the meridians and the latitudes is randomly selected, the number of meridians and latitudes is randomly determined within the preset number range, and the interval between the meridians and the latitudes is automatically calculated based on the geographic space range coordinates of the map viewport.
10. The method of claim 1, wherein the method is implemented by a computer system. The structured meta-information annotation data includes: the geographic space range and the size of the map viewport, the element type, spatial coordinates, original symbol color, text label, and pixel-level bounding box coordinates of the legend item in the map, and the pixel-level bounding box coordinates of each drawing in the map. The construction geological element mask annotation file specifically comprises: uniformly setting all pixels of a map to black; traversing each legend item to set relevant element symbol pixels to white until mask images corresponding to all legend items are obtained to obtain a geological element mask annotation file.
11. A structured corpus generation device for geological map multimodal large model training, configured to implement the structured corpus generation method for geological map multimodal large model training according to any one of claims 1-10, characterized in that, Comprise: a data processing module for preprocessing geological vector data and constructing a semantically aligned geological data set; a sample generation module for loading vector data in sequence based on the geological data set and unifying a geographic spatial coordinate system; simultaneously configuring viewport selection parameter items to constrain random generation of a map viewport geographic spatial range and a map viewport size according to an element quantity threshold interval; and automatically generating a geological map sample under the configuration constraint of annotation text parameter items, symbol style parameter items, map and layout parameter items and output parameter items; a labeling construction module for extracting multi-dimensional attribute information of the geological map sample to construct structured meta-information labeling data and extracting pixel-level spatial distribution of point, line and surface element symbols to construct a geological element mask annotation file; a scheduling control module for coordinating execution processes of the data processing module, the sample generation module and the labeling construction module to control the structured corpus generation of the geological map to be in multi-process parallel iteration among multiple data sets.
Citation Information
Patent Citations
Method for automatically generating map annotation based on text by using large language model
CN117708252A
Multi-modal large model federation training platform and heterogeneous data alignment algorithm
CN120105464A