WO2022012668A1 - 一种训练集处理方法和装置 - Google Patents
一种训练集处理方法和装置 Download PDFInfo
- Publication number
- WO2022012668A1 WO2022012668A1 PCT/CN2021/106758 CN2021106758W WO2022012668A1 WO 2022012668 A1 WO2022012668 A1 WO 2022012668A1 CN 2021106758 W CN2021106758 W CN 2021106758W WO 2022012668 A1 WO2022012668 A1 WO 2022012668A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- training set
- basis
- encoded data
- discrete
- neural network
- 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.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/214—Generating training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/213—Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods
- G06F18/2135—Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods based on approximation criteria, e.g. principal component analysis
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/213—Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods
- G06F18/2136—Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods based on sparsity criteria, e.g. with an overcomplete basis
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N7/00—Computing arrangements based on specific mathematical models
Definitions
- the present application relates to the field of artificial intelligence, and in particular, to a training set processing method and apparatus.
- neural networks In the field of artificial intelligence, neural networks have made a series of breakthroughs in computer vision, natural language processing, network security and other tasks in recent years, showing new possibilities in the age of intelligence.
- neural networks generally suffer from an unexplained vulnerability to adversarial examples, which may be tricked into giving false results by very small but carefully designed noises added to their input data. Such carefully constructed examples are called for adversarial samples.
- the present application provides a training set processing method for training a neural network by extracting the principal components of the training set, so that more robust features can be used to train the neural network, so that the output accuracy of the neural network is not reduced on the basis of , to improve the robustness of the resulting neural network.
- the present application provides a training set processing method, including: first, decomposing according to the first training set to obtain a basis of the first training set and a discrete sequence of the basis, the first training set includes Multiple samples, the basis of the first training set can be understood as a space composed of data in multiple directions, the basis includes at least one basis vector, and the discrete sequence includes discrete values that correspond to each basis vector in the basis one-to-one, The discrete sequence can be used to represent the discrete degree of the basis; then, the component value of each sample in the first training set on each basis vector is obtained, and multiple sets of first encoded data are obtained, wherein each set of first encoded data corresponds to one Sample, each sample has a component value in each base vector, each base vector included in the first encoded data corresponds to a component, and the components included in the first encoded data are in one-to-one correspondence with at least one base vector; The principal components in each set of first coded data in the set of first coded data, to obtain multiple
- the second encoded data with reduced interference is obtained, and a new sample can be obtained according to the second encoded data , and use the new samples for neural network training.
- the new sample reduces the interference of other components except the main component, so that the neural network obtained by training can be trained by the main component, and the robustness of the neural network is improved.
- the data set processing method provided by this application is processed for the training set, and the processing method is only related to the distribution of the principal components of the training set itself. Therefore, even if different models are trained in different scenarios, this application can be used.
- the provided training set processing method processes the training set, has strong generalization ability, and does not depend on the general algorithm of the trained model, so it has high versatility.
- obtaining the basis of the first training set and the discrete sequence of the basis according to the first training set may include: performing principal component analysis (PCA) on the first training set process to obtain the orthonormal basis and the discrete sequence of the orthonormal basis.
- PCA principal component analysis
- the first training set there are various ways to decompose the first training set, such as PCA processing or sparse coding, etc., to decompose the first training set, so as to obtain the basis and discrete sequence of the first training set, and then obtain the first training set.
- decompose the first training set such as PCA processing or sparse coding, etc.
- performing PCA processing on the first training set to obtain the orthonormal basis and the discrete sequence of the orthonormal basis may include: performing central processing on the first training set to obtain the centralised first training set. Training set, the mean value of the data included in the first training set after centralization is 0; PCA processing is performed on the first training set after centralization to obtain the orthonormal basis and the discrete sequence of the orthonormal basis, and the discrete sequence includes the centralization
- the sequence of variances in the orthonormal basis after the first training set is arranged in decreasing order, and the variances included in the discrete sequence are in one-to-one correspondence with the basis vectors in the orthonormal basis.
- the first training set can be centrally processed to obtain a centralized first training set, and then PCA processing can be performed on the centralized training set, so as to complete the rapid analysis of the first training set, Obtain orthonormal basis and discrete sequence of orthonormal basis.
- acquiring the component value of each sample in the first training set in the basis may include: using a preset algorithm, calculating the orthonormal basis of each sample in the first training set after centralization The component values on each base vector in , obtain multiple sets of first encoded data.
- the component value of each sample on each basis vector can be calculated based on the orthonormal basis after PCA processing, thereby obtaining the first encoded data.
- the preset algorithm includes an inner product operation or a sparse coding operation.
- the component value of each sample on each basis vector can be calculated through the inner product operation or the sparse coding operation, so as to realize the projection of each sample on each basis vector.
- acquiring principal components in each group of first encoded data to obtain multiple groups of second encoded data may include: retaining principal components in each group of first encoded data, and encoding each group of first encoded data Other components in the data except the principal component are replaced with preset values to obtain multiple sets of second coded data, wherein the principal components of each set of first coded data constitute at least one set of second coded data.
- other components except the main component in each group of first encoded data can be replaced with preset values, so that the components of each group of first encoded data can form one or more groups of second encoded data .
- the preset value includes 0 or a preset noise vector
- the preset noise vector includes Gaussian noise or uniformly distributed noise.
- values other than the principal component in the first encoded data can be replaced with 0 or a preset noise vector, thereby obtaining one or more sets of second encoded data, so as to reduce the number of The influence of values other than principal components in each sample on the training of the neural network improves the robustness of the resulting neural network.
- the preset noise vector is proportional to the discrete value of the transposed component. Therefore, in the embodiment of the present application, the distribution of the replaced noise vector is similar to that of the original data in the first encoded data. On the basis of reducing the influence of the values other than the principal components in each sample on the training of the neural network, The interference to the training of the neural network is reduced, and the resulting output of the neural network is more accurate.
- the present application provides a training set processing device, including:
- a decomposition unit configured to obtain a basis of the first training set and a discrete sequence of the basis according to the first training set, the first training set includes a plurality of samples, the basis includes at least one basis vector, and the degree of discreteness includes and each of the basis The discrete value corresponding to the basis vector one-to-one, and the discrete sequence is used to represent the discrete degree of the basis;
- an acquisition unit used for acquiring the component value of each sample in the first training set in the base, and obtaining multiple groups of first encoded data, each group of first encoded data corresponding to one sample;
- the obtaining unit is further configured to obtain the principal component in each group of first encoded data in the multiple groups of first encoded data, and obtain multiple groups of second encoded data, and the discrete value of the principal component is higher than the preset discrete value;
- the mapping unit is used to map multiple sets of second encoded data to the base of the first training set, and obtain samples corresponding to multiple sets of second encoded data, and the samples corresponding to multiple sets of second encoded data form a second training set.
- Sets are used to train neural networks.
- the basis is an orthonormal basis
- the decomposition unit is specifically configured to perform principal component analysis PCA processing on the first training set to obtain an orthonormal basis and a discrete sequence of orthonormal basis.
- the decomposition unit is specifically configured to: perform centralized processing on the first training set to obtain a centralized first training set, and the average value of the data included in the centralized first training set is 0; perform PCA processing on the first training set after centralization to obtain an orthonormal basis and a discrete sequence of the orthonormal basis, and the discrete sequence includes a sequence composed of the variance of the first training set after centralization in the orthonormal basis.
- the decomposition unit is specifically configured to calculate, through a preset algorithm, the component value of each sample in the first centralized training set on each basis vector in the orthonormal basis, to obtain a A set of first encoded data.
- the preset algorithm includes an inner product operation or a sparse coding operation.
- the obtaining unit is specifically configured to retain the principal components in each group of first encoded data, and replace other components except the principal components in each group of first encoded data with preset values, to obtain A plurality of sets of second coded data, wherein the principal components of each set of first coded data constitute at least one set of second coded data.
- the preset value includes 0 or a preset noise vector
- the preset noise vector includes Gaussian noise or uniformly distributed noise.
- the preset noise vector is proportional to the discrete value of the component being replaced.
- an embodiment of the present application provides a training set processing apparatus, and the training set processing apparatus has the function of implementing the training set processing method of the first aspect.
- This function can be implemented by hardware or by executing corresponding software by hardware.
- the hardware or software includes one or more modules corresponding to the above functions.
- an embodiment of the present application provides a training set processing apparatus, including: a processor and a memory, wherein the processor and the memory are interconnected through a line, and the processor invokes program codes in the memory to execute any one of the above-mentioned first aspects
- the processing-related functions in the training set processing method shown in item may be a chip.
- an embodiment of the present application provides a training set processing device.
- the training set processing device may also be referred to as a digital processing chip or a chip.
- the chip includes a processing unit and a communication interface.
- the processing unit obtains program instructions through the communication interface.
- the instructions are executed by a processing unit, and the processing unit is configured to perform processing-related functions as in the first aspect or any of the optional embodiments of the first aspect.
- an embodiment of the present application provides a computer-readable storage medium, including instructions, which, when executed on a computer, cause the computer to execute the method in the first aspect or any optional implementation manner of the first aspect.
- an embodiment of the present application provides a computer program product including instructions, which, when run on a computer, enables the computer to execute the method in the first aspect or any optional implementation manner of the first aspect.
- Fig. 1 is a kind of artificial intelligence main frame schematic diagram applied in this application
- FIG. 2 is a schematic diagram of a system architecture provided by the present application.
- FIG. 3 is a schematic structural diagram of a convolutional neural network provided by an embodiment of the present application.
- FIG. 4 is a schematic structural diagram of another convolutional neural network provided by an embodiment of the present application.
- FIG. 6 is a schematic flowchart of a training set processing method provided by an embodiment of the present application.
- FIG. 7 is a schematic diagram of an adversarial sample provided by an embodiment of the present application.
- FIG. 8 is a schematic structural diagram of a training set processing apparatus provided by the present application.
- FIG. 9 is another schematic structural diagram of a training set processing apparatus provided by the present application.
- FIG. 10 is a schematic structural diagram of a chip according to an embodiment of the present application.
- AI artificial intelligence
- AI is a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
- artificial intelligence is a branch of computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that responds in a similar way to human intelligence.
- Artificial intelligence is to study the design principles and implementation methods of various intelligent machines, so that the machines have the functions of perception, reasoning and decision-making.
- Research in the field of artificial intelligence includes robotics, natural language processing, computer vision, decision-making and reasoning, human-computer interaction, recommendation and search, and basic AI theory.
- Figure 1 shows a schematic diagram of an artificial intelligence main frame, which describes the overall workflow of an artificial intelligence system and is suitable for general artificial intelligence field requirements.
- the "intelligent information chain” reflects a series of processes from data acquisition to processing. For example, it can be the general process of intelligent information perception, intelligent information representation and formation, intelligent reasoning, intelligent decision-making, intelligent execution and output. In this process, data has gone through the process of "data-information-knowledge-wisdom".
- the "IT value chain” reflects the value brought by artificial intelligence to the information technology industry from the underlying infrastructure of human intelligence, information (providing and processing technology implementation) to the industrial ecological process of the system.
- the infrastructure provides computing power support for artificial intelligence systems, realizes communication with the outside world, and supports through the basic platform. Communicate with the outside through sensors; computing power is provided by intelligent chips, such as central processing unit (CPU), network processor (neural-network processing unit, NPU), graphics processor (English: graphics processing unit, GPU), Application specific integrated circuit (ASIC) or field programmable gate array (field programmable gate array, FPGA) and other hardware acceleration chips) are provided; the basic platform includes distributed computing framework and network related platform guarantee and support, It can include cloud storage and computing, interconnection networks, etc. For example, sensors communicate with external parties to obtain data, and these data are provided to the intelligent chips in the distributed computing system provided by the basic platform for calculation.
- intelligent chips such as central processing unit (CPU), network processor (neural-network processing unit, NPU), graphics processor (English: graphics processing unit, GPU), Application specific integrated circuit (ASIC) or field programmable gate array (field programmable gate array, FPGA) and other hardware acceleration chips
- CPU central processing unit
- the data on the upper layer of the infrastructure is used to represent the data sources in the field of artificial intelligence.
- the data involves graphics, images, voice, video, and text, as well as IoT data of traditional devices, including business data of existing systems and sensory data such as force, displacement, liquid level, temperature, and humidity.
- Data processing usually includes data training, machine learning, deep learning, search, reasoning, decision-making, etc.
- machine learning and deep learning can perform symbolic and formalized intelligent information modeling, extraction, preprocessing, training, etc. on data.
- Reasoning refers to the process of simulating human's intelligent reasoning method in a computer or intelligent system, using formalized information to carry out machine thinking and solving problems according to the reasoning control strategy, and the typical function is search and matching.
- Decision-making refers to the process of making decisions after intelligent information is reasoned, usually providing functions such as classification, sorting, and prediction.
- some general capabilities can be formed based on the results of data processing, such as algorithms or a general system, such as translation, text analysis, computer vision processing (such as image recognition, object detection, etc.), speech recognition, etc.
- algorithms or a general system such as translation, text analysis, computer vision processing (such as image recognition, object detection, etc.), speech recognition, etc.
- Intelligent products and industry applications refer to the products and applications of artificial intelligence systems in various fields. They are the encapsulation of the overall artificial intelligence solution, and the productization of intelligent information decision-making and implementation of applications. Its application areas mainly include: intelligent manufacturing, intelligent transportation, Smart home, smart medical care, smart security, autonomous driving, safe city, smart terminals, etc.
- an embodiment of the present application provides a system architecture 200 .
- the system architecture includes a database 230 and a client device 240 .
- the data collection device 260 is used to collect data and store it in the database 230 , and the training module 211 generates the target model/rule 201 based on the data maintained in the database 230 .
- the following will describe in more detail how the training module 211 obtains the target model/rule 201 based on the data.
- the target model/rule 201 is the neural network constructed in the following embodiments of the present application. For details, please refer to the relevant description of FIG. 6 below.
- the computing module may include a training module 211, and the target model/rule obtained by the training module 211 may be applied to different systems or devices.
- the execution device 210 configures a transceiver 212, which can be a wireless transceiver, an optical transceiver, or a wired interface (such as an I/O interface), etc., to perform data interaction with external devices, and a "user" can
- the client device 240 inputs data to the transceiver 212.
- the client device 240 can send target tasks to the execution device 210, request the execution device to build a neural network, and send the execution device 210 a database for training.
- the execution device 210 can call data, codes, etc. in the data storage system 250 , and can also store data, instructions, etc. in the data storage system 250 .
- the calculation module 211 uses the target model/rule 201 to process the input data. Specifically, the computing module 211 is used to: first, obtain a first training set, which includes a plurality of samples; then, obtain a basis of the first training set and a discrete sequence of The set includes multiple samples, the base includes at least one basis vector, and the discrete sequence includes discrete values that correspond one-to-one with each basis vector in the base, and the discrete sequence can be used to represent the discrete degree of the base;
- the samples corresponding to the second set of encoded data form a second
- transceiver 212 returns the constructed neural network to client device 240 to deploy the neural network in client device 240 or other devices.
- the training module 211 can obtain corresponding target models/rules 201 based on different data for different tasks, so as to provide users with better results.
- the data input into the execution device 210 can be determined according to the input data of the user, for example, the user can operate in the interface provided by the transceiver 212 .
- the client device 240 can automatically input data to the transceiver 212 and obtain the result. If the client device 240 automatically inputs data and needs to obtain the authorization of the user, the user can set the corresponding permission in the client device 240 .
- the user can view the result output by the execution device 210 on the client device 240, and the specific presentation form can be a specific manner such as display, sound, and action.
- the client device 240 can also act as a data collection end to store the collected data associated with the target task into the database 230 .
- FIG. 2 is only an exemplary schematic diagram of a system architecture provided by an embodiment of the present application, and the positional relationship among the devices, devices, modules, etc. shown in the figure does not constitute any limitation.
- the data storage system 250 is an external memory relative to the execution device 210 . In other scenarios, the data storage system 250 may also be placed in the execution device 210 .
- the training or updating process mentioned in this application may be performed by the training module 211 .
- the training process of the neural network is to learn the way to control the spatial transformation, and more specifically, to learn the weight matrix.
- the purpose of training a neural network is to make the output of the neural network as close to the expected value as possible, so you can compare the predicted value and expected value of the current network, and then update the weight of each layer of the neural network in the neural network according to the difference between the two. vector (of course, the weight vector can usually be initialized before the first update, that is, the parameters are pre-configured for each layer in the deep neural network).
- the value of the weight in the weight matrix is adjusted to reduce the predicted value, and after continuous adjustment, the value output by the neural network is close to or equal to the expected value.
- the difference between the predicted value and the expected value of the neural network can be measured by a loss function or an objective function. Taking the loss function as an example, the higher the output value of the loss function (loss), the greater the difference.
- the training of the neural network can be understood as the process of reducing the loss as much as possible. For the process of updating the weight of the starting point network and training the serial network in the following embodiments of the present application, reference may be made to this process, which will not be repeated below.
- the neural network mentioned in this application may include various types, such as deep neural network (DNN), convolutional neural network (CNN), recurrent neural network (RNN) or residual network other neural networks, etc.
- DNN deep neural network
- CNN convolutional neural network
- RNN recurrent neural network
- residual network other neural networks etc.
- CNN is taken as an example below.
- CNN is a deep neural network with a convolutional structure.
- CNN is a deep learning architecture, which refers to multiple levels of learning at different levels of abstraction through machine learning algorithms.
- a CNN is a feed-forward artificial neural network in which each neuron responds to overlapping regions in images fed into it.
- a convolutional neural network consists of a feature extractor consisting of convolutional and subsampling layers.
- the feature extractor can be viewed as a filter, and the convolution process can be viewed as convolution with an input image or a convolutional feature map using a trainable filter.
- the convolutional layer refers to the neuron layer in the convolutional neural network that convolves the input signal.
- a convolutional layer of a convolutional neural network a neuron can only be connected to some of its neighbors.
- a convolutional layer usually contains several feature planes, and each feature plane can be composed of some neural units arranged in a rectangle. Neural units in the same feature plane share weights, and the shared weights here are convolution kernels. Shared weights can be understood as the way to extract image information is independent of location. The underlying principle is that the statistics of one part of the image are the same as the other parts. This means that image information learned in one part can also be used in another part. So for all positions on the image, we can use the same learned image information. In the same convolution layer, multiple convolution kernels can be used to extract different image information. Generally, the more convolution kernels, the richer the image information reflected by the convolution operation.
- the convolution kernel can be initialized in the form of a matrix of random size, and the convolution kernel can obtain reasonable weights by learning during the training process of the convolutional neural network.
- the immediate benefit of sharing weights is to reduce the connections between the layers of the convolutional neural network, while reducing the risk of overfitting.
- the convolutional neural network can use the error back propagation (BP) algorithm to correct the size of the parameters in the initial super-resolution model during the training process, so that the reconstruction error loss of the super-resolution model becomes smaller and smaller. Specifically, forwarding the input signal until the output will generate an error loss, and updating the parameters in the initial super-resolution model by back-propagating the error loss information, so that the error loss converges.
- the back-propagation algorithm is a back-propagation motion dominated by the error loss, aiming to obtain the parameters of the optimal super-resolution model, such as the weight matrix.
- a convolutional neural network (CNN) 100 may include an input layer 110 , a convolutional/pooling layer 120 , where the pooling layer is optional, and a neural network layer 130 .
- the convolutional/pooling layer 120 may include layers 121-126 as examples.
- layer 121 is a convolutional layer
- layer 122 is a pooling layer
- layer 123 is a convolutional layer
- layer 124 is a convolutional layer.
- Layers are pooling layers
- 125 are convolutional layers
- 126 are pooling layers; in another implementation, 121 and 122 are convolutional layers, 123 are pooling layers, 124 and 125 are convolutional layers, and 126 are pooling layer. That is, the output of a convolutional layer can be used as the input of a subsequent pooling layer, or it can be used as the input of another convolutional layer to continue the convolution operation.
- the convolution layer 121 may include many convolution operators, which are also called kernels, and their role in image processing is equivalent to a filter that extracts specific information from the input image matrix.
- the convolution operator can essentially be a weight matrix, which is usually pre-defined. During a convolution operation on an image, the weight matrix is usually performed one pixel by one pixel (or two pixels by two pixels...depending on the value of stride) in the horizontal direction on the input image. processing to complete the work of extracting specific features from an image.
- the size of this weight matrix should be related to the size of the image. It should be noted that the depth dimension of the weight matrix is the same as the depth dimension of the input image.
- the weight matrix will extend to the entire depth of the input image. Therefore, convolution with a single weight matrix will produce a single depth dimension of the convolutional output, but in most cases a single weight matrix is not used, but multiple weight matrices of the same dimension are applied.
- the output of each weight matrix is stacked to form the depth dimension of the convolutional image.
- Different weight matrices can be used to extract different features in the image. For example, one weight matrix is used to extract image edge information, another weight matrix is used to extract specific colors of the image, and another weight matrix is used to extract unwanted noise in the image. Blur, etc.
- the multiple weight matrices have the same dimension, and the feature maps extracted from the multiple weight matrices with the same dimension have the same dimension, and then the multiple extracted feature maps with the same dimension are combined to form the output of the convolution operation.
- the weight values in the weight matrix need to be obtained through a lot of training in practical applications, and each weight matrix formed by the weight values obtained by training can extract information from the input image, thereby helping the convolutional neural network 100 to make correct predictions.
- the initial convolutional layer eg 121
- the features extracted by the later convolutional layers become more and more complex, such as features such as high-level semantics.
- features with higher semantics are more suitable for the problem to be solved.
- pooling layer after the convolutional layer, that is, each layer 121-126 exemplified by 120 in Figure 3, which can be a convolutional layer followed by a layer
- the pooling layer can also be a multi-layer convolutional layer followed by one or more pooling layers.
- the pooling layer may include an average pooling operator and/or a max pooling operator for sampling the input image to obtain a smaller size image.
- the average pooling operator can calculate the average value of the pixel values in the image within a certain range.
- the max pooling operator can take the pixel with the largest value within a specific range as the result of max pooling. Also, just as the size of the weight matrix used in the convolutional layer should be related to the size of the image, the operators in the pooling layer should also be related to the size of the image.
- the size of the output image after processing by the pooling layer can be smaller than the size of the image input to the pooling layer, and each pixel in the image output by the pooling layer represents the average or maximum value of the corresponding sub-region of the image input to the pooling layer.
- the convolutional neural network 100 After being processed by the convolutional layer/pooling layer 120, the convolutional neural network 100 is not sufficient to output the required output information. Because as mentioned before, the convolutional layer/pooling layer 120 only extracts features and reduces the parameters brought by the input image. However, in order to generate the final output information (required class information or other related information), the convolutional neural network 100 needs to utilize the neural network layer 130 to generate one or a set of outputs of the required number of classes. Therefore, the neural network layer 130 may include multiple hidden layers (131, 132 to 13n as shown in FIG. 3) and an output layer 140. In this application, the convolutional neural network is obtained by deforming the selected starting point network at least once to obtain a serial network, and then obtaining it according to the trained serial network. This convolutional neural network can be used for image recognition, image classification, image super-resolution reconstruction, and more.
- the output layer 140 After the multi-layer hidden layers in the neural network layer 130, that is, the last layer of the entire convolutional neural network 100 is the output layer 140, the output layer 140 has a loss function similar to the classification cross entropy, and is specifically used to calculate the prediction error, Once the forward propagation of the entire convolutional neural network 100 (as shown in Fig. 3 from 110 to 140 is forward propagation) is completed, the back propagation (as shown in Fig. 3 from 140 to 110 as back propagation) will start to update The weight values and biases of the aforementioned layers are used to reduce the loss of the convolutional neural network 100 and the error between the result output by the convolutional neural network 100 through the output layer and the ideal result.
- the convolutional neural network 100 shown in FIG. 3 is only used as an example of a convolutional neural network.
- the convolutional neural network can also exist in the form of other network models, for example, such as The multiple convolutional layers/pooling layers shown in FIG. 4 are in parallel, and the extracted features are input to the full neural network layer 130 for processing.
- an embodiment of the present application further provides a system architecture 300 .
- the execution device 210 is implemented by one or more servers, and optionally, cooperates with other computing devices, such as: data storage, routers, load balancers and other devices; the execution device 210 can be arranged on a physical site, or distributed in multiple on the physical site.
- the execution device 210 can use the data in the data storage system 250, or call the program code in the data storage system 250 to implement the steps of the training set processing method corresponding to FIG. 6 below in this application.
- a user may operate respective user devices (eg, local device 301 and local device 302 ) to interact with execution device 210 .
- Each local device may represent any computing device, such as a personal computer, computer workstation, smartphone, tablet, smart camera, smart car or other type of cellular phone, media consumption device, wearable device, set-top box, gaming console, and the like.
- Each user's local device can interact with the execution device 210 through any communication mechanism/standard communication network, which can be a wide area network, a local area network, a point-to-point connection, etc., or any combination thereof.
- the communication network may include a wireless network, a wired network, or a combination of a wireless network and a wired network, and the like.
- the wireless network includes but is not limited to: the fifth generation mobile communication technology (5th-Generation, 5G) system, the long term evolution (long term evolution, LTE) system, the global system for mobile communication (global system for mobile communication, GSM) or code division Multiple access (code division multiple access, CDMA) network, wideband code division multiple access (wideband code division multiple access, WCDMA) network, wireless fidelity (wireless fidelity, WiFi), Bluetooth (bluetooth), Zigbee protocol (Zigbee), Any one or a combination of radio frequency identification technology (radio frequency identification, RFID), long range (Long Range, Lora) wireless communication, and near field communication (near field communication, NFC).
- the wired network may include an optical fiber communication network or a network composed of coaxial cables, and the like.
- one or more aspects of the execution device 210 may be implemented by each local device, for example, the local device 301 may provide the execution device 210 with local data or feedback calculation results.
- the local device 301 implements the functions of the execution device 210 and provides services for its own users, or provides services for the users of the local device 302 .
- more adversarial samples can be added on the basis of the original samples, and both the original samples and the adversarial samples can be added to the training set for training, so that the trained neural network can recognize the disturbance in the adversarial samples.
- the effect of adversarial training is greatly affected by the model, which may produce completely different effects for different models, and adversarial training needs to continuously generate adversarial samples during the training process, which greatly reduces the training efficiency, and may cause training results.
- the output accuracy of the neural network decreases, that is, the robustness of the neural network is reduced. Robustness can be understood as the ability of a neural network to keep the output value unchanged in the face of small changes in the input.
- denoising can be performed on adversarial samples, adding a denoising network in front of the neural network, and reducing the gap between the paired adversarial samples and the top-level representation generated by the original sample through the gradient descent algorithm, so that the denoising can be achieved.
- the noise network achieves the effect of adversarial robustness.
- the denoising network needs to be added in a targeted manner, and different denoising networks may need to be set in different training scenarios, and the generalization ability is weak, resulting in low training efficiency.
- the vulnerability of neural networks stems from the fact that in the process of neural network training, it is more inclined to learn which functions have more drastic changes outside the prevalence of data distribution, that is, neural networks mainly rely on the relatively small changes in linear space. , but also those components that contain information that can be used for classification are classified, that is, the aforementioned components other than the principal component.
- the components other than the principal components included in the samples of the training set have a greater impact on the training of the neural network.
- the gradient leakage phenomenon is hereinafter referred to as the gradient leakage phenomenon.
- the present application provides a training set processing method, by processing the training set before training, extracting the principal component of each sample, and obtaining a new sample to form a second training set.
- the sample includes the principal component in the original sample, so that training the neural network through the second training set can improve the robustness of the neural network.
- FIG. 6 a schematic flowchart of a training set processing method provided by the present application is as follows.
- all the data included in the first training set can be decomposed to obtain the basis of the first training set and the discrete sequence corresponding to the basis
- the first training set includes multiple samples
- the basis can include one or more basis vectors
- the discrete sequence is used to represent the discrete degree of the basis
- the discrete sequence may include discrete values one-to-one corresponding to each basis vector in the basis.
- the aforementioned basis may be understood as a space, and the space may include one or more basis vectors, and the discrete sequence is used to represent the degree of dispersion of the data included in the first training set in the basis.
- the types of samples included in the first training set are related to the neural network to be trained. For example, if a classification network needs to be trained, the first training set may include a large number of classified images, and if a face recognition network needs to be trained, the first training set may include a large number of face images.
- the aforementioned discrete value may be a value used to represent the degree of dispersion, such as variance, standard deviation, or range.
- the following exemplarily takes the variance as an example to represent the degree of dispersion of the basis in the embodiments of the present application. It should be understood that the variance mentioned below can also be replaced by standard deviation or range to represent the degree of dispersion The value of , will not be repeated below.
- the first training set there may be various ways to decompose the first training set, such as PCA or sparse coding algorithm.
- the first training set can be decomposed by a sparse coding algorithm.
- dataset X solve the optimization problem
- a i is the i th column of A, S i, X i empathy;.
- p L p norm representatives, ⁇ is a regularization term; whereby X i of the dictionary and sparse coding matrix S i (i.e., group )A.
- PCA processing is performed on the first training set to obtain an orthogonal basis and a discrete sequence corresponding to the orthogonal basis.
- PCA is an algorithm to achieve dimensionality reduction by performing orthogonal spectral decomposition of the covariance matrix of the input data to determine the linear direction of the main changes between data points.
- the PCA process can be understood as performing orthonormal spectral decomposition on the input data, that is, the covariance matrix of the first data set to determine the linear direction of the main changes between data points, thereby implementing a dimensionality reduction algorithm.
- the following steps are exemplarily described below by taking the PCA processing on the first training set as an example.
- performing principal component analysis (PCA) processing on the first training set to obtain discrete sequences corresponding to the orthonormal basis and the orthonormal basis may specifically include: centralizing the first training set, Obtain the first training set after centralization. Then perform PCA processing on the first training set after centralization to obtain the orthonormal basis and the discrete sequence corresponding to the orthonormal basis.
- the discrete sequence is composed of the variance of the first training set after centralization in the orthonormal basis.
- the variance included in the discrete sequence is in decreasing order, and the variance included in the discrete sequence corresponds to the basis vectors in the orthonormal basis in order one-to-one.
- the aforementioned centralization process can be understood as zero-average, that is, to detect the mean of all the data included in the first training set, and translate the first training set in space, such as subtracting the mean of all the data in the first training set, so that the first The mean value of all data included in the training set is 0, and the first centralized training set is obtained.
- the calculated variances may be sorted and arranged in descending order to obtain a discrete sequence. Then, the basis vectors included in the orthonormal basis are sorted, and the arrangement of the basis vectors in the orthonormal basis corresponds to the sorting manner in the discrete sequence.
- the orthonormal basis can be expressed as ⁇ v_1,v_2, across,v_N ⁇
- the discrete sequence can be expressed as ⁇ _1, ⁇ _2, across, ⁇ _N ⁇
- the variance corresponding to the basis vector v_1 is ⁇ _1
- the basis vector v_2 corresponds to The variance is ⁇ _2, etc., and so on.
- the discrete sequences can also be sorted in other ways, for example, they can be arranged in increasing order, or according to other set rules, etc.
- the basis vectors in the orthonormal basis can also be sorted according to the corresponding discrete sequences. Sort by.
- the component value of each sample in the first training set in each base vector in the base is obtained, and a plurality of sets of first encoded data are obtained.
- the component values of the samples in each base vector form a set of first encoded data.
- Step 602 is to obtain the component value of each sample projected on each direction, so that Obtain the first encoded data for each sample.
- the component of each sample in the first training set in the orthonormal basis can be obtained, and the first training set corresponding to each sample can be obtained. an encoded data.
- the first training set in step 602 may be replaced with the centralized first training set.
- a preset algorithm may be used to calculate the component value of each sample in the first training set in the basis to obtain multiple sets of first encoded data.
- the preset algorithm may include an inner product operation or a sparse coding operation or the like. For example, taking the inner product operation as an example, the inner product operation may be performed on each sample in the first training set and each basis vector in the basis to obtain the first encoded data of each sample.
- the principal components in each set of the first coded data in the multiple sets of first coded data are extracted, thereby obtaining multiple sets of second coded data.
- the principal component may be understood as a component whose corresponding discrete value is greater than a preset discrete value, or, the principal component may be understood as a preset number of components whose corresponding discrete value is the largest in the first encoded data.
- the basis in the aforementioned step 601 can be an orthonormal basis
- the orthonormal basis can be expressed as ⁇ v_1,v_2,...,v_N ⁇
- the discrete sequence can be expressed as ⁇ _1, ⁇ _2,...., ⁇ _N ⁇
- the basis vector in the orthonormal basis corresponds to the variance in the discrete sequence one-to-one in order.
- the first coded data can be represented as a: ⁇ a_1, a_2,...,a_N ⁇
- the components included in the first coded data correspond to the variance in the discrete sequence one-to-one in order.
- a variance greater than a preset discrete value is determined, and a component corresponding to the variance greater than the preset discrete value is determined from the first encoded data as a principal component to obtain second encoded data.
- a': ⁇ a_1,a_2,...,a_K ⁇ can be extracted from a: ⁇ a_1,a_2,...,a_N ⁇ , and a' is a set of second codes Data, K is less than or equal to N.
- each group of first encoded data may be retained, and other components except the principal component in each group of first encoded data may be replaced with preset values to obtain multiple groups of second encoded data data.
- each group of first encoded data may correspond to one or more groups of second encoded data.
- components other than the principal component in each set of first coded data can be replaced in various ways to obtain multiple sets of second coded data, thereby obtaining multiple sets of second coded data corresponding to each set of first coded data .
- the preset value may include 0 or a preset noise vector.
- the preset noise vector may include noise independent of the real value of the sample, or noise independent of the real value of the sample but similar to the data distribution in the first training set, or noise of a specific distribution, or the like.
- the preset noise vector may be Gaussian noise or uniform distribution features, or the like. Therefore, in the embodiment of the present application, by replacing other components except the main component with 0 or a noise vector, the influence of this part of the components on the training of the neural network is eliminated, so that when training the neural network later, you can use The principal component is dominant, and the neural network with better robustness is obtained.
- the replaced noise may be proportional to the variance corresponding to the component before replacement.
- the noise can be 5 times, 10 times, etc., the variance corresponding to the original component. Therefore, in the embodiment of the present application, the distribution law of the replaced noise can be similar to the distribution law of the variance of the original component, thereby reducing the impact on the subsequent training of the neural network, so that in the process of training the neural network, the main component is used to perform Under the premise of obtaining a neural network with better robustness, avoid the impact on the output accuracy of the neural network, and obtain a neural network with more balanced robustness and output accuracy.
- PCA processing is used for the first training set in the aforementioned step 601
- a certain amount of noise may be added in the normal direction of the PCA subspace to suppress the gradient leakage phenomenon.
- the arrangement order of the components included in the first encoded data corresponds to the arrangement order of the variances in the discrete sequence, and it is determined that the variance is greater than the predetermined order.
- the multiple sets of second encoded data are mapped to the basis of the first training set to obtain new samples corresponding to each set of second encoded data in the multiple sets of second encoded data.
- the samples corresponding to the second encoded data constitute the second training set.
- the basis of the first training set can be understood as a space
- the second encoded data includes component values in one or more directions in the space
- a group of second encoded data is mapped into the space, A new sample can be obtained.
- the basis in the foregoing step 601 may be mapped according to the second encoded data to obtain new samples corresponding to each group of the second encoded data. Multiple new samples corresponding to the multiple sets of second encoded data form a second training set.
- the basis mentioned in the aforementioned step 601 can be understood as space
- the second encoded data includes the value of the projection of the new sample in the direction of each basis vector
- the components included in the second encoded data are in the basis Mapping in , you can get a new sample.
- the second training set can be used to perform neural network training to obtain a neural network with better robustness.
- the second coded data with reduced interference is obtained, and a new sample can be obtained according to the second coded data, And use the new samples for neural network training.
- the new sample reduces the interference of other components except the main component, so that the neural network obtained by training can be trained by the main component, and the robustness of the neural network is improved.
- the training set processing method provided by this application is processed for the training set, and the processing method is only related to the distribution of the principal components of the training set itself. Therefore, even if different models are trained in different scenarios, this application can be used.
- the provided training set processing method processes the training set, has strong generalization ability, and does not depend on the general algorithm of the trained model, so it has high versatility.
- An adversarial sample is a sample that includes disturbance information, and the disturbance included in the adversarial sample will reduce the output accuracy of the neural network.
- the adversarial sample includes a sample of disturbance information, and the disturbance included in the adversarial sample will affect the robustness of the neural network obtained by subsequent training, and reduce the output accuracy of the neural network.
- the schematic diagram of the adversarial sample can be shown in FIG. 7 , the image A1 is an image that does not include disturbance, and the disturbance information A2 is superimposed on the basis of the image A1, and 0.007 identifies the coefficient of the added disturbance information, thereby obtaining the added disturbance information.
- the perturbation information is included in the adversarial sample, which can easily cause the recognition error of the neural network.
- the image A1 is actually classified as a panda, and the image 3 after adding the disturbance information may be recognized as a dog. Therefore, if Using this adversarial example for training may lead to poor robustness of the neural network.
- the training set before using the training set for neural network training, is processed to reduce the disturbance part in each sample in the training set, so that the subsequent neural network training can use the reduced disturbance part.
- the training set is used for training to avoid the influence of the disturbance in the sample on the neural network and improve the robustness of the neural network.
- the principal component of the sample is the main component, and the neural network with better robustness is obtained by training.
- the main component of the sample can be used to train the neural network. While improving the robustness of the neural network, the impact on the output accuracy of the neural network can be reduced, and a neural network with balanced robustness and output accuracy can be obtained.
- the principal component in the encoded data corresponding to the original sample is retained, and other components except the principal component are replaced with noise or 0, so as to obtain the elimination of the principal component except the principal component.
- New samples of other components of When the neural network is trained using the training set including new samples, the training can be performed mainly on the principal component, which reduces the disturbance included in the samples. It is equivalent to introducing a data manifold to defend against adversarial samples in the training process to improve the robustness of the neural network.
- the data manifold can be understood as one of the hypotheses embedded in the linear space of the real dimension of the data, but the dimension is much lower than the manifold of the space, and the observed input data points are distributed near it, similar to neural networks such as natural images.
- Data that is good at classification basically conforms to this distribution assumption.
- the principal components of different samples are quite different, and if the principal components are successfully classified, a higher robust neural network can be obtained. Therefore, without reducing the output accuracy of the neural network, the robustness of the neural network is improved, and the problem of gradient leakage during the training of the neural network is suppressed.
- a sample in the first training set can be represented as a data point xi
- the first training set can be a N*D dimensional data set
- the orthonormal basis ⁇ v_1,v_2,.....,v_N ⁇ is obtained, and the corresponding discrete sequence ⁇ _1, ⁇ _2, etc, ⁇ _N ⁇ , and the variance included in the discrete sequence is decreasing.
- arrangement Determine the component dimension d included in the principal component, the added noise dimension m, and the noise size c.
- the neural network can then be trained using the new second training set.
- the other components of the principal component are replaced with noise proportional to the corresponding variance, which improves the robustness of the neural network without affecting the training process of the neural network.
- the formula for taking the sample can include: Ux old represents the aforementioned first encoded data, s is a scaling vector, ⁇ is a noise vector, and c is a constant greater than 1.
- s can be taken as the truncation vector ⁇ 1,1,...,1,1,0,0,....,0 ⁇ , and the number of 1 is the truncation hyperparameter, that is, the aforementioned preset value d. In order to achieve the purpose of robustness, it is generally necessary to further suppress the corresponding components with smaller scales. ).
- the aforementioned noise vector can also be replaced with a vector that is not Gaussian distributed, but has other similar variance levels independent of the distribution of the samples themselves.
- a method is proposed to detect and improve the vulnerability of neural networks to confrontation caused by non-robust parts of the training set.
- the method provided in this application is versatile and efficient, and can be directly applied to most tasks and networks.
- a neural network with higher output accuracy can be trained, and a neural network with balanced robustness and output accuracy can be obtained.
- the classification network As an example, if the defense method of projection in the test phase is adopted, that is, the disturbance in the adversarial sample is trained in the test phase, since the projected manifold has errors compared with the real data manifold, during training If unprojected data is used for training, the classification effect of the model on the data projected onto the manifold is unknown. On the one hand, it will lead to a significant decline in classification accuracy, and on the other hand, because the classification network is not well trained on the manifold, it is easier to find adversarial examples on the manifold.
- the projection operation is performed during training, which can avoid the aforementioned problems.
- the classification network obtained by training does not need to project the input data during testing, which improves the training efficiency.
- the present invention can have a better and more flexible trade-off between robust accuracy and original test set accuracy.
- the present application can flexibly adjust the final accuracy rate of model training and adjust the balance between the output accuracy rate and robustness of the neural network by adjusting the parameter d and the specific distribution and amplitude of the added noise according to the needs of the application scenario.
- FIG. 8 a schematic structural diagram of a training set processing apparatus provided by the present application, the training set processing apparatus is used to execute the steps of the method in the aforementioned FIG. 6 .
- the training set processing means may include:
- the decomposition unit 801 is configured to decompose according to the first training set to obtain a basis of the first training set and a discrete sequence corresponding to the basis, the first training set includes a plurality of samples, the basis includes at least one basis vector, and the degree of dispersion includes A discrete value corresponding to each basis vector in , the discrete sequence can be used to represent the discrete degree of the basis;
- Obtaining unit 802 is used to obtain the component value of each sample in the first training set in the base, and obtain multiple groups of first encoded data, and each group of first encoded data corresponds to one sample;
- the obtaining unit 802 is further configured to obtain principal components in each group of first encoded data in the multiple groups of first encoded data, and obtain multiple groups of second encoded data, wherein the discrete values corresponding to the principal components are higher than the preset discrete values, and each First;
- the mapping unit 803 is configured to map multiple groups of second encoded data to the base of the first training set, and obtain samples corresponding to multiple groups of second encoded data, and the samples corresponding to multiple groups of second encoded data form a second training set, and the first The second training set is used to train the neural network.
- the basis is an orthonormal basis
- the decomposition unit 801 is specifically configured to perform principal component analysis PCA processing on the first training set to obtain the orthonormal basis and the corresponding discrete sequence in the orthonormal basis.
- the decomposition unit 801 is specifically configured to: centralize the first training set to obtain a centralized first training set, and the mean value of the data included in the centralized first training set is 0; perform PCA processing on the first training set after centralization to obtain the orthonormal basis and the discrete sequence of the orthonormal basis, the discrete sequence includes the sequence composed of the variance of the first training set after centralization in the orthonormal basis .
- the decomposition unit 801 is specifically configured to calculate, through a preset algorithm, the component value of each sample in the centered first training set on each basis vector in the orthonormal basis, to obtain A plurality of sets of first encoded data.
- the preset algorithm includes an inner product operation or a sparse coding operation.
- the obtaining unit 802 is specifically configured to retain the main component in each group of first encoded data, and replace other components except the main component in each group of first encoded data with a preset value, A plurality of sets of second coded data are obtained, wherein the principal components of each set of first coded data constitute at least one set of second coded data.
- the preset value includes 0 or a preset noise vector
- the preset noise vector includes Gaussian noise or uniformly distributed noise.
- the preset noise vector is proportional to the variance corresponding to the replaced component.
- FIG. 9 is a schematic structural diagram of another training set processing apparatus provided by the present application, as described below.
- the training set processing apparatus may include a processor 901 and a memory 902 .
- the processor 901 and the memory 902 are interconnected by wires.
- the memory 902 stores program instructions and data.
- the memory 902 stores program instructions and data corresponding to the aforementioned steps in FIG. 6 .
- the processor 901 is configured to perform the method steps performed by the training set processing apparatus shown in any of the foregoing embodiments in FIG. 6 .
- the training set processing apparatus may further include a transceiver 903 for receiving or sending data.
- Embodiments of the present application further provide a computer-readable storage medium, where a program for generating a vehicle's running speed is stored in the computer-readable storage medium, and when the computer is running on a computer, the computer is made to execute the implementation as shown in the aforementioned FIG. 6 . steps in the method described in the example.
- the aforementioned training set processing apparatus shown in FIG. 9 is a chip.
- An embodiment of the present application further provides a training set processing device, which may also be called a digital processing chip or a chip.
- the chip includes a processing unit and a communication interface.
- the processing unit obtains program instructions through the communication interface, and the program instructions are processed.
- the unit is executed, and the processing unit is configured to execute the method steps executed by the training set processing apparatus shown in any of the foregoing embodiments in FIG. 6 .
- the embodiments of the present application also provide a digital processing chip.
- the digital processing chip integrates circuits and one or more interfaces for realizing the above-mentioned processor 901 or the functions of the processor 901 .
- the digital processing chip can perform the method steps of any one or more of the foregoing embodiments.
- the digital processing chip does not integrate the memory, it can be connected with the external memory through the communication interface.
- the digital processing chip implements the actions performed by the training set processing apparatus in the above embodiment according to the program codes stored in the external memory.
- the embodiment of the present application also provides a computer program product that, when driving on the computer, causes the computer to execute the steps executed by the training set processing apparatus in the method described in the embodiment shown in FIG. 6 .
- the training set processing apparatus may be a chip, and the chip includes: a processing unit and a communication unit.
- the processing unit may be, for example, a processor, and the communication unit may be, for example, an input/output interface, a pin, or a circuit, etc. .
- the processing unit can execute the computer-executed instructions stored in the storage unit, so that the chip in the server executes the training set processing method described in the embodiment shown in FIG. 6 above.
- the storage unit is a storage unit in the chip, such as a register, a cache, etc.
- the storage unit may also be a storage unit located outside the chip in the wireless access device, such as only Read-only memory (ROM) or other types of static storage devices that can store static information and instructions, random access memory (RAM), etc.
- ROM Read-only memory
- RAM random access memory
- the aforementioned processing unit or processor may be a central processing unit (CPU), a network processor (neural-network processing unit, NPU), a graphics processing unit (graphics processing unit, GPU), a digital signal processing digital signal processor (DSP), application specific integrated circuit (ASIC) or field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
- a general purpose processor may be a microprocessor or it may be any conventional processor or the like.
- FIG. 10 is a schematic structural diagram of a chip provided by an embodiment of the present application.
- the chip may be represented as a neural network processor NPU 100, and the NPU 100 is mounted on the main CPU ( Host CPU), the task is allocated by the Host CPU.
- the core part of the NPU is the arithmetic circuit 1003, which is controlled by the controller 1004 to extract the matrix data in the memory and perform multiplication operations.
- the arithmetic circuit 1003 includes multiple processing units (process engines, PEs). In some implementations, the arithmetic circuit 1003 is a two-dimensional systolic array. The arithmetic circuit 1003 may also be a one-dimensional systolic array or other electronic circuitry capable of performing mathematical operations such as multiplication and addition. In some implementations, arithmetic circuit 1003 is a general-purpose matrix processor.
- the arithmetic circuit fetches the data corresponding to the matrix B from the weight memory 1002 and buffers it on each PE in the arithmetic circuit.
- the arithmetic circuit fetches the data of the matrix A and the matrix B from the input memory 1001 to perform the matrix operation, and stores the partial result or the final result of the matrix in the accumulator 1008 .
- Unified memory 1006 is used to store input data and output data.
- the weight data is directly passed through the storage unit access controller (direct memory access controller, DMAC) 1005, and the DMAC is transferred to the weight memory 1002.
- Input data is also transferred to unified memory 1006 via the DMAC.
- a bus interface unit (BIU) 1010 is used for the interaction between the AXI bus and the DMAC and an instruction fetch buffer (instruction fetch buffer, IFB) 1009.
- IFB instruction fetch buffer
- the bus interface unit 1010 (bus interface unit, BIU) is used for the instruction fetch memory 1009 to obtain instructions from the external memory, and is also used for the storage unit access controller 1005 to obtain the original data of the input matrix A or the weight matrix B from the external memory.
- the DMAC is mainly used to transfer the input data in the external memory DDR to the unified memory 1006 , the weight data to the weight memory 1002 , or the input data to the input memory 1001 .
- the vector calculation unit 1007 includes a plurality of operation processing units, and further processes the output of the operation circuit, such as vector multiplication, vector addition, exponential operation, logarithmic operation, size comparison, etc., if necessary. It is mainly used for non-convolutional/fully connected layer network computations in neural networks, such as batch normalization, pixel-level summation, and upsampling of feature planes.
- the vector computation unit 1007 can store the vector of processed outputs to the unified memory 1006 .
- the vector calculation unit 1007 may apply a linear function and/or a nonlinear function to the output of the operation circuit 1003, such as linear interpolation of the feature plane extracted by the convolutional layer, such as a vector of accumulated values, to generate activation values.
- the vector computation unit 1007 generates normalized values, pixel-level summed values, or both.
- the vector of processed outputs can be used as activation input to the arithmetic circuit 1003, eg, for use in subsequent layers in a neural network.
- the instruction fetch memory (instruction fetch buffer) 1009 connected to the controller 1004 is used to store the instructions used by the controller 1004;
- the unified memory 1006, the input memory 1001, the weight memory 1002 and the instruction fetch memory 1009 are all On-Chip memories. External memory is private to the NPU hardware architecture.
- each layer in the recurrent neural network can be performed by the operation circuit 1003 or the vector calculation unit 1007 .
- the processor mentioned in any one of the above may be a general-purpose central processing unit, a microprocessor, an ASIC, or one or more integrated circuits for controlling the execution of the program of the method in FIG. 6 above.
- the device embodiments described above are only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be A physical unit, which can be located in one place or distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
- the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.
- U disk U disk
- mobile hard disk ROM
- RAM random access memory
- disk or CD etc.
- a computer device which can be a personal computer, server, or network device, etc. to execute the methods described in the various embodiments of the present application.
- the computer program product includes one or more computer instructions.
- the computer may be a general purpose computer, special purpose computer, computer network, or other programmable device.
- the computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be downloaded from a website site, computer, server, or data center Transmission to another website site, computer, server, or data center is by wire (eg, coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (eg, infrared, wireless, microwave, etc.).
- wire eg, coaxial cable, fiber optic, digital subscriber line (DSL)
- wireless eg, infrared, wireless, microwave, etc.
- the computer-readable storage medium may be any available medium that can be stored by a computer, or a data storage device such as a server, data center, etc., which includes one or more available media integrated.
- the usable media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVDs), or semiconductor media (eg, solid state disks (SSDs)), and the like.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Artificial Intelligence (AREA)
- Evolutionary Computation (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Life Sciences & Earth Sciences (AREA)
- Software Systems (AREA)
- Computing Systems (AREA)
- Bioinformatics & Computational Biology (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Mathematical Physics (AREA)
- Evolutionary Biology (AREA)
- Biophysics (AREA)
- General Health & Medical Sciences (AREA)
- Molecular Biology (AREA)
- Computational Linguistics (AREA)
- Biomedical Technology (AREA)
- Health & Medical Sciences (AREA)
- Algebra (AREA)
- Computational Mathematics (AREA)
- Mathematical Analysis (AREA)
- Mathematical Optimization (AREA)
- Pure & Applied Mathematics (AREA)
- Image Analysis (AREA)
Abstract
一种训练集处理方法,用于通过提取训练集的主分量训练神经网络,可以使用更鲁棒的特征来进行神经网络的训练,从而在不降低神经网络的输出准确率的基础上,提升得到的神经网络的鲁棒性。该方法包括:首先,获取第一训练集的基和离散序列,离散序列包括与基中的每个基向量一一对应的离散值,离散序列用于表示基的离散程度;然后,获取每个样本在每个基向量上的分量值,以得到多组第一编码数据;随后,获取每组第一编码数据中的主分量,得到多组第二编码数据,主分量对应的离散值高于预设离散值;根据多组第二编码数据进行映射,得到新的样本,以组成第二训练集,第二训练集用于训练神经网络。
Description
本申请要求于2020年07月17日提交中国专利局、申请号为“202010692947.9”、申请名称为“一种训练集处理方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及人工智能领域,尤其涉及一种训练集处理方法和装置。
在人工智能领域中,神经网络近年来在计算机视觉、自然语言处理、网络安全等任务中的一系列突破,展现了智能时代的全新可能。然而神经网络普遍存在难以解释的对对抗样本的脆弱性,其有可能被加在其输入数据上的非常微小但精心设计的噪声所欺骗而得出错误的结果,这种精心构造的样本被称为对抗样本。
面对对抗具有脆弱性的人工智能系统显然无法使用于安全要求高的领域如医疗,智能驾驶等领域。因此分析导致人工神经网络脆弱的因素,获得具有对抗鲁棒性的人工神经网络至关重要。在现有方案中,可以在原样本的基础上增加较多的对抗样本,将原样本和对抗样本都加入训练集中进行训练,从而使训练得到的神经网络可以识别出对抗样本中的扰动。然而,对抗训练的效果受模型的影响较大,可能针对不同的模型产生了完全不同的效果,且对抗训练需要在训练过程中不断产生对抗样本,大大降低了训练效率,且可能造成训练得到的神经网络的输出准确率下降,即降低了神经网络的鲁棒性。因此,如何得到鲁棒性更优的神经网络,成为亟待解决的问题。
发明内容
本申请提供一种训练集处理方法,用于通过提取训练集的主分量训练神经网络,可以使用更鲁棒的特征来进行神经网络的训练,从而在不降低神经网络的输出准确率的基础上,提升得到的神经网络的鲁棒性。
有鉴于此,第一方面,本申请提供一种训练集处理方法,包括:首先,根据第一训练集进行分解,得到第一训练集的基和该基的离散序列,该第一训练集中包括多个样本,该第一训练集的基可以理解为多个方向的数据组成的空间,该基中包括至少一个基向量,离散序列包括与基中的每个基向量一一对应的离散值,离散序列可以用于表示基的离散程度;然后,获取第一训练集中的每个样本在每个基向量上的分量值,得到多组第一编码数据,其中,每组第一编码数据对应一个样本,每个样本在每个基向量中具有一个分量值,该第一编码数据中包括的每个基向量对应一个分量,第一编码数据包括的分量与至少一个基向量一一对应;获取多组第一编码数据中的每组第一编码数据中的主分量,得到多组第二编码数据,主分量的离散值高于预设离散值,或者说第一编码数据中的离散值高于预设值的分量组成了主分量;将该多组第二编码数据映射至第一训练集的,得到多组第二编码数据对应的新的样本,多组第二编码数据对应的样本组成第二训练集,第二训练集用于训练神经网络,从而得到鲁棒性更优的神经网络。
因此,在本申请实施方式中,在提取到每个样本在基中的第一编码数据中的主分量之后,得到降低了干扰之后的第二编码数据,可以根据第二编码数据得到新的样本,并使用新的样本进行神经网络训练。而新的样本中减少了除主要分量外的其他分量的干扰,从而使得训练得到的神经网络可以通过主分量进行训练,提高神经网络的鲁棒性。并且,本申请提供的数据集处理方法,针对训练集进行了处理,处理方式仅与训练集本身的主分量的分布有关,因此,即使在不同的场景中训练不同的模型,也可以使用本申请提供的训练集处理方法对训练集进行处理,泛化能力强,不依赖于被训练模型的通用算法,从而具有较高的通用性。
在一种可能的实施方式中,根据第一训练集获得所述第一训练集的基和所述基的离散序列,可以包括:对第一训练集进行主成分分析(principal component analysis,PCA)处理,得到正交基和正交基的离散序列。
通常,对第一训练集进行分解的方式可以有多种,如PCA处理或者稀疏编码等方式对第一训练集进行分解,从而得到第一训练集的基和离散序列,进而获取到第一训练集的每个样本的分量。
在一种可能的实施方式中,对第一训练集进行PCA处理,得到正交基和正交基的离散序列,可以包括:对第一训练集进行中心化处理,得到中心化后的第一训练集,中心化后的第一训练集包括的数据的均值为0;对中心化后的第一训练集进行PCA处理,得到正交基,以及正交基的离散序列,离散序列包括中心化后的第一训练集在正交基中的方差组成的序列。通常,离散序列所包括的方差呈递减排列,且离散序列所包括的方差按顺序和正交基中的基向量按顺序一一对应。
本申请实施方式中,可以对第一训练集进行中心化处理,得到中心化后的第一训练集,然后对中心化后的训练集进行PCA处理,从而完成对第一训练集的快速分析,得到正交基和正交基的离散序列。
在一种可能的实施方式中,获取第一训练集中的每个样本在基中的分量值,可以包括:通过预设算法,计算中心化后的第一训练集中的每个样本在正交基中的每个基向量上的分量值,得到多组第一编码数据。
本申请实施方式中,若对第一训练集进行PCA处理,相应地,可以基于PCA处理后的正交基计算每个样本在每个基向量上的分量值,从而得到第一编码数据。
在一种可能的实施方式中,预设算法包括内积运算或者稀疏编码运算。本申请实施方式中,可以通过内积运算或者稀疏编码运算计算每个样本在每个基向量上的分量值,实现了对每个样本在每个基向量上的投影。
在一种可能的实施方式中,获取每组第一编码数据中的主分量,得到多组第二编码数据,可以包括:保留每组第一编码数据中的主分量,将每组第一编码数据中除主分量外的其他分量替换为预设的值,得到多组第二编码数据,其中,每组第一编码数据的主分量组成至少一组第二编码数据。本申请实施方式中,可以将每组第一编码数据中除主分量外的其他分量替换为预设的值,从而使每组第一编码数据的分量可以组成一组或者多组第二编码数据。
在一种可能的实施方式中,预设的值包括0或者预设的噪声向量,预设的噪声向量包括高斯噪声或者均匀分布噪声。
因此,本申请实施方式中,可以将第一编码数据中除主分量以外的值替换为0或者预设的噪声向量,从而得到一组或者多组第二编码数据,以降低第一训练集中每个样本中除主分量以外的值对神经网络的训练的影响,提高最终得到的神经网络的鲁棒性。
在一种可能的实施方式中,预设的噪声向量与被换的分量的离散值成比例。因此,本申请实施方式中,替换的噪声向量与第一编码数据中原有的数据的分布方式类似,在降低了每个样本中除主分量以外的值对神经网络的训练的影响的基础上,降低对神经网络的训练的干扰,得到的神经网络的输出更准确。
第二方面,本申请提供一种训练集处理装置,包括:
分解单元,用于根据第一训练集获得第一训练集的基和该基的离散序列,第一训练集中包括多个样本,基中包括至少一个基向量,离散程度包括与基中的每个基向量一一对应的离散值,离散序列用于表示基的离散程度;
获取单元,用于获取第一训练集中的每个样本在基中的分量值,得到多组第一编码数据,每组第一编码数据对应一个样本;
获取单元,还用于获取多组第一编码数据中的每组第一编码数据中的主分量,得到多组第二编码数据,主分量的离散值高于预设离散值;
映射单元,用于将多组第二编码数据映射至第一训练集的基,得到多组第二编码数据对应的样本,多组第二编码数据对应的样本组成第二训练集,第二训练集用于训练神经网络。
第二方面及第二方面任一种可能的实施方式产生的有益效果可参照第一方面及第一方面任一种可能实施方式的描述。
在一种可能的实施方式中,基为正交基,分解单元,具体用于对第一训练集进行主成分分析PCA处理,得到正交基和正交基的离散序列。
在一种可能的实施方式中,分解单元,具体用于:对第一训练集进行中心化处理,得到中心化后的第一训练集,中心化后的第一训练集包括的数据的均值为0;对中心化后的第一训练集进行PCA处理,得到正交基,以及正交基的离散序列,离散序列包括中心化后的第一训练集在正交基中的方差组成的序列。
在一种可能的实施方式中,分解单元,具体用于通过预设算法,计算中心化后的第一训练集中的每个样本在正交基中的每个基向量上的分量值,得到多组第一编码数据。
在一种可能的实施方式中,预设算法包括内积运算或者稀疏编码运算。
在一种可能的实施方式中,获取单元,具体用于保留每组第一编码数据中的主分量,将每组第一编码数据中除主分量外的其他分量替换为预设的值,得到多组第二编码数据,其中,每组第一编码数据的主分量组成至少一组第二编码数据。
在一种可能的实施方式中,预设的值包括0或者预设的噪声向量,预设的噪声向量包括高斯噪声或者均匀分布噪声。
在一种可能的实施方式中,预设的噪声向量与被替换的分量的离散值成比例。
第三方面,本申请实施例提供一种训练集处理装置,该训练集处理装置具有实现上述第一方面训练集处理方法的功能。该功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。该硬件或软件包括一个或多个与上述功能相对应的模块。
第四方面,本申请实施例提供一种训练集处理装置,包括:处理器和存储器,其中,处理器和存储器通过线路互联,处理器调用存储器中的程序代码用于执行上述第一方面任一项所示的训练集处理方法中与处理相关的功能。可选地,该训练集处理装置可以是芯片。
第五方面,本申请实施例提供了一种训练集处理装置,该训练集处理装置也可以称为数字处理芯片或者芯片,芯片包括处理单元和通信接口,处理单元通过通信接口获取程序指令,程序指令被处理单元执行,处理单元用于执行如上述第一方面或第一方面任一可选实施方式中与处理相关的功能。
第六方面,本申请实施例提供了一种计算机可读存储介质,包括指令,当其在计算机上运行时,使得计算机执行上述第一方面或第一方面任一可选实施方式中的方法。
第七方面,本申请实施例提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第一方面或第一方面任一可选实施方式中的方法。
图1本申请应用的一种人工智能主体框架示意图;
图2本申请提供的一种系统架构示意图;
图3为本申请实施例提供的一种卷积神经网络结构示意图;
图4为本申请实施例提供的另一种卷积神经网络结构示意图;
图5本申请提供的另一种系统架构示意图;
图6为本申请实施例提供的一种训练集处理方法的流程示意图;
图7为本申请实施例提供的一种对抗样本的示意图;
图8为本申请提供的一种训练集处理装置的一种结构示意图;
图9为本申请提供的一种训练集处理装置的另一种结构示意图;
图10为本申请实施例提供的一种芯片的结构示意图。
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
本申请提供的训练集处理方法可以应用于人工智能(artificial intelligence,AI)场景中。AI是利用数字计算机或者数字计算机控制的机器模拟、延伸和扩展人的智能,感知环境、获取知识并使用知识获得最佳结果的理论、方法、技术及应用系统。换句话说,人工智能是计算机科学的一个分支,它企图了解智能的实质,并生产出一种新的能以人类智能相似的方式作出反应的智能机器。人工智能也就是研究各种智能机器的设计原理与实 现方法,使机器具有感知、推理与决策的功能。人工智能领域的研究包括机器人,自然语言处理,计算机视觉,决策与推理,人机交互,推荐与搜索,AI基础理论等。
图1示出一种人工智能主体框架示意图,该主体框架描述了人工智能系统总体工作流程,适用于通用的人工智能领域需求。
下面从“智能信息链”(水平轴)和“IT价值链”(垂直轴)两个维度对上述人工智能主题框架进行阐述。
“智能信息链”反映从数据的获取到处理的一列过程。举例来说,可以是智能信息感知、智能信息表示与形成、智能推理、智能决策、智能执行与输出的一般过程。在这个过程中,数据经历了“数据—信息—知识—智慧”的凝练过程。
“IT价值链”从人智能的底层基础设施、信息(提供和处理技术实现)到系统的产业生态过程,反映人工智能为信息技术产业带来的价值。
(1)基础设施:
基础设施为人工智能系统提供计算能力支持,实现与外部世界的沟通,并通过基础平台实现支撑。通过传感器与外部沟通;计算能力由智能芯片,如中央处理器(central processing unit,CPU)、网络处理器(neural-network processing unit,NPU)、图形处理器(英语:graphics processing unit,GPU)、专用集成电路(application specific integrated circuit,ASIC)或现场可编程逻辑门阵列(field programmable gate array,FPGA)等硬件加速芯片)提供;基础平台包括分布式计算框架及网络等相关的平台保障和支持,可以包括云存储和计算、互联互通网络等。举例来说,传感器和外部沟通获取数据,这些数据提供给基础平台提供的分布式计算系统中的智能芯片进行计算。
(2)数据
基础设施的上一层的数据用于表示人工智能领域的数据来源。数据涉及到图形、图像、语音、视频、文本,还涉及到传统设备的物联网数据,包括已有系统的业务数据以及力、位移、液位、温度、湿度等感知数据。
(3)数据处理
数据处理通常包括数据训练,机器学习,深度学习,搜索,推理,决策等方式。
其中,机器学习和深度学习可以对数据进行符号化和形式化的智能信息建模、抽取、预处理、训练等。
推理是指在计算机或智能系统中,模拟人类的智能推理方式,依据推理控制策略,利用形式化的信息进行机器思维和求解问题的过程,典型的功能是搜索与匹配。
决策是指智能信息经过推理后进行决策的过程,通常提供分类、排序、预测等功能。
(4)通用能力
对数据经过上面提到的数据处理后,进一步基于数据处理的结果可以形成一些通用的能力,比如可以是算法或者一个通用系统,例如,翻译,文本的分析,计算机视觉的处理(如图像识别、目标检测等),语音识别等等。
(5)智能产品及行业应用
智能产品及行业应用指人工智能系统在各领域的产品和应用,是对人工智能整体解决 方案的封装,将智能信息决策产品化、实现落地应用,其应用领域主要包括:智能制造、智能交通、智能家居、智能医疗、智能安防、自动驾驶,平安城市,智能终端等。
参见附图2,本申请实施例提供了一种系统架构200。该系统架构中包括数据库230、客户设备240。数据采集设备260用于采集数据并存入数据库230,训练模块211基于数据库230中维护的数据生成目标模型/规则201。下面将更详细地描述训练模块211如何基于数据得到目标模型/规则201,目标模型/规则201即本申请以下实施方式中构建得到的神经网络,具体参阅以下图6的相关描述。
计算模块可以包括训练模块211,训练模块211得到的目标模型/规则可以应用不同的系统或设备中。在附图2中,执行设备210配置收发器212,该收发器212可以是无线收发器、光收发器或有线接口(如I/O接口)等,与外部设备进行数据交互,“用户”可以通过客户设备240向收发器212输入数据,例如,本申请以下实施方式,客户设备240可以向执行设备210发送目标任务,请求执行设备构建神经网络,并向执行设备210发送用于训练的数据库。
执行设备210可以调用数据存储系统250中的数据、代码等,也可以将数据、指令等存入数据存储系统250中。
计算模块211使用目标模型/规则201对输入的数据进行处理。具体地,计算模块211用于:首先,获取第一训练集,该第一训练集中包括多个样本;然后,根据第一训练集得到第一训练集的基和基的离散序列,第一训练集中包括多个样本,基中包括至少一个基向量,离散序列包括与基中的每个基向量一一对应的离散值,该离散序列可以用于表示基的离散程度;获取第一训练集中的每个样本在每个基向量上的分量值,以得到多组第一编码数据,每组第一编码数据对应一个样本;获取多组第一编码数据中的每组第一编码数据中的主分量,得到多组第二编码数据,主分量的离散值高于预设离散值;将多组第二编码数据映射至第一训练集的基,得到多组第二编码数据对应的样本,多组第二编码数据对应的样本组成第二训练集,第二训练集用于训练神经网络。
最后,收发器212将构建得到的神经网络返回给客户设备240,以在客户设备240或者其他设备中部署该神经网络。
更深层地,训练模块211可以针对不同的任务,基于不同的数据得到相应的目标模型/规则201,以给用户提供更佳的结果。
在附图2中所示情况下,可以根据用户的输入数据确定输入执行设备210中的数据,例如,用户可以在收发器212提供的界面中操作。另一种情况下,客户设备240可以自动地向收发器212输入数据并获得结果,若客户设备240自动输入数据需要获得用户的授权,用户可以在客户设备240中设置相应权限。用户可以在客户设备240查看执行设备210输出的结果,具体的呈现形式可以是显示、声音、动作等具体方式。客户设备240也可以作为数据采集端将采集到与目标任务关联的数据存入数据库230。
需要说明的是,附图2仅是本申请实施例提供的一种系统架构的示例性的示意图,图中所示设备、器件、模块等之间的位置关系不构成任何限制。例如,在附图2中,数据存储系统250相对执行设备210是外部存储器,在其它场景中,也可以将数据存储系统250 置于执行设备210中。
在本申请所提及的训练或者更新过程可以由训练模块211来执行。可以理解的是,神经网络的训练过程即学习控制空间变换的方式,更具体即学习权重矩阵。训练神经网络的目的是使神经网络的输出尽可能接近期望值,因此可以通过比较当前网络的预测值和期望值,再根据两者之间的差异情况来更新神经网络中的每一层神经网络的权重向量(当然,在第一次更新之前通常可以先对权重向量进行初始化,即为深度神经网络中的各层预先配置参数)。例如,如果网络的预测值过高,则调整权重矩阵中的权重的值从而降低预测值,经过不断的调整,直到神经网络输出的值接近期望值或者等于期望值。具体地,可以通过损失函数(loss function)或目标函数(objective function)来衡量神经网络的预测值和期望值之间的差异。以损失函数举例,损失函数的输出值(loss)越高表示差异越大,神经网络的训练可以理解为尽可能缩小loss的过程。本申请以下实施方式中更新起点网络的权重以及对串行网络进行训练的过程可以参阅此过程,以下不再赘述。
本申请提及的神经网络可以包括多种类型,如深度神经网络(deep neural network,DNN)、卷积神经网络(convolutional neural network,CNN)、循环神经网络(recurrent neural networks,RNN)或残差网络其他神经网络等。
示例性地,下面以CNN为例。
CNN是一种带有卷积结构的深度神经网络。CNN是一种深度学习(deep learning)架构,深度学习架构是指通过机器学习的算法,在不同的抽象层级上进行多个层次的学习。作为一种深度学习架构,CNN是一种前馈(feed-forward)人工神经网络,该前馈人工神经网络中的各个神经元对输入其中的图像中的重叠区域作出响应。卷积神经网络包含了一个由卷积层和子采样层构成的特征抽取器。该特征抽取器可以看作是滤波器,卷积过程可以看作是使用一个可训练的滤波器与一个输入的图像或者卷积特征平面(feature map)做卷积。卷积层是指卷积神经网络中对输入信号进行卷积处理的神经元层。在卷积神经网络的卷积层中,一个神经元可以只与部分邻层神经元连接。一个卷积层中,通常包含若干个特征平面,每个特征平面可以由一些矩形排列的神经单元组成。同一特征平面的神经单元共享权重,这里共享的权重就是卷积核。共享权重可以理解为提取图像信息的方式与位置无关。这其中隐含的原理是:图像的某一部分的统计信息与其他部分是一样的。即意味着在某一部分学习的图像信息也能用在另一部分上。所以对于图像上的所有位置,我们都能使用同样的学习得到的图像信息。在同一卷积层中,可以使用多个卷积核来提取不同的图像信息,一般地,卷积核数量越多,卷积操作反映的图像信息越丰富。
卷积核可以以随机大小的矩阵的形式初始化,在卷积神经网络的训练过程中卷积核可以通过学习得到合理的权重。另外,共享权重带来的直接好处是减少卷积神经网络各层之间的连接,同时又降低了过拟合的风险。
卷积神经网络可以采用误差反向传播(back propagation,BP)算法在训练过程中修正初始的超分辨率模型中参数的大小,使得超分辨率模型的重建误差损失越来越小。具体地,前向传递输入信号直至输出会产生误差损失,通过反向传播误差损失信息来更新初始的超分辨率模型中参数,从而使误差损失收敛。反向传播算法是以误差损失为主导的反向 传播运动,旨在得到最优的超分辨率模型的参数,例如权重矩阵。
如图3所示,卷积神经网络(CNN)100可以包括输入层110,卷积层/池化层120,其中池化层为可选的,以及神经网络层130。
如图3所示卷积层/池化层120可以包括如示例121-126层,在一种实现中,121层为卷积层,122层为池化层,123层为卷积层,124层为池化层,125为卷积层,126为池化层;在另一种实现方式中,121、122为卷积层,123为池化层,124、125为卷积层,126为池化层。即卷积层的输出可以作为随后的池化层的输入,也可以作为另一个卷积层的输入以继续进行卷积操作。
以卷积层121为例,卷积层121可以包括很多个卷积算子,卷积算子也称为核,其在图像处理中的作用相当于一个从输入图像矩阵中提取特定信息的过滤器,卷积算子本质上可以是一个权重矩阵,这个权重矩阵通常被预先定义。在对图像进行卷积操作的过程中,权重矩阵通常在输入图像上沿着水平方向一个像素接着一个像素(或两个像素接着两个像素……这取决于步长stride的取值)的进行处理,从而完成从图像中提取特定特征的工作。该权重矩阵的大小应该与图像的大小相关。需要注意的是,权重矩阵的纵深维度(depth dimension)和输入图像的纵深维度是相同的,在进行卷积运算的过程中,权重矩阵会延伸到输入图像的整个深度。因此,和一个单一的权重矩阵进行卷积会产生一个单一纵深维度的卷积化输出,但是大多数情况下不使用单一权重矩阵,而是应用维度相同的多个权重矩阵。每个权重矩阵的输出被堆叠起来形成卷积图像的纵深维度。不同的权重矩阵可以用来提取图像中不同的特征,例如一个权重矩阵用来提取图像边缘信息,另一个权重矩阵用来提取图像的特定颜色,又一个权重矩阵用来对图像中不需要的噪点进行模糊化等。该多个权重矩阵维度相同,经过该多个维度相同的权重矩阵提取后的特征图维度也相同,再将提取到的多个维度相同的特征图合并形成卷积运算的输出。
通常,权重矩阵中的权重值在实际应用中需要经过大量的训练得到,通过训练得到的权重值形成的各个权重矩阵可以从输入图像中提取信息,从而帮助卷积神经网络100进行正确的预测。
当卷积神经网络100有多个卷积层时,初始的卷积层(例如121)往往提取较多的一般特征,该一般特征也可以称之为低级别的特征;随着卷积神经网络100深度的加深,越往后的卷积层(例如126)提取到的特征越来越复杂,比如高级别的语义之类的特征,语义越高的特征越适用于待解决的问题。
池化层:
由于常常需要减少训练参数的数量,因此卷积层之后常常需要周期性的引入池化层,即如图3中120所示例的121-126各层,可以是一层卷积层后面跟一层池化层,也可以是多层卷积层后面接一层或多层池化层。在图像处理过程中,池化层的唯一目的就是减少图像的空间大小。池化层可以包括平均池化算子和/或最大池化算子,以用于对输入图像进行采样得到较小尺寸的图像。平均池化算子可以在特定范围内对图像中的像素值进行计算产生平均值。最大池化算子可以在特定范围内取该范围内值最大的像素作为最大池化的结果。另外,就像卷积层中用权重矩阵的大小应该与图像大小相关一样,池化层中的运算符也应 该与图像的大小相关。通过池化层处理后输出的图像尺寸可以小于输入池化层的图像的尺寸,池化层输出的图像中每个像素点表示输入池化层的图像的对应子区域的平均值或最大值。
神经网络层130:
在经过卷积层/池化层120的处理后,卷积神经网络100还不足以输出所需要的输出信息。因为如前所述,卷积层/池化层120只会提取特征,并减少输入图像带来的参数。然而为了生成最终的输出信息(所需要的类信息或别的相关信息),卷积神经网络100需要利用神经网络层130来生成一个或者一组所需要的类的数量的输出。因此,在神经网络层130中可以包括多层隐含层(如图3所示的131、132至13n)以及输出层140。在本申请中,该卷积神经网络为:对选取的起点网络进行至少一次变形得到串行网络,然后根据训练后的串行网络得到。该卷积神经网络可以用于图像识别,图像分类,图像超分辨率重建等等。
在神经网络层130中的多层隐含层之后,也就是整个卷积神经网络100的最后层为输出层140,该输出层140具有类似分类交叉熵的损失函数,具体用于计算预测误差,一旦整个卷积神经网络100的前向传播(如图3由110至140的传播为前向传播)完成,反向传播(如图3由140至110的传播为反向传播)就会开始更新前面提到的各层的权重值以及偏差,以减少卷积神经网络100的损失及卷积神经网络100通过输出层输出的结果和理想结果之间的误差。
需要说明的是,如图3所示的卷积神经网络100仅作为一种卷积神经网络的示例,在具体的应用中,卷积神经网络还可以以其他网络模型的形式存在,例如,如图4所示的多个卷积层/池化层并行,将分别提取的特征均输入给全神经网络层130进行处理。
参见附图5,本申请实施例还提供了一种系统架构300。执行设备210由一个或多个服务器实现,可选的,与其它计算设备配合,例如:数据存储、路由器、负载均衡器等设备;执行设备210可以布置在一个物理站点上,或者分布在多个物理站点上。执行设备210可以使用数据存储系统250中的数据,或者调用数据存储系统250中的程序代码实现本申请以下图6对应的训练集处理方法的步骤。
用户可以操作各自的用户设备(例如本地设备301和本地设备302)与执行设备210进行交互。每个本地设备可以表示任何计算设备,例如个人计算机、计算机工作站、智能手机、平板电脑、智能摄像头、智能汽车或其他类型蜂窝电话、媒体消费设备、可穿戴设备、机顶盒、游戏机等。
每个用户的本地设备可以通过任何通信机制/通信标准的通信网络与执行设备210进行交互,通信网络可以是广域网、局域网、点对点连接等方式,或它们的任意组合。具体地,该通信网络可以包括无线网络、有线网络或者无线网络与有线网络的组合等。该无线网络包括但不限于:第五代移动通信技术(5th-Generation,5G)系统,长期演进(long term evolution,LTE)系统、全球移动通信系统(global system for mobile communication,GSM)或码分多址(code division multiple access,CDMA)网络、宽带码分多址(wideband code division multiple access,WCDMA)网络、无线保真(wireless fidelity,WiFi)、蓝牙(bluetooth)、紫蜂协议(Zigbee)、射频识别技术(radio frequency identification, RFID)、远程(Long Range,Lora)无线通信、近距离无线通信(near field communication,NFC)中的任意一种或多种的组合。该有线网络可以包括光纤通信网络或同轴电缆组成的网络等。
在另一种实现中,执行设备210的一个方面或多个方面可以由每个本地设备实现,例如,本地设备301可以为执行设备210提供本地数据或反馈计算结果。
需要注意的,执行设备210的所有功能也可以由本地设备实现。例如,本地设备301实现执行设备210的功能并为自己的用户提供服务,或者为本地设备302的用户提供服务。
在一些场景中,可以在原样本的基础上增加较多的对抗样本,将原样本和对抗样本都加入训练集中进行训练,从而使训练得到的神经网络可以识别出对抗样本中的扰动。然而,对抗训练的效果受模型的影响较大,可能针对不同的模型产生了完全不同的效果,且对抗训练需要在训练过程中不断产生对抗样本,大大降低了训练效率,且可能造成训练得到的神经网络的输出准确率下降,即降低了神经网络的鲁棒性。鲁棒性可以理解为神经网络在面对输入的微小变化能保持输出值不变的能力。或者,在另一些场景中,可以针对对抗样本进行去噪,在神经网络前添加一个去噪网络,通过梯度下降算法减小成对的对抗样本和原样本产生的顶层表示的差距,从而使去噪网络达到对抗鲁棒效果。然而,该去噪网络需要有针对性地添加,在不同的训练场景中可能需要设定不同的去噪网络,泛化能力弱,导致训练效率低。
通常,神经网络的脆弱性源于在进行神经网络的训练的过程中,更倾向于学习到哪些在数据分布流行之外的变化比较剧烈的函数,即神经网络主要依靠在线性空间中变化比较小,但同样包含可以用来分类的信息的那些分量施行分类,该分量即前述的除主分量外的分量。为便于理解,可以理解为,训练集的样本中所包括的主分量之外的其他分量,对神经网络的训练产生了较大影响,其往往具有较高的线性可分性而更容易由神经网络学得并泛化,这些主分量之外的其他分量影响神经网络的鲁棒性的主要原因,降低了神经网络的鲁棒性,该现象在以下称为梯度泄漏现象。
因此,本申请提供一种训练集处理方法,通过在训练之前,对训练集进行处理,提取每个样本的主分量,得到新的样本,组成第二训练集,该第二训练集中所包括的样本包括了原样本中的主分量,从而使通过第二训练集训练神经网络,可以提升神经网络的鲁棒性。
参阅图6,本申请提供的一种训练集处理方法的流程示意图,如下所述。
601、获取第一训练集的基和对应的离散序列。
其中,可以对第一训练集包括的所有数据进行分解,得到第一训练集的基和该基对应的离散序列,该第一训练集中包括多个样本,该基可以包括一个或者多个基向量,该离散序列用于表示基的离散程度,该离散序列可以包括与基中的每个基向量一一对应的离散值。
为便于理解,前述的基可以理解为空间,该空间中可以包括一个或者多个基向量,离散序列用于表示第一训练集所包括的数据在基中的分散程度。
应理解,第一训练集所包括的样本的类型,与需要训练的神经网络相关。例如,若需要训练分类网络,则第一训练集中可以包括大量的已进行分类的图像,若需要训练人脸识别网络,则第一训练集中可以包括大量的人脸图像等。
在一种可选的实施方式中,前述的离散值可以是方差、标准差或者极差等用于表示离散程度的值。下面示例性地,以方差来表示本申请实施例中的基的离散程度为例进行示例性说明,应理解,以下所提及的方差也可以替换为标准差或者极差等用于表示离散程度的值,以下不再赘述。
具体地,对第一训练集进行分解的方式可以有多种,如PCA或者稀疏编码算法等。
例如,可以通过稀疏编码算法对第一训练集进行分解。针对数据集X,解优化问题
其中A
i是A的第i列,S
i,X
i同理;||.||
p代表L
p范数,λ是正则项;从而得到X
i的稀疏编码S
i和字典矩阵(即基)A。
又例如,对第一训练集进行PCA处理,得到正交基和正交基对应的离散序列。PCA是对通过输入数据的协方差矩阵进行正交谱分解,以确定数据点之间主要变化的线性方向,从而实现维数缩减的算法。为便于理解,该PCA处理可以理解为对输入数据,即第一数据集的协方差矩阵进行正交谱分解以确定数据点之间主要变化的线性方向,从而实现降维的算法。为便于理解,下面示例性地,以对第一训练集进行PCA处理为例,对后续的步骤进行示例性说明。
在一种可能的实施方式中,前述的对第一训练集进行主成分分析PCA处理,得到正交基和正交基对应的离散序列,具体可以包括:对第一训练集进行中心化处理,得到中心化处理后的第一训练集。然后对中心化后的第一训练集进行PCA处理,得到正交基和该正交基对应的离散序列,该离散序列为包括了中心化后的第一训练集在正交基中的方差组成的序列,离散序列所包括的方差呈递减排列,且离散序列所包括的方差按顺序和正交基中的基向量按顺序一一对应。
前述的中心化处理可以理解为零均值化,即检测第一训练集所包括的所有数据的均值,在空间中平移第一训练集,如将第一训练集中的所有数据减均值,使第一训练集所包括的所有数据的均值为0,得到中心化后的第一训练集。
在一种可能的实施方式中,在计算得到每个基向量对应的离散值,即方差之后,可以对计算得到的方差进行排序,按照递减的顺序进行排列,得到离散序列。然后对正交基所包括的基向量进行排序,且正交基中的基向量的排列方式与离散序列中的排序方式对应。例如,正交基可以表示为{v_1,v_2,…..,v_N},离散序列可以表示为{λ_1,λ_2,…..,λ_N},基向量v_1对应的方差为λ_1,基向量v_2对应的方差为λ_2等,以此类推。
当然,离散序列中的也可以按照其他方式进行排序,例如,可以按照递增的顺序排列、或者按照其他设定的规律等,相应地,正交基中的基向量也可以按照与离散序列对应的排序方式进行排列。
602、获取第一训练集中的每个样本在基中的分量值,得到多组第一编码数据。
其中,在对第一训练集进行分解得到基和对应的离散序列之后,获取第一训练集中的每个样本在基中的每个基向量中的分量值,得到多组第一编码数据,每个样本在每个基向量中的分量值组成一组第一编码数据。
为便于理解,前述的基可以理解为第一训练集所包括的数据组成的空间,基向量即表示该空间内的方向,步骤602即获取每个样本投影到每个方向上的分量值,从而得到每个 样本的第一编码数据。
可选地,若对第一训练集进行PCA处理,得到正交基和对应的离散序列,则可以获取第一训练集中的每个样本在正交基中的分量,得到每个样本对应的第一编码数据。
可选地,若在步骤601中,对第一训练集进行了中心化,则步骤602中的第一训练集可以替换为中心化后的第一训练集。
可选地,可以通过预设算法计算第一训练集中的每个样本在基中的分量值,得到多组第一编码数据。该预设算法可以包括内积运算或者稀疏编码运算等。例如,以内积运算为例,可以对第一训练集中的每个样本和基中的每个基向量进行内积运算,得到每个样本的第一编码数据。
603、获取多组第一编码数据中的每组第一编码数据中的主分量,得到多组第二编码数据。
其中,在得到每个样本的第一编码数据之后,提取该多组第一编码数据中每组第一编码数据中的主分量,从而得到多组第二编码数据。该主分量可以理解为对应的离散值大于预设离散值的分量,或者说,该主分量可以理解为第一编码数据中对应的离散值最大的预设数量的分量。
例如,前述步骤601中的基可以是正交基,该正交基可以表示为{v_1,v_2,…..,v_N},离散序列可以表示为{λ_1,λ_2,…..,λ_N},且正交基中的基向量与离散序列中的方差按顺序一一对应。第一编码数据可以表示为a:{a_1,a_2,……,a_N},该第一编码数据所包括的分量与离散序列中的方差按顺序一一对应,因此,可以根据确定出离散序列中大于预设离散值的方差,并从第一编码数据中确定出与该大于预设离散值的方差对应的分量作为主分量,得到第二编码数据。例如,当离散值以递减的顺序排列时,从a:{a_1,a_2,……,a_N}可以提取得到a’:{a_1,a_2,……,a_K},a’即一组第二编码数据,K小于或者等于N。
在一种可能的实施方式中,可以保留每组第一编码数据中的主分量,将每组第一编码数据中除主分量外的其他分量替换为预设的值,得到多组第二编码数据。其中,每组第一编码数据可以对应一个或者多组第二编码数据。例如,可以将每组第一编码数据中除主分量外的其他分量通过多种不同的方式替换,得到多组第二编码数据,从而得到每组第一编码数据对应的多组第二编码数据。
可选地,该预设的值可以包括0或者预设的噪声向量。该预设的噪声向量可以包括与样本的真实值独立的噪声,或者与样本的真实值独立,但与第一训练集中的数据分布类似的噪声,或者特定分布的噪声等。例如,该预设的噪声向量可以是高斯噪声或者均匀分布特征等。因此,在本申请实施方式中,通过将除主要分量之外的其他分量替换为0或者噪声向量的方式,消除该部分分量对训练神经网络时的影响,使后续在训练神经网络时,可以以主分量为主,得到鲁棒性更优的神经网络。
在一种可能的实施方式中,若将每组第一编码数据中除主分量外的其他分量替换为噪声,则替换的噪声可以与替换前的分量对应的方差成比例。例如,噪声可以是原分量对应的方差的5倍、10倍等。因此,本申请实施方式中,替换后的噪声的分布规律可以与原分量的方差的分布规律类似,从而降低对后续训练神经网络的影响,使得在训练神经网络的 过程中,在使用主分量进行训练,得到鲁棒性更优的神经网络的前提下,避免对神经网络的输出准确率的影响,得到鲁棒性和输出准确率更平衡的神经网络。可以理解为,若前述步骤601中对第一训练集采用PCA处理,本申请实施方式中,可以在PCA子空间的法方向增加一定大小的噪声,以抑制梯度泄漏现象。
在一种可能的场景中,若离散序列中的方差值按照递减的顺序排列,相应地,第一编码数据所包括的分量的排列顺序与离散序列中的方差的排列顺序对应,确定大于预设离散值的方差的数量d,该d为正整数,保留第一编码数据中的前d个分量,将第d+1至第D个分量替换为与分量对应的方差成比例的独立高斯噪声,并将第D个分量之后的分量替换为0,得到第二编码数据。因此,在此场景中,可以将第一编码数据中除主分量外的其他分量替换为0或者噪声,从而使后续进行神经网络训练时,可以使用主分量进行训练,可以避免对抗样本中的扰动对神经网络造成的影响,提高神经网络的鲁棒性。
604、将多组第二编码数据映射至第一训练集的基,得到多组第二编码数据对应的样本。
在得到多组第二编码数据之后,将多组第二编码数据映射至第一训练集的基中,得到多组第二编码数据中每组第二编码数据对应的新的样本,该多组第二编码数据对应的样本组成第二训练集。为便于理解,第一训练集的基可以理解为一个空间,第二编码数据中包括了该空间内的一个或者多个方向上的分量值,将一组第二编码数据映射至该空间中,即可得到新的样本。
具体地,在得到第二编码数据之后,可以根据第二编码数据对前述步骤601中的基进行映射,得到每组第二编码数据对应的新样本。该多组第二编码数据对应的多个新样本组成第二训练集。为便于理解,可以将前述步骤601中提及的基理解为空间,第二编码数据中即包括新样本在每个基向量的方向上投影的值,对第二编码数据所包括的分量在基中进行映射,即可得到新的样本。
可选地,在得到新样本组成的第二训练集之后,即可使用该第二训练集进行神经网络训练,得到鲁棒性更优的神经网络。
因此,在本申请实施方式中,在提取到每个样本在基中第一编码数据中的主分量之后,得到降低了干扰之后的第二编码数据,可以根据第二编码数据得到新的样本,并使用新的样本进行神经网络训练。而新的样本中减少了除主要分量外的其他分量的干扰,从而使得训练得到的神经网络可以通过主分量进行训练,提高神经网络的鲁棒性。并且,本申请提供的训练集处理方法,针对训练集进行了处理,处理方式仅与训练集本身的主分量的分布有关,因此,即使在不同的场景中训练不同的模型,也可以使用本申请提供的训练集处理方法对训练集进行处理,泛化能力强,不依赖于被训练模型的通用算法,从而具有较高的通用性。
通常,神经网络模型对于对抗样本容易误分类。对抗样本即包括了扰动信息的样本,对抗样本所包括的扰动将降低神经网络的输出准确率。该对抗样本即包括了扰动信息的样本,该对抗样本所包括的扰动将影响后续训练得到的神经网络的鲁棒性,降低神经网络的输出准确率。示例性地,对抗样本的示意图可以如图7所示,图像A1为未包括扰动的图像,在图像A1的基础上叠加扰动信息A2,0.007标识添加的扰动信息的系数,从而得到增加了 扰动信息的图像A3,该图像A3即对抗样本。通常,对抗样本中包括了扰动信息,该扰动信息容易造成神经网络的识别错误,如图像A1的实际分类为熊猫,添加了扰动信息之后的图像3则可能被识别为分类为狗,因此,若使用该对抗样本进行训练,则可能导致神经网络的鲁棒性差。而本申请实施方式中,在使用训练集进行神经网络训练之前,对训练集进行了处理,减少了训练集中每个样本中的扰动部分,从而使后续进行神经网络训练时,可以使用减少了扰动的训练集进行训练,避免样本中的扰动对神经网络的影响,提高神经网络的鲁棒性。
而本申请实施方式中,以通过消除干扰的方式,使后续训练神经网络时,以样本的主分量为主,训练得到鲁棒性更优的神经网络。且可以以样本的主分量为主,训练得到神经网络,在提升神经网络的鲁棒性的同时,减少对神经网络的输出准确率的影响,得到鲁棒性和输出准确率均衡的神经网络。
可以理解为,在本申请提供的训练集处理方法中,保留了原样本对应的编码数据中的主分量,将除主分量外的其他分量替换为噪声或者0,从而得到消除了除主分量外的其他分量的新样本。在使用包括了新样本的训练集进行神经网络训练时,可以以主分量为主进行训练,减少了样本中所包括的扰动。相当于在训练的过程中,引入了数据流形来对对抗样本进行防御,以提升神经网络的鲁棒性。数据流形可以理解为,假设中的一个嵌入在数据真实维数的线性空间,但维度远低于该空间的流形,观察得到的输入数据点都分布在其附近,类似自然图像等神经网络擅长分类的数据基本都符合该分布假设。通常,不同的样本的主分量的差异较大,对主分量成功分类,可以得到较高的鲁棒性的神经网络。从而在不降低神经网络的输出准确率的基础上,提升了神经网络的鲁棒性,抑制了神经网络训练过程中的梯度泄漏的问题。
前述对本申请提供的训练集处理方法的流程进行了详细说明,为便于理解,下面结合具体的应用场景,对本申请提供的训练集处理方法进行更详细的说明。
第一训练集中的样本可以表示为一个数据点x
i,该第一训练集可以是N*D维的数据集,该第一数据集可以表示为X=[x
1,…x
N]
T。对训练集进行PCA投影之后,得到正交基{v_1,v_2,…..,v_N},和对应的离散序列{λ_1,λ_2,…..,λ_N},且离散序列所包括的方差呈递减排列。确定主分量所包括的分量维数d,增加的噪声维数m,以及噪声大小c。
随后,即可使用新的第二训练集进行神经网络训练。
因此,在本场景中,将主分量为的其他分量替换为了与对应的方差成比例的噪声,在不影响神经网络的训练过程的基础上,提升神经网络的鲁棒性。
为便于理解,对另一些具体的场景进行示例性说明。
首先,对训练集{(x
i,y
i)},i=1,2,…,n中的输入数据(设为行向量)进行中心化,得到
然后计算器协方差矩阵:
设其正交对角化结果为U
Tdiag(B)U,其中,B为一个维度与输入数据(即训练集中的样本)相同的非负向量,表示输入数据在这些方向上的变化量的大小。
然后取样本的公式可以包括:
Ux
old即表示前述的第一编码数据,s为尺度缩放向量,∈为噪声向量,c为大于1的常数。通常,可以取s为截断向量{1,1,…,1,1,0,0,….,0},1的数量为截断超参数,即前述的预设值d。为了达到鲁棒目的,一般需要令对应尺度较小的分量进一步被压制,∈可以取在截断值附近的标准正态分布向量(即在截断值附近的维度为标准正态分布,其他维度为0)。
可选地,前述的尺度缩放向量可以替换为平滑向量,如该平滑向量中的某一个点可以表示为s
i=sigmoid(-i+d),d表示软截断阈值,i表示维度的下标。
或者,可选地,前述的尺度缩放向量也可以替换为随机向量,如该随机向量中的某一个点可以表示为s
i=Bernoulli(sigmoid(-i+d))。
或者,前述的噪声向量也可以替换为非高斯分布,但与样本本身的分布独立的其他方差水平类似的向量。
因此,在本场景中,提出了一种检测并改善训练集中非鲁棒部分导致神经网络对抗脆弱性的方法,本申请提供的方法具有通用性和高效性,可以直接适用于大多数任务和网络架构,泛化能力强,在提高神经网络的鲁棒性的基础上,可以训练得到输出准确率更高的神经网络,得到鲁棒性和输出准确率达到均衡的神经网络。
通常,以分类网络为例,若采用在测试阶段进行投影的防御方法,即在测试阶段对对抗样本中的扰动进行训练,由于投影到的流形相比于真实的数据流形存在误差,训练时使用的是未经过投影的数据来训练,则模型对被投影到的流形上的数据的分类效果是未知的。一方面会导致明显的分类精度下降,另一方面由于分类网络没有在该流形上良好训练,较容易找到该流形上的对抗样本。而本申请提供的方法中,在训练中就进行投影操作,可以避免前述的问题。此外,通过本申请提供的方法得到的训练集,训练得到的分类网络在测试时可不必对输入数据进行投影,提升了训练效率。
若采用对抗样本进行训练,往往需要数倍的时间和更高的计算资源以计算输入样本的对抗样本。而本申请提供的方法中,将相对本质的流形外对抗方向分开进行加噪声增广,避免了在模型训练时产生的流形内,误分类样本训练造成的难度提升和原测试集准确率下降。因此本发明能够在鲁棒准确率和原测试集准确率之间有更好和更灵活的权衡取舍。并且,本申请可以根据应用场景需要,通过调节参数d和所加噪声具体的分布及幅度,可以灵活调节模型训练最终的准确率,调整神经网络的输出准确率和鲁棒性的均衡。
前述对本申请提供的方法进行了详细介绍,下面基于前述的方法,对本申请提供的装 置进行介绍。
参阅图8,本申请提供的一种训练集处理装置的结构示意图,该训练集处理装置用于执行前述图6中的方法的步骤。
该训练集处理装置可以包括:
分解单元801,用于根据第一训练集进行分解获得第一训练集的基和该基对应的离散序列,第一训练集中包括多个样本,基中包括至少一个基向量,离散程度包括与基中的每个基向量一一对应的离散值,该离散序列可以用于表示基的离散程度;
获取单元802,用于获取第一训练集中的每个样本在基中的分量值,得到多组第一编码数据,每组第一编码数据对应一个样本;
获取单元802,还用于获取多组第一编码数据中的每组第一编码数据中的主分量,得到多组第二编码数据,主分量对应的离散值高于预设离散值,每个第一;
映射单元803,用于将多组第二编码数据映射至第一训练集的基中,得到多组第二编码数据对应的样本,多组第二编码数据对应的样本组成第二训练集,第二训练集用于训练神经网络。
在一种可能的实施方式中,基为正交基,分解单元801,具体用于对第一训练集进行主成分分析PCA处理,得到正交基和正交基中对应的离散序列。
在一种可能的实施方式中,分解单元801,具体用于:对第一训练集进行中心化处理,得到中心化后的第一训练集,中心化后的第一训练集包括的数据的均值为0;对中心化后的第一训练集进行PCA处理,得到正交基,以及正交基的离散序列,离散序列包括中心化后的第一训练集在正交基中的方差组成的序列。
在一种可能的实施方式中,分解单元801,具体用于通过预设算法,计算中心化后的第一训练集中的每个样本在正交基中的每个基向量上的分量值,得到多组第一编码数据。
在一种可能的实施方式中,预设算法包括内积运算或者稀疏编码运算。
在一种可能的实施方式中,获取单元802,具体用于保留每组第一编码数据中的主分量,将每组第一编码数据中除主分量外的其他分量替换为预设的值,得到多组第二编码数据,其中,每组第一编码数据的主分量组成至少一组第二编码数据。
在一种可能的实施方式中,预设的值包括0或者预设的噪声向量,预设的噪声向量包括高斯噪声或者均匀分布噪声。
在一种可能的实施方式中,预设的噪声向量与替换的分量对应的方差成比例。
请参阅图9,本申请提供的另一种训练集处理装置的结构示意图,如下所述。
该训练集处理装置可以包括处理器901和存储器902。该处理器901和存储器902通过线路互联。其中,存储器902中存储有程序指令和数据。
存储器902中存储了前述图6中的步骤对应的程序指令以及数据。
处理器901用于执行前述图6中任一实施例所示的训练集处理装置执行的方法步骤。
可选地,该训练集处理装置还可以包括收发器903,用于接收或者发送数据。
本申请实施例中还提供一种计算机可读存储介质,该计算机可读存储介质中存储有用于生成车辆行驶速度的程序,当其在计算机上行驶时,使得计算机执行如前述图6所示实 施例描述的方法中的步骤。
可选地,前述的图9中所示的训练集处理装置为芯片。
本申请实施例还提供了一种训练集处理装置,该训练集处理装置也可以称为数字处理芯片或者芯片,芯片包括处理单元和通信接口,处理单元通过通信接口获取程序指令,程序指令被处理单元执行,处理单元用于执行前述图6中任一实施例所示的训练集处理装置执行的方法步骤。
本申请实施例还提供一种数字处理芯片。该数字处理芯片中集成了用于实现上述处理器901,或者处理器901的功能的电路和一个或者多个接口。当该数字处理芯片中集成了存储器时,该数字处理芯片可以完成前述实施例中的任一个或多个实施例的方法步骤。当该数字处理芯片中未集成存储器时,可以通过通信接口与外置的存储器连接。该数字处理芯片根据外置的存储器中存储的程序代码来实现上述实施例中训练集处理装置执行的动作。
本申请实施例中还提供一种包括计算机程序产品,当其在计算机上行驶时,使得计算机执行如前述图6所示实施例描述的方法中训练集处理装置所执行的步骤。
本申请实施例提供的训练集处理装置可以为芯片,芯片包括:处理单元和通信单元,所述处理单元例如可以是处理器,所述通信单元例如可以是输入/输出接口、管脚或电路等。该处理单元可执行存储单元存储的计算机执行指令,以使服务器内的芯片执行上述图6所示实施例描述的训练集处理方法。可选地,所述存储单元为所述芯片内的存储单元,如寄存器、缓存等,所述存储单元还可以是所述无线接入设备端内的位于所述芯片外部的存储单元,如只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)等。
具体地,前述的处理单元或者处理器可以是中央处理器(central processing unit,CPU)、网络处理器(neural-network processing unit,NPU)、图形处理器(graphics processing unit,GPU)、数字信号处理器(digital signal processor,DSP)、专用集成电路(application specific integrated circuit,ASIC)或现场可编程逻辑门阵列(field programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者也可以是任何常规的处理器等。
示例性地,请参阅图10,图10为本申请实施例提供的芯片的一种结构示意图,所述芯片可以表现为神经网络处理器NPU 100,NPU 100作为协处理器挂载到主CPU(Host CPU)上,由Host CPU分配任务。NPU的核心部分为运算电路1003,通过控制器1004控制运算电路1003提取存储器中的矩阵数据并进行乘法运算。
在一些实现中,运算电路1003内部包括多个处理单元(process engine,PE)。在一些实现中,运算电路1003是二维脉动阵列。运算电路1003还可以是一维脉动阵列或者能够执行例如乘法和加法这样的数学运算的其它电子线路。在一些实现中,运算电路1003是通用的矩阵处理器。
举例来说,假设有输入矩阵A,权重矩阵B,输出矩阵C。运算电路从权重存储器1002中取矩阵B相应的数据,并缓存在运算电路中每一个PE上。运算电路从输入存储器1001 中取矩阵A数据与矩阵B进行矩阵运算,得到的矩阵的部分结果或最终结果,保存在累加器(accumulator)1008中。
统一存储器1006用于存放输入数据以及输出数据。权重数据直接通过存储单元访问控制器(direct memory access controller,DMAC)1005,DMAC被搬运到权重存储器1002中。输入数据也通过DMAC被搬运到统一存储器1006中。
总线接口单元(bus interface unit,BIU)1010,用于AXI总线与DMAC和取指存储器(instruction fetch buffer,IFB)1009的交互。
总线接口单元1010(bus interface unit,BIU),用于取指存储器1009从外部存储器获取指令,还用于存储单元访问控制器1005从外部存储器获取输入矩阵A或者权重矩阵B的原数据。
DMAC主要用于将外部存储器DDR中的输入数据搬运到统一存储器1006或将权重数据搬运到权重存储器1002中或将输入数据数据搬运到输入存储器1001中。
向量计算单元1007包括多个运算处理单元,在需要的情况下,对运算电路的输出做进一步处理,如向量乘,向量加,指数运算,对数运算,大小比较等等。主要用于神经网络中非卷积/全连接层网络计算,如批归一化(batch normalization),像素级求和,对特征平面进行上采样等。
在一些实现中,向量计算单元1007能将经处理的输出的向量存储到统一存储器1006。例如,向量计算单元1007可以将线性函数和/或非线性函数应用到运算电路1003的输出,例如对卷积层提取的特征平面进行线性插值,再例如累加值的向量,用以生成激活值。在一些实现中,向量计算单元1007生成归一化的值、像素级求和的值,或二者均有。在一些实现中,处理过的输出的向量能够用作到运算电路1003的激活输入,例如用于在神经网络中的后续层中的使用。
控制器1004连接的取指存储器(instruction fetch buffer)1009,用于存储控制器1004使用的指令;
统一存储器1006,输入存储器1001,权重存储器1002以及取指存储器1009均为On-Chip存储器。外部存储器私有于该NPU硬件架构。
其中,循环神经网络中各层的运算可以由运算电路1003或向量计算单元1007执行。
其中,上述任一处提到的处理器,可以是一个通用中央处理器,微处理器,ASIC,或一个或多个用于控制上述图6的方法的程序执行的集成电路。
另外需说明的是,以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。另外,本申请提供的装置实施例附图中,模块之间的连接关系表示它们之间具有通信连接,具体可以实现为一条或多条通信总线或信号线。
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到本申请可借助软件加必需的通用硬件的方式来实现,当然也可以通过专用硬件包括专用集成电路、专用CPU、 专用存储器、专用元器件等来实现。一般情况下,凡由计算机程序完成的功能都可以很容易地用相应的硬件来实现,而且,用来实现同一功能的具体硬件结构也可以是多种多样的,例如模拟电路、数字电路或专用电路等。但是,对本申请而言更多情况下软件程序实现是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在可读取的存储介质中,如计算机的软盘、U盘、移动硬盘、只读存储器(read only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。
所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存储的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘(solid state disk,SSD))等。
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”、“第四”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的实施例能够以除了在这里图示或描述的内容以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。
最后应说明的是:以上,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。
Claims (19)
- 一种训练集处理方法,其特征在于,包括:根据第一训练集获得所述第一训练集的基和所述基的离散序列,所述第一训练集中包括多个样本,所述基中包括至少一个基向量,所述离散序列包括与所述基中的每个基向量一一对应的离散值;获取所述第一训练集中的每个样本在所述每个基向量上的分量值,以得到多组第一编码数据,每组第一编码数据对应一个样本;获取所述多组第一编码数据中的每组第一编码数据中的主分量,得到多组第二编码数据,所述主分量的离散值高于预设离散值;将所述多组第二编码数据映射至所述第一训练集的基,得到所述多组第二编码数据对应的样本,所述多组第二编码数据对应的样本组成第二训练集,所述第二训练集用于训练神经网络。
- 根据权利要求1所述的方法,其特征在于,所述第一训练集的基为正交基,所述根据第一训练集获得所述第一训练集的基和所述基的离散序列,包括:对所述第一训练集进行主成分分析PCA处理,得到所述正交基和所述正交基的离散序列。
- 根据权利要求2所述的方法,其特征在于,所述对所述第一训练集进行主成分分析PCA处理,得到正交基和所述正交基的离散序列,包括:对所述第一训练集进行中心化处理,得到中心化后的第一训练集,所述中心化后的第一训练集包括的数据的均值为0;对所述中心化后的第一训练集进行所述PCA处理,得到所述正交基,以及所述正交基的离散序列,所述离散序列包括所述中心化后的第一训练集在所述正交基中的方差组成的序列。
- 根据权利要求3所述的方法,其特征在于,所述获取所述第一训练集中的每个样本在所述每个基向量上的分量值,包括:通过预设算法,计算所述中心化后的第一训练集中的每个样本在所述正交基中的每个基向量的分量值,得到所述多组第一编码数据。
- 根据权利要求4所述的方法,其特征在于,所述预设算法包括内积运算或者稀疏编码运算。
- 根据权利要求1-5中任一项所述的方法,其特征在于,所述获取所述每组第一编码数据中的主分量,得到多组第二编码数据,包括:保留所述每组第一编码数据中的所述主分量,将所述每组第一编码数据中除所述主分量外的其他分量替换为预设的值,得到所述多组第二编码数据,其中,所述每组第一编码数据的主分量组成至少一组第二编码数据。
- 根据权利要求6所述的方法,其特征在于,所述预设的值包括0或者预设的噪声向量,所述预设的噪声向量包括高斯噪声或者均匀分布噪声。
- 根据权利要求7所述的方法,其特征在于,所述预设的噪声向量与被替换的分量的 离散值成比例。
- 一种训练集处理装置,其特征在于,包括:分解单元,用于根据第一训练集获得所述第一训练集的基和所述基的离散序列,所述第一训练集中包括多个样本,所述基中包括至少一个基向量,所述离散程度包括与所述基中的每个基向量一一对应的离散值;获取单元,用于获取所述第一训练集中的每个样本在所述每个基向量上的分量值,以得到多组第一编码数据,每组第一编码数据对应一个样本;所述获取单元,还用于获取所述多组第一编码数据中的每组第一编码数据中的主分量,得到多组第二编码数据,所述主分量的离散值高于预设离散值,其中,所述每组第一编码数据的主分量组成至少一组第二编码数据;映射单元,用于将所述多组第二编码数据映射至所述第一训练集的基,得到所述多组第二编码数据对应的样本,所述多组第二编码数据对应的样本组成第二训练集,所述第二训练集用于训练神经网络。
- 根据权利要求9所述的装置,其特征在于,所述基为正交基,所述分解单元,具体用于对所述第一训练集进行主成分分析PCA处理,得到所述正交基和所述正交基的离散序列。
- 根据权利要求10所述的装置,其特征在于,所述分解单元,具体用于:对所述第一训练集进行中心化处理,得到中心化后的第一训练集,所述中心化后的第一训练集包括的数据的均值为0;对所述中心化后的第一训练集进行所述PCA处理,得到所述正交基,以及所述正交基的离散序列,所述离散序列包括所述中心化后的第一训练集在所述正交基中的方差组成的序列。
- 根据权利要求11所述的装置,其特征在于,所述分解单元,具体用于通过预设算法,计算所述中心化后的第一训练集中的每个样本在所述正交基中的每个基向量的分量值,得到所述多组第一编码数据。
- 根据权利要求12所述的装置,其特征在于,所述预设算法包括内积运算或者稀疏编码运算。
- 根据权利要求9-13中任一项所述的装置,其特征在于,所述获取单元,具体用于保留所述每组第一编码数据中的所述主分量,将所述每组第一编码数据中除所述主分量外的其他分量替换为预设的值,得到所述多组第二编码数据。
- 根据权利要求14所述的装置,其特征在于,所述预设的值包括0或者预设的噪声向量,所述预设的噪声向量包括高斯噪声或者均匀分布噪声。
- 根据权利要求15所述的装置,其特征在于,所述预设的噪声向量与被替换的分量的离散值成比例。
- 一种训练集处理装置,其特征在于,包括处理器,所述处理器和存储器耦合,所述存储器存储有程序,当所述存储器存储的程序指令被所述处理器执行时实现权利要求1 至8中任一项所述的方法。
- 一种计算机可读存储介质,包括程序,当其被处理单元所执行时,执行如权利要求1至8中任一项所述的方法。
- 一种训练集处理装置,其特征在于,包括处理单元和通信接口,所述处理单元通过所述通信接口获取程序指令,当所述程序指令被所述处理单元执行时实现权利要求1至8中任一项所述的方法。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010692947.9A CN114091554B (zh) | 2020-07-17 | 2020-07-17 | 一种训练集处理方法和装置 |
| CN202010692947.9 | 2020-07-17 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2022012668A1 true WO2022012668A1 (zh) | 2022-01-20 |
Family
ID=79554489
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2021/106758 Ceased WO2022012668A1 (zh) | 2020-07-17 | 2021-07-16 | 一种训练集处理方法和装置 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN114091554B (zh) |
| WO (1) | WO2022012668A1 (zh) |
Cited By (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114547482A (zh) * | 2022-03-03 | 2022-05-27 | 智慧足迹数据科技有限公司 | 业务特征生成方法、装置、电子设备及存储介质 |
| CN114579851A (zh) * | 2022-02-25 | 2022-06-03 | 电子科技大学 | 一种基于自适应性节点特征生成的信息推荐方法 |
| CN116910526A (zh) * | 2023-01-16 | 2023-10-20 | 中国移动通信有限公司研究院 | 模型训练方法、装置、通信设备及可读存储介质 |
| CN117152486A (zh) * | 2023-07-26 | 2023-12-01 | 北京工业大学 | 一种基于可解释性的图像对抗样本检测方法 |
| CN117349764A (zh) * | 2023-12-05 | 2024-01-05 | 河北三臧生物科技有限公司 | 一种干细胞诱导数据智能分析方法 |
| CN120340506A (zh) * | 2025-05-14 | 2025-07-18 | 智明日新(南京)人工智能科技有限公司 | 一种基于多模态大模型的asr音频语料的生成方法和装置 |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114612688B (zh) * | 2022-05-16 | 2022-09-09 | 中国科学技术大学 | 对抗样本生成方法、模型训练方法、处理方法及电子设备 |
Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108896499A (zh) * | 2018-05-09 | 2018-11-27 | 西安建筑科技大学 | 结合主成分分析与正则化多项式的光谱反射率重建方法 |
Family Cites Families (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8595164B2 (en) * | 2011-01-27 | 2013-11-26 | Ming-Chui DONG | Wavelet modeling paradigms for cardiovascular physiological signal interpretation |
| CN110321929A (zh) * | 2019-06-04 | 2019-10-11 | 平安科技(深圳)有限公司 | 一种提取文本特征的方法、装置及存储介质 |
-
2020
- 2020-07-17 CN CN202010692947.9A patent/CN114091554B/zh active Active
-
2021
- 2021-07-16 WO PCT/CN2021/106758 patent/WO2022012668A1/zh not_active Ceased
Patent Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108896499A (zh) * | 2018-05-09 | 2018-11-27 | 西安建筑科技大学 | 结合主成分分析与正则化多项式的光谱反射率重建方法 |
Non-Patent Citations (3)
| Title |
|---|
| INDRANIL CHAKRABORTY; DEBOLEENA ROY; ISHA GARG; AAYUSH ANKIT; KAUSHIK ROY: "Constructing Energy-efficient Mixed-precision Neural Networks through Principal Component Analysis for Edge Intelligence", ARXIV.ORG, CORNELL UNIVERSITY LIBRARY, 201 OLIN LIBRARY CORNELL UNIVERSITY ITHACA, NY 14853, 4 June 2019 (2019-06-04), 201 Olin Library Cornell University Ithaca, NY 14853 , XP081543655 * |
| PENGUIN MEDIA CONTENT PLATFORM – AI CLASSROOM: "Face Recognition Based on PCA for Dimensionality Reduction and BP Neural Network", 27 April 2018 (2018-04-27), Retrieved from the Internet <URL:https://cloud.tencent.com/developer/news/193912> * |
| SOME HINTS ON MACHINE LEARNING ALGORITHMS: "Summary of Principal Components Analysis (PCA)", 22 October 2019 (2019-10-22), Retrieved from the Internet <URL:https://tianchi.aliyun.com/forum/postDetail?postId=79395> * |
Cited By (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114579851A (zh) * | 2022-02-25 | 2022-06-03 | 电子科技大学 | 一种基于自适应性节点特征生成的信息推荐方法 |
| CN114579851B (zh) * | 2022-02-25 | 2023-03-14 | 电子科技大学 | 一种基于自适应性节点特征生成的信息推荐方法 |
| CN114547482A (zh) * | 2022-03-03 | 2022-05-27 | 智慧足迹数据科技有限公司 | 业务特征生成方法、装置、电子设备及存储介质 |
| CN114547482B (zh) * | 2022-03-03 | 2023-01-20 | 智慧足迹数据科技有限公司 | 业务特征生成方法、装置、电子设备及存储介质 |
| CN116910526A (zh) * | 2023-01-16 | 2023-10-20 | 中国移动通信有限公司研究院 | 模型训练方法、装置、通信设备及可读存储介质 |
| CN117152486A (zh) * | 2023-07-26 | 2023-12-01 | 北京工业大学 | 一种基于可解释性的图像对抗样本检测方法 |
| CN117349764A (zh) * | 2023-12-05 | 2024-01-05 | 河北三臧生物科技有限公司 | 一种干细胞诱导数据智能分析方法 |
| CN117349764B (zh) * | 2023-12-05 | 2024-02-27 | 河北三臧生物科技有限公司 | 一种干细胞诱导数据智能分析方法 |
| CN120340506A (zh) * | 2025-05-14 | 2025-07-18 | 智明日新(南京)人工智能科技有限公司 | 一种基于多模态大模型的asr音频语料的生成方法和装置 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN114091554B (zh) | 2026-01-20 |
| CN114091554A (zh) | 2022-02-25 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN113705769B (zh) | 一种神经网络训练方法以及装置 | |
| CN114255361B (zh) | 神经网络模型的训练方法、图像处理方法及装置 | |
| CN113807399B (zh) | 一种神经网络训练方法、检测方法以及装置 | |
| CN113570029B (zh) | 获取神经网络模型的方法、图像处理方法及装置 | |
| CN111797983B (zh) | 一种神经网络构建方法以及装置 | |
| WO2022042713A1 (zh) | 一种用于计算设备的深度学习训练方法和装置 | |
| WO2022083536A1 (zh) | 一种神经网络构建方法以及装置 | |
| CN113011562B (zh) | 一种模型训练方法及装置 | |
| US20230082597A1 (en) | Neural Network Construction Method and System | |
| CN114091554B (zh) | 一种训练集处理方法和装置 | |
| CN112651511A (zh) | 一种训练模型的方法、数据处理的方法以及装置 | |
| US9373038B2 (en) | Apparatus and methods for temporal proximity detection | |
| WO2022068623A1 (zh) | 一种模型训练方法及相关设备 | |
| CN112529146A (zh) | 神经网络模型训练的方法和装置 | |
| WO2022111617A1 (zh) | 一种模型训练方法及装置 | |
| CN113627163B (zh) | 一种注意力模型、特征提取方法及相关装置 | |
| CN111931901A (zh) | 一种神经网络构建方法以及装置 | |
| US12373691B1 (en) | Executing sublayers of a fully-connected layer | |
| CN113536970B (zh) | 一种视频分类模型的训练方法及相关装置 | |
| CN110222718B (zh) | 图像处理的方法及装置 | |
| CN115081588A (zh) | 一种神经网络参数量化方法和装置 | |
| CN111797992A (zh) | 一种机器学习优化方法以及装置 | |
| CN114169393B (zh) | 一种图像分类方法及其相关设备 | |
| WO2023273934A1 (zh) | 一种模型超参数的选择方法及相关装置 | |
| WO2022156475A1 (zh) | 神经网络模型的训练方法、数据处理方法及装置 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 21842978 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 21842978 Country of ref document: EP Kind code of ref document: A1 |