Sample generation method, apparatus, device, and storage medium
By introducing a dual-label system of sample labels and business labels into the remote sensing interpretation sample library, the problems of inconsistent labels and inaccurate semantics in the remote sensing interpretation sample library are solved, and the accurate classification of samples and unified labels are achieved, thereby improving the model training effect.
Patent Information
- Application Number
- CN202310215947.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-07
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2043-03-07
AI Technical Summary
In the existing remote sensing interpretation sample library, the sample labels under the independent label system have the problem of inaccurate semantics, and the labels of the same ground feature images under different label systems are not consistent, which makes it difficult for the samples to be truly reused and for the model generalization index to be improved.
A dual-label system of sample labels and business labels is adopted. The original samples are mapped to the first label system, the sample type is determined by the business label group, and the target samples are generated by slicing and filling according to the sample type, so as to achieve accurate classification of samples and unified labeling.
It achieves accurate classification and label unification of samples from different labeling systems, improves the model training effect, solves the problems of inconsistent labels and inaccurate semantics, and realizes true sample reuse.
Smart Images

Figure CN116385772B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of remote sensing sample generation technology, and more specifically, to a sample generation method, apparatus, device, and storage medium. Background Technology
[0002] With the development of Earth observation technology, more and more remote sensing data are being used in various fields such as surface information extraction and resource and ecological environment change monitoring, playing a significant role. With the continuous development of deep learning technology, the effectiveness of remote sensing image feature extraction has been significantly improved by training deep learning networks with large amounts of sample data.
[0003] The existing remote sensing interpretation sample library is built upon an independent labeling system. Using the existing labeling system as a reference, a label set is developed in conjunction with image features and actual operational needs, and the sample library is generated based on this label set.
[0004] However, the sample labels under the current independent labeling system have the problem of inaccurate semantics, and the labels of the same ground feature images are not consistent under different labeling systems. Therefore, when the generated samples are applied to model training, there are problems such as the samples being difficult to truly reuse and the model generalization index being difficult to improve. Summary of the Invention
[0005] The purpose of this application is to address the shortcomings of the prior art by providing a sample generation method, apparatus, device, and storage medium to solve the problems of semantic inaccuracy in sample labels under independent labeling systems and inconsistent labels for the same ground feature images under different labeling systems.
[0006] To achieve the above objectives, the technical solution adopted in this application is as follows:
[0007] Firstly, this application provides a sample generation method, the method comprising:
[0008] The original sample is mapped to the first label system to obtain the sample label of the original sample;
[0009] The business labels of the original samples are determined based on the sample labels, the preset business label groups, and the mapping relationship between the business labels and the sample labels. The business label groups include multiple business labels, and the multiple business labels are in an equal hierarchical relationship.
[0010] The sample type of the original sample is determined based on the business tag and the sample tag, and the sample type includes: fully mapped and partially mapped;
[0011] The original sample is sliced according to the sample type to obtain the target sample, and the business tag is used as the sample tag of the target sample.
[0012] Optionally, determining the business label of the original sample based on the sample label, a preset business label group, and the mapping relationship between the business label and the sample label includes:
[0013] Based on the mapping relationship between business tags and sample tags, obtain the business tags in the business tag group that have a mapping relationship with the sample tags;
[0014] The business label that has a mapping relationship with the sample label is used as the business label of the original sample.
[0015] Optionally, determining the sample type of the original sample based on the business tag and the sample tag includes:
[0016] The identification of the business tag of the original sample is compared with the identification of the sample tag to obtain the comparison result;
[0017] Based on the comparison results, the sample type of the original sample is determined.
[0018] Optionally, determining the sample type of the original sample based on the comparison result includes:
[0019] If the comparison result indicates that the identifier of the business tag is the same as the identifier of the sample tag, then the sample type of the original sample is determined to be a complete mapping;
[0020] If the comparison result indicates that the identifier of the business tag is different from the identifier of the sample tag, then the sample type of the original sample is determined to be incomplete mapping.
[0021] Optionally, the step of slicing the original sample according to the sample type to obtain the target sample includes:
[0022] If the sample type is a complete mapping, then a sliding window is used to slice the original sample to obtain the target sample;
[0023] If the sample type is not fully mapped, then the original sample is sliced with a centrally located patch, and the original sample is filled with background according to the application scenario of the original sample to obtain the target sample.
[0024] Optionally, the step of filling the background of the original sample according to the application scenario of the original sample to obtain the target sample includes:
[0025] If the original sample is the initial model training sample, then the original sample after slicing is masked to obtain the target sample;
[0026] If the original sample is a training sample for model generalization, then a generative adversarial network is used to fill the sliced original sample to obtain the target sample.
[0027] Optionally, the original sample includes image data and vector data;
[0028] The step of mapping the original sample to the first label system to obtain the sample label of the original sample includes:
[0029] Read the vector data of the original sample;
[0030] Based on the field information of the vector data, the original sample is mapped to the first label system to obtain the sample label of the original sample.
[0031] Secondly, this application provides a sample generation apparatus, the apparatus comprising:
[0032] The first mapping module is used to map the original sample to the first label system to obtain the sample label of the original sample;
[0033] The second mapping module is used to determine the business label of the original sample based on the sample label, the preset business label group, and the mapping relationship between the business label and the sample label. The business label group includes multiple business labels, and the multiple business labels are in an equal hierarchical relationship.
[0034] The determination module is used to determine the sample type of the original sample based on the business tag and the sample tag, wherein the sample type includes: fully mapped and partially mapped;
[0035] The slicing module is used to slice the original sample according to the sample type to obtain the target sample, and use the business tag as the sample tag of the target sample.
[0036] Optionally, the second mapping module is specifically used for:
[0037] Based on the mapping relationship between business tags and sample tags, obtain the business tags in the business tag group that have a mapping relationship with the sample tags;
[0038] The business label that has a mapping relationship with the sample label is used as the business label of the original sample.
[0039] Optionally, the determining module is specifically used for:
[0040] The identification of the business tag of the original sample is compared with the identification of the sample tag to obtain the comparison result;
[0041] Based on the comparison results, the sample type of the original sample is determined.
[0042] Optionally, the determining module is further specifically used for:
[0043] If the comparison result indicates that the identifier of the business tag is the same as the identifier of the sample tag, then the sample type of the original sample is determined to be a complete mapping;
[0044] If the comparison result indicates that the identifier of the business tag is different from the identifier of the sample tag, then the sample type of the original sample is determined to be incomplete mapping.
[0045] Optionally, the slicing module is specifically used for:
[0046] If the sample type is a complete mapping, then a sliding window is used to slice the original sample to obtain the target sample;
[0047] If the sample type is not fully mapped, then the original sample is sliced with a centrally located patch, and the original sample is filled with background according to the application scenario of the original sample to obtain the target sample.
[0048] Optionally, the slicing module is further specifically used for:
[0049] If the original sample is the initial model training sample, then the original sample after slicing is masked to obtain the target sample;
[0050] If the original sample is a training sample for model generalization, then a generative adversarial network is used to fill the sliced original sample to obtain the target sample.
[0051] Optionally, the original sample includes image data and vector data;
[0052] The first mapping module is also specifically used for:
[0053] Read the vector data of the original sample;
[0054] Based on the field information of the vector data, the original sample is mapped to the first label system to obtain the sample label of the original sample.
[0055] Thirdly, this application provides an electronic device, including: a processor, a storage medium, and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the sample generation method described above.
[0056] Fourthly, this application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the sample generation method described above.
[0057] The beneficial effects of this application are: sample generation is based on a dual-label system constructed from sample labels and business labels. Sample labels can accurately classify samples from different label systems, and business labels can slice samples of different sample types. Since the business labels are at the same level, accurate semantic expression can be achieved for labels under the same label system. Furthermore, for different label systems, label unification can be achieved through business labels. Attached Figure Description
[0058] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0059] Figure 1 A schematic diagram of a sample set provided in an embodiment of this application is shown;
[0060] Figure 2 A schematic diagram illustrating an application scenario provided by an embodiment of this application is shown;
[0061] Figure 3 A flowchart of a sample generation method provided in an embodiment of this application is shown;
[0062] Figure 4 This document illustrates a flowchart of a method for determining a business tag, as provided in an embodiment of this application.
[0063] Figure 5 This document illustrates a flowchart of a method for determining a sample type, as provided in an embodiment of this application.
[0064] Figure 6 This document illustrates a flowchart illustrating yet another method for determining a sample type, as provided in an embodiment of this application.
[0065] Figure 7 This document illustrates a flowchart of a sample slicing method provided in an embodiment of this application.
[0066] Figure 8 This illustration shows a schematic diagram of a slice with a centrally located patch provided in an embodiment of this application;
[0067] Figure 9 This document illustrates a flowchart of a background filling process provided in an embodiment of this application.
[0068] Figure 10 A schematic diagram of a mask filling result provided in an embodiment of this application is shown;
[0069] Figure 11 This illustration shows a schematic diagram of a generative adversarial network result filling method provided in an embodiment of this application;
[0070] Figure 12 This document illustrates a flowchart of a method for determining sample labels according to an embodiment of this application.
[0071] Figure 13 This paper shows a schematic diagram of the structure of a sample generation device provided in an embodiment of this application;
[0072] Figure 14 A schematic diagram of the structure of an electronic device provided in an embodiment of this application is shown. Detailed Implementation
[0073] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the accompanying drawings in this application are for illustrative and descriptive purposes only and are not intended to limit the scope of protection of this application. Furthermore, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of this application. It should be understood that the operations in the flowcharts may not be implemented in sequence, and steps without logical contextual relationships may be reversed or implemented simultaneously. In addition, those skilled in the art, guided by the content of this application, may add one or more other operations to the flowcharts, or remove one or more operations from the flowcharts.
[0074] Furthermore, the described embodiments are merely some, not all, of the embodiments of this application. The components of the embodiments of this application described and illustrated herein can typically be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0075] It should be noted that the term "comprising" will be used in the embodiments of this application to indicate the presence of the features declared thereafter, but does not exclude the addition of other features.
[0076] In the scenario of generating remote sensing interpretation samples, existing remote sensing sample data is filtered according to the logical relationship of lower-level coverage of higher-level data when it is used. For example, when training a sports field based on an existing sample library, after label filtering and retrieval, a sample with the label set "basketball court", a sample with the label set "tennis court", and a sample with the label set "sports field" can be obtained. All the filtered samples are used to train the model for intelligent interpretation of "sports field", and finally the intelligent model result that can complete the inference of "sports field" is obtained.
[0077] However, the sample labels in the current independent labeling system have the problem of inaccurate semantics, and the sample labels under different labeling systems are inconsistent.
[0078] For example, under the existing independent labeling system, basketball courts and badminton courts are both subsets of sports fields. When adopting... Figure 1 When training the model using the sample images of basketball courts and sports fields shown, the desired outcome is a model that can accurately detect and extract various types of sports fields. However, Figure 1 In the sample images of basketball courts, unlabeled badminton courts mixed in would be considered non-sports fields, while... Figure 1 In the sample images of sports fields, badminton courts are often mistakenly identified as sports fields. Therefore, during the model training phase, Figure 1 The badminton courts in the sample images of the sports field are labeled, which tells the computer that this is a sports field. Figure 1 The lack of labeling for badminton court sample images in basketball courts tells the computer that this is not a sports field, even though they clearly share the same characteristics. This creates mutually exclusive samples during model training, negatively impacting the model's final metrics. However, training with a single sports field sample image fails to achieve true sample reuse and cannot support model generalization and metric improvement in practical applications.
[0079] It is evident that sample labels within the same labeling system may exhibit inaccurate semantics due to the hierarchical relationship between labels.
[0080] On the other hand, under different labeling systems, the same sample may be assigned different labels, resulting in inconsistent sample labels. For example, a land parcel labeled "paddy field" should theoretically be expanded based on the higher-level label "arable land," with the first-level category being "vegetation." However, its characteristics often conform to the first-level label "water area." If an intelligent interpretation model for water areas is trained according to this labeling system, paddy field samples cannot be selected for training, and the final model's generalization ability cannot be improved with the support of paddy field samples.
[0081] Based on the above problems, this application proposes a sample generation method. By using a dual-label system of sample labels and business labels, the creation and use of samples are isolated from each other, and their coupling relationship is broken. This overcomes the problems of inconsistent labels and inaccurate semantics of sample labels, and achieves true sample reuse.
[0082] like Figure 2 The image shown is an application scenario provided in this application. The user inputs the collected raw data into an electronic device. The raw data can be, for example, multiple raw remote sensing images, which include various land cover images required for model training. The electronic device can then add labels to the raw data and slice the raw data to generate training samples required for the model.
[0083] Next, combine Figure 3 The sample generation method of this application will be further explained. The subject executing this method can be an electronic device, such as... Figure 3 As shown, the method includes:
[0084] S301: Map the original sample to the first label system to obtain the sample label of the original sample.
[0085] Optionally, taking the scenario of generating remote sensing interpretation samples as an example, the original sample can be the original remote sensing data. Mapping the original sample to the first label system can be done by mapping the field information in the original remote sensing data to the first label system.
[0086] Optionally, the first labeling system can be a label tree for classifying samples, which can express the semantic relationship of the label hierarchy through a tree structure. Each label tree includes multiple sample labels with hierarchical relationships.
[0087] For example, some of the labels in the land classification labeling system can be shown in Table 1 below, where the secondary classification is a subset of the primary classification.
[0088] Table 1 Land Classification
[0089]
[0090] For example, if the original remote sensing image contains multiple rivers and lakes, based on the field information in the original remote sensing image, the lakes can be labeled as "area water" and the rivers as "linear water".
[0091] S302: Determine the business labels of the original samples based on the sample labels, the preset business label groups, and the mapping relationship between the business labels and the sample labels. The business label group includes multiple business labels, and the multiple business labels are in an equal hierarchical relationship.
[0092] Optionally, business tag groups can be multiple tag groups formed by users grouping tags according to specific business scenarios. The business tags in each business tag group are at the same level, that is, there is no hierarchical structure between the tags in the business tag group.
[0093] As one possible implementation, users can directly regroup the sample tags to obtain business tag groups. When the business tag groups are set, the mapping relationship between sample tags and business tags is actually established.
[0094] As another possible implementation, users can also set new business labels according to business needs and determine the data source for each business label, that is, which sample labels corresponding to each business label can be used as data sources.
[0095] It is worth noting that when users group tags to form business tag groups, a mapping relationship between sample tags and business tags has actually been established, that is, the sample source of each business tag in the business tag group has been determined.
[0096] For example, assuming the business scenario involves sample segmentation and generation of elements such as buildings and roads, the business tags in the business tag group can be set as: buildings and roads. The sample tags corresponding to the business tag "building" include building land and facility land, while the sample tags corresponding to the business tag "road" include highways and railways. Therefore, when sample A is a factory building, its sample tag is building land. Based on the mapping relationship between sample tags and business tags, the business tag for sample A can be determined to be a building.
[0097] S303: Determine the sample type of the original sample based on the business label and sample label. The sample type includes: fully mapped and partially mapped.
[0098] Optionally, the sample type of the original sample is used to characterize the mapping relationship between business labels and sample labels.
[0099] In this context, "complete mapping" can mean that the sample label and the business label of the original sample are completely consistent. For example, if the sample label and the business label of sample A are both "sports field", then the sample type of sample A can be considered to be completely mapped.
[0100] Incomplete mapping can refer to situations where the sample labels and business labels of the original sample are not completely consistent. For example, if the sample labels are a subset of the business labels, or if the sample labels and business labels have no subordinate relationship, the sample type of the original sample can be considered to be incomplete mapping.
[0101] For example, if sample A is labeled as "basketball court" and business label as "sports field", then we can determine that sample A is a non-complete mapping.
[0102] It should be noted that the above explanation of sample types uses sample A as an example. When determining the sample type, since a mapping relationship is pre-established between sample labels and business labels, all samples under the same sample label can be of the same sample type. For example, when the business label is "sports field", the sample labels that have a mapping relationship with this business label include "basketball court", "badminton court", and "sports field". Then, the sample type of all samples with the sample labels "basketball court" and "badminton court" is a partial mapping, while the sample type of "sports field" is a complete mapping.
[0103] S304: Slice the original sample according to the sample type to obtain the target sample, and use the business label as the sample label of the target sample.
[0104] Optionally, the target sample can be the training sample required for subsequent model training.
[0105] It is worth noting that the original sample may include at least one target sample, for example Figure 1 The sports field sample shown includes three target samples. This application embodiment is only used as an example of an original sample including one target sample. It should be understood that after generating multiple target samples, the business tags of each target sample can be used as the sample tags of the target samples respectively.
[0106] In this embodiment, a dual-label system based on sample labels and business labels is used for sample generation. Sample labels allow for precise classification of samples from different label systems, while business labels segment samples of different types. Since all business labels are at an equal level, accurate semantic expression can be achieved for labels within the same label system, and label unification can be achieved for different label systems through business labels. This application isolates sample creation and usage, decoupling them and overcoming the problems of inconsistent labels and inaccurate sample label semantics, thus achieving true sample reuse.
[0107] The following describes the steps for determining the business labels of the original samples based on the sample labels, preset business label groups, and the mapping relationship between business labels and sample labels. Figure 4 As shown, step S302 above includes:
[0108] S401: Based on the mapping relationship between business tags and sample tags, obtain the business tags in the business tag group that have a mapping relationship with the sample tags.
[0109] Optionally, the mapping relationship between business tags and sample tags can be one-to-one or one-to-many, that is, one business tag can correspond to one or more sample tags.
[0110] Each business tag group includes multiple business tags. When it is necessary to determine the business tag corresponding to a sample tag, the business tag corresponding to the sample tag can be determined based on this mapping relationship.
[0111] For example, assuming that the business label that has a mapping relationship with the sample label "badminton court" is "sports field", then based on this mapping relationship, we can determine that "sports field" in the business label group is a business label that has a mapping relationship with the sample label "badminton court".
[0112] S402: Use the business labels that have a mapping relationship with the sample labels as the business labels of the original samples.
[0113] For example, assuming that “sports field” in the business label group is determined to be a business label that has a mapping relationship with the sample label “badminton court”, then the business label “sports field” can be determined as the business label of all original samples in “badminton court”.
[0114] The following are explanations of the steps for determining the sample type of the original sample based on the business tag and sample tag, as described above. Figure 5 As shown, the above step S303 includes:
[0115] S501: Compare the identifier of the business label of the original sample with the identifier of the sample label to obtain the comparison result.
[0116] Optionally, the identifier of a business label can be the field information of the business label or the encoding information of the business label, etc.; the identifier of a sample label can be the field information of the sample label or the encoding information of the sample label, etc., wherein the field information can be the name of the label, and the encoding can be, for example, the label encoding in Table 1.
[0117] S502: Determine the sample type of the original sample based on the comparison results.
[0118] Optionally, based on the comparison results of the business tags and sample tags, it can be determined whether the business tags and sample tags are the same tags, tags with a subset relationship, or tags without a hierarchical relationship, thereby determining whether the sample type of the original sample is a complete mapping or a non-complete mapping.
[0119] Furthermore, such as Figure 6 As shown, in step S502 above, the sample type of the original sample is determined based on the comparison results, including:
[0120] S601: If the comparison result indicates that the identifier of the business label is the same as the identifier of the sample label, then the sample type of the original sample is determined to be a complete mapping.
[0121] Optionally, when the identifier of the business label is the same as the identifier of the sample label, that is, when the field information or code of the business label is the same as the field information or code of the sample label, the sample type of the original sample can be considered to be a complete mapping.
[0122] S602: If the comparison result indicates that the identifier of the business label is different from the identifier of the sample label, then the sample type of the original sample is determined to be incomplete mapping.
[0123] For example, suppose the comparison result indicates that the field information of the business label and the sample label are different. For instance, the sample label is "ping-pong court" but the business label is "sports field". Then it can be determined that the sample type of the original sample under the label "ping-pong court" is not fully mapped.
[0124] Optionally, after determining the sample type, the fully mapped samples can be divided into one sample set, the partially mapped samples into another sample set, and the original samples in the two sample sets can be split to obtain the final target samples.
[0125] The following is a description of the steps in step S304 above, which involves slicing the original sample according to the sample type to obtain the target sample. Figure 7 As shown, step S304 above includes:
[0126] S701: If the sample type is a complete mapping, a sliding window is used to slice the original sample to obtain the target sample.
[0127] For the original samples corresponding to the sample labels that are completely mapped to the business labels, the sample labels and business labels can accurately express the semantics of each original sample. Therefore, the step size of the sliding window can be set, and the sliding window can be used to slide on each original sample in turn to obtain the target sample.
[0128] by Figure 1 Taking the sports field sample set as an example, if the business label of the sample set is sports field, then its sample type is fully mapped. In this case, a sliding window can be used to segment the original samples in the sample set, and the target samples obtained are "basketball court sample", "badminton court sample" and "table tennis court sample".
[0129] S702: If the sample type is not fully mapped, then slice the original sample into patches and fill the background of the original sample according to the application scenario of the original sample to obtain the target sample.
[0130] When sample labels and business labels are inconsistent, directly using a sliding window for segmentation can lead to semantic inaccuracies, for example... Figure 1If the business label of the basketball court sample set is basketball court, then directly segmenting the basketball court sample set will misidentify badminton court samples as basketball court samples. Therefore, for this type of sample that is not completely mapped, the method of placing slices in the map patch can be used.
[0131] like Figure 8 The diagram shown is a schematic of a slice placed in the center of a patch, as provided in this application. Figure 1 In the basketball court sample set, when its business label is "basketball court," its sample type can be determined to be incompletely mapped. After performing patching on the basketball court sample set, only sample patches consistent with the business label will be retained. Figure 8 The basketball court sample after being sliced in the center of the image.
[0132] Optionally, the application scenario of the original sample can refer to the specific model training scenario in which the original sample is applied, such as the initial training of the model and the generalization training of the model.
[0133] It is worth noting that in the scenario of remote sensing interpretation sample generation, in order to retain more sample information and improve the usability of samples in model training, after slicing the incompletely mapped samples, this application can also fill the background of the original samples according to the application scenario of the original samples to obtain the target samples, such as... Figure 9 As shown, the above step S702 includes:
[0134] S901: If the original sample is the initial model training sample, then the original sample after slicing is masked to obtain the target sample.
[0135] Optionally, for applications training initial models without pre-trained models, a masking method can be used to fill the unlabeled regions of the sliced original samples with colored fill as a background, and then slice the samples into fixed-size slices centered on the patches. Since the semantic information surrounding the sample patches may affect the model training and fitting process and the final model—for example, when learning a building detection model, buildings are usually surrounded by road features. If a region has building features, but the surrounding features match those of a lake, then that region will not be detected as a building, because lakes typically do not contain buildings—a buffer zone can be set during this filling process to preserve a certain range of areas surrounding the labeled patches.
[0136] For example, for Figure 8 After masking and filling the basketball court sample obtained from the middle slice, the resulting target sample can be as follows: Figure 10 As shown, the background area can be filled with a mask, and the shadow area is a buffer area for secondary filling.
[0137] S902: If the original sample is the model generalization training sample, then the generative adversarial network is used to fill the original sample after slicing to obtain the target sample.
[0138] For generalization training of models with pre-trained models, a larger number of samples and a wider variety of sample types are required to improve the model's adaptability to different samples. Therefore, generative adversarial networks can be used to fill in the samples and improve the efficiency of generating target samples.
[0139] by Figure 8 Taking a basketball court sample obtained from a slice as an example, after background filling using a generative adversarial network, the result can be as follows: Figure 11 As shown, for the labeled patch areas, a buffer area can still be set to retain a certain amount of the original information. For other areas, the generator uses samples from the fully mapped sample set to assist in generating the background of samples from the incompletely mapped sample set. A pre-trained model is used as a discriminator for prediction to generate high-quality training samples.
[0140] After slicing and processing the samples in the fully mapped sample set and the incompletely mapped sample set to obtain the target samples, as a possible implementation, the samples can be integrated according to their business labels. For example, when the business label is "sports field", the label "basketball court" in the incompletely mapped sample set can be set to "sports field", and the generated target samples can be used for subsequent model training.
[0141] Optionally, the aforementioned original sample may include image data and vector data. The image data may be raster data, and the vector data may include attribute data (attribute table), in which the field information describes the attribute information of the vector.
[0142] Next, combine Figure 12 The steps described above for mapping the original samples to the first label system to obtain the sample labels of the original samples are explained as follows: Figure 12 As shown, the above step S301 includes:
[0143] S1201: Read the vector data of the original sample.
[0144] Optionally, the vector data of the original sample can be read. This can be done by reading the field information in the vector data. Vector data usually includes multiple fields, such as ID, name, type, etc.
[0145] S1202: Map the original sample to the first label system based on the field information of the vector data to obtain the sample label of the original sample.
[0146] Optionally, the electronic device can pre-store the mapping relationship between field information and sample labels in the labeling system.
[0147] It is worth noting that vector data can include multiple fields, and one of these fields can be used as the field for mapping. The specific field to be specified can be set by technical personnel according to the business scenario, and this application does not impose any restrictions on it.
[0148] As one possible implementation, the field information may include a code, based on which the corresponding tag system and sample tag can be determined.
[0149] For example, assuming the field information of the original sample vector data is the code "110102", referring to Table 1, we can determine that its corresponding first label system is land classification, and the sample label of the original sample is "building".
[0150] As another possible implementation, the field information may also include the name of the patch, and the sample label of the sample can also be determined based on the patch name.
[0151] For example, if the field information of the original sample vector data is "Qinghai Lake", the field "Qinghai Lake" is mapped to the label system of lakes in the label system. According to the preset mapping relationship, its sample label can be determined as "area water".
[0152] It should be noted that this application only uses encoding and patch name as examples to illustrate vector data mapping. Those skilled in the art can also use other mapping methods to determine the sample label of the original sample, and this application does not impose any restrictions on this.
[0153] Based on the same inventive concept, this application also provides a sample generation device corresponding to the sample generation method. Since the principle of the device in this application is similar to that of the sample generation method described above, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.
[0154] Reference Figure 13 The diagram shown is a schematic of a sample generation device provided in an embodiment of this application. The device includes: a first mapping module 1301, a second mapping module 1302, a determination module 1303, and a slicing module 1304, wherein:
[0155] The first mapping module 1301 is used to map the original sample to the first label system to obtain the sample label of the original sample;
[0156] The second mapping module 1302 is used to determine the business label of the original sample based on the sample label, the preset business label group and the mapping relationship between the business label and the sample label. The business label group includes multiple business labels, and the multiple business labels are in an equal hierarchical relationship.
[0157] The determination module 1303 is used to determine the sample type of the original sample based on the business tag and the sample tag. The sample type includes: complete mapping and incomplete mapping.
[0158] The slicing module 1304 is used to slice the original sample according to the sample type to obtain the target sample, and use the business label as the sample label of the target sample.
[0159] Optionally, the second mapping module 1302 is specifically used for:
[0160] Based on the mapping relationship between business tags and sample tags, obtain the business tags in the business tag group that have a mapping relationship with the sample tags;
[0161] Use the business labels that have a mapping relationship with the sample labels as the business labels of the original samples.
[0162] Optionally, module 1303 is specifically used for:
[0163] The identification of the business label in the original sample is compared with the identification of the sample label to obtain the comparison result;
[0164] Based on the comparison results, the sample type of the original sample is determined.
[0165] Optionally, the determination module 1303 is also specifically used for:
[0166] If the comparison result indicates that the identifier of the business label is the same as the identifier of the sample label, then the sample type of the original sample is determined to be a complete mapping.
[0167] If the comparison result indicates that the identifier of the business label is different from the identifier of the sample label, then the sample type of the original sample is determined to be incomplete mapping.
[0168] Optionally, the slice module 1304 is specifically used for:
[0169] If the sample type is a complete mapping, a sliding window is used to slice the original sample to obtain the target sample;
[0170] If the sample type is not fully mapped, the original sample is sliced in the center of the image and the background of the original sample is filled according to the application scenario of the original sample to obtain the target sample.
[0171] Optionally, the slicing module 1304 is also specifically used for:
[0172] If the original sample is the initial model training sample, then the original sample after slicing is masked to obtain the target sample;
[0173] If the original sample is the model's generalization training sample, then a generative adversarial network is used to fill in the sliced original sample to obtain the target sample.
[0174] Optionally, the original samples include image data and vector data;
[0175] The first mapping module 1301 is also specifically used for:
[0176] Read the vector data of the original sample;
[0177] Based on the field information of the vector data, the original samples are mapped to the first label system to obtain the sample labels of the original samples.
[0178] The processing flow of each module in the device and the interaction flow between each module can be referred to the relevant descriptions in the above method embodiments, and will not be detailed here.
[0179] This application embodiment accurately classifies samples from different labeling systems using sample tags and segments samples of different sample types using business tags. Since the business tags are at the same level, accurate semantic expression can be achieved for tags under the same labeling system, and label unification can be achieved for different labeling systems through business tags.
[0180] This application also provides an electronic device, such as... Figure 14 The diagram shown is a schematic representation of an electronic device structure provided in an embodiment of this application, including: a processor 1401, a memory 1402, and a bus. The memory 1402 stores machine-readable instructions executable by the processor 1401 (e.g., ...). Figure 13 The device includes the execution instructions corresponding to the first mapping module 1301, the second mapping module 1302, the determination module 1303, and the slicing module 1304. When the computer device is running, the processor 1401 and the memory 1402 communicate via a bus. When the machine-readable instructions are executed by the processor 1401, the above-mentioned sample generation method is processed.
[0181] This application also provides a computer-readable storage medium storing a computer program, which, when run by a processor, executes the steps of the above-described sample generation method.
[0182] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems and devices described above can be referred to the corresponding processes in the method embodiments, and will not be repeated here. In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection can be through some communication interfaces; the indirect coupling or communication connection of devices or modules can be electrical, mechanical, or other forms.
[0183] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. If the functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0184] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A sample generation method, characterized in that, include: The original sample image is mapped to the first label system to obtain the sample label of the original sample image; Based on the sample tags, the preset business tag group, and the mapping relationship between the business tags and the sample tags, the business tags of the original sample image are determined. The business tag group includes multiple business tags, and the multiple business tags are in an equal hierarchical relationship. The identification of the business tag in the original sample image is compared with the identification of the sample tag to obtain a comparison result. If the comparison result indicates that the identification of the business tag is the same as the identification of the sample tag, the sample type of the original sample image is determined to be a complete mapping. If the comparison result indicates that the identification of the business tag is different from the identification of the sample tag, the sample type of the original sample image is determined to be a non-complete mapping. If the sample type is a complete mapping, then a sliding window is used to slice the original sample image to obtain the target sample image; If the sample type is not fully mapped, the original sample image is sliced by placing the inset of the image patch to obtain the sliced original sample image; if the original sample image is the initial model training sample, the sliced original sample image is masked and filled to obtain the target sample image; if the original sample image is the model generalization training sample, a generative adversarial network is used to fill the sliced original sample image to obtain the target sample image, and the business label is used as the sample label of the target sample image.
2. The method according to claim 1, characterized in that, The step of determining the business label of the original sample image based on the sample label, the preset business label group, and the mapping relationship between the business label and the sample label includes: Based on the mapping relationship between business tags and sample tags, obtain the business tags in the business tag group that have a mapping relationship with the sample tags; The business label that has a mapping relationship with the sample label is used as the business label of the original sample image.
3. The method according to claim 1, characterized in that, The original sample images include image data and vector data; The step of mapping the original sample image to the first labeling system to obtain the sample label of the original sample image includes: Read the vector data of the original sample image; Based on the field information of the vector data, the original sample image is mapped to the first label system to obtain the sample label of the original sample image.
4. A sample generation device, characterized in that, include: The first mapping module is used to map the original sample image to the first label system to obtain the sample label of the original sample image; The second mapping module is used to determine the business label of the original sample image based on the sample label, the preset business label group, and the mapping relationship between the business label and the sample label. The business label group includes multiple business labels, and the multiple business labels are in an equal hierarchical relationship. The determination module is used to compare the identifier of the business tag of the original sample image with the identifier of the sample tag to obtain a comparison result; if the comparison result indicates that the identifier of the business tag is the same as the identifier of the sample tag, then the sample type of the original sample image is determined to be a complete mapping; if the comparison result indicates that the identifier of the business tag is different from the identifier of the sample tag, then the sample type of the original sample image is determined to be a non-complete mapping. The slicing module is used to slice the original sample image using a sliding window to obtain the target sample image if the sample type is a complete mapping; if the sample type is a non-complete mapping, the original sample image is sliced using in-slice patches to obtain the sliced original sample image; if the original sample image is an initial model training sample, the sliced original sample image is masked and filled to obtain the target sample image; if the original sample image is a model generalization training sample, a generative adversarial network is used to fill the sliced original sample image to obtain the target sample image, and the business tag is used as the sample tag of the target sample image.
5. An electronic device, characterized in that, include: The device includes a processor, a storage medium, and a bus, wherein the storage medium stores program instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the program instructions to perform the steps of the sample generation method as described in any one of claims 1 to 3.
6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the sample generation method as described in any one of claims 1 to 3.
Citation Information
Patent Citations
Map slice generation method and device, storage medium and electronic equipment
CN111667573A
Training sample generation method and device
CN113408482A