CN110288085B - Data processing method, device and system and storage medium - Google Patents

Data processing method, device and system and storage medium Download PDF

Info

Publication number
CN110288085B
CN110288085B CN201910538093.6A CN201910538093A CN110288085B CN 110288085 B CN110288085 B CN 110288085B CN 201910538093 A CN201910538093 A CN 201910538093A CN 110288085 B CN110288085 B CN 110288085B
Authority
CN
China
Prior art keywords
training
data
neural network
data processing
class
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910538093.6A
Other languages
Chinese (zh)
Other versions
CN110288085A (en
Inventor
陈子沣
曾鹏
张永光
王海滨
林淑强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiamen Meiya Pico Information Co Ltd
Original Assignee
Xiamen Meiya Pico Information Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xiamen Meiya Pico Information Co Ltd filed Critical Xiamen Meiya Pico Information Co Ltd
Priority to CN201910538093.6A priority Critical patent/CN110288085B/en
Publication of CN110288085A publication Critical patent/CN110288085A/en
Application granted granted Critical
Publication of CN110288085B publication Critical patent/CN110288085B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Image Analysis (AREA)

Abstract

The invention provides a data processing method, a device, a system and a storage medium, wherein the method comprises the following steps: acquiring data to be processed; performing feature extraction on the data to be processed to obtain data features of the data to be processed; inputting the data characteristics into the trained data processing model to obtain a data processing result; wherein the training of the data processing model comprises: selecting a plurality of types of training samples from the training data; inputting the class weights of the quantity classes into the layers of the corresponding classes of the neural network; training a neural network by adopting a training sample to obtain new category weights of quantity categories; and repeating the steps, and stopping training when the neural network model meets the training conditions to obtain the trained data processing model. According to the method, the device, the system and the storage medium, the neural network model obtained by training the neural network by selecting the training samples with fixed category number out of order is easy to converge, has high accuracy, is suitable for data processing application and optimizes the data processing process.

Description

Data processing method, device and system and storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a method, an apparatus, a system, and a storage medium for data processing.
Background
With the wide application of the neural network in data processing such as image processing, text processing, and language processing, the demand and demand for the neural network are gradually increasing. It is often necessary to have class information in the neural network to perform tasks such as classification, detection or regression on different classes for multiple classes. Usually, since these kinds of information are also undetermined and need to be optimized or optimized during training, these kinds of information are often stored as network weights in specific layers of the neural network, and participate in training and reasoning. The more classes, the more weights are needed, and the slower the training and reasoning of these layers.
At present, when a neural network is trained (for example, softmax loss), if there are too many classes (for example, millions of classes), a layer containing class information occupies a large amount of computing and storage resources, and sometimes even cannot be trained due to too many required resources. Methods that do not require a fixed number of classes (e.g., triplet loss) tend to be difficult to converge, require long training times, and fail to train out class weights.
That is, the current neural network model is difficult to converge, requires a long training time, cannot train the class weight, and is not beneficial to the optimization of the data processing process.
Disclosure of Invention
The present invention has been made in view of the above problems. The invention provides a data processing method, a device, a system and a computer storage medium, which are used for solving the problems that a neural network model is difficult to converge, needs longer training time, cannot train class weight and is not beneficial to optimizing a data processing process.
According to a first aspect of the present invention, there is provided a data processing method comprising:
acquiring data to be processed;
performing feature extraction on the data to be processed to obtain data features of the data to be processed;
inputting the data characteristics into a trained data processing model to obtain a data processing result;
wherein the training of the data processing model comprises:
step S11, selecting first training samples of a first quantity category from the first training data;
step S12, inputting the class weights of the first number of classes into the layer of the corresponding class of the first neural network;
step S13, training the first neural network by adopting the first training sample to obtain a new class weight of a first quantity class;
and step S14, repeating the steps S11-S13, and stopping the training when the first neural network model meets the training condition to obtain the trained data processing model.
According to a second aspect of the present invention, there is provided a data processing apparatus comprising:
the data acquisition module is used for acquiring data to be processed;
the characteristic extraction module is used for extracting the characteristics of the data to be processed to obtain the data characteristics of the data to be processed;
the data processing module is used for inputting the data characteristics into a trained data processing model to obtain a data processing result;
wherein the data processing module is further configured to:
step S11, selecting first training samples of a first quantity category from the first training data;
step S12, inputting the class weights of the first number of classes into the layer of the corresponding class of the first neural network;
step S13, training the first neural network by adopting the first training sample to obtain a new class weight of a first quantity class;
and step S14, repeating the steps S11-S13, and stopping the training when the first neural network model meets the training condition to obtain the trained data processing model.
According to a third aspect of the present invention, there is provided a data processing system comprising a memory, a processor and a computer program stored on the memory and running on the processor, wherein the steps of the method of the first aspect are implemented when the computer program is executed by the processor.
According to a fourth aspect of the present invention, there is provided a computer storage medium having a computer program stored thereon, wherein the computer program, when executed by a computer, implements the steps of the method of the first aspect.
According to the data processing method, the data processing device, the data processing system and the computer storage medium, the neural network model obtained by training the neural network by selecting the training samples with fixed category number in a multiple-out-of-order mode is easy to converge, has high accuracy, is suitable for data processing application and optimizes the data processing process.
Drawings
The above and other objects, features and advantages of the present invention will become more apparent by describing in more detail embodiments of the present invention with reference to the attached drawings. The accompanying drawings are included to provide a further understanding of the embodiments of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention and not to limit the invention. In the drawings, like reference numbers generally represent like parts or steps.
FIG. 1 is a schematic flow chart diagram of a data processing method according to an embodiment of the present invention;
FIG. 2 is a schematic block diagram of a data processing apparatus according to an embodiment of the present invention;
FIG. 3 is a schematic block diagram of a data processing system according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, exemplary embodiments according to the present invention will be described in detail below with reference to the accompanying drawings. It is to be understood that the described embodiments are merely a subset of embodiments of the invention and not all embodiments of the invention, with the understanding that the invention is not limited to the example embodiments described herein. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the invention described herein without inventive step, shall fall within the scope of protection of the invention.
Referring to fig. 1, fig. 1 shows a data processing method 100 according to an embodiment of the present invention, and as shown in fig. 1, a data processing method 100 includes:
step A, acquiring data to be processed;
b, performing feature extraction on the data to be processed to obtain data features of the data to be processed;
step C, inputting the data characteristics into a trained data processing model to obtain a data processing result;
wherein the training of the data processing model comprises:
step S11, selecting first training samples of a first quantity category from the first training data;
step S12, inputting the class weights of the first number of classes into the layer of the corresponding class of the first neural network;
step S13, training the first neural network by adopting the first training sample to obtain a new class weight of a first quantity class;
and step S14, repeating the steps S11-S13, and stopping the training when the first neural network model meets the training condition to obtain the trained data processing model.
The data processing may be any one of image processing, voice processing, word processing, and other forms of data processing, for example, and is not limited herein.
When the data processing is image processing, image recognition may be specifically performed, that is, the data to be processed is an image to be recognized, image features of the image to be recognized are represented by vectors after feature extraction, an image recognition model (for example, the identity of a person is recognized by a human face in the image, the type of an article is recognized by image features of the article in the image, or the behavior of the person is recognized by the features of the person in the image, etc.) can be obtained by training a neural network after a training sample of a fixed category in training data is selected based on multiple times of disorder, and corresponding image recognition results, such as the identity of the person, the type of the article, the behavior of the person, etc., can be obtained by inputting the image features of the image to be recognized into the image recognition model.
When the data processing is voice processing, the voice recognition can be specifically performed, that is, the data to be processed is voice to be recognized, the voice features of the voice to be recognized are represented by vectors after feature extraction, a voice recognition model (such as gender or identity of a person in the voice through voice recognition) can be obtained by training a neural network after a training sample of a fixed category in training data is selected based on multiple disorder sequences, and a corresponding voice recognition result can be obtained by inputting the voice features of the voice to be recognized into the voice recognition model, such as gender or identity of the person in the voice.
According to the embodiment of the invention, the neural network is trained after the training samples of fixed categories in the training data are selected out of order for multiple times, so that the weight of the selected category is continuously updated every time, and finally the convergent neural network model is obtained. Compared with the prior art that all training data are adopted to train the neural network at the same time, the method provided by the embodiment of the invention adopts multiple batch training of the neural network, and the parameter quantity and the calculation quantity of the layer of the neural network containing the category information in each training process are greatly reduced, so that the training is carried out by using the same training data, the whole time required for training the neural network in the method 100 is correspondingly shorter, the calculation resources are greatly saved, the training efficiency and the accuracy of the neural network are improved, the efficiency and the accuracy in the subsequent data processing process are improved, and the user experience is ensured. In particular, class weights for all classes of neural networks may be stored; selecting training samples of fixed categories in training data through multiple times of disorder to train the neural network, wherein before each training, the category weights of all categories contained in the selected training sample are loaded into a layer containing corresponding category information in the neural network from the stored category weights of all categories, and then training is carried out and new category weights of all categories contained in the training samples are obtained after the training is carried out; and repeating the steps until the condition of stopping training is met, thus obtaining the converged neural network model.
Alternatively, the data processing method according to the embodiment of the present invention may be implemented in a device, an apparatus, or a system having a memory and a processor.
The data processing method according to the embodiment of the invention can be deployed at a personal terminal, and can also be deployed at a server side (or a cloud side) and the personal terminal in a distributed manner. For example, when the data processing method is deployed in a personal terminal, after the personal terminal acquires data to be processed, the data processing is performed at the personal terminal to obtain a data processing result of the data to be processed, wherein the data processing model may be trained at the personal terminal, or acquired from an external device after being trained by the external device, which is not limited;
according to the data processing method provided by the embodiment of the invention, when the data processing method can be distributed and deployed at the server side (or cloud side) and the personal terminal, the data processing model can be obtained by training at the server side (or cloud side), and after the personal terminal obtains the data processing model and the data to be processed, the data processing result of the data to be processed is obtained after the personal terminal performs data processing.
According to the embodiment of the invention, in the step a, the data to be processed is obtained directly, or obtained from other data sources; the data to be processed may be a real-time signal or a non-real-time signal, which is not limited herein.
Optionally, the acquiring the data to be processed includes: directly collecting data to be processed.
In one example, taking voice processing as an example, acquiring data to be processed includes: and collecting the voice data to be processed directly through microphone pickup.
In one example, taking voice processing as an example, acquiring data to be processed includes: and acquiring the voice data to be processed from other data sources. For example, the voice data to be recognized is collected by other voice collecting devices, and then the voice data to be recognized is obtained from the voice collecting devices; or acquiring the voice data to be recognized from the cloud.
In one example, taking image processing as an example, acquiring data to be processed includes: the information of the image to be processed is directly collected by an image collecting device (such as a camera).
In one example, taking image processing as an example, acquiring to-be-processed data includes: and acquiring image data to be processed from other data sources.
According to the embodiment of the present invention, step a may further include: and after the data to be processed is obtained, preprocessing the data to be processed.
In one example, preprocessing the data to be processed may include: and normalizing and/or converting the data to be processed into the same format or size.
According to the embodiment of the present invention, in step B, feature extraction is performed on the data to be processed, and the data features of the data to be processed may be obtained through a feature extraction model or through other feature extraction methods.
Optionally, the feature extraction model may be obtained by using the same training method as the data processing model, or may be obtained by using another training method. It is understood that the data features obtained by any feature extraction method can be used in the data processing model in the embodiment of the present invention.
In an example, the feature extraction is performed on the data to be processed to obtain the data feature of the data to be processed, and the following feature extraction method may be adopted: LBP (local binary pattern), HoG (histogram of oriented gradients), or PCA (principal component analysis), generating a feature vector as a data feature of the data to be processed.
In one example, the performing feature extraction on the data to be processed to obtain the data features of the data to be processed includes:
and inputting the data to be processed into a trained feature extraction model to obtain the data features of the data to be processed.
In one example, the training of the feature extraction model comprises:
step S21, selecting a second training sample of a second quantity category from the second training data;
step S22, inputting the class weights of the second quantity class into a layer of a corresponding class of a second neural network;
step S23, training the second neural network by adopting the second quantity type second training sample to obtain a new type weight of the second quantity type;
and step S24, repeating the steps S21-S23, and stopping the training when the second neural network model meets the training condition to obtain the trained feature extraction model.
In one example, selecting a second training sample of a second number of categories in the second training data includes:
randomly disordering the sequence of all samples of the second training data, and sequentially selecting second alternative samples until the number of the classes of the second alternative samples is greater than a second number;
returning the finally selected second alternative sample to the second training data, and taking the remaining second alternative sample as a second training sample of the second quantity category;
or the like, or, alternatively,
and after randomly disordering the sequence of all the classes of the second training data, sequentially selecting a second quantity class, and taking all samples of the second quantity class as second training samples of the second quantity class.
In one example, the training of the feature extraction model further comprises:
storing the class weights for all layers of the second neural network, and updating the class weights for all layers in the second neural network with the new class weights.
It should be noted that the first number and the second number may be the same or different, and are not limited herein. The data processing method according to the embodiment of the present invention may also be configured to extract the features of the data to be processed through the feature extraction model to obtain the data features, or may be used in other data processing models.
According to an embodiment of the present invention, in step C, the training of the data processing model includes:
step S11, selecting first training samples of a first quantity category from the first training data;
step S12, inputting the class weights of the first number of classes into the layer of the corresponding class of the first neural network;
step S13, training the first neural network by adopting the first training sample to obtain a new class weight of a first quantity class;
and step S14, repeating the steps S11-S13, and stopping the training when the first neural network model meets the training condition to obtain the trained data processing model.
Optionally, the training condition may include at least one of: all samples in the training data are trained for a fixed turn, the loss value of the neural network is smaller than a preset threshold value, and the performance (such as accuracy or precision) on the verification set reaches a preset value.
Optionally, selecting a first training sample of a first number of categories from the first training data includes:
randomly disordering the sequence of all samples of the first training data, and then sequentially selecting first alternative samples until the category number of the first alternative samples is greater than a first number;
returning the finally selected first alternative sample to the first training data, and taking the remaining first alternative sample as a first training sample of the first quantity category;
or the like, or, alternatively,
and randomly disordering all the category sequences of the first training data, sequentially selecting a first quantity category, and taking all samples of the first quantity category as first training samples of the first quantity category.
In one example, assuming that the first training data includes 6 category numbers of all categories, a1, a2, A3, a4, a5, a6, and the first number is 3, selecting a first training sample of the first number of categories in the first training data includes:
after the sequence of all samples of the first training data is randomly disturbed, sequentially selecting first candidate samples until the number of the classes of the first candidate samples is greater than 3, namely sequentially selecting 4 classes of samples A1, A2, A3 and A4, wherein the number of the candidate samples of the last selected class A4 is inevitably 1;
and returning the last selected first candidate sample, namely the candidate sample of the category A4, to the first training data, and taking the first candidate samples of the remaining categories A1, A2 and A3 as the first training samples of the first quantity categories.
The method comprises the steps of selecting samples in sequence, selecting the samples in sequence, and selecting the first training data according to the sequence of the samples, wherein the samples are selected in sequence after being disorganized, and finally selecting the whole first training data, so that all samples in the whole first training data can be selected, the convergence rate of training and the accuracy of a neural network are further ensured, and the optimization of subsequent data processing is facilitated.
In one example, assuming that the first training data includes 6 categories of all categories, the first number being 3, selecting a first training sample of the first number of categories in the first training data includes:
after randomly disordering all category sequences of the first training data, namely A1, A2, A3, A4, A5 and A6, sequentially selecting 3 categories, namely A2, A3 and A6, and taking all samples of the 3 categories, namely A2, A3 and A6, as first training samples of the first quantity category. Similarly, all the categories are sequentially selected after being scrambled, and finally the whole first training data is selected (for example, all the category sequences a1, a2, A3, a4, A5, A6, after being scrambled, a2, A3, A6, a1, and A5 can sequentially select a2, A3, A6-A3, A6, a 1-A6, a1, A5-a 1, A5, a 2-A5, a2, and A3).
It can be understood that, since the number of samples of each category in the training data may be different, in the training process of the data processing model and the feature extraction model in the embodiment of the present invention, the number of samples selected each time may be the same or different, and is not limited herein.
In one example, the training of the data processing model further comprises:
storing the class weights for all layers of the first neural network, and updating the class weights for all layers in the first neural network with the new class weights.
In an embodiment, taking an example that the embodiment of the present invention is deployed in a personal terminal, a data processing method according to the embodiment of the present invention is described, which specifically includes:
firstly, storing the class weights of all layers of a first neural network;
then, selecting first training samples of a first quantity category from the first training data; the method specifically comprises the following steps: randomly disordering the sequence of all samples of the first training data, and sequentially selecting first alternative samples each time until the number of the classes of the first alternative samples is greater than a first number; returning the finally selected first alternative sample to the first training data, and taking the remaining first alternative sample as a first training sample of the first quantity category; or after randomly disordering all the category sequences of the first training data, sequentially selecting a first quantity category each time, and taking all samples of the first quantity category as first training samples of the first quantity category;
then, selecting the category weight of the first quantity category from the stored category weights of all the layers of the first neural network, and inputting the category weight of the first quantity category into the layer of the corresponding category of the first neural network;
then, training the first neural network by adopting the first training sample to obtain new class weights of a first quantity of classes;
then, updating the stored class weights of all layers in the first neural network by adopting the new class weights;
repeating the above steps, stopping the training when the first neural network model meets the training conditions (e.g., all samples are trained for a fixed turn, the loss value of the neural network is less than a predetermined threshold value, or the performance (e.g., accuracy or precision) on the verification set reaches a preset value), and obtaining the trained data processing model;
then, acquiring data to be processed, and performing feature extraction on the data to be processed to obtain data features of the data to be processed;
and finally, inputting the data characteristics into a trained data processing model to obtain a data processing result.
Therefore, according to the data processing method provided by the embodiment of the invention, the neural network model obtained by training the neural network by selecting the training samples with fixed category number through multiple disordering is easy to converge, the convergence speed is high, the accuracy is high, the method is suitable for data processing application, and the data processing process is optimized.
In an embodiment, taking the speech data recognition as an example, the data processing method of the embodiment of the present invention is specifically described, which specifically includes:
firstly, storing the class weights of all layers of a first neural network;
then, selecting a first number of voice training samples in the voice training data; the method specifically comprises the following steps: randomly disordering the sequence of all samples of the voice training data, and sequentially selecting voice alternative samples each time until the category number of the voice alternative samples is greater than a first number; returning the finally selected voice alternative sample to the voice training data, and taking the remaining voice alternative sample as the voice training sample of the first quantity category; or after randomly disordering all the category sequences of the voice training data, sequentially selecting a first quantity category each time, and taking all samples of the first quantity category as voice training samples of the first quantity category;
then, selecting the category weight of the first quantity category from the stored category weights of all the layers of the first neural network, and inputting the category weight of the first quantity category into the layer of the corresponding category of the first neural network;
then, training the first neural network by adopting the voice training sample to obtain new class weights of a first quantity of classes;
then, updating the stored class weights of all layers in the first neural network by adopting the new class weights;
repeating the above steps, stopping the training when the first neural network model meets the training conditions (e.g., all samples are trained for a fixed turn, the loss value of the neural network is less than a predetermined threshold value, or the performance (e.g., accuracy or precision) on the verification set reaches a preset value), and obtaining the trained speech recognition model;
then, voice data to be recognized are obtained, and feature extraction is carried out on the voice data to be recognized, so that voice features of the voice data to be recognized are obtained; the method specifically comprises the following steps:
storing class weights for all layers of the second neural network;
selecting a second number of voice feature extraction training samples from the voice feature extraction training data; such as: randomly disorganizing the sequence of all samples of the voice feature extraction training data, and sequentially selecting voice feature extraction alternative samples each time until the number of the types of the voice feature extraction alternative samples is larger than a second number; returning the finally selected voice feature extraction alternative sample to the voice feature extraction training data, and taking the remaining voice feature extraction alternative sample as the voice feature extraction training sample of the second quantity category; or after randomly disordering all the category sequences of the voice feature extraction training data, sequentially selecting a second quantity category each time, and taking all samples of the second quantity category as voice feature extraction training samples of the second quantity category;
selecting the class weights of the second quantity class from the stored class weights of all the layers of the second neural network to be input into the layer of the corresponding class of the second neural network;
training the second neural network by adopting the voice feature extraction training sample to obtain new category weight of a second quantity of categories;
updating the class weights for all layers in the stored second neural network with the new class weights;
repeating the above steps, stopping the training when the second neural network model meets the training conditions (for example, all samples are trained for a fixed turn, the loss value of the neural network is less than a predetermined threshold value or the performance (such as accuracy or precision) on the verification set reaches a preset value), and obtaining the trained speech feature extraction model;
inputting the voice data to be recognized into a trained voice feature extraction model to obtain voice features;
and finally, inputting the data characteristics into the trained voice recognition model to obtain a voice recognition result (such as the identity or sex of a person in voice).
Therefore, according to the data processing method provided by the embodiment of the invention, the speech recognition model and the speech feature extraction model obtained by training the neural network by selecting the training samples with fixed category number through multiple disorder are easy to converge, the convergence speed is high, the accuracy is high, the method is suitable for application of speech recognition processing, the speech recognition process is optimized, the rapid and accurate speech recognition is realized, and the user experience is improved.
Fig. 2 shows a schematic block diagram of a data processing device 200 according to an embodiment of the present invention. As shown in fig. 2, a data processing apparatus 200 according to an embodiment of the present invention includes:
a data obtaining module 210, configured to obtain data to be processed;
a feature extraction module 220, configured to perform feature extraction on the data to be processed to obtain data features of the data to be processed;
the data processing module 230 inputs the data characteristics into a trained data processing model to obtain a data processing result;
wherein the data processing module 230 is further configured to:
step S11, selecting first training samples of a first quantity category from the first training data;
step S12, inputting the class weights of the first number of classes into a layer of a corresponding class of the first neural network;
step S13, training the first neural network by adopting the first training sample to obtain a new class weight of a first quantity class;
and step S14, repeating the steps S11-S13, and stopping the training when the first neural network model meets the training condition to obtain the trained data processing model.
The data processing apparatus 200 may be used for any one of image processing, voice processing, word processing and other forms of data processing, for example, and is not limited herein.
When the data processing apparatus 200 is used for image processing, image recognition may be specifically performed, that is, the data to be processed is an image to be recognized, image features of the image to be recognized are obtained by vector representation after feature extraction, an image recognition model (for example, the identity of a person is recognized by a face in an image, or the type of an article is recognized by image features of an article in an image, or the behavior of a person is recognized by the features of a person in an image, etc.) can be obtained by training a neural network after a training sample of a fixed category in training data is selected based on multiple times of disorder, and corresponding image recognition results, such as the identity of a person, the type of an article, and the behavior of a person, etc., can be obtained by inputting the image features of the image to be recognized into the image recognition model.
When the data processing apparatus 200 is used for speech processing, it may specifically be speech recognition, that is, the data to be processed is speech to be recognized, a speech feature representing the speech to be recognized by a vector is obtained after feature extraction, a neural network is trained after a training sample of a fixed category in training data is selected based on multiple disorder, so as to obtain a speech recognition model (for example, by recognizing gender or identity of a person in the speech, etc.), and a corresponding speech recognition result, such as gender or identity of a person in the speech, etc., can be obtained by inputting the speech feature of the speech to be recognized into the speech recognition model.
According to the embodiment of the present invention, the data processing apparatus 200 selects training samples of fixed categories in the training data by multiple times of disorder, and then trains the neural network, so as to continuously update the weight of each selected category, and finally obtain a converged neural network model. Compared with the prior art that the neural network is trained simultaneously by adopting all training data, the data processing device 200 of the embodiment of the invention adopts the neural network to be trained in batches for many times, and the parameter quantity and the calculation quantity of the layer of the neural network containing the category information in each training process are greatly reduced, so that the training is carried out by using the same training data, the whole time required for training the neural network is correspondingly shorter, the calculation resources are greatly saved, the training efficiency and the accuracy of the neural network are improved, the efficiency and the accuracy in the subsequent data processing process are improved, and the user experience is ensured. In particular, class weights for all classes of neural networks may be stored; selecting training samples of fixed categories in training data through multiple times of disorder to train the neural network, wherein before each training, the category weights of all categories contained in the selected training sample are loaded into a layer containing corresponding category information in the neural network from the stored category weights of all categories, and then training is carried out and new category weights of all categories contained in the training samples are obtained after the training is carried out; and repeating the steps until the condition of stopping training is met, thus obtaining the converged neural network model.
According to the embodiment of the present invention, the data obtaining module 210 may obtain the data to be processed directly, or may obtain the data to be processed from other data sources; the data to be processed may be a real-time signal or a non-real-time signal, which is not limited herein.
Optionally, the acquiring the data to be processed by the data acquiring module 210 includes: directly collecting data to be processed.
In one example, taking voice processing as an example, the data obtaining module 210 obtains the data to be processed, including: and collecting the voice data to be processed directly through microphone pickup.
In one example, taking voice processing as an example, the data obtaining module 210 obtains the data to be processed, including: and acquiring the voice data to be processed from other data sources. For example, the voice data to be recognized is collected by other voice collecting devices, and then the voice data to be recognized is obtained from the voice collecting devices; or acquiring the voice data to be recognized from the cloud.
In one example, taking image processing as an example, the data acquiring module 210 acquires data to be processed, including: the information of the image to be processed is directly collected by an image collecting device (such as a camera).
In one example, taking image processing as an example, the data acquiring module 210 acquires data to be processed, including: and acquiring image data to be processed from other data sources.
According to an embodiment of the present invention, the data obtaining module 210 may be further configured to: and after the data to be processed is obtained, preprocessing the data to be processed.
In one example, the preprocessing of the data to be processed by the data obtaining module 210 may include: and normalizing and/or converting the data to be processed into the same format or size.
According to the embodiment of the present invention, the feature extraction module 220 performs feature extraction on the data to be processed, and the data feature of the data to be processed may be obtained through a feature extraction model or through other feature extraction methods.
Optionally, the feature extraction model may be obtained by using the same training method as the data processing model, or may be obtained by using another training method. It is understood that the data features obtained by any feature extraction method can be used in the data processing model in the embodiment of the present invention.
In an example, the feature extraction module 220 performs feature extraction on the data to be processed to obtain data features of the data to be processed, and may adopt one of the following feature extraction methods: LBP (local binary pattern), HoG (histogram of oriented gradients), or PCA (principal component analysis), generating a feature vector as a data feature of the data to be processed.
In an example, the feature extraction module 220 performs feature extraction on the data to be processed to obtain data features of the data to be processed, including:
and inputting the data to be processed into a trained feature extraction model to obtain the data features of the data to be processed.
In one example, the training of the feature extraction model comprises:
step S21, selecting a second training sample of a second quantity category from the second training data;
step S22, inputting the class weights of the second number of classes into a layer of a corresponding class of a second neural network;
step S23, training the second neural network by adopting the second training sample of the second quantity category to obtain the new category weight of the second quantity category;
and step S24, repeating the steps S21-S23, and stopping the training when the second neural network model meets the training condition to obtain the trained feature extraction model.
In one example, selecting a second training sample of a second number of categories in the second training data includes:
randomly disordering the sequence of all samples of the second training data, and sequentially selecting second alternative samples until the number of the classes of the second alternative samples is greater than a second number;
returning the finally selected second alternative sample to the second training data, and taking the remaining second alternative sample as a second training sample of the second quantity category;
or the like, or, alternatively,
and after randomly disordering the sequence of all the classes of the second training data, sequentially selecting a second quantity class, and taking all samples of the second quantity class as second training samples of the second quantity class.
In one example, the training of the feature extraction model further comprises:
storing the class weights for all layers of the second neural network, and updating the class weights for all layers in the second neural network with the new class weights.
It should be noted that the first number and the second number may be the same or different, and are not limited herein. The data processing method according to the embodiment of the present invention may also be configured to extract the features of the data to be processed through the feature extraction model to obtain the data features, or may be used in other data processing models.
According to an embodiment of the present invention, the data processing module 230 further comprises a model module 231, wherein the model module 231 is used for training the data processing model, and comprises:
step S11, selecting first training samples of a first quantity category from the first training data;
step S12, inputting the class weights of the first number of classes into the layer of the corresponding class of the first neural network;
step S13, training the first neural network by adopting the first training sample to obtain a new class weight of a first quantity class;
and step S14, repeating the steps S11-S13, and stopping the training when the first neural network model meets the training condition to obtain the trained data processing model.
Optionally, the training condition may include at least one of: all samples in the training data are trained for a fixed turn, the loss value of the neural network is smaller than a preset threshold value, and the performance (such as accuracy or precision) on the verification set reaches a preset value.
Optionally, selecting a first training sample of a first number of categories from the first training data includes:
randomly disordering the sequence of all samples of the first training data, and sequentially selecting first alternative samples until the number of the classes of the first alternative samples is greater than a first number;
returning the finally selected first alternative sample to the first training data, and taking the remaining first alternative sample as a first training sample of the first quantity category;
or the like, or, alternatively,
and after randomly disordering all the category sequences of the first training data, sequentially selecting a first quantity category, and taking all the samples of the first quantity category as first training samples of the first quantity category.
In one example, assuming that the first training data includes 6 category numbers of all categories, a1, a2, A3, a4, a5, a6, and the first number is 3, selecting a first training sample of the first number of categories in the first training data includes:
after the sequence of all samples of the first training data is randomly disturbed, sequentially selecting first candidate samples until the number of the classes of the first candidate samples is greater than 3, namely sequentially selecting 4 classes of samples A1, A2, A3 and A4, wherein the number of the candidate samples of the last selected class A4 is inevitably 1;
and returning the last selected first candidate sample, namely the candidate sample of the category A4, to the first training data, and taking the first candidate samples of the remaining categories A1, A2 and A3 as the first training samples of the first number of categories.
The method comprises the steps of selecting samples in sequence, selecting the samples in sequence, and selecting the first training data according to the sequence of the samples, wherein the samples are selected in sequence after being disorganized, and finally selecting the whole first training data, so that all samples in the whole first training data can be selected, the convergence rate of training and the accuracy of a neural network are further ensured, and the optimization of subsequent data processing is facilitated.
In one example, assuming that the first training data includes 6 categories of all categories, the first number being 3, selecting a first training sample of the first number of categories in the first training data includes:
after randomly disordering all category sequences of the first training data, namely A1, A2, A3, A4, A5 and A6, sequentially selecting 3 categories, namely A2, A3 and A6, and taking all samples of the 3 categories, namely A2, A3 and A6, as first training samples of the first quantity category. Similarly, all the categories are sequentially selected after being scrambled, and finally the whole first training data is selected (for example, all the category sequences a1, a2, A3, a4, A5, A6, after being scrambled, a2, A3, A6, a1, and A5 can sequentially select a2, A3, A6-A3, A6, a 1-A6, a1, A5-a 1, A5, a 2-A5, a2, and A3).
It can be understood that, since the number of samples of each category in the training data may be different, in the training process of the data processing model and the feature extraction model in the embodiment of the present invention, the number of samples selected each time may be the same or different, and is not limited herein.
In one example, the data processing module 230 further comprises:
a weight storage module 232, configured to store the class weights of all layers of the first neural network, and update the class weights of all layers in the first neural network with the new class weight.
FIG. 3 shows a schematic block diagram of a data processing system 300 according to an embodiment of the present invention. Data processing system 300 includes a storage device 310, and a processor 320.
The storage device 310 stores program codes for implementing respective steps in the data processing method according to the embodiment of the present invention.
The processor 320 is configured to run the program codes stored in the storage device 310 to perform the corresponding steps of the data processing method according to the embodiment of the present invention, and is configured to implement the data acquisition module 210, the feature extraction module 220, and the data processing module 230 in the data processing device according to the embodiment of the present invention.
Furthermore, according to an embodiment of the present invention, there is also provided a storage medium on which program instructions are stored, which when executed by a computer or a processor are used for executing the respective steps of the data processing method according to an embodiment of the present invention and for implementing the respective modules in the data processing apparatus according to an embodiment of the present invention. The storage medium may include, for example, a memory card of a smart phone, a storage component of a tablet computer, a hard disk of a personal computer, a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a portable compact disc read-only memory (CD-ROM), a USB memory, or any combination of the above storage media. The computer readable storage medium can be any combination of one or more computer readable storage media, e.g., one containing computer readable program code for randomly generating sequences of action instructions and another containing computer readable program code for performing data processing.
In an embodiment, the computer program instructions may, when executed by a computer, implement the respective functional modules of the data processing apparatus according to the embodiment of the present invention and/or may perform the data processing method according to the embodiment of the present invention.
The modules in the data processing system according to the embodiment of the present invention may be implemented by the processor of the electronic device for data processing according to the embodiment of the present invention executing computer program instructions stored in the memory, or may be implemented when computer instructions stored in the computer-readable storage medium of the computer program product according to the embodiment of the present invention are executed by the computer.
According to the data processing method, the device, the system and the storage medium, the neural network model obtained by training the neural network by randomly selecting the training samples with fixed category number is easy to converge, the accuracy is high, the method and the device are suitable for data processing application, and the data processing process is optimized.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The above description is only for the specific embodiment of the present invention or the description thereof, and the protection scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and the changes or substitutions should be covered within the protection scope of the present invention. The protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (7)

1. A method of data processing, the method comprising:
acquiring data to be processed;
inputting the data to be processed into a trained feature extraction model to obtain the data features of the data to be processed, wherein the data features comprise:
step S21, selecting a second training sample of a second quantity category from the second training data;
step S22, inputting the class weights of the second number of classes into a layer of a corresponding class of a second neural network;
step S23, training the second neural network by adopting the second training sample of the second quantity category to obtain the new category weight of the second quantity category;
step S24, repeating the steps S21-S23, and stopping the training when the second neural network model meets the training condition to obtain the trained feature extraction model;
inputting the data characteristics into a trained data processing model to obtain a data processing result;
wherein the training of the data processing model comprises:
step S11, selecting a first training sample of a first number of categories from the first training data, including:
randomly disordering the sequence of all samples of the first training data, and sequentially selecting first alternative samples until the number of the classes of the first alternative samples is greater than a first number;
returning the finally selected first alternative sample to the first training data, and taking the remaining first alternative sample as a first training sample of the first quantity category;
step S12, inputting the class weights of the first number of classes into the layer of the corresponding class of the first neural network;
step S13, training the first neural network by adopting the first training sample to obtain a new class weight of a first quantity class;
and step S14, repeating the steps S11-S13, and stopping the training when the first neural network model meets the training condition to obtain the trained data processing model.
2. The method of claim 1, wherein the training of the data processing model further comprises:
storing the class weights for all layers of the first neural network, and updating the class weights for all layers in the first neural network with the new class weights.
3. The method of claim 1, wherein selecting a second training sample in a second number of categories in a second training data comprises:
randomly disordering the sequence of all samples of the second training data, and sequentially selecting second alternative samples until the number of the classes of the second alternative samples is greater than a second number;
returning the finally selected second alternative sample to the second training data, and taking the remaining second alternative sample as a second training sample of the second quantity category;
or the like, or, alternatively,
and after randomly disordering the sequence of all the classes of the second training data, sequentially selecting a second quantity class, and taking all samples of the second quantity class as second training samples of the second quantity class.
4. The method of claim 1, wherein the training of the feature extraction model further comprises:
storing the class weights for all layers of the second neural network, and updating the class weights for all layers in the second neural network with the new class weights.
5. A data processing apparatus, characterized in that the apparatus comprises:
the data acquisition module is used for acquiring data to be processed;
the feature extraction module is configured to input the to-be-processed data into a trained feature extraction model to obtain data features of the to-be-processed data, and includes:
step S21, selecting a second training sample of a second quantity category from the second training data;
step S22, inputting the class weights of the second number of classes into a layer of a corresponding class of a second neural network;
step S23, training the second neural network by adopting the second quantity type second training sample to obtain a new type weight of the second quantity type;
step S24, repeating the steps S21-S23, and stopping the training when the second neural network model meets the training condition to obtain the trained feature extraction model;
the data processing module is used for inputting the data characteristics into a trained data processing model to obtain a data processing result;
wherein the data processing module is further configured to:
step S11, selecting a first training sample of a first number of categories from the first training data, including:
randomly disordering the sequence of all samples of the first training data, and sequentially selecting first alternative samples until the number of the classes of the first alternative samples is greater than a first number;
returning the finally selected first alternative sample to the first training data, and taking the remaining first alternative sample as a first training sample of the first quantity category;
step S12, inputting the class weights of the first number of classes into the layer of the corresponding class of the first neural network;
step S13, training the first neural network by adopting the first training sample to obtain a new class weight of a first quantity class;
and step S14, repeating the steps S11-S13, and stopping the training when the first neural network model meets the training condition to obtain the trained data processing model.
6. A data processing system comprising a memory, a processor and a computer program stored on the memory and running on the processor, characterized in that the steps of the method of any of claims 1 to 4 are implemented when the computer program is executed by the processor.
7. A computer storage medium on which a computer program is stored, the computer program, when executed by a computer, implementing the steps of the method of any one of claims 1 to 4.
CN201910538093.6A 2019-06-20 2019-06-20 Data processing method, device and system and storage medium Active CN110288085B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910538093.6A CN110288085B (en) 2019-06-20 2019-06-20 Data processing method, device and system and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910538093.6A CN110288085B (en) 2019-06-20 2019-06-20 Data processing method, device and system and storage medium

Publications (2)

Publication Number Publication Date
CN110288085A CN110288085A (en) 2019-09-27
CN110288085B true CN110288085B (en) 2022-06-03

Family

ID=68004430

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910538093.6A Active CN110288085B (en) 2019-06-20 2019-06-20 Data processing method, device and system and storage medium

Country Status (1)

Country Link
CN (1) CN110288085B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111027568B (en) * 2019-10-30 2023-04-18 中科南京人工智能创新研究院 Iterative neural network batch normalization system
CN111046924B (en) * 2019-11-26 2023-12-19 成都旷视金智科技有限公司 Data processing method, device, system and storage medium
CN114005016A (en) * 2020-07-28 2022-02-01 华为技术有限公司 Image processing method, electronic equipment, image processing system and chip system
CN116628507B (en) * 2023-07-20 2023-10-27 腾讯科技(深圳)有限公司 Data processing method, device, equipment and readable storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017113232A1 (en) * 2015-12-30 2017-07-06 中国科学院深圳先进技术研究院 Product classification method and apparatus based on deep learning
CN108229588A (en) * 2018-02-08 2018-06-29 重庆师范大学 A kind of machine learning recognition methods based on deep learning
CN108229676A (en) * 2017-05-18 2018-06-29 北京市商汤科技开发有限公司 The training method and device of neural network model, electronic equipment and computer storage media
CN108345943A (en) * 2018-02-08 2018-07-31 重庆理工大学 A kind of machine learning recognition methods based on embedded coding with comparison study
CN109492666A (en) * 2018-09-30 2019-03-19 北京百卓网络技术有限公司 Image recognition model training method, device and storage medium
CN109558892A (en) * 2018-10-30 2019-04-02 银河水滴科技(北京)有限公司 A kind of target identification method neural network based and system
CN109657793A (en) * 2018-12-26 2019-04-19 广州小狗机器人技术有限公司 Model training method and device, storage medium and electronic equipment
CN109816092A (en) * 2018-12-13 2019-05-28 北京三快在线科技有限公司 Deep neural network training method, device, electronic equipment and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017113232A1 (en) * 2015-12-30 2017-07-06 中国科学院深圳先进技术研究院 Product classification method and apparatus based on deep learning
CN108229676A (en) * 2017-05-18 2018-06-29 北京市商汤科技开发有限公司 The training method and device of neural network model, electronic equipment and computer storage media
CN108229588A (en) * 2018-02-08 2018-06-29 重庆师范大学 A kind of machine learning recognition methods based on deep learning
CN108345943A (en) * 2018-02-08 2018-07-31 重庆理工大学 A kind of machine learning recognition methods based on embedded coding with comparison study
CN109492666A (en) * 2018-09-30 2019-03-19 北京百卓网络技术有限公司 Image recognition model training method, device and storage medium
CN109558892A (en) * 2018-10-30 2019-04-02 银河水滴科技(北京)有限公司 A kind of target identification method neural network based and system
CN109816092A (en) * 2018-12-13 2019-05-28 北京三快在线科技有限公司 Deep neural network training method, device, electronic equipment and storage medium
CN109657793A (en) * 2018-12-26 2019-04-19 广州小狗机器人技术有限公司 Model training method and device, storage medium and electronic equipment

Also Published As

Publication number Publication date
CN110288085A (en) 2019-09-27

Similar Documents

Publication Publication Date Title
CN110288085B (en) Data processing method, device and system and storage medium
CN111523621B (en) Image recognition method and device, computer equipment and storage medium
CN110633745B (en) Image classification training method and device based on artificial intelligence and storage medium
CN110362677B (en) Text data category identification method and device, storage medium and computer equipment
CN108021934B (en) Method and device for recognizing multiple elements
US20210390370A1 (en) Data processing method and apparatus, storage medium and electronic device
CN111814810A (en) Image recognition method and device, electronic equipment and storage medium
KR20180094024A (en) Adaptive Artificial Neural Network Selection Techniques
CN110807314A (en) Text emotion analysis model training method, device and equipment and readable storage medium
CN111260220B (en) Group control equipment identification method and device, electronic equipment and storage medium
CN111783997B (en) Data processing method, device and equipment
CN111104954A (en) Object classification method and device
CN110287311A (en) File classification method and device, storage medium, computer equipment
CN110648289A (en) Image denoising processing method and device
CN112632248A (en) Question answering method, device, computer equipment and storage medium
CN110765292A (en) Image retrieval method, training method and related device
JP2016029568A (en) Linear identification device, large-sized general object recognition device, electronic computer, mobile terminal, data processor, and image recognition system
CN110610131B (en) Face movement unit detection method and device, electronic equipment and storage medium
CN114238764A (en) Course recommendation method, device and equipment based on recurrent neural network
CN109101858B (en) Action recognition method and device
CN111488950B (en) Classification model information output method and device
CN115713669B (en) Image classification method and device based on inter-class relationship, storage medium and terminal
CN111652320A (en) Sample classification method and device, electronic equipment and storage medium
CN116266394A (en) Multi-modal emotion recognition method, device and storage medium
CN110489592B (en) Video classification method, apparatus, computer device and storage medium

Legal Events

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