Model training method based on ensemble learning, image recognition method and device
By introducing class center vector constraints and feature space alignment into ensemble learning, the parameters of the complementary model to be trained are directly updated, which solves the problem of long training cycles in ensemble learning and achieves efficient image recognition model training and improved accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TENCENT TECH SHANGHAI
- Filing Date
- 2022-03-16
- Publication Date
- 2026-04-28
AI Technical Summary
Existing ensemble learning methods require training a large number of complementary models for combined testing when training image recognition models, resulting in long training cycles and low efficiency.
By obtaining the class center vector and feature vector of the image sample set, the parameters of the complementary model to be trained are directly updated until the model training conditions are met, avoiding sub-model combination testing. A unified class center vector is introduced as a classification surface constraint, and the angle between the feature vector and the classification surface is increased to improve the model's classification performance.
By avoiding sub-model combination testing, a robust ensemble model can be directly obtained, saving model training efficiency and improving the accuracy of image recognition.
Smart Images

Figure CN116824193B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence, and in particular to model training methods, image recognition methods, and apparatus based on ensemble learning. Background Technology
[0002] Image recognition technology is an important field of artificial intelligence (AI). It refers to the technology of identifying objects in images to recognize targets and objects of various patterns. As image recognition technology becomes increasingly popular and valued, there is a continuous demand for improving the accuracy of image recognition models.
[0003] Currently, to improve the accuracy of image recognition, ensemble learning methods can be used to obtain image recognition models with better performance. Ensemble learning completes the learning task by constructing and combining multiple learners. That is, multiple complementary models with weak recognition performance are used for training and combined in a cyclical manner, and finally integrated to obtain a higher-performance image recognition model.
[0004] While ensemble learning can improve the accuracy of image recognition models, the inventors have found at least the following problems with existing methods: during ensemble learning, a large number of complementary models need to be trained for combined testing, resulting in a long training cycle and low training efficiency. Summary of the Invention
[0005] This application provides a model training method, an image recognition method, and an apparatus based on ensemble learning. This application can directly obtain a robust ensemble model without requiring sub-model combination testing, thereby saving model training efficiency.
[0006] In view of this, this application provides a model training method based on ensemble learning, comprising:
[0007] Obtain T sets of image samples, where each set of image samples includes at least one image sample, each image sample corresponds to a category label, and T is an integer greater than 1;
[0008] Based on the category label corresponding to each image sample in each image sample set, obtain T sets of class center vectors for T sets of image samples. The set of class center vectors corresponds to the set of image samples, and image samples with the same category label have the same class center vector.
[0009] Based on a set of T image samples, T feature vector sets are obtained through T complementary models to be trained. Each complementary model to be trained is used to extract a feature vector set, and the feature vector sets correspond to the image sample sets.
[0010] Based on T feature vector sets and T class center vector sets, the model parameters of T complementary models to be trained are updated until the T complementary models to be trained meet the model training conditions, thus obtaining an ensemble model. The ensemble model includes T complementary models, and the complementary models correspond to the complementary models to be trained.
[0011] This application also provides an image recognition method, comprising:
[0012] Acquire the target image;
[0013] Based on the target image, R feature vectors are obtained through an ensemble model, where the ensemble model includes T complementary models, or the ensemble model includes T complementary models and a base model. The ensemble model is trained using the methods described above, and R is an integer greater than 1.
[0014] Generate the target feature vector of the target image based on R feature vectors;
[0015] The target image is identified based on the target feature vector to obtain the image recognition result.
[0016] This application also provides a model training apparatus, comprising:
[0017] The acquisition module is used to acquire T sets of image samples, wherein each set of image samples includes at least one image sample, each image sample corresponds to a category label, and T is an integer greater than 1;
[0018] The acquisition module is also used to acquire T sets of class center vectors for T sets of image samples based on the category label corresponding to each image sample in each set of image samples. The set of class center vectors corresponds to the set of image samples, and image samples with the same category label have the same class center vector.
[0019] The acquisition module is also used to acquire T feature vector sets based on T sets of image samples through T complementary models to be trained, wherein each complementary model to be trained is used to extract a feature vector set, and the feature vector set has a corresponding relationship with the image sample set;
[0020] The training module is used to update the model parameters of T complementary models to be trained based on T feature vector sets and T class center vector sets, until the T complementary models to be trained meet the model training conditions, thus obtaining an ensemble model. The ensemble model includes T complementary models, and the complementary models correspond to the complementary models to be trained.
[0021] In one possible design, in another implementation of another aspect of the embodiments of this application,
[0022] The acquisition module is specifically used to obtain the class center vector corresponding to each image sample in each image sample set based on the class label corresponding to the image sample and through the class center mapping relationship. The class center mapping relationship includes the mapping relationship between the class label and the class center vector.
[0023] In one possible design, in another implementation of another aspect of the embodiments of this application,
[0024] The acquisition module is also used to acquire a first image sample set before acquiring the set of T class center vectors for the T sets of image samples based on the category label corresponding to each image sample in each image sample set. The first image sample set includes P image samples, each image sample corresponds to a category label, and P is an integer greater than or equal to 1.
[0025] The acquisition module is also used to acquire P class center vectors based on the category label corresponding to each image sample in the first image sample set;
[0026] The acquisition module is also used to acquire P feature vectors based on the first image sample set and through the basic model to be trained, wherein the feature vectors in the P feature vectors correspond to the image samples in the P image samples;
[0027] The training module is also used to update the model parameters of the base model to be trained and each class center vector based on P feature vectors and P class center vectors.
[0028] In one possible design, in another implementation of another aspect of the embodiments of this application,
[0029] The training module is specifically used to calculate the cosine value of each image sample in the first image sample set based on the feature vector and class center vector corresponding to the image sample.
[0030] The gradient is determined using the first loss function based on the distribution radius of the image feature space and the cosine value corresponding to each image sample in the first image sample set.
[0031] Gradients are used to update the model parameters of the base model to be trained and the center vectors of each class.
[0032] In one possible design, in another implementation of another aspect of the embodiments of this application,
[0033] The training module is specifically used to calculate the cosine value of each image sample in the first image sample set based on the feature vector and class center vector corresponding to the image sample.
[0034] The gradient is determined using the second loss function based on the first interval value, the second interval value, the distribution radius of the image feature space, and the cosine value corresponding to each image sample in the first image sample set.
[0035] Gradients are used to update the model parameters of the base model to be trained and the center vectors of each class.
[0036] In one possible design, in another implementation of another aspect of the embodiments of this application,
[0037] The training module is specifically used to obtain T complementary models when T complementary models to be trained meet the model training conditions.
[0038] When the base model to be trained meets the model training conditions, the base model is obtained;
[0039] The basic model and T complementary models are used as an integrated model.
[0040] In one possible design, in another implementation of another aspect of the embodiments of this application,
[0041] The training module is specifically used to calculate the cosine value of each image sample in the image sample set for each of the T complementary models to be trained, based on the feature vector and class center vector of each image sample in the image sample set. The initial model parameters of each complementary model to be trained are randomly generated.
[0042] For each of the T complementary models to be trained, the gradient for the complementary model to be trained is determined by the first loss function based on the distribution radius of the image feature space and the cosine value corresponding to each image sample in the image sample set.
[0043] For each of the T complementary models to be trained, the model parameters of the complementary model to be trained are updated using the gradient of the complementary model to be trained.
[0044] In one possible design, in another implementation of another aspect of the embodiments of this application,
[0045] The training module is specifically used to calculate the cosine value of each image sample in the image sample set for each of the T complementary models to be trained, based on the feature vector and class center vector of each image sample in the image sample set. The initial model parameters of each complementary model to be trained are randomly generated.
[0046] For each of the T complementary models to be trained, the gradient for the complementary model to be trained is determined by the second loss function based on the first interval value, the second interval value, the distribution radius of the image feature space, and the cosine value corresponding to each image sample in the image sample set.
[0047] For each of the T complementary models to be trained, the model parameters of the complementary model to be trained are updated using the gradient of the complementary model to be trained.
[0048] In one possible design, in another implementation of another aspect of the embodiments of this application,
[0049] The acquisition module is also used to acquire a second image sample set after the ensemble model is obtained by satisfying the model training conditions for T complementary models to be trained. The second image sample set includes K image samples, each image sample corresponds to a category label, and K is an integer greater than or equal to 1.
[0050] The acquisition module is also used to acquire K class center vectors based on the category label corresponding to each image sample in the second image sample set;
[0051] The acquisition module is also used to acquire K feature matrices based on the second image sample set through an ensemble model, wherein the feature matrices correspond to the image samples in the K image samples;
[0052] The acquisition module is also used to acquire K feature vectors based on K feature matrices through the fusion model to be trained, wherein the feature vectors among the K feature vectors have a corresponding relationship with the image samples in the second image sample set;
[0053] The training module is also used to update the model parameters and class center vectors of the fusion model to be trained based on the K feature vectors and K class center vectors until the model training conditions are met, thus obtaining the fusion model.
[0054] In one possible design, in another implementation of another aspect of the embodiments of this application,
[0055] The training module is specifically used to calculate the cosine value of each image sample in the second image sample set based on the feature vector and class center vector corresponding to the image sample.
[0056] The gradient is determined using the first loss function based on the distribution radius of the image feature space and the cosine value corresponding to each image sample in the second image sample set.
[0057] Gradients are used to update the model parameters and class center vectors of the fusion model to be trained.
[0058] In one possible design, in another implementation of another aspect of the embodiments of this application,
[0059] The training module is specifically used to calculate the cosine value of each image sample in the second image sample set based on the feature vector and class center vector corresponding to the image sample.
[0060] The gradient is determined using the second loss function based on the first interval value, the second interval value, the distribution radius of the image feature space, and the cosine value corresponding to each image sample in the second image sample set.
[0061] Gradients are used to update the model parameters and class center vectors of the fusion model to be trained.
[0062] This application also provides an image recognition device, comprising:
[0063] The acquisition module is used to acquire the target image;
[0064] The acquisition module is also used to acquire R feature vectors based on the target image through an ensemble model, wherein the ensemble model includes T complementary models, or the ensemble model includes T complementary models and a base model, and the ensemble model is trained using the methods mentioned above, where R is an integer greater than 1.
[0065] The generation module is used to generate the target feature vector of the target image based on R feature vectors;
[0066] The recognition module is used to recognize the target image based on the target feature vector and obtain the image recognition result.
[0067] In one possible design, in another implementation of another aspect of the embodiments of this application,
[0068] The generation module is specifically used to average the R feature vectors to obtain the target feature vector of the target image.
[0069] In one possible design, in another implementation of another aspect of the embodiments of this application,
[0070] The generation module is specifically used to take R feature vectors as the target feature matrix;
[0071] Based on the target feature matrix, the target feature vector of the target image is obtained through a fusion model.
[0072] In one possible design, in another implementation of another aspect of the embodiments of this application,
[0073] The recognition module is specifically used to respond to an image recognition request and obtain the feature vector to be matched corresponding to the target information, wherein the image recognition request carries the target information;
[0074] Determine the feature similarity based on the target feature vector and the feature vector to be matched;
[0075] If the feature similarity is less than or equal to the similarity threshold, the target image is considered to have been successfully identified.
[0076] or,
[0077] The recognition module is specifically used to calculate the similarity between the target feature vector and each feature vector in the database;
[0078] Based on the similarity calculation results, the feature vector with the highest similarity to the target feature vector is determined from the database, and the recognition result of the target image is determined based on the feature vector.
[0079] In another aspect, this application provides a computer device including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the methods described above.
[0080] Another aspect of this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the methods described above.
[0081] Another aspect of this application provides a computer program product, including a computer program that, when executed by a processor, implements the methods described above.
[0082] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:
[0083] This application provides a model training method based on ensemble learning. First, T sets of image samples are obtained, each set including at least one image sample, and each image sample corresponding to a class label. Then, based on the class label corresponding to each image sample in each set, T sets of class center vectors are obtained for the T sets of image samples. Based on the T sets of image samples, T sets of feature vectors are obtained through T complementary models to be trained. Therefore, based on the T sets of feature vectors and the T sets of class center vectors, the model parameters of the T complementary models to be trained are updated until the T complementary models to be trained meet the model training conditions, resulting in an ensemble model. Through the above method, based on ensemble learning, a unified class center vector is introduced as the classification surface of each complementary model to be trained; that is, the classification surface constrains each complementary model to be trained. Since the classification surfaces of each complementary model to be trained are consistent, the feature vectors of each complementary model to be trained can be constrained to a feature space. During model training, the classification performance of the model is improved by increasing the angle between the feature vectors and the classification surface. Since a larger angle indicates a lower degree of overlap in the feature vectors output by the models, it suggests better complementarity in the output features between the complementary models to be trained. Therefore, by avoiding combined testing of the complementary models to be trained, a robust ensemble model (i.e., including multiple complementary models to be trained) can be directly obtained, thus saving on model training efficiency. Attached Figure Description
[0084] Figure 1 This is a schematic diagram of an architecture for ensemble learning in an embodiment of this application;
[0085] Figure 2 This is a schematic diagram of the spatial distribution of a class center for different initialization models in the embodiments of this application;
[0086] Figure 3 This is a schematic diagram of the architecture of an image recognition system in an embodiment of this application;
[0087] Figure 4 This is a flowchart illustrating the model training method in an embodiment of this application;
[0088] Figure 5 This is a schematic diagram of a process for training a complementary model in an embodiment of this application;
[0089] Figure 6 This is a schematic diagram of the angular distribution between different complementary models in the embodiments of this application;
[0090] Figure 7 This is a schematic diagram of a process for training the base model in an embodiment of this application;
[0091] Figure 8This is a schematic diagram of the spatial distribution of image features in an embodiment of this application;
[0092] Figure 9 This is a schematic diagram of a process for training the fusion model in an embodiment of this application;
[0093] Figure 10 This is a schematic diagram of an overall framework for implementing image recognition using an ensemble model in an embodiment of this application;
[0094] Figure 11 This is a flowchart illustrating an image recognition method in an embodiment of this application;
[0095] Figure 12 This is a deployment diagram of the integration model in an embodiment of this application;
[0096] Figure 13 This is another deployment diagram of the integration model in the embodiments of this application;
[0097] Figure 14 This is a schematic diagram of an image recognition scenario in an embodiment of this application;
[0098] Figure 15 This is another schematic diagram of an image recognition scenario in an embodiment of this application;
[0099] Figure 16 This is a schematic diagram of a model training device in an embodiment of this application;
[0100] Figure 17 This is a schematic diagram of an image recognition device in an embodiment of this application;
[0101] Figure 18 This is a schematic diagram of the server structure in an embodiment of this application;
[0102] Figure 19 This is a schematic diagram of the structure of a terminal in an embodiment of this application. Detailed Implementation
[0103] This application provides a model training method, an image recognition method, and an apparatus based on ensemble learning. This application can directly obtain a robust ensemble model without requiring sub-model combination testing, thereby saving model training efficiency.
[0104] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “corresponding to,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0105] AI (Artificial Intelligence) is a theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within 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. AI technology is a comprehensive discipline involving a wide range of fields, encompassing both hardware and software technologies. Basic AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly include computer vision (CV), speech processing, natural language processing, and machine learning / deep learning.
[0106] Computer vision (CV) is an important field of AI. It's a science that studies how to enable machines to "see," specifically, using cameras and computers to replace human eyes for target recognition and measurement, and further processing images to create images more suitable for human observation or transmission to instruments. As a scientific discipline, CV researches related theories and technologies, attempting to build AI systems capable of extracting information from images or multidimensional data. CV technologies typically include image processing, image recognition, image semantic understanding, image retrieval, optical character recognition (OCR), video processing, video semantic understanding, video content / behavior recognition, 3D object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous localization and mapping (SLAM), and common biometric recognition technologies such as facial recognition and fingerprint recognition.
[0107] Computer vision (CV) technology forms the foundation for practical technologies such as stereo vision, motion analysis, and data fusion, and has wide applications in many fields, including navigation, map and terrain registration, natural resource analysis, weather forecasting, environmental monitoring, and physiological disease research. For example, facial recognition is an important research topic in CV and has wide applications in industry. With the development and popularization of mobile devices, the demand for running facial recognition algorithms on terminals is increasing. For example, in the field of autonomous driving, object detection is typically required to improve vehicle safety and avoid collisions with other objects on the road.
[0108] Therefore, image recognition accuracy has a significant impact on business operations, and model ensemble learning is a method to improve model recognition accuracy, exhibiting stability and effectiveness. For easier understanding, please refer to [link to relevant documentation]. Figure 1 , Figure 1 This is a schematic diagram of an ensemble learning architecture in an embodiment of this application. As shown in the figure, ensemble learning combines multiple models with weak recognition performance. These weaker sub-models undergo complementarity screening tests, and then are integrated to obtain a model with better performance. Specifically, the process includes randomly selecting N samples with replacement from the training sample set as a sample set, repeating this process T times to obtain T sample sets. An individual learner (i.e., the complementary model to be trained) is trained for each sample set. A certain strategy is used to combine the T individual learners into a strong learner (i.e., the ensemble model).
[0109] In image recognition-based ensemble learning, there is a situation where the spatial distribution of image features is inconsistent. For better understanding, please refer to [link to relevant documentation]. Figure 2 , Figure 2 This figure illustrates the class center space distribution of different initialization models in this application, using simulation to represent the feature space distribution. The black circles, black squares, and black pentagrams represent the distribution of the three category labels in the feature space. Models initialized with different random seeds result in inconsistent distributions of the class center vectors extracted from the three category labels. Therefore, during model ensemble, this feature space mismatch may prevent the ensemble model from achieving improved recognition accuracy, or even impair the overall recognition accuracy of the ensemble model.
[0110] To improve the recognition accuracy of the ensemble model, this application proposes a method for training multiple complementary models based on feature space alignment, integrating the complementary models, and adapting them into an image recognition system to improve image recognition accuracy.
[0111] The image recognition method proposed in this application can be applied to... Figure 3The image recognition system shown in the figure includes at least one of a server and a terminal, with the client deployed on the terminal. The client can run on the terminal via a browser or as a standalone application (APP), etc. The specific form of the client is not limited here. The server involved in this application can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. The terminal can be a mobile phone, computer, smart voice interaction device, smart home appliance, vehicle terminal, aircraft, etc., but is not limited to these. The terminal and server can be directly or indirectly connected via wired or wireless communication, which is not limited here. The number of servers and terminals is also not limited. The solution provided in this application can be completed independently by the terminal, independently by the server, or jointly by the terminal and the server; this is not specifically limited here. The embodiments of the present invention can be applied to various scenarios, including but not limited to cloud technology, AI, smart transportation, and assisted driving.
[0112] In one scenario, the terminal sends the captured image to the server. The server then uses a pre-trained ensemble model to extract features from the image and performs further analysis based on these features, for example, identifying the image type as "apple." The server then sends the recognition result back to the terminal for display.
[0113] Based on the above introduction, the model training method based on ensemble learning in this application will be described below. Please refer to [link / reference]. Figure 4 In this application, the model training method based on ensemble learning can be executed by a computer device, which can be a terminal or a server. This application includes:
[0114] 110. Obtain T sets of image samples, where each set of image samples includes at least one image sample, each image sample corresponds to a category label, and T is an integer greater than 1;
[0115] In one or more embodiments, N image samples are randomly selected with replacement from the full training sample set to form an image sample set, and this process is repeated T times to obtain T image sample sets. Here, N is an integer greater than or equal to 1, and T is an integer greater than 1. Each image sample in the full training sample set is labeled with a category label, and there is a mapping relationship between image samples and category labels. For example, image sample A corresponds to the category label "001", and image sample B corresponds to the category label "002".
[0116] 120. Based on the category label corresponding to each image sample in each image sample set, obtain T sets of class center vectors for T sets of image samples, where the set of class center vectors corresponds to the set of image samples, and image samples with the same category label have the same class center vector.
[0117] In one or more embodiments, for each of the T sets of image samples, the class center vector of the image sample can be queried from the class center storage module according to the class label corresponding to each image sample in the image sample set. Based on this, T sets of class center vectors can be obtained from the T sets of image samples, with each set of image samples corresponding to one set of class center vectors.
[0118] It is worth noting that image samples with the same category label have the same class center vector. For example, the category label can be an identity label. For instance, image sample A is a face image of user A, and its corresponding category label is "001". Image sample B is also a face image of user A, so its corresponding category label is still "001". Image sample C is a face image of user B, and its corresponding category label is "002".
[0119] 130. Based on a set of T image samples, obtain T feature vector sets through T complementary models to be trained. Each complementary model to be trained is used to extract a feature vector set, and the feature vector set corresponds to the set of image samples.
[0120] In one or more embodiments, based on ensemble learning, T complementary models to be trained are initialized using different random seeds. The initialized complementary models to be trained are obtained by randomly assigning network parameters using fixed function operations, and the random seeds are control variables generated by random numbers.
[0121] Specifically, each set of image samples can be used to train a complementary model. For ease of explanation, a set of image samples will be used as an example. Based on this, each image sample in the set is used as input to the complementary model, and the model outputs a feature vector corresponding to each image sample. Thus, the feature vectors corresponding to each image sample can be considered as a set of feature vectors. That is, each set of image samples corresponds to a set of feature vectors.
[0122] 140. Based on the T feature vector sets and the T class center vector sets, update the model parameters of the T complementary models to be trained until the T complementary models to be trained meet the model training conditions, and obtain the ensemble model. The ensemble model includes T complementary models, and the complementary models correspond to the complementary models to be trained.
[0123] In one or more embodiments, the input to each complementary model to be trained is a set of image samples, each image sample in the set having a corresponding class center vector, which represents the features of the image sample. Meanwhile, the output of each complementary model to be trained is a set of feature vectors. For ease of explanation, a set of image samples will be used as an example.
[0124] Specifically, based on the feature vector set and class center vector set corresponding to the image sample set, a loss function is used to update the model parameters of the complementary model to be trained. Understandably, other complementary models to be trained also have their model parameters updated in a similar manner. When all T complementary models to be trained meet the model training conditions, T complementary models are obtained. Here, these T complementary models can be considered as an ensemble model.
[0125] It should be noted that, in one scenario, an exhaustion criterion can be used to determine whether the model training conditions are met. For example, an iteration threshold can be set; when the number of iterations reaches the threshold, it indicates that the model training conditions have been met. In another scenario, an observational criterion can be used to determine whether the model training conditions are met. For example, when the loss value is less than a threshold, it indicates that the model training conditions have been met.
[0126] For easier understanding, please refer to Figure 5 , Figure 5 This is a flowchart illustrating the training of a complementary model in an embodiment of this application, as shown in the figure. Specifically:
[0127] In step A1, during model training, T sets of image samples are read, and each set of image samples can be processed as a batch. For ease of explanation, the following will use a set of image samples as an example.
[0128] In step A2, the complementary model to be trained is invoked to extract spatial features from each image sample in the image sample set. The output feature map retains the spatial structure information of the image. The feature map is then vectorized to obtain the feature vector of each image sample.
[0129] It is worth noting that for T complementary models to be trained, each model also needs to be randomly initialized by controlling the random seed. Since the initialization random seed of each complementary model is not controlled in a consistent manner, the diversity of the models is improved.
[0130] It should be noted that the base model to be trained can adopt the structure of Convolutional Neural Networks (CNN). Based on this, operations such as convolution calculation, non-linear activation function (ReLU) calculation, and pooling calculation can be implemented through the base model to be trained.
[0131] In step A3, the class label of each image sample is obtained through the class center mapping relationship based on the class label corresponding to each image sample in the image sample set. The class center mapping relationship can be represented as a (d×k) matrix, where d represents the feature dimension of the class center vector and k represents the total number of class labels. During the training of the complementary model, the stored class center mapping relationship is not updated. Since the class center vectors remain fixed during the training of the complementary model, the feature space of the model can be constrained to a uniform spherical distribution.
[0132] In step A4, the feature vector output by the complementary model to be trained is multiplied by the class center vectors to obtain the probability vector of the image sample belonging to each class label. Then, based on the class label of the image sample that generated the probability vector, the gradient is calculated using the corresponding loss function.
[0133] It is worth noting that for T complementary models to be trained, it is also necessary to control the hyperparameters of each model. Since the class center vectors of the training data have a fixed direction, the orientation vector of each class label in space can be determined. Image samples cluster around the space corresponding to the class center vector of their class label, and their distance from the class center (i.e., the distribution radius of the image feature space) expresses the quality of the image sample. Therefore, in complementarity experiments, the distribution radius of the image feature space and the margin can be adjusted to ensure the diversity of constraints on the image in space, which can promote the model's learning of complementarity. Different complementary models to be trained should have inconsistent hyperparameters.
[0134] It should be noted that during the training process, only the model parameters of the complementary model to be trained are updated, while the class center vector only provides gradient calculation and does not participate in the parameter update process.
[0135] In step A5, the model parameters of the complementary model to be trained are trained using gradient descent, and it is determined whether the model training conditions are met. It should be noted that gradient descent methods include, but are not limited to, stochastic gradient descent, stochastic gradient descent with momentum term, adaptive momentum estimation (adam), and adaptive gradient (adagard), without limitation here.
[0136] In step A6, if the model training conditions are met, the trained complementary model is obtained. It is understood that other complementary models are trained in a similar manner, which will not be elaborated upon here.
[0137] In step A7, if the model training conditions are not met, the complementary model to be trained is further optimized based on the loss function.
[0138] Therefore, after obtaining T complementary models, since their feature spaces are aligned, the features of each complementary model are comparable. For further explanation, please refer to [link to relevant documentation]. Figure 6 , Figure 6 This is a schematic diagram illustrating the angular distribution between different complementary models in this application embodiment. As shown in the figure, assuming T is 5, the horizontal axis represents the angle between complementary models, and the vertical axis represents the proportion of models at this angle. It can be seen that, based on the angular distribution of the same image between the various models, the feature overlap between the models is low. When the angle is around 17 degrees, the complementarity and comparability between the models are good. Model ensemble can be interpreted as sampling from a uniformly distributed random sample, and feature space alignment is a prerequisite for ensuring a uniform distribution.
[0139] This application provides a model training method based on ensemble learning. By introducing a unified class center vector as the classification surface for each complementary model to be trained, a constraint is applied to each complementary model based on the classification surface. Since the classification surfaces of all complementary models are consistent, their feature vectors can be constrained to a single feature space. During model training, the classification performance of the model is improved by increasing the angle between the feature vectors and the classification surface. A larger angle indicates lower overlap of the output feature vectors, thus indicating better complementarity of the output features among the complementary models. Therefore, a robust ensemble model can be directly obtained without requiring sub-model combination testing, thereby saving model training efficiency.
[0140] Optionally, in the above Figure 4 Based on the corresponding embodiments, in another optional embodiment provided by this application, according to the category label corresponding to each image sample in each image sample set, T class center vector sets for T sets of image samples are obtained, which may specifically include:
[0141] For each image sample in each image sample set, the class center vector corresponding to the image sample is obtained based on the class label corresponding to the image sample through the class center mapping relationship. The class center mapping relationship includes the mapping relationship between the class label and the class center vector.
[0142] In one or more embodiments, a method for querying class center vectors based on a class center storage module is introduced. As can be seen from the foregoing embodiments, image recognition is an open-set recognition task, meaning it uses feature alignment for recognition, and the recognized class label is not among the class labels in the training data. Therefore, during model ensemble learning, it is necessary to align the distribution of its feature space.
[0143] Specifically, image samples with the same category label have the same class center vector. Taking the category label as the identity label as an example, please refer to Table 1 for illustration. Table 1 is a schematic diagram of the class center mapping relationship.
[0144] Table 1
[0145] Image samples Category Tags Class center vector Image Sample A 001 [0.23,0.28,0.27,0.51,0.55,…,0.74] Image sample B 001 [0.23,0.28,0.27,0.51,0.55,…,0.74] Image sample C 002 [0.95,0.28,0.22,0.74,0.69,…,0.42] Image sample D 002 [0.95,0.28,0.22,0.74,0.69,…,0.42] Image sample E 003 [0.68,0.28,0.01,0.47,0.64,…,0.18] Image sample F 003 [0.68,0.28,0.01,0.47,0.64,…,0.18] Image sample G 003 [0.68,0.28,0.01,0.47,0.64,…,0.18]
[0146] Therefore, image sample A is a face image of user A, and its corresponding category label is "001". Image sample B is also a face image of user A, so its corresponding category label is also "001". Therefore, image sample A and image sample B have the same class center vector.
[0147] Secondly, this application provides a method for querying class center vectors based on a class center storage module. Through this method, during the training process of model ensemble learning, considering that the features extracted by the complementary models to be trained follow independent distributions, the class center mapping relationship can be used to align their feature space distributions, ensuring that the distributions extracted by different complementary models to be trained are consistent. This guarantees the complementarity between the sub-models and improves the recognition accuracy of the ensemble model.
[0148] Optionally, in the above Figure 4 Based on the corresponding embodiments, in another optional embodiment provided by this application, before obtaining the set of T class center vectors for the T sets of image samples according to the category label corresponding to each image sample in each image sample set, the following may be included:
[0149] Obtain a first image sample set, wherein the first image sample set includes P image samples, each image sample corresponds to a category label, and P is an integer greater than or equal to 1;
[0150] Based on the category label corresponding to each image sample in the first image sample set, obtain P class center vectors;
[0151] Based on the first set of image samples, P feature vectors are obtained through the basic model to be trained, wherein the feature vectors in the P feature vectors correspond to the image samples in the P image samples;
[0152] Based on P feature vectors and P class center vectors, update the model parameters and class center vectors of the base model to be trained.
[0153] In one or more embodiments, a method for training a base model and class center vectors is described. As can be seen from the foregoing embodiments, the class center vectors need to be optimized before training T complementary models. It is worth noting that the class center vectors need to be optimized simultaneously with the optimization of the base model to be trained.
[0154] For easier understanding, please refer to Figure 7 , Figure 7 This is a flowchart illustrating the training process of the base model in an embodiment of this application, as shown in the figure. Specifically:
[0155] In step B1, during model training, P image samples are read and combined into a batch for processing. This batch of image samples is the first set of image samples.
[0156] In step B2, the base model to be trained is invoked to extract spatial features from each image sample in the first image sample set. The output feature map retains the spatial structure information of the image. The feature map is then vectorized to obtain the feature vector of each image sample.
[0157] It should be noted that the base model to be trained can adopt a CNN structure. Based on this, convolution calculation, non-linear activation function (ReLU) calculation, pooling calculation, and other operations are performed through the base model to be trained. Optionally, the base model to be trained can also adopt a model with a larger number of parameters, such as Residual Network-152 (ResNet-152) or ResNet-200. There is no limitation here.
[0158] In step B3, based on the category label corresponding to each image sample in the first image sample set, the category label of each image sample is obtained through the class center mapping relationship. The class center mapping relationship can be represented as a (d×k) matrix, where d represents the feature dimension of the class center vector and k represents the total number of category labels. The class center vector is then used in matrix operations with the feature vector extracted by the base model to be trained to obtain the probability value of each image sample belonging to each category label.
[0159] In step B4, the feature vector output by the base model to be trained is multiplied by the class center vectors to obtain the probability vector of the image sample belonging to each class label. Then, based on the class label of the image sample that generated the probability vector, the gradient is calculated using the corresponding loss function.
[0160] In step B5, the model parameters and class center vectors of the base model to be trained are optimized using gradient descent, and it is determined whether the model training conditions are met. It should be noted that gradient descent methods include, but are not limited to, stochastic gradient descent, including stochastic gradient descent with a driving term, Adam, and Adamard; these are not limited here.
[0161] In step B6, if the model training conditions have been met, the trained base model is obtained.
[0162] In step B7, if the model training conditions are not met, the optimization of the base model to be trained and the class center vectors continues based on the loss function.
[0163] Secondly, this application provides a method for training a base model and class center vectors. Through this method, the class center vectors are trained simultaneously during the training of the base model. This yields unified class center vectors for use in subsequent training of complementary models, thereby improving the feasibility and operability of the solution.
[0164] Optionally, in the above Figure 4 Based on the corresponding embodiments, in another optional embodiment provided by this application, the model parameters of the base model to be trained and each class center vector are updated according to P feature vectors and P class center vectors. Specifically, this may include:
[0165] For each image sample in the first image sample set, the cosine value corresponding to the image sample is calculated based on the feature vector and class center vector corresponding to the image sample.
[0166] The gradient is determined using the first loss function based on the distribution radius of the image feature space and the cosine value corresponding to each image sample in the first image sample set.
[0167] Gradients are used to update the model parameters of the base model to be trained and the class center vectors of each class.
[0168] In one or more embodiments, a training method for a base model is described. As can be seen from the foregoing embodiments, a loss function can be used to update the model parameters and class center vectors of the base model to be trained. The following will illustrate the method using a first loss function, which can be a softmax loss function.
[0169] Specifically, taking P image samples in the first image sample set as an example, the gradient of the first loss function can be calculated as follows:
[0170]
[0171] Where P represents the total number of image samples included in the first image sample set. i This represents the category label of the i-th image sample. This represents the angle between the feature vector corresponding to the i-th image sample and the corresponding class center vector. This represents the cosine value corresponding to the image sample. s represents the distribution radius of the image feature space, such as... Figure 8 The radius indicated by C1 is the distribution radius of the image feature space, and s is usually an empirical value. j represents the j-th category label. k represents the total number of category labels. e represents the natural constant.
[0172] Furthermore, this application provides a training method for a basic model. By using the softmax loss function to train the model in this way, the aim is to increase the distance between classes and decrease the distance within classes, thereby enabling the trained basic model to have better classification capabilities.
[0173] Optionally, in the above Figure 4 Based on the corresponding embodiments, in another optional embodiment provided by this application, the model parameters of the base model to be trained and each class center vector are updated according to P feature vectors and P class center vectors. Specifically, this may include:
[0174] For each image sample in the first image sample set, the cosine value corresponding to the image sample is calculated based on the feature vector and class center vector corresponding to the image sample.
[0175] The gradient is determined using the second loss function based on the first interval value, the second interval value, the distribution radius of the image feature space, and the cosine value corresponding to each image sample in the first image sample set.
[0176] Gradients are used to update the model parameters of the base model to be trained and the class center vectors of each class.
[0177] In one or more embodiments, another training method for the base model is introduced. As can be seen from the foregoing embodiments, a loss function can be used to update the model parameters and class center vectors of the base model to be trained. The following will use a second loss function as an example, where the second loss function can be a softmax loss function with an added margin, i.e., margin softmax.
[0178] Specifically, taking P image samples in the first image sample set as an example, the gradient of the first loss function can be calculated as follows:
[0179]
[0180] Where P represents the total number of image samples included in the first image sample set. i This represents the category label of the i-th image sample. This represents the angle between the feature vector corresponding to the i-th image sample and the corresponding class center vector. The value represents the cosine of the image sample. s represents the radius of the image feature space distribution; s is usually an empirical value. j represents the j-th class label. k represents the total number of class labels. e represents the natural constant. m1 represents the first interval value. m2 represents the second interval value; m1 and m2 are usually empirical values.
[0181] Furthermore, this application provides another method for training the base model. By using the margin softmax loss function to train the model in this way, the aim is to increase the distance between classes and decrease the distance within classes, thereby giving the trained base model better classification capabilities.
[0182] Optionally, in the above Figure 4 Based on the corresponding embodiments, in another optional embodiment provided by this application, the ensemble model is obtained until T complementary models to be trained meet the model training conditions. Specifically, this may include:
[0183] When T complementary models to be trained meet the model training conditions, obtain T complementary models;
[0184] When the base model to be trained meets the model training conditions, the base model is obtained;
[0185] The basic model and T complementary models are used as an integrated model.
[0186] In one or more embodiments, a method for adding a base model to an ensemble model is described. As can be seen from the foregoing embodiments, either a exhaustion criterion or an observational criterion can be used to determine whether the model training conditions are met.
[0187] Specifically, for each complementary model to be trained, it is necessary to determine whether it meets the model training conditions. The base model to be trained that meets the model training conditions is the complementary model. Based on this, T complementary models can be obtained. Similarly, for each base model to be trained, it is also necessary to determine whether it meets the model training conditions. The base model to be trained that meets the model training conditions is the base model. Thus, the T complementary models and the base models can be used together as an ensemble model, that is, the ensemble model can include (T+1) sub-models.
[0188] It should be noted that the ensemble model includes R sub-models. When the ensemble model includes only T complementary models, R = T. When the ensemble model includes T complementary models and the base model, R = (T + 1).
[0189] Furthermore, this application provides a method for adding a base model to an ensemble model. Using this method, the trained base model can be directly used as a sub-model of the ensemble model, thereby saving model training costs.
[0190] Optionally, in the above Figure 4 Based on the corresponding embodiments, in another optional embodiment provided by this application, the model parameters of T complementary models to be trained are updated according to T feature vector sets and T class center vector sets, which may specifically include:
[0191] For each of the T complementary models to be trained, the cosine value corresponding to each image sample in the image sample set is calculated based on the feature vector and class center vector corresponding to each image sample in the image sample set. The initial model parameters of each complementary model to be trained are randomly generated.
[0192] For each of the T complementary models to be trained, the gradient for the complementary model to be trained is determined by the first loss function based on the distribution radius of the image feature space and the cosine value corresponding to each image sample in the image sample set.
[0193] For each of the T complementary models to be trained, the model parameters of the complementary model to be trained are updated using the gradient of the complementary model to be trained.
[0194] In one or more embodiments, a training method for a complementary model is described. As can be seen from the foregoing embodiments, a loss function can be used to update the model parameters and class center vectors of the complementary model to be trained. The following explanation will take the use of a first loss function as an example, where the first loss function can be the softmax loss function. For ease of explanation, a set of image samples will be used as an example below.
[0195] Specifically, taking an image sample set containing N image samples as an example, the gradient of the first loss function can be calculated as follows:
[0196]
[0197] Where N represents the total number of image samples in the image sample set. i This represents the category label of the i-th image sample. This represents the angle between the feature vector corresponding to the i-th image sample and the corresponding class center vector. The value represents the cosine of the image sample. s represents the radius of the image feature space distribution, which is usually an empirical value. j represents the j-th class label. k represents the total number of class labels. e represents the natural constant.
[0198] Furthermore, this application provides a training method for a complementary model. By using the softmax loss function to train the model in this way, the aim is to increase the distance between classes and decrease the distance within classes, thereby enabling the trained complementary model to have better classification capabilities.
[0199] Optionally, in the above Figure 4 Based on the corresponding embodiments, in another optional embodiment provided by this application, the model parameters of T complementary models to be trained are updated according to T feature vector sets and T class center vector sets, which may specifically include:
[0200] For each of the T complementary models to be trained, the cosine value corresponding to each image sample in the image sample set is calculated based on the feature vector and class center vector corresponding to each image sample in the image sample set. The initial model parameters of each complementary model to be trained are randomly generated.
[0201] For each of the T complementary models to be trained, the gradient for the complementary model to be trained is determined by the second loss function based on the first interval value, the second interval value, the distribution radius of the image feature space, and the cosine value corresponding to each image sample in the image sample set.
[0202] For each of the T complementary models to be trained, the model parameters of the complementary model to be trained are updated using the gradient of the complementary model to be trained.
[0203] In one or more embodiments, another training method for the complementary model is introduced. As described in the foregoing embodiments, a loss function can be used to update the model parameters and class center vectors of the complementary model to be trained. The following explanation will use a second loss function as an example, where the second loss function can be a softmax loss function with added margin, i.e., margin softmax. For ease of explanation, a set of image samples will be used as an example below.
[0204] Specifically, taking N image samples in the image sample set as an example, the gradient of the second loss function can be calculated as follows:
[0205]
[0206] Where N represents the total number of image samples in the image sample set. i This represents the category label of the i-th image sample. This represents the angle between the feature vector corresponding to the i-th image sample and the corresponding class center vector. The value represents the cosine of the image sample. s represents the radius of the image feature space distribution; s is usually an empirical value. j represents the j-th class label. k represents the total number of class labels. e represents the natural constant. m1 represents the first interval value. m2 represents the second interval value; m1 and m2 are usually empirical values.
[0207] Secondly, this application provides another method for training complementary models. By using the margin softmax loss function to train the model in this way, the aim is to increase the distance between classes and decrease the distance within classes, thereby giving the trained complementary model better classification capabilities.
[0208] Optionally, in the above Figure 4 Based on the corresponding embodiments, in another optional embodiment provided by this application, after T complementary models to be trained meet the model training conditions and the ensemble model is obtained, it may further include:
[0209] Obtain a second image sample set, which includes K image samples, each image sample corresponding to a category label, where K is an integer greater than or equal to 1;
[0210] Based on the category label corresponding to each image sample in the second image sample set, obtain K class center vectors;
[0211] Based on the second image sample set, K feature matrices are obtained through an ensemble model, where each feature matrix corresponds to an image sample in the K image samples.
[0212] Based on K feature matrices, K feature vectors are obtained through the fusion model to be trained, wherein the feature vectors in the K feature vectors correspond to the image samples in the second image sample set;
[0213] Based on K feature vectors and K class center vectors, the model parameters and class center vectors of the fusion model to be trained are updated until the model training conditions are met, thus obtaining the fusion model.
[0214] In one or more embodiments, a method for training the fusion model and class center vectors is described. As can be seen from the foregoing embodiments, after training T complementary models, the class center vectors can be further optimized. It is worth noting that the class center vectors need to be optimized simultaneously with the optimization of the fusion model to be trained.
[0215] For easier understanding, please refer to Figure 9 , Figure 9 This is a schematic diagram of a process for training the fusion model in an embodiment of this application, as shown in the figure. Specifically:
[0216] In step D1, during model training, K image samples are read and combined into a batch for processing. This batch of image samples is the second set of image samples.
[0217] In step D2, the trained ensemble model is invoked to extract spatial features from each image sample in the second image sample set. The output feature map retains the spatial structure information of the image. The feature map is then vectorized to obtain the feature vector of each image sample. Since the feature vector output by a single sub-model has a dimension of d (e.g., 512 dimensions), assuming no feature fusion dimensionality reduction is performed, the output dimension of the ensemble of R sub-models is an R*d feature matrix.
[0218] In step D3, the increased feature length of the model leads to a longer time for calculating feature similarity during deployment, and some features extracted from different sub-models overlap, resulting in redundant information in the integrated features. Therefore, the features of K image samples are integrated into a K×R*d dimensional feature matrix. That is, the K R*d dimensional feature matrices are used as input to the fusion model to be trained, and the fusion model outputs the feature vector corresponding to each feature matrix.
[0219] It should be noted that the fusion model to be trained includes operations such as non-linear activation function (ReLU) calculation, pooling calculation, and fully connected operations.
[0220] In step D4, based on the category label corresponding to each image sample in the second image sample set, the category label of each image sample is obtained through the class center mapping relationship. The class center mapping relationship can be represented as a (d×k) matrix, where d represents the feature dimension of the class center vector and k represents the total number of category labels. The class center vector is then used in matrix operations with the feature vector extracted by the fusion model to obtain the probability value of the image sample belonging to each category label. The feature vector output by the fusion model to be trained is then multiplied with each class center vector to obtain the probability vector of the image sample belonging to each category label. Finally, based on the category label of the image sample that generated this probability vector, the gradient is calculated using the corresponding loss function.
[0221] In step D5, the model parameters and class center vectors of the fusion model to be trained are optimized using gradient descent, and it is determined whether the model training conditions are met. It should be noted that gradient descent methods include, but are not limited to, stochastic gradient descent, including stochastic gradient descent with a driving term, Adam, and Adamard; these are not limited here.
[0222] In step D6, if the model training conditions have been met, the trained fusion model is obtained.
[0223] In step D7, if the model training conditions are not met, the fusion model to be trained and the class center vector are optimized based on the loss function.
[0224] Secondly, this application provides a method for feature dimensionality reduction by incorporating a fusion model. This method designs a fusion model for the output features of the ensemble model, removing redundant information between features, reducing the time required to calculate the angle between the feature vector and the class center vector, and ensuring that the maximum effective information is retained among the various sub-models. Furthermore, it reduces the need for manually designing model weight parameters, ensuring the stability of model iteration. Simultaneously, the fusion model guarantees the adaptability of the ensemble model's output to existing image recognition systems.
[0225] Optionally, in the above Figure 4 Based on the corresponding embodiments, in another optional embodiment provided by this application, the model parameters of the fusion model to be trained and each class center vector are updated according to K feature vectors and K class center vectors. Specifically, this may include:
[0226] For each image sample in the second image sample set, the cosine value corresponding to the image sample is calculated based on the feature vector and class center vector corresponding to the image sample.
[0227] The gradient is determined using the first loss function based on the distribution radius of the image feature space and the cosine value corresponding to each image sample in the second image sample set.
[0228] Gradients are used to update the model parameters and class center vectors of the fusion model to be trained.
[0229] In one or more embodiments, a training method for a fusion model is described. As can be seen from the foregoing embodiments, a loss function can be used to update the model parameters and class center vectors of the fusion model to be trained. The following will use the first loss function as an example for explanation, where the first loss function can be the softmax loss function.
[0230] Specifically, taking K image samples from the second image sample set as an example, the gradient of the first loss function can be calculated as follows:
[0231]
[0232] Where K represents the total number of image samples included in the second image sample set. i This represents the category label of the i-th image sample. This represents the angle between the feature vector corresponding to the i-th image sample and the corresponding class center vector. Let represent the cosine value corresponding to the image sample. s represents the distribution radius of the image feature space; s is usually an empirical value. j represents the j-th class label. k represents the total number of class labels. e represents the natural constant.
[0233] Furthermore, this application provides a training method for a fusion model. By using the softmax loss function to train the model in this way, the aim is to increase the distance between classes and decrease the distance within classes, thereby enabling the trained fusion model to have better classification capabilities.
[0234] Optionally, in the above Figure 4 Based on the corresponding embodiments, in another optional embodiment provided by this application, the model parameters of the fusion model to be trained and each class center vector are updated according to K feature vectors and K class center vectors. Specifically, this may include:
[0235] For each image sample in the second image sample set, the cosine value corresponding to the image sample is calculated based on the feature vector and class center vector corresponding to the image sample.
[0236] The gradient is determined using the second loss function based on the first interval value, the second interval value, the distribution radius of the image feature space, and the cosine value corresponding to each image sample in the second image sample set.
[0237] Gradients are used to update the model parameters and class center vectors of the fusion model to be trained.
[0238] In one or more embodiments, another training method for the fusion model is introduced. As can be seen from the foregoing embodiments, a loss function can be used to update the model parameters of the base model to be trained and the class center vectors of each class. The following will use a second loss function as an example for explanation, where the second loss function can be a softmax loss function with margin added, i.e., margin softmax.
[0239] Specifically, taking K image samples from the second image sample set as an example, the gradient of the second loss function can be calculated as follows:
[0240]
[0241] Where P represents the total number of image samples included in the second image sample set. i This represents the category label of the i-th image sample. This represents the angle between the feature vector corresponding to the i-th image sample and the corresponding class center vector. The value represents the cosine of the image sample. s represents the radius of the image feature space distribution; s is usually an empirical value. j represents the j-th class label. k represents the total number of class labels. e represents the natural constant. m1 represents the first interval value. m2 represents the second interval value; m1 and m2 are usually empirical values.
[0242] Furthermore, this application provides another method for training the fusion model. By using the margin softmax loss function to train the model in this way, the aim is to increase the distance between classes and decrease the distance within classes, thereby giving the trained fusion model better classification capabilities.
[0243] The following will combine Figure 10 This section introduces a general scheme for image recognition using an ensemble model with feature space alignment. Please refer to [link / reference]. Figure 10 , Figure 10This diagram illustrates the overall framework for image recognition using an ensemble model in this application. As shown, it mainly consists of two stages: model training and model deployment. In the model training stage, the base model is first trained and optimized using existing data. To align the feature spaces of complementary models, a classification surface is introduced to constrain them. Since the classification surfaces of each sub-model are consistent, they can be constrained to a single feature space. During sub-model training, the classification surfaces are not updated. Finally, the trained sub-models are integrated, and a fusion model is trained to fuse all features. In the model deployment stage, all sub-models need to be integrated and connected to the fusion model, resulting in a recognition ensemble model. Combined with feature comparison and search functions, this forms a complete image recognition system.
[0244] This application aligns the feature spaces of the models, ensuring that sub-models can be complementaryly integrated within the same feature space, thereby improving the recognition accuracy of the integrated model. Simultaneously, this application only requires training the number of models to be stacked, eliminating the need for screening and traversing model combinations, reducing the steps of combination testing and selection, and simplifying the process of obtaining the integrated model. Furthermore, it eliminates the need to train a large number of sub-models, ensuring a reliable iteration cycle. Moreover, during application, no additional training data for image recognition is required; existing training data can be used.
[0245] Based on the above introduction, the image recognition method in this application will be described below. Please refer to [link / reference]. Figure 11 The image recognition method in this application embodiment can be executed by a computer device, which can be a terminal or a server. This application includes:
[0246] 210. Acquire the target image;
[0247] In one or more embodiments, a target image to be identified is acquired.
[0248] 220. Based on the target image, obtain R feature vectors through an ensemble model, wherein the ensemble model includes T complementary models, or the ensemble model includes T complementary models and a base model, and the ensemble model is trained using the model training method provided in the above embodiment, where R is an integer greater than 1.
[0249] In one or more embodiments, the target image is used as input to an ensemble model, wherein the ensemble model comprises R sub-models. Thus, the ensemble model outputs R feature vectors, i.e., each sub-model outputs one feature vector.
[0250] It should be noted that the R sub-models may include T complementary models, or the R sub-models may include T complementary models and one base model. The training methods for the complementary models and the base model can be found in the aforementioned embodiments, and will not be repeated here.
[0251] 230. Generate the target feature vector of the target image based on R feature vectors;
[0252] In one or more embodiments, based on R feature vectors, a corresponding strategy can be employed to obtain the target feature vector of the target image. It is understood that these strategies include, but are not limited to, averaging the R feature vectors, performing feature fusion on the R feature vectors, etc.
[0253] 240. Recognize the target image based on the target feature vector to obtain the image recognition result.
[0254] In one or more embodiments, after obtaining the target feature vector, the target image can be identified based on the target feature vector, thereby obtaining the image recognition result.
[0255] This application provides an image recognition method. Based on the above approach, a method for aligning the feature spaces of each sub-model is proposed to ensure the complementarity between the sub-models, thereby improving the recognition accuracy of the integrated model.
[0256] Optionally, in the above Figure 11 Based on the corresponding embodiments, in another optional embodiment provided by this application, generating a target feature vector of the target image according to R feature vectors may specifically include:
[0257] The target feature vector of the target image is obtained by averaging the R feature vectors.
[0258] In one or more embodiments, a method for generating target feature vectors is described. As can be seen from the foregoing embodiments, the target feature vector of the target image can be obtained by averaging R feature vectors.
[0259] Specifically, for ease of understanding, please refer to Figure 12 , Figure 12This is a schematic diagram of the deployment of the integrated model in an embodiment of this application. As shown in the figure, the target image is used as the input to each sub-model in the integrated model, and each sub-model outputs its corresponding feature vector. Based on this, the R feature vectors are averaged to obtain the target feature vector of the target image. Assuming R is 2, where one feature vector is [0.3, 0.8, 0.6] and the other feature vector is [0.1, 0.8, 0.2], the target feature vector is obtained by averaging these two feature vectors as [0.2, 0.8, 0.4].
[0260] Secondly, this application provides a method for generating target feature vectors. Through this method, since the ensemble model has good robustness, it can extract more accurate feature vectors, thereby improving the accuracy of image recognition.
[0261] Optionally, in the above Figure 11 Based on the corresponding embodiments, in another optional embodiment provided by this application, generating a target feature vector of the target image according to R feature vectors may specifically include:
[0262] Use R eigenvectors as the target feature matrix;
[0263] Based on the target feature matrix, the target feature vector of the target image is obtained through a fusion model.
[0264] In one or more embodiments, another method for generating target feature vectors is described. As can be seen from the foregoing embodiments, feature fusion can be performed on R feature vectors to obtain the target feature vector of the target image.
[0265] Specifically, for ease of understanding, please refer to Figure 13 , Figure 13 This is another deployment diagram of the ensemble model in this application embodiment. As shown in the figure, the target image is used as the input to each sub-model in the ensemble model, and each sub-model outputs its corresponding feature vector. Based on this, the R feature vectors are used as an R*d-dimensional target feature matrix. Then, the target feature matrix is used as the input to the fusion model, and the fusion model outputs a d-dimensional target feature vector.
[0266] Secondly, this application provides another method for generating target feature vectors. Through this method, on the one hand, the ensemble model has better robustness, thus enabling the extraction of more accurate feature vectors. On the other hand, the fusion model can fuse and reduce the dimensionality of the features output by the ensemble model, ensuring that the features of the ensemble model are adaptable to existing image recognition systems, facilitating deployment and application.
[0267] Optionally, in the above Figure 11 Based on the corresponding embodiments, in another optional embodiment provided by this application, the target image is identified according to the target feature vector to obtain the image recognition result, which may specifically include:
[0268] In response to an image recognition request, the feature vector to be matched corresponding to the target information is obtained, wherein the image recognition request carries the target information;
[0269] Determine the feature similarity based on the target feature vector and the feature vector to be matched;
[0270] If the feature similarity is less than or equal to the similarity threshold, the target image is considered to have been successfully identified.
[0271] or,
[0272] The target image is identified based on the target feature vector to obtain the image recognition result, which may specifically include:
[0273] The similarity between the target feature vector and each feature vector in the database is calculated.
[0274] Based on the similarity calculation results, the feature vector with the highest similarity to the target feature vector is determined from the database, and the recognition result of the target image is determined based on the feature vector.
[0275] In one or more embodiments, various image processing methods are described. As can be seen from the foregoing embodiments, after extracting the target feature vector of the target image, 1:1 face image recognition or 1:N face image recognition can also be achieved, thereby effectively improving the accuracy of face recognition.
[0276] Scenario 1: 1:1 face image recognition;
[0277] Facial verification is essentially a 1:1 comparison. Its identity verification mode is fundamentally a process where a computer device quickly compares the current face with a database of facial images and determines if they match. This 1:1 mode can be used for scenarios such as facial unlocking and identity verification. The terminal only needs to compare the user's pre-registered photo with the photo taken on-site to determine if they are the same person, thus completing the identity verification.
[0278] Specifically, for ease of understanding, please refer to Figure 14 , Figure 14This is a schematic diagram of an image recognition scenario in an embodiment of this application. As shown in the figure, when a user unlocks their phone with their face, the user faces the phone's camera to capture a target image (i.e., a face image). After the capture is complete, an image recognition request is triggered. This request carries target information, which can be a user identifier. Based on this, the feature vector to be matched corresponding to the user identifier can be directly extracted from the backend according to the target information. It can be understood that the feature vector to be matched is a feature vector extracted based on the user's pre-registered face image. Therefore, the similarity between the target feature vector extracted from the target image and the feature vector to be matched is calculated to obtain a feature similarity (e.g., cosine similarity). If the feature similarity is less than or equal to a similarity threshold, the target image recognition is successful, i.e., the phone unlocks successfully. If the feature similarity is greater than the similarity threshold, the phone unlock fails.
[0279] For example, users can also undergo identity verification when launching a game application. Specifically, when a user launches the game application, the game's anti-addiction system prompts the user to verify their identity. After the user agrees to access the camera, a target image of the user (i.e., a facial image) can be captured. Once the image is captured, an image recognition request is triggered, which carries the user's account information. Based on this, the feature vector to be matched corresponding to the user account can be directly extracted from the backend according to the target information. It can be understood that the feature vector to be matched is a feature vector extracted based on the user's pre-registered facial image. Therefore, the similarity between the target feature vector extracted from the target image and the feature vector to be matched is calculated to obtain the feature similarity. If the feature similarity is less than or equal to the similarity threshold, the target image recognition is successful, that is, the user can enter the game. If the feature similarity is greater than the similarity threshold, the user cannot enter the game.
[0280] At the same time, since users need to verify their identity (e.g., adult or minor) when registering their facial images, it is also possible to determine whether the user is a minor when providing the target image. For underage players, the game usage time can be controlled.
[0281] Scenario 2: 1:N face image recognition;
[0282] Facial recognition uses a 1:N comparison method. After acquiring the target image, it searches a massive database for images that match the target image, performs a match, and identifies the target image. This 1:N mode can be used for community access control, meeting room check-in, etc.
[0283] Specifically, for ease of understanding, please refer to Figure 15 , Figure 15This is another schematic diagram of an image recognition scenario in an embodiment of this application. As shown in the figure, a user is verifying their identity at the entrance of an access control device. The user faces the camera of the access control device to capture a target image (i.e., a face image). After capturing the target image, an image matching the target image is found from a facial image database. One processing method is to store face images and corresponding feature vectors in the facial image database. Based on this, the similarity between the target feature vector extracted from the target image and each feature vector in the database is calculated to obtain feature similarity (e.g., cosine similarity). According to these feature similarities, the feature vector with the highest similarity to the target feature vector is selected, and the user information corresponding to this feature vector is used as the recognition result of the target image.
[0284] If the highest feature similarity is greater than or equal to the similarity threshold, the user has been successfully identified, and the gate can be opened. If the highest feature similarity is less than the similarity threshold, the user has failed to be identified, and the gate will not be opened.
[0285] Secondly, this application provides various image processing methods. Through these methods, tasks such as identity verification, image matching, and image retrieval can be performed based on the image's feature vectors, thereby enhancing the application versatility of the solution.
[0286] The model training apparatus in this application is described in detail below. Please refer to [link / reference]. Figure 16 , Figure 16 This is a schematic diagram of one embodiment of the model training device in this application. The model training device 30 includes:
[0287] The acquisition module 310 is used to acquire T sets of image samples, wherein each set of image samples includes at least one image sample, each image sample corresponds to a category label, and T is an integer greater than 1;
[0288] The acquisition module 310 is also used to acquire T sets of class center vectors for T sets of image samples based on the category label corresponding to each image sample in each set of image samples, wherein the set of class center vectors corresponds to the set of image samples, and image samples with the same category label have the same class center vector.
[0289] The acquisition module 310 is also used to acquire T feature vector sets based on T sets of image samples through T complementary models to be trained, wherein each complementary model to be trained is used to extract a feature vector set, and the feature vector set has a corresponding relationship with the image sample set;
[0290] The training module 320 is used to update the model parameters of T complementary models to be trained based on T feature vector sets and T class center vector sets until the T complementary models to be trained meet the model training conditions, thereby obtaining an ensemble model. The ensemble model includes T complementary models, and the complementary models have a corresponding relationship with the complementary models to be trained.
[0291] This application provides a model training apparatus. Using this apparatus, based on ensemble learning, a unified class center vector is introduced as the classification surface for each complementary model to be trained; that is, the classification surface constrains each complementary model. Since the classification surfaces of each complementary model are consistent, the feature vectors of each complementary model can be constrained to a single feature space. During model training, the classification performance of the model is improved by increasing the angle between the feature vectors and the classification surface. Since a larger angle indicates a lower degree of overlap in the output feature vectors, it indicates better complementarity in the output features between the complementary models. Therefore, by avoiding combined testing of the complementary models, a robust ensemble model can be directly obtained, thus saving model training efficiency.
[0292] Optionally, in the above Figure 16 Based on the corresponding embodiments, in another embodiment of the model training device 30 provided in this application,
[0293] The acquisition module 310 is specifically used to obtain the class center vector corresponding to each image sample in each image sample set based on the class label corresponding to the image sample and through the class center mapping relationship. The class center mapping relationship includes the mapping relationship between the class label and the class center vector.
[0294] In this embodiment, a model training apparatus is provided. Using this apparatus, during the training process of model ensemble learning, considering that the features extracted by the complementary models to be trained follow independent distributions, the feature space distribution can be aligned using class center mapping relationships. This ensures that the distributions extracted by different complementary models to be trained are consistent, thereby guaranteeing the complementarity between the sub-models and improving the recognition accuracy of the ensemble model.
[0295] Optionally, in the above Figure 16 Based on the corresponding embodiments, in another embodiment of the model training device 30 provided in this application,
[0296] The acquisition module 310 is further configured to acquire a first image sample set before acquiring the set of T class center vectors for the T sets of image samples based on the category label corresponding to each image sample in each image sample set, wherein the first image sample set includes P image samples, each image sample corresponds to a category label, and P is an integer greater than or equal to 1.
[0297] The acquisition module 310 is also used to acquire P class center vectors based on the category label corresponding to each image sample in the first image sample set;
[0298] The acquisition module 310 is also used to acquire P feature vectors based on the first image sample set and through the basic model to be trained, wherein the feature vectors in the P feature vectors correspond to the image samples in the P image samples;
[0299] The training module 320 is also used to update the model parameters of the base model to be trained and each class center vector based on P feature vectors and P class center vectors.
[0300] This application provides a model training apparatus. Using this apparatus, class center vectors are trained simultaneously during the training of the base model. This yields unified class center vectors for use in subsequent training of complementary models, thereby improving the feasibility and operability of the solution.
[0301] Optionally, in the above Figure 16 Based on the corresponding embodiments, in another embodiment of the model training device 30 provided in this application,
[0302] The training module 320 is specifically used to calculate the cosine value of each image sample in the first image sample set based on the feature vector and class center vector corresponding to the image sample.
[0303] The gradient is determined using the first loss function based on the distribution radius of the image feature space and the cosine value corresponding to each image sample in the first image sample set.
[0304] Gradients are used to update the model parameters of the base model to be trained and the center vectors of each class.
[0305] In this embodiment of the application, a model training apparatus is provided. When using the above apparatus to train the model with the softmax loss function, the aim is to increase the distance between classes and decrease the distance within classes, thereby enabling the trained base model to have better classification ability.
[0306] Optionally, in the above Figure 16Based on the corresponding embodiments, in another embodiment of the model training device 30 provided in this application,
[0307] The training module 320 is specifically used to calculate the cosine value of each image sample in the first image sample set based on the feature vector and class center vector corresponding to the image sample.
[0308] The gradient is determined using the second loss function based on the first interval value, the second interval value, the distribution radius of the image feature space, and the cosine value corresponding to each image sample in the first image sample set.
[0309] Gradients are used to update the model parameters of the base model to be trained and the center vectors of each class.
[0310] In this embodiment, a model training apparatus is provided. When training the model using the above apparatus and the margin softmax loss function, the aim is to increase the distance between classes and decrease the distance within classes, thereby enabling the trained base model to have better classification capabilities.
[0311] Optionally, in the above Figure 16 Based on the corresponding embodiments, in another embodiment of the model training device 30 provided in this application,
[0312] Training module 320 is specifically used to obtain T complementary models when T complementary models to be trained meet the model training conditions.
[0313] When the base model to be trained meets the model training conditions, the base model is obtained;
[0314] The basic model and T complementary models are used as an integrated model.
[0315] This application provides a model training apparatus. Using this apparatus, a trained base model can be directly used as a sub-model of the ensemble model, thereby saving model training costs.
[0316] Optionally, in the above Figure 16 Based on the corresponding embodiments, in another embodiment of the model training device 30 provided in this application,
[0317] The training module 320 is specifically used to calculate the cosine value of each image sample in the image sample set based on the feature vector and class center vector of each image sample in the image sample set for each of the T complementary models to be trained. The initial model parameters of each complementary model to be trained are randomly generated.
[0318] For each of the T complementary models to be trained, the gradient for the complementary model to be trained is determined by the first loss function based on the distribution radius of the image feature space and the cosine value corresponding to each image sample in the image sample set.
[0319] For each of the T complementary models to be trained, the model parameters of the complementary model to be trained are updated using the gradient of the complementary model to be trained.
[0320] In this embodiment, a model training apparatus is provided. When training the model using the above apparatus and the softmax loss function, the aim is to increase the distance between classes and decrease the distance within classes, thereby enabling the trained complementary model to have better classification ability.
[0321] Optionally, in the above Figure 16 Based on the corresponding embodiments, in another embodiment of the model training device 30 provided in this application,
[0322] The training module 320 is specifically used to calculate the cosine value of each image sample in the image sample set based on the feature vector and class center vector of each image sample in the image sample set for each of the T complementary models to be trained. The initial model parameters of each complementary model to be trained are randomly generated.
[0323] For each of the T complementary models to be trained, the gradient for the complementary model to be trained is determined by the second loss function based on the first interval value, the second interval value, the distribution radius of the image feature space, and the cosine value corresponding to each image sample in the image sample set.
[0324] For each of the T complementary models to be trained, the model parameters of the complementary model to be trained are updated using the gradient of the complementary model to be trained.
[0325] This application provides a model training apparatus. When training the model using the above apparatus and the margin softmax loss function, the aim is to increase the inter-class distance and decrease the intra-class distance, thereby enabling the trained complementary model to have better classification capabilities.
[0326] Optionally, in the above Figure 16 Based on the corresponding embodiments, in another embodiment of the model training device 30 provided in this application,
[0327] The acquisition module 310 is also used to acquire a second image sample set after the ensemble model is obtained by satisfying the model training conditions for T complementary models to be trained. The second image sample set includes K image samples, each image sample corresponds to a category label, and K is an integer greater than or equal to 1.
[0328] The acquisition module 310 is also used to acquire K class center vectors based on the category label corresponding to each image sample in the second image sample set;
[0329] The acquisition module 310 is also used to acquire K feature matrices based on the second image sample set through an ensemble model, wherein the feature matrices correspond to the image samples in the K image samples;
[0330] The acquisition module 310 is also used to acquire K feature vectors based on K feature matrices through the fusion model to be trained, wherein the feature vectors in the K feature vectors have a corresponding relationship with the image samples in the second image sample set;
[0331] The training module 320 is also used to update the model parameters and class center vectors of the fusion model to be trained based on the K feature vectors and K class center vectors until the model training conditions are met and the fusion model is obtained.
[0332] This application provides a model training apparatus. Using this apparatus, a fusion model is designed for the output features of the ensemble model. This removes redundant information between features, reduces the time required to calculate the angle between the feature vector and the class center vector, and ensures that maximum effective information is retained among the various sub-models. Furthermore, it reduces the need for manually designing model weight parameters, ensuring the stability of model iteration. Simultaneously, the fusion model guarantees the adaptability of the ensemble model's output to existing image recognition systems.
[0333] Optionally, in the above Figure 16 Based on the corresponding embodiments, in another embodiment of the model training device 30 provided in this application,
[0334] The training module 320 is specifically used to calculate the cosine value of each image sample in the second image sample set based on the feature vector and class center vector corresponding to the image sample.
[0335] The gradient is determined using the first loss function based on the distribution radius of the image feature space and the cosine value corresponding to each image sample in the second image sample set.
[0336] Gradients are used to update the model parameters and class center vectors of the fusion model to be trained.
[0337] In this embodiment, a model training apparatus is provided. When training the model using the above apparatus and the softmax loss function, the aim is to increase the distance between classes and decrease the distance within classes, thereby enabling the trained fusion model to have better classification ability.
[0338] Optionally, in the above Figure 16 Based on the corresponding embodiments, in another embodiment of the model training device 30 provided in this application,
[0339] The training module 320 is specifically used to calculate the cosine value of each image sample in the second image sample set based on the feature vector and class center vector corresponding to the image sample.
[0340] The gradient is determined using the second loss function based on the first interval value, the second interval value, the distribution radius of the image feature space, and the cosine value corresponding to each image sample in the second image sample set.
[0341] Gradients are used to update the model parameters and class center vectors of the fusion model to be trained.
[0342] In this embodiment, a model training apparatus is provided. When training the model using the above apparatus with the margin softmax loss function, the aim is to increase the distance between classes and decrease the distance within classes, thereby enabling the trained fusion model to have better classification capabilities.
[0343] The image recognition device in this application is described in detail below. Please refer to [link / reference]. Figure 17 , Figure 17 This is a schematic diagram of one embodiment of the image recognition device in this application. The image recognition device 40 includes:
[0344] Acquisition module 410 is used to acquire the target image;
[0345] The acquisition module 410 is also used to acquire R feature vectors based on the target image through an ensemble model, wherein the ensemble model includes T complementary models, or the ensemble model includes T complementary models and a base model, and the ensemble model is trained using the methods described above, where R is an integer greater than 1.
[0346] The generation module 420 is used to generate the target feature vector of the target image based on R feature vectors;
[0347] The recognition module 430 is used to recognize the target image based on the target feature vector and obtain the image recognition result.
[0348] This application provides a model training apparatus. Using this apparatus, a method for aligning the feature spaces of each sub-model is proposed based on the integrated model, ensuring the complementarity between the sub-models and thus improving the recognition accuracy of the integrated model.
[0349] Optionally, in the above Figure 17 Based on the corresponding embodiments, in another embodiment of the image recognition device 40 provided in this application,
[0350] The generation module 420 is specifically used to average the R feature vectors to obtain the target feature vector of the target image.
[0351] This application provides a model training apparatus. Using this apparatus, since the ensemble model has good robustness, it can extract more accurate feature vectors, thereby improving the accuracy of image recognition.
[0352] Optionally, in the above Figure 17 Based on the corresponding embodiments, in another embodiment of the image recognition device 40 provided in this application,
[0353] The generation module 420 is specifically used to take R feature vectors as the target feature matrix;
[0354] Based on the target feature matrix, the target feature vector of the target image is obtained through a fusion model.
[0355] This application provides a model training apparatus. Using this apparatus, on the one hand, because the ensemble model has better robustness, more accurate feature vectors can be extracted. On the other hand, the fusion model can fuse and reduce the dimensionality of the features output by the ensemble model, ensuring that the features of the ensemble model are adaptable to existing image recognition systems, facilitating deployment and application.
[0356] Optionally, in the above Figure 17 Based on the corresponding embodiments, in another embodiment of the image recognition device 40 provided in this application,
[0357] The recognition module 430 is specifically used to respond to an image recognition request and obtain the feature vector to be matched corresponding to the target information, wherein the image recognition request carries the target information;
[0358] Determine the feature similarity based on the target feature vector and the feature vector to be matched;
[0359] If the feature similarity is less than or equal to the similarity threshold, the target image is considered to have been successfully identified.
[0360] or,
[0361] The recognition module 430 is specifically used to calculate the similarity between the target feature vector and each feature vector in the database;
[0362] Based on the similarity calculation results, the feature vector with the highest similarity to the target feature vector is determined from the database, and the recognition result of the target image is determined based on the feature vector.
[0363] This application provides an image recognition device. Using this device, tasks such as identity verification, image matching, and image retrieval can be performed based on the feature vectors of an image, thereby improving the application versatility of the solution.
[0364] This application provides a model training device and an image recognition device, which can be deployed on a server. Please refer to [link / reference]. Figure 18 , Figure 18 This is a schematic diagram of a server structure provided in an embodiment of this application. The server 500 can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 522 (e.g., one or more processors) and memory 532, and one or more storage media 530 (e.g., one or more mass storage devices) for storing application programs 542 or data 544. The memory 532 and storage media 530 can be temporary or persistent storage. The program stored in the storage media 530 may include one or more modules (not shown in the diagram), each module may include a series of instruction operations on the server. Furthermore, the CPU 522 may be configured to communicate with the storage media 530 and execute the series of instruction operations in the storage media 530 on the server 500.
[0365] Server 500 may also include one or more power supplies 526, one or more wired or wireless network interfaces 550, one or more input / output interfaces 558, and / or one or more operating systems 541, such as Windows Server. TM Mac OS X TM Unix TM Linux TM FreeBSD TM etc.
[0366] The steps performed by the server in the above embodiments can be based on this Figure 18 The server structure shown.
[0367] This application provides a model training device and an image recognition device, which can be deployed on a terminal. Please refer to... Figure 19This application also provides a terminal, such as... Figure 19 As shown, for ease of explanation, only the parts related to the embodiments of this application are shown. For specific technical details not disclosed, please refer to the method section of the embodiments of this application. In the embodiments of this application, a smartphone is used as an example for illustration:
[0368] Figure 19 This is a block diagram illustrating a portion of the structure of a smartphone related to the terminal provided in the embodiments of this application. (Reference) Figure 19 The smartphone includes components such as a radio frequency (RF) circuit 610, a memory 620, an input unit 630, a display unit 640, a sensor 650, an audio circuit 660, a wireless fidelity (WiFi) module 670, a processor 680, and a power supply 690. Those skilled in the art will understand that... Figure 19 The smartphone structure shown does not constitute a limitation on smartphones and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0369] The following is combined Figure 19 A detailed introduction to the various components of a smartphone:
[0370] RF circuit 610 can be used for receiving and transmitting signals during information transmission or calls. Specifically, it receives downlink information from the base station and processes it with processor 680; additionally, it transmits uplink data to the base station. Typically, RF circuit 610 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low-noise amplifier (LNA), a duplexer, etc. Furthermore, RF circuit 610 can also communicate wirelessly with networks and other devices. The aforementioned wireless communication can use any communication standard or protocol, including but not limited to Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Message Service (SMS), etc.
[0371] The memory 620 can be used to store software programs and modules. The processor 680 executes various functions and data processing of the smartphone by running the software programs and modules stored in the memory 620. The memory 620 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, applications required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created based on the use of the smartphone (such as audio data, phonebook, etc.). In addition, the memory 620 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0372] The input unit 630 can be used to receive input numerical or character information, and to generate key signal inputs related to user settings and function control of the smartphone. Specifically, the input unit 630 may include a touch panel 631 and other input devices 632. The touch panel 631, also known as a touch screen, can collect touch operations performed by the user on or near it (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near the touch panel 631), and drive the corresponding connected devices according to a pre-set program. Optionally, the touch panel 631 may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch position and the signal generated by the touch operation, and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends it to the processor 680, and can also receive and execute commands sent by the processor 680. In addition, the touch panel 631 can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 631, the input unit 630 may also include other input devices 632. Specifically, other input devices 632 may include, but are not limited to, one or more of the following: a physical keyboard, function keys (such as volume control buttons, power buttons, etc.), a mouse, and a joystick.
[0373] The display unit 640 can be used to display information input by the user or information provided to the user, as well as various menus of the smartphone. The display unit 640 may include a display panel 641, optionally configured as a liquid crystal display (LCD), organic light-emitting diode (OLED), or similar form. Further, a touch panel 631 may cover the display panel 641. When the touch panel 631 detects a touch operation on or near it, it transmits the information to the processor 680 to determine the type of touch event. Subsequently, the processor 680 provides corresponding visual output on the display panel 641 based on the type of touch event. Although in Figure 19 In this embodiment, the touch panel 631 and the display panel 641 are two separate components to realize the input and output functions of the smartphone. However, in some embodiments, the touch panel 631 and the display panel 641 can be integrated to realize the input and output functions of the smartphone.
[0374] The smartphone may also include at least one sensor 650, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 641 according to the ambient light level, and the proximity sensor can turn off the display panel 641 and / or backlight when the smartphone is moved to the ear. As a type of motion sensor, an accelerometer sensor can detect the magnitude of acceleration in various directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that recognize the smartphone's posture (such as landscape / portrait switching, related games, magnetometer posture calibration), vibration recognition-related functions (such as pedometer, tapping), etc. Other sensors that may be configured in the smartphone, such as gyroscopes, barometers, hygrometers, thermometers, and infrared sensors, will not be described in detail here.
[0375] Audio circuit 660, speaker 661, and microphone 662 provide an audio interface between the user and the smartphone. Audio circuit 660 converts received audio data into electrical signals and transmits them to speaker 661, where speaker 661 converts them into sound signals for output. On the other hand, microphone 662 converts collected sound signals into electrical signals, which are received by audio circuit 660, converted into audio data, and then processed by processor 680 before being transmitted via RF circuit 610 to, for example, another smartphone, or the audio data can be output to memory 620 for further processing.
[0376] WiFi is a short-range wireless transmission technology. Smartphones, through their WiFi module 670, can help users send and receive emails, browse web pages, and access streaming media, providing wireless broadband internet access. Although Figure 19 WiFi module 670 is shown, but it is understood that it is not an essential component of a smartphone and can be omitted as needed without changing the nature of the invention.
[0377] The processor 680 is the control center of the smartphone, connecting various parts of the smartphone through various interfaces and lines. It performs various functions and processes data by running or executing software programs and / or modules stored in the memory 620, and by calling data stored in the memory 620. Optionally, the processor 680 may include one or more processing units; optionally, the processor 680 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the aforementioned modem processor may also not be integrated into the processor 680.
[0378] The smartphone also includes a power supply 690 (such as a battery) that powers various components. Optionally, the power supply can be logically connected to the processor 680 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system.
[0379] Although not shown, smartphones may also include a camera, Bluetooth module, etc., which will not be described in detail here.
[0380] The steps performed by the terminal in the above embodiments can be based on this Figure 19 The terminal structure shown.
[0381] This application also provides a computer device, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the steps of the methods described in the foregoing embodiments.
[0382] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the methods described in the foregoing embodiments.
[0383] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the methods described in the foregoing embodiments.
[0384] It is understood that in the specific embodiments of this application, data such as user information and facial images are involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0385] Those skilled in the art will clearly 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.
[0386] 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 an indirect coupling or communication connection between apparatuses or units through some interfaces, and may be electrical, mechanical, or other forms.
[0387] 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.
[0388] Furthermore, 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. The integrated unit can be implemented in hardware or as a software functional unit.
[0389] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it 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 all or part 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.
[0390] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A model training method based on ensemble learning, characterized in that, include: Obtain T sets of image samples, wherein each set of image samples includes at least one image sample, each image sample corresponds to a category label, and T is an integer greater than 1; Based on the category label corresponding to each image sample in each image sample set, obtain T sets of class center vectors for the T sets of image samples, wherein the set of class center vectors corresponds to the image sample set, and image samples with the same category label have the same class center vector; Based on the T sets of image samples, T sets of feature vectors are obtained through T complementary models to be trained, wherein each complementary model to be trained is used to extract a set of feature vectors, and the set of feature vectors has a corresponding relationship with the set of image samples; Based on the T feature vector sets and the T class center vector sets, the model parameters of the T complementary models to be trained are updated until the T complementary models to be trained meet the model training conditions, thereby obtaining an integrated model for image recognition. The integrated model includes T complementary models, and the complementary models have a corresponding relationship with the complementary models to be trained. Before obtaining the set of T class center vectors for the T sets of image samples based on the category label corresponding to each image sample in each set of image samples, the method further includes: Obtain a first image sample set, wherein the first image sample set includes P image samples, each image sample corresponds to a category label, and P is an integer greater than or equal to 1; Based on the category label corresponding to each image sample in the first image sample set, obtain P class center vectors; Based on the first image sample set, P feature vectors are obtained through the basic model to be trained, wherein the feature vectors in the P feature vectors have a corresponding relationship with the image samples in the P image samples; The model parameters and class center vectors of the base model to be trained are updated based on the P feature vectors and the P class center vectors. The step of updating the model parameters and class center vectors of the base model to be trained based on the P feature vectors and the P class center vectors includes: For each image sample in the first image sample set, the cosine value corresponding to the image sample is calculated based on the feature vector and class center vector corresponding to the image sample. The gradient is determined using a first loss function based on the distribution radius of the image feature space and the cosine value corresponding to each image sample in the first image sample set; the distribution radius of the image feature space is the distance of the image sample from the class center in the class center vector corresponding to the class label; The gradient is used to update the model parameters of the base model to be trained and the class center vectors of each class.
2. The model training method according to claim 1, characterized in that, The step of obtaining T class center vector sets for the T sets of image samples based on the category label corresponding to each image sample in each set of image samples includes: For each image sample in each image sample set, the class center vector corresponding to the image sample is obtained based on the category label corresponding to the image sample through the class center mapping relationship, wherein the class center mapping relationship includes the mapping relationship between the category label and the class center vector.
3. The model training method according to claim 1, characterized in that, The step of updating the model parameters and class center vectors of the base model to be trained based on the P feature vectors and the P class center vectors further includes: For each image sample in the first image sample set, the cosine value corresponding to the image sample is calculated based on the feature vector and class center vector corresponding to the image sample. The gradient is determined using a second loss function based on the first interval value, the second interval value, the distribution radius of the image feature space, and the cosine value corresponding to each image sample in the first image sample set; the first interval value is the interval value in the angle space between the feature vector and the class center vector, and the second interval value is the interval value in the cosine value space. The gradient is used to update the model parameters of the base model to be trained and the class center vectors of each class.
4. The model training method according to claim 1, characterized in that, The process of obtaining an ensemble model until the T complementary models to be trained meet the model training conditions includes: When the T complementary models to be trained meet the model training conditions, the T complementary models are obtained. When the base model to be trained meets the model training conditions, the base model is obtained; The basic model and the T complementary models are used as the integrated model.
5. The model training method according to claim 1, characterized in that, The step of updating the model parameters of the T complementary models to be trained based on the T feature vector sets and the T class center vector sets includes: For each of the T complementary models to be trained, the cosine value corresponding to each image sample in the image sample set is calculated based on the feature vector and class center vector corresponding to each image sample in the image sample set. The initial model parameters of each complementary model to be trained are randomly generated. For each of the T complementary models to be trained, the gradient for the complementary model to be trained is determined by the first loss function based on the distribution radius of the image feature space and the cosine value corresponding to each image sample in the image sample set. For each of the T complementary models to be trained, the model parameters of the complementary model to be trained are updated using the gradient of the complementary model to be trained.
6. The model training method according to claim 1, characterized in that, The step of updating the model parameters of the T complementary models to be trained based on the T feature vector sets and the T class center vector sets includes: For each of the T complementary models to be trained, the cosine value corresponding to each image sample in the image sample set is calculated based on the feature vector and class center vector corresponding to each image sample in the image sample set. The initial model parameters of each complementary model to be trained are randomly generated. For each of the T complementary models to be trained, the gradient for the complementary model to be trained is determined using the second loss function based on the first interval value, the second interval value, the distribution radius of the image feature space, and the cosine value corresponding to each image sample in the image sample set. For each of the T complementary models to be trained, the model parameters of the complementary model to be trained are updated using the gradient of the complementary model to be trained.
7. The model training method according to any one of claims 1 to 6, characterized in that, After the T complementary models to be trained satisfy the model training conditions and an ensemble model is obtained, the method further includes: Obtain a second image sample set, wherein the second image sample set includes K image samples, each image sample corresponding to a category label, and K is an integer greater than or equal to 1; Based on the category label corresponding to each image sample in the second image sample set, obtain K class center vectors; Based on the second image sample set, K feature matrices are obtained through the ensemble model, wherein the feature matrices correspond to the image samples in the K image samples; Based on the K feature matrices, K feature vectors are obtained through the fusion model to be trained, wherein the feature vectors in the K feature vectors have a corresponding relationship with the image samples in the second image sample set; Based on the K feature vectors and the K class center vectors, the model parameters of the fusion model to be trained and the class center vectors are updated until the model training conditions are met, and the fusion model is obtained.
8. The model training method according to claim 7, characterized in that, The step of updating the model parameters of the fusion model to be trained and the class center vectors based on the K feature vectors and the K class center vectors includes: For each image sample in the second image sample set, the cosine value corresponding to the image sample is calculated based on the feature vector and class center vector corresponding to the image sample. The gradient is determined using the first loss function based on the distribution radius of the image feature space and the cosine value corresponding to each image sample in the second image sample set. The gradient is used to update the model parameters and class center vectors of the fusion model to be trained.
9. The model training method according to claim 7, characterized in that, The step of updating the model parameters of the fusion model to be trained and the class center vectors based on the K feature vectors and the K class center vectors includes: For each image sample in the second image sample set, the cosine value corresponding to the image sample is calculated based on the feature vector and class center vector corresponding to the image sample. The gradient is determined using the second loss function based on the first interval value, the second interval value, the distribution radius of the image feature space, and the cosine value corresponding to each image sample in the second image sample set. The gradient is used to update the model parameters and class center vectors of the fusion model to be trained.
10. A method for image recognition, characterized in that, include: Acquire the target image; Based on the target image, R feature vectors are obtained through an ensemble model, wherein the ensemble model includes R sub-models, the R sub-models include T complementary models, or the R sub-models include the T complementary models and a base model, the ensemble model is trained using the model training method of any one of claims 1 to 9, R is an integer greater than 1, and T is an integer greater than 1 and less than or equal to R. Based on the R feature vectors, generate the target feature vector of the target image; The target image is identified based on the target feature vector to obtain the image recognition result.
11. The method according to claim 10, characterized in that, The step of generating the target feature vector of the target image based on the R feature vectors includes: The target feature vector of the target image is obtained by averaging the R feature vectors.
12. The method according to claim 10, characterized in that, The step of generating the target feature vector of the target image based on the R feature vectors includes: Use the R feature vectors as the target feature matrix; Based on the target feature matrix, the target feature vector of the target image is obtained through a fusion model.
13. The method according to any one of claims 10 to 12, characterized in that, The step of recognizing the target image based on the target feature vector to obtain the image recognition result includes: In response to an image recognition request, a feature vector to be matched corresponding to the target information is obtained, wherein the image recognition request carries the target information; The feature similarity is determined based on the target feature vector and the feature vector to be matched; If the feature similarity is less than or equal to the similarity threshold, then the target image is determined to have been successfully identified. or, The step of recognizing the target image based on the target feature vector to obtain the image recognition result includes: The similarity between the target feature vector and each feature vector in the database is calculated. Based on the similarity calculation results, the feature vector with the highest similarity to the target feature vector is determined from the database, and the recognition result of the target image is determined based on the feature vector.
14. A model training device, characterized in that, include: The acquisition module is used to acquire T sets of image samples, wherein each set of image samples includes at least one image sample, each image sample corresponds to a category label, and T is an integer greater than 1; The acquisition module is further configured to acquire T sets of class center vectors for the T sets of image samples based on the category label corresponding to each image sample in each set of image samples, wherein the set of class center vectors corresponds to the set of image samples, and image samples with the same category label have the same class center vector. The acquisition module is further configured to acquire T feature vector sets based on the T sets of image samples using T complementary models to be trained, wherein each complementary model to be trained is used to extract a feature vector set, and the feature vector set has a corresponding relationship with the image sample set; The training module is used to update the model parameters of the T complementary models to be trained according to the T feature vector sets and the T class center vector sets, until the T complementary models to be trained meet the model training conditions, thereby obtaining an integrated model for image recognition. The integrated model includes T complementary models, and the complementary models have a corresponding relationship with the complementary models to be trained. The acquisition module is further configured to acquire a first image sample set before acquiring the T class center vector sets for the T sets of image samples according to the category label corresponding to each image sample in each image sample set, wherein the first image sample set includes P image samples, each image sample corresponds to a category label, and P is an integer greater than or equal to 1; The acquisition module is further configured to acquire P class center vectors based on the category label corresponding to each image sample in the first image sample set; The acquisition module is further configured to acquire P feature vectors based on the first image sample set and through the basic model to be trained, wherein the feature vectors in the P feature vectors correspond to the image samples in the P image samples; The training module is also used to update the model parameters and class center vectors of the base model to be trained based on the P feature vectors and the P class center vectors. The training module is specifically used to calculate the cosine value corresponding to each image sample in the first image sample set, based on the feature vector and class center vector corresponding to the image sample. The gradient is determined using a first loss function based on the distribution radius of the image feature space and the cosine value corresponding to each image sample in the first image sample set; the distribution radius of the image feature space is the distance of the image sample from the class center in the class center vector corresponding to the class label; The gradient is used to update the model parameters of the base model to be trained and the class center vectors of each class.
15. The apparatus according to claim 14, characterized in that, The acquisition module is specifically used to obtain the class center vector corresponding to each image sample in each image sample set based on the category label corresponding to the image sample and through the class center mapping relationship, wherein the class center mapping relationship includes the mapping relationship between the category label and the class center vector.
16. The apparatus according to claim 14, characterized in that, The training module is further configured to calculate the cosine value corresponding to each image sample in the first image sample set, based on the feature vector and class center vector corresponding to the image sample. The gradient is determined using a second loss function based on the first interval value, the second interval value, the distribution radius of the image feature space, and the cosine value corresponding to each image sample in the first image sample set; the first interval value is the interval value in the angle space between the feature vector and the class center vector, and the second interval value is the interval value in the cosine value space. The gradient is used to update the model parameters of the base model to be trained and the class center vectors of each class.
17. The apparatus according to claim 14, characterized in that, The training module is specifically used to obtain the T complementary models when the T complementary models to be trained meet the model training conditions. When the base model to be trained meets the model training conditions, the base model is obtained; The basic model and the T complementary models are used as the integrated model.
18. The apparatus according to claim 14, characterized in that, The training module is specifically used to calculate the cosine value of each image sample in the image sample set for each of the T complementary models to be trained, based on the feature vector and class center vector corresponding to each image sample in the image sample set. The initial model parameters of each complementary model to be trained are randomly generated. For each of the T complementary models to be trained, the gradient for the complementary model to be trained is determined by the first loss function based on the distribution radius of the image feature space and the cosine value corresponding to each image sample in the image sample set. For each of the T complementary models to be trained, the model parameters of the complementary model to be trained are updated using the gradient of the complementary model to be trained.
19. The apparatus according to claim 14, characterized in that, The training module is specifically used to calculate the cosine value of each image sample in the image sample set for each of the T complementary models to be trained, based on the feature vector and class center vector corresponding to each image sample in the image sample set. The initial model parameters of each complementary model to be trained are randomly generated. For each of the T complementary models to be trained, the gradient for the complementary model to be trained is determined using the second loss function based on the first interval value, the second interval value, the distribution radius of the image feature space, and the cosine value corresponding to each image sample in the image sample set. For each of the T complementary models to be trained, the model parameters of the complementary model to be trained are updated using the gradient of the complementary model to be trained.
20. The apparatus according to any one of claims 14-19, characterized in that, The acquisition module is further configured to acquire a second image sample set after the T complementary models to be trained meet the model training conditions and the ensemble model is obtained, wherein the second image sample set includes K image samples, each image sample corresponds to a category label, and K is an integer greater than or equal to 1; The acquisition module is further configured to acquire K class center vectors based on the category label corresponding to each image sample in the second image sample set; The acquisition module is further configured to acquire K feature matrices based on the second image sample set through the ensemble model, wherein the feature matrices correspond to the image samples in the K image samples; The acquisition module is further configured to acquire K feature vectors based on the K feature matrices through a fusion model to be trained, wherein the feature vectors among the K feature vectors correspond to the image samples in the second image sample set; The training module is further configured to update the model parameters of the fusion model to be trained and the class center vectors based on the K feature vectors and the K class center vectors, until the model training conditions are met, and thus obtain the fusion model.
21. The apparatus according to claim 20, characterized in that, The training module is specifically used to calculate the cosine value corresponding to each image sample in the second image sample set, based on the feature vector and class center vector corresponding to the image sample. The gradient is determined using the first loss function based on the distribution radius of the image feature space and the cosine value corresponding to each image sample in the second image sample set. The gradient is used to update the model parameters and class center vectors of the fusion model to be trained.
22. The apparatus according to claim 20, characterized in that, The training module is specifically used to calculate the cosine value corresponding to each image sample in the second image sample set, based on the feature vector and class center vector corresponding to the image sample. The gradient is determined using the second loss function based on the first interval value, the second interval value, the distribution radius of the image feature space, and the cosine value corresponding to each image sample in the second image sample set. The gradient is used to update the model parameters and class center vectors of the fusion model to be trained.
23. An image recognition device, characterized in that, include: The acquisition module is used to acquire the target image; The acquisition module is further configured to acquire R feature vectors based on the target image through an ensemble model, wherein the ensemble model includes R sub-models, the R sub-models include T complementary models, or the R sub-models include the T complementary models and a base model, the ensemble model is trained using the model training method of any one of claims 1 to 9, R is an integer greater than 1, and T is an integer greater than 1 and less than or equal to R; The generation module is used to generate a target feature vector of the target image based on the R feature vectors; The recognition module is used to recognize the target image based on the target feature vector to obtain the image recognition result.
24. The apparatus according to claim 23, characterized in that, The generation module is specifically used to average the R feature vectors to obtain the target feature vector of the target image.
25. The apparatus according to claim 23, characterized in that, The generation module is specifically used to take the R feature vectors as the target feature matrix; Based on the target feature matrix, the target feature vector of the target image is obtained through a fusion model.
26. The apparatus according to any one of claims 23-25, characterized in that, The recognition module is specifically used to respond to an image recognition request and obtain the feature vector to be matched corresponding to the target information, wherein the image recognition request carries the target information; The feature similarity is determined based on the target feature vector and the feature vector to be matched; If the feature similarity is less than or equal to the similarity threshold, then the target image is determined to have been successfully identified. or, The identification module is specifically used to calculate the similarity between the target feature vector and each feature vector in the database. Based on the similarity calculation results, the feature vector with the highest similarity to the target feature vector is determined from the database, and the recognition result of the target image is determined based on the feature vector.
27. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the model training method according to any one of claims 1 to 9, or, when executing the computer program, it implements the steps of the method according to any one of claims 10 to 13.
28. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the model training method according to any one of claims 1 to 9, or, when executed, implements the steps of the method according to any one of claims 10 to 13.
29. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the steps of the model training method according to any one of claims 1 to 9, or, when executed, implements the steps of the method according to any one of claims 10 to 13.
Citation Information
Patent Citations
Training method of image target recognition model and image recognition method and device
CN111598190A
Multi-model integration method and system
CN111652238A