Methods and apparatus for training neural network models

By combining transfer learning and deep learning methods, and utilizing feature vectors and network structure storage tables, a neural network model with higher accuracy can be trained with ordinary GPU computing power, a small number of samples, and a short time, thus solving the problem of insufficient model accuracy in existing technologies.

CN114065901BActive Publication Date: 2026-03-13HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-31
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Existing transfer learning methods cannot further improve the accuracy of neural network models, and cannot train better quality models with ordinary GPU computing power, a small number of samples, and a short time.

Method used

By combining transfer learning and deep learning methods, feature vectors are obtained, and deep neural network models with similar features are found using the network structure storage table. These models are then combined with pre-trained models for joint training to improve model accuracy.

Benefits of technology

Under the conditions of limited sample size, computing power, and training time, a neural network model with higher accuracy was trained, solving the problem of insufficient fitting ability of transfer learning to the target domain.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114065901B_ABST
    Figure CN114065901B_ABST
Patent Text Reader

Abstract

This application relates to edge artificial intelligence, and provides a method and apparatus for training a neural network model. It combines transfer learning and deep learning methods, and can train a more accurate neural network model under certain conditions of sample size, computing power, and training time. The method includes: obtaining a first training sample; obtaining a first feature vector of the first training sample; obtaining a first deep neural network model based on the first feature vector; obtaining a pre-trained model based on the first training sample; combining the first deep neural network model and the pre-trained model to obtain a combined neural network model; and training the combined neural network model based on the first training sample to obtain a target neural network model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence, and more specifically, to a method and apparatus for training a neural network model. Background Technology

[0002] Typically, a neural network model requires algorithm engineers to train it over a long period using powerful GPUs and specialized knowledge to label samples. Now, through transfer learning, ordinary developers can obtain a neural network model using ordinary GPUs, a small number of samples, and a shorter training time. Transfer learning is a learning concept and model that utilizes the similarity between data, tasks, or models to apply models learned in an old domain to a new domain. Its core is finding the similarity between the new and old problems to successfully transfer knowledge. Deep learning enables machines to autonomously acquire knowledge from data and apply it to solve new problems; while transfer learning focuses on transferring previously learned knowledge to solve new problems.

[0003] CreateML, an existing transfer learning tool based on an integrated development environment (IDE), allows ordinary application developers to quickly create a neural network model using ordinary GPU computing power, a small number of samples, and existing development experience. However, relying solely on transfer learning methods cannot further improve the accuracy of neural network model training, nor can it yield higher-quality neural network models. Summary of the Invention

[0004] This application provides a method and apparatus for training a neural network model, which combines transfer learning and deep learning methods, and can train a neural network model with higher accuracy under certain conditions of sample size, computing power and training time.

[0005] In a first aspect, a method for training a neural network model is provided, comprising: obtaining a first training sample; obtaining a first feature vector of the first training sample based on the first training sample; obtaining a first deep neural network model based on the first feature vector; obtaining a pre-trained model based on the first training sample; combining the first deep neural network model and the pre-trained model to obtain a combined neural network model; and training the combined neural network model based on the first training sample to obtain a target neural network model.

[0006] The method for training a neural network model in this application combines transfer learning and deep learning. The transfer learning portion addresses the issues of requiring a large number of training samples, high computational power, and long training times; while the deep learning portion addresses the problem of insufficient fitting ability of the neural network model obtained through transfer learning to the training samples of the target domain. Compared with existing methods for training neural network models, the method in this application achieves a better balance in terms of sample quantity, computational power, training time, and training accuracy.

[0007] In one possible implementation of the first aspect, obtaining the first neural network model based on the first feature vector includes: obtaining a network structure storage table, which includes multiple deep neural network models and multiple feature vectors, with each deep neural network model and feature vector corresponding to the other; determining a second feature vector based on the first feature vector, where the second feature vector is one of the multiple feature vectors in the network structure storage table; and obtaining the deep neural network model corresponding to the second feature vector based on the second feature vector.

[0008] In the method for training a neural network model in this application embodiment, the deep neural network model is obtained by looking up a table based on the training samples. The deep neural network model in the table is a neural network model pre-trained based on the existing training samples, which can greatly save computing power and training time.

[0009] In one possible implementation of the first aspect, determining the second feature vector based on the first feature vector includes: the distance between the second feature vector and the first feature vector is less than a first threshold.

[0010] Calculate the distance between the first feature vector and each feature vector in the network structure storage table, and select the feature vector whose distance from the first feature vector is less than a first threshold. The first threshold can be a value set manually, or the feature vector with the smallest distance from the first feature vector can be selected as the second feature vector.

[0011] Secondly, an object classification method is provided, wherein the objects include images and / or text, comprising: acquiring object classification data; processing the object classification data according to an object classification neural network model to obtain object classification results, wherein training the object classification neural network model includes: acquiring a first training sample; and acquiring a first feature vector of the first training sample according to the first training sample.

[0012] A first deep neural network model is obtained based on the first feature vector; a pre-trained model is obtained based on the first training sample; the first deep neural network model and the pre-trained model are combined to obtain a combined neural network model; the combined neural network model is trained based on the first training sample to obtain an object classification neural network model.

[0013] In one possible implementation of the second aspect, obtaining the first neural network model based on the first feature vector includes: obtaining a network structure storage table, which includes multiple deep neural network models and multiple feature vectors, with each deep neural network model and feature vector corresponding to the other; determining a second feature vector based on the first feature vector, where the second feature vector is one of the multiple feature vectors in the network structure storage table; and obtaining the deep neural network model corresponding to the second feature vector based on the second feature vector.

[0014] In one possible implementation of the second aspect, determining the second feature vector based on the first feature vector includes: the distance between the second feature vector and the first feature vector is less than a first threshold.

[0015] Thirdly, an apparatus for training a neural network model is provided, characterized in that it comprises: an acquisition unit for acquiring a first training sample; a processing unit for acquiring a first feature vector of the first training sample based on the first training sample; the processing unit is further configured to acquire a first deep neural network model based on the first feature vector; the processing unit is further configured to acquire a pre-trained model based on the first training sample; the processing unit is further configured to combine the first deep neural network model and the pre-trained model to obtain a combined neural network model; and the processing unit is further configured to train the combined neural network model based on the first training sample to obtain a target neural network model.

[0016] In one possible implementation of the third aspect, the processing unit obtains a first neural network model based on a first feature vector, including: obtaining a network structure storage table, which includes multiple deep neural network models and multiple feature vectors, with each deep neural network model and feature vector corresponding to the other; determining a second feature vector based on the first feature vector, where the second feature vector is one of the multiple feature vectors in the network structure storage table; and obtaining a deep neural network model corresponding to the second feature vector based on the second feature vector.

[0017] In one possible implementation of the third aspect, the processing unit determines the second feature vector based on the first feature vector, including: the distance between the second feature vector and the first feature vector is less than a first threshold.

[0018] Fourthly, an object classification apparatus is provided, characterized in that the objects include images and / or text, comprising: an acquisition unit for acquiring object classification data; and a processing unit for processing the object classification data according to an object classification neural network model to obtain object classification results, wherein training the object classification neural network model includes: acquiring a first training sample; acquiring a first feature vector of the first training sample based on the first training sample; acquiring a first deep neural network model based on the first feature vector; acquiring a pre-trained model based on the first training sample; combining the first deep neural network model and the pre-trained model to obtain a combined neural network model; and training the combined neural network model based on the first training sample to obtain the object classification neural network model.

[0019] In one possible implementation of the fourth aspect, obtaining the first neural network model based on the first feature vector includes: obtaining a network structure storage table, which includes multiple deep neural network models and multiple feature vectors, with each deep neural network model and feature vector corresponding to the other; determining a second feature vector based on the first feature vector, where the second feature vector is one of the multiple feature vectors in the network structure storage table; and obtaining the deep neural network model corresponding to the second feature vector based on the second feature vector.

[0020] In one possible implementation of the fourth aspect, determining the second feature vector based on the first feature vector includes: the distance between the second feature vector and the first feature vector is less than a first threshold.

[0021] Fifthly, an apparatus for training a neural network model is provided, including a processor and a memory, wherein the memory is used to store program instructions, and the processor is used to invoke the program instructions to execute the methods in the first aspect and any one of the implementations of the first aspect, as well as in the second aspect and any one of the implementations of the second aspect.

[0022] In a sixth aspect, a computer-readable storage medium is provided, characterized in that the computer-readable storage medium stores program instructions, which, when executed by a processor, implement the methods of the first aspect and any one of the implementations of the first aspect, as well as the second aspect and any one of the implementations of the second aspect.

[0023] In a seventh aspect, a chip is provided, the chip including a processor and a data interface, the processor reading instructions stored in a memory through the data interface, and executing the methods in the first aspect and any one of the implementations of the first aspect, as well as the second aspect and any one of the implementations of the second aspect. Attached Figure Description

[0024] Figure 1 This is a schematic block diagram of the system architecture for training a neural network model according to an embodiment of this application;

[0025] Figure 2 This is a schematic flowchart of a method for training a neural network model according to an embodiment of this application;

[0026] Figure 3 This is a schematic flowchart of the object classification method according to an embodiment of this application;

[0027] Figure 4 This is a schematic block diagram illustrating a specific application of the method for training a neural network model according to an embodiment of this application;

[0028] Figure 5 This is a schematic block diagram of an apparatus for training a neural network model according to an embodiment of this application;

[0029] Figure 6 This is a schematic block diagram of an object classification device according to an embodiment of this application;

[0030] Figure 7 This is a schematic diagram of the hardware structure of the apparatus for training a neural network model according to an embodiment of this application;

[0031] Figure 8 This is a schematic diagram of the hardware structure of the object classification device according to an embodiment of this application. Detailed Implementation

[0032] Artificial intelligence (AI) includes machine learning (ML), which in turn includes deep learning (DL) and transfer learning (TL).

[0033] Artificial intelligence (AI) is a branch of computer science that simulates the information processes of human consciousness and thought. Applications of AI include machine vision, fingerprint recognition, facial recognition, retinal recognition, iris recognition, palm print recognition, expert systems, automated planning, intelligent search, theorem proving, game playing, automatic programming, intelligent control, robotics, language and image understanding, and genetic programming.

[0034] Machine learning is the core of artificial intelligence. Machine learning theory primarily involves designing and analyzing algorithms that enable computers to learn automatically. Machine learning algorithms are a class of algorithms that automatically analyze data to obtain patterns and use these patterns to predict unknown data. Therefore, the core of machine learning is data, algorithms (models), and computing power (computer processing capabilities). Machine learning has a wide range of applications, including data mining, data classification, computer vision, natural language processing (NLP), biometrics, search engines, medical diagnosis, credit card fraud detection, securities market analysis, DNA sequencing, speech and handwriting recognition, strategy games, and robotics. Machine learning involves designing an algorithmic model to process data and output the desired results. Users can continuously optimize the algorithm model to achieve more accurate data processing capabilities.

[0035] Deep learning is a type of machine learning, its concept originating from the research of artificial neural networks. A multilayer perceptron with multiple hidden layers is a type of deep learning structure, hence deep learning is often referred to as a deep neural network. Compared to general machine learning, deep learning can automatically extract features—that is, automatically combine simple features into more complex features—and use these combinations for multilayer weight learning to solve problems. The focus of deep learning research is on building neural networks that simulate the human brain's analytical learning process, mimicking the brain's mechanisms to interpret data such as images, sounds, and text. Deep learning first emerged in image recognition, but within just a few years, it has been widely adopted in various fields of machine learning, demonstrating outstanding performance. It has applications in image recognition, speech recognition, audio processing, natural language processing, robotics and bioinformatics, search engines, human-computer interaction, targeted online advertising, automated medical diagnosis, and finance, among others.

[0036] Transfer learning is a machine learning method that refers to applying a pre-trained model to another task. One of the most common obstacles in using deep learning to solve problems is the massive amount of data required to train the model. This is because the machine encounters a large number of parameters during the learning process, and when facing a specific problem in a particular domain, it is often impossible to obtain the necessary scale of data to build the model. However, the relationships obtained from training a model on a particular type of data can be applied to other problems in the same domain; this is what is known as transfer learning.

[0037] This application relates to neural networks. To facilitate understanding, the relevant terms and concepts of neural networks that may be involved in this application will be introduced below.

[0038] (1) Neural Network

[0039] Neural networks can be composed of neural units, which can refer to units represented by x. s The arithmetic unit takes the intercept 1 as input, and its output can be as shown in formula (1):

[0040]

[0041] Where s = 1, 2, ..., n, n is a natural number greater than 1, W s For x s The weights are denoted by b, where b is the bias of the neural unit. f is the activation function of the neural unit, which performs a non-linear transformation on the features in the neural network, thereby converting the input signal of the neural unit into an output signal. The output signal of this activation function can be used as the input of the next convolutional layer, and the activation function can be the sigmoid function. A neural network is a network formed by connecting multiple of the above-mentioned individual neural units together; that is, the output of one neural unit can be the input of another neural unit. The input of each neural unit can be connected to the local receptive field of the previous layer to extract the features of the local receptive field, which can be a region composed of several neural units.

[0042] (2) Deep Neural Networks

[0043] A deep neural network (DNN), also known as a multilayer neural network, can be understood as a neural network with multiple hidden layers. Based on the position of the layers, the internal neural network of a DNN can be divided into three categories: input layer, hidden layer, and output layer. Generally, the first layer is the input layer, the last layer is the output layer, and the layers in between are hidden layers. The layers are fully connected, meaning that any neuron in the i-th layer is connected to any neuron in the (i+1)-th layer.

[0044] Although DNNs seem complex, the operation of each layer is actually not complicated. Simply put, it involves the following linear relationship expression: in, It is the input vector. It is the output vector. α is the offset vector, W is the weight matrix (also called coefficients), and α() is the activation function. Each layer is simply an adjustment of the input vector. The output vector is obtained through such a simple operation. Because DNNs have many layers, the coefficients W and the offset vector... The number of these parameters is also quite large. These parameters are defined in DNNs as follows: Taking the coefficient W as an example, assuming a three-layer DNN, the linear coefficient from the 4th neuron in the second layer to the 2nd neuron in the third layer is defined as... The superscript 3 represents the layer number where coefficient W is located, while the subscript corresponds to the third layer index 2 of the output and the second layer index 4 of the input.

[0045] In summary, the coefficient from the k-th neuron in layer L-1 to the j-th neuron in layer L is defined as...

[0046] It's important to note that the input layer does not have a W parameter. In deep neural networks, more hidden layers allow the network to better represent complex real-world situations. Theoretically, the more parameters a model has, the higher its complexity and "capacity," meaning it can perform more complex learning tasks. Training a deep neural network is essentially the process of learning the weight matrix, with the ultimate goal of obtaining the weight matrix of all layers in the trained deep neural network (a weight matrix formed by the vectors W from many layers).

[0047] (3) Convolutional Neural Network (CNN)

[0048] A Convolutional Neural Network (CNN) is a deep neural network with a convolutional structure. A CNN contains a feature extractor consisting of convolutional layers and subsampling layers, which can be viewed as a filter. A convolutional layer is a layer of neurons in a CNN that performs convolutional processing on the input signal. In a convolutional layer, a neuron may only be connected to some of its neighboring neurons. A convolutional layer typically contains several feature planes, each composed of rectangularly arranged neural units. Neural units on the same feature plane share weights, which are the convolutional kernel. Shared weights can be understood as the way image information is extracted regardless of location. The convolutional kernel can be initialized as a matrix of random size, and during the training process of the CNN, the kernel can learn appropriate weights. Furthermore, the direct benefit of shared weights is reducing the connections between layers in the CNN, while also reducing the risk of overfitting.

[0049] (4) Recurrent Neural Network (RNN)

[0050] Recurrent Neural Networks (RNNs) are used to process sequential data. In traditional neural network models, the layers from the input layer to the hidden layer and then to the output layer are fully connected, but the nodes within each layer are unconnected. While this type of neural network has solved many difficult problems, it remains inadequate for many others. For example, predicting the next word in a sentence generally requires using the preceding words because words in a sentence are not independent. RNNs are called recurrent neural networks because the current output of a sequence is related to the outputs of previous sequences. Specifically, the network memorizes previous information and applies it to the calculation of the current output. That is, nodes within the same hidden layer are no longer unconnected but connected, and the input to a hidden layer includes not only the output of the input layer but also the output of the previous hidden layer. Theoretically, RNNs can process sequential data of any length. Training an RNN is similar to training a traditional CNN or DNN.

[0051] Since we already have convolutional neural networks (CNNs), why do we need recurrent neural networks (RNNs)? The reason is simple. CNNs rely on the fundamental assumption that elements are independent of each other, and that input and output are also independent—like a cat and a dog. However, in the real world, many elements are interconnected. For example, stock prices fluctuate over time. Or, imagine someone saying, "I love traveling, and my favorite place is Yunnan. I definitely want to go there someday." Humans know the answer to this question is "Yunnan." Humans can infer from context, but how can machines do the same? This is where RNNs come in. RNNs aim to give machines the ability to remember, just like humans. Therefore, the output of an RNN depends on both the current input information and historical memory information.

[0052] (5) Residual network

[0053] Residual networks, proposed in 2015, are a type of deep convolutional network. Compared to traditional convolutional neural networks, residual networks are easier to optimize and can improve accuracy by significantly increasing their depth. The core of residual networks is addressing the side effects (degradation) of increasing depth, thus improving network performance simply by increasing network depth. Residual networks typically contain many structurally identical sub-modules, usually connected by a number representing the number of times a sub-module is repeated; for example, ResNet50 indicates that the residual network has 50 sub-modules.

[0054] (6) Classifier

[0055] Many neural network architectures ultimately include a classifier to categorize objects in an image. The classifier typically consists of a fully connected layer and a softmax function (also known as a normalized exponential function), which outputs the probabilities of different classes based on the input. It's worth noting that in some cases, the softmax function can be replaced by the sparsemax function (which can be understood as a sparse normalized exponential function).

[0056] (7) Loss Function

[0057] In training a deep neural network, to ensure the output closely approximates the desired predicted value, we compare the network's prediction with the target value. Based on the difference, we update the weight vector of each layer (usually pre-configuring parameters before the initial update). For example, if the prediction is too high, the weight vector is adjusted to predict a lower value. This adjustment continues until the deep neural network predicts the target value or a value very close to it. Therefore, we need to predefine "how to compare the difference between the predicted and target values," which is the loss function or objective function. These are important equations used to measure the difference between the predicted and target values. Taking the loss function as an example, a higher output value (loss) indicates a greater difference, and training the deep neural network becomes a process of minimizing this loss.

[0058] (8) Backpropagation algorithm

[0059] Neural networks can employ backpropagation (BP) to correct the initial parameter values ​​during training, thereby minimizing the reconstruction error loss. Specifically, forward propagation of the input signal to the output generates error loss; this error loss information is then propagated back to update the parameters of the initial neural network model, leading to convergence of the error loss. The backpropagation algorithm is an error-loss-driven backpropagation process aimed at obtaining the optimal parameters of the neural network model, such as the weight matrix.

[0060] (9) Attention mechanism

[0061] Attention mechanisms originate from research on human vision. In cognitive science, due to information processing bottlenecks, humans selectively focus on a portion of all information while ignoring other visible information; this mechanism is commonly referred to as attention. In the field of artificial intelligence, the purpose of attention mechanisms is to find key data from a dataset, such as identifying key objects in an image, key images in a set of images, or nodes of change in a time-series dataset. Attention mechanisms primarily identify data units that contribute significantly by evaluating the contribution of each or every data unit to the overall data. Alternatively, it can be understood as determining key data by comparing the weights of different data points on the outcome. Essentially, the attention function in attention mechanisms can be described as a process of mapping a query to a series of key-value pairs, that is, obtaining a series of key-value data pairs.

[0062] Attention mechanisms can include self-attention (SAM) and referenced attention (RAM). SAM can be understood as identifying the weight of each data point within a single set of data in relation to the outcome; for example, it can identify key data points or the weight of data influence within a given set (vertically or within the same set). RAM can be understood as identifying the weight of different sets of data in relation to the outcome, again identifying key data points or the weight of data influence across different sets (horizontally or between different sets). It's important to note that SAM and RAM can be understood as intra-group attention and inter-group attention mechanisms, respectively.

[0063] In the embodiments of this application, SAM is mainly used to mine the dependencies (or correlations) between data in each dimension of the data to be processed, and RAM is used to mine the dependencies (or correlations) between data in different dimensions of the data to be processed.

[0064] The method for training a neural network model according to embodiments of this application can be applied to a smart terminal, which includes the system for training a neural network model according to embodiments of this application. Users can provide training samples as required, and the system outputs a trained neural network model based on the training samples and training objectives provided by the user.

[0065] For example, the aforementioned smart terminal can be mobile or fixed; for instance, a smart terminal can be a mobile phone with image processing capabilities, a tablet personal computer (TPC), a media player, a smart TV, a laptop computer (LC), a personal digital assistant (PDA), a personal computer (PC), a camera, a camcorder, a smartwatch, a wearable device (WD), or an autonomous vehicle, etc., and this application embodiment does not limit this.

[0066] It should be understood that the above are illustrative examples of application scenarios and do not limit the application scenarios of this application in any way.

[0067] Transfer learning is the process of transferring knowledge from one domain (source domain) to another (target domain) to achieve better learning outcomes in the target domain. Typically, the source domain has abundant data, while the target domain has less data. Transfer learning requires transferring knowledge learned in a data-rich environment to a new environment with limited data. Existing technologies like CreateML utilize data from both the target and source domains to train a model in the source domain, thus obtaining a model for the target domain. However, in practice, because CreateML only captures the transferred features from the target domain and not the original deep features, the model's fit to the target domain may be insufficient, potentially resulting in low accuracy in the newly learned model.

[0068] Therefore, this application proposes a method and apparatus for training a model, which solves the problems of traditional deep learning requiring a large number of samples, high computing power, and long training time by jointly learning deep features and transfer features. It also addresses the issue of insufficient fitting ability of transfer learning to the target domain. This achieves a neural network model with high training accuracy under conditions of fewer samples, lower computing power, and shorter training time.

[0069] Figure 1 A schematic block diagram of the system architecture for training a neural network model according to an embodiment of this application is shown. Figure 1As shown, the system architecture for training a neural network model in this embodiment includes a model creation section, which includes a domain adaptation algorithm module, an early stopping algorithm module, a data augmentation technology module, a sample comprehensive evaluation module, a network structure storage table module, and a model training module. The domain adaptation algorithm module is used for transfer learning, the early stopping algorithm module is used to prevent model overfitting, the data augmentation technology module is used to increase the number of samples, which can improve the generalization ability of the neural network model, the sample comprehensive evaluation module and the network structure storage table module are responsible for obtaining small-scale deep neural network models, and the model training module is responsible for the joint training of the pre-trained model and the small-scale deep neural network model.

[0070] Figure 2 A schematic flowchart of a method for training a neural network model according to an embodiment of this application is shown, including steps 201 to 206, which will be described in detail below.

[0071] S201, Obtain the first training sample.

[0072] The first training sample is used to train the target neural network model. Specifically, the method for training the neural network model in this application embodiment can be used for classification scenarios such as image classification, text classification, and sound classification. Therefore, the first training sample can be a training sample of an image, a training sample of text, or a training sample of sound, etc.

[0073] S202, Obtain the first feature vector of the first training sample based on the first training sample.

[0074] Specifically, a first feature vector is obtained based on the feature attributes of the first training sample. These feature attributes may include data distribution, number of categories, number of samples, etc. The first feature vector corresponds to the first training sample.

[0075] Optionally, before obtaining the first feature vector, the method for training a neural network model in this embodiment further includes data augmentation of the first training sample. Taking a graphic training sample as an example, data augmentation includes rotating, translating, scaling, randomly occluding, and adjusting color differences of the image, thereby enriching the diversity of the training sample.

[0076] S203, Obtain the first deep neural network model based on the first feature vector.

[0077] First, we obtain the network structure storage table, which includes multiple deep neural network models and multiple feature vectors. The multiple deep neural network models are trained separately on multiple training sets, with one training set corresponding to one deep neural network model. The multiple feature vectors are obtained from the training samples in each training set, with one training set corresponding to one feature vector. Therefore, one deep neural network model corresponds to one feature vector.

[0078] Then, a second feature vector is determined based on the first feature vector. This second feature vector is one of the multiple feature vectors in the aforementioned network structure storage table. Specifically, the distance between the first feature vector and each feature vector in the network structure storage table is calculated, and the feature vector whose distance from the first feature vector is less than a first threshold is selected as the second feature vector. This first threshold can be a manually set value, or the feature vector with the smallest distance from the first feature vector can be selected as the second feature vector.

[0079] Finally, the deep neural network model corresponding to the second feature vector is obtained as the first deep neural network model.

[0080] S204, Obtain the pre-trained model based on the first training sample.

[0081] The pre-trained model can be an existing mature model, such as MobileNetV2, which is trained on millions of images and has good generalization ability. Alternatively, the pre-trained model can also be a multi-task learning model.

[0082] The method for training a neural network model according to the embodiments of this application can fine-tune the pre-trained neural network model based on the first training sample. The fine-tuning method can be to freeze the parameters of a certain number of layers in the network structure and only update the parameters of a certain number of layers and fully connected layers in the network structure. The certain number of layers can be a value preset by humans.

[0083] S205, combine the first deep neural network model and the pre-trained model to obtain a combined neural network model.

[0084] The combination method is the existing method of combining two models.

[0085] S206, Train the combined neural network model based on the first training sample to obtain the target neural network model.

[0086] according to Figure 2 The method for training a neural network model, as shown, combines transfer learning and deep learning. The transfer learning component addresses the issues of requiring a large number of training samples, high computational demands, and long training times; while the deep learning component addresses the problem of insufficient fitting ability of the neural network model obtained through transfer learning to the training samples of the target domain. Compared with existing methods for training neural network models, the method described in this application achieves a better balance in terms of sample quantity, computational power, training time, and training accuracy.

[0087] Figure 3 A schematic flowchart of an object classification method according to an embodiment of this application is shown, such as... Figure 3 As shown, the method includes steps 301 to 302, which are described below.

[0088] S301, Obtain object classification data.

[0089] The object classification method of this application embodiment can be used in classification scenarios such as image classification, text classification, and sound classification. Therefore, the object classification data can be image classification data, text classification data, or sound classification data, etc.

[0090] S302, Process the object classification data according to the object classification neural network model to obtain the object classification result.

[0091] The object classification neural network model is pre-trained. The training of the object classification neural network model includes: obtaining a first training sample; obtaining a first feature vector of the first training sample based on the first training sample; obtaining a first deep neural network model based on the first feature vector; obtaining a pre-trained model based on the first training sample; combining the first deep neural network model and the pre-trained model to obtain a combined neural network model; and training the combined neural network model based on the first training sample to obtain the object classification neural network model.

[0092] It should be understood that the training method for object classification neural network models is as follows: Figure 2 For methods of training neural network models, please refer to the above-mentioned methods. Figure 2 For the sake of brevity, the embodiments of this application will not be described in detail here.

[0093] The following combination Figure 4 This paper specifically describes the application of the method for training a neural network model according to embodiments of this application in image classification. For example... Figure 4 As shown, the method for training a neural network model in this application embodiment can be divided into two processes: one is a neural network structure search process, which is responsible for finding the best neural network structure suitable for different image classification tasks; the other is a joint training process, which is responsible for finding a suitable small neural network model based on the dataset of the target domain and jointly training it with the pre-trained neural network model.

[0094] 1. Network Structure Search Process

[0095] This process involves training multiple categories of image classification tasks using auto machine learning (Auto ML) to obtain the optimal network structure for different classification tasks, ultimately resulting in a network structure storage table. Auto ML automates the end-to-end process of applying machine learning to display problems. Machine learning models are meticulously designed by teams of engineers and scientists; this manual design process is extremely difficult because the search space for model components can be enormous. Auto ML focuses on automating machine learning implementations, catering to users without specialized machine learning knowledge while also providing new tools for experienced machine learning users. Auto ML takes data and tasks (classification, regression, recommendation, etc.) as input and outputs an applicable model capable of predicting unknown data. Each decision in the data-driven process is a hyperparameter, and the basic idea of ​​Auto ML is to find high-quality hyperparameters in a relatively short time.

[0096] The network structure search process for training the neural network model in this application embodiment is completed on the server side, and is imperceptible to the end user. The image classification task is a common image classification task based on open-source internet datasets and manual annotations, such as animal classification (further subdivided into poultry, wild animals, birds, etc.), plant classification (further subdivided into flowers, crops, succulents, etc.), clothing classification (further subdivided into hats, tops, pants, etc.), and hundreds of other classification scenarios. The above are merely examples of image classification tasks in this application embodiment and do not constitute a limitation on this application embodiment. Besides the image classification tasks listed above, this application embodiment may also include other possible image classification tasks.

[0097] For each image classification task, a feature vector is calculated based on feature distribution, number of categories, and number of samples, and this feature vector is denoted as the standard sample vector. Each standard sample vector corresponds to a network structure trained using AutoML for that image classification task. The resulting network structure storage table is shown below.

[0098] Table 1

[0099] Training objectives Standard sample vector Network Structure Version Animal classification Vector A Structure 1: Conv + Relu + Conv V1 Plant classification Vector B Structure 2: FireModule*3 V2 Clothing Classification Vector C Structure 3: ...Block + ... V1 … … … …

[0100] 2. Joint Training Process

[0101] The network structure search process of the method for training the neural network model in this embodiment is performed in an integrated development environment (IDE). An IDE is an application that provides a development environment, typically including tools such as a code editor, compiler, debugger, and graphical user interface. An IDE integrates code writing, analysis, and debugging functions into a unified software service suite; any software or software suite possessing this feature can be called an integrated development environment. An IDE can run independently or in conjunction with other programs.

[0102] First, the user selects an image classification dataset. Using garbage classification as an example, the user chooses the garbage classification training dataset. The system then augments the training samples in the training dataset by performing operations such as rotation, translation, scaling, random occlusion, and color adjustment on the images.

[0103] Then, modeling is performed based on the training objective and the data distribution, number of categories, and number of samples in the training samples to obtain the sample evaluation vector. The network structure storage table is queried, and the distance between the sample evaluation vector and each standard sample vector in the network structure storage table is calculated. The network structure corresponding to the standard sample vector with the smallest distance is selected and denoted as the small deep network structure.

[0104] Next, the pre-trained model and the small deep network structure are combined for joint learning. The pre-trained model is a neural network model used for the transfer learning part. A mature pre-trained model, such as MobileNetV2, can be used, which has good generalization ability after training on millions of images. Optionally, the pre-trained model can also be a multi-task learning neural network model; this embodiment does not specifically limit this. In this embodiment, the pre-trained neural network model can be fine-tuned based on an image classification dataset (e.g., a garbage classification dataset). This fine-tuning method can involve freezing the parameters of a certain number of layers in the network structure and only updating the parameters of a certain number of layers and fully connected layers. The number of layers can be a pre-set value. The system simultaneously inputs data into the pre-trained model and the small deep network structure. This input is dual-input; since the two models have different requirements for image shape, the image size needs to be adjusted before input. After training, the neural network model jointly learned by the pre-trained model and the small deep network structure is obtained.

[0105] The following details the application of the method for training a neural network model according to embodiments of this application in text classification. Similar to its application in image classification, the application of the method for training a neural network model according to embodiments of this application in text classification can also be divided into two processes: one is a neural network structure search process, which is responsible for finding the optimal neural network structure suitable for text classification tasks of different languages ​​and lengths; the other is a joint training process, which is responsible for finding a suitable small neural network model based on the dataset of the target domain and jointly training it with the pre-trained neural network model.

[0106] 1. Network Structure Search Process

[0107] The network structure search process for training the neural network model in this application embodiment is completed on the server side, and is imperceptible to the end user. The text classification task is a common text classification task based on open-source internet datasets and manual annotation. Unlike image classification tasks, text classification tasks are mainly distinguished by classification language, text length, etc., such as Chinese classification with an average length of less than 100 characters, mixed Chinese and English classification with an average length of more than 500 characters, and English classification with an average length between (100, 500) characters. The above are merely examples of text classification tasks in this application embodiment and do not constitute a limitation on this application embodiment. In addition to the text classification tasks listed above, this application embodiment may also include other possible text classification tasks.

[0108] For each text classification task, a feature vector is calculated based on the feature distribution, number of categories, and number of samples, and this feature vector is denoted as the standard sample vector. Each standard sample vector corresponds to a network structure trained using AutoML for that text classification task. The resulting network structure storage table is shown below.

[0109] Table 2

[0110]

[0111]

[0112] 2. Joint Training Process

[0113] The network structure search process for training the neural network model in this embodiment is performed in an IDE. First, a text classification dataset is selected; here, a headline news dataset is used as an example. The user selects the headline news training dataset. The system then performs data augmentation on the training samples in the training dataset, such as increasing or decreasing the number of characters.

[0114] Then, modeling is performed based on the training objective and the data distribution, number of categories, and number of samples in the training samples to obtain the sample evaluation vector. The network structure storage table is queried, and the distance between the sample evaluation vector and each standard sample vector in the network structure storage table is calculated. The network structure corresponding to the standard sample vector with the smallest distance is selected and denoted as the small deep network structure.

[0115] Next, the pre-trained model and the small deep network structure are combined for joint training. The system simultaneously inputs data into both the pre-trained model and the small deep network structure; here, the input is dual-input. After training is complete, a neural network model jointly learned from the pre-trained model and the small deep network structure is obtained.

[0116] Existing IDE-based Create ML technology only supports transfer learning methods. The method for training neural network models in this application can automatically design small deep network structures. By jointly training the pre-trained model and the small deep network structure, a more accurate neural network model can be obtained.

[0117] The methods for training neural network models and object classification according to embodiments of this application have been described in detail above with reference to the accompanying drawings. The apparatus for training neural network models and object classification according to embodiments of this application will be described in detail below with reference to the accompanying drawings. It should be understood that the apparatus for training neural network models and object classification described below can perform the various steps of the methods for training neural network models and object classification according to embodiments of this application. In order to avoid unnecessary repetition, repeated descriptions will be appropriately omitted when introducing the apparatus for training neural network models and object classification according to embodiments of this application.

[0118] Figure 5 A schematic block diagram of an apparatus for training a neural network model according to an embodiment of this application is shown, such as Figure 5 As shown, it includes an acquisition unit 510 and a processing unit 520, which will be described below.

[0119] Acquisition unit 510 is used to acquire the first training sample.

[0120] The processing unit 520 is used to obtain the first feature vector of the first training sample based on the first training sample.

[0121] The processing unit 520 is also used to obtain a first deep neural network model based on the first feature vector.

[0122] The processing unit 520 is also used to obtain a pre-trained model based on the first training sample.

[0123] The processing unit 520 is also used to combine the first deep neural network model and the pre-trained model to obtain a combined neural network model.

[0124] The processing unit 520 is also used to train a combined neural network model based on the first training sample to obtain a target neural network model.

[0125] Optionally, the processing unit 520 obtains a first neural network model based on a first feature vector, including: obtaining a network structure storage table, which includes multiple deep neural network models and multiple feature vectors, with each deep neural network model and feature vector corresponding to the other; determining a second feature vector based on the first feature vector, where the second feature vector is one of the multiple feature vectors in the network structure storage table; and obtaining a deep neural network model corresponding to the second feature vector.

[0126] Optionally, the processing unit 520 determines the second feature vector based on the first feature vector, including: the distance between the second feature vector and the first feature vector is less than a first threshold.

[0127] Figure 6 A schematic block diagram of an object classification apparatus according to an embodiment of this application is shown, such as Figure 6 As shown, it includes an acquisition unit 610 and a processing unit 620, which will be described below.

[0128] Acquisition unit 610 is used to acquire object classification data.

[0129] The processing unit 620 is used to process object classification data according to the object classification neural network model to obtain object classification results.

[0130] The training of the object classification neural network model includes: obtaining the first training sample; obtaining the first feature vector of the first training sample based on the first training sample;

[0131] A first deep neural network model is obtained based on the first feature vector; a pre-trained model is obtained based on the first training sample; the first deep neural network model and the pre-trained model are combined to obtain a combined neural network model; the combined neural network model is trained based on the first training sample to obtain an object classification neural network model.

[0132] Optionally, obtaining the first neural network model based on the first feature vector includes: obtaining a network structure storage table, which includes multiple deep neural network models and multiple feature vectors, with each deep neural network model and feature vector corresponding to the other; determining a second feature vector based on the first feature vector, where the second feature vector is one of the multiple feature vectors in the network structure storage table; and obtaining the deep neural network model corresponding to the second feature vector based on the second feature vector.

[0133] Optionally, determining the second feature vector based on the first feature vector includes: the distance between the second feature vector and the first feature vector is less than a first threshold.

[0134] Figure 7 This is a schematic diagram of the hardware structure of the apparatus for training a neural network model provided in the embodiments of this application. Figure 7 The illustrated device 700 (which may specifically be a computer device) includes a memory 710, a processor 720, a communication interface 730, and a bus 740. The memory 710, processor 720, and communication interface 730 are interconnected via the bus 740.

[0135] The memory 710 may be a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 710 may store a program, and when the program stored in the memory 710 is executed by the processor 720, the processor 720 executes various steps of the method for training a neural network model according to embodiments of this application; for example, executing... Figure 2 The steps shown.

[0136] It should be understood that the apparatus for training neural network models shown in the embodiments of this application can be a server, for example, a server in the cloud, or a chip configured in a server in the cloud.

[0137] The processor 720 may be a general-purpose central processing unit (CPU), microprocessor, application-specific integrated circuit (ASIC), graphics processing unit (GPU), or one or more integrated circuits, used to execute relevant programs to implement the image classification method of the embodiments of this application.

[0138] The processor 720 can also be an integrated circuit chip with signal processing capabilities. In implementation, each step of the image classification method of this application can be completed through integrated logic circuits in the processor 720 or through software instructions.

[0139] The processor 720 described above can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or can be executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory 710, and the processor 720 reads the information in memory 710 and, in conjunction with its hardware, completes the implementation of this application. Figure 5 The apparatus shown includes units that are required to perform functions, or to perform the methods described in this application. Figure 2 The method shown is for training a neural network model.

[0140] The communication interface 730 uses transceiver devices, such as, but not limited to, transceivers, to enable communication between the device 700 and other devices or communication networks.

[0141] Bus 740 may include a pathway for transmitting information between various components of device 700 (e.g., memory 710, processor 720, communication interface 730).

[0142] Figure 8 This is a schematic diagram of the hardware structure of the object classification device provided in the embodiments of this application. Figure 8 The object classification device 800 shown (which may specifically be a computer device) includes a memory 810, a processor 820, a communication interface 830, and a bus 840. The memory 810, processor 820, and communication interface 830 are interconnected via the bus 840.

[0143] The memory 810 may be a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 810 may store a program, and when the program stored in the memory 810 is executed by the processor 820, the processor 820 performs various steps of the object classification method of this application embodiment; for example, executing... Figure 3 The steps shown.

[0144] It should be understood that the object classification device shown in the embodiments of this application can be a server, for example, a server in the cloud, or a chip configured in a server in the cloud.

[0145] For example, the processor 820 may be a general-purpose central processing unit (CPU), microprocessor, application-specific integrated circuit (ASIC), graphics processing unit (GPU), or one or more integrated circuits to execute related programs to implement the object classification method of the method embodiments of this application.

[0146] For example, the processor 820 can also be an integrated circuit chip with signal processing capabilities. In implementation, each step of the object classification method of this application can be accomplished through integrated logic circuits in the hardware of the processor 820 or through software instructions.

[0147] The processor 820 described above can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or can be executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory 810, and the processor 820 reads the information in memory 810 and combines it with its hardware to complete... Figure 6 The training apparatus shown includes units that are required to perform functions, or to perform the methods described in this application. Figure 3 The object classification method shown.

[0148] The communication interface 830 uses transceiver devices, such as, but not limited to, transceivers, to enable communication between the training device 800 and other devices or communication networks.

[0149] Bus 840 may include a pathway for transmitting information between various components of device 800 (e.g., memory 810, processor 820, communication interface 830).

[0150] It should be noted that although only a memory, processor, and communication interface are shown in the above-described devices 700 and 800, those skilled in the art should understand that in specific implementations, devices 700 and 800 may also include other devices necessary for normal operation. Furthermore, depending on specific needs, those skilled in the art should understand that devices 700 and 800 may also include hardware devices for implementing other additional functions. In addition, those skilled in the art should understand that devices 700 and 800 may only include the devices necessary for implementing the embodiments of this application, and may not necessarily include... Figure 7 or Figure 8 All the devices shown.

[0151] For example, this application also provides a chip, which includes a transceiver unit and a processing unit. The transceiver unit may be an input / output circuit or a communication interface; the processing unit may be a processor, microprocessor, or integrated circuit integrated on the chip; the chip can execute the method for training a neural network model as described in the above method embodiments.

[0152] For example, this application also provides a chip, which includes a transceiver unit and a processing unit. The transceiver unit may be an input / output circuit or a communication interface; the processing unit may be a processor, microprocessor, or integrated circuit integrated on the chip; the chip can execute the object classification method described in the above method embodiments.

[0153] For example, embodiments of this application also provide a computer-readable storage medium having instructions stored thereon, which, when executed, perform the method for training a neural network model in the above method embodiments.

[0154] For example, embodiments of this application also provide a computer-readable storage medium having instructions stored thereon, which, when executed, perform the object classification method described in the above method embodiments.

[0155] For example, embodiments of this application also provide a computer program product containing instructions that, when executed, perform the method for training a neural network model in the above method embodiments.

[0156] For example, embodiments of this application also provide a computer program product containing instructions that, when executed, perform the object classification method described in the above method embodiments.

[0157] It should be understood that the processor in the embodiments of this application can be a central processing unit (CPU), but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.

[0158] It should also be understood that the memory in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDR SDRAM), enhanced synchronous DRAM (ESDRAM), synchronous linked DRAM (SLDRAM), and direct rambus RAM (DR RAM).

[0159] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. A semiconductor medium can be a solid-state drive.

[0160] It should be understood that the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. A and B can be singular or plural. Additionally, the character " / " in this article generally indicates an "or" relationship between the preceding and following related objects, but it can also represent an "and / or" relationship. Please refer to the context for a more accurate understanding.

[0161] In this application, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or multiple items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.

[0162] It should be understood that in the various embodiments of this application, the order of the above-mentioned processes does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0163] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0164] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0165] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0166] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0167] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0168] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0169] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method of training a neural network model, the method comprising: The method comprises the following steps: obtaining a first training sample, wherein the first training sample comprises at least one of the following: an image training sample, a text training sample, and a sound training sample; obtaining a first feature vector of the first training sample according to the first training sample; obtaining a first deep neural network model according to the first feature vector; obtaining a pre-training model according to the first training sample; combining the first deep neural network model and the pre-training model to obtain a combined neural network model; training the combined neural network model according to the first training sample to obtain a target neural network model; wherein the step of obtaining the first deep neural network model according to the first feature vector comprises the following steps: obtaining a network structure storage table, wherein the network structure storage table comprises a plurality of deep neural network models and a plurality of feature vectors, and the plurality of deep neural network models and the plurality of feature vectors correspond to each other in a one-to-one manner; determining a second feature vector according to the first feature vector, wherein the second feature vector is one of the plurality of feature vectors in the network structure storage table; obtaining a deep neural network model corresponding to the second feature vector according to the second feature vector.

2. The method of claim 1, wherein, The step of determining the second feature vector according to the first feature vector comprises the following steps: the distance between the second feature vector and the first feature vector is less than a first threshold.

3. A method of classifying an object, characterized by, The method comprises the following steps: obtaining object classification data, wherein the object classification data comprises at least one of the following: image classification data, text classification data, and sound classification data; processing the object classification data according to an object classification neural network model to obtain an object classification result, wherein the training of the object classification neural network model comprises the following steps: obtaining a first training sample; obtaining a first feature vector of the first training sample according to the first training sample; obtaining a first deep neural network model according to the first feature vector; obtaining a pre-training model according to the first training sample; combining the first deep neural network model and the pre-training model to obtain a combined neural network model; training the combined neural network model according to the first training sample to obtain the object classification neural network model; wherein the step of obtaining the first deep neural network model according to the first feature vector comprises the following steps: obtaining a network structure storage table, wherein the network structure storage table comprises a plurality of deep neural network models and a plurality of feature vectors, and the plurality of deep neural network models and the plurality of feature vectors correspond to each other in a one-to-one manner; determining a second feature vector according to the first feature vector, wherein the second feature vector is one of the plurality of feature vectors in the network structure storage table; obtaining a deep neural network model corresponding to the second feature vector according to the second feature vector.

4. The method of claim 3, wherein, The step of determining the second feature vector according to the first feature vector comprises the following steps: the distance between the second feature vector and the first feature vector is less than a first threshold.

5. An apparatus for training a neural network model, the apparatus comprising: The method comprises the following steps: obtaining a first training sample, wherein the first training sample comprises at least one of the following: an image training sample, a text training sample, and a sound training sample; a processing unit configured to obtain a first feature vector of the first training sample according to the first training sample; the processing unit is further configured to obtain a first deep neural network model according to the first feature vector; the processing unit is further configured to obtain a pre-training model according to the first training sample; the processing unit is further configured to combine the first deep neural network model and the pre-training model to obtain a combined neural network model; the processing unit is further configured to train the combined neural network model according to the first training sample to obtain a target neural network model; wherein the processing unit is specifically configured to obtain a network structure storage table, the network structure storage table comprising a plurality of deep neural network models and a plurality of feature vectors, the plurality of deep neural network models and the plurality of feature vectors corresponding one by one; determine a second feature vector according to the first feature vector, the second feature vector being one of the plurality of feature vectors in the network structure storage table; obtain a deep neural network model corresponding to the second feature vector according to the second feature vector.

6. The apparatus of claim 5, wherein, The processing unit determines a second feature vector according to the first feature vector, comprising: the distance between the second feature vector and the first feature vector is less than a first threshold.

7. An object classification apparatus characterized by comprising: comprising: an obtaining unit configured to obtain object classification data, the object classification data comprising at least one of: classification data of an image, classification data of a text, and classification data of a sound; a processing unit configured to process the object classification data according to an object classification neural network model to obtain an object classification result, wherein the training of the object classification neural network model comprises: obtaining a first training sample; obtaining a first feature vector of the first training sample according to the first training sample; obtaining a first deep neural network model according to the first feature vector; obtaining a pre-training model according to the first training sample; combining the first deep neural network model and the pre-training model to obtain a combined neural network model; training the combined neural network model according to the first training sample to obtain an object classification neural network model; wherein the obtaining of the first deep neural network model according to the first feature vector comprises: obtaining a network structure storage table, the network structure storage table comprising a plurality of deep neural network models and a plurality of feature vectors, the plurality of deep neural network models and the plurality of feature vectors corresponding one by one; determining a second feature vector according to the first feature vector, the second feature vector being one of the plurality of feature vectors in the network structure storage table; obtaining a deep neural network model corresponding to the second feature vector according to the second feature vector.

8. The apparatus of claim 7, wherein, The determining of the second feature vector according to the first feature vector comprises: the distance between the second feature vector and the first feature vector is less than a first threshold.

9. An apparatus for training a neural network model, the apparatus comprising: comprising a processor and a memory, the memory being configured to store program instructions, and the processor being configured to invoke the program instructions to execute the method of any one of claims 1 or 2, 3 or 4.

10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores program instructions, and when the program instructions are run by a processor, the method in any one of claims 1 or 2, 3 or 4 is implemented.

11. A computer program product comprising instructions, characterized in that, The instructions are executed to perform the method in any one of claims 1 or 2, 3 or 4.

12. A chip, characterized by The chip comprises a processor and a data interface, and the processor reads instructions stored on a memory through the data interface to execute the method in any one of claims 1 or 2, 3 or 4.

Citation Information

Patent Citations

  • Medical text relation extraction method based on pre-training model and fine tuning technology

    CN110134772A

  • Image classification method, neural network training method and neural network training device

    CN110309856A