A method for managing target detection data samples based on category compatibility
By designing category relationships and labeling scope information, and using hash value hierarchical directory access method, the category incompatibility and data security problems in the target detection data sample management are solved, and efficient and secure data management and compatibility processing are achieved.
Patent Information
- Application Number
- CN202111482790.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-07
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2041-12-07
AI Technical Summary
The prior art has problems of category incompatibility, data security risks and low data efficiency in the management of target detection data samples, especially in the access and compatibility of massive data samples.
A target detection data sample management method based on category compatibility was designed. By designing the category relationship of the target, category structure information and labeling scope information were generated, and a hash-based hierarchical directory access method is adopted to ensure the access efficiency and security of data samples, while solving the category compatibility problem.
It realizes unified management of different data sets, ensures compatibility when using data sets in mixed use, avoids the generation of dirty data, and improves the access efficiency and security of data samples.
Smart Images

Figure CN114219939B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of target detection and data management, and in particular to a target detection data sample management method based on category compatibility. Background Art
[0002] With the rapid development of deep learning and computer vision, related technologies have been widely used in many fields. As an important part of image understanding, target detection is to find all targets (objects) of interest in the image and determine their positions and sizes. At present, the development of target detection algorithms based on deep learning requires the use of a large number of image data samples to train and test the model. The selection and use of image data samples can directly determine the quality of the final algorithm model. Therefore, efficient management and use of massive image data samples is a crucial part of algorithm development.
[0003] There are now abundant open source datasets in the field of target detection, such as VOC, COCO, ImageNet, etc., which facilitate the research and development of cutting-edge target detection algorithms. However, they differ greatly in terms of the number of categories, category range, annotation format, file naming, etc., and require a series of tedious format conversions, data filtering, etc. in actual use. In addition to public datasets, different industries and different companies often produce datasets according to their own needs, and there are also great differences in image types, target categories, target sizes, etc. in different datasets, resulting in data produced based on scene A often cannot be directly applied to scene B, resulting in problems such as the closedness and compatibility of data samples.
[0004] To address this problem, the prior art uses a two-layer structure to define a universal image dataset format, including information such as picture name, size, target type, target location shooting angle, difficulty, whether it is blocked, etc., and designs a database table structure in a universal format. This achieves the conversion of COCO and VOC datasets to the defined universal format and database storage, solving the problem of inconsistent formats and inability to mix public target detection datasets. However, the prior art still has the following problems:
[0005] 1. The information contained in the defined universal data format is not complete enough and cannot be compatible with existing open source data sets to the greatest extent;
[0006] 2. When generating a new data set through database screening, the compatibility of categories between data samples is not considered, which will cause the generated data set to contain a large amount of dirty data, thus seriously affecting the detection and recognition effect of the trained algorithm model;
[0007] 3. Storing image data in the database in binary form. This storage method poses a great risk to data security. Summary of the invention
[0008] The present invention aims to provide a method for managing target detection data samples based on category compatibility to solve the following problems:
[0009] 1. As the number of image data samples reaches millions or even tens of millions, it is necessary to ensure data access efficiency and data security;
[0010] 2. Different data sets contain different category names and numbers. It is necessary to establish a unified management method for these categories;
[0011] 3. When filtering and generating new data sets from all data samples, it is necessary to solve the category compatibility problem to ensure that no dirty data is added.
[0012] The present invention provides a method for managing target detection data samples based on category compatibility, comprising:
[0013] S10, designing the category relationship of the target, generating category structure information based on the category relationship, and generating annotation range information based on the original category of the data set;
[0014] S20, retrieve and create a data set from the database according to the scene task requirements, and use the category structure information and annotation range information to remove dirty data in the data set, so as to obtain a data set that meets the requirements; wherein the data samples in the data set include image data and annotation data; the image data and annotation data are accessed in the database using a hierarchical directory based on hash values; and the annotation data is defined with a general annotation data structure based on hash values.
[0015] Furthermore, the category relationship of the target designed in step S10 includes:
[0016] alias;
[0017] subclass sub;
[0018] Parent class up.
[0019] Furthermore, the method for generating the annotation range information based on the original categories of the data set in step S10 is: selecting a plurality of categories from the original categories of the data set and combining them into the annotation range.
[0020] Furthermore, in step S20, the method of removing dirty data in the data set using the category structure information and the annotation range information includes:
[0021] S21, updating the annotation range generated in step S10 in the following manner:
[0022] (1) Find the alias of each category, and add the found alias to the annotation range to form an annotation range with the alias;
[0023] (2) Find the subcategories and their aliases of each category, and add the found subcategories and their aliases to the annotation range to form a complete annotation range;
[0024] S22, when retrieving and creating a dataset from the database according to the scenario task requirements, the retrieved and created dataset is processed for compatibility as follows using the annotation range with an alias or the complete annotation range according to the compatibility strength:
[0025] (1) Obtain all the annotation ranges involved in the data samples in the data set and remove the annotation ranges that have no intersection with each other, to obtain a set of annotation ranges and an intersection of all the annotation ranges, wherein the intersection of all the annotation ranges is a mixed annotation range;
[0026] (2) Traverse the data samples in the data set. If the label range to which the target category of the data sample belongs is included in the label range set and the label range to which the target category of the data sample belongs also belongs to the mixed label range, then the data sample is valid; otherwise, the data sample is removed from the data set.
[0027] Furthermore, the image data and the annotation data are stored in the database in a hierarchical directory based on hash values, which means:
[0028] Define the storage root directory for image data and annotation data;
[0029] Calculate an M-bit hash value for the binary file of the image data as the sample uid;
[0030] In the storage root directory, the first N bits of the sample uid are taken as the hierarchical directory name, and the sample uid is used as the name of the image data and annotation data for storage.
[0031] Furthermore, the annotation data definition has a general annotation data structure based on a hash value, which means:
[0032] Combine sample uid and annotation data into a common annotation data structure.
[0033] In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are:
[0034] 1. The present invention establishes a unified management method for different data sets. By generating category structure information and annotation range information to perform compatibility filtering when data sets are mixed, it can solve the compatibility problem when data sets are mixed and avoid generating a large amount of dirty data when data sets are mixed.
[0035] 2. The data storage method adopted by the present invention can ensure the access efficiency of data samples and the security of massive data samples. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0037] Figure 1 The figure is a flowchart of a method for managing target detection data samples based on category compatibility according to an embodiment of the present invention.
[0038] Figure 2 It is a schematic diagram of representing the compatibility problem of data sets by marking ranges according to an embodiment of the present invention. DETAILED DESCRIPTION
[0039] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0040] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0041] Example
[0042] like Figure 1 As shown, this embodiment proposes a method for managing target detection data samples based on category compatibility, including:
[0043] S10, designing the category relationship of the target, and generating category structure information and annotation range information based on the category relationship;
[0044] The target categories of data samples in the data set are generally named after the actual names of the targets, such as Person, Cat, etc. The category relationships of the targets designed in this embodiment include:
[0045] alias;
[0046] subclass sub;
[0047] Parent class up.
[0048] A dataset usually contains one or more target categories. For example, COCO contains 80 categories and VOC contains 20 categories. Different datasets may have different categories or different naming methods, and there are certain relationships between categories.
[0049] The example of generating category structure information based on category relationship is as follows:
[0050]
[0051] The method for generating the annotation range information based on the original categories of the data set is: select several categories from the original categories of the data set to form the annotation range, as shown in the following example:
[0052]
[0053]
[0054] S20, retrieve and create a data set from the database according to the scene task requirements, and use the category structure information and annotation range information to remove dirty data in the data set, so as to obtain a data set that meets the requirements; wherein the data samples in the data set include image data and annotation data; the image data and annotation data are accessed in the database using a hierarchical directory based on hash values; and the annotation data is defined with a general annotation data structure based on hash values.
[0055] According to the annotation range generated in step S10, the category compatibility problem of the data samples in the data set is explained as follows:
[0056] Taking {label range a} as an example, it means selecting a set of image data and labeling the objects belonging to category 7 and category 5 in the image data, while not labeling the objects of other categories except category 7 and category 5. For a reliable dataset, it is generally believed that the image data in the dataset are labeled with the original category of the dataset, so different datasets have different label ranges. Then, what are the differences between label ranges? Figure 2 Three relationships are shown.
[0057] Therefore, when performing mixed filtering of datasets, if the target category b contained in dataset B is not included in the original category of dataset A (i.e., category b is not labeled in dataset A), then mixing datasets A and B will introduce a large number of unlabeled category b targets (i.e., dirty data), which is the category incompatibility problem. If the relationship between datasets A and B is Figure 2If the target category in the filtered data sample is included in the common category range of dataset A and dataset B, the filtered data sample will not have category compatibility problem.
[0058] Therefore, the method of removing dirty data in the data set using the category structure information and the annotation range information in step S20 includes:
[0059] S21, updating the annotation range generated in step S10 in the following manner:
[0060] (1) Find the alias of each category, and add the found alias to the annotation range to form an annotation range with the alias;
[0061] (2) Find the subcategories and their aliases of each category, and add the found subcategories and their aliases to the annotation range to form a complete annotation range;
[0062] S22, when retrieving and creating a dataset from the database according to the scenario task requirements, the retrieved and created dataset is processed for compatibility as follows using the annotation range with an alias or the complete annotation range according to the compatibility strength:
[0063] (1) Obtain all the annotation ranges involved in the data samples in the data set and remove the annotation ranges that have no intersection with each other, to obtain a set of annotation ranges and an intersection of all the annotation ranges, wherein the intersection of all the annotation ranges is a mixed annotation range;
[0064] (2) Traverse the data samples in the data set. If the label range to which the target category of the data sample belongs is included in the label range set and the label range to which the target category of the data sample belongs also belongs to the mixed label range, then the data sample is valid; otherwise, the data sample is removed from the data set.
[0065] In some embodiments, the image data and the annotation data are accessed in a database using a hierarchical directory based on hash values, which means:
[0066] Define the storage root directory for image data and annotation data. The example is as follows:
[0067] -Storage root directory /
[0068] -images /
[0069] -annotations /
[0070] Calculate an M-bit hash value for the binary file of the image data as the sample uid; the value of M is set as needed. Generally, in order to avoid generating the same sample uid for different data samples, the value of M can be set slightly larger, for example, M=40;
[0071] In the storage root directory, the first N bits of the sample uid are taken as the hierarchical directory name in turn, and the sample uid is used as the name of the image data and the annotation data for storage to avoid storing a large number of files in a single folder. The value of N is set as needed, and generally N=3 can be taken.
[0072] Therefore, an example of a storage path of the image data and the annotation data in the database using a hierarchical directory access method based on hash values is as follows:
[0073] -Storage root directory / images / 0 / 1 / 3 / 013a838be47c34a730450777a252270bbbfc0f32.png
[0074] -Storage root directory / annotations / 0 / 1 / 3 / 013a838be47c34a730450777a252270bbbfc0f32.xml
[0075] This storage method is used to separate image data and annotation data. When a database failure occurs, local data can be used to restore the data in the database, thereby ensuring the security of the managed data.
[0076] In some embodiments, the annotation data defines a general annotation data structure based on a hash value, which means:
[0077] Combine the sample uid and the annotation data into a common annotation data structure, as shown below:
[0078] {sample uid, target height, target width, target posture, whether it is truncated, whether it is blocked, whether it is a difficult target, whether it is a group target, annotation box type, annotation box coordinate point, sample image suffix, image height, image width, number of image channels, image type, image source, annotation range, annotation person, reviewer, annotation time}
[0079] It can be seen that the general annotation data structure contains all the information of the target. In addition, the image data, annotation data and general annotation data structure are all based on the sample uid. When using the data, it can be retrieved from the database through the sample uid, realizing the safe and efficient access of the data set. For example:
[0080] Create a database table with a universal annotation data structure, and synchronize the annotation data in the annotation file to the database table. Then, each data row in the database table corresponds to all the information of a target in the annotation file. You can use the fields of the universal annotation data structure to retrieve target information in the database table, and use the sample uid of the target to quickly obtain the corresponding image data.
[0081] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for managing target detection data samples based on category compatibility, characterized in that: include: S10, designing the category relationship of the target, generating category structure information based on the category relationship, and generating annotation range information based on the original category of the data set; The category relationship of the target designed in step S10 includes: alias; subclass; parent class; S20, according to the scene task requirements, retrieve and create a data set from the database, and use the category structure information and the annotation range information to remove dirty data in the data set, so as to obtain a data set that meets the requirements; wherein the data samples in the data set include image data and annotation data; the image data and the annotation data are accessed in the database using a hierarchical directory based on a hash value; and the annotation data is defined with a general annotation data structure based on a hash value; the method of removing dirty data in the data set using the category structure information and the annotation range information in step S20 includes: S21, updating the annotation range generated in step S10 in the following manner: (1) Find the alias of each category, and add the found alias to the annotation range to form an annotation range with the alias; (2) Find the subcategories and their aliases of each category, and add the found subcategories and their aliases to the annotation range to form a complete annotation range; S22, when retrieving and creating a dataset from the database according to the scenario task requirements, the retrieved and created dataset is processed for compatibility as follows using the annotation range with an alias or the complete annotation range according to the compatibility strength: (1) Obtain all the annotation ranges involved in the data samples in the data set and remove the annotation ranges that have no intersection with each other, to obtain a set of annotation ranges and an intersection of all the annotation ranges, wherein the intersection of all the annotation ranges is a mixed annotation range; (2) Traverse the data samples in the data set. If the label range to which the target category of the data sample belongs is included in the label range set and the label range to which the target category of the data sample belongs also belongs to the mixed label range, then the data sample is valid; otherwise, the data sample is removed from the data set.
2. The target detection data sample management method based on category compatibility according to claim 1 is characterized in that: The method for generating the annotation range information based on the original categories of the data set in step S10 is: selecting a plurality of categories from the original categories of the data set to form an annotation range.
3. The target detection data sample management method based on category compatibility according to claim 1 is characterized in that: The access method of the image data and the annotation data in the database using a hierarchical directory based on hash values refers to: Define the storage root directory for image data and annotation data; Calculate an M-bit hash value for the binary file of the image data as the sample uid; In the storage root directory, the first N bits of the sample uid are taken as the hierarchical directory name, and the sample uid is used as the name of the image data and annotation data for storage.
4. The target detection data sample management method based on category compatibility according to claim 3 is characterized in that: The annotation data definition has a general annotation data structure based on a hash value, which means: Combine sample uid and annotation data into a common annotation data structure.
Citation Information
Patent Citations
Training method of target recognition classification model, object recognition method and device, robot and medium
CN110059734A
General image data set management method based on database
CN110737790A