Method, apparatus, computing device, and storage medium for ai model update
By obtaining the differences between the inference dataset and the training dataset, and using the inference dataset to update the AI model, the problem of reduced accuracy of the AI model when the data distribution changes is solved, and the model is updated efficiently and its accuracy is improved in dynamic scenarios.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
- Filing Date
- 2020-07-27
- Publication Date
- 2026-07-10
AI Technical Summary
Existing AI models suffer from reduced accuracy and untimely updates when data distribution varies significantly, making it impossible to maintain stable accuracy in dynamically changing real-world application scenarios.
By acquiring the inference dataset, we determine its distributional differences from the training dataset, and use the inference dataset to update the existing AI model, including offline and online update methods, optimize the feature extraction part, and construct the target dataset to improve model accuracy.
It enables timely updates to the AI model when data distribution changes, improving inference accuracy and ensuring stable performance of the model in dynamic scenarios.
Smart Images

Figure CN114004328B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence (AI) technology, and in particular to a method, apparatus, computing device, and storage medium for updating an AI model. Background Technology
[0002] With the development of artificial intelligence technology, AI models are being applied more and more widely. Currently, AI models primarily use machine learning algorithms to learn their parameters from large amounts of data. Because AI models are acquired through learning from vast amounts of data, while they possess a certain generalization ability, their performance is affected and accuracy decreases when the data distribution in the application scenario differs significantly from the distribution of the training data. The greater the distribution difference, the more significant the accuracy reduction. However, the actual application environment of AI models is dynamic. Therefore, in real-world application scenarios, the data distribution may constantly change, potentially causing the AI model to lose stable accuracy under changing application conditions. To enable the accuracy of AI models to adapt to changes in the scenario, adaptive updates to the AI model are necessary.
[0003] In related technologies, an AI platform has been developed, allowing users to update their models independently. Specifically, the AI platform provides the necessary functions from training to deploying the AI model, typically including data annotation, data management, model training, and model inference. Users can train their AI models through the platform. If, later, the user determines that the current AI model is unsuitable for the current scenario, they can provide the dataset for that scenario to update the AI model, making it more appropriate for the current environment. The updated AI model can then be applied to the current scenario.
[0004] Because the AI model update method of related technologies can only update the AI model after the user perceives that the accuracy of the AI model has decreased in the current scenario, it will lead to untimely AI model updates. Summary of the Invention
[0005] This application provides a method, apparatus, computing device, and storage medium for updating AI models in a timely manner.
[0006] In a first aspect, this application provides a method for updating an AI model, the method comprising: obtaining an inference dataset, wherein inference data in the inference dataset is used as input to an existing AI model to perform inference; determining that the data distribution of the inference dataset differs from the data distribution of the training dataset, wherein the training dataset is the dataset used to train the existing AI model; and updating the existing AI model using the inference dataset to obtain an updated AI model.
[0007] The solution presented in this application allows the AI model to be updated by an AI platform. Since the above method updates the existing AI model when there is a difference between the data distribution of the inference dataset and the data distribution of the training dataset, instead of waiting until the user perceives a decrease in the accuracy of the AI model before updating it, the AI model can be updated more promptly.
[0008] In one possible implementation, an existing AI model is deployed on an inference platform. The method further includes: comparing the inference accuracy of the updated AI model and the existing AI model to determine that the inference accuracy of the updated AI model is superior to that of the existing AI model; and deploying the updated AI model to the inference platform to perform inference in place of the existing AI model.
[0009] The solution presented in this application allows existing AI models to be deployed on an inference platform, which can be part of or independent of the AI platform. The AI platform obtains the inference accuracy of both the updated AI model and the existing AI model, then compares their inference accuracies. If the updated AI model's inference accuracy is superior to the existing AI model's, the updated AI model is deployed to the inference platform, where it replaces the existing AI model for inference. This approach ensures that the existing AI model is only updated when its inference accuracy is higher, resulting in higher inference accuracy.
[0010] In one possible implementation, before deploying the updated AI model to the inference platform, the method further includes: displaying the inference accuracy of the existing AI model and the inference accuracy of the updated AI model through a display interface; and receiving user instructions to update the existing AI model.
[0011] The solution presented in this application allows the AI platform to display the inference accuracy of both the existing AI model and the updated AI model on a user interface before deploying the updated AI model to the inference platform. Users can then choose whether to update the existing AI model. Upon receiving an update command from the user, the AI platform can deploy the updated AI model to the inference platform. This allows users to decide whether to deploy the updated AI model, thus improving the user experience.
[0012] In one possible implementation, the existing AI model is updated using the inference dataset, including: if the discrepancy meets the offline update criteria, the existing AI model is updated offline using the inference dataset; if the discrepancy does not meet the offline update criteria, the existing AI model is updated online using the inference dataset.
[0013] The solution presented in this application allows the AI platform to determine whether the difference between the data distribution of the inference dataset and the data distribution of the training dataset satisfies the offline update condition. If the difference satisfies the offline update condition, the AI platform can use the inference dataset to update the existing AI model offline. If the difference does not satisfy the offline update condition, the AI platform can use the inference dataset to update the existing AI model online. Thus, because different update methods can be selected based on the different differences, update time can be saved.
[0014] In one possible implementation, an existing AI model is updated online using an inference dataset. This includes: determining the parameter changes of the target part of the existing AI model by utilizing the differences between the data distribution of the inference dataset and the data distribution of the training dataset; and determining the parameters of the target part in the updated AI model based on the current parameters and parameter changes of the target part in the existing AI model. In this way, during online updates, only the parameters of certain parts of the AI model need to be updated to achieve the goal of updating the existing AI model online.
[0015] In one possible implementation, an existing AI model is updated using an inference dataset, including: constructing a target dataset based on the inference dataset; and updating the existing AI model using the target dataset.
[0016] In one possible implementation, constructing a target dataset based on the inference dataset includes: obtaining target data that meets the sample conditions from the inference dataset, displaying the target data through a display interface; obtaining the user's annotation results for the target data; and constructing the target dataset based on the target data and the annotation results for the target data.
[0017] The solution presented in this application allows the AI platform to select target data that meets the sample conditions from the inference dataset and display it to the user, enabling the user to annotate the target data. Based on the user's annotations and the target data, the AI platform can construct a target dataset. Thus, because the constructed target dataset includes user-annotated target data that meets the sample conditions when updating an existing AI model, the updated AI model can be more suitable for inference on the inference dataset.
[0018] In one possible implementation, obtaining target data that satisfies the sample conditions from the inference dataset includes: based on the difference between the data distribution of the inference dataset and the data distribution of the training dataset, obtaining target data that satisfies the sample conditions from the inference dataset, wherein the target data is suitable for updating the existing AI model. In this way, based on the difference between the data distribution of the inference dataset and the data distribution of the training dataset, the target data can be made more suitable for updating the existing AI model.
[0019] In one possible implementation, the target dataset also includes sampled and / or generated labeled data suitable for the data distribution of the inference dataset, which includes data from the training dataset. This allows for the acquisition of labeled data with a suitable data distribution for the inference dataset from existing labeled data, resulting in a larger amount of labeled data in the target dataset and consequently, higher inference accuracy for the updated AI model.
[0020] In one possible implementation, the target dataset includes unlabeled and labeled data with a data distribution suitable for the inference dataset. Updating an existing AI model using the target dataset involves: optimizing the feature extraction portion of the existing AI model using unsupervised methods with the unlabeled data in the target dataset; and updating the existing AI model based on the optimized feature extraction portion and the labeled data in the target dataset. This allows for the optimization of the feature extraction portion of the AI model before updating the existing AI model.
[0021] In one possible implementation, the target dataset includes unlabeled data and labeled data with a data distribution suitable for the inference dataset. Updating an existing AI model using the target dataset involves: using the existing AI model to label the unlabeled data in the target dataset, obtaining labeling results for the unlabeled data; and updating the existing AI model based on the labeling results of the unlabeled data and the labeled data in the target dataset. This approach, because unlabeled data in the target dataset can be labeled, results in a larger amount of labeled data in the target dataset, leading to higher inference accuracy in the updated AI model.
[0022] In one possible implementation, updating an existing AI model using a target dataset includes: obtaining a strategy for updating the existing AI model based on the data characteristics of the data in the target dataset; and updating the existing AI model according to the strategy. In this way, because the data characteristics of the data in the target dataset can be used to select a strategy for updating the existing AI model, the efficiency of updating the existing AI model can be improved, and the inference accuracy of the updated AI model can be increased.
[0023] In one possible implementation, the method further includes: obtaining the update cycle of the AI model input by the user; determining that there is a difference between the data distribution of the inference dataset and the data distribution of the training dataset, including: determining the difference between the data distribution of the inference dataset and the data distribution of the training dataset based on the update cycle of the AI model. In this way, the user can determine the update cycle of the AI model and execute the AI model update process when that update cycle is reached.
[0024] Secondly, this application provides an apparatus for updating an artificial intelligence (AI) model. The apparatus includes: an acquisition module for acquiring an inference dataset, wherein the inference data in the inference dataset is used as input to an existing AI model for inference; a determination module for determining that there is a difference between the data distribution of the inference dataset and the data distribution of the training dataset, wherein the training dataset is the dataset used to train the existing AI model; and an update module for updating the existing AI model using the inference dataset to obtain an updated AI model. Thus, because the existing AI model is updated when there is a difference between the data distribution of the inference dataset and the data distribution of the training dataset, rather than waiting until the user perceives a decrease in the accuracy of the AI model before updating it, timely updates to the AI model are possible.
[0025] In one possible implementation, the existing AI model is deployed on an inference platform. The determining module is further configured to compare the inference accuracy of the updated AI model and the existing AI model, determining that the inference accuracy of the updated AI model is superior to that of the existing AI model. The updating module is further configured to deploy the updated AI model to the inference platform, allowing the updated AI model to perform inference in place of the existing AI model. Thus, the existing AI model is only updated when the inference accuracy of the updated AI model is superior, resulting in higher inference accuracy.
[0026] In one possible implementation, the device further includes: a display module, used to display the inference accuracy of the existing AI model and the inference accuracy of the updated AI model through a display interface before deploying the updated AI model to the inference platform; the device further includes: a receiving module, used to receive user update instructions for the existing AI model. This allows users to decide whether to deploy the updated AI model, thus improving the user experience.
[0027] In one possible implementation, the update module is configured to: if the difference meets the offline update condition, then update the existing AI model offline using the inference dataset; if the difference does not meet the offline update condition, then update the existing AI model online using the inference dataset. In this way, different update methods can be selected based on the different differences, thus saving update time.
[0028] In one possible implementation, the update module is configured to: determine the parameter changes of the target part of the existing AI model by utilizing the difference between the data distribution of the inference dataset and the data distribution of the training dataset; and determine the parameters of the target part in the updated AI model based on the current parameters of the target part in the existing AI model and the parameter changes. Thus, during online updates, only the parameters of certain parts of the AI model need to be updated to achieve online updates of the existing AI model.
[0029] In one possible implementation, the update module is used to construct a target dataset based on the inference dataset; and to update the existing AI model using the target dataset.
[0030] In one possible implementation, the update module is configured to: obtain target data that meets the sample conditions from the inference dataset; display the target data through a display interface; obtain the user's annotation results for the target data; and construct a target dataset based on the target data and the annotation results for the target data. Thus, since the constructed target dataset includes user-annotated target data that meets the sample conditions when updating an existing AI model, the updated AI model can be more suitable for inference on the inference dataset.
[0031] In one possible implementation, the update module is configured to: based on the difference between the data distribution of the inference dataset and the data distribution of the training dataset, obtain target data that meets the sample conditions in the inference dataset, wherein the target data is suitable for updating the existing AI model. This allows for more accurate selection of target data that meets the sample conditions.
[0032] In one possible implementation, the target dataset further includes sampled and / or generated labeled data suitable for the data distribution of the inference dataset from the current labeled data, wherein the current labeled data includes data from the training dataset.
[0033] In one possible implementation, the target dataset includes unlabeled data and labeled data with a data distribution suitable for the inference dataset; the update module is configured to: optimize the feature extraction part of the existing AI model using an unsupervised method based on the unlabeled data in the target dataset; and update the existing AI model based on the optimized feature extraction part and the labeled data in the target dataset. This allows for the optimization of the feature extraction part of the AI model first, followed by updating the existing AI model.
[0034] In one possible implementation, the target dataset includes unlabeled data and labeled data with a data distribution suitable for the inference dataset. The update module is configured to: use the existing AI model to label the unlabeled data in the target dataset to obtain a labeling result for the unlabeled data; and update the existing AI model based on the labeling result of the unlabeled data and the labeled data in the target dataset. In this way, because the unlabeled data in the target dataset can be labeled, the amount of labeled data in the target dataset can be relatively large, thus resulting in higher inference accuracy for the updated AI model.
[0035] In one possible implementation, the update module is configured to: obtain a strategy for updating the existing AI model based on the data characteristics of the data in the target dataset; and update the existing AI model according to the strategy. In this way, since the data characteristics of the data in the target dataset can be used to select a strategy for updating the existing AI model, the efficiency of updating the existing AI model can be improved, and the inference accuracy of the updated AI model can be increased.
[0036] In one possible implementation, the acquisition module is also used to acquire the update cycle of the AI model input by the user;
[0037] The determining module is used to determine, based on the update cycle of the AI model, whether there is a difference between the data distribution of the inference dataset and the data distribution of the training dataset.
[0038] Thirdly, a computing device for updating an AI model is provided, the computing device including a processor and a memory, wherein: the memory stores computer instructions, and the processor executes the computer instructions to implement the method of the first aspect and its possible implementations.
[0039] Fourthly, a computer-readable storage medium is provided, which stores computer instructions that, when executed by a computing device, cause the computing device to perform the method of the first aspect and its possible implementations, or cause the computing device to perform the function of the apparatus of the second aspect and its possible implementations.
[0040] Fifthly, a computer program product containing instructions is provided, which, when run on a computing device, causes the computing device to perform the method of the first aspect and its possible implementations, or causes the computing device to perform the function of the apparatus of the second aspect and its possible implementations. Attached Figure Description
[0041] Figure 1 This application provides a schematic diagram of the structure of an AI platform 100 according to an embodiment of the present application.
[0042] Figure 2 This application provides an illustration of an application scenario for an AI platform 100.
[0043] Figure 3 A deployment diagram of an AI platform 100 provided for an embodiment of this application;
[0044] Figure 4 A schematic diagram of the structure of a computing device 400 for deploying an AI platform 100 is provided in an embodiment of this application;
[0045] Figure 5 This is a schematic diagram illustrating one possible operating mode provided in an embodiment of this application;
[0046] Figure 6 An AI model update logic diagram provided in this application embodiment;
[0047] Figure 7 A flowchart illustrating an AI model update method provided in an embodiment of this application;
[0048] Figure 8 A schematic diagram illustrating an AI model update without user intervention, provided as an embodiment of this application;
[0049] Figure 9 A schematic diagram illustrating a user-participatory AI model update provided in an embodiment of this application;
[0050] Figure 10 A flowchart illustrating an AI model update method provided in an embodiment of this application;
[0051] Figure 11 A schematic diagram illustrating an AI model update scenario provided in an embodiment of this application;
[0052] Figure 12 A schematic diagram illustrating another method for determining data distribution differences, provided in an embodiment of this application;
[0053] Figure 13 A schematic diagram of local parameters of an updated AI model provided in an embodiment of this application;
[0054] Figure 14 This is a schematic diagram illustrating the determination of target data provided in an embodiment of this application;
[0055] Figure 15 A schematic diagram of the structure of an AI model updating device provided in an embodiment of this application;
[0056] Figure 16 A schematic diagram of the structure of an AI model updating device provided in an embodiment of this application;
[0057] Figure 17 This is a schematic diagram of the structure of a computing device provided in an embodiment of this application. Detailed Implementation
[0058] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0059] Currently, the artificial intelligence (AI) boom continues, and machine learning is a core means of realizing AI. Machine learning is permeating various industries such as medicine, transportation, education, and finance. Not only professionals, but also non-AI professionals in various industries are looking forward to using AI and machine learning to complete specific tasks.
[0060] To facilitate understanding of the technical solutions and embodiments provided in this application, the concepts of AI model, AI model training, and AI platform are explained in detail below:
[0061] AI modelsAI (AI) models are mathematical algorithm models that use machine learning concepts to solve practical problems. AI models include numerous parameters and computational formulas (or rules). The parameters in an AI model are numerical values obtained by training the model on a training dataset. For example, AI model parameters are the weights of computational formulas or factors. AI models also contain hyperparameters, which guide the construction and training of the AI model. There are various types of hyperparameters, such as the number of training iterations, learning rate, batch size, number of layers, and number of neurons per layer. Hyperparameters can be obtained by training the AI model on a training dataset or they can be pre-defined parameters that are not updated during training on the training dataset.
[0062] AI models are diverse, with neural network models being one of the most widely used. Neural network models are mathematical algorithm models that mimic the structure and function of biological neural networks (the central nervous system of animals). A neural network model can include multiple neural network layers with different functions, each containing parameters and calculation formulas. Different layers in a neural network model have different names depending on their calculation formulas or functions. For example, the layer that performs convolution calculations is called a convolutional layer, which is often used for feature extraction from input signals (such as images). A neural network model can also be composed of a combination of multiple existing neural network models. Different neural network models can be used in different scenarios (such as classification and recognition) or provide different results when used in the same scenario. Differences in neural network model structure specifically include one or more of the following: different numbers of network layers, different order of network layers, and different weights, parameters, or calculation formulas in each network layer. The industry already has many different neural network models with high accuracy for applications such as recognition or classification. Some neural network models can be trained on specific training datasets and used alone to complete a task or combined with other neural network models (or other functional modules) to complete a task. Each AI model typically needs to be trained before it can be used to perform a task.
[0063] Training AI models,Supervised training refers to using existing samples (i.e., training datasets) to fit the patterns in those samples using certain methods, thereby determining the parameters of the AI model. For example, training an AI model for image classification or detection requires a training image set. Depending on whether the training images in the training image set are labeled (i.e., whether the images have a specific type or name), AI model training can be divided into supervised training and unsupervised training. In supervised training, the training images in the training image set are labeled. During training, the training images in the training image set are used as input to the AI model, and the corresponding labels are used as a reference for the AI model's output values. A loss function is used to calculate the loss between the AI model's output value and the corresponding labels of the training images, and the parameters of the AI model are adjusted based on the loss value. The AI model is trained iteratively using each training image in the training image set, and the parameters are continuously adjusted until the AI model can output values that are highly accurate and match the corresponding labels of the training images based on the input training images. Unsupervised training of AI models involves unlabeled training images in the training image set. These images are sequentially input into the AI model, which gradually identifies the relationships and latent rules between them until it can determine or identify the type or features of the input images. For example, in clustering, an AI model receiving a large number of training images can learn the features of each image and the relationships and differences between them, automatically classifying the images into multiple types. Different task types can use different AI models. Some AI models can only be trained using supervised learning, some only using unsupervised learning, and some using both methods. A trained AI model can then be used to complete a specific task. Generally, AI models in machine learning require supervised learning. Supervised training allows the AI model to more effectively learn the relationships between labeled training images and their corresponding labels, resulting in higher accuracy when predicting other input inference images.
[0064] Here's an example of training a neural network model for a data classification task using supervised learning: To train such a model, first, data is collected based on the task, constructing a training dataset containing three classes: apples, pears, and bananas. The collected training data is stored in three folders, each named after the label of the data within that folder. After constructing the training dataset, a suitable neural network model for data classification (such as a convolutional neural network (CNN)) is selected. The training data from the dataset is input into the CNN. The convolutional kernels of each layer in the CNN extract and classify features, finally outputting the confidence score of each data class. Based on the confidence score and the corresponding label, a loss function is used to calculate the loss value. The parameters of each layer in the CNN are then updated based on the loss value and the CNN structure. This training process continues until the loss function converges or all data in the training dataset has been used for training, at which point training ends.
[0065] loss function The loss function is used to measure the degree to which an AI model has been trained (i.e., to calculate the difference between the AI model's prediction and the true target). During AI model training, because we want the AI model's output to be as close as possible to the desired predicted value, we compare the current AI model's predicted value based on the input data with the actual target value (i.e., the labeled input data), and update the parameters of the AI model based on the difference between the two (of course, there is usually an initialization process before the first update, i.e., pre-configuring initial values for the AI model's parameters). Each training iteration uses the loss function to determine the difference between the current AI model's predicted value and the actual target value, updating the AI model's parameters accordingly, until the AI model can predict the actual target value or a value very close to the actual target value, at which point the AI model is considered to have completed training.
[0066] After training, the AI model can be used to infer data and obtain inference results. For example, in image classification, the specific inference process is as follows: the image is input into the AI model, the convolutional kernels of each layer in the AI model extract features from the image, and output the category to which the image belongs based on the extracted features. In object detection, the image is input into the AI model, the convolutional kernels of each layer in the AI model extract features from the image, and output the position and category of the bounding box of each object included in the image based on the extracted features. In scenarios covering both image classification and object detection, the image is input into the AI model, the convolutional kernels of each layer in the AI model extract features from the image, and output the category to which the image belongs, as well as the position and category of the bounding box of each object included in the image, based on the extracted features. It should be noted that some AI models have strong inference capabilities, while others have weaker inference capabilities. Strong inference capability means that when using the AI model to infer images, the accuracy of the inference result is greater than or equal to a certain value. The weak reasoning ability of AI models refers to the fact that when using AI models to reason about images, the accuracy of the reasoning results is lower than a certain value.
[0067] Data labeling Data labeling is the process of adding all labels to each unlabeled data point within a given context. For example, unlabeled data might consist of unlabeled images. In image classification, this involves adding a category to the unlabeled image; in object detection, it involves adding location information and a category to the objects within the unlabeled image. Alternatively, data labeling can also be the process of adding partial labels to one or more unlabeled data points within a given context. For instance, in object detection, only the objects within the unlabeled image might be categorized, without adding their location information.
[0068] AI PlatformThis platform provides AI developers and users with a convenient AI development environment and tools. It includes various built-in AI models or sub-models for solving different problems. The platform can build suitable AI models based on user input. Users simply define their needs within the platform, prepare their training dataset as prompted, and upload it. The platform then trains an AI model to meet those needs. For example, if a user needs an image classification model, the platform can select one from its stored models, update it using the training dataset, and obtain the desired model. Alternatively, users can prepare their own algorithm and training dataset, upload them to the platform, and the platform can train an AI model based on the user's algorithm and training dataset. Users can then use the trained AI model to complete their specific tasks.
[0069] It should be noted that the AI model mentioned above is a general term, and AI models include deep learning models, machine learning models, etc.
[0070] Figure 1 This is a schematic diagram of the structure of the AI platform 100 in the embodiments of this application. It should be understood that... Figure 1 This is merely an illustrative structural diagram of the AI platform 100, and this application does not limit the division of modules within the AI platform 100. Figure 1 As shown, the AI platform 100 includes a user input / output (I / O) module 101, a model training module 102, and an inference module 103. Optionally, the AI platform may also include an AI model storage module 104 and a data storage module 105.
[0071] The following is a brief description of the functions of each module in AI Platform 100:
[0072] User I / O module 101: This module receives inference datasets input by the user, or allows the user to establish a connection between the AI platform and the device that generates the inference data, and to obtain the inference dataset from the device. For example, the device generating the inference data could be a camera. User I / O module 101 also receives user-inputted or selected task targets, and receives the user's training dataset. Furthermore, it receives the user's annotation results for target data (samples adapted to the data distribution of the inference dataset) in the inference dataset, and obtains one or more labeled data from the user. User I / O module 101 also provides AI models to other users. As an example, user I / O module 101 can be implemented using a graphical user interface (GUI) or a command-line interface (CLI). For example, the GUI displays that the AI platform 100 can provide various AI services to the user (such as image classification, object detection, etc.). The user can select a task target on the GUI; for example, if the user selects image classification, the user can continue to upload multiple unlabeled images to the AI platform's GUI. After receiving the task objective and multiple unlabeled images, the GUI communicates with the model training module 102. The model training module 102 selects or searches for an initial AI model that can be used to complete the user's task objective based on the user's defined task objective.
[0073] Optionally, the user I / O module 101 can also be used to receive user input regarding the expected performance of the AI model in achieving the task objective. For example, inputting or selecting that the final AI model used for face recognition should achieve an accuracy rate higher than 99%.
[0074] Optionally, the user I / O module 101 can also be used to receive AI models, etc., input by the user. For example, the user can input an initial AI model in the GUI based on their task objectives. The user I / O module 101 can also be used to provide a variety of pre-built initial AI models for the user to choose from. For example, the user can select an initial AI model on the GUI according to their task objectives.
[0075] Optionally, when the AI model is applied to image classification or object detection scenarios, the user I / O module 101 can also be used to receive surface and deep features of unlabeled images in the inference dataset input by the user. In image classification scenarios, surface features include one or more of the following: image resolution, image aspect ratio, mean and variance of the red, green and blue (RGB) colors, image brightness, image saturation, or image sharpness. Deep features refer to the abstract features of the image extracted using convolutional kernels in a feature extraction model (such as CNN). In object detection scenarios, surface features include bounding box surface features and image surface features. Bounding box surface features can include one or more of the following: aspect ratio of each bounding box in a single frame, the proportion of each bounding box's area to the total image area, the marginalization degree of each bounding box, the stacking map of each bounding box, the brightness of each bounding box, or the blurriness of each bounding box. Image surface features can include one or more of the following: image resolution, aspect ratio, the mean and variance of the image's RGB values, brightness, saturation, sharpness, the number of boxes in a single frame, or the variance of the area of the boxes in a single frame. Deep features refer to the abstract features of the image extracted using convolutional kernels in feature extraction models (such as CNNs).
[0076] Optionally, the user I / O module 101 can also be used to provide a GUI for users to annotate training data in the training dataset and for users to annotate target data in the inference dataset.
[0077] Optionally, the user I / O module 101 can also be used to receive various configuration information from the user regarding the initial AI model, training data in the training dataset, etc.
[0078] Optionally, the user I / O module 101 can also be used to provide a GUI for the model training module 102 to provide the inference accuracy of the AI model before the update and the inference accuracy of the AI model after the update, and for the user to input instructions to update the AI model.
[0079] Optionally, the user I / O module 101 can also be used to provide a GUI for users to input the update cycle of the AI model.
[0080] Model Training Module 102: Used to train AI models. Here, "training" can be understood as training the initial AI model and optimizing and updating the trained AI model. The initial AI model includes untrained AI models. The trained AI model refers to the AI model obtained by training the initial AI model, or the AI model obtained by updating an existing trained AI model.
[0081] The model training module 102 can communicate with the user I / O module 101, the inference module 103, and the AI model storage module 104. Specifically, the model training module 102 can obtain user-annotated data from the user I / O module 101. The model training module 102 can obtain existing AI models from the AI model storage module 104 as initial AI models, etc. The model training module 102 can obtain the inference results of the inference dataset and the inference dataset from the inference module 103, and train the AI model based on the inference results and the inference dataset.
[0082] Optionally, the model training module 102 is also used to preprocess the training data in the training dataset received by the user I / O module 101. For example, preprocessing the training images in the user-uploaded training image set can ensure that the training images in the training image set are consistent in size and can also remove inappropriate training images from the training image set. The preprocessed training dataset can be used to train the initial AI model and can also improve the training effect. The preprocessed training image set can also be stored in the data storage module 105.
[0083] Optionally, the model training module 102 can also be used to determine the AI model selected by the user on the GUI as the initial AI model. Or, it can determine the AI model uploaded by the user through the GUI as the initial AI model.
[0084] Optionally, the model training module 102 can also be used to evaluate the trained AI model and obtain evaluation results. Of course, evaluating the AI model can also be a separate module.
[0085] The inference module 103 uses an AI model to perform inference on the inference dataset, outputting the inference result and target data of the inference dataset. The inference module 103 can communicate with both the user I / O module 101 and the AI model storage module 104. The inference module 103 obtains the inference dataset from the user I / O module 101, performs inference processing on the dataset, and obtains the inference result. The inference module 103 feeds back the labeled results and target data of the inference dataset to the user I / O module 101. The user I / O module 101 obtains the user-labeled target data and the user's confirmation of the inference result, and feeds back the user-labeled target data and the user-confirmed inference data to the model training module 102. Based on the target data and user-confirmed inference data provided by the user I / O module 101, the model training module 102 continues to train the optimized AI model, obtaining a more optimized AI model. The model training module 102 transfers the more optimized AI model to the AI model storage module 104 for storage and to the inference module 103 for inference processing.
[0086] Optionally, when inferring from the inference dataset, the output of the inference module 103 may also include the difference between the data distribution of the inference dataset and the data distribution of the training dataset of the AI model. In this case, the inference module 103 provides this difference to the model training module 102, which can determine the update method for the AI model based on this difference. Of course, the difference between the data distribution of the inference dataset and the data distribution of the training dataset of the AI model may not be determined by the inference module 103, but by an independent module on the AI platform. Alternatively, the difference between the data distribution of the inference dataset and the data distribution of the training dataset of the AI model may also be determined by the model training module 102.
[0087] Optionally, the inference module 103 is also used to preprocess the inference data in the inference dataset received by the user I / O module 101. For example, preprocessing the inference images in the user-uploaded inference image set can ensure that the inference images in the inference image set are consistent in size, and can also remove inappropriate inference images from the inference image set. The preprocessed inference dataset is suitable for inference on the initial AI model, and can also improve the inference performance. The preprocessed inference image set can also be stored in the data storage module 105.
[0088] The data preprocessing operation described above can also be a separate module, which connects the inference module 103 and the model training module 102 respectively, providing the inference module 103 with the preprocessed inference dataset and the model training module 102 with the preprocessed training image set.
[0089] Optionally, if no user participates during the AI model update process, the inference module 103 may not provide the inference results and target data of the inference dataset to the user I / O module 101.
[0090] Optionally, the initial AI model may also include an AI model trained on the AI model in the AI model storage module 104 using data from the training dataset.
[0091] AI model storage module 104: Used to store initial AI models, updated AI models, AI sub-model structures, and pre-built models. Pre-built models are AI models that have been trained on the AI platform and can be used directly, or AI models that have been trained on the AI platform but need further training and updates. AI model storage module 104 can communicate with both user I / O module 101 and model training module 102. AI model storage module 104 receives and stores the trained initial AI model and updated AI model transmitted by model training module 102. AI model storage module 104 provides AI sub-models or initial AI models to model training module 102. AI model storage module 104 stores the initial AI model uploaded by the user and received by user I / O module 101. It should be understood that in another embodiment, AI model storage module 104 can also be part of model training module 102.
[0092] Data storage module 105 (e.g., data storage resources corresponding to Object Storage Service (OBS) provided by a cloud service provider): used to store training datasets and inference datasets uploaded by users, as well as data processed by data preprocessing module 105, and also used to store sampled or generated data distribution suitable for inference datasets.
[0093] Optionally, the above describes how the user I / O module obtains the inference dataset. Of course, the data storage module 105 can also directly connect to a data source to obtain the inference dataset. For example, the data storage module 105 could be connected to a camera, and the video images captured by the camera could constitute the inference dataset.
[0094] Optionally, the data storage module 105 may also store a knowledge base, which includes knowledge that helps to update the AI model more quickly.
[0095] It should be noted that the AI platform in this application can be a system that can interact with users. This system can be a software system, a hardware system, or a combination of software and hardware. This application does not impose any restrictions.
[0096] It should also be noted that the above-mentioned model training module 102 is used to implement both the initial training of the AI model and the updating of the AI model. Of course, in this embodiment, modules for initial training and modules for updating the AI model can also be deployed separately.
[0097] Due to the functions of the above modules, the AI platform provided in this application embodiment can determine that there is a difference between the data distribution of the inference dataset and the data distribution of the training dataset, and update the AI model when there is a difference, so that the AI model can be updated in a timely manner.
[0098] It should be noted that the aforementioned AI platform may not include the inference module 103; in this case, the AI platform is only used to provide processing for updating the AI model. Specifically, the user provides the inference dataset, the AI model, and the training dataset (or the data distribution of the training dataset) to the AI platform, which then updates the AI model. The AI platform then provides the updated AI model to the user. Alternatively, the AI platform connects to a third-party platform (i.e., the inference platform that performs inference on the inference data). The AI platform obtains the inference dataset, the AI model, and the training dataset (or the data distribution of the training dataset) from the third-party platform, updates the AI model, and then provides the updated AI model to the third-party platform.
[0099] Figure 2 This is a schematic diagram illustrating an application scenario of an AI platform 100 provided in an embodiment of this application, such as... Figure 2 As shown, in one embodiment, the AI platform 100 can be entirely deployed in a cloud environment. A cloud environment is an entity that provides cloud services to users using basic resources under a cloud computing model. A cloud environment includes a cloud data center and a cloud service platform. The cloud data center includes a large amount of basic resources (including computing resources, storage resources, and network resources) owned by the cloud service provider. The computing resources included in the cloud data center can be a large number of computing devices (e.g., servers). The AI platform 100 can be deployed independently on servers or virtual machines in the cloud data center, or it can be distributed and deployed on multiple servers in the cloud data center, or distributed and deployed on multiple virtual machines in the cloud data center, or distributed and deployed on servers and virtual machines in the cloud data center. Figure 2As shown, the AI platform 100 is abstracted into an AI cloud service by a cloud service provider and offered to users on a cloud service platform. After purchasing this cloud service on the cloud service platform (pre-payment is possible, with settlement based on final resource usage), the cloud environment utilizes the AI platform 100 deployed in the cloud data center to provide the AI platform cloud service to the user. When using the AI platform cloud service, the user can specify the task to be performed by the AI model, upload the training image set and inference dataset to the cloud environment through an application program interface (API) or GUI. The AI platform 100 in the cloud environment receives the user's task information, training dataset, and inference dataset, and performs operations such as data preprocessing, AI model training, and inference on the inference dataset using the trained AI model. The AI platform returns the inference results on the inference dataset, the target data identified in the inference dataset, the inference accuracy of the AI model before the update, and the inference accuracy of the AI model after the update to the user through the API or GUI. The user can then choose whether to deploy the updated AI model. The trained AI model can be downloaded by the user or used online to complete specific tasks.
[0100] In another embodiment of this application, when the AI platform 100 in the cloud environment is abstracted into an AI cloud service and provided to users, it can be divided into two parts: a basic AI cloud service and a cloud service for updating AI models based on data distribution. The basic AI cloud service can be a service for training AI models. Users can initially purchase only the basic AI cloud service on the cloud service platform, and then purchase the cloud service for updating AI models when needed. After purchase, the cloud service provider provides the cloud service API for updating AI models, and the cloud service for updating AI models is charged separately based on the number of times the API is called. Of course, users can also purchase only the cloud service for updating AI models.
[0101] The AI platform 100 provided in this application has relatively flexible deployment, such as Figure 3As shown, in another embodiment, the AI platform 100 provided in this application can also be deployed in a distributed manner in different environments. The AI platform 100 provided in this application can be logically divided into multiple parts, each with different functions. For example, in one embodiment, the AI platform 100 includes a user I / O module 101, a model training module 102, an AI model storage module 104, and a data storage module 105. Each part of the AI platform 100 can be deployed in any two or three environments: a terminal computing device, an edge environment, and a cloud environment. Terminal computing devices include: terminal servers, smartphones, laptops, tablets, personal desktop computers, smart cameras, etc. An edge environment is an environment that includes a set of edge computing devices located close to the terminal computing devices, including: edge servers, edge stations with computing capabilities, etc. The various parts of the AI platform 100 deployed in different environments or devices work together to provide users with functions such as determining and training the constructed AI model. For example, in one scenario, the user I / O module 101 and data storage module 105 of the AI platform 100 are deployed in the terminal computing device, while the model training module 102, inference module 103, and AI model storage module 104 of the AI platform 100 are deployed in the edge computing device in the edge environment. The user sends the training dataset and inference dataset to the user I / O module 101 in the terminal computing device, and the terminal computing device stores the training dataset and inference dataset in the data storage module 105. The model training module 102 in the edge computing device updates the AI model based on the inference dataset. It should be understood that this application does not restrict the specific deployment environment of which parts of the AI platform 100 are deployed. In practical applications, deployment can be adapted according to the computing power of the terminal computing device, the resource availability of the edge and cloud environments, or specific application requirements. The above example illustrates the scenario where the user needs to input a training dataset. Of course, the user can also choose not to input a training dataset; the user can directly input the distribution of the training dataset, or the model training module 102 can analyze existing AI models to determine the distribution of the training dataset.
[0102] AI Platform 100 can also be deployed independently on a computing device in any environment (such as on an edge server in an edge environment). Figure 4 This is a schematic diagram of the hardware structure of a computing device 400 on which an AI platform 100 is deployed. Figure 4 The computing device 400 shown includes a memory 401, a processor 402, a communication interface 403, and a bus 404. The memory 401, processor 402, and communication interface 403 are interconnected via the bus 404.
[0103] The memory 401 can be a read-only memory (ROM), a random access memory (RAM), a hard disk, flash memory, or any combination thereof. The memory 401 can store programs. When the program stored in the memory 401 is executed by the processor 402, the processor 402 and the communication interface 403 are used to execute methods for the AI platform 100 to train an AI model for the user, determine the difference between the data distribution of the inference dataset and the data distribution of the training dataset, and update the AI model based on the inference dataset. The memory can also store datasets. For example, a portion of the storage resources in the memory 401 is divided into a data storage module 105 for storing the data required by the AI platform 100, and a portion of the storage resources in the memory 401 is divided into an AI model storage module 104 for storing an AI model library.
[0104] Processor 402 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), a graphics processing unit (GPU), or any combination thereof. Processor 402 may include one or more chips. Processor 402 may include an AI accelerator, such as a neural processing unit (NPU).
[0105] The communication interface 403 uses a transceiver module, such as a transceiver, to enable communication between the computing device 400 and other devices or communication networks. For example, data can be acquired through the communication interface 403.
[0106] Bus 404 may include a pathway for transmitting information between various components of computing device 400 (e.g., memory 401, processor 402, communication interface 403).
[0107] In the embodiments of this application, the method for updating the AI model can have multiple operating modes when updating an existing AI model, such as online single-node self-update, online multi-node collaborative update, and offline multi-node collaborative update. Online single-node self-update means that each computing node deploying the AI model operates independently, using only its own accessed data for online AI model updates. Online multi-node collaborative update involves adding data communication between different computing nodes, allowing them to exchange accessed data. When a computing node updates its model online, it can use not only its own accessed data but also data shared by other computing nodes. Offline multi-node collaborative update means that the AI model update can be performed offline simultaneously. In this mode, the data accessed by each computing node can be aggregated and used uniformly for offline AI model updates. After the AI model is updated offline, the updated AI model is then pushed to each computing node. These three operating modes correspond to... Figure 5 shown Figure 5 (a) Figure 5 (b) and Figure 5 (c) in the middle.
[0108] Specifically, when updating existing AI models, an appropriate operating mode can be selected based on the actual situation (details are described later). For example, when the data distribution of the inference dataset does not change much from that of the training dataset, online single-node self-update can be used; when the data distribution of the inference dataset changes significantly from that of the training dataset, offline multi-node collaborative update can be used.
[0109] In the embodiments of this application, the following are also provided: Figure 6 The AI model update logic diagram shown below:
[0110] Figure 6 This includes data sources, offline updates, online updates, and a knowledge base. Data sources include data from the scenarios in which the AI model update methods are applied. The knowledge base includes prior knowledge and / or domain knowledge used for model training. This prior knowledge and / or domain knowledge can provide a basis for selecting model update strategies and can also guide the AI model update process. For example, if a user needs an AI model to detect cats, the AI platform can learn from domain knowledge that cats and tigers both belong to the feline family and have similarities. The platform already has an AI model for detecting tigers; it can acquire this model and then update it using images of cats to obtain an AI model for detecting cats. As another example, if a user has requirements regarding the AI model's inference speed, memory usage, or hardware requirements, the AI platform can select an AI model architecture that meets the user's requirements or use a pre-built model based on the user's requirements and the knowledge base.
[0111] Online updates refer to adaptively updating the AI model online. Offline updates refer to updating the AI model offline. During offline updates, the data used can include real-world data (such as data from the inference dataset), sampled or generated labeled data adapted to the inference dataset (in... Figure 6 The data used can also include data characteristics, which refer to the statistics, distribution and other information of various types of data. Figure 6The "Offline Update" in the lower left box refers to the offline update process, which includes acquiring data for the updated AI model and updating the existing AI model based on that data. It's important to note that offline updates can involve adjusting the parameters of the existing AI model or retraining a new AI model as the updated model. When retraining a new AI model, the offline update process also includes retrieving the initial model from the AI model storage module 104. For online updates, the data used (which can be simply referred to as online data) can include data obtained from real-world data, labeled data from sampled or generated adaptive inference datasets, etc.
[0112] The following is combined with Figure 7 The specific process of the AI model update method is described, taking the execution of this method by an AI platform as an example:
[0113] Step 701: The AI platform acquires the inference dataset.
[0114] The inference data in the inference dataset is used as input to an existing AI model to perform inference. The existing AI model can also be referred to as the AI model before the update.
[0115] In this embodiment, the user can input an inference dataset into the AI platform, or the AI platform can obtain an inference dataset from a connected inference data source. For example, if the AI platform is connected to a camera, it can continuously acquire data from the camera as data in the inference dataset, with the camera serving as the inference data source. The data in this inference dataset is unlabeled.
[0116] Step 702: The AI platform determines that there is a difference between the data distribution of the inference dataset and the data distribution of the training dataset.
[0117] The training dataset is the dataset used to train existing AI models.
[0118] In this embodiment, the AI platform can determine the data distribution of the inference dataset and obtain the data distribution of the training dataset each time it obtains the inference dataset. Alternatively, the AI platform can determine the data distribution of the inference dataset and obtain the data distribution of the training dataset each time the AI model's update cycle is reached. The update cycle of the AI model can be set by the user.
[0119] The AI platform determines whether there is a difference between the data distribution of the inference dataset and the data distribution of the training dataset. If there is a difference, step 703 is executed; otherwise, no further processing is performed. The reason is that a difference in the data distribution of the inference dataset likely indicates that the existing AI model may not be suitable for the inference dataset, and the existing AI model needs to be updated to adapt to the inference dataset. If there is no difference in the data distribution of the inference dataset and the training dataset, it means that the existing AI model is still suitable for the inference dataset, and no update is needed to conserve processing resources.
[0120] Here, the process of obtaining the data distribution of the training dataset can be: the AI platform can obtain the training dataset and determine the data distribution of the training dataset based on the training dataset; it can also be the data distribution of the training dataset obtained by the AI platform from the user; or it can be the data distribution of the training dataset obtained by the AI platform based on the inference results of the inference dataset by the existing AI model.
[0121] Step 703: The AI platform uses the inference dataset to update the existing AI model and obtain the updated AI model.
[0122] In this embodiment, when the AI platform determines that there is a difference between the data distribution of the inference dataset and the data distribution of the training dataset, it can update the existing AI model based on the inference dataset to obtain the updated AI model.
[0123] In this way, since changes in data distribution can be perceived, existing AI models can be updated in a timely manner based on these changes.
[0124] In one possible implementation, the existing AI model is deployed on an inference platform (the inference platform can be part of the AI platform, such as including the inference module mentioned above, or it can be a platform independent of the AI platform). After step 703, the AI platform can compare the inference accuracy of the updated AI model and the existing AI model, and determine that the inference accuracy of the updated AI model is better than that of the existing AI model. The updated AI model is then deployed to the inference platform so that the updated AI model can replace the existing AI model to perform inference.
[0125] In this embodiment, the AI platform can use test datasets adapted to the data distribution of the training dataset and test datasets adapted to the data distribution of the inference dataset to evaluate the updated AI model, obtaining a first evaluation result and a second evaluation result. Then, using test datasets adapted to the data distribution of the inference dataset and test datasets adapted to the data distribution of the training dataset, the platform can evaluate the existing AI model, obtaining a third evaluation result and a fourth evaluation result. If the first evaluation result is not significantly lower than the fourth evaluation result, and the second evaluation result is better than the third evaluation result, then the inference accuracy of the updated AI model is determined to be better than the inference accuracy of the existing AI model. The AI platform can provide the updated AI model to the inference platform (specifically, it can provide the entire content of the updated AI model, or it can provide the differences between the updated AI model and the existing AI model), and the inference platform can use the updated AI model to replace the existing AI model to perform inference processing.
[0126] It's important to note that when evaluating existing and updated AI models, one or more of the following metrics can be used: Precision Recall (PR) curves, Average Precision (AP) metrics, False Alarm Rate (PAR), and False Negative Rate (FIN). Of course, different evaluation metrics can be used for different types of AI models. For example, in object detection scenarios, in addition to PR curves and AP metrics, one can also use the intersection-union (IU) distribution of bounding boxes, the average AP under different IU, etc. Here, we use PR curves as an example; however, various charts such as box plots and confusion matrices can also be used, and it's not limited to PR curves.
[0127] The above describes the evaluation of AI models based on inference accuracy. Of course, inference speed can also be used. That is, the AI platform uses the combined result of inference accuracy and inference speed as the basis for evaluating the AI model.
[0128] In one possible implementation, the user can decide whether to deploy the updated AI model. When the AI platform determines that the inference accuracy of the updated AI model is superior to that of the existing AI model, it can display both the inference accuracy of the existing AI model and the inference accuracy of the updated AI model on a user interface. The user can then decide whether to deploy the updated AI model based on their respective inference accuracies. If the user decides to deploy the updated AI model, they can trigger the update, and the AI platform will receive the user's update command for the existing AI model. The AI platform can then provide the updated AI model to the inference platform.
[0129] When displaying inference accuracy, the AI platform can also display other information that helps to demonstrate the characteristics of the updated AI model or user-specified information in the display interface, such as gradient change trend, training loss function decrease trend, validation set accuracy change trend, intermediate output results or intermediate feature visualization, or one or more of these.
[0130] In one possible implementation, in step 703, different update methods can be used depending on the differences:
[0131] If the discrepancy meets the offline update criteria, the AI platform uses the inference dataset to update the existing AI model offline; if the discrepancy does not meet the offline update criteria, the AI platform uses the inference dataset to update the existing AI model online.
[0132] The offline update conditions are preset. For example, in this embodiment of the application, for images, the offline update conditions are that the reconstruction error of the image is greater than the reconstruction error of the training image set, and the prediction error between the predicted image corresponding to the image's features and the original image is greater than a second value. As another example, in this embodiment of the application, for anomaly detection of a switch, the data in the inference dataset is the packet loss rate, and the offline update condition is that the difference between the maximum packet loss rate in the inference dataset and the maximum packet loss rate in the training dataset is greater than a third value.
[0133] In this embodiment, the AI platform can determine whether the difference between the data distribution of the inference dataset and the data distribution of the training dataset reaches the offline difference condition. If the difference reaches the offline difference condition, it means that the difference between the data distribution of the inference dataset and the data distribution of the training dataset is relatively large, and the existing AI model is no longer suitable for inference on the inference dataset. Online updates would be slow and not suitable for online updates. The AI platform then uses the inference dataset to update the existing AI model offline.
[0134] If the difference does not meet the offline difference condition, it means that the data distribution of the inference dataset is not significantly different from that of the training dataset. Although the existing AI model is no longer suitable for inference on the inference dataset, it can be updated online. The AI platform uses the inference dataset to update the existing AI model online.
[0135] In this way, the update method can be flexibly selected based on the difference between the data distribution of the inference dataset and the data distribution of the training dataset.
[0136] In one possible implementation, during online updates, the parameters in the updated AI model can be determined based on the difference between the data distribution of the inference dataset and the data distribution of the training dataset. Specifically:
[0137] The AI platform uses the difference between the data distribution of the inference dataset and the data distribution of the training dataset to determine the parameter changes of the target part of the existing AI model; based on the current parameters and parameter changes of the target part in the existing AI model, it determines the parameters of the target part in the updated AI model.
[0138] The target part can be a sub-model of an existing AI model or all sub-models of an existing AI model.
[0139] In this embodiment, the AI platform can obtain the relationship between changes in data distribution and parameter changes. This relationship can be obtained through pre-modeling by the AI platform or from other platforms. The AI platform can determine the parameter changes of the target part by using the differences between the data distribution of the inference dataset and the data distribution of the training dataset, and the relationship between changes in data distribution and parameter changes. Then, the AI platform uses the current parameters and parameter changes of the target part in the existing AI model to determine the parameters of the target part in the updated AI model. The AI platform replaces the parameters of the target part in the existing AI model, thus obtaining the updated AI model. In this way, some or all parameters of the AI model can be updated online.
[0140] In one possible implementation, when updating an existing AI model, the update process can be based on a dataset (hereinafter referred to as the target dataset), as follows:
[0141] The AI platform constructs a target dataset based on the inference dataset; and uses the target dataset to update existing AI models.
[0142] In this embodiment, an existing AI model can use an inference dataset to construct a target dataset, such as sampling some data from the inference dataset and using it as data in the target dataset. Then, the AI platform uses this target dataset to update the existing AI model, obtaining an updated AI model.
[0143] In one possible implementation, when updating an existing AI model using a target dataset, users can participate in building the target dataset or choose not to. When users participate in building the target dataset, they can verify the inference results of the inference data or label the target data provided by the AI platform. In this case, the target dataset includes labeled data, and the AI platform can use supervised learning techniques to update the existing AI model. Alternatively, the AI platform can also use unsupervised learning techniques to update the existing AI model when necessary. Furthermore, the AI platform can fine-tune and adapt the existing AI model using transfer learning and domain adaptation techniques.
[0144] When users do not participate in building the target dataset, the AI platform can use unsupervised learning techniques to update the existing AI model, or use semi-supervised learning techniques to update the existing AI model.
[0145] The specific processing is as follows: 1. Based on user participation, a target dataset can be constructed: The AI platform obtains target data that meets the sample conditions from the inference dataset and displays the target data through the display interface; obtains the user's annotation results on the target data; and constructs the target dataset based on the target data and the annotation results of the target data.
[0146] The sample conditions are used to indicate typical data in the inference dataset.
[0147] In this embodiment, the AI platform can identify target data that meets the sample conditions within the inference dataset. The AI platform then displays the target data through a display interface. Specifically, the target data can be unlabeled data from the inference dataset or labeled data from the inference dataset after inference. When the target data is unlabeled data from the inference dataset, the user can annotate the target data on the display interface, and the AI platform will obtain the user's annotation results. When the target data is labeled data from the inference dataset after inference, the user can confirm the existing annotations on the target data on the display interface, and the AI platform can also obtain the user's annotation results. The AI platform can use the target data and its annotation results as part of the labeled data in the target dataset.
[0148] 2. With user participation, the AI platform can display the inference results of the inference dataset through a display interface. Users can annotate and confirm the inference results, and the AI platform can obtain the annotated and confirmed inference results as labeled data in the target dataset. In addition, if new categories are discovered while users are annotating and confirming the inference results, new category labels can be added to the annotation confirmation results, and these new category labels are also used as labeled data in the target dataset.
[0149] 3. In the absence of user participation, the target dataset may also include data sampled and / or generated by the AI platform from the current labeled data, suitable for the data distribution of the inference dataset. The current labeled data may include data from the training dataset, as well as existing labeled data from other scenarios. Here, "sampling" refers to finding data with a suitable data distribution for the inference dataset within the current labeled data, and "generating" refers to generating data with a suitable data distribution for the inference dataset based on the current labeled data and the data generation algorithm. This way, even when the existing data suitable for the inference dataset's distribution is limited, a larger amount of data suitable for the inference dataset's distribution can be provided, facilitating the updating of the AI model.
[0150] It should be noted that during user participation, users can annotate data in real time, and the AI platform can use the user-annotated data for training in real time.
[0151] In one possible implementation, updating an existing AI model using the target dataset can be done as follows:
[0152] The AI platform obtains a strategy for updating the existing AI model based on the data characteristics of the data in the target dataset; and updates the existing AI model according to the strategy.
[0153] In this embodiment, the AI platform can utilize the data characteristics of the target dataset, along with prior knowledge and / or domain knowledge from the knowledge base, to select a strategy for updating the existing AI model. The AI platform then uses this strategy to update the existing AI model, obtaining the updated AI model.
[0154] For example, if the target dataset has limited labeled data, prior knowledge from the knowledge base can be used to apply transfer learning and / or few-shot learning techniques when labeled data is scarce. AI platforms can then use transfer learning and / or few-shot learning techniques to update existing AI models.
[0155] If the target dataset contains a large amount of labeled data, strong supervision techniques can be used based on prior knowledge in the knowledge base when there is a large amount of labeled data. AI platforms can use strong supervision techniques to update AI models. It should be noted that "strong supervision techniques" here is a general term used for illustration only; in actual implementation, it may refer to a specific strong supervision training method, and the corresponding training method will differ for different tasks and scenarios.
[0156] In one possible implementation, no user intervention is required during the AI model update process. The labeled data for the target dataset is sampled from the current labeled data and / or data with a distribution suitable for the inference dataset is generated. The target dataset includes unlabeled and labeled data with a distribution suitable for the inference dataset. The AI platform can utilize the unlabeled data in the target dataset to optimize the feature extraction part of the existing AI model using an unsupervised approach; based on the optimized feature extraction part and the labeled data in the target dataset, the existing AI model is updated.
[0157] In this embodiment, when the target dataset includes both unlabeled data and labeled data with a distribution suitable for the inference dataset, the AI platform can utilize the unlabeled data in the target dataset to optimize the feature extraction part of the existing AI model using an unsupervised approach, obtaining an optimized feature extraction part. This unsupervised approach can be a self-supervised approach, etc. Then, the AI platform can use the optimized feature extraction part and the labeled data adapted to the inference dataset's distribution to further update the existing AI model, obtaining an updated AI model. In this way, the existing AI model can be updated even without user intervention. For example, as... Figure 8 As shown, without user participation, when the AI platform performs inference on the inference dataset, it obtains both the inference result and the target data, but only provides the inference result to the user, not the target data. Figure 8 As shown in (a)). The AI platform updates existing AI models, and after updating the existing AI models, it can provide the updated AI models to users. Figure 8 (As shown in (b)). The AI platform can then use the updated AI model to perform inference, obtain inference results and target data, and provide the inference results to the user. Figure 8 (as shown in (c)). Of course, in Figure 8 Alternatively, the target data can be omitted from the output.
[0158] It should be noted that this update is based on the optimized feature extraction part and the labeled data in the target dataset to update the existing AI model. Of course, it can also be based on the optimized feature extraction part, the unlabeled data and labeled data in the target dataset to update the existing AI model.
[0159] In one possible implementation, no user intervention is required during the AI model update process. The labeled data for the target dataset is sampled from the current labeled data and / or data with a distribution suitable for the inference dataset is generated. The target dataset includes unlabeled data and labeled data with a distribution suitable for the inference dataset. The AI platform can use an existing AI model to label the unlabeled data in the target dataset to obtain labeled data; then, using the existing AI model, it can label the unlabeled data in the target dataset to obtain labeling results for the unlabeled data. Based on the labeling results of the unlabeled data and the labeled data in the target dataset, the existing AI model is updated.
[0160] In this embodiment, when the data in the target dataset is unlabeled, the AI platform uses an existing AI model to label the unlabeled data in the target dataset, obtaining the labeling results (these labeling results may be inaccurate and can be called "pseudo-labels") and their corresponding confidence scores. Then, the AI model uses the labeling results with higher confidence scores (such as those with confidence scores higher than a preset threshold) and the labeled data in the target dataset to update the existing AI model, obtaining the updated AI model.
[0161] Alternatively, the AI model can be trained using labeled results with high confidence levels to obtain a trained AI model. The AI platform can then use labeled data from the target dataset (this labeled data is sampled and / or generated to fit the data distribution of the inference dataset) to further update the trained AI model, obtaining an updated AI model. This allows for updating existing AI models even without user intervention.
[0162] In one possible implementation, user participation is involved in the AI model update process. The AI platform can update the existing AI model using strongly supervised learning techniques based on labeled data in the target dataset. Specifically, if the task remains unchanged, strongly supervised learning techniques are directly used to update the existing AI model, resulting in the updated AI model. If the task changes (e.g., a new category needs to be classified), and the number of labeled data points for the new category in the target dataset is relatively small, the AI platform can choose few-shot learning techniques to update the existing AI model.
[0163] For example, such as Figure 9 As shown, when users participate, the AI platform, while performing inference on the inference dataset, obtains inference results and target data, and then provides the inference results and target data to the user. Figure 9 As shown in (a)). Users can provide the AI platform with annotation confirmations of the inference results and / or annotation results of multi-target data (i.e., labeled data). Figure 9 As shown in (b)). The AI platform can update the existing AI model based on the labeled data provided by the user, obtain the updated AI model, and provide the updated AI model to the user. Figure 9 (as shown in (c)). The subsequent AI platform can use the updated AI model for inference, obtain inference results and target data, and provide them to the user. Figure 9 (as shown in (d)).
[0164] In addition, if the task remains unchanged and the number of labeled data in the target dataset is relatively small, the AI platform can also sample and / or generate data with a suitable data distribution for the inference dataset from the current labeled data to expand the labeled data in the target dataset.
[0165] In addition, when choosing few-shot learning techniques to update existing AI models, representation learning methods can also be used to optimize the feature extraction part of existing AI models.
[0166] In one possible implementation, the process by which the AI platform determines the difference between the data distribution of the inference dataset and the data distribution of the training dataset is as follows:
[0167] The AI platform acquires a probabilistic model of the data distribution for modeling. This model can be obtained through the AI platform's own modeling or from other platforms. The AI platform can then use this probabilistic model to extract features from the training dataset and fit a Gaussian mixture distribution. By fitting this Gaussian distribution to the features of the training dataset, the AI platform can determine the likelihood of the inference dataset. This likelihood represents the difference between the data distribution of the training dataset and the data distribution of the inference dataset; a higher likelihood indicates a smaller difference, and vice versa.
[0168] It should be noted here that when performing probability modeling, the distribution used can be a Gaussian mixture distribution, a parameterized distribution fitting method, or other distributions, non-parametric distribution fitting algorithms, complex probabilistic graphical models, etc.
[0169] It should be noted that the above only describes a single update process for an existing AI model. During use, the existing AI model can be continuously updated in a loop. Figure 10 The diagram illustrates the cyclical process of AI model updates: Step 1001: The AI platform acquires the inference dataset. Step 1002: The AI platform determines that the data distribution of the inference dataset differs from that of the training dataset. Step 1003: The AI platform uses the inference dataset to update the existing AI model, obtaining the updated AI model. Step 1004: The updated AI model is deployed; this updated AI model is the current existing AI model. Step 1005: The AI platform returns to step 1002.
[0170] Figure 10The description only outlines a single, iterative process; as long as the AI model updates continue, the process is essentially in a continuous loop. Specifically, the AI platform connects to the inference data source and continuously retrieves data from the inference dataset, determining its data distribution. It then compares this distribution with the training dataset. If a difference exists, the existing AI model is updated, the updated model is deployed, and the process returns to step 1002. Steps 1001 and 1002 are asynchronous with steps 1003 and 1004 because the data in the inference dataset is continuously updated, constantly comparing its distribution with the training dataset. Steps 1003 and 1004 are only executed when a difference exists between the inference and training datasets.
[0171] Users can input a stop command into the AI platform to control the platform to update the existing AI model. Alternatively, if the AI platform determines that the data distribution of the inference dataset is relatively small compared to the data distribution of the training dataset, and the accuracy change of the updated AI model compared to the existing AI model (i.e., the AI model before the update) is relatively small, the AI platform can proactively stop updating the AI model.
[0172] After ceasing AI model updates, if the AI platform again determines that the data distribution of the inference dataset differs significantly from that of the training dataset, it can provide the user with an update notification message (e.g., via SMS to the user's device or by displaying the notification on the interface). Upon receiving confirmation of the update from the user, the AI platform can restart the AI model update process. Alternatively, if the AI platform again determines that the data distribution of the inference dataset differs significantly from that of the training dataset, it can proactively initiate the AI model update process.
[0173] In this embodiment, the AI model updating method can be applied to scenarios involving the recognition of actions in images. For example, it can be applied to the recognition of non-standard sorting actions in logistics scenarios. In this application scenario, the AI platform can perform inference and update the existing AI model based on it.
[0174] In this application scenario, the inference dataset consists of user surveillance video data, and the existing AI model is capable of recognizing non-standard sorting actions. The training dataset is also video data. A diagram illustrating this scenario is shown below: Figure 11As shown, the AI platform includes: a video inference module (i.e., inference module 103 mentioned above), a storage service module (i.e., data storage module 105 mentioned above), a model training module (i.e., model training module 102 mentioned above), and a user I / O module (i.e., user I / O module 101 mentioned above). The video inference module is used to infer the inference dataset acquired from the camera, the storage service module is used to store the inference dataset, the model training module is used to update existing AI models, and the user I / O module is used to exchange data with users.
[0175] The AI model update process may include determining the difference between the data distribution of the inference dataset and the data distribution of the training dataset, updating the existing AI model online, performing inference on the inference dataset, providing users with target data processing, and updating the existing AI model offline.
[0176] 1. The process of determining the difference between the data distribution of the inference dataset and the data distribution of the training dataset:
[0177] Given an input inference dataset, the AI platform can extract video frames from the dataset, extract depth features from the video frames using a stored deep neural network, and / or extract non-depth features using other algorithms. For example, non-depth features include frame difference and optical flow. Frame difference refers to the result of subtracting two adjacent frames, while optical flow refers to the positional relationship between pixels in two adjacent frames; it is a displacement field representing pixel movement.
[0178] It should be noted that if the inference dataset consists of video streams or continuous videos over a period of time, the AI platform can use sliding windows or video segmentation to obtain short videos of appropriate duration as input. Methods for extracting video frames from the inference dataset include, but are not limited to, extracting all video frames, uniform sampling, non-uniform sampling, and multi-scale sampling. Non-uniform sampling can involve selecting video frames based on keyframes or inter-frame similarity; specifically, it can involve selecting keyframes or video frames with inter-frame similarity less than a certain value. Multi-scale sampling involves obtaining multiple short video segments using different sampling intervals, extracting depth features from each segment, and then integrating the extracted depth features to obtain the aforementioned depth features. Deep neural networks include, but are not limited to, 2D / 3D convolutional neural networks, recurrent neural networks, long short-term memory networks, two-stream convolutional neural networks, and their combinations and variations.
[0179] The AI platform stores video prediction models, which can be built by the AI platform itself or obtained from other platforms. For example... Figure 12As shown, the AI platform can use the extracted features (including deep and / or non-deep features) to predict future video frames. The AI platform then calculates the prediction error between the predicted video frame and the actual video frames in the inference dataset, using the prediction error from a single prediction or the average of multiple prediction errors to represent the difference between the data distribution of the training dataset and the data distribution of the inference dataset. Specifically, when predicting future video frames, the AI platform can predict one or more frames. The aforementioned video prediction models include, but are not limited to, 2D / 3D convolutional neural networks, recurrent neural networks, generative adversarial networks, variational autoencoders, and their combinations and variants.
[0180] Other methods can also be used when modeling the data distribution, such as video frame interpolation, video reconstruction, and calculating inter-frame similarity. Video frame interpolation refers to predicting intermediate video frames using non-adjacent video frames. Video reconstruction refers to reconstructing a reconstructed video frame based on the features of the current video frame, comparing the reconstructed video frame with the current video frame to obtain the reconstruction error, and using the reconstruction error of one video frame or the average of the reconstruction errors of multiple video frames to represent the difference between the data distribution of the training dataset and the data distribution of the inference dataset. Calculating inter-frame similarity refers to calculating the similarity between two adjacent video frames, and using the similarity of one video frame or the average of the similarities of multiple adjacent video frames to represent the difference between the data distribution of the training dataset and the data distribution of the inference dataset.
[0181] Furthermore, when modeling data distribution, in the spatial dimension, one can use the overall image of each video frame, or a local region of each video frame, or a combination of both. In the temporal dimension, similar modeling methods can be used, such as overall (considering a whole video segment), local (considering a portion of a whole video segment), or a combination of both.
[0182] When calculating prediction error, the AI platform can use any metric that meets the task requirements, including but not limited to L1 distance (the difference between two predicted video frames), L2 distance (the square of the difference between two predicted video frames), Wasserstein distance (also known as earth mover distance), learnable metrics, and combinations and variations thereof.
[0183] In the above description, the difference between the data distribution of the inference dataset and the data distribution of the training dataset is directly represented by the prediction error. Of course, it can also be represented by the result of linear or nonlinear transformation of the prediction error.
[0184] The above process for determining changes in data distribution is in Figure 12 There is an explanation.
[0185] 2. The process of updating existing AI models online:
[0186] In this embodiment, when the difference between the data distribution of the inference dataset and the data distribution of the training dataset is less than a certain value, the AI platform can update the existing AI model online. Specifically: such as... Figure 13 As shown, the AI platform can input the difference between the data distribution of the inference dataset and the data distribution of the training dataset into the parameter generator (the parameter generator models the correspondence between parameter changes and data distribution differences). The output of the parameter generator is the parameter change of the target part mentioned earlier. The AI platform adds the current parameter values of the target part in the existing AI model to the parameter change to obtain the parameter values of the target part in the updated AI model.
[0187] The difference between the data distribution of the inference dataset and the data distribution of the training dataset is used here to determine the parameter change of the target part. Of course, some or all of the data in the inference dataset and this difference can also be used to determine the parameter change of the target part. This application embodiment does not limit this.
[0188] 3. The process of reasoning on the inference dataset:
[0189] In this embodiment, an existing AI model (or an updated AI model) performs inference on video frames in the inference dataset and outputs the inference result of action recognition. The AI platform displays the inference result through a display interface.
[0190] 4. Provide users with processing of target data:
[0191] AI platforms can extract target data that meets the sample conditions from the inference dataset based on the differences between the data distribution of the inference dataset and the data distribution of the training dataset.
[0192] In this embodiment, the AI platform can use the difference between the data distribution of the inference dataset and the data distribution of the training dataset to filter out target data that meets the sample conditions in the inference data. The target data under these sample conditions is suitable for updating the existing AI model.
[0193] Optionally, the AI platform can use uncertainty to determine the target data and process it as follows:
[0194] AI platforms can use existing AI models to infer the uncertainty of each inference data in the inference data. This uncertainty can be represented by any one of action category probability, information entropy, mutual information, and variance.
[0195] Then, the AI platform uses the differences between the data distribution of the inference dataset and the data distribution of the training dataset, as well as the uncertainty of each inference data, to obtain target data that meets the sample conditions in the inference dataset.
[0196] Specifically, uncertainty is represented by action class probabilities, the difference between the data distribution of the inference dataset and the data distribution of the training dataset is represented by prediction error, L1 distance is used to measure prediction error, and the entropy of action class probabilities is used to measure uncertainty. The sample conditions satisfied by the target data are:
[0197]
[0198] In equation (1), x represents the target data (also known as a sample), and the first term I(x) represents the actual video frame. This indicates the predicted video frame; in the second term, p i (x) represents the probability of the i-th type of action corresponding to x, where λ1 and λ2 are hyperparameters used as weights of two terms to weigh their effects. * This represents the selected target data to be labeled. Equation (1) means: satisfying... x is the value of x when it reaches its maximum value. * This allows us to obtain typical data from the inference dataset, which is more suitable for updating existing AI models and makes the inference accuracy of the updated AI models better.
[0199] like Figure 14 As shown, the AI platform provides target data to the user, and the user then selects x. * Perform annotation and obtain the annotation result y * The AI platform is based on {x * y * Update the existing AI model.
[0200] 5. The process of updating existing AI models offline:
[0201] AI platforms can use supervised techniques to update existing AI models. This can involve fine-tuning an existing AI model based on a target dataset, or directly retraining a new AI model based on the target dataset as the updated model. When updating existing AI models, the optimization algorithms used to update parameters include, but are not limited to, stochastic gradient descent and conjugate gradient descent.
[0202] The process of evaluating and deploying the updated AI model is the same as described above, and will not be repeated here.
[0203] Thus, the technical solution of this application embodiment can perceive changes in data distribution. On the one hand, it utilizes the adaptive capabilities of the AI model itself to adjust local parameters; on the other hand, it interacts with the user to obtain new labeled data for offline updates of the AI model, thereby continuously adapting to new data distributions and ensuring the inference accuracy of the AI model. Furthermore, the AI platform can control the AI model to continuously and automatically update, without requiring users to possess algorithm-related expertise.
[0204] Furthermore, in this embodiment, the AI model can be updated with or without user participation. Moreover, when updating the AI model, it is not limited by the number of labeled data points, nor by changes in the task, and it can be applied to any form of inference dataset, such as batch data (100 consecutive images), streaming data (gradually generated video data), etc.
[0205] Figure 15 This is a structural diagram of the AI model updating device provided in this application embodiment. This device can be implemented as part or all of the apparatus through software, hardware, or a combination of both. In some embodiments, the AI model updating device may be part or all of the aforementioned AI platform 100.
[0206] The apparatus provided in this application embodiment can implement the embodiments of this application. Figure 7 The process described herein, the device includes: an acquisition module 1510, a determination module 1520, and an update module 1530, wherein:
[0207] The acquisition module 1510 is used to acquire an inference dataset, wherein the inference data in the inference dataset is used to input into an existing AI model to perform inference. Specifically, it can be used to implement the acquisition function of step 701 and execute the implicit steps included in step 701.
[0208] The determination module 1520 is used to determine that there is a difference between the data distribution of the inference dataset and the data distribution of the training dataset, wherein the training dataset is the dataset used to train the existing AI model, and can be used to implement the determination function of step 702 and execute the implicit steps included in step 702.
[0209] The update module 1530 is used to update the existing AI model using the inference dataset to obtain the updated AI model. Specifically, it can be used to implement the update function of step 703 and execute the implicit steps included in step 703.
[0210] In one possible implementation, the existing AI model is deployed on an inference platform, and the determining module 1520 is further configured to, after obtaining the updated AI model, compare the inference accuracy of the updated AI model and the existing AI model, and determine that the inference accuracy of the updated AI model is better than the inference accuracy of the existing AI model.
[0211] The update module 1530 is further configured to deploy the updated AI model to the inference platform so that the updated AI model can replace the existing AI model in performing inference.
[0212] In one possible implementation, such as Figure 16 As shown, the device further includes a display module 1540, used to deploy the updated AI model to the inference platform and, before replacing the existing AI model in performing inference, display the inference accuracy of the existing AI model and the inference accuracy of the updated AI model through a display interface;
[0213] The receiving module 1550 is used to receive the user's update instruction for the existing AI model.
[0214] In one possible implementation, the update module 1530 is used to:
[0215] If the difference meets the offline update condition, the existing AI model is updated offline using the inference dataset;
[0216] If the difference does not meet the offline update conditions, the existing AI model is updated online using the inference dataset.
[0217] In one possible implementation, the update module 1530 is used to:
[0218] By utilizing the difference between the data distribution of the inference dataset and the data distribution of the training dataset, the parameter variation of the target part of the existing AI model is determined;
[0219] Based on the current parameters of the target part in the existing AI model and the amount of parameter change, the parameters of the target part in the updated AI model are determined.
[0220] In one possible implementation, the update module 1530 is used to:
[0221] Construct the target dataset based on the inference dataset;
[0222] The existing AI model is updated using the target dataset.
[0223] In one possible implementation, the update module 1530 is used to:
[0224] In the inference dataset, target data that meets the sample conditions is obtained, and the target data is displayed through the display interface;
[0225] Obtain the user's annotation results for the target data;
[0226] Based on the target data and the annotation results of the target data, construct the target dataset.
[0227] In one possible implementation, the update module 1530 is used to:
[0228] Based on the difference between the data distribution of the inference dataset and the data distribution of the training dataset, target data that meets the sample conditions is obtained from the inference dataset, wherein the target data is suitable for updating the existing AI model.
[0229] In one possible implementation, the target dataset further includes sampled and / or generated labeled data suitable for the data distribution of the inference dataset from the current labeled data, wherein the current labeled data includes data from the training dataset.
[0230] In one possible implementation, the target dataset includes unlabeled data and labeled data that are suitable for the data distribution of the inference dataset;
[0231] The update module 1530 is used for:
[0232] Using unlabeled data from the target dataset, the feature extraction part of the existing AI model is optimized in an unsupervised manner;
[0233] The existing AI model is updated based on the optimized feature extraction part and the labeled data in the target dataset.
[0234] In one possible implementation, the target dataset includes unlabeled data and labeled data that are suitable for the data distribution of the inference dataset;
[0235] The update module 1530 is used for:
[0236] Using the existing AI model, unlabeled data in the target dataset is labeled to obtain the labeling results of the unlabeled data;
[0237] The existing AI model is updated based on the annotation results of the unlabeled data and the labeled data in the target dataset.
[0238] In one possible implementation, the update module 1530 is used to:
[0239] Based on the data characteristics of the data in the target dataset, obtain a strategy for updating the existing AI model;
[0240] The existing AI model is updated according to the strategy described above.
[0241] In one possible implementation, the acquisition module 1510 is further configured to acquire the update cycle of the AI model input by the user;
[0242] The determining module 1520 is used for:
[0243] Based on the update cycle of the AI model, it is determined that the data distribution of the inference dataset differs from that of the training dataset.
[0244] The module division in this embodiment is illustrative and represents only one logical functional division. In actual implementation, other division methods are possible. Furthermore, the functional modules in each embodiment of this application can be integrated into a single processor, exist as separate physical entities, or be integrated into a single module. The integrated modules described above can be implemented in hardware or as software functional modules.
[0245] This application also provides a method such as Figure 4 The computing device 400 shown has a processor 402 that reads the program and image set stored in the memory 401 to execute the method executed by the aforementioned AI platform.
[0246] Since the various modules in the AI platform 100 provided in this application can be distributed and deployed on multiple computers in the same or different environments, this application also provides a... Figure 17 The computing device shown includes multiple computers 1700, each computer 1700 including a memory 1701, a processor 1702, a communication interface 1703, and a bus 1704. The memory 1701, processor 1702, and communication interface 1703 are interconnected via the bus 1704.
[0247] The memory 1701 can be a read-only memory, a static storage device, a dynamic storage device, or a random access memory. The memory 1701 can store programs. When the program stored in the memory 1701 is executed by the processor 502, the processor 1702 and the communication interface 1703 are used to execute parts of the methods for updating the AI model by the AI platform. The memory can also store image collections. For example, a portion of the storage resources in the memory 1701 can be allocated as an inference dataset storage module to store inference datasets, and a portion of the storage resources in the memory 1701 can be allocated as an AI model storage module to store an AI model library.
[0248] The processor 1702 can be a general-purpose central processing unit, microprocessor, application-specific integrated circuit, graphics processor, or one or more integrated circuits.
[0249] Communication interface 1703 uses transceiver modules, such as, but not limited to, transceivers, to enable communication between computer 1700 and other devices or communication networks. For example, inference datasets can be obtained through communication interface 1703.
[0250] Bus 504 may include a pathway for transmitting information between various components of computer 1700 (e.g., memory 1701, processor 1702, communication interface 1703).
[0251] Each of the aforementioned computers 1700 establishes a communication path through a communication network. Each computer 1700 runs any one or more of the following: user I / O module 101, model training module 102, inference module 103, AI model storage module 104, or data storage module 105. Any computer 1700 can be a computer in a cloud data center (such as a server), a computer in an edge data center, or a terminal computing device.
[0252] The descriptions of the processes corresponding to the above-mentioned figures each have their own emphasis. For parts of a process that are not described in detail, please refer to the relevant descriptions of other processes.
[0253] In the above embodiments, implementation can be achieved, in whole or in part, by software, hardware, or a combination thereof. When implemented using software, it can be implemented, in whole or in part, as a computer program product. The computer program product providing the AI platform includes one or more computer instructions for accessing the AI platform. When these computer program instructions are loaded and executed on a computer, all or part of the implementation according to the embodiments of this application is generated. Figure 5 , Figure 11 , Figure 14 or Figure 15 The process or function described.
[0254] The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic cable, twisted pair) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium stores computer program instructions that provide an AI platform. The computer-readable storage medium may be any medium accessible to a computer or a data storage device such as a server or data center that integrates one or more media. The medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., optical disc), or a semiconductor medium (e.g., SSD).
Claims
1. A method for updating an artificial intelligence (AI) model, characterized in that, The method is applied to an artificial intelligence (AI) platform, and the method includes: Obtain an inference dataset, wherein the inference data in the inference dataset is used as input to an existing AI model to perform inference, the existing AI model is deployed on an inference platform, and the inference platform is part of the AI platform or independent of the AI platform; It is determined that the data distribution of the inference dataset differs from that of the training dataset, wherein the training dataset is the dataset used to train the existing AI model, and the data distribution is obtained through modeling; The existing AI model is updated using the inference dataset to obtain the updated AI model; The step of updating the existing AI model using the inference dataset includes: If the difference meets the offline update condition, the existing AI model is updated offline using the inference dataset, wherein the difference that meets the offline update condition is greater than the difference that does not meet the offline update condition. If the difference does not meet the offline update condition, then by utilizing the difference between the data distribution of the inference dataset and the data distribution of the training dataset, a model is created to obtain or acquire the correspondence between the parameter changes of the target part of the stored existing AI model and the difference. The parameter changes corresponding to the difference in the correspondence are determined as the parameter changes of the target part of the existing AI model. Based on the current parameters of the target part in the existing AI model and the parameter changes, the parameters of the target part in the updated AI model are determined. The parameters of the target part include some or all of the parameters of the existing AI model.
2. The method according to claim 1, characterized in that, The method further includes: By comparing the inference accuracy of the updated AI model and the existing AI model, it is determined that the inference accuracy of the updated AI model is better than that of the existing AI model. The updated AI model is deployed to the inference platform so that the updated AI model can replace the existing AI model to perform inference.
3. The method according to claim 2, characterized in that, Before deploying the updated AI model to the inference platform, the process also includes: The inference accuracy of the existing AI model and the inference accuracy of the updated AI model are displayed through the display interface. Receive user's update command for the existing AI model.
4. The method according to any one of claims 1 to 3, characterized in that, The offline update of the existing AI model using the inference dataset includes: Construct the target dataset based on the inference dataset; The existing AI model is updated using the target dataset.
5. The method according to claim 4, characterized in that, The construction of the target dataset based on the inference dataset includes: In the inference dataset, target data that meets the sample conditions is obtained, and the target data is displayed through the display interface; Obtain the user's annotation results for the target data; Based on the target data and the annotation results of the target data, construct the target dataset.
6. The method according to claim 4, characterized in that, The target dataset includes unlabeled and labeled data that are suitable for the data distribution of the inference dataset; The step of updating the existing AI model using the target dataset includes: Using unlabeled data from the target dataset, the feature extraction part of the existing AI model is optimized in an unsupervised manner; The existing AI model is updated based on the optimized feature extraction part and the labeled data in the target dataset.
7. The method according to claim 4, characterized in that, The target dataset includes unlabeled and labeled data that are suitable for the data distribution of the inference dataset; The step of updating the existing AI model using the target dataset includes: Using the existing AI model, unlabeled data in the target dataset is labeled to obtain the labeling results of the unlabeled data; The existing AI model is updated based on the annotation results of the unlabeled data and the labeled data in the target dataset.
8. The method according to claim 4, characterized in that, The step of updating the existing AI model using the target dataset includes: Based on the data characteristics of the data in the target dataset, obtain a strategy for updating the existing AI model; The existing AI model is updated according to the strategy described above.
9. The method according to any one of claims 1 to 3, characterized in that, The method further includes: The update cycle of the AI model obtained from user input; The determination that the data distribution of the inference dataset differs from the data distribution of the training dataset includes: Based on the update cycle of the AI model, it is determined that the data distribution of the inference dataset differs from that of the training dataset.
10. An apparatus for updating an artificial intelligence (AI) model, characterized in that, The device belongs to an artificial intelligence (AI) platform, and the device includes: An acquisition module is used to acquire an inference dataset, wherein the inference data in the inference dataset is used to input into an existing AI model to perform inference, the existing AI model is deployed on an inference platform, and the inference platform is part of the AI platform or independent of the AI platform; The determination module is used to determine that there is a difference between the data distribution of the inference dataset and the data distribution of the training dataset, wherein the training dataset is the dataset used to train the existing AI model, and the data distribution is obtained through modeling; The update module is used to update the existing AI model using the inference dataset to obtain the updated AI model; The update module is used for: If the difference meets the offline update condition, the existing AI model is updated offline using the inference dataset, wherein the difference that meets the offline update condition is greater than the difference that does not meet the offline update condition. If the difference does not meet the offline update condition, then by utilizing the difference between the data distribution of the inference dataset and the data distribution of the training dataset, a model is created to obtain or acquire the correspondence between the parameter changes of the target part of the stored existing AI model and the difference. The parameter changes corresponding to the difference in the correspondence are determined as the parameter changes of the target part of the existing AI model. Based on the current parameters of the target part in the existing AI model and the parameter changes, the parameters of the target part in the updated AI model are determined. The parameters of the target part include some or all of the parameters of the existing AI model.
11. The apparatus according to claim 10, characterized in that, The determining module is further configured to compare the inference accuracy of the updated AI model and the existing AI model, and determine that the inference accuracy of the updated AI model is better than that of the existing AI model. The update module is also used to deploy the updated AI model to the inference platform so that the updated AI model can replace the existing AI model to perform inference.
12. The apparatus according to claim 11, characterized in that, The device further includes a display module, used to display the inference accuracy of the existing AI model and the inference accuracy of the updated AI model through a display interface before deploying the updated AI model to the inference platform; The receiving module is used to receive update instructions from the user for the existing AI model.
13. The apparatus according to any one of claims 10 to 12, characterized in that, The update module is used for: Construct the target dataset based on the inference dataset; The existing AI model is updated using the target dataset.
14. The apparatus according to claim 13, characterized in that, The update module is used for: In the inference dataset, target data that meets the sample conditions is obtained, and the target data is displayed through the display interface; Obtain the user's annotation results for the target data; Based on the target data and the annotation results of the target data, construct the target dataset.
15. The apparatus according to claim 13, characterized in that, The target dataset includes unlabeled and labeled data that are suitable for the data distribution of the inference dataset; The update module is used for: Using unlabeled data from the target dataset, the feature extraction part of the existing AI model is optimized in an unsupervised manner; The existing AI model is updated based on the optimized feature extraction part and the labeled data in the target dataset.
16. The apparatus according to claim 13, characterized in that, The target dataset includes unlabeled and labeled data that are suitable for the data distribution of the inference dataset; The update module is used for: Using the existing AI model, unlabeled data in the target dataset is labeled to obtain the labeling results of the unlabeled data; The existing AI model is updated based on the annotation results of the unlabeled data and the labeled data in the target dataset.
17. The apparatus according to claim 13, characterized in that, The update module is used for: Based on the data characteristics of the data in the target dataset, obtain a strategy for updating the existing AI model; The existing AI model is updated according to the strategy described above.
18. The apparatus according to any one of claims 10 to 12, characterized in that, The acquisition module is also used to acquire the update cycle of the AI model input by the user; The determining module is used to determine, based on the update cycle of the AI model, whether there is a difference between the data distribution of the inference dataset and the data distribution of the training dataset.
19. A computing device for updating an artificial intelligence (AI) model, characterized in that, The computing device includes a processor and a memory, wherein: The memory stores computer instructions; The processor executes the computer instructions to cause the computing device to perform the method described in any one of claims 1-9.
20. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed by a computing device, cause the computing device to perform the method described in any one of claims 1-9, or cause the computing device to perform the function of the apparatus described in any one of claims 10-18.