Multi-modal pre-training data set cleaning method and device based on anomaly detection
Based on the multi -mode pre -training data set cleaning method based on abnormal detection, using feature extraction and local abnormal detection technology to automatically eliminate the abnormal samples of multi -mode data sets, solve the cost of being easily attacked and artificial screening costs in the existing technology. High problems have achieved efficient and automatic data cleaning effects.
Patent Information
- Application Number
- CN202411612403.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-13
- Publication Date
- 2025-01-24
AI Technical Summary
Existing multimodal pre-trained deep learning models are vulnerable to backdoor or poisoning attacks, resulting in datasets that may contain affected image or text descriptions when downloaded and used, and large-scale datasets make manual data screening expensive.
Adopt a multi -mode pre -training data set cleaning method based on abnormal detection, and use the feature extractor to extract the data points by constructing a feature extractor. Use the local abnormal detection method to calculate the abnormal value of the data point, select the abnormal point and remove it, so as to obtain the cleaning data set Essence
Realize the abnormal samples of automatic and efficiently eliminating data, reduce the needs of manual supervision, and improve the security and quality of the data set.
Smart Images

Figure CN119357673A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of artificial intelligence security, and specifically relates to a multimodal pre-training data set cleaning method and device based on anomaly detection. Background Art
[0002] In recent years, due to the great progress made in deep learning, a large number of deep learning models have been widely used in various industries. Among them, deep vision models based on multimodal pre-training have been applied to various tasks such as image classification, image and text retrieval, and multimodal large language models.
[0003] However, deep neural networks (DNNs), including convolutional neural networks (CNNs) and the latest visual self-attention models (ViT models), are vulnerable to backdoor or poisoning attacks. A so-called backdoor attack means that when a backdoor is added to a sample, the affected model will output a specified prediction. Currently, poisoning attacks are an effective way to implant backdoors. Figure 1 As shown in the figure, existing multimodal pre-training is mostly published in the format of web-dataset, that is, images are stored as web links, and the corresponding text descriptions are stored as text files. This makes images vulnerable to backdoor or poisoning attacks. Attackers only need to purchase domain names that are about to expire or have expired, and then put images implanted with backdoors into the corresponding web links. Since images are published in the form of web links, when dataset users download data, some domain names may have expired, and the downloaded images may be affected by backdoor or poisoning attacks, or the downloaded images no longer save images related to the original text descriptions.
[0004] Therefore, data set users need to perform data screening, but large-scale data sets make manual data screening very expensive. Now, there is an urgent need for a method or device that can effectively and efficiently screen abnormal samples in data without manual supervision. Summary of the invention
[0005] The present invention is made to solve the above-mentioned problems, and its purpose is to provide a method and device for cleaning a multimodal pre-training data set based on anomaly detection.
[0006] The present invention provides a multimodal pre-trained data set cleaning method based on anomaly detection, which is used for performing data cleaning on a multimodal large data set to obtain a cleaned data set, wherein the multimodal large data set includes multiple data points, and the data points include multiple data of different modes and corresponding to each other, and have such characteristics, comprising the following steps: step S1, constructing a feature extractor, and training the feature extractor according to the multimodal large data set to obtain a trained feature extractor; step S2, for each data point, extracting features corresponding to the data of each different mode by the trained feature extractor; step S3, according to all features of each data point, by a local anomaly detection method, calculating the outlier value corresponding to the data of different modes of each data point; step S4, according to all outlier values of each data point, selecting multiple data points as outliers, and using the multimodal large data set with the outliers removed as a cleaned data set.
[0007] In the multimodal pre-training data set cleaning method based on anomaly detection provided by the present invention, it can also have the following characteristics: wherein the local anomaly detection method includes the k-dist method, the SLOF method and the DAO method. In the k-dist method, the calculation expression of the anomaly value corresponding to the data of any mode of the data point x is: k-dist(x)=sorted({d(x,x i )|x i ∈X})[k], where k-dist(x) is the outlier value of data point x, X is the collection of samples near data point x, d(.) is the Euclidean distance, and in the SLOF method, the calculation expression of the outlier value corresponding to the data of any mode of data point q is: Where SLOF(q) is the outlier value of data point q, NN k (q) is the collection of k nearest data points near point q, and o is the collection NN k (q), k is a hyperparameter, k-dist(q) is the distance from data point q to the kth nearest point, dist(o) is the distance from data point o to the kth nearest point. In the DAO method, the calculation expression of the outlier value corresponding to the data of any mode of data point q is: Where DAO(q) is the outlier value of data point q, is the estimated size of the neighboring intrinsic dimension.
[0008] In the multimodal pre-training data set cleaning method based on anomaly detection provided by the present invention, it can also have the following characteristics: wherein, in step S4, for each local anomaly detection method, all anomaly values of each modality are sorted according to the numerical value, and the data points corresponding to the anomaly values with the largest N% of the numerical values of each modality of each local anomaly detection method are selected as anomaly points.
[0009] The present invention also provides a multimodal pre-trained data set cleaning device based on anomaly detection, which is used to perform data cleaning on a multimodal large data set to obtain a cleaned data set, wherein the multimodal large data set includes multiple data points, and the data points include multiple data of different modes and corresponding to each other, and have the following characteristics, including: a feature extraction module, including a trained feature extractor, which is used to extract the features corresponding to the data of each different mode for each data point through the trained feature extractor; an outlier calculation module, which is used to calculate the outlier values corresponding to the data of different modes of each data point according to all the features of each data point through a local anomaly detection method; a cleaning module, which is used to select multiple data points as outliers according to all the outliers of each data point, and use the multimodal large data set with the outliers removed as the cleaned data set, wherein the feature extractor is trained according to the multimodal large data set.
[0010] Functions and Effects of the Invention
[0011] According to the method and device for cleaning a multimodal pre-trained data set based on anomaly detection involved in the present invention, the features of the data of different modes in each data point are extracted by a feature extractor, and the features retain the abnormal features of the corresponding data, and then the abnormal features are processed by various abnormal value calculation methods to obtain the abnormal values of each data point in different modes, and then the abnormal points are selected and removed according to the abnormal values, so as to remove the abnormal points and obtain the cleaned data set. Therefore, the method and device for cleaning a multimodal pre-trained data set based on anomaly detection of the present invention can automatically and efficiently remove abnormal samples in the data. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 It is a schematic diagram of the principle of poisoning attack in the present invention;
[0013] Figure 2 is a block diagram of a multimodal pre-training data set cleaning device based on anomaly detection in an embodiment of the present invention;
[0014] Figure 3 It is a flow chart of a multimodal pre-training data set cleaning method based on anomaly detection in an embodiment of the present invention. DETAILED DESCRIPTION
[0015] In order to make the technical means, creative features, objectives and effects achieved by the present invention easy to understand, the following embodiments and the accompanying drawings specifically illustrate the multimodal pre-training data set cleaning method and device based on anomaly detection of the present invention.
[0016] In this embodiment, a multimodal pre-trained data set cleaning device based on anomaly detection is provided, which is used to clean a multimodal large data set to obtain a cleaned data set, wherein the multimodal large data set includes multiple data points, and the data points include multiple different modal and mutually corresponding data. In this embodiment, the modality includes language and images. For example, an image mainly featuring a cat and the language and text "This is a cat" correspond to each other and constitute a data point. In other embodiments, data of more than two different modalities may constitute a data point.
[0017] Figure 2 is a block diagram of a multimodal pre-training data set cleaning device based on anomaly detection in an embodiment of the present invention.
[0018] like Figure 2 As shown, the multimodal pre-training data set cleaning device 100 based on anomaly detection includes a feature extraction module 10, an anomaly value calculation module 20 and a cleaning module 30.
[0019] The feature extraction module 10 includes a trained feature extractor, which is used to extract features corresponding to data of different modalities for each data point through the trained feature extractor.
[0020] Among them, the feature extractor is trained based on a multimodal large data set. In this embodiment, corresponding to the language and image that need to extract features, the feature extractor includes ResNet for extracting image features corresponding to the image, and the Tokenizer and Transformer connected in sequence are used to tokenize and extract features of the input language to obtain corresponding text features. In the feature extractor training, a fixed total number of optimization steps and a cosine curve learning rate adjustment are used, and the maximum learning rate is gradually reduced from the beginning. In the last step, the learning rate is adjusted to 0, and then the training is terminated to obtain a trained feature extractor.
[0021] The outlier calculation module 20 is used to calculate the outlier values corresponding to the data of different modes of each data point according to all the features of each data point through a local outlier detection method, that is, for any mode of data in a data point, there is an outlier value corresponding to the data of the mode. Among them, the local outlier detection method includes the k-dist method, the SLOF method and the DAO method.
[0022] In the k-dist method, the calculation expression for the outlier value corresponding to the data of any mode of data point x is:
[0023] k-dist(x)=sorted({d(x,x i )|x i ∈X})[k],
[0024] Where k-dist(x) is the outlier corresponding to the data point x, X is the collection of samples near the data point x, and d(.) is the Euclidean distance, that is, d(x,x i )=|xx i |2.
[0025] In the SLOF method, the calculation expression of the outlier value corresponding to the data of any mode of data point q is:
[0026]
[0027] Where SLOF(q) is the outlier value of data point q, NN k (q) is the collection of k nearest data points near point q, and o is the collection NN k (q), k is a hyperparameter, k-dist(q) is the distance from data point q to the kth nearest point, dist(o) is the distance from data point o to the kth nearest point, and the distance is calculated as Euclidean distance.
[0028] In the DAO method, the calculation expression of the outlier value corresponding to the data of any mode of data point q is:
[0029]
[0030] Where DAO(q) is the outlier value of data point q, is the estimated size of the adjacent intrinsic dimension. In this embodiment, the maximum natural estimate is used to estimate It can be expressed as Here, the distance is the Euclidean distance.
[0031] The cleaning module 30 is used to select multiple data points as outliers according to all outliers of each data point, and use the multimodal large data set from which the outliers are removed as the cleaning data set.
[0032] Among them, the cleaning module 30 sorts all the abnormal values of each mode according to the numerical value for each local abnormality detection method, and selects the data points corresponding to the N% abnormal values of each mode of each local abnormality detection method with the largest numerical value as abnormal points. For example, for language and text data, N% of abnormal points are selected from all data points, and for image data, N% of abnormal points are selected from all data points, and then all the above abnormal points are removed from the set of data points, and the set composed of the remaining data points is the cleaning data set. In other embodiments, in order to obtain a safer cleaning data set, N% of the data points can be removed from the set of data points according to the abnormal values corresponding to the language and text to obtain a first data set, and then N% of the data points can be removed from the first data set according to the abnormal values corresponding to the image to obtain a cleaning data set, wherein the order of the modes to be selected for removing abnormal points can be adjusted according to actual needs.
[0033] The following describes the process of using the multimodal pre-training dataset cleaning device 100 based on anomaly detection to perform a multimodal pre-training dataset cleaning method based on anomaly detection in conjunction with the accompanying drawings.
[0034] Figure 3 It is a flow chart of a multimodal pre-training data set cleaning method based on anomaly detection in an embodiment of the present invention.
[0035] like Figure 3 As shown in FIG. 1 , the multimodal pre-training dataset cleaning method based on anomaly detection includes the following steps:
[0036] Step S1, constructing a feature extractor, and training the feature extractor according to a multimodal large data set to obtain a trained feature extractor.
[0037] Step S2, the feature extraction module 10 extracts features corresponding to data of different modalities for each data point through a trained feature extractor.
[0038] Step S3, the outlier value calculation module 20 calculates the outlier value corresponding to the data of different modes of each data point according to all the features of each data point through a local outlier detection method.
[0039] In step S4, the cleaning module 30 selects multiple data points as outliers according to all outliers of each data point, and uses the multimodal large data set from which the outliers are removed as the cleaning data set.
[0040] Functions and Effects of the Embodiments
[0041] According to the method and device for cleaning a multimodal pre-trained data set based on anomaly detection involved in this embodiment, the feature extractor extracts the features of the data of different modes in each data point, and the features retain the abnormal features of the corresponding data, and then the abnormal features are processed by various abnormal value calculation methods to obtain the abnormal values of each data point in different modes, and then the abnormal points are selected and removed according to the abnormal values, so as to remove the abnormal points and obtain the cleaned data set. In short, this method can automatically and efficiently remove abnormal samples in the data.
[0042] Those skilled in the art should understand that the present invention is not limited to the above embodiments, and the above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, and these changes and improvements fall within the scope of the present invention to be protected. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. A multimodal pre-training data set cleaning method based on anomaly detection, used for cleaning a multimodal large data set to obtain a cleaned data set, the multimodal large data set includes a plurality of data points, the data points include a plurality of different modalities and corresponding data, characterized in that: The following steps are involved: Step S1, constructing a feature extractor, and training the feature extractor according to the multimodal large data set to obtain a trained feature extractor; Step S2, for each of the data points, extracting features corresponding to the data of each different modality through the trained feature extractor; Step S3, calculating the abnormal value corresponding to the data of different modes of each data point by a local abnormality detection method according to all the features of each data point; Step S4: selecting a plurality of the data points as outliers based on all the outlier values of the data points, and using the multimodal large data set from which the outliers are removed as the cleaned data set.
2. The method for cleaning a multimodal pre-training dataset based on anomaly detection according to claim 1, characterized in that: in, The local anomaly detection methods include k-dist method, SLOF method and DAO method. In the k-dist method, the calculation expression of the outlier corresponding to the data of any mode of the data point x is: k-dist(x)=sorted({d(x,x i )|x i ∈X})[k], Where k-dist(x) is the outlier of data point x, X is the collection of samples near data point x, d(.) is the Euclidean distance, In the SLOF method, the calculation expression of the outlier value corresponding to the data of any mode of the data point q is: Where SLOF(q) is the outlier value of data point q, NN k (q) is the collection of k nearest data points near point q, and o is the collection NN k (q), k is a hyperparameter, k-dist(q) is the distance from data point q to the kth nearest point, dist(o) is the distance from data point o to the kth nearest point, In the DAO method, the calculation expression of the abnormal value corresponding to the data of any mode of the data point q is: Where DAO(q) is the outlier value of data point q, is the estimated size of the neighboring intrinsic dimension.
3. The method for cleaning a multimodal pre-training dataset based on anomaly detection according to claim 2, characterized in that: in, In step S4, for each of the local anomaly detection methods, all of the abnormal values of each of the modes are sorted according to numerical values, and the data points corresponding to the abnormal values with the largest N% of the numerical values of each of the modes of each of the local anomaly detection methods are selected as the abnormal points.
4. A multimodal pre-training data set cleaning device based on anomaly detection, used for cleaning a multimodal large data set to obtain a cleaned data set, the multimodal large data set includes a plurality of data points, the data points include a plurality of different modalities and corresponding data, characterized in that: include: A feature extraction module, including a trained feature extractor, for extracting features corresponding to data of different modalities for each of the data points through the trained feature extractor; An outlier value calculation module, used to calculate the outlier value corresponding to the data of different modes of each of the data points according to all the features of each of the data points by a local outlier detection method; a cleaning module, configured to select a plurality of the data points as outliers according to all the outliers of each of the data points, and use the multimodal large data set from which the outliers are removed as the cleaning data set, Wherein, the feature extractor is trained according to the multimodal large data set.
Citation Information
Cited By
EAST Tokamak real-time data cleaning method
CN120527045A
Railway infrastructure detection large model method and device
CN121389037A