Data set construction method, device and system and storage medium

By deduplication and screening the industrial data sets, a high-quality data set covering a wide range of industrial scenarios was constructed, which solved the problem of insufficient data scale and diversity in the existing data set construction methods, and improved the effect of self-supervised pre-training.

CN119904714APending Publication Date: 2025-04-29BEIJING LUSTER LIGHTTECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411995447.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-29

AI Technical Summary

Technical Problem

The existing industrial data set construction methods have problems with insufficient data scale and diversity, which affects the effect of self-supervised pre-training.

Method used

By acquiring the first industrial data set and performing deduplication processing, the second industrial data set is obtained; then screening the second industrial data set based on the predetermined industrial data set to obtain the third industrial data set; finally, the training industrial data set of the industrial detection model is determined based on the predetermined industrial data set and the third industrial data set.

Benefits of technology

The scale and diversity of industrial data sets are improved, allowing them to cover diverse industrial scenarios, reduce human intervention, improve data set construction efficiency, ensure data set quality and reduce noise impact.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119904714A_ABST
    Figure CN119904714A_ABST
Patent Text Reader

Abstract

The invention discloses a data set construction method, a data set construction device, a data set construction system and a computer readable storage medium. The data set construction method comprises the steps of obtaining a first industrial data set and a predetermined industrial data set; performing duplicate removal processing on the first industrial data set to obtain a second industrial data set; screening the second industrial data set based on a predetermined industrial data set to obtain a third industrial data set; and determining a training industrial data set of the industrial detection model according to the predetermined industrial data set and the third industrial data set. Therefore, the scale and diversity of the industrial data set can be improved, and the industrial data set can cover diversified industrial scenes. Besides, the automatic and standardized data set construction scheme provided by the embodiment of the invention also has the advantages of reducing human intervention, improving data set construction efficiency, ensuring data set quality, reducing noise influence and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of industrial detection technology, and in particular to a data set construction method, a data set construction device, a data set construction system and a computer-readable storage medium. Background Art

[0002] With the rapid development of deep learning technology, self-supervised learning (SSL) has become a research hotspot in the current industry and academia because it does not require large-scale labeled data. However, the effectiveness of self-supervised pre-training is highly dependent on high-quality, rich and diverse large-scale datasets. Current industrial dataset construction methods generally have problems such as insufficient data scale and diversity. Summary of the invention

[0003] The embodiments of the present application provide a data set construction method, a data set construction device, a data set construction system and a computer-readable storage medium to solve at least one of the above-mentioned technical problems.

[0004] The data set construction method of the embodiment of the present application includes:

[0005] obtaining a first industrial data set and a predetermined industrial data set;

[0006] Deduplication processing is performed on the first industrial data set to obtain a second industrial data set;

[0007] Based on the predetermined industrial data set, the second industrial data set is screened to obtain a third industrial data set;

[0008] A training industrial data set for an industrial detection model is determined according to the predetermined industrial data set and the third industrial data set.

[0009] In some embodiments, the first industrial data set includes a plurality of first industrial images, and performing deduplication processing on the first industrial data set to obtain the second industrial data set includes:

[0010] Inputting the first industrial data set into a pre-trained model to generate a plurality of first image embedding vectors corresponding to the plurality of first industrial images;

[0011] Calculating cosine similarities between the plurality of first image embedding vectors;

[0012] A representative industrial image from the multiple first industrial images is selected according to the cosine similarity between the multiple first image embedding vectors to obtain the second industrial data set.

[0013] In some embodiments, calculating the cosine similarity between the plurality of first image embedding vectors comprises:

[0014] For each first industrial image, calculating a first cosine similarity between the first image embedding vector corresponding to the current first industrial image and the first image embedding vectors corresponding to the remaining first industrial images;

[0015] The step of selecting a representative industrial image from the plurality of first industrial images according to the cosine similarity between the plurality of first image embedding vectors to obtain the second industrial data set includes:

[0016] sorting the remaining first industrial images according to the first cosine similarity;

[0017] Selecting a first predetermined number of industrial images that are neighbors of the current first industrial image from the remaining first industrial images;

[0018] Selecting, from the industrial images of the first predetermined number of neighbors, industrial images whose first cosine similarity is greater than a predetermined cosine similarity;

[0019] The representative industrial image is selected from the industrial images whose first cosine similarity is greater than a predetermined cosine similarity to determine the second industrial data set.

[0020] In some embodiments, the predetermined industrial data set includes a plurality of predetermined industrial images, the second industrial data set includes a plurality of second industrial images, and the second industrial data set is screened based on the predetermined industrial data set to obtain a third industrial data set, including:

[0021] Inputting the predetermined industrial data set and the second industrial data set into a pre-trained model to generate a plurality of predetermined image embedding vectors corresponding to the plurality of predetermined industrial images and a plurality of second image embedding vectors corresponding to the plurality of second industrial images;

[0022] calculating cosine similarities between the plurality of predetermined image embedding vectors and the plurality of second image embedding vectors;

[0023] Similar industrial images are selected from the plurality of second industrial images according to the cosine similarities between the plurality of predetermined image embedding vectors and the plurality of second image embedding vectors to obtain the third industrial data set.

[0024] In some embodiments, calculating the cosine similarities between the plurality of predetermined image embedding vectors and the plurality of second image embedding vectors comprises:

[0025] For each predetermined industrial image, calculating a second cosine similarity between the predetermined image embedding vector corresponding to the current predetermined industrial image and the plurality of second image embedding vectors;

[0026] The selecting similar industrial images from the plurality of second industrial images according to the cosine similarities between the plurality of predetermined image embedding vectors and the plurality of second image embedding vectors to obtain the third industrial data set comprises:

[0027] When the size of the predetermined industrial data set is greater than a predetermined size, sorting the plurality of second industrial images according to the second cosine similarity;

[0028] Selecting industrial images that are a second predetermined number of neighbors of the current predetermined industrial image from the plurality of second industrial images as the similar industrial images to determine the third industrial data set.

[0029] In some embodiments, calculating the cosine similarities between the plurality of predetermined image embedding vectors and the plurality of second image embedding vectors comprises:

[0030] For each predetermined industrial image, calculating a second cosine similarity between the predetermined image embedding vector corresponding to the current predetermined industrial image and the plurality of second image embedding vectors;

[0031] The selecting similar industrial images from the plurality of second industrial images according to the cosine similarities between the plurality of predetermined image embedding vectors and the plurality of second image embedding vectors to obtain the third industrial data set comprises:

[0032] When the size of the predetermined industrial data set is smaller than the predetermined size, clustering the plurality of second industrial images to obtain a plurality of categories of second industrial images;

[0033] Selecting a type of second industrial image that is most similar to the current predetermined industrial image from the multiple types of second industrial images according to the second cosine similarity;

[0034] A third predetermined number of industrial images corresponding to the currently predetermined industrial image are sampled from the most similar second industrial images as the similar industrial images to determine the third industrial data set.

[0035] In some embodiments, determining a training industrial data set for an industrial detection model according to the predetermined industrial data set and the third industrial data set includes:

[0036] Randomly sampling a fourth predetermined number of industrial images from each category of the plurality of categories of second industrial images;

[0037] The predetermined industrial data set, the third industrial data set, and the fourth predetermined number of industrial images are combined as the training industrial data set.

[0038] The data set construction device of the embodiment of the present application includes:

[0039] A data acquisition module, used for acquiring a first industrial data set and a predetermined industrial data set;

[0040] a deduplication processing module, used for performing deduplication processing on the first industrial data set to obtain a second industrial data set;

[0041] A screening processing module, configured to perform screening processing on the second industrial data set based on the predetermined industrial data set to obtain a third industrial data set;

[0042] The data determination module is used to determine a training industrial data set for the industrial detection model according to the predetermined industrial data set and the third industrial data set.

[0043] The data set construction system of the embodiment of the present application includes one or more processors and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the data set construction method of any of the above embodiments is implemented.

[0044] The computer-readable storage medium of the embodiment of the present application stores a computer program thereon, and when the program is executed by a processor, the data set construction method of any of the above embodiments is implemented.

[0045] The data set construction method, data set construction device, data set construction system and computer-readable storage medium of the implementation mode of the present application first deduplicate the first industrial data set to obtain the second industrial data set, and then screen the second industrial data set based on the predetermined industrial data set to obtain the third industrial data set, thereby determining the training industrial data set of the industrial detection model based on the predetermined industrial data set and the third industrial data set. In this way, the scale and diversity of the industrial data set can be increased so that it can cover a variety of industrial scenarios. In addition, the automated and standardized data set construction scheme proposed in the implementation mode of the present application also has many advantages such as reducing human intervention, improving data set construction efficiency, ensuring data set quality, and reducing noise impact.

[0046] Additional aspects and advantages of the embodiments of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the embodiments of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:

[0048] Figure 1 is a flowchart of a method for constructing a data set in certain embodiments of the present application;

[0049] Figure 2 It is a schematic diagram of the working process of the data set construction method of certain embodiments of the present application;

[0050] Figure 3 is a flowchart of a method for constructing a data set in certain embodiments of the present application;

[0051] Figure 4 is a flowchart of a method for constructing a data set in certain embodiments of the present application;

[0052] Figure 5 is a flowchart of a method for constructing a data set in certain embodiments of the present application;

[0053] Figure 6 is a flowchart of a method for constructing a data set in certain embodiments of the present application;

[0054] Figure 7 is a flowchart of a method for constructing a data set in certain embodiments of the present application;

[0055] Figure 8 is a flowchart of a method for constructing a data set in certain embodiments of the present application;

[0056] Fig. 9 is a schematic diagram of a module of a data set construction device in certain embodiments of the present application;

[0057] Fig.10 is a schematic diagram of modules of a data set construction system of certain embodiments of the present application;

[0058] Fig.11 It is a schematic diagram of the connection status between a computer-readable storage medium and a processor in certain embodiments of the present application.

[0059] Description of reference numerals:

[0060] Data set construction device 100, data acquisition module 10, deduplication processing module 20, screening processing module 30, data determination module 40, data set construction system 200, processor 210, memory 220, computer readable storage medium 300, computer program 310, processor 320. DETAILED DESCRIPTION

[0061] The following is a further description of the embodiments of the present application in conjunction with the accompanying drawings. The same or similar reference numerals in the accompanying drawings represent the same or similar elements or elements with the same or similar functions from beginning to end. In addition, the embodiments of the present application described below in conjunction with the accompanying drawings are exemplary and are only used to explain the embodiments of the present application, and cannot be understood as limiting the present application.

[0062] With the rapid development of deep learning technology, self-supervised learning has become a hot research topic in industry and academia because it does not require large-scale labeled data. However, the effectiveness of self-supervised pre-training is highly dependent on high-quality, rich and diverse large-scale datasets. Current industrial dataset construction methods mainly focus on the following aspects:

[0063] Manually labeled data: Traditional datasets mostly rely on manual labeling to ensure high quality, but this process is time-consuming and labor-intensive, and extremely costly when faced with massive amounts of data.

[0064] Data augmentation and sampling: Data augmentation technology is used to generate more diverse samples, but it is limited to expanding the diversity of existing data and cannot solve the problem of insufficient coverage of source data.

[0065] Multi-source data integration: Collecting data from multiple different sources and integrating them into a larger data set, but the data cleaning and unification process is complex, and it is difficult to ensure consistency and unbiasedness.

[0066] Although the above industrial dataset construction method meets the needs of some industrial scenarios to a certain extent, it has the following problems:

[0067] Insufficient data size and diversity: Current industrial dataset construction methods are usually unable to cover all possible application scenarios in industrial scenarios, resulting in insufficient dataset size and diversity, affecting the effectiveness of self-supervised pre-training.

[0068] Data quality is difficult to guarantee: In the process of multi-source data integration, data noise and quality issues are common, which seriously affect the training effect of the model.

[0069] Lack of standardized and automated processes: The current industrial dataset construction process mostly relies on manual labor and lacks standardization and automation support, resulting in low construction efficiency.

[0070] The implementation methods of the present application are intended to address the limitations of industrial dataset construction methods in related technologies and propose an industrial dataset construction method that supports large-scale self-supervised pre-training.

[0071] See also Figure 1 and Figure 2 , the data set construction method of the implementation mode of the present application includes:

[0072] 010: Obtain the first industrial data set and the predetermined industrial data set;

[0073] 020: De-duplicate the first industrial data set to obtain the second industrial data set;

[0074] 030: Screening and processing the second industrial data set based on the predetermined industrial data set to obtain a third industrial data set;

[0075] 040: Determine a training industrial data set for the industrial detection model according to the predetermined industrial data set and the third industrial data set.

[0076] The data set construction method of the implementation mode of the present application first deduplicates the first industrial data set to obtain the second industrial data set, and then screens the second industrial data set based on the predetermined industrial data set to obtain the third industrial data set, thereby determining the training industrial data set of the industrial detection model based on the predetermined industrial data set and the third industrial data set. In this way, the scale and diversity of the industrial data set can be increased so that it can cover a variety of industrial scenarios. In addition, the automated and standardized data set construction scheme proposed in the implementation mode of the present application also has many advantages such as reducing human intervention, improving data set construction efficiency, ensuring data set quality, and reducing noise impact.

[0077] Specifically, in 010, a first industrial data set and a predetermined industrial data set are obtained. The predetermined industrial data set can be an existing high-quality industrial data set, while the first industrial data set is a massive unprocessed industrial data set. Due to long-term industrial accumulation, existing high-quality industrial data collection is available, such as some public industrial data sets and carefully processed industrial production line data sets. These data sets are representative, clear and high-quality, and can be collected and used directly, but their number is often limited. In industrial scenarios, massive unprocessed data sets account for the majority. Therefore, in order to build a large-scale data set, it is also necessary to collect it. However, since its quality is often poor and there is a lot of noise, it needs to be filtered before it can be used. Therefore, it is necessary to reasonably use the existing small amount of high-quality industrial data sets and massive industrial data sets with noise to build a high-quality large-scale data set.

[0078] In 020, the first industrial data set is deduplicated to obtain the second industrial data set. In this way, deduplication of the collected massive industrial data set can reduce redundancy and improve data diversity. It can be understood that there are often a large amount of duplicate data in massive data. These data not only occupy storage space, but also may interfere with subsequent data analysis and model training. Through deduplication, these redundant data can be effectively removed to make the data set more compact and efficient. In addition, deduplication can also improve data diversity to a certain extent. When the redundant data in the data set is removed, the remaining data will better represent the characteristics and distribution of the entire data set, thereby helping the model to learn more generalized and accurate feature representations. In addition, in the process of data analysis and model training, processing redundant data consumes a lot of computing resources and time. Through deduplication, these unnecessary resource consumption can be reduced and the efficiency and speed of data processing can be improved. Among them, deduplication can be performed based on the image similarity between multiple first industrial images in the first industrial data set to remove redundant data with high similarity.

[0079] In 030, the second industrial data set is screened and processed based on the predetermined industrial data set to obtain the third industrial data set. Since the predetermined industrial data set is derived from carefully processed and verified industrial data, it has a high degree of accuracy and representativeness, and the second industrial data set contains a large amount of original, unprocessed industrial data, therefore, the predetermined industrial data set can be used as a screening benchmark for the second industrial data set to retrieve and screen out data that meets the requirements. Among them, the screening process can be performed based on the image similarity between multiple second industrial images in the second industrial data set and multiple predetermined industrial images in the predetermined industrial data set, so as to retrieve and screen out data with high similarity to the high-quality data set.

[0080] In 040, the training industrial data set of the industrial detection model is determined based on the predetermined industrial data set and the third industrial data set. In this way, the training industrial data set for the industrial detection model constructed not only covers a wide range of industrial scenarios, but also has sufficient quality and diversity to provide high-quality data support for industrial vision tasks. The training industrial data set will effectively improve the training effect of industrial detection models (such as industrial vision models) and enhance their performance and generalization ability in practical applications.

[0081] It is understandable that although simple data enhancement technology can expand the diversity of data sets through data enhancement, it does not involve extracting more representative or useful information from the original data, which may lead to a lack of diversity in industrial scenarios in the data set. In addition, integration based on a single data set is prone to the problem of uneven data quality.

[0082] The data set construction method of the present application embodiment has at least the following advantages:

[0083] First, increase the scale and diversity of data sets: By collecting and processing massive amounts of industrial data and using deduplication and retrieval and screening technologies, we can effectively cover a variety of industrial scenarios and avoid the current problem of insufficient data set size.

[0084] Second, automation and standardization: Compared with the traditional manual construction method, the implementation method of the present application greatly improves the efficiency of data set construction, reduces manual intervention, and improves the level of automation of data processing.

[0085] Third, reduce noise and ensure data quality: By deduplicating and retrieving data, redundancy and noise can be effectively removed to ensure the high quality of the data set.

[0086] Fourth, enhance the effect of self-supervised learning: The constructed large-scale, diverse and high-quality dataset can better support self-supervised pre-training, thereby improving the model training effect and generalization ability.

[0087] Fifth, multi-source data integration method: optimize the scale and diversity of data sets by combining high-quality industrial data sets with massive noisy data.

[0088] See also Figure 3 In some embodiments, the first industrial data set includes a plurality of first industrial images. The first industrial data set is deduplicated to obtain a second industrial data set (ie, 020), including:

[0089] 021: inputting the first industrial data set into the pre-trained model to generate a plurality of first image embedding vectors corresponding to the plurality of first industrial images;

[0090] 022: Calculate the cosine similarity between multiple first image embedding vectors;

[0091] 023: Select a representative industrial image from the multiple first industrial images according to the cosine similarity between the multiple first image embedding vectors to obtain a second industrial data set.

[0092] Specifically, first, the first industrial data set is input into the pre-trained model to generate multiple first image embedding vectors corresponding to the multiple first industrial images. In this way, by using the pre-trained model to generate multiple first image embedding vectors corresponding to the multiple first industrial images, the image can be converted into a vector in a high-dimensional space to capture the underlying features of the image, thereby facilitating the similarity comparison between the multiple first industrial images. The pre-trained model can be a pre-trained image embedding model ResNet, VGG, EfficientNet or other deep learning models.

[0093] Then, the cosine similarity between the multiple first image embedding vectors is calculated, and the cosine similarity is used as a similarity metric. Among them, the cosine similarity is used to measure the angle between the multiple first image embedding vectors. The smaller the angle, the higher the similarity. Finally, representative industrial images from the multiple first industrial images are selected according to the cosine similarity between the multiple first image embedding vectors to obtain a second industrial data set. The implementation method of the present application generates the first image embedding vector through a pre-trained model, and then uses the cosine similarity to determine the image similarity, so as to remove redundant data and retain representative images.

[0094] See also Figure 4 In some embodiments, calculating the cosine similarity (i.e., 022) between the plurality of first image embedding vectors comprises:

[0095] 0221: for each first industrial image, calculating a first cosine similarity between a first image embedding vector corresponding to the current first industrial image and first image embedding vectors corresponding to the remaining first industrial images;

[0096] Select a representative industrial image from the plurality of first industrial images according to the cosine similarity between the embedding vectors of the plurality of first images to obtain a second industrial data set (ie, 023), including:

[0097] 0231: Sort the remaining first industrial images according to the first cosine similarity;

[0098] 0232: Selecting a first predetermined number of industrial images that are neighbors of the current first industrial image from the remaining first industrial images;

[0099] 0233: Selecting an industrial image whose first cosine similarity is greater than a predetermined cosine similarity from the industrial images of the first predetermined number of neighbors;

[0100] 0234: Select representative industrial images from industrial images whose first cosine similarity is greater than a predetermined cosine similarity to determine a second industrial data set.

[0101] Specifically, for each first industrial image, the first cosine similarity between the first image embedding vector corresponding to the first industrial image (that is, the current first industrial image) and the first image embedding vector corresponding to all other first industrial images (that is, the remaining first industrial images) is calculated. The remaining first industrial images can be sorted according to the first cosine similarity, with the high similarity in the front and the low similarity in the back. Then, industrial images of the first predetermined number of neighbors are selected from the remaining first industrial images. The first predetermined number can be set in advance manually, for example, the industrial images of the first 128 neighbors are selected. Then, industrial images whose first cosine similarity is greater than the predetermined cosine similarity are selected from the industrial images of the first 128 neighbors. The predetermined cosine similarity can be set to 0.8, for example. Assuming that the first cosine similarity of 60 industrial images among the first 128 neighbors is greater than 0.8, the 60 industrial images are selected. Finally, a representative industrial image is retained from these 60 industrial images (other industrial images are deleted) to form a second industrial data set. The strategy of retaining representative industrial images includes but is not limited to selecting the industrial image with the highest first cosine similarity as the representative industrial image, or selecting the central image determined by some clustering analysis algorithm as the representative industrial image, etc. In this way, by retaining the deduplication method of representative industrial images, redundancy can be reduced and data diversity can be improved.

[0102] It should be noted that after performing the above operation on a certain first industrial image to select a representative industrial image, thereby achieving deletion of multiple first industrial images, the above operation can be performed again on other first industrial images to select a representative industrial image, thereby achieving further deletion of multiple first industrial images. In addition, when the number of multiple first industrial images is large, the multiple first industrial images can be grouped first, and then the above operation can be performed on each group of first industrial images.

[0103] See also Figure 5 In some embodiments, the predetermined industrial data set includes a plurality of predetermined industrial images, and the second industrial data set includes a plurality of second industrial images. The second industrial data set is screened based on the predetermined industrial data set to obtain a third industrial data set (i.e., 030), including:

[0104] 031: inputting the predetermined industrial data set and the second industrial data set into the pre-training model to generate a plurality of predetermined image embedding vectors corresponding to the plurality of predetermined industrial images and a plurality of second image embedding vectors corresponding to the plurality of second industrial images;

[0105] 032: Calculating cosine similarities between a plurality of predetermined image embedding vectors and a plurality of second image embedding vectors;

[0106] 033: Select similar industrial images from the plurality of second industrial images according to the cosine similarities between the plurality of predetermined image embedding vectors and the plurality of second image embedding vectors to obtain a third industrial data set.

[0107] Specifically, first, the predetermined industrial data set and the second industrial data set are input into the pre-trained model to generate a plurality of predetermined image embedding vectors corresponding to a plurality of predetermined industrial images and a plurality of second image embedding vectors corresponding to a plurality of second industrial images. In this way, by using the pre-trained model to generate a plurality of predetermined image embedding vectors corresponding to a plurality of predetermined industrial images and a plurality of second image embedding vectors corresponding to a plurality of second industrial images, the image can be converted into a vector in a high-dimensional space to capture the underlying features of the image, thereby facilitating the similarity comparison between the predetermined industrial image and the second industrial image. The pre-trained model can be a pre-trained image embedding model such as ResNet, VGG, EfficientNet or other deep learning models.

[0108] Then, the cosine similarity between the multiple predetermined image embedding vectors and the multiple second image embedding vectors is calculated, and the cosine similarity is used as a similarity metric. Among them, the cosine similarity is used to measure the angle between the predetermined image embedding vector and the second image embedding vector. If the angle is smaller, the similarity is higher. Finally, similar industrial images from the multiple second industrial images are selected according to the cosine similarity between the multiple predetermined image embedding vectors and the multiple second image embedding vectors to obtain a third industrial data set. The implementation method of the present application realizes the retrieval and screening of the deduplicated massive industrial data set based on the high-quality industrial data set, and images with high similarity to the high-quality industrial data set can be screened out from the deduplicated massive industrial data set.

[0109] See also Figure 6In some embodiments, calculating the cosine similarity (i.e., 032) between a plurality of predetermined image embedding vectors and a plurality of second image embedding vectors comprises:

[0110] 0321: For each predetermined industrial image, calculating a second cosine similarity between a predetermined image embedding vector corresponding to the current predetermined industrial image and a plurality of second image embedding vectors;

[0111] Select similar industrial images from the plurality of second industrial images according to the cosine similarity between the plurality of predetermined image embedding vectors and the plurality of second image embedding vectors to obtain a third industrial data set (ie, 033), including:

[0112] 0331: when the scale of the predetermined industrial data set is greater than the predetermined scale, sorting the plurality of second industrial images according to the second cosine similarity;

[0113] 0332: Selecting industrial images of a second predetermined number of neighbors before a current predetermined industrial image from a plurality of second industrial images as similar industrial images to determine a third industrial data set.

[0114] Specifically, for each predetermined industrial image, the second cosine similarity between the predetermined image embedding vector corresponding to the predetermined industrial image (that is, the current predetermined industrial image) and the multiple second image embedding vectors is calculated. Different strategies for selecting similar industrial images can be implemented according to the scale of the predetermined industrial data set. In the implementation mode of the present application, if the scale of the predetermined industrial data set is large, for example, greater than the predetermined scale, the multiple second industrial images can be sorted according to the second cosine similarity, with the high similarity in the front and the low similarity in the back. Then, the industrial images of the first second predetermined number of neighbors of the current predetermined industrial image are selected from the multiple second industrial images as similar industrial images. The second predetermined number can be set artificially in advance, and these similar industrial images are retained to form a third industrial data set. In this way, when the scale of the predetermined industrial data set is large, similar industrial images can be directly searched for by neighbors from multiple second industrial images, so that enough similar industrial images can be obtained simply and efficiently to form a third industrial data set.

[0115] It should be noted that after performing the above operation on a predetermined industrial image to select similar industrial images, the above operation will continue to be performed on other predetermined industrial images to select similar industrial images. In this way, similar industrial images corresponding to each predetermined industrial image can be obtained. The implementation method of the present application can effectively extract images similar to high-quality data sets from massive data, thereby constructing an industrial data set that is both diverse and highly relevant.

[0116] See also Figure 7In some embodiments, calculating the cosine similarity (i.e., 032) between a plurality of predetermined image embedding vectors and a plurality of second image embedding vectors comprises:

[0117] 0322: For each predetermined industrial image, calculating a second cosine similarity between a predetermined image embedding vector corresponding to the current predetermined industrial image and a plurality of second image embedding vectors;

[0118] Select similar industrial images from the plurality of second industrial images according to the cosine similarity between the plurality of predetermined image embedding vectors and the plurality of second image embedding vectors to obtain a third industrial data set (ie, 033), including:

[0119] 0333: when the scale of the predetermined industrial data set is smaller than the predetermined scale, clustering the plurality of second industrial images is performed to obtain a plurality of categories of second industrial images;

[0120] 0334: selecting a second industrial image that is most similar to the current predetermined industrial image from multiple types of second industrial images according to the second cosine similarity;

[0121] 0335: Sampling a third predetermined number of industrial images corresponding to the current predetermined industrial image from the most similar type of second industrial images as similar industrial images to determine a third industrial data set.

[0122] Specifically, for each predetermined industrial image, the second cosine similarity between the predetermined image embedding vector corresponding to the predetermined industrial image (that is, the current predetermined industrial image) and the multiple second image embedding vectors is calculated. Different strategies for selecting similar industrial images can be implemented according to the scale of the predetermined industrial data set. In the implementation mode of the present application, if the scale of the predetermined industrial data set is small, for example, less than the predetermined scale, the multiple second industrial images can be clustered first to obtain multiple categories of second industrial images. The clustering method includes but is not limited to k-means clustering. K-means clustering is simple and efficient, has a good clustering effect, and can classify similar second industrial images into the same category. Then, according to the second cosine similarity, a class of second industrial images that is most similar to the current predetermined industrial image is selected from the multiple classes of second industrial images, and can be selected specifically according to the second cosine similarity. For example, if the average value of the second cosine similarity corresponding to all second industrial images in one class of second industrial images is the highest, then the class of second industrial images is used as the class of second industrial images that is most similar to the current predetermined industrial image. Finally, a third predetermined number of industrial images corresponding to the current predetermined industrial image are sampled from the most similar second industrial image as similar industrial images. The third predetermined number can be set in advance manually, and these similar industrial images are retained to form a third industrial data set. The sampling method can be random sampling, or sampling according to the second cosine similarity (selecting the third predetermined number of neighboring industrial images). In this way, when the scale of the predetermined industrial data set is small, a third predetermined number of industrial images are sampled from the most similar second industrial image, so as to obtain a sufficient number of similar industrial images to form a third industrial data set.

[0123] It should be noted that after performing the above operation on a predetermined industrial image to select similar industrial images, the above operation will continue to be performed on other predetermined industrial images to select similar industrial images. In this way, similar industrial images corresponding to each predetermined industrial image can be obtained. The implementation method of the present application can effectively extract images similar to high-quality data sets from massive data, thereby constructing an industrial data set that is both diverse and highly relevant.

[0124] See also Figure 8 In some embodiments, determining a training industrial data set (i.e., 040) for an industrial detection model based on a predetermined industrial data set and a third industrial data set includes:

[0125] 041: Randomly sampling a fourth predetermined number of industrial images from each category of the second industrial images of the multiple categories of second industrial images;

[0126] 042: Merge the predetermined industrial data set, the third industrial data set, and a fourth predetermined number of industrial images as a training industrial data set.

[0127] Specifically, for multiple categories of second industrial images, a fourth predetermined number of industrial images are randomly sampled from each category of second industrial images. The random sampling method includes but is not limited to simple random sampling, systematic sampling, stratified sampling, multi-stage sampling, etc. The fourth predetermined number can be set in advance manually. Among them, for different categories of second industrial images, the fourth predetermined number can be different. For example, the sampling number can be determined according to the size of the cluster and the required degree of data diversity. For larger clusters, more data can be sampled; for smaller clusters, the sampling number can be appropriately reduced.

[0128] A fourth predetermined number of industrial images are randomly sampled from each class of the second industrial images and added to the final data set, which together with the predetermined industrial data set and the third industrial data set form a training industrial data set to ensure that the diversity of the data is not lost due to the clustering process. The implementation method of the present application is conducive to retaining representative samples from different categories, thereby improving the generalization ability of subsequent industrial detection models.

[0129] It can be understood that when the scale of the predetermined industrial data set is larger than the predetermined scale, since the plurality of second industrial images are not clustered, the industrial images of the second predetermined number of neighbors of the current predetermined industrial image are directly selected from the plurality of second industrial images as similar industrial images to determine the third industrial data set. At this time, the diversity of the data will not be lost due to the clustering process, and therefore, the training industrial data set can be directly composed of the predetermined industrial data set and the third industrial data set.

[0130] In summary, the dataset construction method of the implementation mode of the present application, on the one hand, the dataset construction process includes the collection of massive industrial data, deduplication processing, image retrieval based on high-quality existing datasets, and clustering and sample sampling, to ensure that the dataset is both diverse and highly relevant. On the second hand, a pre-trained model is used to generate image embedding vectors, and cosine similarity is used to retrieve image similarity, remove redundant data and retain representative images. On the third hand, through deduplication, image retrieval, k-means clustering and other technologies, a high-quality, scalable and diverse dataset is finally constructed to provide data support for industrial vision tasks. The training industrial dataset constructed by the dataset construction method of the implementation mode of the present application can ensure that it not only covers a wide range of industrial scenarios, but also has sufficient quality and diversity, and can provide high-quality data support for industrial vision tasks. The training industrial dataset will effectively improve the training effect of the industrial detection model and enhance its performance and generalization ability in practical applications.

[0131] See also Fig. 9, the data set construction device 100 of the embodiment of the present application includes a data acquisition module 10, a deduplication processing module 20, a screening processing module 30 and a data determination module 40. The data set construction method of the embodiment of the present application can be implemented by the data set construction device 100 of the embodiment of the present application. For example, the data acquisition module 10 can be used to acquire a first industrial data set and a predetermined industrial data set. The deduplication processing module 20 can be used to perform deduplication processing on the first industrial data set to obtain a second industrial data set. The screening processing module 30 can be used to perform screening processing on the second industrial data set based on the predetermined industrial data set to obtain a third industrial data set. The data determination module 40 can be used to determine the training industrial data set of the industrial detection model based on the predetermined industrial data set and the third industrial data set.

[0132] In some embodiments, the deduplication processing module 20 is specifically used to: input the first industrial data set into a pre-trained model to generate multiple first image embedding vectors corresponding to multiple first industrial images; calculate the cosine similarity between the multiple first image embedding vectors; select representative industrial images from the multiple first industrial images based on the cosine similarity between the multiple first image embedding vectors to obtain a second industrial data set.

[0133] In certain embodiments, the deduplication processing module 20 is specifically used to: for each first industrial image, calculate the first cosine similarity between the first image embedding vector corresponding to the current first industrial image and the first image embedding vector corresponding to the remaining first industrial images; sort the remaining first industrial images according to the first cosine similarity; select industrial images of the first predetermined number of neighbors of the current first industrial image from the remaining first industrial images; select industrial images whose first cosine similarity is greater than a predetermined cosine similarity from the industrial images of the first predetermined number of neighbors; select representative industrial images from the industrial images whose first cosine similarity is greater than a predetermined cosine similarity to determine a second industrial data set.

[0134] In certain embodiments, the screening and processing module 30 is specifically used to: input the predetermined industrial data set and the second industrial data set into a pre-trained model to generate a plurality of predetermined image embedding vectors corresponding to a plurality of predetermined industrial images and a plurality of second image embedding vectors corresponding to a plurality of second industrial images; calculate the cosine similarity between the plurality of predetermined image embedding vectors and the plurality of second image embedding vectors; select similar industrial images from the plurality of second industrial images according to the cosine similarity between the plurality of predetermined image embedding vectors and the plurality of second image embedding vectors to obtain a third industrial data set.

[0135] In certain embodiments, the screening processing module 30 is specifically used to: for each predetermined industrial image, calculate the second cosine similarity between the predetermined image embedding vector corresponding to the current predetermined industrial image and the multiple second image embedding vectors; when the scale of the predetermined industrial data set is greater than the predetermined scale, sort the multiple second industrial images according to the second cosine similarity; select the industrial images of the first second predetermined number of neighbors of the current predetermined industrial image from the multiple second industrial images as similar industrial images to determine a third industrial data set.

[0136] In certain embodiments, the screening and processing module 30 is specifically used to: for each predetermined industrial image, calculate the second cosine similarity between the predetermined image embedding vector corresponding to the current predetermined industrial image and the multiple second image embedding vectors; when the scale of the predetermined industrial data set is smaller than the predetermined scale, perform clustering processing on the multiple second industrial images to obtain multiple categories of second industrial images; select a category of second industrial images that is most similar to the current predetermined industrial image from the multiple categories of second industrial images according to the second cosine similarity; and sample a third predetermined number of industrial images corresponding to the current predetermined industrial image from the most similar category of second industrial images as similar industrial images to determine a third industrial data set.

[0137] In some embodiments, the data determination module 40 is specifically used to: randomly sample a fourth predetermined number of industrial images from each category of second industrial images of multiple categories of second industrial images; and merge the predetermined industrial data set, the third industrial data set, and the fourth predetermined number of industrial images as a training industrial data set.

[0138] The data set construction device 100 of the embodiment of the present application first performs deduplication processing on the first industrial data set to obtain the second industrial data set, and then screens the second industrial data set based on the predetermined industrial data set to obtain the third industrial data set, thereby determining the training industrial data set of the industrial detection model based on the predetermined industrial data set and the third industrial data set. In this way, the scale and diversity of the industrial data set can be increased so that it can cover a variety of industrial scenarios. In addition, the automated and standardized data set construction scheme proposed in the embodiment of the present application also has many advantages such as reducing human intervention, improving data set construction efficiency, ensuring data set quality, and reducing noise impact.

[0139] It should be noted that the explanation of the dataset construction method in the aforementioned embodiment is also applicable to the dataset construction device 100 in the embodiment of the present application, and will not be elaborated here.

[0140] See also Fig.10The data set construction system 200 of the embodiment of the present application includes one or more processors 210 and a memory 220, and the memory 220 stores a computer program. When the computer program is executed by the processor 210, the data set construction method of any of the above embodiments is implemented.

[0141] For example, when the computer program is executed by the processor 210, the following data set construction method is implemented:

[0142] 010: Obtain the first industrial data set and the predetermined industrial data set;

[0143] 020: De-duplicate the first industrial data set to obtain the second industrial data set;

[0144] 030: Screening and processing the second industrial data set based on the predetermined industrial data set to obtain a third industrial data set;

[0145] 040: Determine a training industrial data set for the industrial detection model according to the predetermined industrial data set and the third industrial data set.

[0146] For another example, when the computer program is executed by the processor 210, the following data set construction method is implemented:

[0147] 021: inputting the first industrial data set into the pre-trained model to generate a plurality of first image embedding vectors corresponding to the plurality of first industrial images;

[0148] 022: Calculate the cosine similarity between multiple first image embedding vectors;

[0149] 023: Select a representative industrial image from the multiple first industrial images according to the cosine similarity between the multiple first image embedding vectors to obtain a second industrial data set.

[0150] It should be noted that the explanation of the dataset construction method in the aforementioned embodiment is also applicable to the dataset construction system 200 of the embodiment of the present application, and will not be elaborated here.

[0151] See also Fig.11 The computer-readable storage medium 300 of the embodiment of the present application stores a computer program 310. When the program is executed by the processor 320, the data set construction method of any of the above embodiments is implemented.

[0152] For example, when the program is executed by the processor 320, the following data set construction method is implemented:

[0153] 010: Obtain the first industrial data set and the predetermined industrial data set;

[0154] 020: De-duplicate the first industrial data set to obtain the second industrial data set;

[0155] 030: Screening and processing the second industrial data set based on the predetermined industrial data set to obtain a third industrial data set;

[0156] 040: Determine a training industrial data set for the industrial detection model according to the predetermined industrial data set and the third industrial data set.

[0157] For another example, when the program is executed by the processor 320, the following data set construction method is implemented:

[0158] 021: inputting the first industrial data set into the pre-trained model to generate a plurality of first image embedding vectors corresponding to the plurality of first industrial images;

[0159] 022: Calculate the cosine similarity between multiple first image embedding vectors;

[0160] 023: Select a representative industrial image from the multiple first industrial images according to the cosine similarity between the multiple first image embedding vectors to obtain a second industrial data set.

[0161] It should be noted that the explanation of the data set construction method in the aforementioned embodiment is also applicable to the computer-readable storage medium 300 of the embodiment of the present application, and will not be elaborated here.

[0162] In summary, the data set construction method, data set construction device 100, data set construction system 200 and computer-readable storage medium 300 of the implementation mode of the present application first deduplicate the first industrial data set to obtain the second industrial data set, and then screen the second industrial data set based on the predetermined industrial data set to obtain the third industrial data set, thereby determining the training industrial data set of the industrial detection model according to the predetermined industrial data set and the third industrial data set. In this way, the scale and diversity of the industrial data set can be improved so that it can cover a variety of industrial scenarios. In addition, the automated and standardized data set construction scheme proposed in the implementation mode of the present application also has many advantages such as reducing human intervention, improving data set construction efficiency, ensuring data set quality, and reducing noise impact.

[0163] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0164] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.

[0165] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable storage medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, a computer-readable storage medium can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples (non-exhaustive list) of computer-readable storage media include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable storage medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.

[0166] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0167] A person of ordinary skill in the art will appreciate that all or part of the steps carried by the method for implementing the above-mentioned embodiment can be completed by instructing the relevant hardware through a program, and the program can be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment. In addition, each functional unit in each embodiment of the present application can be integrated into a processing module, or each unit can exist physically alone, or two or more units can be integrated into one module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. The above-mentioned storage medium can be a read-only memory, a disk or an optical disk, etc.

[0168] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present application. The scope of the present application is defined by the claims and their equivalents.

Claims

1. A method for constructing a data set, characterized in that: The data set construction method comprises: obtaining a first industrial data set and a predetermined industrial data set; Deduplication processing is performed on the first industrial data set to obtain a second industrial data set; Based on the predetermined industrial data set, the second industrial data set is screened to obtain a third industrial data set; A training industrial data set for an industrial detection model is determined according to the predetermined industrial data set and the third industrial data set.

2. The method for constructing a data set according to claim 1, characterized in that: The first industrial data set includes a plurality of first industrial images, and performing deduplication processing on the first industrial data set to obtain a second industrial data set includes: Inputting the first industrial data set into a pre-trained model to generate a plurality of first image embedding vectors corresponding to the plurality of first industrial images; Calculating cosine similarities between the plurality of first image embedding vectors; A representative industrial image from the multiple first industrial images is selected according to the cosine similarity between the multiple first image embedding vectors to obtain the second industrial data set.

3. The method for constructing a data set according to claim 2, characterized in that: The calculating the cosine similarity between the plurality of first image embedding vectors comprises: For each first industrial image, calculating a first cosine similarity between the first image embedding vector corresponding to the current first industrial image and the first image embedding vectors corresponding to the remaining first industrial images; The step of selecting a representative industrial image from the plurality of first industrial images according to the cosine similarity between the plurality of first image embedding vectors to obtain the second industrial data set includes: sorting the remaining first industrial images according to the first cosine similarity; Selecting a first predetermined number of industrial images that are neighbors of the current first industrial image from the remaining first industrial images; Selecting, from the industrial images of the first predetermined number of neighbors, industrial images whose first cosine similarity is greater than a predetermined cosine similarity; The representative industrial image is selected from the industrial images whose first cosine similarity is greater than a predetermined cosine similarity to determine the second industrial data set.

4. The method for constructing a data set according to claim 1, characterized in that: The predetermined industrial data set includes a plurality of predetermined industrial images, the second industrial data set includes a plurality of second industrial images, and the second industrial data set is screened based on the predetermined industrial data set to obtain a third industrial data set, including: Inputting the predetermined industrial data set and the second industrial data set into a pre-trained model to generate a plurality of predetermined image embedding vectors corresponding to the plurality of predetermined industrial images and a plurality of second image embedding vectors corresponding to the plurality of second industrial images; calculating cosine similarities between the plurality of predetermined image embedding vectors and the plurality of second image embedding vectors; Similar industrial images are selected from the plurality of second industrial images according to the cosine similarities between the plurality of predetermined image embedding vectors and the plurality of second image embedding vectors to obtain the third industrial data set.

5. The method for constructing a data set according to claim 4, characterized in that: The calculating cosine similarities between the plurality of predetermined image embedding vectors and the plurality of second image embedding vectors comprises: For each predetermined industrial image, calculating a second cosine similarity between the predetermined image embedding vector corresponding to the current predetermined industrial image and the plurality of second image embedding vectors; The selecting similar industrial images from the plurality of second industrial images according to the cosine similarities between the plurality of predetermined image embedding vectors and the plurality of second image embedding vectors to obtain the third industrial data set comprises: When the size of the predetermined industrial data set is greater than a predetermined size, sorting the plurality of second industrial images according to the second cosine similarity; Selecting industrial images that are a second predetermined number of neighbors of the current predetermined industrial image from the plurality of second industrial images as the similar industrial images to determine the third industrial data set.

6. The method for constructing a data set according to claim 4, characterized in that: The calculating cosine similarities between the plurality of predetermined image embedding vectors and the plurality of second image embedding vectors comprises: For each predetermined industrial image, calculating a second cosine similarity between the predetermined image embedding vector corresponding to the current predetermined industrial image and the plurality of second image embedding vectors; The selecting similar industrial images from the plurality of second industrial images according to the cosine similarities between the plurality of predetermined image embedding vectors and the plurality of second image embedding vectors to obtain the third industrial data set comprises: When the size of the predetermined industrial data set is smaller than the predetermined size, clustering the plurality of second industrial images to obtain a plurality of categories of second industrial images; Selecting a type of second industrial image that is most similar to the current predetermined industrial image from the multiple types of second industrial images according to the second cosine similarity; A third predetermined number of industrial images corresponding to the currently predetermined industrial image are sampled from the most similar second industrial images as the similar industrial images to determine the third industrial data set.

7. The method for constructing a data set according to claim 6, characterized in that: The step of determining a training industrial data set for an industrial detection model according to the predetermined industrial data set and the third industrial data set includes: Randomly sampling a fourth predetermined number of industrial images from each category of the plurality of categories of second industrial images; The predetermined industrial data set, the third industrial data set, and the fourth predetermined number of industrial images are combined as the training industrial data set.

8. A data set construction device, characterized in that: The data set construction device comprises: A data acquisition module, used for acquiring a first industrial data set and a predetermined industrial data set; a deduplication processing module, used for performing deduplication processing on the first industrial data set to obtain a second industrial data set; A screening processing module, configured to perform screening processing on the second industrial data set based on the predetermined industrial data set to obtain a third industrial data set; The data determination module is used to determine a training industrial data set for the industrial detection model according to the predetermined industrial data set and the third industrial data set.

9. A data set construction system, characterized in that: The data set construction system includes one or more processors and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the data set construction method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the data set construction method described in any one of claims 1 to 7 is implemented.