Identification model training method and device, equipment and storage medium

Through semi-supervised learning technology, diversified training data is generated in smart cities, and the problem of insufficient recognition accuracy and generalization ability due to limited training data is solved, and efficient identification model training and generalization ability improvement is achieved.

CN119723237APending Publication Date: 2025-03-28CHINA TELECOM ARTIFICIAL INTELLIGENCE TECHNOLOGY (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411688321.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-22
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

In the construction of smart cities, it is difficult for the existing technology to effectively utilize limited and high-cost training data, resulting in insufficient recognition accuracy and generalization capabilities of the recognition model.

Method used

Using semi-supervised learning technology, the second sample data and its label are generated through a small amount of accurately labeled first sample data, and the two are used as training data to train the target recognition model based on diversified training data.

Benefits of technology

Based on the limited first sample data, efficient training of the target recognition model is achieved, the generalization ability of the model is enhanced, the cost and time of training data annotation are reduced, and the recognition accuracy is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119723237A_ABST
    Figure CN119723237A_ABST
Patent Text Reader

Abstract

The invention discloses an identification model training method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining first sample data which is provided with a pre-labeled label; performing semi-supervised learning on the first sample data and the corresponding labels to obtain second sample data and labels corresponding to the second sample data; and taking the first sample data and the corresponding label as well as the second sample data and the corresponding label as training data, and performing iterative adjustment on model parameters of a preset model based on the training data to obtain a target recognition model. Thus, training of the target recognition model can be completed on the basis of limited and small amount of first sample data, efficient learning under small samples is achieved, the generalization ability of the target recognition model can be enhanced through diversification of training data, the target recognition model can keep stable recognition performance under different scenes and conditions, and the recognition efficiency of the target recognition model is improved. The effects of reducing the marking cost and time of the training data and improving the recognition precision of the target recognition model are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of data processing, and specifically relates to a recognition model training method, device, equipment and storage medium. Background Art

[0002] In the construction of modern smart cities, it has become an urgent need to use AI (Artificial Intelligence) technology to identify massive and diverse urban elements. Traditional AI model training methods based on machine learning are highly dependent on a large amount of labeled data, and their performance in segmented vertical fields is often unsatisfactory, making it difficult to meet this demand.

[0003] In the existing technology, the large CV (Computer Vision) model can be fine-tuned using limited pre-labeled training data to obtain a recognition model for smart cities. The recognition model has higher accuracy and better performance in segmented vertical fields.

[0004] However, the CV large model has a strong dependence on high-quality training data. In the smart city scenario, the construction and annotation of training data is costly and difficult to obtain. Moreover, the available training samples are usually limited. These factors will limit the feature learning effect of the CV large model, resulting in insufficient recognition accuracy and generalization ability of the recognition model. Summary of the invention

[0005] The purpose of the embodiments of the present application is to provide a recognition model training method, device, equipment and storage medium, which can solve the problem that the current training data is difficult to obtain and the samples are limited, resulting in insufficient recognition accuracy and generalization ability of the recognition model.

[0006] In a first aspect, an embodiment of the present application provides a recognition model training method, comprising:

[0007] Acquire first sample data, where the first sample data has a pre-labeled label;

[0008] Performing semi-supervised learning on the first sample data and the label corresponding to the first sample data to obtain second sample data and the label corresponding to the second sample data;

[0009] The first sample data and the label corresponding to the first sample data, the second sample data and the label corresponding to the second sample data are used as training data, and based on the training data, the model parameters of the preset model are iteratively adjusted to obtain a target recognition model.

[0010] Optionally, performing semi-supervised learning on the first data and the label corresponding to the first sample data to obtain the second sample data and the label corresponding to the second sample data includes:

[0011] Acquire second sample data;

[0012] Iteratively adjusting model parameters of a prediction model based on the first sample data and a label corresponding to the first sample data to obtain a labeled model;

[0013] The second sample data is input into the annotation model for prediction to determine a label corresponding to the second sample data.

[0014] Optionally, the iteratively adjusting the model parameters of the prediction model based on the first sample data and the label corresponding to the first sample data to obtain the labeled model includes:

[0015] Inputting the first sample data into a prediction model for feature analysis to determine a prediction value of the first sample data;

[0016] Calculating a first loss value between a predicted value of the first sample data and a label of the first sample data, and determining a regularization term of the prediction model;

[0017] When the sum of the first loss value and the regularization term takes a minimum value, the values ​​of the model parameters of the prediction model are determined to obtain a labeled model.

[0018] Optionally, the iterative adjustment of model parameters of a preset model based on the training data to obtain a target recognition model includes:

[0019] Based on the training data, the model parameters of the annotation model are iteratively adjusted to obtain a target recognition model.

[0020] Optionally, performing semi-supervised learning on the first sample data and the label corresponding to the first sample data to obtain the second sample data and the label corresponding to the second sample data includes:

[0021] Based on the first sample data and the label corresponding to the first sample data, training a generation model;

[0022] The generation model is used to generate second sample data, and a label corresponding to the second sample data is determined.

[0023] Optionally, determining a label corresponding to the second sample data includes:

[0024] Perform a cluster analysis on the second sample data to determine a label corresponding to the second sample data.

[0025] Optionally, the iterative adjustment of model parameters of a preset model based on the training data to obtain a target recognition model includes:

[0026] Obtaining model parameters of a pre-trained model, and determining initialization parameters according to the model parameters of the pre-trained model;

[0027] Initializing the model parameters of the preset model based on the initialization parameters;

[0028] Based on the training data, the model parameters of the initialized preset model are iteratively adjusted to obtain a target recognition model.

[0029] Optionally, the preset model is a computer vision model including an attention mechanism and a memory network.

[0030] Optionally, after iteratively adjusting the model parameters of the preset model based on the training data to obtain the target recognition model, the method further includes:

[0031] The target recognition model is pruned and quantized to obtain a compressed model.

[0032] Optionally, after iteratively adjusting the model parameters of the preset model based on the training data to obtain the target recognition model, the method further includes:

[0033] transmitting the target recognition model to a plurality of nodes;

[0034] After receiving the data to be processed, the data to be processed is divided and sent to each node respectively;

[0035] The processing result returned by each node based on the target recognition model is obtained, and the processing results are aggregated to obtain the recognition result of the data to be processed.

[0036] In a second aspect, an embodiment of the present application provides a recognition model training device, the device comprising:

[0037] An acquisition module, used for acquiring first sample data, where the first sample data has a pre-marked label;

[0038] A learning module, used for performing semi-supervised learning on the first sample data and the label corresponding to the first sample data to obtain second sample data and the label corresponding to the second sample data;

[0039] A training module is used to use the first sample data and the label corresponding to the first sample data, the second sample data and the label corresponding to the second sample data as training data, and iteratively adjust the model parameters of the preset model based on the training data to obtain a target recognition model.

[0040] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.

[0041] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0042] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.

[0043] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the first aspect.

[0044] In the present application, first sample data is obtained, and the first sample data has a pre-labeled label; semi-supervised learning is performed on the first sample data and the corresponding label to obtain second sample data and the label corresponding to the second sample data; the first sample data and the corresponding label, the second sample data and the corresponding label are used as training data, and based on the training data, the model parameters of the preset model are iteratively adjusted to obtain a target recognition model.

[0045] As can be seen from the above, this scheme uses semi-supervised learning technology to generate second sample data and its corresponding labels through a small amount of accurately labeled first sample data, and uses the first sample data and its corresponding labels and the second sample data and its corresponding labels as training data, and then obtains a target recognition model based on diversified training data. In this way, not only can the target recognition model be trained on the basis of a limited and small amount of first sample data to achieve efficient learning under small samples, but also the generalization ability of the target recognition model can be enhanced through the diversification of training data, so that it can maintain stable recognition performance in different scenarios and conditions, thereby reducing the cost and time of labeling training data and improving the recognition accuracy of the target recognition model. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 is a flow chart of a recognition model training method according to an exemplary embodiment;

[0047] Figure 2 is a logic schematic diagram of a recognition model training method according to an exemplary embodiment;

[0048] Figure 3 is a training and testing flow chart of a target recognition model according to an exemplary embodiment;

[0049] Figure 4 is a block diagram of a recognition model training device according to an exemplary embodiment;

[0050] Figure 5 is a block diagram of an electronic device according to an exemplary embodiment;

[0051] Figure 6 The figure is a schematic diagram showing the hardware structure of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0052] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0053] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0054] The following is a detailed description of the recognition model training method provided in the embodiment of the present application through specific embodiments and their application scenarios in conjunction with the accompanying drawings.

[0055] Figure 1 It is a flowchart of a recognition model training method according to an exemplary embodiment. The recognition model training method includes the following steps.

[0056] In step S11, first sample data is obtained, where the first sample data has a pre-labeled label.

[0057] In the construction of modern smart cities, it is often necessary to identify massive and diverse urban elements. In related technologies, the large CV model can be fine-tuned using limited pre-labeled training data to obtain a recognition model for smart cities. This recognition model has high accuracy and performs better in segmented vertical fields.

[0058] However, the CV large model has a strong dependence on high-quality training data. In the smart city scenario, the construction and annotation of training data is costly and difficult to obtain. Moreover, the available training samples are usually limited. These factors will limit the feature learning effect of the CV large model, resulting in insufficient recognition accuracy and generalization ability of the recognition model.

[0059] Based on this, the present application proposes a recognition model training method, which can use semi-supervised learning technology to generate diversified training data through a small amount of accurately labeled first sample data to solve the above problems.

[0060] In this step, firstly, first sample data with pre-labeled labels are obtained as the basis for the recognition model training. The first sample data may be image and video data containing various objects collected from an urban environment, and these image and video data have been pre-labeled, and their corresponding labels may indicate the targets contained in the images. For example, the labels of the first sample data may indicate that the images of the first sample data include urban element targets such as people, vehicles or buildings.

[0061] In this application, after collecting images or videos, the collected images or videos can be screened, low-quality or irrelevant data can be removed, and the remaining data can be accurately labeled. The labeled data can be used as the first sample data. Among them, attention should be paid to safety issues during the labeling process, and some specific targets need to be avoided. The labeling rules can be set according to specific application scenarios and regulations, and this application does not limit this.

[0062] Furthermore, after obtaining the first sample data, the first sample data can be preprocessed by rotating, scaling, cropping, flipping, etc., so that one copy of the first sample data can be processed into multiple copies as new first sample data, thereby increasing the diversity of the first sample data, which is conducive to improving the generalization ability of the target recognition model obtained by subsequent training.

[0063] In step S12, semi-supervised learning is performed on the first sample data and the label corresponding to the first sample data to obtain the second sample data and the label corresponding to the second sample data.

[0064] In this step, the first sample data and its corresponding labels are used for semi-supervised learning, and expansion is performed based on a small amount of accurately labeled first sample data to obtain more labeled data, that is, the second sample data and its corresponding labels. The addition of the second sample data can expand the amount of training data, which helps to improve the diversity of training data and the generalization ability of the target recognition model obtained by subsequent training.

[0065] Among them, semi-supervised learning refers to using pre-labeled first sample data to learn the basic structure and characteristics of training data, and then labeling the unlabeled data to obtain diversified training data, which is used to further adjust and optimize the model, thereby utilizing limited first sample data to maximize the performance of the target recognition model.

[0066] In addition, in some cases, the labeling of the first sample data may not be accurate or complete enough. For example, the first sample data may only have coarse-grained labels, some of the first sample data may have labels but other first sample data may not, or the labels themselves may contain certain noise, etc. In this case, a similar method can also be used to use these incomplete labels to try to extract useful features from them, so as to achieve labeling of all the first sample data, and then use them to train the target recognition model.

[0067] In one implementation, semi-supervised learning is performed on the first sample data and the label corresponding to the first sample data to obtain the second sample data and the label corresponding to the second sample data, including:

[0068] Acquire second sample data;

[0069] Iteratively adjusting model parameters of the prediction model based on the first sample data and the label corresponding to the first sample data to obtain a labeled model;

[0070] The second sample data is input into the annotation model for prediction to determine the label corresponding to the second sample data.

[0071] That is to say, semi-supervised learning includes self-supervised learning. If a large amount of unlabeled second sample data can be obtained, then self-supervised learning can be adopted. First, the labeling model is trained based on the first sample data and its corresponding labels, so that the labeling model can learn useful feature representations from the labeled first sample data. Then, the unlabeled second sample data is predicted by using the labeling model to determine the label corresponding to the second sample data, thereby realizing the labeling of the second sample data.

[0072] The prediction model can be any machine learning algorithm such as a neural network, a decision tree, a support vector machine, etc., and this application does not limit this. The first sample data and labels are used to adjust the model parameters of the prediction model in an iterative manner. After multiple iterative trainings, a relatively stable prediction model is obtained, which can be called a labeling model. The labeling model has a certain generalization ability and can predict the second sample data and determine its corresponding label.

[0073] In one implementation, based on the first sample data and the label corresponding to the first sample data, iteratively adjusting the model parameters of the prediction model to obtain the labeled model includes:

[0074] Inputting the first sample data into the prediction model to perform feature analysis and determine the prediction value of the first sample data;

[0075] Calculate a first loss value between a predicted value of the first sample data and a label of the first sample data, and determine a regularization term of the prediction model;

[0076] When the sum of the first loss value and the regularization term takes a minimum value, the values ​​of the model parameters of the prediction model are determined to obtain the labeled model.

[0077] That is, the training process of the prediction model usually involves minimizing the loss function, that is, continuously reducing the gap between the predicted value output by the prediction model and the label of the first sample data through optimization algorithms such as gradient descent. For example, the loss function can be cross entropy loss or mean square error loss.

[0078] Moreover, in the iterative process, in order to prevent the prediction model from overfitting, that is, the trained annotation model performs well on the training data but poorly on the unknown data, a regularization term can be introduced to limit the complexity of the annotation model. The regularization term can be a term that penalizes the size of the model parameters of the annotation model, such as L1 regularization or L2 regularization, or other forms of constraints.

[0079] Therefore, the training of the prediction model can be simplified to a convex optimization problem, that is, minimizing the sum of the loss function and the regularization term. The process can be expressed as the following formula:

[0080]

[0081] y u =f(x u ,θ)

[0082] Among them, y u represents the predicted value of the second sample data, f represents the model function of the prediction model, θ represents the model parameter of the prediction model, L represents the loss function, R represents the regularization term, n represents the number of the first sample data, xi represents the first sample data of the i-th order, y i represents the label of the i-th first sample data, and λ represents the regularization parameter.

[0083] In one implementation, based on the training data, the model parameters of the preset model are iteratively adjusted to obtain the target recognition model, including:

[0084] Based on the training data, the model parameters of the annotation model are iteratively adjusted to obtain the target recognition model.

[0085] It is understandable that in the training process of the annotation model, the prediction model is designed to learn the intrinsic representation of the first sample data. In this process, the prediction model continuously optimizes its own parameters to better complete the prediction task, thereby learning useful features as the annotation model. The features of the first sample data and the second sample data that the annotation model can learn can be used as powerful prior knowledge in subsequent tasks.

[0086] Therefore, the trained annotation model can continue to be used to train the training data. Through continuous optimization, the target recognition model is obtained, so that the performance of the target recognition model is gradually improved, the waste of computing resources is reduced, and the training efficiency of the target recognition model is improved.

[0087] In one implementation, semi-supervised learning is performed on the first sample data and the label corresponding to the first sample data to obtain the second sample data and the label corresponding to the second sample data, including:

[0088] Based on the first sample data and the label corresponding to the first sample data, training a generation model;

[0089] Generate second sample data using the generative model, and determine a label corresponding to the second sample data.

[0090] That is to say, semi-supervised learning includes virtual supervised learning, which usually involves the training of a generative model, and the generative model generates new second sample data by learning the potential representation of the first sample data and the label corresponding to the first sample data.

[0091] Furthermore, labels for the second sample data may be generated, the unlabeled second sample data may be converted into labeled second sample data, and then the generated second sample data and their labels may be used to train the target recognition model.

[0092] The above process can be expressed as:

[0093] p(x,y|G)=p G (x)p(y|x,G)

[0094] Among them, p(x,y|G) represents the probability distribution of the generative model, p G (x) represents the data probability distribution of the generative model, and p(y|x,G) represents the label probability distribution of the generative model.

[0095] In one implementation, determining a label corresponding to the second sample data includes:

[0096] Perform cluster analysis on the second sample data to determine labels corresponding to the second sample data.

[0097] That is to say, if the generation model can only generate the second sample data but cannot directly output the label corresponding to the second sample data, then cluster analysis can be performed on the generated second sample data, and the label of each second sample data can be determined according to the clustering result.

[0098] Among them, clustering algorithms include K-means, hierarchical clustering, DBSCAN (Density-Based Spatial Clustering of Applications with Noise), spectral clustering, etc. Each clustering algorithm has its unique advantages and applicable scenarios. Therefore, it is necessary to select the most appropriate clustering algorithm based on the characteristics of the second sample data and the requirements of the task.

[0099] In step S13, the first sample data and the label corresponding to the first sample data, the second sample data and the label corresponding to the second sample data are used as training data, and based on the training data, the model parameters of the preset model are iteratively adjusted to obtain the target recognition model.

[0100] In this step, the preset model can be fine-tuned using the labeled training data to optimize the model parameters of the preset model, where the preset model can be any type of machine learning algorithm such as a neural network, support vector machine, decision tree, etc. The preset model can be selected based on factors such as the characteristics of the training data, task requirements, and the complexity of the model, and this application does not limit this.

[0101] Based on the prepared training data, you can start iteratively adjusting the model parameters of the preset model. This process is usually achieved through optimization algorithms such as gradient descent. In each iteration, the second loss value of the preset model under the current model parameters is calculated, and the model parameters are updated according to the gradient of the second loss value. Through multiple iterations, the model parameters of the preset model will gradually converge to an optimal solution or a near-optimal solution, and the performance of the preset model on the training data will be optimal.

[0102] When the model parameters of the preset model converge to a stable state, a target recognition model with excellent performance can be obtained. The target recognition model can accurately identify new unknown data and give correct prediction results.

[0103] In one implementation, based on the training data, the model parameters of the preset model are iteratively adjusted to obtain the target recognition model, including:

[0104] Obtain model parameters of the pre-trained model, and determine initialization parameters according to the model parameters of the pre-trained model;

[0105] Initialize the model parameters of the preset model based on the initialization parameters;

[0106] Based on the training data, the model parameters of the initialized preset model are iteratively adjusted to obtain the target recognition model.

[0107] In this embodiment, the model parameters of the preset model can be iteratively adjusted using a transfer learning method. Transfer learning is a method of transferring knowledge learned on one task to another related task, and is usually used to solve the problem of scarce labeled data.

[0108] The mathematical model of transfer learning usually involves two models: a pre-trained model and a preset model. The pre-trained model is trained on a large dataset, and the preset model can use these feature representations to be fine-tuned on a small training data.

[0109] It is understandable that the pre-trained model has been fully trained on a large dataset and has learned rich feature representations and hierarchical structures. These feature representations are often universal and can capture the basic laws and patterns in the data.

[0110] Therefore, when the model parameters of the pre-trained models are used to initialize the model parameters of the preset model, knowledge is actually transferred. The initialized preset model can inherit the knowledge learned by the pre-trained model, significantly accelerate the learning process, reduce training time, and potentially improve the interpretability and robustness of the target recognition model.

[0111] Among them, interpretability refers to the ability of the target recognition model to explain its prediction results in an easy-to-understand way; while robustness refers to the ability of the target recognition model to maintain stable predictions in the face of slight changes or noise in the input data.

[0112] Moreover, for small data sets or complex tasks, training a model from scratch is often prone to overfitting, which refers to the phenomenon that the model performs well on the training data, but the performance degrades on unseen test data. By using a pre-trained model for initialization, the general feature representation learned by the pre-trained model on a large-scale data set can be used to constrain the training process of the new model, thereby reducing the risk of overfitting. In addition, pre-trained models usually have stronger generalization capabilities because they have learned more information about the structure and distribution of the data.

[0113] For example, in transfer learning, the preset model needs to be initialized. Suppose f(x,θ pre ) is a pre-trained model, where x is the input data used to train the pre-trained model, θ pre It is the parameter of the pre-trained model. First, we need to initialize a new preset model f(x m ,θ), where θ is the model parameter of the preset model and can be initialized to θ pre part or all of x m It represents the first sample data or the second sample data, y m Represents x m The corresponding labels can be obtained based on the training data D target ={(x m ,y m )} to optimize θ.

[0114] The optimization goal is usually to minimize the loss function. For example, if the loss function is the cross entropy loss, it can be expressed as:

[0115]

[0116] Where L is the loss function, θ * is the model parameter of the optimized preset model, and k represents the amount of training data.

[0117] In one implementation, the preset model is a computer vision model that includes an attention mechanism and a memory network.

[0118] That is to say, the preset model can adopt a computer vision model, and the feature extraction and representation capabilities of the target recognition model can be enhanced by introducing advanced components such as attention mechanisms and memory networks.

[0119] Among them, computer vision models are an important branch in the field of artificial intelligence. They focus on enabling computers to "see" and understand information in images and videos. Computer vision models are usually trained through deep learning methods to learn and extract useful features from large amounts of training data.

[0120] The attention mechanism is an important concept in deep learning, which allows the model to dynamically focus on different parts of the input when processing input data. This mechanism mimics the way humans allocate attention when processing information, allowing the model to more accurately capture important features in the input data.

[0121] In the design of complex model structures, attention mechanisms usually appear in the form of attention layers. These layers can be embedded in different positions in the neural network to achieve dynamic attention to the input data. For example, in natural language processing tasks, attention mechanisms can help the model identify key words or phrases in a sentence, so as to understand the meaning of the sentence more accurately.

[0122] There are many ways to implement the attention mechanism, including soft attention, hard attention, multi-head attention, etc. These different implementations vary in performance and computational complexity, but they can all effectively improve the recognition accuracy of the model.

[0123] A memory network is a neural network structure that can store and retrieve past information. It usually consists of a memory unit and a controller. The memory unit is used to store past information, while the controller is responsible for retrieving and updating the information in the memory unit according to the current task requirements.

[0124] In the design of complex model structures, memory networks can be used to handle long-term dependencies. For example, in sequence prediction tasks, the model needs to use previous information to predict future outputs. By introducing memory networks, the model can better capture and utilize these long-term dependencies, thereby improving the accuracy of predictions.

[0125] Memory networks can also be combined with other neural network structures to form more complex models. For example, Memory-Augmented Neural Networks (MANNs) are a model that combines memory networks and recurrent neural networks (RNNs). This model has shown excellent performance in handling complex tasks.

[0126] In addition, regularization technology can be combined to add a regularization term to the loss function to penalize excessive values ​​of model parameters. This helps the model reduce overfitting of new data while maintaining good generalization capabilities, thereby improving the recognition accuracy and stability of the model in complex urban environments.

[0127] Regularization techniques include L1 regularization, L2 regularization, and Dropout. L1 regularization limits the complexity of the model by adding the sum of the absolute values ​​of the model parameters to the loss function; L2 regularization achieves the same goal by adding the sum of the squares of the model parameters. Dropout is a method of randomly discarding neuron connections during training, which helps prevent the model from overfitting the training data.

[0128] In the design of complex model structures, regularization techniques are often combined with other optimization methods to further improve the generalization ability of the model. For example, Dropout can be combined with Batch Normalization to speed up the training process and improve the stability of the model.

[0129] In one implementation, after iteratively adjusting the model parameters of the preset model based on the training data to obtain the target recognition model, the method further includes:

[0130] The target recognition model is pruned and quantized to obtain a compressed model.

[0131] That is to say, after the target recognition model is obtained through training, it can be compressed through pruning and quantization. Model compression is an important method to improve the real-time and flexibility of deep learning models, and to reduce the complexity of the model by reducing the number of model parameters and the amount of calculation.

[0132] Among them, pruning is a model compression technology that aims to reduce the size and computational complexity of the model by removing redundant parameters or nodes in the model. These redundant parameters or nodes usually have little effect on the predictive performance of the model, so they can be removed without significantly reducing performance.

[0133] Pruning methods can be divided into global pruning and local pruning. Global pruning considers all parameters in the entire model and decides which parameters can be removed based on certain criteria (such as weight size, gradient information, etc.). Local pruning, on the other hand, prunes a certain part of the model (such as a convolutional layer or a fully connected layer). In addition, pruning can be divided into structured pruning and unstructured pruning. Structured pruning removes the entire convolution kernel or neuron, while unstructured pruning removes a single weight.

[0134] Through pruning, the size and computation of the model can be significantly reduced, thereby increasing the running speed of the model and reducing energy consumption. At the same time, a reasonable pruning strategy can also improve the generalization ability of the model to a certain extent and avoid overfitting.

[0135] Quantization is a technique that converts model parameters from high precision to low precision. Through quantization, the storage requirements and computational complexity of the model can be further reduced.

[0136] Quantization methods can be divided into uniform quantization and non-uniform quantization. Uniform quantization maps parameter values ​​to a fixed, equally spaced quantization level. Non-uniform quantization selects the appropriate quantization level for mapping based on the distribution characteristics of the parameter value. In addition, quantization can also be divided into static quantization and dynamic quantization based on the accuracy and method of quantization.

[0137] Quantization can significantly reduce the storage requirements and computational complexity of the model, thereby increasing the model's running speed and reducing energy consumption. However, quantization may also lead to a decrease in model performance. Therefore, it is necessary to carefully weigh the relationship between performance and compression rate during the quantization process and select appropriate quantization methods and parameters.

[0138] In one implementation, after iteratively adjusting the model parameters of the preset model based on the training data to obtain the target recognition model, the method further includes:

[0139] transmitting the target recognition model to multiple nodes;

[0140] After receiving the data to be processed, the data to be processed is divided and sent to each node respectively;

[0141] Obtain the processing results returned by each node based on the target recognition model, aggregate the processing results, and obtain the recognition results of the data to be processed.

[0142] That is to say, after the target recognition model is trained, it can be deployed in multiple nodes to realize distributed computing based on the target recognition model. Distributed computing is an important method to improve the real-time and flexibility of deep learning models. It accelerates model training and reasoning by allocating computing tasks to multiple nodes for parallel processing.

[0143] Distributed computing distributes computing tasks to multiple nodes to improve computing efficiency and data security. The mathematical model can be expressed as: R = f(x1, x2, ..., x l ), where R is the result of the calculation, x l It is the lth data to be processed after segmentation. Distributed computing will segment the data to be processed and distribute it to various computing nodes, perform computing tasks on these nodes, and finally aggregate the results.

[0144] In addition, in the present application, a hypernetwork model training method can be used to train the target recognition model. First, a unified hypernetwork model is trained through multi-task learning to capture shared features and representations between different tasks. Then, by pruning and compressing the hypernetwork model, multiple plug-and-play small models are generated for different tasks or devices.

[0145] This method can improve the generalization ability and deployment efficiency of the target recognition model, reduce the R&D cost and deployment difficulty. At the same time, since the hypernetwork model has captured the shared features between different tasks, the generated small model usually has better performance.

[0146] Furthermore, NAS (Neural Architecture Search) can be used to automatically search for the optimal neural network architecture for the target recognition model. Through an automated process, a large number of network architectures can be explored and evaluated to ultimately find the architecture that performs best on a specific task.

[0147] The core concept of NAS is to regard network architecture design as an optimization problem and use machine learning algorithms for search, including reinforcement learning, evolutionary algorithms, and gradient descent. These algorithms use different search strategies and evaluation indicators to find the optimal network architecture, thereby improving the performance and efficiency of the model.

[0148] For example, this application can be applied to urban traffic management. For example, in traffic monitoring scenarios, by real-time analysis of traffic monitoring video streams, using target recognition models to identify vehicles, pedestrians and other traffic participants, and monitoring traffic flow, vehicle speed and congestion. This helps traffic management departments to more effectively dispatch traffic lights, alleviate traffic congestion and improve traffic efficiency. In violation detection scenarios, traffic violations such as speeding and running red lights are automatically detected to reduce accident risks and improve road safety.

[0149] This application can be applied to urban security monitoring. For example, in the abnormal behavior recognition scenario, the target recognition model is used to automatically identify and monitor abnormal behaviors in the city, such as pedestrian congestion, traffic accidents, fires, sabotage, etc., and timely detect and alarm to improve the safety of the city. In the face recognition and tracking scenario, the face recognition system is deployed in key areas to track and monitor specific personnel, providing strong support for urban security.

[0150] This application can be applied to garbage disposal and environmental protection. For example, in the garbage classification and recognition scenario, the target recognition model can be used to analyze image data, automatically identify different types of garbage, and put them into corresponding garbage bins, thereby improving the accuracy and efficiency of garbage classification. In the environmental monitoring scenario, environmental indicators such as air quality, noise level, and water pollution can be detected to help urban management departments take timely measures to protect the environment.

[0151] This application can be applied to urban planning and design. For example, in the image analysis and processing scenario, the target recognition model is used to analyze satellite images and aerial photos, extract information about buildings and roads, evaluate the development status and population density of urban construction, and optimize urban planning schemes. In the virtual urban landscape generation scenario, a virtual urban landscape is generated to help designers and planners better display and communicate design ideas, and improve the scientificity and artistry of urban planning.

[0152] This application can be applied to the construction of smart cities. For example, in smart parking scenarios, it can identify vacant parking spaces, guide drivers to park, improve parking efficiency, and alleviate parking difficulties. In public facility management scenarios, it can monitor and manage public facilities (such as street lights, manhole covers, etc.), detect and handle faults in a timely manner, and ensure the normal operation of urban infrastructure.

[0153] This application can be applied to other application scenarios. For example, in the security field, target recognition models can be deployed in public places such as scenic spots and shopping malls to achieve intelligent monitoring and early warning. In the medical field, combined with medical imaging data, it can assist doctors in disease diagnosis and treatment. In the education field, it can be used for scenarios such as student clocking in and learning supervision to improve the level of intelligent education management.

[0154] In summary, the urban object recognition system and method based on small sample learning of the target recognition model has broad application prospects in many fields such as urban transportation, safety, environmental protection, and planning, and can significantly improve the intelligence level and efficiency of urban management.

[0155] Figure 2 It is a logical diagram of a recognition model training method according to an exemplary embodiment, wherein Telesearch is the starting point of the process and represents a method of searching, extracting or generating training data from a large amount of data, which will be used for subsequent small model and large model training.

[0156] Aggregation: This step involves aggregating the searched, extracted, or generated training data into a sample database. This database will serve as the data source for subsequent small model and large model training.

[0157] The large model phase includes:

[0158] Small sample fine-tuning: Select a small sample data from the sample database for fine-tuning of the large model. Fine-tuning is to use small sample data to make fine adjustments based on the pre-trained model to improve the performance of the model on the task.

[0159] Large model training: Use the fine-tuned data and possible additional data to train a large model.

[0160] Large model evaluation: Perform performance evaluation on the trained large model to ensure that it meets application requirements.

[0161] Platform application: Deploy the qualified large model to the actual application platform to handle actual tasks.

[0162] Automatic launch: Implement the automatic launch function on the platform to ensure that large models can run stably and can be updated or replaced in a timely manner.

[0163] The small model stage includes:

[0164] Small model training: Based on the training data for personalized tasks and the trained large model, a small model is trained.

[0165] Small model evaluation: Evaluate the performance of the small model. These evaluation results will be used to guide subsequent model improvements.

[0166] General reasoning framework: Aggregate the results of small model evaluation into a general reasoning framework. This framework may be a standardized evaluation platform for comparing the performance of different models on different tasks.

[0167] Figure 3 The following is a training and testing flowchart of a target recognition model according to an exemplary embodiment, wherein the training phase includes:

[0168] Clustering: X1, X2, X3, and X4 are input training data, which are used to train the preset model.

[0169] Feature extraction function: Through data query, the training data input into the preset model is obtained. During the training phase, features can be extracted from the input training data to learn the characteristic performance of the training data.

[0170] Pass parameters: pass the model parameters during feature extraction to the test process.

[0171] Output probability P(X): During the training process, the preset model can receive training data X and output the corresponding probability P(X), which represents the possibility that the training data X belongs to a certain category.

[0172] Loss calculation: In order to optimize the model, the model loss is calculated. The loss function is an indicator that measures the difference between the prediction results of the preset model and the queried data labels. By minimizing the loss function, the performance of the preset model can be improved.

[0173] The testing phase includes:

[0174] Clustering: X1, X2, X3, and X4 are input training data, which can also be used to test the preset model.

[0175] Embedded feature extraction f(X): Determine the test model by embedding the model parameters passed during the training process, and obtain the training data input to the test model through data query.

[0176] Output feature values: The input training data is processed based on the test model, and the corresponding feature values ​​are output. After training and testing, the difference between the feature values ​​output by the test model and the labels corresponding to the input training data is reduced, which can improve the accuracy of the output feature values.

[0177] As can be seen from the above, the technical solution provided by the embodiment of the present application utilizes semi-supervised learning technology to generate second sample data and its corresponding labels through a small amount of accurately labeled first sample data, and uses the first sample data and its corresponding labels and the second sample data and its corresponding labels as training data, and then obtains a target recognition model based on training with diversified training data. In this way, not only can the training of the target recognition model be completed on the basis of a limited and small amount of first sample data, and efficient learning under small samples can be achieved, but also the generalization ability of the target recognition model can be enhanced through the diversification of training data, so that it can maintain stable recognition performance in different scenarios and conditions, thereby reducing the cost and time of labeling training data and improving the recognition accuracy of the target recognition model.

[0178] The recognition model training method provided in the embodiment of the present application can be executed by a recognition model training device. In the embodiment of the present application, the recognition model training device is used as an example to illustrate the device of the recognition model training method provided in the embodiment of the present application.

[0179] Figure 4 : is a block diagram of a recognition model training device according to an exemplary embodiment, comprising:

[0180] An acquisition module 201 is used to acquire first sample data, where the first sample data has a pre-marked label;

[0181] A learning module 202, configured to perform semi-supervised learning on the first sample data and the label corresponding to the first sample data, to obtain second sample data and the label corresponding to the second sample data;

[0182] The training module 203 is used to use the first sample data and the label corresponding to the first sample data, the second sample data and the label corresponding to the second sample data as training data, and iteratively adjust the model parameters of the preset model based on the training data to obtain a target recognition model.

[0183] As can be seen from the above, the technical solution provided by the embodiment of the present application utilizes semi-supervised learning technology to generate second sample data and its corresponding labels through a small amount of accurately labeled first sample data, and uses the first sample data and its corresponding labels and the second sample data and its corresponding labels as training data, and then obtains a target recognition model based on training with diversified training data. In this way, not only can the training of the target recognition model be completed on the basis of a limited and small amount of first sample data, and efficient learning under small samples can be achieved, but also the generalization ability of the target recognition model can be enhanced through the diversification of training data, so that it can maintain stable recognition performance in different scenarios and conditions, thereby reducing the cost and time of labeling training data and improving the recognition accuracy of the target recognition model.

[0184] The recognition model training method provided in the embodiment of the present application can be executed by a terminal access terminal. In the embodiment of the present application, a method for executing terminal access by a terminal access terminal is taken as an example to illustrate the device of the recognition model training method provided in the embodiment of the present application.

[0185] The recognition model training device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or it can be other devices other than the terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0186] The recognition model training device provided in the embodiment of the present application can achieve Figures 1 to 3 To avoid repetition, the various processes implemented by the method embodiment are not described here.

[0187] Alternatively, if Figure 5As shown, an embodiment of the present application also provides an electronic device 500, including a processor 501 and a memory 502, wherein the memory 502 stores programs or instructions that can be executed on the processor 501, and when the program or instructions are executed by the processor 501, the various steps of the above-mentioned recognition model training method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, they are not repeated here.

[0188] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

[0189] Figure 6 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.

[0190] The electronic device 1000 includes but is not limited to: a radio frequency unit 1001, a network module 1002, an audio output unit 1003, an input unit 1004, a sensor 1005, a display unit 1006, a user input unit 1007, an interface unit 1008, a memory 1009, and a processor 1010 and other components.

[0191] Those skilled in the art will appreciate that the electronic device 1000 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 1010 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 6 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.

[0192] As can be seen from the above, the technical solution provided by the embodiment of the present application utilizes semi-supervised learning technology to generate second sample data and its corresponding labels through a small amount of accurately labeled first sample data, and uses the first sample data and its corresponding labels and the second sample data and its corresponding labels as training data, and then obtains a target recognition model based on training with diversified training data. In this way, not only can the training of the target recognition model be completed on the basis of a limited and small amount of first sample data, and efficient learning under small samples can be achieved, but also the generalization ability of the target recognition model can be enhanced through the diversification of training data, so that it can maintain stable recognition performance in different scenarios and conditions, thereby reducing the cost and time of labeling training data and improving the recognition accuracy of the target recognition model.

[0193] It should be understood that in the embodiment of the present application, the input unit 1004 may include a graphics processor (Graphics Processing Unit, GPU) 10041 and a microphone 10042, and the graphics processor 10041 processes the image data of the static picture or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 1006 may include a display panel 10061, and the display panel 10061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 1007 includes a touch panel 10071 and at least one of other input devices 10072. The touch panel 10071 is also called a touch screen. The touch panel 10071 may include two parts: a touch detection device and a touch controller. Other input devices 10072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.

[0194] The memory 1009 can be used to store software programs and various data. The memory 1009 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 1009 may include a volatile memory or a non-volatile memory, or the memory 1009 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 109 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.

[0195] The processor 1010 may include one or more processing units; optionally, the processor 1010 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 1010.

[0196] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned recognition model training method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0197] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0198] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned recognition model training method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0199] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0200] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned recognition model training method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0201] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0202] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0203] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A recognition model training method, characterized in that: The method comprises: Acquire first sample data, where the first sample data has a pre-labeled label; Performing semi-supervised learning on the first sample data and the label corresponding to the first sample data to obtain second sample data and the label corresponding to the second sample data; The first sample data and the label corresponding to the first sample data, the second sample data and the label corresponding to the second sample data are used as training data, and based on the training data, the model parameters of the preset model are iteratively adjusted to obtain a target recognition model.

2. The recognition model training method according to claim 1, characterized in that: The performing semi-supervised learning on the first sample data and the label corresponding to the first sample data to obtain the second sample data and the label corresponding to the second sample data includes: Acquire second sample data; Iteratively adjusting model parameters of a prediction model based on the first sample data and a label corresponding to the first sample data to obtain a labeled model; The second sample data is input into the annotation model for prediction to determine a label corresponding to the second sample data.

3. The recognition model training method according to claim 2, characterized in that: The iteratively adjusting the model parameters of the prediction model based on the first sample data and the label corresponding to the first sample data to obtain the labeled model includes: Inputting the first sample data into a prediction model for feature analysis to determine a prediction value of the first sample data; Calculating a first loss value between a predicted value of the first sample data and a label of the first sample data, and determining a regularization term of the prediction model; When the sum of the first loss value and the regularization term takes a minimum value, the values ​​of the model parameters of the prediction model are determined to obtain a labeled model.

4. The recognition model training method according to claim 2, characterized in that: The method of iteratively adjusting the model parameters of the preset model based on the training data to obtain the target recognition model includes: Based on the training data, the model parameters of the annotation model are iteratively adjusted to obtain a target recognition model.

5. The recognition model training method according to claim 1, characterized in that: The performing semi-supervised learning on the first sample data and the label corresponding to the first sample data to obtain the second sample data and the label corresponding to the second sample data includes: Based on the first sample data and the label corresponding to the first sample data, training a generation model; The generation model is used to generate second sample data, and a label corresponding to the second sample data is determined.

6. The recognition model training method according to claim 5, characterized in that: The determining a label corresponding to the second sample data includes: Perform a cluster analysis on the second sample data to determine a label corresponding to the second sample data.

7. The recognition model training method according to claim 1, characterized in that: The method of iteratively adjusting the model parameters of the preset model based on the training data to obtain the target recognition model includes: Obtaining model parameters of a pre-trained model, and determining initialization parameters according to the model parameters of the pre-trained model; Initializing the model parameters of the preset model based on the initialization parameters; Based on the training data, the model parameters of the initialized preset model are iteratively adjusted to obtain a target recognition model.

8. The recognition model training method according to claim 7, characterized in that: The preset model is a computer vision model that includes an attention mechanism and a memory network.

9. The recognition model training method according to claim 1, characterized in that: After the model parameters of the preset model are iteratively adjusted based on the training data to obtain the target recognition model, the method further includes: The target recognition model is pruned and quantized to obtain a compressed model.

10. The recognition model training method according to claim 1, characterized in that: After the model parameters of the preset model are iteratively adjusted based on the training data to obtain the target recognition model, the method further includes: transmitting the target recognition model to a plurality of nodes; After receiving the data to be processed, the data to be processed is divided and sent to each node respectively; The processing result returned by each node based on the target recognition model is obtained, and the processing results are aggregated to obtain the recognition result of the data to be processed.

11. A recognition model training device, characterized in that: The device comprises: An acquisition module, used for acquiring first sample data, where the first sample data has a pre-marked label; A learning module, used for performing semi-supervised learning on the first sample data and the label corresponding to the first sample data to obtain second sample data and the label corresponding to the second sample data; A training module is used to use the first sample data and the label corresponding to the first sample data, the second sample data and the label corresponding to the second sample data as training data, and iteratively adjust the model parameters of the preset model based on the training data to obtain a target recognition model.

12. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the recognition model training method as described in any one of claims 1 to 10.

13. A readable storage medium, characterized in that: The readable storage medium stores programs or instructions, and when the programs or instructions are executed by the processor, the steps of the recognition model training method as described in any one of claims 1-10 are implemented.