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

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

Info

Publication number
CN111382771A
CN111382771A CN201811644532.3A CN201811644532A CN111382771A CN 111382771 A CN111382771 A CN 111382771A CN 201811644532 A CN201811644532 A CN 201811644532A CN 111382771 A CN111382771 A CN 111382771A
Authority
CN
China
Prior art keywords
data
model
loss function
countermeasure
classification
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.)
Granted
Application number
CN201811644532.3A
Other languages
Chinese (zh)
Other versions
CN111382771B (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.)
Reach Best Technology Co Ltd
Original Assignee
Reach Best 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 Reach Best Technology Co Ltd filed Critical Reach Best 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

Images

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The disclosure relates to a data classification method, a data classification device, data classification 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 obtained, the 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 processing can be correctly classified based on the classification model, the problem of classification errors 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 present disclosure relates to the field of computer technologies, and in particular, to a data classification method, apparatus, device, and storage medium.
Background
With the rapid development of computer technology, data shows 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 usually collected, training is performed based on the collected sample data to obtain a trained classification model, and then 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, the original data is interfered due to the influence of various factors to form the countermeasure data, so when the original data is classified based on the classification model, the countermeasure data is actually classified based on the classification model, which may cause the classification error of the classification model and affect the classification accuracy.
Disclosure of Invention
The present disclosure provides a data classification method, apparatus, device, and storage medium, which can overcome the problem in the related art that classification errors affect classification accuracy when classifying countermeasure data based on a classification model.
According to a first aspect of embodiments of the present disclosure, there is provided a data classification method, the method including:
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;
based on the interference elimination model, carrying out interference elimination processing on the first countermeasure data to obtain first data;
performing discrimination processing on the first original 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 training the interference elimination model and the discrimination model according to the discrimination result so as to lead the difference between the data processed by the interference elimination model and the corresponding original data to tend to be minimum.
In another possible implementation manner, the determination result includes second data corresponding to the first original data and third data corresponding to the first data;
the 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 by the discrimination model includes:
and training the interference elimination model according to the third data and the first loss function, and training 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 manner, the first loss function includes a penalty loss function, and the penalty loss function is:
Figure BDA0001931791330000021
the second loss function is:
Figure BDA0001931791330000022
wherein ladvIs said first loss function,/dIs the second loss function, N is the number of the first original data, xiFor the ith first original data, the first data is,
Figure BDA0001931791330000023
for the ith first countermeasure data,
Figure BDA0001931791330000024
for the ith first data, DθD(xi) For the ith second data, the first data is the first data,
Figure BDA0001931791330000025
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:
Figure BDA0001931791330000026
the spatial consistency loss function is:
Figure BDA0001931791330000027
wherein lmseIs the pixel mean square error loss function,/scW is the width of the pixel in the first original data, H is the height of the pixel in the first original data, and x is the loss function of the spatial consistencyw,hG is a pixel point with width of w and height of h in the first original dataθG(xadv)w,hThe pixel points are located in the first data corresponding to the first countermeasure data, and the pixel points are w in width and h in height.
In another possible implementation manner, the acquiring first original data and corresponding first countermeasure data includes:
acquiring the first original data;
and processing the first original data based on a countermeasure data generation model to obtain first countermeasure data corresponding to the first original data.
In another possible implementation manner, 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;
and training the countermeasure data generation model 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.
In another possible implementation manner, the training the countermeasure data generation model according to the second countermeasure data and the third loss function so that the output value of the third loss function tends to be minimum includes:
classifying the second countermeasure data based on the classification model to obtain fourth data;
and training the countermeasure data generation model according to the second original data, the second countermeasure data, the fourth data and the third loss function, so that the output value of the third loss function tends to be minimum.
According to a second aspect of the embodiments of the present disclosure, there is provided a data sorting apparatus, the apparatus including:
a target acquisition unit configured to acquire first target data to be classified;
a first eliminating unit, configured to perform interference elimination processing on the first target data based on an interference elimination model, so as to obtain second target data, where the interference elimination model is used to eliminate interference in the first target data;
a classification unit configured to perform classification processing on the second target data based on a classification model.
In one possible implementation, the apparatus further includes:
a first acquisition unit configured to acquire first original data and corresponding first countermeasure data;
a second eliminating unit configured to perform interference elimination processing on the first countermeasure data based on the interference elimination model to obtain first data;
a discrimination 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 that the difference between the data processed by the interference elimination model and the corresponding original data tends to be minimum.
In another possible implementation manner, the determination 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 a first loss function, and train the discriminant model according to the second data, the third data, and a 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 manner, the first loss function includes a penalty loss function, and the penalty loss function is:
Figure BDA0001931791330000041
the second loss function is:
Figure BDA0001931791330000042
wherein ladvIs said first loss function,/dIs the second loss function, N is the number of the first original data, xiFor the ith first original data, the first data is,
Figure BDA0001931791330000043
for the ith first countermeasure data,
Figure BDA0001931791330000044
for the ith first data, DθD(xi) For the ith second data, the first data is the first data,
Figure BDA0001931791330000045
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:
Figure BDA0001931791330000046
the spatial consistency loss function is:
Figure BDA0001931791330000047
wherein lmseIs the pixel mean square error loss function,/scW is the width of the pixel in the first original data, H is the height of the pixel in the first original data, and x is the loss function of the spatial consistencyw,hG is a pixel point with width of w and height of h in the first original dataθG(xadv)w,hThe pixel points are located in the first data corresponding to the first countermeasure data, and the pixel points are w in width and h in height.
In another possible implementation manner, the first obtaining unit includes:
a first acquisition subunit configured to acquire the first raw data;
the first processing subunit is configured to generate a model based on the countermeasure data, and process the first raw data to obtain first countermeasure data corresponding to the first raw 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 generate a model based on the countermeasure data, and process the second original data to obtain second countermeasure data corresponding to the second original data;
a second training subunit configured to train the countermeasure data generation model so that an output value of a third loss function tends to be minimum, in accordance with the second countermeasure data and the third loss function.
In another possible implementation manner, 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 countermeasure data based on the classification model to obtain fourth data; and training the countermeasure data generation model according to the second original data, the second countermeasure data, the fourth data and the third loss function, so that the output value of the third loss function tends to be minimum.
According to a third aspect of the embodiments of the present disclosure, there is provided a processing apparatus for data classification, the processing apparatus including:
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 having instructions therein, which when executed by a processor of a processing device, enable the processing device to perform a method of data classification, 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, wherein instructions which, when executed by a processor of a processing device, enable the processing device to perform a method of data classification, 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 data classification device, the data classification equipment and the data classification storage medium, first target data to be classified are obtained, interference elimination processing is conducted on the first target data based on an interference elimination model to obtain second target data, and classification processing is conducted 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, whether the target data is original data or countermeasure data, the interference possibly existing in the target data can be eliminated based on the interference elimination model, the interference existing in the first target data is eliminated before classification, the data obtained after the target data is processed by the interference elimination model is correctly classified based on the classification model, the problem of classification errors is avoided, and the classification accuracy is improved.
In addition, according to the embodiment of the disclosure, by setting the interference cancellation model, matching with the discrimination model, and setting the corresponding loss function, the accuracy of the trained interference cancellation model can be improved, and the interference cancellation effect of the interference cancellation model is improved.
Moreover, the countermeasure data generation model learns the relationship between the original data and the corresponding countermeasure data, so that the countermeasure data for training the interference elimination model can be generated, the interference elimination model with strong interference elimination capability is obtained by learning the relationship among the original data, the countermeasure data and the data of the countermeasure data after the interference elimination processing, the interference in the target data can be effectively eliminated, and the effect of correctly classifying the target data is 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 present disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a flow chart illustrating a method of data classification according to an exemplary embodiment.
FIG. 2 is a flow chart illustrating a method of data classification according to an exemplary embodiment.
Fig. 3 is a diagram illustrating an interference cancellation model and a discriminant model in accordance with an exemplary embodiment.
Fig. 4 is a schematic diagram illustrating another interference cancellation model and discrimination model in accordance with an exemplary embodiment.
Fig. 5 is a diagram illustrating test results based on an interference cancellation model and a discriminant model according to an example embodiment.
Fig. 6 is a flow chart illustrating a method of interference cancellation model training in accordance with an example embodiment.
Fig. 7 is a block diagram illustrating a data sorting apparatus according to an example embodiment.
Fig. 8 is a block diagram illustrating a terminal for data classification according to an example embodiment.
Fig. 9 is a schematic diagram illustrating a configuration of a server according to an example embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended 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, a 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 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, the first target data to be classified is obtained, the interference elimination processing is performed on the first target data based on the interference elimination model to obtain the second target data, and the classification processing is performed on the second target data based on the classification model, wherein the interference elimination model is used for eliminating the interference in the first target data. When the target data is acquired, whether the target data is original data or countermeasure data, the interference possibly existing in the target data can be eliminated based on the interference elimination model, so that when the data obtained after the target data is processed by the interference elimination model is classified based on the classification model, the data can be correctly classified, and the classification accuracy is improved.
In one possible implementation, the method further includes:
acquiring first original data and corresponding first countermeasure data;
based on the interference elimination model, carrying out interference elimination processing on the first countermeasure data to obtain first data;
on the basis of a discrimination model, performing discrimination processing on 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 lead the difference between the data processed by the interference elimination model and the corresponding original data to tend to be minimum.
In another possible implementation manner, the determination result includes second data corresponding to the first original data and third data corresponding to the first data;
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 by the discrimination model, wherein the training comprises the following steps:
and training the interference elimination model according to the third data and the first loss function, and training 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 penalty loss function that is:
Figure BDA0001931791330000081
the second loss function is:
Figure BDA0001931791330000082
wherein ladvIs a first loss function,/dIs a second loss function, N is the number of first original data, xiFor the ith first original data, the first data is,
Figure BDA0001931791330000083
for the ith first countermeasure data,
Figure BDA0001931791330000084
for the ith first data, DθD(xi) For the ith second data, the first data is the first data,
Figure BDA0001931791330000085
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:
Figure BDA0001931791330000086
the spatial consistency loss function is:
Figure BDA0001931791330000091
wherein lmseAs a pixel mean square error loss function,/scFor the spatial consistency loss function, W is the width of the pixel in the first original data, H is the height of the pixel in the first original data, and xw,hIs a pixel point with width w and height h in the first original data, GθG(xadv)w,hThe pixel points are located in the first data corresponding to the first countermeasure data, and the pixel points are w in width and h in height.
In another possible implementation manner, the obtaining first original data and 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 manner, 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;
and training the countermeasure data generation model according to the second countermeasure data and the third loss function so that the output value of the third loss function tends to be minimum.
In another possible implementation manner, the third loss function includes a distance loss function and a classification loss function, and the training of the impedance data generation model according to the second impedance data and the third loss function is performed so that the output value of the third loss function tends to be minimum, including:
classifying the second countermeasure data based on the classification model to obtain fourth data;
and training the countermeasure data generation model according to the second original data, the second countermeasure data, the fourth data and the third loss function, so that the output value of the third loss function tends to be minimum.
The method comprises the steps of obtaining a large amount of original data and countermeasure data, forming a training sample set by the original data and the countermeasure data together, training the classification model based on the training sample set to obtain a classification model capable of correctly classifying the original data and the countermeasure data, and classifying target data to be classified based on the classification model subsequently.
The embodiment of the present disclosure provides another data classification method, in which an interference elimination model is obtained through training, and target data to be classified is processed based on the interference elimination model, so that interference in the target data can be eliminated, and the data after the interference elimination can be correctly classified by the classification model, which is specifically referred to in the following embodiments.
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 discriminant model according to an exemplary embodiment, as shown in fig. 2 and fig. 3, the data classification method is used in a processing device, where the processing device may be a terminal such as a mobile phone, a computer, a tablet computer, a smart television, 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 target data to be classified are acquired, the target data can be classified based on the classification model, and the category to which the target data belong is acquired. However, since the target data may be original data or countermeasure data, when the target data is countermeasure data, the countermeasure data includes interference, which may mislead the classification of the classification model, and cause the classification model to output an incorrect classification result with high confidence when classifying the target data.
In order to avoid the above problem, in the embodiment of the present disclosure, at least one piece of original data and corresponding countermeasure data are obtained 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 to obtain an interference cancellation model, where the interference cancellation model is used to perform interference cancellation processing on the data to cancel 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 obtained by adding interference to the original data, and the countermeasure data can mislead classification of the classification model, so that the classification model divides the original data and the countermeasure data into different categories, and therefore when training is performed based on the original data and the countermeasure data, the relationship between the original data and the countermeasure data can be learned, and the classification of the classification model can be correct after the interference in the countermeasure data is eliminated by the trained interference elimination model.
The processing device may be a terminal or a server, and if the processing device is a terminal, the raw data may be obtained by shooting by the terminal, or may be obtained by recording by the terminal, or may be downloaded from the internet by the terminal, or may be sent to the terminal by another device. If the processing device is a server, the raw data can be uploaded to the server by the terminal or uploaded to the server by other devices.
The embodiment of the present disclosure only takes the first original data and the first opposing data corresponding to the first original data as an example, and describes a training process of an interference cancellation model.
In a possible implementation manner, the processing device obtains first raw data and a trained countermeasure data generation model, processes the first raw data based on the countermeasure data generation model, and obtains first countermeasure data corresponding to the first raw data.
The countermeasure data generation model is used for generating first countermeasure data corresponding to the first original data, and the first countermeasure data is data obtained by adding interference to the first original data.
In step 202, the processing device performs interference cancellation processing on the first countermeasure data based on the interference cancellation model to obtain first data.
In a possible implementation manner, a current interference cancellation model is obtained, where the interference cancellation model may be an initialized interference cancellation model or an interference cancellation model obtained after one or more times of 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 obtained after the first countermeasure data is subjected to interference cancellation processing by the interference cancellation model.
In step 203, the processing device performs discrimination processing on the first raw data and the first data based on the discrimination model to obtain a discrimination result.
The training target of the interference elimination model is to keep the data obtained after the countermeasure data is processed by the interference elimination model consistent with the original data as much as possible. Thus, the processing device obtains a discriminant model for determining a difference between the first raw data and the first data. The first original data and the first data are judged based on the judgment model to obtain a judgment result, and the judgment result can represent the difference between the first original data and the first data, so that the interference elimination effect of the interference elimination model can be represented, and the interference elimination model can be trained based on the judgment result subsequently, and the interference elimination effect of the interference elimination model is improved.
The smaller the difference between the first original data and the first data is, the closer the first data is to the first original data is, i.e. the better the interference cancellation effect of the interference cancellation model is.
In one possible implementation manner, 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 difference between the first original data and the first data can be obtained by analyzing and processing according to the second data and the third data.
For example, if the discriminant model is used to classify data to obtain a category to which the data belongs, the second data may represent a category to which the first original data determined by the discriminant model belongs, and the third data may represent a category to which the first data determined by the discriminant model belongs. The closer the class to which the first original data belongs and the class to which the first data belongs, the smaller the difference between the second data and the third data is represented. And 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 raw 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. Wherein the discriminant model is used to determine a difference between the first data and the first raw data and a difference between the first data and the first countermeasure data. The discrimination result can indicate the magnitude of the difference between the first data and the first original data and can also indicate 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 is, the closer the first data is to the first original data is, and the better the interference cancellation effect of the interference cancellation model is. And the smaller the difference between the first data and the first countermeasure data is, the closer the first data is to the first countermeasure data is, 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 discrimination model according to the discrimination result to obtain the trained interference elimination model and the trained discrimination model. And the interference elimination model is provided with a first loss function, the discriminant 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 discriminant 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 also tends to be minimum, so as to ensure that the difference between the data subjected to the interference elimination processing by the interference elimination model and the corresponding original data tends to be minimum.
In a 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 penalty loss function that is:
Figure BDA0001931791330000121
the output value of the first loss function is determined according to the distance between the first countermeasure data and the first original data.
The second loss function is:
Figure BDA0001931791330000122
and 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 ladvIs a first loss function,/dIs a second loss function, N is the number of first original data, xiFor the ith first original data, the first data is,
Figure BDA0001931791330000123
for the ith first countermeasure data,
Figure BDA0001931791330000124
for the ith first data, DθD(xi) For the ith second data, the first data is the first data,
Figure BDA0001931791330000125
is the ith third data.
And performing one or more times of training according to the training target by adopting the training mode, so that when the trained interference model and the trained discrimination model perform interference elimination processing again and then perform discrimination processing, the output value of the first loss function obtained by calculation is smaller than the output value of the first loss function obtained by last calculation, and the output value of the second loss function obtained by calculation is smaller than the output value of the second loss function obtained by last calculation. So that the calculated output value of the first loss function tends to be minimum and the output value of the second loss function tends to be minimum. That is, the difference between the data after the interference elimination of the sample original data and the sample countermeasure data tends to be the minimum, and the difference between the data after the discrimination processing of the sample original data and the data after the interference elimination of the sample countermeasure data also tends to be the minimum, so that the sample countermeasure data obeys the distribution of the sample original data in a high-dimensional space, and the two 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 contrast data are images, the pixel value mean square error loss function is:
Figure BDA0001931791330000131
the spatial consistency loss function is:
Figure BDA0001931791330000132
wherein lmseAs a pixel mean square error loss function,/scFor the spatial consistency loss function, W is the width of the pixel in the first original data, H is the height of the pixel in the first original data, and xw,hIs a pixel point with width w and height h in the first original data, GθG(xadv)w,hThe pixel points are located in the first data corresponding to the first countermeasure data, and the pixel points are w in width and h in height.
When the first loss function includes a contrast loss function and a 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 performing weighted summation on the contrast loss function and the pixel value mean square error loss function.
When the first loss function includes a countermeasure loss function and a spatial consistency loss function, the first loss function may be obtained by summing the countermeasure loss function and the spatial consistency loss function, or may be obtained by weighting and summing the countermeasure loss function and the spatial consistency loss function.
When the first loss function includes a confrontation loss function, a pixel value mean square error loss function, and a spatial consistency loss function, the first loss function may be obtained by summing the confrontation loss function, the pixel value mean square error loss function, and the spatial consistency loss function, or may be obtained by weighting and summing the confrontation loss function, the pixel value mean square error loss function, and the spatial consistency loss function.
For example, after the countermeasure 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 following formula is adopted to determine the first loss function:
lape=ξ1lmse2ladv3lsc
wherein lapeIs a first loss function,/mseAs a loss function of the mean square error of the pixel values,/advTo combat the loss function,/scAs a function of spatial consistency loss, ξ1Weights corresponding to the mean square error loss function of the pixel values, ξ2To combat the corresponding weight of the loss function, ξ3Weights corresponding to the spatial consistency loss function, and ξ123=1。
In step 205, the processing device obtains first target data to be classified.
In the embodiment of the present disclosure, the processing device may classify data, divide the data into different categories, and then 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 may be obtained by shooting or recording by a processing device, or may be obtained by downloading from the internet, or may be obtained by transmitting to the processing device by another device. The first target data may be data in various formats such as pictures, audio or video. The acquired first target data to be classified can be 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 not including interference, or countermeasure data formed after the original data is interfered. Therefore, when the first target data is countermeasure data, the first target data includes interference that can affect the classification result when the first target data is classified based on the classification model. After the interference in the first target data is eliminated based on the interference elimination model, the obtained second target data is the data of the first target data after the interference elimination, and the influence of the interference can be eliminated, so that the subsequent classification model can correctly 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, the second target data not including 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.
And the processing equipment classifies the second target data subjected to the interference elimination processing by the interference elimination model based on the classification model, determines the class to which the second target data belongs, and takes the class as the class to which the first target data belongs. Because the second target data is the data subjected to interference elimination, accurate classification can be performed based on the classification model, and the determined class is the actual class 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 second target data based on the first target data has the advantages that the interference elimination processing is carried out on the first target data based on the interference elimination model to obtain the second target data, then the second target data is classified based on the classification model, the influence of interference possibly existing in the first target data can be eliminated, the classification model can be correctly classified, and the classification accuracy is improved.
Fig. 5 is a schematic diagram illustrating a test result based on an interference cancellation model and a discriminant model according to an exemplary embodiment, as shown in fig. 5, it can be seen from an observation that when the countermeasure data is classified directly based on the classification model, the classification model misclassifies the countermeasure data with a probability of 85.3%, so that the classification fails. And when the countermeasure data is processed by the interference elimination model and then classified based on the classification model, the classification model correctly classifies the countermeasure data with 93.5% probability, so that the classification is successful.
The embodiment is only described by taking the execution subject as the processing device, the processing device may be a device with a training function and a classification function, and the interference cancellation model may be trained, the interference cancellation process may be performed based on the interference cancellation model by executing the steps 201 and 207, and the classification process may be performed based on the classification model. Or, the processing device may include a training device and a classifying device, where the training device is configured to perform step 201 and step 204, train the interference cancellation model, and send the interference cancellation model to the classifying device, and the classifying device is configured to perform step 205 and step 207 based on the received interference cancellation model, so as to implement classification of the target data.
According to the method provided by the embodiment of the disclosure, the first original data and the corresponding first countermeasure data are obtained, the interference elimination processing is performed on the first countermeasure data based on the interference elimination model to obtain the first data, the discrimination processing is performed on the first original data and the first data based on the discrimination model to obtain the discrimination result, and the interference elimination model and the discrimination model are trained according to the discrimination result to obtain the trained interference elimination model. According to the embodiment of the invention, the accuracy of the trained interference elimination model can be improved by setting the interference elimination model, matching with the discrimination 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 carried out based on the interference elimination model, the interference existing in the first target data can be eliminated before classification, and then the second target data obtained after the interference elimination processing is classified based on the classification model, so that the data output by the interference elimination model can be correctly 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 the scenes of data classification, and the data can be pictures, audio or video. For example, in a scene where a user acquires a pet photograph, the interference cancellation processing is performed on the pet photograph, and the processed pet photograph is classified to determine the type of the pet in the pet photograph. Even if the pet photo carries interference, the pet photo can be processed through interference elimination processing, so that the interference in the pet photo is eliminated, and the pet can be correctly classified.
The embodiment of the disclosure further provides a method for training an interference cancellation model, which is different from the above embodiments in that, instead of directly obtaining countermeasure data corresponding to original data, a countermeasure data generation model is obtained by training first, countermeasure data corresponding to the original data is generated by the countermeasure data generation model, and the interference cancellation model is obtained by training based on the original data and the countermeasure data.
Fig. 6 is a flowchart illustrating an interference cancellation model training method according to an exemplary embodiment, as shown in fig. 6, for use in a processing device, the method including 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 obtained by training first, the countermeasure data of the original data is generated 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 present disclosure, the second raw data is taken as a sample raw data as an example, and a process of training the confrontation data generation model is described, so that the processing device first acquires the second raw data.
In step 602, the processing device processes the second original data based on the countermeasure data generation model to obtain second countermeasure data corresponding to the second original data.
The processing device firstly obtains a current countermeasure data generation model, the countermeasure data generation model may be an initialized countermeasure data generation model, or may be a countermeasure data generation model obtained after one or more training, and second original data is processed 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 impedance data generation model according to the second impedance data and the third loss function so that the output value of the third loss function tends to be minimum.
The countermeasure data generation model is provided with a third loss function, and the difference between the countermeasure data and the corresponding original data is positively correlated with the output value of the third loss function, so that when the countermeasure data generation model is trained, the training target is that the output value of the third loss function tends to be minimum on the basis of ensuring that the classification model divides the countermeasure data and the corresponding original data into different categories, so as to ensure that the countermeasure data generated based on the countermeasure data generation model and the corresponding original data belong to different categories, and the difference between the countermeasure data and the corresponding original data tends to be minimum, namely the contents of the countermeasure data and the corresponding original data are relatively similar.
Therefore, after the processing device acquires the second countermeasure data, a third loss function is acquired, calculation is performed according to the second countermeasure data and the third loss function to obtain an output value of the third loss function, and the countermeasure data generation model is trained according to the output value of the third loss function.
In a possible implementation manner, the third loss function includes a distance loss function and a classification loss function, wherein the smaller the output value of the distance loss function is, the smaller the difference between the countermeasure data and the original data is, and the larger the output value of the classification loss function is, the easier it is to divide the countermeasure data and the corresponding original data into two different categories when classification is performed based on the classification model, and the more powerful countermeasure data can be obtained. Therefore, on the basis of ensuring that the output value of the classification loss function is as large as possible, the output value of the distance loss function is made as small as possible, so that the output value of the third loss function tends to be minimal.
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, and an interference elimination model with a 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 and cannot be mutually corresponding, so that the subsequent classification result is influenced. Thus, the third loss function is essentially a competing harmonic between the classification loss function and the distance loss function.
In one possible implementation, the third loss function is:
Loss(θ,x,xadv,l)=ξ4lclassify(θ,xadv,l)+ξ5ldistance(θ,x,xadv)
wherein, Loss (theta, x)advL) is a third loss function, θ is a parameter of the third loss function, x is second raw data, xadvIs the second antagonizing data,/classify(θ,xadvL) the classification loss corresponding to the second antagonizing data, ldistance(θ,x,xadv) Is the distance loss between the second original data and the second antagonizing data, l is the class to which the second antagonizing data belongs ξ4For classification weight, ξ5Is a distance weight, and ξ45=1。
And performing one or more times of training according to the training target by adopting the training mode, so that when the trained confrontation data generation model obtains confrontation data based on another original data again, the output value of the third loss function obtained by calculation is smaller than the output value of the third loss function obtained by the last calculation. The calculated output value of the third loss function tends to be the minimum, i.e. the difference between the sample contrast data and the corresponding sample original data is the minimum.
In another possible implementation manner, whether the class to which the countermeasure data belongs and the class to which the original data belongs are the same class is judged based on the classification model, and the judgment 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 obtained, and based on the classification model, the second countermeasure data is classified to obtain fourth data, where the fourth data is used to describe characteristics of the second countermeasure data, and for example, the fourth data is represented by a category to which the second countermeasure data belongs, which is determined after classification based on the classification model.
The processing equipment obtains a third loss function, calculates according to the second original data, the second antagonistic data, the fourth data and the third loss function to obtain an output value of the third loss function, and trains an antagonistic data generation model according to the output value of the third loss function, wherein the third loss function is determined according to the distance between the second antagonistic data and the second original data and the fourth data.
The classification model is used to classify data, and may be the classification model used in the embodiment shown in fig. 2, or may be another classification model.
By adopting the training mode and performing one or more times of training according to the training target, when the trained confrontation 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 calculation at the last time, so that the output value of the third loss function tends to be the minimum, the trained confrontation data generation model is obtained, the confrontation data can be generated based on the confrontation data generation model subsequently, the classification model can be ensured to classify the confrontation data and the corresponding original data into different categories, and the difference between the confrontation data and the original data is the minimum.
In step 604, the processing device obtains first raw data, and processes the first raw data based on the trained confrontation data generation model to obtain first confrontation data corresponding to the first raw data.
After the training of the countermeasure data generation model is completed, in the process of acquiring data in step 201, first raw data is acquired, and the first raw data is processed based on the trained countermeasure data generation model, so that first countermeasure data which enables the classification model to be classified incorrectly and is similar to the first raw data as much as possible can be obtained.
In step 605, the processing device trains an interference cancellation model based on the first raw data and the first countermeasure data.
The specific steps of training to obtain the interference cancellation model based on the first raw data and the acquired first countermeasure data are shown in step 202 and step 204 in the above embodiment, and will not be described herein again.
The method for training the interference cancellation model provided by the embodiment of the disclosure includes processing acquired second original data based on a countermeasure data generation model to obtain second countermeasure data corresponding to the second original data, training the countermeasure data generation model according to the second countermeasure data and a third loss function so that an output value of the third loss function tends to be minimum, processing acquired first original data according to the sample generation model to obtain corresponding first countermeasure data, and obtaining the interference cancellation model according to the first original data and the first countermeasure data. The method has the advantages that the countermeasure data used for training the interference elimination model can be generated by learning the relation between the original data and the corresponding countermeasure data through the countermeasure data generation model, the interference elimination model with strong interference elimination capability can be obtained by learning the relation among the original data, the countermeasure data and the data of the countermeasure data after the interference elimination processing, the interference in the target data can be effectively eliminated, and the effect of correctly classifying the target data is achieved.
Fig. 7 is a block diagram illustrating a data sorting apparatus according to an example embodiment. Referring to fig. 7, the apparatus includes an object acquisition unit 701, a first elimination unit 702, and a classification unit 703.
A target acquisition unit 701 configured to acquire first target data to be classified;
a first eliminating unit 702, configured to perform interference elimination processing on the first target data based on an interference elimination model to obtain second target data, where the interference elimination model is used to eliminate interference in the first target data;
a classification unit 703 configured to perform classification processing on the second target data based on the classification model.
In one possible implementation manner, the apparatus further includes:
a first acquisition unit configured to acquire first original data and corresponding first countermeasure data;
the second elimination unit is configured to perform interference elimination processing on the first countermeasure data based on the interference elimination model to obtain first data;
the judging unit is configured to perform judging processing on the first original data and the first data based on a judging model to obtain a judging result, and 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 that the difference between the data processed by the interference elimination model and the corresponding original data tends to be minimum.
In another possible implementation manner, the determination result includes second data corresponding to the first original data and third data corresponding to the first data;
a training unit comprising:
a first training subunit configured to train the interference cancellation model based on the third data and the first loss function, and train the discriminant model based on the second data, the third data, and the second loss function such 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 penalty loss function that is:
Figure BDA0001931791330000191
the second loss function is:
Figure BDA0001931791330000192
wherein ladvIs a first loss function,/dIs a second loss function, N isNumber of first original data, xiFor the ith first original data, the first data is,
Figure BDA0001931791330000193
for the ith first countermeasure data,
Figure BDA0001931791330000194
for the ith first data, DθD(xi) For the ith second data, the first data is the first data,
Figure BDA0001931791330000195
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:
Figure BDA0001931791330000196
the spatial consistency loss function is:
Figure BDA0001931791330000197
wherein lmseAs a pixel mean square error loss function,/scFor the spatial consistency loss function, W is the width of the pixel in the first original data, H is the height of the pixel in the first original data, and xw,hIs a pixel point with width w and height h in the first original data, GθG(xadv)w,hThe pixel points are located in the first data corresponding to the first countermeasure data, and the pixel points are w in width and h in height.
In another possible implementation manner, the first obtaining unit includes:
a first acquisition subunit configured to acquire 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 generate a model based on the countermeasure data, and process the second original data to obtain second countermeasure data corresponding to the second original data;
a second training subunit configured to train the countermeasure data generation model so that an output value of the third loss function tends to be minimum, in accordance with the second countermeasure data and the third loss function.
In another possible implementation manner, 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 countermeasure data based on the classification model to obtain fourth data; and training the countermeasure data generation model according to the second original data, the second countermeasure data, the fourth data and the third loss function, so that the output value of the third loss function tends to be minimum.
With regard to the apparatus in the above-described embodiment, the specific manner in which each unit performs the operation has been described in detail in the embodiment related to 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 example embodiment. The terminal 800 is used for executing the steps executed by the processing device in the data classification method, and may be a portable mobile terminal, such as: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, motion video Experts compression standard Audio Layer 3), an MP4 player (Moving Picture Experts Group Audio Layer IV, motion video Experts compression standard Audio Layer 4), a notebook computer, or a desktop computer. The terminal 800 may also be referred to by other names such as user equipment, portable terminal, laptop terminal, desktop terminal, etc.
In general, the terminal 800 includes: a processor 801 and a memory 802.
The processor 801 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and so forth. The processor 801 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). The processor 801 may also include a main processor and a coprocessor, where the main processor is a processor for processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 801 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the display screen. In some embodiments, the processor 801 may further 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 method embodiments herein.
In some embodiments, the terminal 800 may further include: a peripheral interface 803 and at least one peripheral. The processor 801, memory 802 and peripheral interface 803 may be connected by bus or signal lines. Various peripheral devices may be connected to peripheral interface 803 by a bus, signal line, or circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 804, a touch screen display 805, a camera 806, an audio circuit 807, a positioning component 808, and a power supply 809.
The peripheral interface 803 may be used to connect at least one peripheral related to I/O (Input/Output) to the processor 801 and the memory 802. In some embodiments, the processor 801, memory 802, and peripheral interface 803 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 801, the memory 802, and the peripheral interface 803 may be implemented on separate chips or circuit boards, which are not limited by this embodiment.
The Radio Frequency circuit 804 is used for receiving and transmitting RF (Radio Frequency) signals, also called electromagnetic signals. The radio frequency circuitry 804 communicates with communication networks and other communication devices via electromagnetic signals. The rf circuit 804 converts an electrical signal into an electromagnetic signal to be transmitted, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 804 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and so forth. The radio frequency circuit 804 may communicate with other terminals via at least one wireless communication protocol. The wireless communication protocols include, but are not limited to: metropolitan area networks, various generation mobile communication networks (2G, 3G, 4G, and 13G), Wireless local area networks, and/or WiFi (Wireless Fidelity) networks. In some embodiments, the radio frequency circuit 804 may further include NFC (Near Field Communication) related circuits, which are 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 capture touch signals on or above the surface of the display 805. The touch signal may be input to the processor 801 as a control signal for processing. At this point, the display 805 may also be used to provide virtual buttons and/or a virtual keyboard, also referred to as soft buttons and/or a soft keyboard. In some embodiments, the display 805 may be one, providing the 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 further, the display 805 may be arranged in a non-rectangular irregular pattern, i.e., a shaped screen. The Display 805 can be made of LCD (liquid crystal Display), OLED (Organic Light-Emitting Diode), and the like.
The camera assembly 806 is used to capture images or video. Optionally, camera assembly 806 includes a front camera and a rear camera. Generally, a front camera is disposed at a front panel of the terminal, and a rear camera is disposed at a rear surface of the terminal. In some embodiments, the number of the rear cameras is at least two, and each rear camera is any one of a main camera, a depth-of-field camera, a wide-angle camera and a telephoto camera, so that the main camera and the depth-of-field camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize panoramic shooting and VR (Virtual Reality) shooting functions or other fusion shooting functions. In some embodiments, camera assembly 806 may also include a flash. The flash lamp can be a monochrome temperature flash lamp or a bicolor temperature flash lamp. The double-color-temperature flash lamp is a combination of a warm-light flash lamp and a cold-light flash lamp, and can be used for light compensation at different color temperatures.
The audio circuit 807 may include a microphone and a speaker. The microphone is used for collecting sound waves of a user and the environment, converting the sound waves into electric signals, and inputting the electric signals to the processor 801 for processing or inputting the electric signals to the radio frequency circuit 804 to realize voice communication. For the purpose of stereo sound collection or noise reduction, a plurality of microphones may be provided at different portions of the terminal 800. The microphone may also be an array microphone or an omni-directional pick-up microphone. The speaker is used to convert electrical signals from the processor 801 or the radio frequency circuit 804 into sound waves. The loudspeaker can be a traditional film loudspeaker or a piezoelectric ceramic loudspeaker. When the speaker is a piezoelectric ceramic speaker, the speaker can be used for purposes such as converting an electric signal into a sound wave audible to a human being, or converting an electric signal into a sound wave inaudible to a human being to measure a distance. In some embodiments, the audio circuitry 807 may also include a headphone jack.
The positioning component 808 is used to locate the current geographic position of the terminal 800 for navigation or LBS (location based Service). The positioning component 808 may be a positioning component based on the GPS (global positioning System) in the united states, the beidou System in china, the graves System in russia, or the galileo System in the european union.
Power supply 809 is used to provide power to various components in terminal 800. The power supply 809 can be ac, dc, disposable or rechargeable. When the power source 809 comprises 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, terminal 800 also includes one or more sensors 810. The one or more sensors 810 include, but are not limited to: acceleration sensor 811, gyro sensor 812, pressure sensor 813, fingerprint sensor 814, optical sensor 815 and proximity sensor 816.
The acceleration sensor 811 may detect the magnitude of acceleration in three coordinate axes of the coordinate system established with the terminal 800. For example, the acceleration sensor 811 may be used to detect the components of the gravitational acceleration in three coordinate axes. The processor 801 may control the touch screen 805 to display the user interface in a landscape view or a portrait view according to the gravitational acceleration signal collected by the acceleration sensor 811. The acceleration sensor 811 may also be used for acquisition of motion data of a game or a user.
The gyro sensor 812 may detect a body direction and a rotation angle of the terminal 800, and the gyro sensor 812 may cooperate with the acceleration sensor 811 to acquire a 3D motion of the user with respect to the terminal 800. From the data collected by the gyro sensor 812, the processor 801 may implement the following functions: motion sensing (such as changing the UI according to a user's tilting operation), image stabilization at the time of photographing, game control, and inertial navigation.
Pressure sensors 813 may be disposed on the side bezel of terminal 800 and/or underneath touch display 805. When the pressure sensor 813 is disposed on the side frame of the terminal 800, the holding signal of the user to the terminal 800 can be detected, and the processor 801 performs left-right hand recognition or shortcut operation according to the holding signal collected by the pressure sensor 813. When the pressure sensor 813 is disposed at a 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 control comprises at least one of a button control, a scroll bar control, an icon control and a menu control.
The fingerprint sensor 814 is used for collecting a fingerprint of the user, and the processor 801 identifies the identity of the user according to the fingerprint collected by the fingerprint sensor 814, or the fingerprint sensor 814 identifies the identity of the user according to the collected fingerprint. Upon identifying 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. Fingerprint sensor 814 may be disposed on the front, back, or side of terminal 800. When a physical button or a vendor Logo is provided on the terminal 800, the fingerprint sensor 814 may be integrated with the physical button or the 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 screen 805 based on the ambient light intensity collected by the optical sensor 815. Specifically, when the ambient light intensity is high, the display brightness of the touch display screen 805 is increased; when the ambient light intensity is low, the display brightness of the touch display 805 is turned down. In another embodiment, the processor 801 may also dynamically adjust the shooting parameters of the camera assembly 806 based on the ambient light intensity collected by the optical sensor 815.
A proximity sensor 816, also known 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 surface of the terminal 800. In one embodiment, when the proximity sensor 816 detects that the distance between the user and the front surface of the terminal 800 gradually decreases, the processor 801 controls the touch display 805 to switch from the bright screen state to the dark screen state; when the proximity sensor 816 detects that the distance between the user and the front surface of the terminal 800 becomes gradually larger, the processor 801 controls the touch display 805 to switch from the screen-on state to the screen-on state.
Those skilled in the art will appreciate that the configuration shown in fig. 8 is not intended to be limiting of terminal 800 and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components may be used.
Fig. 9 is a schematic structural diagram of a server according to an exemplary embodiment, where the server 900 may generate a relatively large difference due to different configurations or performances, and may include one or more processors (CPUs) 901 and one or more memories 902, where the memory 902 stores at least one instruction, and the at least one instruction is loaded and executed by the processors 901 to implement the methods provided by the above method embodiments. Of course, the server may also have components such as a wired or wireless network interface, a keyboard, and an input/output interface, so as to perform input/output, and the server may also include other components for implementing the functions of the device, which are not described herein again.
The server 900 may be used 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 having instructions therein, which when executed by a processor of a processing device, enable the processing device to perform a method of data classification, 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, instructions of which, when executed by a processor of a processing device, enable the processing device to perform a method of data classification, 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 variations, 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 will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A method of data classification, 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.
2. The method of claim 1, further comprising:
acquiring first original data and corresponding first countermeasure data;
based on the interference elimination model, carrying out interference elimination processing on the first countermeasure data to obtain first data;
performing discrimination processing on the first original 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 training the interference elimination model and the discrimination model according to the discrimination result so as to lead the difference between the data processed by the interference elimination model and the corresponding original data to tend to be minimum.
3. The method according to claim 2, wherein the discrimination result includes second data corresponding to the first original data and third data corresponding to the first data;
the 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 by the discrimination model includes:
and training the interference elimination model according to the third data and the first loss function, and training 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.
4. The method of claim 3, wherein the first loss function comprises a penalty loss function, the penalty loss function being:
Figure FDA0001931791320000011
the second loss function is:
Figure FDA0001931791320000021
wherein ladvIs said first loss function,/dIs the second loss function, N is the number of the first original data, xiFor the ith first original data, the first data is,
Figure FDA0001931791320000022
for the ith first countermeasure data,
Figure FDA0001931791320000023
for the ith first data, DθD(xi) For the ith second data, the first data is the first data,
Figure FDA0001931791320000024
is the ith third data.
5. The method of claim 2, wherein the obtaining first raw data and corresponding first countermeasure data comprises:
acquiring the first original data;
and processing the first original data based on a countermeasure data generation model to obtain first countermeasure data corresponding to the first original data.
6. The method of claim 5, further comprising:
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;
and training the countermeasure data generation model 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.
7. The method of claim 6, wherein the third loss function comprises a distance loss function and a classification loss function, and wherein training the challenge data generation model according to the second and third challenge data and the third loss function to minimize an output value of the third loss function comprises:
classifying the second countermeasure data based on the classification model to obtain fourth data;
and training the countermeasure data generation model according to the second original data, the second countermeasure data, the fourth data and the third loss function, so that the output value of the third loss function tends to be minimum.
8. An apparatus for classifying data, the apparatus comprising:
a target acquisition unit configured to acquire first target data to be classified;
a first eliminating unit, configured to perform interference elimination processing on the first target data based on an interference elimination model, so as to obtain second target data, where the interference elimination model is used to eliminate interference in the first target data;
a classification unit configured to perform classification processing on the second target data based on a classification model.
9. A processing device for data classification, characterized in that the processing device comprises:
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.
10. A non-transitory computer readable storage medium having instructions therein which, when executed by a processor of a processing device, enable the processing device to perform a method of data classification, 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.
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 true CN111382771A (en) 2020-07-07
CN111382771B 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 (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160211882A1 (en) * 2015-01-20 2016-07-21 Qualcomm Incorporated Switched, simultaneous and cascaded interference cancellation
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

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160211882A1 (en) * 2015-01-20 2016-07-21 Qualcomm Incorporated Switched, simultaneous and cascaded interference cancellation
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
CN111382771B (en) 2024-03-15

Similar Documents

Publication Publication Date Title
CN109522426B (en) Multimedia data recommendation method, device, equipment and computer readable storage medium
CN109815150B (en) Application testing method and device, electronic equipment and storage medium
CN109558837B (en) Face key point detection method, device and storage medium
CN109522863B (en) Ear key point detection method and device and storage medium
CN110992493A (en) Image processing method, image processing device, electronic equipment and storage medium
CN110650379B (en) Video abstract generation method and device, electronic equipment and storage medium
CN111127509B (en) Target tracking method, apparatus and computer readable storage medium
CN109360222B (en) Image segmentation method, device and storage medium
CN109886208B (en) Object detection method and device, computer equipment and storage medium
CN110933468A (en) Playing method, playing device, electronic equipment and medium
US11386586B2 (en) Method and electronic device for adding virtual item
CN113763228A (en) Image processing method, image processing device, electronic equipment and storage medium
CN111753606A (en) Intelligent model upgrading method and device
CN111488895B (en) Countermeasure data generation method, device, equipment and storage medium
CN111982293B (en) Body temperature measuring method and device, electronic equipment and storage medium
CN113709353B (en) Image acquisition method and device
CN111757146B (en) Method, system and storage medium for video splicing
CN110263695B (en) Face position acquisition method and device, electronic equipment and storage medium
CN111723615B (en) Method and device for judging matching of detected objects in detected object image
CN110443841B (en) Method, device and system for measuring ground depth
CN111382771B (en) Data classification method, device, equipment and storage medium
CN112990424A (en) Method and device for training neural network model
CN114093020A (en) Motion capture method, motion capture device, electronic device and storage medium
CN112308104A (en) Abnormity identification method and device and computer storage medium
CN111127539A (en) Parallax determination method and device, computer equipment 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