Method and apparatus for neural network training, data processing method and apparatus

By introducing universal training and evaluation data into the UDA algorithm, and using clustering and MMT algorithms to adjust parameters and select the model with the highest accuracy, the problem of model selection after iteration in UDA is solved, thereby improving the accuracy of the target domain and training efficiency.

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

Patent Information

Application Number
CN202110648030.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-10
Publication Date
2026-01-13
Estimated Expiration
2041-06-10

AI Technical Summary

Technical Problem

In unsupervised domain adaptation (UDA) algorithms, how can we determine the neural network model for the target domain with the highest accuracy after multiple iterations, avoid overfitting, and reduce computational load?

Method used

By introducing a universal training dataset and a universal evaluation dataset during the training process, clustering algorithms and mutual mean teaching (MMT) algorithms are used to adjust the parameters of the neural network model. The model with the highest accuracy in the universal evaluation dataset is selected as the neural network model for the target domain, and preset conditions are set to stop the iteration.

Benefits of technology

It improves the accuracy of neural network models in the target domain, reduces the number of iterations and computational load, avoids overfitting, and improves the training efficiency of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115545143B_ABST
    Figure CN115545143B_ABST
Patent Text Reader

Abstract

The application discloses a neural network model training method and device, and a data processing method and device in the field of artificial intelligence. The neural network model training method comprises the following steps: performing multiple iterations on the first initial neural network model according to a training data set to obtain multiple training neural network models, wherein the training data set comprises a general training data set and a target domain data set; determining the accuracy of each training neural network model on a general evaluation data set according to the difference between the processing result of the data in the general evaluation data set and the labeled information of the data in the general evaluation data set obtained by each iteration, wherein the general evaluation data set and the general training data set have the same data distribution; and taking the training neural network model with the highest accuracy as the trained neural network model. Thus, the neural network model with the highest accuracy in the target domain can be determined from the multiple training neural network models.
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, and a method and apparatus for processing data. Background Technology

[0002] Artificial intelligence (AI) is the theory, methods, technology, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a branch of computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a way similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to have perception, reasoning, and decision-making capabilities. Research in the field of AI includes robotics, natural language processing, computer vision, decision-making and reasoning, human-computer interaction, recommendation and search, and fundamental AI theories.

[0003] Unsupervised domain adaptation (UDA) algorithms learn domain-invariant features from both the source and target domains, allowing a classifier learned from the source domain to be applied to the target domain even when the target domain is unlabeled. UDA is widely used in machine learning applications such as computer vision and natural language processing.

[0004] The UDA algorithm iteratively adjusts the parameters of the initial neural network model, with each iteration yielding a corresponding training model. However, with a large number of iterations, noise can lead to overfitting. Furthermore, the accuracy of the trained neural network model in the target domain decreases as the number of iterations increases. Therefore, determining the neural network model with the highest accuracy in the target domain from among the various training models obtained through multiple iterations of UDA is a pressing problem. Summary of the Invention

[0005] This application provides a method and apparatus for training a neural network, as well as a data processing method and apparatus, which can determine the neural network model with the highest accuracy in the target domain among various trained neural network models obtained through multiple iterations for implementing UDA.

[0006] In a first aspect, a neural network training method is provided, comprising: obtaining a first initial neural network model, which is pre-trained; iterating the first initial neural network model multiple times based on a training data set to obtain multiple training neural network models, wherein the training data set includes a general training data set and a target domain data set; processing data in a general evaluation data set using the training neural network models obtained in each iteration to obtain inference information, wherein the general evaluation data set has the same data distribution as the general training data set; determining the accuracy of the training neural network models obtained in each iteration in the general evaluation data set based on the difference between the annotation information of the data in the general evaluation data set and the inference information; and selecting the training neural network model with the highest accuracy as the trained neural network model.

[0007] Since the general evaluation dataset and the general training dataset have the same data distribution, the accuracy of the trained neural network model on the general evaluation dataset can represent the accuracy of the trained neural network model on the general training dataset. Furthermore, the general training dataset and the target domain dataset are used in multiple iterations of training the initial neural network model. The accuracy of the trained neural network model on both the general training dataset and the target domain dataset changes with the number of iterations in essentially the same way.

[0008] During multiple iterations of the neural network model, the training data includes not only the target domain dataset but also a general training dataset. By utilizing a general evaluation dataset with the same data distribution as the general training dataset, the accuracy trend of the trained neural network model obtained in each iteration on the general evaluation dataset is determined with the number of iterations. Thus, the trained neural network model with the highest accuracy on the general evaluation dataset is used as the trained neural network model, thereby improving the accuracy of the trained neural network model.

[0009] In other words, during multiple iterations of the neural network model, a general training dataset is added to the training dataset. A general evaluation dataset with the same data distribution as the general training dataset is then used to calculate the accuracy of the trained neural network model on the general evaluation dataset for each iteration. Because the accuracy of the trained neural network model on both the general training dataset and the target domain dataset follows essentially the same trend with each iteration, the trained neural network model with the highest accuracy on the general evaluation dataset will also have the highest accuracy on the target domain dataset; this model is the final trained neural network model.

[0010] In conjunction with the first aspect, in some possible implementations, the multiple iterations are stopped when a preset condition is met. The preset condition includes at least one of the following: as the number of iterations increases, the accuracy of the multiple trained neural network models obtained from the last preset number of iterations in the general evaluation dataset shows a decreasing trend; the number of iterations reaches a preset value.

[0011] After each iteration, the trained neural network model obtained in that iteration can be used to process the data in the general evaluation dataset to obtain the accuracy of the trained neural network model on that dataset. If preset conditions are met, the iteration can be stopped, i.e., further training of the neural network model can be halted, which can further reduce the number of iterations and the computational load.

[0012] In particular, stopping iteration when the accuracy of the trained neural network model on a general evaluation dataset is declining can prevent further iterations after overfitting has occurred, thereby reducing the number of iterations and computational load.

[0013] In conjunction with the first aspect, in some possible implementations, the iteration includes: extracting features from each data point in the training dataset using an initial model to obtain features for each data point in the training dataset, wherein the initial model is the first initial neural network model or the training neural network model obtained in the previous iteration; processing each feature using a clustering algorithm to determine the category of each data point in the training dataset; and adjusting the parameters of the initial model according to the category of each data point in the training dataset to obtain the training neural network model.

[0014] By adjusting the parameters of the initial neural network model using a clustering-based pseudo-label method, the trained neural network model exhibits better performance. The categories of data obtained using the clustering algorithm can also be referred to as pseudo-labels for that data.

[0015] In conjunction with the first aspect, in some possible implementations, the method further includes: obtaining a second initial neural network model, the second initial neural network model being pre-trained; the step of iterating the first initial neural network model multiple times based on the training data set to obtain multiple trained neural network models includes: using the mutual mean teaching MMT algorithm to perform the multiple iterations on the first initial neural network model and the second initial neural network model.

[0016] By using the MMT algorithm and taking into account the processing results of the first and second initial neural network models, the trained neural network model obtained has better performance.

[0017] In conjunction with the first aspect, in some possible implementations, the general evaluation dataset and the general training dataset share the same source.

[0018] When the general evaluation dataset and the general training dataset share the same source, they have the same data distribution. Therefore, given this shared source, there is no need to classify the data in the general training dataset; the neural network model training method provided in this application can be used to train the neural network model, thus reducing costs.

[0019] Secondly, a data processing method is provided, comprising: acquiring a neural network model, wherein the neural network model is the one with the highest accuracy in a general evaluation dataset among multiple trained neural network models, the multiple trained neural network models are obtained by iterating a first initial neural network model multiple times based on the training dataset, the accuracy of the trained neural network model obtained in each iteration in the general evaluation dataset is determined based on the difference between the annotation information of the data in the general evaluation dataset and the inference information, the inference information is obtained by processing the data in the general evaluation dataset using the trained neural network model, the first initial neural network model is pre-trained, the training dataset includes a general training dataset and a target domain dataset, the general evaluation dataset and the general training dataset have the same data distribution; and processing the data in the target domain dataset using the neural network model.

[0020] In conjunction with the second aspect, in some possible implementations, the multiple iterations stop when preset conditions are met, and the preset conditions include at least one of the following: as the number of iterations increases, the accuracy of the multiple trained neural network models obtained from the last preset number of iterations on the general evaluation dataset shows a decreasing trend; the number of iterations reaches a preset value.

[0021] In conjunction with the second aspect, in some possible implementations, the training neural network model obtained in each iteration is obtained by adjusting the parameters of the initial model according to the category of each data in the training set. The initial model is either the first initial neural network model or the training neural network model obtained in the previous iteration. The category of each data in the training set is obtained by processing the features of each data in the training set using a clustering algorithm. The features of each data in the training set are obtained by extracting features from each data in the training set using the initial model.

[0022] In conjunction with the second aspect, in some possible implementations, the plurality of trained neural network models are obtained by iterating the first initial neural network model and the second initial neural network model multiple times using mutual mean teaching MMT.

[0023] In conjunction with the second aspect, in some possible implementations, the general evaluation data set and the general training dataset share the same source.

[0024] Thirdly, a neural network model training device is provided, comprising an acquisition module and a processing module. The acquisition module is used to acquire a first initial neural network model, which is pre-trained. The processing module is used to iterate the first initial neural network model multiple times according to a training data set to obtain multiple training neural network models. The training data set includes a general training data set and a target domain data set. The processing module is also used to process data in a general evaluation data set using the training neural network model obtained in each iteration to obtain inference information. The general evaluation data set has the same data distribution as the general training data set. The processing module is also used to determine the accuracy of the training neural network model obtained in each iteration in the general evaluation data set based on the difference between the annotation information of the data in the general evaluation data set and the inference information. The processing module is also used to select the training neural network model with the highest accuracy as the trained neural network model.

[0025] In conjunction with the third aspect, in some possible implementations, the processing module is further configured to: stop the multiple iterations when a preset condition is met, the preset condition including at least one of the following: as the number of iterations increases, the accuracy of the multiple trained neural network models obtained from the last preset number of iterations in the general evaluation dataset shows a decreasing trend; the number of iterations reaches a preset value.

[0026] In conjunction with the third aspect, in some possible implementations, during one iteration, the processing module is specifically used to: extract features from each data point in the training dataset using an initial model to obtain features for each data point in the training dataset, wherein the initial model is the first initial neural network model or the training neural network model obtained in the previous iteration; process each feature using a clustering algorithm to determine the category of each data point in the training dataset; and adjust the parameters of the initial model according to the category of each data point in the training dataset to obtain the training neural network model.

[0027] In conjunction with the third aspect, in some possible implementations, the acquisition module is further configured to acquire a second initial neural network model, which is pre-trained; the processing module is further configured to perform the multiple iterations on the first initial neural network model and the second initial neural network model using the mutual mean teaching MMT algorithm.

[0028] In conjunction with the third aspect, in some possible implementations, the general evaluation dataset and the general training dataset share the same source.

[0029] Fourthly, a data processing apparatus is provided, comprising: an acquisition module and a processing module. The acquisition module is used to acquire a neural network model, wherein the neural network model is the one with the highest accuracy among multiple trained neural network models on a general evaluation dataset. The multiple trained neural network models are obtained by iterating a first initial neural network model multiple times based on the training dataset. The accuracy of the trained neural network model obtained in each iteration on the general evaluation dataset is determined based on the difference between the annotation information and inference information of the data in the general evaluation dataset. The inference information is obtained by processing the data in the general evaluation dataset using the trained neural network model. The first initial neural network model is pre-trained. The training dataset includes a general training dataset and a target domain dataset, and the general evaluation dataset and the general training dataset have the same data distribution. The processing module is used to process the data in the target domain dataset using the neural network model.

[0030] In conjunction with the fourth aspect, in some possible implementations, the multiple iterations stop when a preset condition is met, and the preset condition includes at least one of the following: as the number of iterations increases, the accuracy of the multiple trained neural network models obtained from the last preset number of iterations in the general evaluation dataset shows a decreasing trend; the number of iterations reaches a preset value.

[0031] In conjunction with the fourth aspect, in some possible implementations, the training neural network model obtained in each iteration is obtained by adjusting the parameters of the initial model according to the category of each data in the training set. The initial model is either the first initial neural network model or the training neural network model obtained in the previous iteration. The category of each data in the training set is obtained by processing the features of each data in the training set using a clustering algorithm. The features of each data in the training set are obtained by extracting features from each data in the training set using the initial model.

[0032] In conjunction with the fourth aspect, in some possible implementations, the plurality of trained neural network models are obtained by iterating the first initial neural network model and the second initial neural network model multiple times using mutual mean teaching MMT.

[0033] In conjunction with the fourth aspect, in some possible implementations, the general evaluation data set and the general training dataset share the same source.

[0034] Fifthly, an electronic device is provided, including a memory and a processor, the memory being used to store program instructions; when the program instructions are executed in the processor, the processor is used to perform the method described in the first aspect or the second aspect.

[0035] The processor mentioned in the fifth aspect above can be a central processing unit (CPU) or a combination of a CPU and a neural network processing processor. The neural network processing processor can include a graphics processing unit (GPU), a neural network processing unit (NPU), and a tensor processing unit (TPU), etc. The TPU is a dedicated integrated circuit developed by Google for a fully customized artificial intelligence accelerator for machine learning.

[0036] A sixth aspect provides a computer-readable medium storing program code for execution by a device, the program code including methods for performing any implementation of the first or second aspect.

[0037] In a seventh aspect, a computer program product containing instructions is provided, which, when run on a computer, causes the computer to perform the method in any one of the implementations of the first or second aspect described above.

[0038] Eighthly, a chip is provided, the chip including a processor and a data interface, wherein the processor reads instructions stored in a memory through the data interface and executes the method in any one of the implementations of the first or second aspect described above.

[0039] Optionally, as one implementation, the chip may further include a memory storing instructions, and the processor is used to execute the instructions stored in the memory. When the instructions are executed, the processor is used to execute the method in either the first aspect or the second aspect.

[0040] The aforementioned chip can be a field-programmable gate array (FPGA) or an application-specific integrated circuit (ASIC).

[0041] It should be understood that, in this application, the method of the first aspect can specifically refer to the first aspect and the method in any of the various implementations of the first aspect. Attached Figure Description

[0042] Figure 1 This is a schematic diagram of a system architecture provided in an embodiment of this application.

[0043] Figure 2 This is a schematic diagram of the structure of a convolutional neural network provided in an embodiment of this application.

[0044] Figure 3 This is a schematic diagram of another convolutional neural network structure provided in an embodiment of this application.

[0045] Figure 4 This is a schematic diagram of the hardware structure of a chip provided in an embodiment of this application.

[0046] Figure 5 This is a schematic diagram of a system architecture provided in an embodiment of this application.

[0047] Figure 6 This is a schematic flowchart of a neural network model training method.

[0048] Figure 7 This is a graph showing how the accuracy of a neural network model changes with the number of iterations.

[0049] Figure 8 This is a schematic flowchart of a neural network model training method provided in an embodiment of this application.

[0050] Figure 9 This is a schematic flowchart illustrating another neural network model training method provided in the embodiments of this application.

[0051] Figure 10 This is a schematic flowchart illustrating another neural network model training method provided in the embodiments of this application.

[0052] Figures 11 to 14 This is a graph showing the relationship between the accuracy of the neural network model provided in this application and the number of iterations.

[0053] Figure 15 This is a schematic flowchart illustrating another neural network model training method provided in the embodiments of this application.

[0054] Figure 16 and Figure 17 This is a graph showing the relationship between the accuracy of the neural network model provided in this application embodiment and the number of iterations.

[0055] Figure 18 This is a schematic flowchart illustrating another data processing method provided in the embodiments of this application.

[0056] Figure 19 This is a schematic structural diagram of a data processing device provided in an embodiment of this application.

[0057] Figure 20 This is a schematic structural diagram of a neural network training device provided in an embodiment of this application.

[0058] Figure 21 This is a schematic structural diagram of a data processing apparatus according to an embodiment of this application.

[0059] Figure 22 This is a schematic structural diagram of a neural network training device according to an embodiment of this application. Detailed Implementation

[0060] The technical solutions of the embodiments of this application will now be described with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.

[0061] Since the embodiments of this application involve a large number of neural network applications, for ease of understanding, the relevant terms and concepts of neural networks that may be involved in the embodiments of this application will be introduced below.

[0062] (1) Neural Network

[0063] Neural networks can be composed of neural units, which can refer to units represented by x. s The arithmetic unit that takes an intercept of 1 as input can output the following:

[0064]

[0065] Where s = 1, 2, ..., n, n is a natural number greater than 1, W s For x sThe weights are denoted by b, where b is the bias of the neural unit. f is the activation function of the neural unit, used to introduce nonlinear characteristics into the neural network to convert the input signal in 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; 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.

[0066] (2) Deep Neural Networks

[0067] 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.

[0068] 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 relatively large. The definitions of these parameters in DNNs are 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.

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

[0070] 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).

[0071] (3) Convolutional Neural Network

[0072] 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 of a CNN, a neuron may only be connected to some of its neighboring neurons. A convolutional layer typically contains several feature planes, each composed of a series of rectangularly arranged neural units. Neural units on the same feature plane share weights, which are called 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 that it reduces the connections between layers in the CNN, while also reducing the risk of overfitting.

[0073] (4) Recurrent neural networks (RNNs) are used to process sequential data. In traditional neural network models, the layers are fully connected from the input layer to the hidden layer and then to the output layer, but the nodes within each layer are unconnected. While this type of ordinary neural network has solved many difficult problems, it is still powerless against many others. For example, to predict the next word in a sentence, you generally need to use the preceding words because the words in a sentence are not independent. RNNs are called recurrent neural networks because the current output of a sequence is related to the previous output. Specifically, the network memorizes previous information and applies it to the calculation of the current output. That is, the nodes within the hidden layer are no longer unconnected but connected, and the input of the hidden layer includes not only the output of the input layer but also the output of the hidden layer at the previous time step. Theoretically, RNNs can process sequential data of any length. Training an RNN is the same as training a traditional CNN or DNN.

[0074] 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.

[0075] (5) Loss Function

[0076] 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.

[0077] (6) Backpropagation algorithm

[0078] Neural networks can employ backpropagation (BP) to correct the parameters of the initial neural network model during training, thereby reducing 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.

[0079] (7) Unsupervised learning

[0080] Unsupervised learning is a type of machine learning. It involves learning from training samples that lack concept labels (classifications) to discover structural knowledge within the training sample set. Here, all labels (classifications) are unknown.

[0081] (8) Supervised learning

[0082] Supervised learning is a method of machine learning. It learns from training samples with concept labels (classifications) to predict labels (classifications) on data outside the training sample set as much as possible. Here, all labels (classifications) are known.

[0083] (9) Unsupervised adaptive domain

[0084] Unsupervised domain adaptation (UDA) is a transfer learning method. Domain adaptation is a machine learning algorithm designed to address the distribution shift between the source and target domains. Various domain adaptation methods aim to learn domain-invariant features of both the source and target domains, allowing a classifier learned from the source domain to be applied to the target domain even when the target domain has few or no labels. Labels, also known as annotation information, can be manually labeled. UDA is widely used in machine learning applications such as computer vision and natural language processing.

[0085] Domain adaptation methods transfer knowledge from the source domain to the target domain through model capabilities; this process can be viewed as the model adapting to the target domain. Unsupervised domain adaptation can solve the problem of traditional supervised learning requiring extensive manual annotation.

[0086] (10) Pedestrian Re-identification

[0087] Person re-identification (Person ReID or ReID) aims to retrieve images of specific pedestrians across different cameras and is widely used in surveillance scenarios. The availability of large-scale, manually labeled datasets has driven rapid advancements in this task, leading to significant improvements in accuracy. However, in practical applications, even models trained on large datasets often experience a noticeable drop in accuracy when directly deployed to a new surveillance system due to significant domain differences. Re-collecting and manually labeling data for each surveillance system is time-consuming, labor-intensive, and difficult to implement. Therefore, unsupervised domain adaptation (UDA) has been proposed to address this issue, allowing models trained in a labeled source domain to adapt to an unlabeled target domain, thus improving retrieval accuracy in the target domain. It is worth noting that, unlike typical unsupervised domain adaptation problems (where the target and source domains share categories), the number of categories in the target domain in person re-identification is unpredictable and typically does not overlap with the source domain.

[0088] (11) Pre-training

[0089] Machine learning applications require neural network models to accurately predict test samples. In some cases, the number of test samples is limited. To achieve accurate classification of each test sample in the test sample set, the original neural network model can be trained using a training sample set, which contains a large number of training samples. Then, the initial neural network model is fine-tuned using the test sample set to obtain the trained neural network model. Test samples and training samples can have different data distributions. The process of training the original neural network model using a large number of training samples is called pre-training.

[0090] In transfer learning, training a neural network model using source domain data can also be understood as pre-training the neural network model.

[0091] (12) Data distribution

[0092] Multiple datasets with the same data distribution, where the data in each dataset has the same type of labels. Each data label represents its type. In other words, two datasets with the same data distribution have the same data type.

[0093] like Figure 1 As shown, this application embodiment provides a system architecture 100. In Figure 1In this embodiment, the data acquisition device 160 is used to collect training data. For the data processing method of this application, the training data may include training images, training audio, training video, training text, etc.

[0094] After collecting the training data, the data acquisition device 160 stores the training data in the database 130, and the training device 120 trains the target model / rule 101 based on the training data maintained in the database 130.

[0095] The following describes how the training device 120 obtains the target model / rule 101 based on the training data. The training device 120 processes the input training data and compares the output training information with the corresponding annotation information of the training data until the difference between the output training information of the training device 120 and the corresponding annotation information of the training data is less than a certain threshold, thereby completing the training of the target model / rule 101.

[0096] The aforementioned target model / rule 101 can be used to implement the data processing method of this application embodiment. Specifically, the target model / rule 101 in this application embodiment can be a neural network. It should be noted that in practical applications, the training data maintained in the database 130 may not all come from the data acquisition device 160; it may also be received from other devices. Furthermore, it should be noted that the training device 120 may not necessarily train the target model / rule 101 entirely based on the training data maintained in the database 130; it may also obtain training data from the cloud or other sources for model training. The above description should not be construed as limiting the embodiments of this application.

[0097] The target model / rule 101 trained using training device 120 can be applied to different systems or devices, such as... Figure 1 The execution device 110 shown can be a terminal, such as a mobile phone terminal, tablet computer, laptop computer, augmented reality (AR) / virtual reality (VR) device, vehicle terminal, etc., or it can be a server or cloud service. Figure 1 In this embodiment, the execution device 110 is configured with an input / output (I / O) interface 112 for data interaction with external devices. Users can input data to the I / O interface 112 through the client device 140. The input data may include data to be processed input by the client device.

[0098] The preprocessing module 113 and the preprocessing module 114 are used to preprocess the input data (such as data to be processed) received by the I / O interface 112. In this embodiment, the preprocessing module 113 and the preprocessing module 114 may be omitted (or only one of them may be used), and the calculation module 111 may be used directly to process the input data.

[0099] During the preprocessing of input data by the execution device 110, or during the calculation module 111 of the execution device 110 performing calculations and other related processes, the execution device 110 can call data, code, etc. in the data storage system 150 for corresponding processing, or store the data, instructions, etc. obtained from the corresponding processing into the data storage system 150.

[0100] Finally, I / O interface 112 returns the processing result to client device 140, thereby providing it to the user.

[0101] It is worth noting that the training device 120 can generate corresponding target models / rules 101 based on different training data for different objectives or tasks. The corresponding target models / rules 101 can be used to achieve the above objectives or complete the above tasks, thereby providing the user with the required results.

[0102] exist Figure 1 In the scenario shown, the user can manually provide input data, which can be done through the interface provided by I / O interface 112. Alternatively, the client device 140 can automatically send input data to I / O interface 112. If user authorization is required for the client device 140 to automatically send input data, the user can set the corresponding permissions in the client device 140. The user can view the output results of the execution device 110 on the client device 140, which can be presented in various forms such as display, sound, or animation. The client device 140 can also act as a data acquisition terminal, collecting the input data and output results of the input I / O interface 112 as new sample data and storing them in the database 130. Alternatively, data can be collected directly from the I / O interface 112 without going through the client device 140, using the input data and output results of the input I / O interface 112 as new sample data and storing them in the database 130.

[0103] It is worth noting that, Figure 1 This is merely a schematic diagram of a system architecture provided in an embodiment of this application. The positional relationships between the devices, components, modules, etc., shown in the diagram do not constitute any limitation. For example, in Figure 1In this context, the data storage system 150 is an external memory relative to the execution device 110. In other cases, the data storage system 150 may also be placed within the execution device 110.

[0104] like Figure 1 As shown, the target model / rule 101 is trained by the training device 120. In this embodiment of the application, the target model / rule 101 can be the neural network in this application. Specifically, the neural network used in this embodiment of the application can be CNN, deep convolutional neural network (DCNN), recurrent neural network (RNN), etc.

[0105] Since CNN is a very common type of neural network, the following will combine... Figure 2 This section focuses on a detailed explanation of the structure of CNNs. As mentioned in the basic concept introduction above, a Convolutional Neural Network (CNN) is a deep neural network with a convolutional structure. It is a deep learning architecture, which refers to learning at multiple levels of abstraction using machine learning algorithms. As a deep learning architecture, CNN is a feed-forward artificial neural network, where each neuron responds to the input data. The following explanation uses an image as the input data.

[0106] The data processing method in this application embodiment specifically employs a neural network structure as follows: Figure 2 As shown. In Figure 2 In this example, the Convolutional Neural Network (CNN) 200 may include an input layer 210, convolutional / pooling layers 220 (where the pooling layers are optional), and a neural network layer 230. The input layer 210 acquires the data to be processed and passes it to the convolutional / pooling layers 220 and the subsequent neural network layer 230 for processing, thus obtaining the processed data result. The following section... Figure 2 This section provides a detailed introduction to the internal layer structure of CNN 200.

[0107] Convolutional / pooling layers 220:

[0108] Convolutional layers:

[0109] like Figure 2The convolutional / pooling layer 220 shown may include layers as in Examples 221-226. For instance, in one implementation, layer 221 is a convolutional layer, layer 222 is a pooling layer, layer 223 is a convolutional layer, layer 224 is a pooling layer, layer 225 is a convolutional layer, and layer 226 is a pooling layer; in another implementation, layers 221 and 222 are convolutional layers, layer 223 is a pooling layer, layers 224 and 225 are convolutional layers, and layer 226 is a pooling layer. That is, the output of the convolutional layer can be used as the input to a subsequent pooling layer, or as the input to another convolutional layer to continue the convolution operation.

[0110] The following section will use convolutional layer 221 as an example to introduce the internal working principle of a convolutional layer.

[0111] Convolutional layer 221 can include multiple convolution operators, also known as kernels. In data processing, a convolution operator acts as a filter to extract specific information from the input image. Essentially, a convolution operator can be a weight matrix, which is usually predefined. During the convolution operation, the weight matrix typically processes the input image pixel by pixel (or two pixels by two pixels, depending on the stride) along the horizontal direction, thus extracting specific features from the image. The size of the weight matrix should be related to the image size. It's important to note that the depth dimension of the weight matrix is ​​the same as the depth dimension of the input image; during convolution, the weight matrix extends to the entire depth of the input image. Therefore, convolution with a single weight matrix produces a single-depth convolutional output. However, in most cases, a single weight matrix is ​​not used; instead, multiple weight matrices of the same size (rows × columns) are applied—multiple identical matrices. The outputs of each weight matrix are stacked to form the depth dimension of the convolutional image; this dimension can be understood as being determined by the "multiple" mentioned above. Different weight matrices can be used to extract different features from an image. For example, one weight matrix can be used to extract edge information, another to extract specific colors, and yet another to blur unwanted noise. These multiple weight matrices have the same size (rows × columns), and the resulting convolutional feature maps are also of the same size. These extracted convolutional feature maps are then merged to form the output of the convolution operation.

[0112] The weight values ​​in these weight matrices need to be obtained through extensive training in practical applications. The weight matrices formed by the weight values ​​obtained through training can be used to extract information from the input image, thereby enabling the convolutional neural network 200 to make correct predictions.

[0113] When a convolutional neural network 200 has multiple convolutional layers, the initial convolutional layers (e.g., 221) tend to extract more general features, which can also be called low-level features. As the depth of the convolutional neural network 200 increases, the features extracted by later convolutional layers (e.g., 226) become more and more complex, such as high-level semantic features. Features with higher semantic levels are more suitable for the problem to be solved.

[0114] Pooling layer:

[0115] Because it is often necessary to reduce the number of training parameters, pooling layers are often introduced periodically after convolutional layers, such as... Figure 2 Layers 221-226 in example 220 can be a convolutional layer followed by a pooling layer, or multiple convolutional layers followed by one or more pooling layers. In image processing, the sole purpose of pooling layers is to reduce the spatial size of the image. Pooling layers can include average pooling and / or max pooling operators to sample the input image to obtain a smaller image size. The average pooling operator calculates the average value of pixel values ​​within a specific range as the result of average pooling. The max pooling operator takes the pixel with the largest value within a specific range as the result of max pooling. Furthermore, just as the size of the weight matrix in a convolutional layer should be related to the image size, the operators in a pooling layer should also be related to the image size. The size of the output image after processing by the pooling layer can be smaller than the size of the input image of the pooling layer. Each pixel in the output image of the pooling layer represents the average or maximum value of the corresponding sub-region of the input image of the pooling layer.

[0116] Neural network layer 230:

[0117] After processing by the convolutional / pooling layers 220, the convolutional neural network 200 is still insufficient to output the required information. As mentioned earlier, the convolutional / pooling layers 220 only extract features and reduce the parameters introduced by the input image. However, to generate the final output information (the required class information or other relevant information), the convolutional neural network 200 needs to utilize neural network layers 230 to generate one or more outputs representing the required number of classes. Therefore, neural network layers 230 can include multiple hidden layers (such as...). Figure 2 As shown in layers 231, 232 to 23n) and output layer 240, the parameters contained in these multi-layer hidden layers can be pre-trained based on relevant training data for specific task types, such as image recognition, image classification, image super-resolution reconstruction, etc.

[0118] After the multiple hidden layers in neural network layer 230, the final layer of the entire convolutional neural network 200 is the output layer 240. This output layer 240 has a loss function similar to classification cross-entropy, specifically used to calculate the prediction error. Once the entire convolutional neural network 200 has undergone forward propagation (e.g., ...), the loss function is applied. Figure 2 Propagation from 210 to 240 degrees is considered forward propagation, while backward propagation (e.g.) is completed. Figure 2 The propagation from 240 to 210 (backpropagation) will begin to update the weight values ​​and biases of the layers mentioned above, in order to reduce the loss of the convolutional neural network 200 and the error between the output of the convolutional neural network 200 through the output layer and the ideal result.

[0119] The data processing method in this application embodiment specifically employs a neural network structure as follows: Figure 3 As shown. In Figure 3 In this example, the Convolutional Neural Network (CNN) 200 may include an input layer 110, convolutional / pooling layers 120 (where pooling layers are optional), and neural network layers 130. Figure 2 compared to, Figure 3 Multiple convolutional / pooling layers in the convolutional / pooling layer 120 are processed in parallel, and the extracted features are input into the full neural network layer 130 for processing.

[0120] It should be noted that, Figure 2 and Figure 3 The convolutional neural networks shown are merely examples of two possible convolutional neural networks for the data processing method of this application embodiment. In specific applications, the convolutional neural networks used in the data processing method of this application embodiment may also exist in the form of other network models.

[0121] Figure 4 The present application provides a hardware structure for a chip, which includes a neural network processor 50. This chip can be configured as follows: Figure 1 The execution device 110 shown is used to perform the calculations of the calculation module 111. This chip can also be located in, for example... Figure 1 The training device 120 shown is used to complete the training work of the training device 120 and output the target model / rule 101. For example... Figure 2 and Figure 3 The algorithms for each layer in the convolutional neural network shown can all be implemented in, for example... Figure 4 This is achieved in the chip shown.

[0122] The Neural Processing Unit (NPU) 50 is mounted as a coprocessor on the main central processing unit (CPU) (host CPU), and tasks are assigned by the host CPU. The core of the NPU is the arithmetic circuit 503, and the controller 504 controls the arithmetic circuit 503 to retrieve data from the memory (weight memory or input memory) and perform calculations.

[0123] In some implementations, the arithmetic circuit 503 internally includes multiple process engines (PEs). In some implementations, the arithmetic circuit 503 is a two-dimensional pulsating array. The arithmetic circuit 503 can also be a one-dimensional pulsating array or other electronic circuits capable of performing mathematical operations such as multiplication and addition. In some implementations, the arithmetic circuit 503 is a general-purpose matrix processor.

[0124] For example, suppose we have an input matrix A, a weight matrix B, and an output matrix C. The arithmetic circuit retrieves the corresponding data of matrix B from the weight memory 502 and caches it in each PE of the arithmetic circuit. The arithmetic circuit retrieves the data of matrix A from the input memory 501 and performs matrix operations with matrix B. The partial result or the final result of the obtained matrix is ​​stored in the accumulator 508.

[0125] The vector computation unit 507 can further process the output of the arithmetic circuit, such as vector multiplication, vector addition, exponentiation, logarithmic operations, size comparisons, etc. For example, the vector computation unit 507 can be used for network computation in non-convolutional / non-FC layers of neural networks, such as pooling, batch normalization, local response normalization, etc.

[0126] In some implementations, the vector computation unit 507 can store the processed output vector into a unified buffer 506. For example, the vector computation unit 507 can apply a nonlinear function to the output of the arithmetic circuit 503, such as a vector of accumulated values, to generate activation values. In some implementations, the vector computation unit 507 generates normalized values, merged values, or both. In some implementations, the processed output vector can be used as activation input to the arithmetic circuit 503, for example, for use in subsequent layers of a neural network.

[0127] The unified memory 506 is used to store input data and output data.

[0128] The weight data is directly transferred from the external memory to the input memory 501 and / or the unified memory 506 through the direct memory access controller 505 (DMAC), the weight data in the external memory is stored in the weight memory 502, and the data in the unified memory 506 is stored in the external memory.

[0129] The bus interface unit (BIU) 510 is used to enable interaction between the main CPU, DMAC and instruction fetch memory 509 via a bus.

[0130] The instruction fetch buffer 509, connected to the controller 504, is used to store the instructions used by the controller 504.

[0131] The controller 504 is used to call the instructions cached in the instruction memory 509 to control the operation of the computing accelerator.

[0132] Generally, the unified memory 506, input memory 501, weight memory 502, and instruction fetch memory 509 are all on-chip memories, while the external memory is memory outside the NPU. This external memory can be double data rate synchronous dynamic random access memory (DDR SDRAM), high bandwidth memory (HBM), or other readable and writable memory.

[0133] in, Figure 2 and Figure 3 The operations of each layer in the convolutional neural network shown can be performed by the operation circuit 503 or the vector calculation unit 507.

[0134] The above-mentioned Figure 1 The execution device 110 in the present application is capable of executing each step of the data processing method of the embodiments of the present application. Figure 2 and Figure 3 The CNN model shown and Figure 4 The chip shown can also be used to execute various steps of the data processing method of the embodiments of this application. The neural network training method and the data processing method of the embodiments of this application will be described in detail below with reference to the accompanying drawings.

[0135] like Figure 5As shown, this application embodiment provides a system architecture 300. The system architecture includes a local device 301, a local device 302, an execution device 210, and a data storage system 250, wherein the local devices 301 and 302 are connected to the execution device 210 through a communication network.

[0136] The execution device 210 can be implemented by one or more servers. Optionally, the execution device 210 can be used in conjunction with other computing devices, such as data storage devices, routers, load balancers, etc. The execution device 210 can be deployed on a single physical site or distributed across multiple physical sites. The execution device 210 can use data in the data storage system 250 or call program code in the data storage system 250 to implement the data processing method of the embodiments of this application.

[0137] Specifically, the execution device 210 can execute the various steps of the data processing method provided in the embodiments of this application.

[0138] Users can interact with execution device 210 by operating their respective user devices (e.g., local device 301 and local device 302). Each local device can represent any computing device, such as a personal computer, computer workstation, smartphone, tablet, smart camera, smart car or other type of cellular phone, media consumption device, wearable device, set-top box, game console, etc.

[0139] Each user's local device can interact with the execution device 210 through a communication network of any communication mechanism / standard. The communication network can be a wide area network, a local area network, a point-to-point connection, or any combination thereof.

[0140] In one implementation, local devices 301 and 302 obtain relevant parameters of the target neural network from execution device 210, deploy the target neural network on local devices 301 and 302, and use the target neural network for image classification or image processing, etc.

[0141] In another implementation, the target neural network can be directly deployed on the execution device 210. The execution device 210 obtains the data to be processed from the local devices 301 and 302, and performs classification or other types of processing on the data to be processed according to the target neural network.

[0142] The aforementioned execution device 210 can also be a cloud device, in which case the execution device 210 can be deployed in the cloud; or, the aforementioned execution device 210 can also be a terminal device, in which case the execution device 210 can be deployed on the user terminal side. This application embodiment does not limit this.

[0143] Figure 6A schematic flowchart of a neural network model training method is shown.

[0144] The neural network model training method 600 includes steps S601 to S604.

[0145] The source domain includes multiple first data points and a label corresponding to each first data point.

[0146] In S601, a neural network model Ms can be trained using the first data in the source domain and the label of each first data.

[0147] In other words, a neural network model Ms is obtained by training through supervised learning.

[0148] Specifically, a first data point from the source domain is input into an initial neural network model. The initial neural network model processes the first data point to obtain a training label. Based on the training label and the label corresponding to the first data point, the parameters of the initial neural network model are adjusted to minimize the loss value. The adjusted initial neural network model is then used to process other first data points until the loss value gradually converges, resulting in the trained neural network model Ms.

[0149] In S602, feature extraction is performed on the second data in the target domain using the neural network model Ms to obtain the features of each second data.

[0150] A neural network model Ms may include a feature extraction module. The feature extraction module is used to extract features from the input data. The neural network model Ms may also include a classifier or other modules. The classifier can be used to classify the data based on the features output by the feature extraction module. The feature extraction module in the neural network model Ms can be used to extract features from second data in the target domain.

[0151] The second data in the target domain can be unlabeled data, meaning the label of the second data is unknown.

[0152] In S603, a clustering algorithm is used to cluster the features of the second data to obtain the category of each second data, and each category corresponds to a pseudo-label.

[0153] In S604, the parameters of the neural network model Ms are adjusted using multiple second data in the target domain and the pseudo-label of each second data to obtain the trained neural network model Mt.

[0154] Specifically, a second data point from the target domain is input into the neural network model Ms. The neural network model Ms processes the second data to obtain training labels. Based on the training labels and the pseudo-labels corresponding to the neural network model Ms, the parameters of the neural network model Ms are adjusted to minimize the loss value.

[0155] The adjusted neural network model Ms is used to process each second data in the target domain until the loss value gradually converges, resulting in the trained neural network model Mt.

[0156] S601 to S604 utilize the UDA algorithm to improve the quality of pseudo-labels as the neural network model Mt is optimized. However, the training of the model is affected by pseudo-label noise. Pseudo-label noise mainly comes from the limited expressiveness of the source domain pre-trained network in the target domain, the unknown number of target domain categories, and the limitations of the clustering algorithm itself.

[0157] When the target domain has a large amount of data, it can be divided into multiple subsets. For each subset, processing steps S602 to S604 are performed, and each iteration can be considered as one step. When the target domain has a small amount of data, steps S601 to S604 can be repeated, and each execution of steps S601 to S604 can be considered as one iteration. The number of iterations affects the accuracy of the neural network model Mt.

[0158] The labels for each second data point in the target domain can be determined manually. By comparing the results obtained from processing the second data using the neural network model Mt with the manually labeled data, the accuracy of the neural network model Mt can be determined.

[0159] Mean average precision (mAP) can be used to represent the accuracy of a neural network model. The mean average precision is determined based on the confidence level of detected positive samples.

[0160] Specifically, mAP represents the mean average precision (AP) of each test sample in the test set. The test set includes multiple test samples and their corresponding actual labels. A neural network model can be used to process these multiple test samples to obtain their features and processed labels. For each test sample, a corresponding test sample set is determined. In each test sample set, other test samples have high feature similarity to the original test sample. Based on the difference between the processed labels and actual labels of each test sample in the corresponding test sample set, the AP of the corresponding test sample set can be determined. The mean AP of the test sample set corresponding to each test sample in the test set is the mAP.

[0161] like Figure 7 As shown, when the number of iterations is small, the mAP of the neural network model Mt increases with the increase of the number of iterations.

[0162] Since the pseudo-labels are obtained through clustering, they contain noise, meaning they are not entirely accurate. With a large number of iterations, these noisy pseudo-labels lead to overfitting. As the number of iterations increases, the accuracy of the neural network model Mt in the target domain decreases.

[0163] Therefore, in practical applications, how to determine the neural network model with the highest accuracy in the target domain among the various trained neural network models obtained through multiple iterations of UDA is an urgent problem to be solved.

[0164] To address the aforementioned issues, this application provides a method for training a neural network model.

[0165] Figure 8 This is a schematic flowchart of a neural network model training method provided in an embodiment of this application.

[0166] The neural network model training method 800 includes steps S810 to S850. The training device 120 can be used to execute method 800.

[0167] In S810, a first initial neural network model is obtained, which is obtained through pre-training.

[0168] The first initial neural network model can be trained based on the data in the source domain dataset and the label corresponding to each data point in the source domain dataset.

[0169] Specifically, data from the source domain dataset is input into the original neural network model, which processes the data to obtain training labels. Based on the training labels and their corresponding labels, the parameters of the neural network model `Ms` are adjusted to minimize the loss value. The loss value represents the difference between the training labels and the corresponding labels. The adjusted neural network model is then used to process other data. When the loss value gradually converges, or the number of adjustments reaches a preset value, the adjusted neural network model becomes the first initial neural network model.

[0170] Training the original neural network model using data from the source domain dataset and the label corresponding to each data point in the source domain dataset can be understood as pre-training the original neural network model. In other words, the first initial neural network model can be understood as being obtained through pre-training.

[0171] In S820, the first initial neural network model is iterated multiple times according to the training data set to obtain multiple training neural network models. The training data set includes a general training data set and a target domain data set.

[0172] The source domain dataset and the target domain dataset can have different data distributions. The data types in the target domain dataset can include types other than those in the source domain dataset.

[0173] The training dataset used in each iteration can include the same or different data. The training dataset used in each iteration can have the same data distribution.

[0174] In S830, the data in the general evaluation data set is processed by the training neural network model obtained in each iteration to obtain the inference information corresponding to the training neural network model. The general evaluation data set and the general training data set have the same data distribution.

[0175] In S840, based on the difference between the annotation information of the data in the general evaluation data set and the inference information corresponding to the training neural network model obtained in each iteration, the accuracy of the training neural network model obtained in each iteration in the general evaluation data set is determined. The general evaluation data set and the general training data set have the same data distribution.

[0176] They have the same data distribution, meaning they have the same data type. Each data point in the general evaluation dataset has annotation information, which can also be called a label, used to indicate the type of data.

[0177] The data in the general training dataset may not have labeled information. If the general evaluation dataset and the general training dataset share the same source, they can be considered to have the same data type, i.e., the same data distribution.

[0178] A common evaluation dataset and a common training dataset share a common source, meaning that all data in the common evaluation dataset and the common training dataset originate from the same source. Both datasets can be considered to share a common source if they both include image data from a single camera, or if they both include image data from each camera in a set of cameras. Randomly selecting data from the same total dataset to form two new datasets, when the amount of data in both new datasets is large, can also be considered to mean that both new datasets and the total dataset share a common source. For example, when the amount of data in each new dataset is more than 3, 5, 10, or 20 times the number of data types in the total dataset, both new datasets and the total dataset can be considered to share a common source. Generally, when the amount of data in both new datasets is large, both new datasets include all data types from the total dataset.

[0179] When the general evaluation dataset and the general training dataset share the same source, they have the same data distribution. Therefore, given this shared source, there is no need to classify the data in the general training dataset; the neural network model training method provided in this application can be used to train the neural network model, thus reducing costs.

[0180] By using a trained neural network model to process data in a general evaluation dataset and comparing the processing results with the annotation information of each data point in the general evaluation dataset, the accuracy of the trained neural network model on the general evaluation dataset can be determined.

[0181] In S850, the training neural network model with the highest accuracy is used as the trained neural network model.

[0182] Since the general evaluation dataset and the general training dataset have the same data distribution, the accuracy of the trained neural network model on the general evaluation dataset can represent the accuracy of the trained neural network model on the general training dataset. Both the general training dataset and the target domain dataset are used to train the first initial neural network model, i.e., for these multiple iterations. The accuracy of the trained neural network model obtained in each iteration on both the general training dataset and the target domain dataset shows a basically similar trend with the number of iterations.

[0183] Therefore, through steps S810 to S850, during the training of the neural network model through multiple iterations, the training data includes not only the target domain data set but also a general training data set. By utilizing a general evaluation data set with the same data distribution as the general training data set, the trend of the accuracy of the trained neural network model obtained in each iteration on the general evaluation data set with the number of iterations is determined. Thus, the trained neural network model with the highest accuracy on the general evaluation data set is used as the trained neural network model, which can improve the accuracy of the trained neural network model.

[0184] In other words, during the parameter adjustment of the neural network model, a general training dataset is added to the training dataset. A general evaluation dataset with the same data distribution as the general training dataset is then used to calculate the accuracy of the trained neural network model on the general evaluation dataset for each iteration. Because the accuracy of the trained neural network model on the general training dataset and the target domain dataset changes with the number of iterations in a basically the same way, the trained neural network model with the highest accuracy on the general evaluation dataset will also have the highest accuracy on the target domain dataset; this model is the trained neural network model.

[0185] Method 800 can be understood as a UDA algorithm that, by labeling only a general test dataset, can train neural network models on different target domain datasets while ensuring high accuracy. This significantly reduces labor costs and improves the efficiency of transfer learning, i.e., the generalization efficiency of neural network models.

[0186] Method 800 has high versatility across different scenarios. Neural network models required for various scenarios such as detection and recognition can be trained using Method 800.

[0187] To reduce the number of iterations, a stopping condition can be set for the iteration. That is, iteration can stop when a preset condition is met. The preset condition includes at least one of the following: as the number of iterations increases, the accuracy of the multiple trained neural network models obtained from the last preset number of iterations on the general evaluation dataset shows a decreasing trend; the number of iterations reaches a preset value.

[0188] After each iteration, the trained neural network model obtained in that iteration can be used to process the data in the general evaluation dataset to obtain the accuracy of the trained neural network model on that dataset. If preset conditions are met, the iteration can be stopped, i.e., further training of the neural network model can be halted, which can further reduce the number of iterations and the computational load.

[0189] The decreasing accuracy with the number of iterations can mean that the accuracy of the trained neural network model decreases continuously as the number of iterations increases. Alternatively, it can mean that the slope of the line connecting the highest or lowest points in the curve showing the change in accuracy of the trained neural network model with the number of iterations is negative.

[0190] Method 800 can implement UDA based on clustering pseudo-labeling, style transfer (also known as domain transformation), or feature learning.

[0191] Method 800 can utilize a clustering-based pseudo-labeling method. During the training of the first initial neural network model to obtain the trained neural network model, multiple iterations can be performed. Each iteration may include: extracting features from each data point in the training set using the first initial neural network model to obtain features for each data point; processing each feature using a clustering algorithm to determine the category of each data point in the training set; and adjusting the parameters of the first initial neural network model based on the category of each data point in the training set to obtain an adjusted first neural network model. The adjusted first neural network model can then be used as the first initial neural network model for the next iteration. The category of each data point obtained using the clustering algorithm can also be called the pseudo-label of that data. For details, please refer to... Figure 9 and Figure 10 Explanation.

[0192] In other words, the first initial neural network model includes a feature extraction model and a classifier. The feature extraction model is used to extract features from the input data of the first initial application network model, and the classifier is used to determine the category of the input data based on the features extracted by the feature extraction model.

[0193] It should be understood that when adjusting the parameters of the first initial neural network model according to the category of each data point in the training set, the parameters of the feature extraction model and the classifier can be adjusted, or only the parameters of the classifier can be adjusted; this embodiment of the application does not limit this. For example, the parameters of the classifier and the parameters of the last preset number of layers in the feature extraction model can be adjusted.

[0194] Method 800 can utilize a style transfer-based approach. The training process can be iterated multiple times, with each iteration adjusting the parameters of the initial neural network model. Each iteration may include: extracting features from each data point in the training dataset and the source domain dataset using the initial neural network model; processing the source domain dataset based on the mean and standard deviation of the features in the training dataset and the source domain dataset, thereby converting the style of the data in the source domain dataset to the style of the data in the target domain dataset, i.e., achieving style transfer; and adjusting the parameters of the initial neural network model using each data point in the style-transferred source domain dataset and its corresponding label. The adjusted initial neural network model can then be used as the initial neural network model for the next iteration.

[0195] The source domain dataset after style transfer retains the original meaning of the source domain images and exhibits the data distribution pattern of the target domain data. This data distribution pattern can also be understood as style. Specifically, the difference between the features of the source domain data and the mean of the source domain features, divided by the standard deviation of the source domain, multiplied by the standard deviation of the target domain, and then added to the mean of the target domain, achieves style transfer of the source domain data.

[0196] Method 800 utilizes feature-based learning, iterating multiple times during the training process to obtain the trained neural network model. Each iteration adjusts the parameters of the initial neural network model. Each iteration may include: extracting features from each data point in the training dataset and the source domain dataset using the initial neural network model; mapping the features of each data point in the training dataset and the source domain dataset to a Hilbert space; and minimizing the loss value by adjusting the parameters of the initial neural network model. The loss value represents the average distance between the features of the source domain data and the target domain data in the Hilbert space. The feature-based UDA algorithm reduces the average distance between the features of the training dataset and the source domain dataset in the Hilbert space, thereby making the distributions of the features of the training dataset and the source domain dataset more similar, reducing the difference in feature representation between the source domain dataset and the training dataset, and achieving transfer learning.

[0197] In some embodiments, a second initial neural network model can be obtained. The first and second initial neural network models are iterated multiple times using a mutual mean-teaching (MMT) algorithm. The parameters of the first and second initial neural network models are different.

[0198] In cluster-based pseudo-label UDA algorithms, noise exists in the pseudo-labels generated by clustering. In style transfer-based UDA algorithms, noise is introduced during the style transfer process. In feature-learning-based UDA algorithms, noise is introduced during the feature learning process.

[0199] Using the MMT algorithm to implement UDA allows for mutual supervision of the processing results from different neural network models, thereby reducing the impact of noisy training and improving the accuracy of the trained neural network model. For details, please refer to... Figure 15 Explanation.

[0200] Figure 9 This is a schematic flowchart of a neural network model training method provided in an embodiment of this application.

[0201] The neural network model training method 900 includes steps S901 to S908. The neural network model training method 900 can be executed by the training device 120.

[0202] In S901, obtain the neural network model Ms.

[0203] The neural network model Ms is trained using data from the source domain dataset and the corresponding annotation information for each data point.

[0204] Specifically, data from the source domain dataset can be input into an initial neural network model. This model processes the source domain data to obtain training output information corresponding to the data in the source domain dataset. Based on the labeled information and training output information corresponding to the data in the source domain dataset, the parameters of the initial neural network model are adjusted to minimize the loss values ​​of the training output information and the labeled information. The adjusted initial neural network model values ​​are then used to continue processing the data in the source domain dataset until the loss values ​​gradually converge, resulting in the trained neural network model Ms. The loss values ​​of the training output information and the labeled information are used to represent the difference between the training output information and the labeled information.

[0205] In S902, the neural network model Ms is used to extract features from the data in the target domain dataset and the data in the general training dataset.

[0206] The data in the target domain dataset and the data in the general training dataset can be unlabeled, meaning the labels of the data in the target domain dataset and the data in the general training dataset are unknown.

[0207] A neural network model Ms can include a feature extraction module. This module can be used to extract features from both the target domain dataset and the general training dataset.

[0208] Neural network models Ms can also include modules such as classifiers.

[0209] In S903, a clustering algorithm is used to cluster the features of each data point in the target domain dataset and the general training dataset to obtain pseudo-labels for each data point in the target domain dataset and the general training dataset.

[0210] Clustering algorithms such as the k-nearest neighbor graph (kNN Graph) can be used to cluster the features of each data point in the target domain dataset and the general training dataset. The k-nearest neighbor graph algorithm classifies data using the formula for calculating the absolute distance between multidimensional data. Data that are close in distance can be grouped into one category, and appropriate clusters are selected according to the clustering principle to complete the clustering process.

[0211] In S904, the neural network model Ms is trained using the data in the target domain dataset and the general training dataset, as well as the pseudo-labels corresponding to each data point, to obtain the neural network model Mt.

[0212] Training the neural network model Ms involves adjusting its parameters to minimize the difference between the processing results of the neural network model Ms on the target domain dataset and the general training dataset and the pseudo-labels of each data point.

[0213] Specifically, a data point from either the target domain dataset or the general training dataset can be input into the neural network model Ms. The neural network model Ms processes the input data to obtain the corresponding training output information. Based on the pseudo-label and training output information, the parameters of the initial neural network model are adjusted to minimize the loss value of the training output information and the pseudo-label. The adjusted neural network model values ​​Ms are then used to process data from both the target domain dataset and the general training dataset until the resulting loss value gradually converges, thus obtaining the neural network model Mt. The loss value of the training output information and the pseudo-label is used to represent the difference between the training output information and the pseudo-label.

[0214] S902 to S904 represent one iteration of the UDA algorithm. In different iteration numbers, the data in the target domain dataset and the data in the general training dataset can be the same or different. The data in the target domain dataset and the general training dataset corresponding to different iteration numbers are identically distributed.

[0215] In S905, the accuracy of the neural network model Mt on a general evaluation dataset is determined.

[0216] The data in the general evaluation dataset are distributed in the same way as the data in the general training dataset. All data in the general evaluation dataset are labeled, meaning the labels of all data in the general evaluation dataset are known.

[0217] The neural network model Mt can be used to process each data point in the general evaluation dataset to obtain the training labels for each data point. Based on the training labels and the differences between the labels for each data point in the general evaluation dataset, the accuracy of the neural network model Mt on the general evaluation dataset can be determined.

[0218] In some embodiments, the accuracy of the neural network model Mt on a general evaluation dataset can be represented by the mAP of the neural network model Mt on the general evaluation dataset.

[0219] In S906, determine whether the neural network model Mt obtained in this iteration has the highest accuracy on the general evaluation dataset among the neural network models Mt obtained in multiple iterations.

[0220] If the neural network model Mt obtained in this iteration has the highest accuracy, then record the neural network model Mt obtained in this iteration as the best model and save the best model.

[0221] Saving the best model can also be understood as updating the best model.

[0222] If the accuracy of the neural network model Mt obtained in this iteration is not the highest, proceed with S907.

[0223] In S907, it is determined whether the accuracy of the neural network model Mt on the general evaluation dataset decreases as the number of iterations increases, given the neural network model Mt with the highest preset number of iterations.

[0224] The neural network model Mt with the highest preset number of iterations, that is, the neural network model Mt obtained by performing the preset number of iterations at the end.

[0225] If the accuracy of the neural network model Mt does not show a decreasing trend, return to steps S902 to S907.

[0226] If the accuracy of the neural network model Mt shows a downward trend, perform S908.

[0227] In S908, the optimal model is output.

[0228] Or, such as Figure 10 As shown, the neural network model training method 900 may further include step S1001.

[0229] In S1001, determine whether the number of iterations exceeds the preset value.

[0230] If the number of iterations does not exceed the preset value, proceed to S902 to S906; if the number of iterations exceeds the preset value, proceed to S908.

[0231] Method 900 may also include step S1001, in which case S907 may or may not be performed. For example, S908 may be performed when at least one of the following conditions is met: (1) whether the number of iterations exceeds a preset value; (2) in the neural network model Mt with the highest preset number of iterations, the accuracy of the neural network model Mt on the general evaluation dataset decreases as the number of iterations increases.

[0232] The neural network models obtained using neural network model training method 600 and neural network model training method 900 were validated, and the validation results are shown in the following figures. Figure 11 and Figure 12 As shown.

[0233] For the neural network model Ms used to implement the Person ReID function, trained using the source domain dataset, the domain dataset can be a self-built dataset from the laboratory.

[0234] For training the neural network model using Method 900, the source general evaluation dataset and the general training dataset can be data from the DukeMTMC dataset. The target domain dataset can be data from the MSMT17 dataset. The data distributions in the source domain dataset, the target domain dataset, and the general evaluation dataset are different.

[0235] The DukeMTMC dataset is a large-scale labeled multi-tracking multi-camera (MTMC) pedestrian tracking dataset. The data in DukeMTMC consists of images, with each image labeled with the identification (ID) of the pedestrian in that image. The MSMT17 dataset includes labeled multi-scene multi-time (MSMT) data. The data in MSMT17 consists of images, with each image labeled with the identification of the pedestrian in that image.

[0236] The neural network model Ms can use ResNet50. ResNet50 is a residual network model. A residual network can be considered a special type of deep neural network; specifically, it can be understood as a special connection method between multiple hidden layers in a deep neural network. In addition to the layer-by-layer connections (e.g., the first hidden layer connects to the second, the second to the third, and the third to the fourth – this is a data processing path in the neural network, also figuratively called neural network transmission), a residual network has an additional direct connection branch. This direct connection branch directly connects the first hidden layer to the fourth hidden layer, skipping the processing of the second and third hidden layers and directly transmitting the data from the first hidden layer to the fourth hidden layer for computation. The highway network can be: In addition to the computational pathways and direct branches mentioned above, the deep neural network also includes a weight acquisition branch. This branch introduces a transformation gate to acquire weight values ​​and outputs weight values ​​T for subsequent computations of the computational pathways and direct branches mentioned above.

[0237] The clustering method used is the kNN Graph algorithm. mAP represents the accuracy of the neural network model.

[0238] For neural network model training method 600, UDA is implemented using the MSMT17 dataset as the target domain dataset to determine the accuracy of the trained neural network model on the DukeMTMC dataset and the MSMT17 dataset, respectively.

[0239] like Figure 11 and Figure 12 As shown, the horizontal axis represents the number of iterations, and the vertical axis represents the mAP (dashed line) of the neural network model obtained after different number of iterations on the DukeMTMC dataset and the MSMT17 dataset (solid line).

[0240] exist Figure 11 In this study, the mAP of the neural network model on the DukeMTMC dataset and the MSMT17 dataset showed inconsistent trends with the number of iterations. In other words, even with labeled datasets in the target domain, the neural network model training method 600 cannot accurately determine the neural network model with the highest accuracy using other labeled datasets.

[0241] exist Figure 12 In the study, the mAP of the neural network model on the DukeMTMC dataset and the MSMT17 dataset showed consistent trends with the number of iterations. In other words, when using neural network model training method 900, and implementing UDA using a general training dataset and a target domain dataset, the trend of the neural network model's accuracy on the general evaluation dataset (which is distributed similarly to the general training dataset) with the number of iterations can represent the trend of the neural network model's accuracy on the target domain dataset. The neural network model with the highest accuracy on the general evaluation dataset at the highest iteration count is then considered the highest-accurate neural network model on the target domain dataset.

[0242] The neural network model obtained by the neural network model training method 900 can be validated in different scenarios where at least one of the general evaluation dataset, the source domain dataset, and the target domain dataset changes.

[0243] The general training dataset and the general evaluation dataset still use the data from the DukeMTMC dataset. The self-built datasets HY1W and DYBH40W are used as the target domain datasets, respectively. Through multiple iterations in steps S902 to S904 of method 900, the accuracy of the neural network model corresponding to different iteration numbers on the general evaluation dataset and the target domain dataset are as follows: Figure 13 and Figure 14 As shown ( Figure 13 It was obtained using a self-built dataset HY1W as the target domain dataset. Figure 14 (This dataset was obtained using a self-built dataset, DYBH40W, as the target domain dataset.) The general evaluation dataset contains 1944 pedestrian identifiers and 25012 images. The DYBH40W dataset is 68 times larger than the DukeMTMC dataset. The HY1W dataset contains 10000 pedestrian identifiers and 144565 images.

[0244] exist Figure 13 and Figure 14 In the study, the accuracy of the neural network model on the general evaluation dataset and the accuracy on the target domain dataset showed the same trend with the number of iterations.

[0245] A relatively small set of general training data and a relatively small set of general evaluation data can achieve a consistent trend in the accuracy of neural network models with the number of iterations when the target domain dataset is 100 times larger than the general training data.

[0246] When the general evaluation dataset and the general training dataset share the same source, they have the same data distribution. Therefore, given this shared source, there is no need to classify the data in the general training dataset; the neural network model training method provided in this application can be used to train the neural network model, thus reducing costs.

[0247] If the target domain dataset is too large, the amount of data in the general training dataset can be appropriately increased. Since the data in the general training dataset does not require manual annotation, increasing the amount of data in the general training dataset will not lead to a significant increase in cost.

[0248] A universal evaluation dataset can be used to train different neural network models, enabling one-time annotation for multiple uses. This significantly reduces the cost of manual annotation while obtaining the most accurate neural network model.

[0249] Figure 15 This is a schematic flowchart of a neural network model training method provided in an embodiment of this application.

[0250] Method 1500 includes steps S901 to S908, and includes step S1501. Method 1500 implements UDA using the MMT algorithm.

[0251] In S901, obtain neural network models Ms-1 and Ms-2.

[0252] Neural network models Ms-1 and Ms-2 can be trained using data from the source domain dataset and the corresponding annotation information for each data point. Neural network models Ms-1 and Ms-2 can have the same neural network structure.

[0253] In S902, neural network models Ms-1 and Ms-2 are used to extract features from the data in the target domain dataset and the data in the general training dataset, respectively.

[0254] Feature 1 for each data point is obtained using neural network model Ms-1, and feature 2 for each data point is obtained using neural network model Ms-2.

[0255] Then, multiple iterations are performed. Each iteration includes execution of S902-S904.

[0256] After S902, S1501 can be performed.

[0257] In S1501, the average value of feature 1 and feature 2 for each data point is taken to obtain the feature mean.

[0258] In S903, a clustering algorithm is used to cluster the features of each data point in the target domain dataset and the general training dataset to obtain pseudo-labels for each data point in the target domain dataset and the general training dataset.

[0259] In S904, the parameters of neural network models Ms-1 and Ms-2 are adjusted using data from the target domain dataset and the general training dataset, as well as the pseudo-labels corresponding to each data point.

[0260] The neural network model Ms-1 is obtained by adjusting the parameters to obtain the neural network model Mt-1, and the neural network model Ms-2 is obtained by adjusting the parameters to obtain the neural network model Mt-2.

[0261] In S905, the accuracy of neural network models Mt-1 and Mt-2 on the general evaluation dataset is determined, and the neural network model with higher accuracy is the neural network model Mt obtained in this iteration.

[0262] In S906, determine whether the neural network model Mt obtained in this iteration has the highest accuracy on the general evaluation dataset among the neural network models Mt obtained in multiple iterations.

[0263] Other steps in Method 1500 can be found in [reference needed]. Figure 9 Explanation.

[0264] It should be understood that S907 can be omitted after S906. The iteration can be stopped if the number of iterations exceeds a preset value, as shown in S1001 of method 1000.

[0265] The clustering method used is the kNN Graph algorithm. mAP represents the accuracy of the neural network model.

[0266] For neural network model training method 1500,

[0267] The general evaluation dataset uses data from the DukeMTMC dataset, the self-built dataset HY1W is used as the source domain dataset, and the target domain dataset uses data from the MSMT17 dataset. The self-built dataset HY1W has a different data distribution than the DukeMTMC and MSMT17 datasets.

[0268] The initial neural network model Ms uses a ResNet 50 architecture and employs method 600. The accuracy curves of the neural network model obtained in each iteration on the general evaluation dataset and the target domain dataset as a function of the number of iterations are shown below. Figure 16 As shown.

[0269] The general training and evaluation datasets use data from the DukeMTMC dataset, with a self-built dataset HY1W as the source domain dataset and data from the MSMT17 dataset as the target domain dataset. The self-built dataset HY1W has a different data distribution than the DukeMTMC and MSMT17 datasets.

[0270] The initial neural network models Ms-1 and Ms-2 both use the ResNet 50 architecture and employ method 1500. The accuracy curves of the trained neural network model Mt obtained in each iteration on the general evaluation dataset and the target domain dataset as a function of the number of iterations are shown below. Figure 17 As shown.

[0271] exist Figure 16 In this study, the accuracy of neural network models on the general evaluation dataset and the target domain dataset showed inconsistent trends with the number of iterations. Figure 17 The accuracy of the neural network model on both the general evaluation dataset and the target domain dataset shows a consistent trend with the number of iterations.

[0272] The neural network model training method provided in this application includes, during multiple iterations of training, a target domain dataset and a general training dataset. A general evaluation dataset with the same data distribution as the general training dataset is used to determine the accuracy trend of the trained neural network model on the general evaluation dataset with the number of iterations. This allows the trained neural network model with the highest accuracy on the general evaluation dataset to be used as the trained neural network model, thus avoiding overfitting and improving the accuracy of the trained neural network model.

[0273] Figure 18 This is a schematic flowchart of a data processing method provided in an embodiment of this application.

[0274] The data processing method 1800 includes steps S1810 to S1820. The execution device 110 can be used to execute the data processing method 1800.

[0275] In S1810, obtain the neural network model.

[0276] The neural network model described is the one with the highest accuracy among multiple trained neural network models on a general evaluation dataset. These multiple trained neural network models are obtained by iterating the first initial neural network model multiple times based on the training dataset. The accuracy of the trained neural network model obtained in each iteration on the general evaluation dataset is determined based on the difference between the labeled information and the inference information of the data in the general evaluation dataset. The inference information is obtained by processing the data in the general evaluation dataset using the trained neural network model. The first initial neural network model is pre-trained. The training dataset includes a general training dataset and a target domain dataset, and the general evaluation dataset and the general training dataset have the same data distribution.

[0277] In other words, the neural network model can be obtained using method 800, method 900, method 1000, or method 1500. The neural network model can be the target model / rule 101.

[0278] Specifically, the training may be stopped when preset conditions are met, and the preset conditions include at least one of the following: as the number of iterations increases, the accuracy of the multiple trained neural network models obtained by the last preset number of iterations on the general evaluation dataset shows a decreasing trend; the number of iterations reaches a preset value.

[0279] Optionally, the training neural network model obtained in each iteration is obtained by adjusting the parameters of the initial model according to the category of each data in the training set. The initial model is the first initial neural network model or the training neural network model obtained in the previous iteration. The category of each data in the training set is obtained by processing the features of each data in the training set using a clustering algorithm. The features of each data in the training set are obtained by extracting features from each data in the training set using the initial model.

[0280] Optionally, the plurality of trained neural network models are obtained by iterating the first initial neural network model and the second initial neural network model multiple times using mutual mean teaching MMT.

[0281] Optionally, the general evaluation data set and the general training data set may be from the same source.

[0282] In S1820, the neural network model is used to process the data in the target domain dataset.

[0283] The above text combined Figures 1 to 18 The present application describes the neural network model training method and data processing method provided in the embodiments. The following is a combination of... Figures 19 to 22 This section describes the apparatus embodiments of the present application. It should be understood that the descriptions of the neural network model training method and the data processing method correspond to the descriptions of the apparatus embodiments; therefore, any parts not described in detail can be referred to the above description.

[0284] Figure 19 This is a schematic structural diagram of a data processing device provided in an embodiment of this application.

[0285] The data processing device 2000 includes an acquisition module 2010 and a processing module 2020.

[0286] The Acquisition Module 2010 is used to acquire neural network models.

[0287] The neural network model described is the one with the highest accuracy among multiple trained neural network models on a general evaluation dataset. These multiple trained neural network models are obtained by iterating the first initial neural network model multiple times based on the training dataset. The accuracy of the trained neural network model obtained in each iteration on the general evaluation dataset is determined based on the difference between the labeled information and the inference information of the data in the general evaluation dataset. The inference information is obtained by processing the data in the general evaluation dataset using the trained neural network model. The first initial neural network model is pre-trained. The training dataset includes a general training dataset and a target domain dataset, and the general evaluation dataset and the general training dataset have the same data distribution.

[0288] The processing module 2020 is used to process the data in the target domain dataset using the neural network model.

[0289] Optionally, the multiple iterations stop when a preset condition is met, and the preset condition includes at least one of the following: as the number of iterations increases, the accuracy of the multiple trained neural network models obtained from the last preset number of iterations on the general evaluation dataset shows a decreasing trend; the number of iterations reaches a preset value.

[0290] Optionally, the training neural network model obtained in each iteration is obtained by adjusting the parameters of the initial model according to the category of each data in the training set. The initial model is the first initial neural network model or the training neural network model obtained in the previous iteration. The category of each data in the training set is obtained by processing the features of each data in the training set using a clustering algorithm. The features of each data in the training set are obtained by extracting features from each data in the training set using the initial model.

[0291] Optionally, the plurality of trained neural network models are obtained by iterating the first initial neural network model and the second initial neural network model multiple times using mutual mean teaching MMT.

[0292] Optionally, the general evaluation dataset and the general training dataset share the same source.

[0293] Figure 20 This is a schematic structural diagram of a neural network training device provided in an embodiment of this application.

[0294] The neural network training device 3000 includes an acquisition module 3010 and a processing module 3020.

[0295] The acquisition module 3010 is used to acquire a first initial neural network model, which is obtained through pre-training.

[0296] The processing module 3020 is used to perform multiple iterations on the first initial neural network model based on the training data set to obtain multiple training neural network models, wherein the training data set includes a general training data set and a target domain data set.

[0297] The processing module 3020 is further configured to process the data in the general evaluation data set using the training neural network model obtained in each iteration, so as to obtain inference information, wherein the general evaluation data set and the general training data set have the same data distribution.

[0298] The processing module 3020 is further configured to determine the accuracy of the trained neural network model obtained in each iteration in the general evaluation data set based on the difference between the annotation information of the data in the general evaluation data set and the inference information.

[0299] The processing module 3020 is also used to use the training neural network model with the highest accuracy as the trained neural network model.

[0300] Optionally, the processing module 3020 is further configured to: stop the multiple iterations when a preset condition is met, wherein the preset condition includes at least one of the following: as the number of iterations increases, the accuracy of the multiple trained neural network models obtained by the last preset number of iterations in the general evaluation dataset shows a decreasing trend; the number of iterations reaches a preset value.

[0301] Optionally, during one iteration, the processing module 3020 is used to extract features from each data in the training dataset using an initial model to obtain features for each data in the training dataset, wherein the initial model is the first initial neural network model or the training neural network model obtained in the previous iteration.

[0302] During one iteration, the processing module 3020 is further configured to process each feature using a clustering algorithm to determine the category of each data in the training set.

[0303] During one iteration, the processing module 3020 is further configured to adjust the parameters of the initial model according to the category of each data in the training set to obtain the trained neural network model.

[0304] Optionally, the acquisition module 3010 is further configured to acquire a second initial neural network model, wherein the second initial neural network model is pre-trained.

[0305] The processing module 3020 is further configured to perform multiple iterations on the first initial neural network model to obtain multiple training neural network models based on the training data set, including: performing the multiple iterations on the first initial neural network model and the second initial neural network model using the mutual mean teaching (MMT) algorithm.

[0306] Optionally, the general evaluation dataset and the general training dataset share the same source.

[0307] Figure 21 This is a schematic diagram of the hardware structure of the data processing device according to an embodiment of this application. Figure 21 The data processing device 4000 shown includes a memory 4001, a processor 4002, a communication interface 4003, and a bus 4004. The memory 4001, processor 4002, and communication interface 4003 are interconnected via the bus 4004.

[0308] The memory 4001 can be a ROM, a static storage device, or RAM. The memory 4001 can store a program, and when the program stored in the memory 4001 is executed by the processor 4002, the processor 4002 and the communication interface 4003 are used to execute the various steps of the data processing method of the embodiments of this application.

[0309] The processor 4002 may be a general-purpose CPU, microprocessor, ASIC, GPU, or one or more integrated circuits, used to execute relevant programs to achieve the functions required by the units in the data processing apparatus of this application embodiment, or to execute the data processing method of this application method embodiment.

[0310] The processor 4002 can also be an integrated circuit chip with signal processing capabilities; for example, it could be... Figure 4 The chip shown. In implementation, each step of the data processing method in this embodiment can be completed by the integrated logic circuitry in the processor 4002 or by software instructions.

[0311] The processor 4002 described above can also be a general-purpose processor, DSP, ASIC, 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 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 4001. The processor 4002 reads the information in memory 4001 and, in conjunction with its hardware, completes the functions required by the units included in the data processing apparatus of the embodiments of this application, or executes the data processing method of the method embodiments of this application.

[0312] The communication interface 4003 uses a transceiver device, such as, but not limited to, a transceiver, to enable communication between the device 4000 and other devices or communication networks. For example, an image to be processed can be acquired through the communication interface 4003.

[0313] Bus 4004 may include a pathway for transmitting information between various components of device 4000 (e.g., memory 4001, processor 4002, communication interface 4003).

[0314] Specifically, memory 4001 is used to store a program. When the program is executed in processor 4002, processor 4002 is used for:

[0315] A neural network model is obtained, wherein the neural network model is the one with the highest accuracy on a general evaluation dataset among multiple trained neural network models. The multiple trained neural network models are obtained by iterating a first initial neural network model multiple times based on the training dataset. The accuracy of the trained neural network model obtained in each iteration on the general evaluation dataset is determined based on the difference between the annotation information and inference information of the data in the general evaluation dataset. The inference information is obtained by processing the data in the general evaluation dataset using the trained neural network model. The first initial neural network model is pre-trained. The training dataset includes a general training dataset and a target domain dataset. The general evaluation dataset and the general training dataset have the same data distribution.

[0316] The neural network model is used to process the data in the target domain dataset.

[0317] Optionally, the multiple iterations stop when a preset condition is met, and the preset condition includes at least one of the following: as the number of iterations increases, the accuracy of the multiple trained neural network models obtained from the last preset number of iterations on the general evaluation dataset shows a decreasing trend; the number of iterations reaches a preset value.

[0318] Optionally, the training neural network model obtained in each iteration is obtained by adjusting the parameters of the initial model according to the category of each data in the training set. The initial model is the first initial neural network model or the training neural network model obtained in the previous iteration. The category of each data in the training set is obtained by processing the features of each data in the training set using a clustering algorithm. The features of each data in the training set are obtained by extracting features from each data in the training set using the initial model.

[0319] Optionally, the plurality of trained neural network models are obtained by iterating the first initial neural network model and the second initial neural network model multiple times using mutual mean teaching MMT.

[0320] Optionally, the general evaluation dataset and the general training dataset share the same source.

[0321] Figure 22 This is a schematic diagram of the hardware structure of a neural network training device according to an embodiment of this application. Similar to the device 4000 described above, Figure 22The neural network training device 5000 shown includes a memory 5001, a processor 5002, a communication interface 5003, and a bus 5004. The memory 5001, processor 5002, and communication interface 5003 are interconnected via the bus 5004.

[0322] It can be done Figure 22 The neural network training device 5000 shown trains the neural network, and the trained neural network can then be used to execute the data processing method of the embodiments of this application.

[0323] Specifically, Figure 22 The device shown can acquire training data and the neural network to be trained from the outside through the communication interface 5003, and then the processor trains the neural network to be trained according to the training data.

[0324] Specifically, memory 5001 is used to store the program. When the program is executed in processor 5002, processor 5002 is used for:

[0325] Obtain a first initial neural network model, which is pre-trained;

[0326] Based on the training data set, the first initial neural network model is iterated multiple times to obtain multiple trained neural network models, wherein the training data set includes a general training data set and a target domain data set;

[0327] The trained neural network model obtained in each iteration is used to process the data in the general evaluation dataset to obtain inference information. The general evaluation dataset and the general training dataset have the same data distribution.

[0328] Based on the difference between the annotation information and the inference information in the general evaluation dataset, the accuracy of the trained neural network model obtained in each iteration in the general evaluation dataset is determined.

[0329] The training neural network model with the highest accuracy is used as the trained neural network model.

[0330] Optionally, the processor 5002 is further configured to stop the multiple iterations when a preset condition is met, the preset condition including at least one of the following: as the number of iterations increases, the accuracy of the multiple trained neural network models obtained by the last preset number of iterations in the general evaluation dataset shows a decreasing trend; the number of iterations reaches a preset value.

[0331] Optionally, during one iteration, the processor 5002 is further configured to extract features from each data in the training dataset using an initial model to obtain features for each data in the training dataset, wherein the initial model is the first initial neural network model or the training neural network model obtained in the previous iteration.

[0332] During one iteration, the processor 5002 is also used to process each feature using a clustering algorithm to determine the category of each data in the training set.

[0333] During one iteration, the processor 5002 is also configured to adjust the parameters of the initial model according to the category of each data in the training set to obtain the trained neural network model.

[0334] Optionally, the processor 5002 is further configured to obtain a second initial neural network model, which is pre-trained.

[0335] The processor 5002 is also used to perform the multiple iterations on the first initial neural network model and the second initial neural network model using the mutual mean teaching MMT algorithm.

[0336] Optionally, the general evaluation dataset and the general training dataset share the same source.

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

[0338] 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.

[0339] 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).

[0340] 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. The 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.

[0341] 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.

[0342] 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.

[0343] 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.

[0344] 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.

[0345] 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.

[0346] 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.

[0347] 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.

[0348] 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.

[0349] 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.

[0350] 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 for training a neural network model, characterized in that, include: Obtain a first initial neural network model, which is pre-trained; Based on the training data set, the first initial neural network model is iterated multiple times to obtain multiple training neural network models. The training data set includes a general training data set and a target domain data set. The general training data set is a pedestrian tracking dataset. The data in the pedestrian tracking dataset is images. The data in the target domain data set is images. The labels corresponding to the images in the pedestrian tracking dataset and the target domain data set are the identifiers of each pedestrian in the images. The trained neural network model obtained in each iteration is used to process the data in the general evaluation dataset to obtain inference information. The general evaluation dataset and the general training dataset have the same data distribution. Based on the difference between the annotation information and the inference information in the general evaluation dataset, the accuracy of the trained neural network model obtained in each iteration in the general evaluation dataset is determined. The training neural network model with the highest accuracy is used as the trained neural network model.

2. The method according to claim 1, characterized in that, The method further includes: The multiple iterations are stopped when a preset condition is met, and the preset condition includes at least one of the following: As the number of iterations increases, the accuracy of the multiple trained neural network models obtained from the final preset number of iterations on the general evaluation dataset shows a decreasing trend. The number of iterations has reached the preset value.

3. The method according to claim 1, characterized in that, Performing one iteration includes: The initial model is used to extract features from each data point in the training dataset to obtain the features of each data point in the training dataset. The initial model is either the first initial neural network model or the training neural network model obtained in the previous iteration. Clustering algorithms are used to process each feature in order to determine the category of each data point in the training set; The parameters of the initial model are adjusted according to the category of each data point in the training set to obtain the trained neural network model.

4. The method according to claim 1, characterized in that, The method further includes: obtaining a second initial neural network model, wherein the second initial neural network model is pre-trained; The step of iterating the first initial neural network model multiple times to obtain multiple trained neural network models based on the training data set includes: using the mutual mean teaching (MMT) algorithm to perform the multiple iterations on the first initial neural network model and the second initial neural network model.

5. The method according to any one of claims 1-4, characterized in that, The general evaluation dataset and the general training dataset share the same source.

6. A data processing method, characterized in that, The method includes: A neural network model is obtained, wherein the neural network model is the one with the highest accuracy on a general evaluation dataset among multiple trained neural network models. These multiple trained neural network models are obtained by iterating a first initial neural network model multiple times based on the training dataset. The accuracy of the trained neural network model obtained in each iteration on the general evaluation dataset is determined based on the difference between the labeled information and inference information of the data in the general evaluation dataset. The inference information is obtained by processing the data in the general evaluation dataset using the trained neural network model. The first initial neural network model is pre-trained. The training dataset includes a general training dataset and a target domain dataset. The general evaluation dataset and the general training dataset have the same data distribution. The general training dataset is a pedestrian tracking dataset, and the data in the pedestrian tracking dataset and the target domain dataset are images. The labels corresponding to the images in the pedestrian tracking dataset and the target domain dataset are the identifiers of the pedestrians in the images. The neural network model is used to process the data in the target domain dataset.

7. The method according to claim 6, characterized in that, The multiple iterations stop when a preset condition is met, and the preset condition includes at least one of the following: As the number of iterations increases, the accuracy of the multiple trained neural network models obtained from the final preset number of iterations on the general evaluation dataset shows a decreasing trend. The number of iterations has reached the preset value.

8. The method according to claim 6, characterized in that, The training neural network model obtained in each iteration is obtained by adjusting the parameters of the initial model according to the category of each data in the training set. The initial model is either the first initial neural network model or the training neural network model obtained in the previous iteration. The category of each data in the training set is obtained by processing the features of each data in the training set using a clustering algorithm. The features of each data in the training set are obtained by extracting features from each data in the training set using the initial model.

9. The method according to claim 6, characterized in that, The multiple trained neural network models are obtained by iterating the first initial neural network model and the second initial neural network model multiple times using mutual mean teaching MMT, and the second initial neural network model is obtained through pre-training.

10. The method according to any one of claims 6-9, characterized in that, The general evaluation dataset and the general training dataset share the same source.

11. A training device for a neural network model, characterized in that, include: Acquisition module and processing module; The acquisition module is used to acquire a first initial neural network model, which is pre-trained. The processing module is used to iterate the first initial neural network model multiple times according to the training data set to obtain multiple training neural network models. The training data set includes a general training data set and a target domain data set. The general training data set is a pedestrian tracking dataset. The data in the pedestrian tracking dataset is images. The data in the target domain data set is images. The labels corresponding to the images in the pedestrian tracking dataset and the target domain data set are the identifiers of each pedestrian in the images. The processing module is further configured to process the data in the general evaluation dataset using the training neural network model obtained in each iteration to obtain inference information, wherein the general evaluation dataset and the general training dataset have the same data distribution; The processing module is further configured to determine the accuracy of the trained neural network model obtained in each iteration in the general evaluation data set based on the difference between the annotation information of the data in the general evaluation data set and the inference information. The processing module is further configured to use the training neural network model with the highest accuracy as the trained neural network model.

12. The apparatus according to claim 11, characterized in that, The processing module is further configured to: stop the multiple iterations when a preset condition is met, wherein the preset condition includes at least one of the following: As the number of iterations increases, the accuracy of the multiple trained neural network models obtained from the final preset number of iterations on the general evaluation dataset shows a decreasing trend. The number of iterations has reached the preset value.

13. The apparatus according to claim 11, characterized in that, During one iteration, the processing module is specifically used for: The initial model is used to extract features from each data point in the training dataset to obtain the features of each data point in the training dataset. The initial model is either the first initial neural network model or the training neural network model obtained in the previous iteration. Clustering algorithms are used to process each feature in order to determine the category of each data point in the training set; The parameters of the initial model are adjusted according to the category of each data point in the training set to obtain the trained neural network model.

14. The apparatus according to claim 11, characterized in that, The acquisition module is further configured to acquire a second initial neural network model, wherein the second initial neural network model is pre-trained. The processing module is further configured to perform the multiple iterations on the first initial neural network model and the second initial neural network model using the mutual mean teaching MMT algorithm.

15. The apparatus according to any one of claims 11-14, characterized in that, The general evaluation dataset and the general training dataset share the same source.

16. A data processing apparatus, characterized in that, The device includes: an acquisition module and a processing module. The acquisition module is used to acquire a neural network model, which is the neural network model with the highest accuracy among multiple trained neural network models on a general evaluation dataset. The multiple trained neural network models are obtained by iterating a first initial neural network model multiple times based on the training dataset. The accuracy of the trained neural network model obtained in each iteration on the general evaluation dataset is determined based on the difference between the annotation information and inference information of the data in the general evaluation dataset. The inference information is obtained by processing the data in the general evaluation dataset using the trained neural network model. The first initial neural network model is pre-trained. The training dataset includes a general training dataset and a target domain dataset. The general evaluation dataset and the general training dataset have the same data distribution. The general training dataset is a pedestrian tracking dataset, and the data in the pedestrian tracking dataset and the target domain dataset are images. The labels corresponding to the images in the pedestrian tracking dataset and the target domain dataset are the identifiers of the pedestrians in the images. The processing module is used to process the data in the target domain dataset using the neural network model.

17. The apparatus according to claim 16, characterized in that, The multiple iterations stop when a preset condition is met, and the preset condition includes at least one of the following: As the number of iterations increases, the accuracy of the multiple trained neural network models obtained from the final preset number of iterations on the general evaluation dataset shows a decreasing trend. The number of iterations has reached the preset value.

18. The apparatus according to claim 16, characterized in that, The training neural network model obtained in each iteration is obtained by adjusting the parameters of the initial model according to the category of each data in the training set. The initial model is either the first initial neural network model or the training neural network model obtained in the previous iteration. The category of each data in the training set is obtained by processing the features of each data in the training set using a clustering algorithm. The features of each data in the training set are obtained by extracting features from each data in the training set using the initial model.

19. The apparatus according to claim 16, characterized in that, The multiple trained neural network models are obtained by iterating the first initial neural network model and the second initial neural network model multiple times using mutual mean teaching MMT, and the second initial neural network model is obtained through pre-training.

20. The apparatus according to any one of claims 16-19, characterized in that, The general evaluation dataset and the general training dataset share the same source.

21. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores program code for execution by the device, the program code including methods for performing any one of claims 1 to 10.

22. A chip, characterized in that, The chip includes a processor and a data interface, wherein the processor reads instructions stored in a memory through the data interface to execute the method as described in any one of claims 1 to 10.

23. A computer program product containing instructions, characterized in that, When the instructions are executed by a computer, the computer performs the method as described in any one of claims 1 to 10.

Citation Information

Patent Citations

  • Neural network model training method and device, and computer device

    CN108898218A

  • Method for providing AI model, AI platform, computing device and storage medium

    CN112529026A