CN111382771B - Data classification method, device, equipment and storage medium - Google Patents

Data classification method, device, equipment and storage medium Download PDF

Info

Publication number
CN111382771B
CN111382771B CN201811644532.3A CN201811644532A CN111382771B CN 111382771 B CN111382771 B CN 111382771B CN 201811644532 A CN201811644532 A CN 201811644532A CN 111382771 B CN111382771 B CN 111382771B
Authority
CN
China
Prior art keywords
data
loss function
model
countermeasure
original data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811644532.3A
Other languages
Chinese (zh)
Other versions
CN111382771A (en
Inventor
申世伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN201811644532.3A priority Critical patent/CN111382771B/en
Publication of CN111382771A publication Critical patent/CN111382771A/en
Application granted granted Critical
Publication of CN111382771B publication Critical patent/CN111382771B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/25Fusion techniques
    • G06F18/254Fusion techniques of classification results, e.g. of results related to same input data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2413Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on distances to training or reference patterns

Abstract

The disclosure relates to a data classification method, a device, equipment and a storage medium, and belongs to the technical field of computers. The method comprises the following steps: acquiring first target data to be classified; based on an interference elimination model, carrying out interference elimination processing on the first target data to obtain second target data, wherein the interference elimination model is used for eliminating interference in the first target data; and classifying the second target data based on the classification model. When the target data is acquired, interference possibly existing in the target data can be eliminated based on the interference elimination model, the interference in the target data can be effectively eliminated, the data obtained after the interference elimination process can be correctly classified based on the classification model, the problem of wrong classification is avoided, the classification accuracy is improved, and the effect of correctly classifying the target data is achieved.

Description

Data classification method, device, equipment and storage medium
Technical Field
The disclosure relates to the field of computer technology, and in particular, to a data classification method, a device, equipment and a storage medium.
Background
With the rapid development of computer technology, data has shown an explosive growth trend, and data classification is required in many cases. Therefore, the classification model based on the machine learning algorithm is widely applied by virtue of good learning performance and classification accuracy.
In the related art, a large amount of sample data is generally collected, training is performed based on the collected sample data, a trained classification model is obtained, and any data can be classified based on the classification model. Taking the original data as an example, classifying the original data based on the classification model can determine the category to which the original data belongs. However, in practical applications, since the original data is interfered due to the influence of various factors to form the countermeasure data, when classifying the original data based on the classification model, the countermeasure data is actually classified based on the classification model, which may cause erroneous classification of the classification model and affect the classification accuracy.
Disclosure of Invention
The disclosure provides a data classification method, a device, equipment and a storage medium, which can solve the problem that classification accuracy is affected due to classification errors when classification is performed on countermeasure data based on a classification model in the related technology.
According to a first aspect of embodiments of the present disclosure, there is provided a data classification method, the method comprising:
acquiring first target data to be classified;
performing interference elimination processing on the first target data based on an interference elimination model to obtain second target data, wherein the interference elimination model is used for eliminating interference in the first target data;
And classifying the second target data based on a classification model.
In one possible implementation, the method further includes:
acquiring first original data and corresponding first countermeasure data;
performing interference elimination processing on the first countermeasure data based on the interference elimination model to obtain first data;
based on a discrimination model, discriminating the first original data and the first data to obtain a discrimination result, wherein the discrimination model is used for determining the difference between the first original data and the first data;
and training the interference elimination model and the discrimination model according to the discrimination result so as to minimize the difference between the data processed by the interference elimination model and the corresponding original data.
In another possible implementation manner, the discrimination result includes second data corresponding to the first original data and third data corresponding to the first data;
training the interference cancellation model and the discrimination model according to the discrimination result so that the difference between the data processed by the interference cancellation model and the corresponding original data tends to be minimum, including:
The interference cancellation model is trained based on the third data and the first loss function, and the discriminant model is trained based on the second data, the third data, and the second loss function such that the output value of the first loss function and the output value of the second loss function tend to be minimal.
In another possible implementation, the first loss function includes a counterloss function that is:
the second loss function is:
wherein l adv For the first loss function, l d N is the number of the first original data, x, as the second loss function i For the i-th first original data,for the ith first challenge data, +.>For the ith first data, D θD (x i ) For the ith second data, +.>Is the ith third data.
In another possible implementation manner, the first loss function further includes at least one of a pixel value mean square error loss function and a spatial consistency loss function;
the pixel value mean square error loss function is as follows:
the spatial consistency loss function is:
wherein l mse For the pixel mean square error loss function, l sc For the spatial consistency loss function, W is the width of the pixels in the first original data, H is the height of the pixels in the first original data, and x w,h G is a pixel point with width w and height h in the first original data θG (x adv ) w,h And the pixel points are located in the first data corresponding to the first countermeasure data, wherein the width of the pixel points is w, and the height of the pixel points is h.
In another possible implementation manner, the acquiring the first original data and the corresponding first countermeasure data includes:
acquiring the first original data;
and processing the first original data based on the countermeasure data generation model to obtain first countermeasure data corresponding to the first original data.
In another possible implementation, the method further includes:
acquiring second original data;
processing the second original data based on the countermeasure data generation model to obtain second countermeasure data corresponding to the second original data;
training the challenge data generation model based on the second challenge data and a third loss function such that an output value of the third loss function tends to be minimal.
In another possible implementation, the third loss function includes a distance loss function and a classification loss function, and the training the challenge data generation model according to the second challenge data and the third loss function to minimize an output value of the third loss function includes:
Classifying the second countermeasure data based on the classification model to obtain fourth data;
training the challenge data generation model based on the second raw data, the second challenge data, the fourth data, and the third loss function to minimize an output value of the third loss function.
According to a second aspect of embodiments of the present disclosure, there is provided a data sorting apparatus, the apparatus comprising:
a target acquisition unit configured to acquire first target data to be classified;
a first cancellation unit configured to perform interference cancellation processing on the first target data based on an interference cancellation model to obtain second target data, where the interference cancellation model is used to cancel interference in the first target data;
and the classification unit is configured to perform classification processing on the second target data based on a classification model.
In one possible implementation, the apparatus further includes:
the first acquisition unit is configured to acquire first original data and corresponding first countermeasure data;
a second cancellation unit configured to perform interference cancellation processing on the first challenge data based on the interference cancellation model, to obtain first data;
A discriminating unit configured to perform discrimination processing on the first original data and the first data based on a discrimination model for determining a difference between the first original data and the first data, to obtain a discrimination result;
and the training unit is configured to train the interference elimination model and the discrimination model according to the discrimination result so as to minimize the difference between the data processed by the interference elimination model and the corresponding original data.
In another possible implementation manner, the discrimination result includes second data corresponding to the first original data and third data corresponding to the first data;
the training unit comprises:
a first training subunit configured to train the interference cancellation model according to the third data and the first loss function, and train the discriminant model according to the second data, the third data, and the second loss function, so that an output value of the first loss function and an output value of the second loss function tend to be minimum.
In another possible implementation, the first loss function includes a counterloss function that is:
The second loss function is:
wherein l adv For the first loss function, l d N is the number of the first original data, x, as the second loss function i For the i-th first original data,for the ith first challenge data, +.>For the ith first data, D θD (x i ) For the ith second data, +.>Is the ith third data.
In another possible implementation manner, the first loss function further includes at least one of a pixel value mean square error loss function and a spatial consistency loss function;
the pixel value mean square error loss function is as follows:
the spatial consistency loss function is:
wherein l mse For the pixel mean square error loss function, l sc For the spatial consistency loss function, W is the width of the pixels in the first original data, H is the height of the pixels in the first original data, and x w,h G is a pixel point with width w and height h in the first original data θG (x adv ) w,h And the pixel points are located in the first data corresponding to the first countermeasure data, wherein the width of the pixel points is w, and the height of the pixel points is h.
In another possible implementation manner, the first obtaining unit includes:
a first acquisition subunit configured to acquire the first raw data;
And the first processing subunit is configured to process the first original data based on the countermeasure data generation model to obtain first countermeasure data corresponding to the first original data.
In another possible implementation manner, the first obtaining unit further includes:
a second acquisition subunit configured to acquire second original data;
the second processing subunit is configured to process the second original data based on the countermeasure data generation model to obtain second countermeasure data corresponding to the second original data;
a second training subunit configured to train the challenge data generation model in accordance with the second challenge data and a third loss function such that an output value of the third loss function tends to be minimum.
In another possible implementation, the third loss function includes a distance loss function and a classification loss function, and the second training subunit is further configured to perform classification processing on the second challenge data based on the classification model to obtain fourth data; training the challenge data generation model based on the second raw data, the second challenge data, the fourth data, and the third loss function to minimize an output value of the third loss function.
According to a third aspect of embodiments of the present disclosure, there is provided a processing apparatus for data classification, the processing apparatus comprising:
a processor;
a memory for storing processor-executable commands;
wherein the processor is configured to:
acquiring first target data to be classified;
performing interference elimination processing on the first target data based on an interference elimination model to obtain second target data, wherein the interference elimination model is used for eliminating interference in the first target data;
and classifying the second target data based on a classification model.
According to a fourth aspect of embodiments of the present disclosure, there is provided a non-transitory computer readable storage medium, which when executed by a processor of a processing device, causes the processing device to perform a data classification method, the method comprising:
acquiring first target data to be classified;
performing interference elimination processing on the first target data based on an interference elimination model to obtain second target data, wherein the interference elimination model is used for eliminating interference in the first target data;
and classifying the second target data based on a classification model.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer program product, which when executed by a processor of a processing device, causes the processing device to perform a data classification method, the method comprising:
acquiring first target data to be classified;
performing interference elimination processing on the first target data based on an interference elimination model to obtain second target data, wherein the interference elimination model is used for eliminating interference in the first target data;
and classifying the second target data based on a classification model.
According to the data classification method, the device, the equipment and the storage medium, through obtaining first target data to be classified, performing interference elimination processing on the first target data based on an interference elimination model to obtain second target data, and performing classification processing on the second target data based on a classification model, wherein the interference elimination model is used for eliminating interference in the first target data. When the target data is acquired, the method and the device can eliminate interference possibly existing in the target data based on the interference elimination model no matter whether the target data is the original data or the countermeasure data, and eliminate the interference existing in the first target data before classification, so that the data obtained after the target data is processed by the interference elimination model based on the classification model is correctly classified, the problem of classification errors is avoided, and the classification accuracy is improved.
In addition, according to the embodiment of the disclosure, the accuracy of the trained interference elimination model can be improved and the interference elimination effect of the interference elimination model can be improved by setting the interference elimination model, matching with the judging model and setting the corresponding loss function.
Moreover, the countermeasure data for training the interference cancellation model can be generated by learning the relation between the original data and the corresponding countermeasure data through the countermeasure data generation model, and the interference cancellation model with high interference cancellation capability can be obtained by learning the relation among the original data, the countermeasure data and the data of the countermeasure data subjected to the interference cancellation processing, so that the interference in the target data can be effectively eliminated, and the effect of correctly classifying the target data can be achieved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure.
Fig. 1 is a flow chart illustrating a data classification method according to an exemplary embodiment.
Fig. 2 is a flow chart illustrating a method of classifying data according to an exemplary embodiment.
Fig. 3 is a schematic diagram of an interference cancellation model and a discriminant model, according to an illustrative embodiment.
Fig. 4 is a schematic diagram of another interference cancellation model and discrimination model shown in accordance with an exemplary embodiment.
Fig. 5 is a schematic diagram illustrating a test result based on an interference cancellation model and a discriminant model, according to an illustrative embodiment.
Fig. 6 is a flow chart illustrating a method of training an interference cancellation model according to an example embodiment.
Fig. 7 is a block diagram illustrating a data sorting apparatus according to an exemplary embodiment.
Fig. 8 is a block diagram illustrating a terminal for data classification according to an exemplary embodiment.
Fig. 9 is a schematic diagram illustrating a structure of a server according to an exemplary embodiment.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
Fig. 1 is a flow chart illustrating a data classification method according to an exemplary embodiment, as shown in fig. 1, for use in a processing device, comprising the steps of:
in step 101, the processing device acquires first target data to be classified.
In step 102, the processing device performs interference cancellation processing on the first target data based on an interference cancellation model, so as to obtain second target data, where the interference cancellation model is used to cancel interference in the first target data.
In step 103, the processing device performs classification processing on the second target data based on the classification model.
According to the method provided by the embodiment of the disclosure, through obtaining the first target data to be classified, performing interference elimination processing on the first target data based on the interference elimination model to obtain the second target data, and performing classification processing on the second target data based on the classification model, wherein the interference elimination model is used for eliminating interference in the first target data. When the target data is acquired, the method and the device can eliminate interference possibly existing in the target data based on the interference elimination model no matter whether the target data is original data or countermeasure data, so that the data obtained after the target data is processed by the interference elimination model can be correctly classified based on the classification model, and the classification accuracy is improved.
In one possible implementation, the method further includes:
acquiring first original data and corresponding first countermeasure data;
performing interference elimination processing on the first countermeasure data based on an interference elimination model to obtain first data;
based on a discrimination model, discriminating the first original data and the first data to obtain a discrimination result, wherein the discrimination model is used for determining the difference between the first original data and the first data;
according to the discrimination result, the interference cancellation model and the discrimination model are trained so that the difference between the data processed by the interference cancellation model and the corresponding original data tends to be minimum.
In another possible implementation manner, the discrimination result includes second data corresponding to the first original data and third data corresponding to the first data;
training the interference cancellation model and the discrimination model according to the discrimination result so that the difference between the data processed by the interference cancellation model and the corresponding original data tends to be minimum, including:
the interference cancellation model is trained based on the third data and the first loss function, and the discrimination model is trained based on the second data, the third data, and the second loss function such that the output value of the first loss function and the output value of the second loss function tend to be minimized.
In another possible implementation, the first loss function includes a counterloss function, the counterloss function being:
the second loss function is:
wherein l adv As a first loss function, l d N is the number of the first original data, x, as the second loss function i For the i-th first original data,for the ith first challenge data, +.>For the ith first data, D θD (x i ) For the ith second data, +.>Is the ith third data.
In another possible implementation, the first loss function further includes at least one of a pixel value mean square error loss function and a spatial consistency loss function;
the pixel value mean square error loss function is:
the spatial consistency loss function is:
wherein l mse Is the pixel mean square error loss function, l sc As a spatial consistency loss function, W is the width of the pixels in the first original data, H is the height of the pixels in the first original data, x w,h G is a pixel point with width w and height h in the first original data θG (x adv ) w,h The pixel points with the width w and the height h are located in the first data corresponding to the first countermeasure data.
In another possible implementation manner, acquiring the first original data and the corresponding first countermeasure data includes:
Acquiring first original data;
and processing the first original data based on the countermeasure data generation model to obtain first countermeasure data corresponding to the first original data.
In another possible implementation, the method further includes:
acquiring second original data;
processing the second original data based on the countermeasure data generation model to obtain second countermeasure data corresponding to the second original data;
the challenge data generation model is trained based on the second challenge data and the third loss function such that an output value of the third loss function tends to be minimal.
In another possible implementation, the third loss function includes a distance loss function and a classification loss function, and training the challenge data generation model based on the second challenge data and the third loss function to minimize an output value of the third loss function includes:
classifying the second countermeasure data based on the classification model to obtain fourth data;
the challenge data generation model is trained based on the second raw data, the second challenge data, the fourth data, and the third loss function such that an output value of the third loss function tends to be minimal.
After the original data is interfered by various factors to form the countermeasure data, the classification model is easy to classify errors with high confidence, a method for expanding a training sample set to train the classification model is developed at present, a training sample set is formed by the original data and the countermeasure data together by acquiring a large amount of the original data and the countermeasure data, the classification model capable of correctly classifying the original data and the countermeasure data is obtained based on the training sample set, and the target data to be classified can be classified subsequently based on the classification model.
The embodiment of the disclosure provides another data classification method, in which an interference elimination model is obtained through training, and the target data to be classified is processed based on the interference elimination model, so that the interference in the target data can be eliminated, and the data after the interference elimination can be correctly classified by the classification model.
Fig. 2 is a flowchart illustrating a data classification method according to an exemplary embodiment, and fig. 3 is a schematic diagram illustrating an interference cancellation model and a discrimination model according to an exemplary embodiment, where the data classification method is used in a processing device, as shown in fig. 2 and 3, where the processing device may be a mobile phone, a computer, a tablet computer, a smart tv, or may also be a server, and the method includes the following steps:
In step 201, the processing device obtains first raw data and corresponding first countermeasure data.
When the target data to be classified is obtained, the target data can be classified based on the classification model, and the category to which the target data belongs is obtained. However, since the target data may be original data or countermeasure data, when the target data is countermeasure data, the inclusion of interference in the countermeasure data may mislead the classification of the classification model, resulting in that the classification model outputs an erroneous classification result with high confidence when classifying the target data.
In order to avoid the above-mentioned problems, in the embodiments of the present disclosure, at least one piece of original data and corresponding countermeasure data are acquired first, and as sample data, at least one training is performed based on the at least one piece of original data and the corresponding countermeasure data, so as to obtain an interference cancellation model, where the interference cancellation model is used to perform interference cancellation processing on the data, and eliminate interference that may exist in the data.
The original data can be data in various formats such as images, audios or videos, the countermeasure data is data after interference is added to the original data, and classification of the classification model can be misled by the countermeasure data, so that the classification model divides the original data and the countermeasure data into different categories, and therefore when training is carried out based on the original data and the countermeasure data, the relation between the original data and the countermeasure data can be learned, and the trained interference elimination model can enable the classification model to be correctly classified after interference in the countermeasure data is eliminated.
The processing device may be a terminal or a server, and if the processing device is a terminal, the original data may be obtained by shooting the terminal, or may be obtained by recording the terminal, or may be downloaded from the internet by the terminal, or may be sent to the terminal by other devices. If the processing device is a server, the raw data may be uploaded to the server by the terminal or uploaded to the server by other devices.
In the embodiment of the disclosure, only the first primary data and the first countermeasure data corresponding to the first primary data are taken as examples, and the training process of the interference cancellation model is described.
In one possible implementation manner, the processing device acquires the first original data and the trained countermeasure data generation model, and processes the first original data based on the countermeasure data generation model to obtain first countermeasure data corresponding to the first original data.
The countermeasure data generation model is used for generating first countermeasure data corresponding to first original data, and the first countermeasure data is data after interference is added to the first original data.
In step 202, the processing device performs interference cancellation processing on the first challenge data based on the interference cancellation model, to obtain first data.
In one possible implementation manner, a current interference cancellation model is obtained, where the interference cancellation model may be an initialized interference cancellation model, or may be an interference cancellation model obtained after one or more training, and the first countermeasure data is processed based on the current interference cancellation model to obtain first data corresponding to the first countermeasure data, where the first data is data obtained after the first countermeasure data is subjected to interference cancellation by the interference cancellation model.
In step 203, the processing apparatus performs a discrimination process on the first raw data and the first data based on the discrimination model, to obtain a discrimination result.
The training goal of the interference elimination model is to keep the data obtained by processing the countermeasure data by the interference elimination model as consistent as possible with the original data. Thus, the processing device acquires a discrimination model for determining the difference between the first raw data and the first data. And carrying out discrimination processing on the first original data and the first data based on the discrimination model to obtain discrimination results, wherein the discrimination results can represent the difference between the first original data and the first data, so that the interference cancellation effect of the interference cancellation model can be represented, and the interference cancellation model can be trained based on the discrimination results, so that the interference cancellation effect of the interference cancellation model is improved.
The smaller the difference between the first original data and the first data, the closer the first data and the first original data are, that is, the better the interference cancellation effect of the interference cancellation model is.
In one possible implementation, the discrimination result obtained based on the discrimination model includes second data corresponding to the first original data and third data corresponding to the first data. The second data is used for describing the characteristics of the first original data, the third data is used for describing the characteristics of the first data, and the second data and the third data are analyzed and processed according to the second data and the third data, so that the difference between the first original data and the first data can be obtained.
For example, the second data may represent the category to which the first original data determined after the discrimination processing based on the discrimination model belongs, and the third data may represent the category to which the first data determined after the discrimination processing based on the discrimination model belongs. The closer the category to which the first original data belongs is to the category to which the first data belongs, the smaller the difference between the second data and the third data is indicated. The first original data and the first data belong to the same category, which means that the difference between the second data and the third data is small enough.
In another possible implementation manner, as shown in fig. 4, the first original data, the first countermeasure data, and the first data are subjected to a discrimination process based on a discrimination model, so as to obtain a discrimination result. The discrimination model is used for determining differences between the first data and the first original data and differences between the first data and the first countermeasure data. The discrimination result can represent the magnitude of the difference between the first data and the first original data, and can also represent the magnitude of the difference between the first data and the first countermeasure data.
The smaller the difference between the first data and the first original data, the closer the first data and the first original data are, the better the interference cancellation effect of the interference cancellation model is. The smaller the difference between the first data and the first countermeasure data, the closer the first data and the first countermeasure data are, the worse the interference cancellation effect of the interference cancellation model is.
In step 204, the processing device trains the interference cancellation model and the discrimination model according to the discrimination result so that the difference between the data processed by the interference cancellation model and the corresponding original data tends to be minimum.
In order to improve the interference elimination effect of the interference elimination model, the processing equipment trains the interference elimination model and the judgment model according to the judgment result to obtain the trained interference elimination model and the judgment model. And the interference elimination model is provided with a first loss function, the judging model is provided with a second loss function, the difference between the first data and the first original data is positively correlated with the output value of the first loss function, and the difference between the second data and the third data is positively correlated with the output value of the second loss function, so that when the interference elimination model and the judging model are trained, the training target is that the output value of the first loss function tends to be minimum, and the output value of the second loss function tends to be minimum, so that the difference between the data subjected to interference elimination processing of the interference elimination model and the corresponding original data tends to be minimum.
In one possible implementation manner, after obtaining the discrimination result, the processing device obtains a first loss function and a second loss function, calculates according to third data included in the discrimination result and the first loss function to obtain an output value of the first loss function, trains the interference cancellation model according to the output value of the first loss function, calculates according to second data, third data and the second loss function included in the discrimination result to obtain an output value of the second loss function, and trains the discrimination model according to the output value of the second loss function.
Wherein the first loss function comprises a counterloss function, the counterloss function being:
the output value of the first loss function is determined according to the distance between the first challenge data and the first original data.
The second loss function is:
the output value of the second loss function is determined according to the distance between the second data corresponding to the first original data and the third data corresponding to the first data.
Wherein l adv As a first loss function, l d N is the number of the first original data, x, as the second loss function i For the i-th first original data,for the ith first challenge data, +. >For the ith first data, D θD (x i ) For the ith second data, +.>Is the ith third data.
And performing one or more times of training according to the training targets by adopting the training mode, so that when the interference elimination processing is performed again on the trained interference model and the judgment model and then the judgment processing is performed, the output value of the first loss function obtained through calculation is smaller than the output value of the first loss function obtained through the last calculation, and the output value of the second loss function obtained through calculation is smaller than the output value of the second loss function obtained through the last calculation. Such that the calculated output value of the first loss function tends to be minimal and the output value of the second loss function tends to be minimal. That is, the difference between the sample raw data and the data after the interference cancellation of the sample challenge data tends to be minimum, and the difference between the data after the discrimination processing of the sample raw data and the data after the interference cancellation of the sample challenge data also tends to be minimum, so that the sample challenge data is subjected to the distribution of the sample raw data in a high-dimensional space, and the sample raw data and the sample challenge data are most similar in content.
In one possible implementation, the first loss function may further include at least one of a pixel value mean square error loss function and a spatial consistency loss function.
When the first original data and the first countermeasure data are images, the pixel value mean square error loss function is:
the spatial consistency loss function is:
wherein l mse Is the pixel mean square error loss function, l sc As a spatial consistency loss function, W is the width of the pixels in the first original data, H is the height of the pixels in the first original data, x w,h G is a pixel point with width w and height h in the first original data θG (x adv ) w,h The pixel points with the width w and the height h are located in the first data corresponding to the first countermeasure data.
When the first loss function includes the contrast loss function and the pixel value mean square error loss function, the first loss function may be obtained by summing the contrast loss function and the pixel value mean square error loss function, or may be obtained by weighted summing the contrast loss function and the pixel value mean square error loss function.
When the first loss function includes an antagonistic loss function and a spatially consistent loss function, the first loss function may be obtained by summing the antagonistic loss function and the spatially consistent loss function, or may be obtained by weighted summing the antagonistic loss function and the spatially consistent loss function.
When the first loss function includes the contrast loss function, the pixel value mean square error loss function, and the spatial consistency loss function, the first loss function may be obtained by summing the contrast loss function, the pixel value mean square error loss function, and the spatial consistency loss function, or may be obtained by weighted summing the contrast loss function, the pixel value mean square error loss function, and the spatial consistency loss function.
For example, after the antagonism loss function, the pixel value mean square error loss function, and the spatial consistency loss function are obtained, the three are weighted and summed, and the first loss function is determined by adopting the following formula:
l ape =ξ 1 l mse2 l adv3 l sc
wherein l ape As a first loss function, l mse Is a pixel value mean square error loss function, l adv To combat the loss function, l sc Is a space consistency loss function, ζ 1 For the weight corresponding to the pixel value mean square error loss function, xi 2 To counter the weight corresponding to the loss function, ζ 3 Weight corresponding to space consistency loss function and xi 123 =1。
In step 205, the processing device obtains first target data to be classified.
In the embodiment of the disclosure, the processing device may classify the data into different categories, and may subsequently process the data based on the category to which the data belongs.
Taking the first target data as an example, the processing device obtains the first target data to be classified. The first target data can be obtained through shooting or recording by the processing equipment, can also be obtained through downloading from the Internet, or can be obtained through sending the first target data to the processing equipment by other equipment. The first target data may be data in various formats such as pictures, audio or video. The acquired first target data to be classified may be subsequently classified based on the classification model.
In step 206, the processing device performs interference cancellation processing on the first target data based on the interference cancellation model, to obtain second target data.
The interference elimination model is used for eliminating interference in the first target data to obtain second target data after interference elimination processing.
The first target data may be original data which does not include interference, or may be countermeasure data formed after the original data is interfered. Thus, when the first target data is countermeasure data, interference is included in the first target data, which can affect a classification result when classifying the first target data based on the classification model. And after the interference in the first target data is eliminated based on the interference elimination model, the obtained second target data is the data after the interference elimination of the first target data, so that the influence of the interference can be eliminated, and the subsequent classification model can accurately classify the second target data. When the first target data is the original data, after the interference in the first target data is eliminated based on the interference elimination model, second target data which does not include the interference can also be obtained.
In step 207, the processing device performs classification processing on the second target data based on the classification model.
The processing device performs classification processing on the second target data subjected to interference cancellation processing by the interference cancellation model based on the classification model, and determines a category to which the second target data belongs as a category to which the first target data belongs. Because the second target data is the data after interference elimination, accurate classification can be performed based on the classification model, and the determined category is ensured to be the actual category to which the first target data belongs.
Compared with the method for directly classifying the first target data based on the classification model, the method for classifying the first target data based on the interference elimination model performs interference elimination processing on the first target data to obtain second target data, and then classifies the second target data based on the classification model, so that the influence of interference possibly existing in the first target data can be eliminated, the classification model can be accurately classified, and the classification accuracy is improved.
Fig. 5 is a schematic diagram of a test result based on an interference cancellation model and a discrimination model according to an exemplary embodiment, and as can be seen from observation in fig. 5, when classification is performed on challenge data directly based on a classification model, the classification model classifies the challenge data with a probability of 85.3% in error, so that the classification fails. When the countermeasure data is processed by the interference elimination model and then classified based on the classification model, the classification model classifies the countermeasure data correctly with 93.5% probability, so that the classification is successful.
The present embodiment is described by taking an execution subject as an example of a processing device, which may be a device having a training function and a classification function, and performing the steps 201 to 207 may train an interference cancellation model, perform interference cancellation processing based on the interference cancellation model, and perform classification processing based on the classification model. Alternatively, the processing device may comprise a training device for performing the above steps 201-204, training the interference cancellation model, and sending to the classification device, and a classification device for performing the above steps 205-207 based on the received interference cancellation model, implementing the classification of the target data.
According to the method provided by the embodiment of the disclosure, through obtaining the first original data and the corresponding first countermeasure data, performing interference cancellation processing on the first countermeasure data based on the interference cancellation model to obtain the first data, performing discrimination processing on the first original data and the first data based on the discrimination model to obtain discrimination results, and training the interference cancellation model and the discrimination model according to the discrimination results to obtain the trained interference cancellation model. According to the embodiment of the disclosure, the accuracy of the trained interference elimination model can be improved by setting the interference elimination model, matching with the judging model and setting the corresponding loss function, and the interference elimination effect based on the interference elimination model is improved. And when the first target data is acquired, the interference elimination processing is performed based on the interference elimination model, so that the interference existing in the first target data can be eliminated before classification, and the classification processing is performed on the second target data obtained after the interference elimination processing based on the classification model, so that the data output by the interference elimination model can be accurately classified based on the classification model, the problem of classification errors is avoided, and the accuracy is improved.
The embodiment of the disclosure can be applied to scenes classified by data, wherein the data can be pictures, audio or video. For example, in a scenario where a user obtains a pet photo, interference cancellation processing is performed on the pet photo, and the processed pet photo is classified to determine the type of the pet in the pet photo. Even if the pet photo carries interference, the interference in the pet photo can be eliminated by processing the pet photo through interference elimination processing, so that the pet can be correctly classified.
The embodiment of the disclosure also provides a method for training an interference cancellation model, which is different from the above embodiment in that instead of directly obtaining the countermeasure data corresponding to the original data, the countermeasure data generation model is first trained to obtain the countermeasure data corresponding to the original data, the countermeasure data corresponding to the original data is generated through the countermeasure data generation model, and training is performed based on the original data and the countermeasure data to obtain the interference cancellation model.
Fig. 6 is a flow chart illustrating an interference cancellation model training method for use in a processing device, as shown in fig. 6, according to an exemplary embodiment, the method comprising the steps of:
In step 601, the processing device obtains second raw data.
In the embodiment of the disclosure, the countermeasure data generation model is firstly trained to generate the countermeasure data of the original data based on the countermeasure data generation model, and then training can be performed based on the original data and the corresponding countermeasure data to obtain the interference elimination model.
In the embodiment of the disclosure, taking the second original data as the sample original data as an example, the process of training the challenge data generation model is described, so that the processing device acquires the second original data first.
In step 602, the processing device processes the second raw data based on the challenge data generation model, to obtain second challenge data corresponding to the second raw data.
The processing device firstly acquires a current countermeasure data generation model, wherein the countermeasure data generation model can be an initialized countermeasure data generation model or a countermeasure data generation model obtained after one or more times of training, and processes second original data based on the current countermeasure data generation model to obtain second countermeasure data corresponding to the second original data. The second countermeasure data is the data after the second original data is added with the interference.
In step 603, the processing device trains the challenge data generation model according to the second challenge data and the third loss function such that the output value of the third loss function tends to be minimal.
The challenge data generating model is provided with a third loss function, and the difference between the challenge data and the corresponding original data is positively correlated with the output value of the third loss function, so that when the challenge data generating model is trained, the training target is to ensure that the output value of the third loss function tends to be minimum on the basis of ensuring that the classification model classifies the challenge data and the corresponding original data into different categories, so as to ensure that the challenge data generated based on the challenge data generating model and the corresponding original data belong to different categories, and the difference between the challenge data and the corresponding original data tends to be minimum, namely the contents of the challenge data and the corresponding original data are similar.
Therefore, after the processing device acquires the second countermeasure data, the processing device acquires a third loss function, calculates according to the second countermeasure data and the third loss function, obtains an output value of the third loss function, and trains the countermeasure data generation model according to the output value of the third loss function.
In one possible implementation, the third loss function includes a distance loss function and a classification loss function, where a smaller output value of the distance loss function indicates a smaller difference between the challenge data and the original data, and a larger output value of the classification loss function indicates that the challenge data and the corresponding original data are more easily classified into two different categories when classified based on the classification model, and the more powerful challenge data can be obtained. Therefore, the output value of the distance loss function is made as small as possible on the basis of ensuring that the output value of the classification loss function is as large as possible, so that the output value of the third loss function tends to be minimum.
When the difference between the countermeasure data and the corresponding original data is too small, the countermeasure data and the corresponding original data belong to the same category, an interference elimination model with good interference elimination effect cannot be trained, and when the difference between the countermeasure data and the corresponding original data is too large, the difference between the countermeasure data and the corresponding original data is obvious, the countermeasure data and the corresponding original data cannot correspond to each other, and the subsequent classification result is influenced. Thus, the third loss function is essentially a countering harmonic between the classification loss function and the distance loss function.
In one possible implementation, the third loss function is:
Loss(θ,x,x adv ,l)=ξ 4 l classify (θ,x adv ,l)+ξ 5 l distance (θ,x,x adv )
wherein, loss (θ, x adv L) is a third loss function, θ is a parameter of the third loss function, x is the second original data, x adv For the second countermeasure data, l classify (θ,x adv L) is the classification loss of the second reactance data and its corresponding, l distance (θ,x,x adv ) For the distance loss between the second original data and the second countermeasure data, l is the category to which the second countermeasure data belongs, ζ 4 For classification weight, ζ 5 Is the distance weight and ζ 45 =1。
And training the training mode for one or more times according to the training target, so that when the trained countermeasure data generation model obtains countermeasure data again based on the other original data, the output value of the third loss function obtained through calculation is smaller than the output value of the third loss function obtained through the last calculation. The output value of the calculated third loss function tends to be minimized, that is, the difference between the sample reactance data and the corresponding sample raw data is minimized.
In another possible implementation manner, whether the category to which the countermeasure data belongs and the category to which the original data belongs are the same category is determined based on the classification model, and the determination result is introduced into the process of training the countermeasure data generation model, so that the training accuracy can be improved.
For this purpose, a classification model is acquired, based on which classification processing is performed on the second challenge data, resulting in fourth data that is used to describe the characteristics of the second challenge data, for example, the fourth data being represented as the category to which the second challenge data determined after classification based on the classification model belongs.
The processing device obtains a third loss function, calculates according to the second original data, the second countermeasure data, the fourth data and the third loss function, obtains an output value of the third loss function, trains the countermeasure data generation model according to the output value of the third loss function, and determines the third loss function according to the distance between the second countermeasure data and the second original data and the fourth data.
The classification model is used to classify the data, and may be the classification model adopted in the embodiment shown in fig. 2, or may be another classification model.
By adopting the training mode and training for one or more times according to the training target, when the trained countermeasure data generation model acquires the original data again, the output value of the third loss function obtained through calculation is smaller than the output value of the third loss function obtained through the last calculation, so that the output value of the third loss function tends to be minimum, the trained countermeasure data generation model is obtained, the countermeasure data can be generated based on the countermeasure data generation model subsequently, the classification model can be ensured to divide the countermeasure data and the corresponding original data into different categories, and the difference between the countermeasure data and the original data is minimum.
In step 604, the processing device acquires first raw data, and processes the first raw data based on the trained countermeasure data generation model to obtain first countermeasure data corresponding to the first raw data.
After the training of the countermeasure data creation model is completed, in the process of acquiring data in step 201, first raw data is acquired first, and the first raw data is processed based on the trained countermeasure data creation model, so that first countermeasure data which can cause the classification model to classify errors and is as similar as possible to the first raw data can be obtained.
In step 605, the processing device trains an interference cancellation model based on the first raw data and the first challenge data.
The specific steps of training to obtain the interference cancellation model based on the first raw data and the acquired first challenge data are referred to steps 202-204 in the above embodiments, and are not described herein.
According to the method for training the interference elimination model, the acquired second original data is processed based on the countermeasure data generation model to obtain second countermeasure data corresponding to the second original data, the countermeasure data generation model is trained according to the second countermeasure data and a third loss function so that the output value of the third loss function tends to be minimum, the acquired first original data is processed according to the sample generation model to obtain corresponding first countermeasure data, and the interference elimination model is obtained according to the first original data and the first countermeasure data. The countermeasure data for training the interference cancellation model can be generated by learning the relation between the original data and the corresponding countermeasure data through the countermeasure data generation model, and the interference cancellation model with stronger interference cancellation capability can be obtained by learning the relation among the original data, the countermeasure data and the data of the countermeasure data after interference cancellation processing, so that the interference in the target data can be effectively eliminated, and the effect of correctly classifying the target data can be achieved.
Fig. 7 is a block diagram illustrating a data sorting apparatus according to an exemplary embodiment. Referring to fig. 7, the apparatus includes a target acquisition unit 701, a first cancellation unit 702, and a classification unit 703.
A target acquisition unit 701 configured to acquire first target data to be classified;
a first cancellation unit 702 configured to perform interference cancellation processing on the first target data based on an interference cancellation model, to obtain second target data, where the interference cancellation model is used to cancel interference in the first target data;
the classification unit 703 is configured to perform classification processing on the second target data based on the classification model.
In one possible implementation, the apparatus further includes:
the first acquisition unit is configured to acquire first original data and corresponding first countermeasure data;
a second cancellation unit configured to perform interference cancellation processing on the first challenge data based on the interference cancellation model, to obtain first data;
the judging unit is configured to judge the first original data and the first data based on a judging model to obtain a judging result, wherein the judging model is used for determining the difference between the first original data and the first data;
and the training unit is configured to train the interference elimination model and the discrimination model according to the discrimination result so as to minimize the difference between the data processed by the interference elimination model and the corresponding original data.
In another possible implementation manner, the discrimination result includes second data corresponding to the first original data and third data corresponding to the first data;
training unit, comprising:
and a first training subunit configured to train the interference cancellation model according to the third data and the first loss function, and train the discriminant model according to the second data, the third data and the second loss function so that the output value of the first loss function and the output value of the second loss function tend to be minimum.
In another possible implementation, the first loss function includes a counterloss function, the counterloss function being:
the second loss function is:
wherein l adv As a first loss function, l d As a second loss function, N is the firstQuantity of raw data, x i For the i-th first original data,for the ith first challenge data, +.>For the ith first data, D θD (x i ) For the ith second data, +.>Is the ith third data.
In another possible implementation, the first loss function further includes at least one of a pixel value mean square error loss function and a spatial consistency loss function;
the pixel value mean square error loss function is:
the spatial consistency loss function is:
Wherein l mse Is the pixel mean square error loss function, l sc As a spatial consistency loss function, W is the width of the pixels in the first original data, H is the height of the pixels in the first original data, x w,h G is a pixel point with width w and height h in the first original data θG (x adv ) w,h The pixel points with the width w and the height h are located in the first data corresponding to the first countermeasure data.
In another possible implementation manner, the first obtaining unit includes:
a first acquisition subunit configured to acquire first original data;
the first processing subunit is configured to process the first original data based on the countermeasure data generation model to obtain first countermeasure data corresponding to the first original data.
In another possible implementation manner, the first obtaining unit further includes:
a second acquisition subunit configured to acquire second original data;
the second processing subunit is configured to process the second original data based on the countermeasure data generation model to obtain second countermeasure data corresponding to the second original data;
and a second training subunit configured to train the challenge data generation model in accordance with the second challenge data and the third loss function so that an output value of the third loss function tends to be minimum.
In another possible implementation, the third loss function includes a distance loss function and a classification loss function, and the second training subunit is further configured to classify the second challenge data based on the classification model to obtain fourth data; the challenge data generation model is trained based on the second raw data, the second challenge data, the fourth data, and the third loss function such that an output value of the third loss function tends to be minimal.
The specific manner in which the individual units perform the operations in relation to the apparatus of the above embodiments has been described in detail in relation to the embodiments of the method and will not be described in detail here.
Fig. 8 is a block diagram illustrating a terminal 800 for data classification according to an exemplary embodiment. The terminal 800 is configured to perform the steps performed by the processing device in the data classification method, and may be a portable mobile terminal, for example: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, motion picture expert compression standard audio plane 3), an MP4 (Moving Picture Experts Group Audio Layer IV, motion picture expert compression standard audio plane 4) player, a notebook computer, or a desktop computer. Terminal 800 may also be referred to by other names of user devices, portable terminals, laptop terminals, desktop terminals, and the like.
In general, the terminal 800 includes: a processor 801 and a memory 802.
Processor 801 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 801 may be implemented in at least one hardware form of DSP (Digital Signal Processing ), FPGA (Field-Programmable Gate Array, field programmable gate array), PLA (Programmable Logic Array ). The processor 801 may also include a main processor, which is a processor for processing data in an awake state, also referred to as a CPU (Central Processing Unit ), and a coprocessor; a coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 801 may integrate a GPU (Graphics Processing Unit, image processor) for rendering and rendering of content required to be displayed by the display screen. In some embodiments, the processor 801 may also include an AI (Artificial Intelligence ) processor for processing computing operations related to machine learning.
Memory 802 may include one or more computer-readable storage media, which may be non-transitory. Memory 802 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in memory 802 is used to store at least one instruction for being possessed by processor 801 to implement the data classification methods provided by the method embodiments herein.
In some embodiments, the terminal 800 may further optionally include: a peripheral interface 803, and at least one peripheral. The processor 801, the memory 802, and the peripheral interface 803 may be connected by a bus or signal line. Individual peripheral devices may be connected to the peripheral device interface 803 by buses, signal lines, or a circuit board. Specifically, the peripheral device includes: at least one of radio frequency circuitry 804, a touch display 805, a camera 806, audio circuitry 807, a positioning component 808, and a power supply 809.
Peripheral interface 803 may be used to connect at least one Input/Output (I/O) related peripheral to processor 801 and memory 802. In some embodiments, processor 801, memory 802, and peripheral interface 803 are integrated on the same chip or circuit board; in some other embodiments, either or both of the processor 801, the memory 802, and the peripheral interface 803 may be implemented on separate chips or circuit boards, which is not limited in this embodiment.
The Radio Frequency circuit 804 is configured to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 804 communicates with a communication network and other communication devices via electromagnetic signals. The radio frequency circuit 804 converts an electrical signal into an electromagnetic signal for transmission, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 804 includes: antenna systems, RF transceivers, one or more amplifiers, tuners, oscillators, digital signal processors, codec chipsets, subscriber identity module cards, and so forth. The radio frequency circuitry 804 may communicate with other terminals via at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: metropolitan area networks, various generations of mobile communication networks (2G, 3G, 4G, and 13G), wireless local area networks, and/or WiFi (Wireless Fidelity ) networks. In some embodiments, the radio frequency circuitry 804 may also include NFC (Near Field Communication ) related circuitry, which is not limited in this application.
The display screen 805 is used to display a UI (user interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display 805 is a touch display, the display 805 also has the ability to collect touch signals at or above the surface of the display 805. The touch signal may be input as a control signal to the processor 801 for processing. At this time, the display 805 may also be used to provide virtual buttons and/or virtual keyboards, also referred to as soft buttons and/or soft keyboards. In some embodiments, the display 805 may be one, providing a front panel of the terminal 800; in other embodiments, the display 805 may be at least two, respectively disposed on different surfaces of the terminal 800 or in a folded design; in still other embodiments, the display 805 may be a flexible display disposed on a curved surface or a folded surface of the terminal 800. Even more, the display 805 may be arranged in an irregular pattern other than rectangular, i.e., a shaped screen. The display 805 may be made of LCD (Liquid Crystal Display ), OLED (Organic Light-Emitting Diode) or other materials.
The camera assembly 806 is used to capture images or video. Optionally, the camera assembly 806 includes a front camera and a rear camera. Typically, the front camera is disposed on the front panel of the terminal and the rear camera is disposed on the rear surface of the terminal. In some embodiments, the at least two rear cameras are any one of a main camera, a depth camera, a wide-angle camera and a tele camera, so as to realize that the main camera and the depth camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize a panoramic shooting and Virtual Reality (VR) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 806 may also include a flash. The flash lamp can be a single-color temperature flash lamp or a double-color temperature flash lamp. The dual-color temperature flash lamp refers to a combination of a warm light flash lamp and a cold light flash lamp, and can be used for light compensation under different color temperatures.
Audio circuitry 807 may include a microphone and a speaker. The microphone is used for collecting sound waves of users and the environment, converting the sound waves into electric signals, inputting the electric signals to the processor 801 for processing, or inputting the electric signals to the radio frequency circuit 804 for voice communication. For stereo acquisition or noise reduction purposes, a plurality of microphones may be respectively disposed at different portions of the terminal 800. The microphone may also be an array microphone or an omni-directional pickup microphone. The speaker is used to convert electrical signals from the processor 801 or the radio frequency circuit 804 into sound waves. The speaker may be a conventional thin film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, not only the electric signal can be converted into a sound wave audible to humans, but also the electric signal can be converted into a sound wave inaudible to humans for ranging and other purposes. In some embodiments, audio circuit 807 may also include a headphone jack.
The location component 808 is utilized to locate the current geographic location of the terminal 800 to enable navigation or LBS (Location Based Service, location-based services). The positioning component 808 may be a positioning component based on the United states GPS (Global Positioning System ), the Beidou system of China, the Granati system of Russia, or the Galileo system of the European Union.
A power supply 809 is used to power the various components in the terminal 800. The power supply 809 may be an alternating current, direct current, disposable battery, or rechargeable battery. When the power supply 809 includes a rechargeable battery, the rechargeable battery may support wired or wireless charging. The rechargeable battery may also be used to support fast charge technology.
In some embodiments, the terminal 800 also includes one or more sensors 810. The one or more sensors 810 include, but are not limited to: acceleration sensor 811, gyroscope sensor 812, pressure sensor 813, fingerprint sensor 814, optical sensor 815, and proximity sensor 816.
The acceleration sensor 811 can detect the magnitudes of accelerations on three coordinate axes of the coordinate system established with the terminal 800. For example, the acceleration sensor 811 may be used to detect components of gravitational acceleration in three coordinate axes. The processor 801 may control the touch display screen 805 to display a user interface in a landscape view or a portrait view according to the gravitational acceleration signal acquired by the acceleration sensor 811. Acceleration sensor 811 may also be used for the acquisition of motion data of a game or user.
The gyro sensor 812 may detect a body direction and a rotation angle of the terminal 800, and the gyro sensor 812 may collect a 3D motion of the user to the terminal 800 in cooperation with the acceleration sensor 811. The processor 801 may implement the following functions based on the data collected by the gyro sensor 812: motion sensing (e.g., changing UI according to a tilting operation by a user), image stabilization at shooting, game control, and inertial navigation.
The pressure sensor 813 may be disposed at a side frame of the terminal 800 and/or at a lower layer of the touch display 805. When the pressure sensor 813 is disposed on a side frame of the terminal 800, a grip signal of the terminal 800 by a user may be detected, and the processor 801 performs left-right hand recognition or shortcut operation according to the grip signal collected by the pressure sensor 813. When the pressure sensor 813 is disposed at the lower layer of the touch display screen 805, the processor 801 controls the operability control on the UI interface according to the pressure operation of the user on the touch display screen 805. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.
The fingerprint sensor 814 is used to collect a fingerprint of a user, and the processor 801 identifies the identity of the user based on the fingerprint collected by the fingerprint sensor 814, or the fingerprint sensor 814 identifies the identity of the user based on the collected fingerprint. Upon recognizing that the user's identity is a trusted identity, the user is authorized by the processor 801 to have associated sensitive operations including unlocking the screen, viewing encrypted information, downloading software, paying for and changing settings, etc. The fingerprint sensor 814 may be provided on the front, back, or side of the terminal 800. When a physical key or vendor Logo is provided on the terminal 800, the fingerprint sensor 814 may be integrated with the physical key or vendor Logo.
The optical sensor 815 is used to collect the ambient light intensity. In one embodiment, the processor 801 may control the display brightness of the touch display screen 805 based on the intensity of ambient light collected by the optical sensor 815. Specifically, when the intensity of the ambient light is high, the display brightness of the touch display screen 805 is turned up; when the ambient light intensity is low, the display brightness of the touch display screen 805 is turned down. In another embodiment, the processor 801 may also dynamically adjust the shooting parameters of the camera module 806 based on the ambient light intensity collected by the optical sensor 815.
A proximity sensor 816, also referred to as a distance sensor, is typically provided on the front panel of the terminal 800. The proximity sensor 816 is used to collect the distance between the user and the front of the terminal 800. In one embodiment, when the proximity sensor 816 detects that the distance between the user and the front of the terminal 800 gradually decreases, the processor 801 controls the touch display 805 to switch from the bright screen state to the off screen state; when the proximity sensor 816 detects that the distance between the user and the front surface of the terminal 800 gradually increases, the processor 801 controls the touch display 805 to switch from the off-screen state to the on-screen state.
Those skilled in the art will appreciate that the structure shown in fig. 8 is not limiting and that more or fewer components than shown may be included or certain components may be combined or a different arrangement of components may be employed.
Fig. 9 is a schematic structural diagram of a server according to an exemplary embodiment, where the server 900 may have a relatively large difference due to configuration or performance, and may include one or more processors (central processing units, CPU) 901 and one or more memories 902, where at least one instruction is stored in the memories 902, and the at least one instruction is loaded and executed by the processors 901 to implement the methods provided in the foregoing method embodiments. Of course, the server may also have a wired or wireless network interface, a keyboard, an input/output interface, and other components for implementing the functions of the device, which are not described herein.
The server 900 may be configured to perform the steps performed by the processing device in the data classification method described above.
In an exemplary embodiment, there is also provided a non-transitory computer readable storage medium, which when executed by a processor of a processing device, causes the processing device to perform a data classification method, the method comprising:
acquiring first target data to be classified;
Based on an interference elimination model, carrying out interference elimination processing on the first target data to obtain second target data, wherein the interference elimination model is used for eliminating interference in the first target data;
and classifying the second target data based on the classification model.
In an exemplary embodiment, there is also provided a computer program product, which when executed by a processor of a processing device, causes the processing device to perform a data classification method, the method comprising:
acquiring first target data to be classified;
based on an interference elimination model, carrying out interference elimination processing on the first target data to obtain second target data, wherein the interference elimination model is used for eliminating interference in the first target data;
and classifying the second target data based on the classification model.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure herein. This application is intended to cover any adaptations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (14)

1. A method of classifying data, the method comprising:
acquiring first target data to be classified, wherein the first target data is pictures, audio or video;
performing interference elimination processing on the first target data based on an interference elimination model to obtain second target data, wherein the interference elimination model is used for eliminating interference in the first target data;
classifying the second target data based on a classification model;
the method further comprises the steps of:
acquiring first original data and corresponding first countermeasure data;
performing interference elimination processing on the first countermeasure data based on the interference elimination model to obtain first data;
performing discrimination processing on the first original data, the first countermeasure data and the first data based on a discrimination model to obtain a discrimination result, wherein the discrimination model is used for determining the difference between the first original data and the first data and the difference between the first data and the first countermeasure data, and the discrimination result comprises second data corresponding to the first original data and third data corresponding to the first data;
Determining a pixel value difference value between the first original data and pixel points with the same positions in the first data corresponding to the first countermeasure data through a pixel value mean square error loss function, wherein the first original data and the first data both comprise a first number of pixel points, and the first number is the product of the width of the pixels in the first original data and the height of the pixels in the first original data; determining the square of each pixel value difference value, and determining the ratio of the sum of the squares of the first number of pixel value difference values to the first number as a first numerical value;
determining norms of gradients of pixel values of each pixel point in the first data through a spatial consistency loss function; determining the ratio of norms corresponding to all pixel points in the first data to the first quantity as a second value, wherein a first loss function comprises at least one of a mean square error loss function or a space consistency loss function of the pixel values;
determining an output value of the first loss function based on at least one of the first value or the second value, training the interference cancellation model based on the output value of the first loss function to minimize the output value of the first loss function;
Determining, by a second loss function, an output value of the second loss function based on a distance between the second data and the third data, and training the discriminant model based on the output value of the second loss function to minimize the output value of the second loss function.
2. The method of claim 1, wherein the first loss function comprises a counterloss function, the counterloss function being:
the second loss function is:
wherein l adv For the first loss function, l d N is the number of the first original data, x, as the second loss function i For the i-th first original data,for the ith first challenge data, +.>For the ith first data, D θD (x i ) For the ith second data, +.>Is the ith third data.
3. The method of claim 2, wherein the pixel value mean square error loss function is:
the spatial consistency loss function is:
wherein l mse For the pixel value mean square error loss function, l sc For the spatial consistency loss function, W is the width of the pixels in the first original data, H is the height of the pixels in the first original data, and x w,h G is a pixel point with width w and height h in the first original data θG (x adv ) w,h And the pixel points are located in the first data corresponding to the first countermeasure data, wherein the width of the pixel points is w, and the height of the pixel points is h.
4. The method of claim 1, wherein the obtaining the first raw data and the corresponding first challenge data comprises:
acquiring the first original data;
and processing the first original data based on the countermeasure data generation model to obtain first countermeasure data corresponding to the first original data.
5. The method according to claim 4, wherein the method further comprises:
acquiring second original data;
processing the second original data based on the countermeasure data generation model to obtain second countermeasure data corresponding to the second original data;
training the challenge data generation model based on the second challenge data and a third loss function such that an output value of the third loss function tends to be minimal.
6. The method of claim 5, wherein the third loss function comprises a distance loss function and a classification loss function, wherein the training the challenge data generation model to minimize the output value of the third loss function based on the second challenge data and the third loss function comprises:
Classifying the second countermeasure data based on the classification model to obtain fourth data;
training the challenge data generation model based on the second raw data, the second challenge data, the fourth data, and the third loss function to minimize an output value of the third loss function.
7. A data sorting apparatus, the apparatus comprising:
the target acquisition unit is configured to acquire first target data to be classified, wherein the first target data is a picture, audio or video;
a first cancellation unit configured to perform interference cancellation processing on the first target data based on an interference cancellation model to obtain second target data, where the interference cancellation model is used to cancel interference in the first target data;
a classification unit configured to classify the second target data based on a classification model;
the apparatus further comprises:
the first acquisition unit is configured to acquire first original data and corresponding first countermeasure data;
a second cancellation unit configured to perform interference cancellation processing on the first challenge data based on the interference cancellation model, to obtain first data;
A discriminating unit configured to perform discrimination processing on the first original data, the first countermeasure data, and the first data based on a discrimination model for determining a difference between the first original data and the first data, and a difference between the first data and the first countermeasure data, to obtain a discrimination result including second data corresponding to the first original data and third data corresponding to the first data;
training unit, comprising: a first training subunit;
a first training subunit configured to determine, by a pixel value mean square error loss function, a pixel value difference between the first original data and a pixel point with the same position in the first data corresponding to the first challenge data, where the first original data and the first data each include a first number of pixel points, and the first number is a product of a width of a pixel in the first original data and a height of a pixel in the first original data; determining the square of each pixel value difference value, and determining the ratio of the sum of the squares of the first number of pixel value difference values to the first number as a first numerical value; determining norms of gradients of pixel values of each pixel point in the first data through a spatial consistency loss function; determining the ratio of norms corresponding to all pixel points in the first data to the first quantity as a second value, wherein a first loss function comprises at least one of a mean square error loss function or a space consistency loss function of the pixel values; determining an output value of the first loss function based on at least one of the first value or the second value, training the interference cancellation model based on the output value of the first loss function to minimize the output value of the first loss function; determining, by a second loss function, an output value of the second loss function based on a distance between the second data and the third data, and training the discriminant model based on the output value of the second loss function to minimize the output value of the second loss function.
8. The apparatus of claim 7, wherein the first loss function comprises a counterloss function, the counterloss function being:
the second loss function is:
wherein l adv For the first loss function, l d N is the number of the first original data, x, as the second loss function i For the i-th first original data,for the ith first challenge data, +.>For the ith first data, D θD (x i ) For the ith second data, +.>Is the ith third data.
9. The apparatus of claim 8, wherein the pixel value mean square error loss function is:
the spatial consistency loss function is:
wherein l mse For the pixel value mean square error loss function, l sc For the spatial consistency loss function, W is the width of the pixels in the first original data, H is the height of the pixels in the first original data, and x w,h G is a pixel point with width w and height h in the first original data θG (x adv ) w,h To be positioned at the first countermeasureAnd the first data corresponding to the data comprises pixel points with the width w and the height h.
10. The apparatus of claim 7, wherein the first acquisition unit comprises:
A first acquisition subunit configured to acquire the first raw data;
and the first processing subunit is configured to process the first original data based on the countermeasure data generation model to obtain first countermeasure data corresponding to the first original data.
11. The apparatus of claim 10, wherein the first acquisition unit further comprises:
a second acquisition subunit configured to acquire second original data;
the second processing subunit is configured to process the second original data based on the countermeasure data generation model to obtain second countermeasure data corresponding to the second original data;
a second training subunit configured to train the challenge data generation model in accordance with the second challenge data and a third loss function such that an output value of the third loss function tends to be minimum.
12. The apparatus of claim 11, wherein the third loss function comprises a distance loss function and a classification loss function, the second training subunit further configured to classify the second challenge data based on the classification model to obtain fourth data; training the challenge data generation model based on the second raw data, the second challenge data, the fourth data, and the third loss function to minimize an output value of the third loss function.
13. A processing device for data classification, the processing device comprising:
a processor;
a memory for storing processor-executable commands;
wherein the processor is configured to:
acquiring first target data to be classified, wherein the first target data is pictures, audio or video;
performing interference elimination processing on the first target data based on an interference elimination model to obtain second target data, wherein the interference elimination model is used for eliminating interference in the first target data;
classifying the second target data based on a classification model;
acquiring first original data and corresponding first countermeasure data;
performing interference elimination processing on the first countermeasure data based on the interference elimination model to obtain first data;
performing discrimination processing on the first original data, the first countermeasure data and the first data based on a discrimination model to obtain a discrimination result, wherein the discrimination model is used for determining the difference between the first original data and the first data and the difference between the first data and the first countermeasure data, and the discrimination result comprises second data corresponding to the first original data and third data corresponding to the first data;
Determining a pixel value difference value between the first original data and pixel points with the same positions in the first data corresponding to the first countermeasure data through a pixel value mean square error loss function, wherein the first original data and the first data both comprise a first number of pixel points, and the first number is the product of the width of the pixels in the first original data and the height of the pixels in the first original data; determining the square of each pixel value difference value, and determining the ratio of the sum of the squares of the first number of pixel value difference values to the first number as a first numerical value;
determining norms of gradients of pixel values of each pixel point in the first data through a spatial consistency loss function; determining the ratio of norms corresponding to all pixel points in the first data to the first quantity as a second value, wherein a first loss function comprises at least one of a mean square error loss function of the pixel values and a space consistency loss function;
determining an output value of the first loss function based on at least one of the first value or the second value, training the interference cancellation model based on the output value of the first loss function to minimize the output value of the first loss function;
Determining, by a second loss function, an output value of the second loss function based on a distance between the second data and the third data, and training the discriminant model based on the output value of the second loss function to minimize the output value of the second loss function.
14. A non-transitory computer readable storage medium, which when executed by a processor of a processing device, causes the processing device to perform a data classification method, the method comprising:
acquiring first target data to be classified, wherein the first target data is pictures, audio or video;
performing interference elimination processing on the first target data based on an interference elimination model to obtain second target data, wherein the interference elimination model is used for eliminating interference in the first target data;
classifying the second target data based on a classification model;
acquiring first original data and corresponding first countermeasure data;
performing interference elimination processing on the first countermeasure data based on the interference elimination model to obtain first data;
performing discrimination processing on the first original data, the first countermeasure data and the first data based on a discrimination model to obtain a discrimination result, wherein the discrimination model is used for determining the difference between the first original data and the first data and the difference between the first data and the first countermeasure data, and the discrimination result comprises second data corresponding to the first original data and third data corresponding to the first data;
Determining a pixel value difference value between the first original data and pixel points with the same positions in the first data corresponding to the first countermeasure data through a pixel value mean square error loss function, wherein the first original data and the first data both comprise a first number of pixel points, and the first number is the product of the width of the pixels in the first original data and the height of the pixels in the first original data; determining the square of each pixel value difference value, and determining the ratio of the sum of the squares of the first number of pixel value difference values to the first number as a first numerical value;
determining norms of gradients of pixel values of each pixel point in the first data through a spatial consistency loss function; determining the ratio of norms corresponding to all pixel points in the first data to the first quantity as a second value, wherein a first loss function comprises at least one of a mean square error loss function of the pixel values and a space consistency loss function;
determining an output value of the first loss function based on at least one of the first value or the second value, training the interference cancellation model based on the output value of the first loss function to minimize the output value of the first loss function;
Determining, by a second loss function, an output value of the second loss function based on a distance between the second data and the third data, and training the discriminant model based on the output value of the second loss function to minimize the output value of the second loss function.
CN201811644532.3A 2018-12-29 2018-12-29 Data classification method, device, equipment and storage medium Active CN111382771B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811644532.3A CN111382771B (en) 2018-12-29 2018-12-29 Data classification method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811644532.3A CN111382771B (en) 2018-12-29 2018-12-29 Data classification method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111382771A CN111382771A (en) 2020-07-07
CN111382771B true CN111382771B (en) 2024-03-15

Family

ID=71216611

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811644532.3A Active CN111382771B (en) 2018-12-29 2018-12-29 Data classification method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111382771B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108197662A (en) * 2018-01-22 2018-06-22 湖州师范学院 A kind of solid wooden floor board sorting technique
CN108537271A (en) * 2018-04-04 2018-09-14 重庆大学 A method of resisting sample is attacked based on convolution denoising self-editing ink recorder defence
CN108875510A (en) * 2017-11-28 2018-11-23 北京旷视科技有限公司 Method, apparatus, system and the computer storage medium of image procossing

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9590673B2 (en) * 2015-01-20 2017-03-07 Qualcomm Incorporated Switched, simultaneous and cascaded interference cancellation

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108875510A (en) * 2017-11-28 2018-11-23 北京旷视科技有限公司 Method, apparatus, system and the computer storage medium of image procossing
CN108197662A (en) * 2018-01-22 2018-06-22 湖州师范学院 A kind of solid wooden floor board sorting technique
CN108537271A (en) * 2018-04-04 2018-09-14 重庆大学 A method of resisting sample is attacked based on convolution denoising self-editing ink recorder defence

Also Published As

Publication number Publication date
CN111382771A (en) 2020-07-07

Similar Documents

Publication Publication Date Title
US11517099B2 (en) Method for processing images, electronic device, and storage medium
CN110059652B (en) Face image processing method, device and storage medium
CN109558837B (en) Face key point detection method, device and storage medium
CN111127509B (en) Target tracking method, apparatus and computer readable storage medium
CN109522863B (en) Ear key point detection method and device and storage medium
CN109886208B (en) Object detection method and device, computer equipment and storage medium
US11386586B2 (en) Method and electronic device for adding virtual item
CN112150560B (en) Method, device and computer storage medium for determining vanishing point
CN110705614A (en) Model training method and device, electronic equipment and storage medium
CN111753606A (en) Intelligent model upgrading method and device
CN110853124B (en) Method, device, electronic equipment and medium for generating GIF dynamic diagram
CN110163192B (en) Character recognition method, device and readable medium
CN111488895B (en) Countermeasure data generation method, device, equipment and storage medium
CN111982293B (en) Body temperature measuring method and device, electronic equipment and storage medium
CN111382771B (en) Data classification method, device, equipment and storage medium
CN111723615B (en) Method and device for judging matching of detected objects in detected object image
CN111757146B (en) Method, system and storage medium for video splicing
CN112487162A (en) Method, device and equipment for determining text semantic information and storage medium
CN112214115A (en) Input mode identification method and device, electronic equipment and storage medium
CN112308104A (en) Abnormity identification method and device and computer storage medium
CN111488898B (en) Countermeasure data acquisition method, device, equipment and storage medium
CN116681755B (en) Pose prediction method and device
CN113065457B (en) Face detection point processing method and device, computer equipment and storage medium
CN112990424B (en) Neural network model training method and device
CN110660031B (en) Image sharpening method and device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant