METHOD, ELECTRONIC DEVICE, AND COMPUTER PROGRAM PRODUCT FOR DETECTING MODEL PERFORMANCE

Embodiments of the present disclosure provide a method, an electronic device, and a computer program product for detecting model performance. The method may include acquiring a prediction result of an input feature using a target model to determine a confidence of the prediction result. The method may further include reconstructing the input feature using a self-coding model to determine a reconstruction error, the reconstruction error being a difference between the input feature before being reconstructed by the self-coding model and the input feature after being reconstructed by the self-coding model. In addition, the method may include determining a detection result of the target model at least based on a comparison between the confidence and a first threshold and a comparison between the reconstruction error and a second threshold.

RELATED APPLICATION

The present application claims priority to Chinese Patent Application No. 202211295555.4, filed Oct. 21, 2022, and entitled “Method, Electronic Device, and Computer Program Product for Detecting Model Performance,” which is incorporated by reference herein in its entirety.

FIELD

Embodiments of the present disclosure relate to the technical field of computers and, more particularly, to a method, an electronic device, and a computer program product for detecting model performance.

BACKGROUND

Deep neural networks have been widely used in various fields. Different from other applications, the performance of a deep neural network model will decrease over time due to changes in the environment (such as user behavior and sensor drift), which results in model drift. The model drift usually means that statistical characteristics of a target variable that the model is trying to predict will change in an unforeseeable way over time. As prediction results of a model become less accurate over time, it will lead to many problems. However, model retraining is usually a time-consuming and laborious project.

SUMMARY

Embodiments of the present disclosure provide a solution for detecting model performance.

In a first aspect of the present disclosure, a method for detecting model performance is provided. The method may include acquiring a prediction result of an input feature using a target model to determine a confidence of the prediction result. The method may further include reconstructing the input feature using a self-coding model to determine a reconstruction error, the reconstruction error being a difference between the input feature before being reconstructed by the self-coding model and the input feature after being reconstructed by the self-coding model. In addition, the method may include determining a detection result of the target model at least based on a comparison between the confidence and a first threshold and a comparison between the reconstruction error and a second threshold.

In a second aspect of the present disclosure, an electronic device is provided, including a processor; and a memory coupled to the processor and having instructions stored therein, wherein the instructions, when executed by the processor, cause the electronic device to perform actions including: acquiring a prediction result of an input feature using a target model to determine a confidence of the prediction result; reconstructing the input feature using a self-coding model to determine a reconstruction error, the reconstruction error being a difference between the input feature before being reconstructed by the self-coding model and the input feature after being reconstructed by the self-coding model; and determining a detection result of the target model at least based on a comparison between the confidence and a first threshold and a comparison between the reconstruction error and a second threshold.

In a third aspect of the present disclosure, a computer program product is provided, wherein the computer program product is tangibly stored on a non-transitory computer-readable medium and includes machine-executable instructions, wherein the machine-executable instructions, when executed by a machine, cause the machine to perform any steps of the method according to the first aspect.

This Summary is provided to introduce the selection of concepts in a simplified form, which will be further described in the Detailed Description below. The Summary is neither intended to identify key features or main features of the present disclosure, nor intended to limit the scope of the present disclosure.

DETAILED DESCRIPTION

Principles of the present disclosure will be described below with reference to several example embodiments illustrated in the accompanying drawings.

The term “include” and variants thereof used in this text indicate open-ended inclusion, that is, “including but not limited to.” Unless specifically stated, the term “or” means “and/or.” The term “based on” means “based at least in part on.” The terms “an example embodiment” and “an embodiment” indicate “a set of embodiments.” The term “another embodiment” indicates “a group of other embodiments.” The terms “first,” “second,” and the like may refer to different or identical objects. Other explicit and implicit definitions may also be included below.

As discussed above, a model drift occurs frequently throughout the life cycle of a deep neural network model. The model drift refers to that the effect of an old model becomes worse over time under the latest features. The model drift can be classified into at least two categories: concept drift and data drift. The concept drift refers to a change in the distribution or definition of labels, while the data drift refers to a change in the distribution of features. Traditional model drift detection usually relies on confidence information and ground truth derived from model inference. In other words, in the traditional model drift detection, a model may be considered to have a drift only when a large number of prediction results obtained through prediction by the model do not match corresponding ground truths. Apparently, there is a lag in this detection method, and the labor cost is high.

In order to solve, at least in part, the above problem, an embodiment of the present disclosure provides a novel solution for detecting model performance. First, a computing device may provide an input feature related to field data to a target model to be detected, for the target model to determine a confidence of a prediction result. Correspondingly, a self-coding model for monitoring features in the target model may be built in parallel for the target model. The computing device may reconstruct the input feature using the self-coding model to determine a reconstruction error. Therefore, whether the target model has a drift can be determined at least based on a comparison between the confidence and a first threshold and a comparison between the reconstruction error and a second threshold. In addition, the detection process can also detect Shapley value vectors in the target model and the self-coding model. In the above operations, the model is monitored from an inference confidence and the reconstruction error, thus avoiding the dependence on the ground truth, so that a model drift can be found in a timely manner, and a high labor cost will not be generated. In addition, due to the introduction of observation on the Shapley value vectors, internal causes of a model drift can be automatically identified, and a countermeasure can be worked out, which significantly improves the user experience.

FIG.1shows a schematic diagram of example environment100according to an embodiment of the present disclosure. In example environment100, a device and/or a process according to an embodiment of the present disclosure may be implemented. Example environment100includes input feature110, target model120to be detected, computing device130, and output detection result140. Computing device130obtains detection result140, such as whether target model120is in a drift state, by means of monitoring input feature110and target model120.

An example of computing device130includes, but is not limited to, a personal computer, a server computer, a handheld or laptop device, a mobile device (such as a mobile phone, a personal digital assistant (PDA), and a media player), a multiprocessor system, a consumer electronic product, a small computer, a mainframe computer, a distributed computing environment including any of the above systems or devices, and the like.

In some embodiments, computing device130may extract input feature110from received input data. The received input data may be voice data, text data, or pictures input by a user. Thus, target model120determines a prediction result based on input feature110to determine a confidence of the prediction result. Computing device130may determine detection result140based on input feature110and the confidence output by target model120, so as to remind the user when it is detected that target model120is in the drift state, or to recommend a countermeasure that improves the performance of target model120to the user.

The above examples are intended to describe the present disclosure only and are not specific limitations to the present disclosure. In order to explain principles of the above solution more clearly, the process for training and applying a model will be described in more detail below with reference toFIG.2.

FIG.2illustrates a schematic diagram of detailed example environment200for training and applying a model according to an embodiment of the present disclosure. As shown inFIG.2, example environment200may include computing device220, field data210input into computing device220, and prediction result230output from computing device220and corresponding to field data210. Example environment200may generally include model training system260and model application system270. As an example, model training system260and/or model application system270may be implemented in computing device130as shown inFIG.1or in computing device220as shown inFIG.2. It should be understood that the structure and functions of example environment200are described for illustrative purposes only, and are not intended to limit the scope of the subject matter described herein. The subject matter described herein may be implemented in different structures and/or functions.

As mentioned above, the process of processing field data210using target model240may be divided into two stages: a model training stage and a model application stage. As an example, in the model training stage, model training system260can use training dataset250to train target model240used for performing corresponding functions. It should be understood that training dataset250may be a combination of a plurality of pieces of sample data (as an input to target model240) and corresponding labeled supervision information (or referred to as “label” or “ground truth”). In the model application stage, model application system270may receive trained target model240. Thus, target model240loaded into computing device220of model application system270may determine prediction result230based on field data210.

In other embodiments, target model240may be constructed as a learning network. In some embodiments, this learning network may include multiple networks, wherein each of the networks may be a multilayer neural network that may be constituted by a large number of neurons. Through the training process, corresponding parameters of the neurons in each of the networks can be determined. Parameters of the neurons in these networks are collectively referred to as parameters of target model240.

The training process of target model240may be performed in an iterative manner until at least some of the parameters of target model240converge or until a predetermined number of iterations is performed, thereby obtaining final model parameters.

The technical solution described above is only used as an example, and does not limit the present disclosure. It should be understood that the networks may also be disposed according to other manners and connection relationships. In order to explain principles of the above solution more clearly, the process for detecting model performance will be described in more detail below with reference toFIG.3.

The process for detecting model performance according to an embodiment of the present disclosure will be described in detail below with reference toFIG.3. For ease of understanding, specific data mentioned in the following description is illustrative and is not intended to limit the protection scope of the present disclosure. It should be understood that embodiments described below may also include additional actions not shown and/or may omit actions shown, and the scope of the present disclosure is not limited in this regard.

FIG.3illustrates a flow chart of process300of detecting model performance according to an embodiment of the present disclosure. Process300for detecting the performance of a target model according to an embodiment of the present disclosure is now described with reference toFIG.3. For ease of understanding, specific examples mentioned in the following description are illustrative and are not intended to limit the protection scope of the present disclosure.

As shown inFIG.3, at302, computing device130may acquire a prediction result of input feature110using target model120to determine a confidence of the prediction result. In some embodiments, when target model120is a deep neural network model, the confidence of the prediction result inferred by target model120can be determined based on the distribution of scores output by the model. It should be understood that a high confidence of model inference may usually indicate that the model has been fully trained, while a low confidence of model inference may usually indicate that the model is insufficiently trained.

At304, computing device130may reconstruct the input feature using the self-coding model to determine a reconstruction error. It should be understood that the reconstruction error is a difference between the input feature before being reconstructed by the self-coding model and the input feature after being reconstructed by the self-coding model. The self-coding model is an unsupervised neural network model, which can learn implicit features of input data. This is referred to as coding. At the same time, original input data can be reconstructed using the new features learned. This is referred to as decoding. It should be understood that a small reconstruction error indicates that the input data is included in the training dataset, while a large reconstruction error indicates that the input data is not included in the training dataset.

At306, computing device130may determine detection result140of target model120at least based on a comparison between the confidence and a first threshold and a comparison between the reconstruction error and a second threshold. In this way, the dependency on the ground truth is avoided, so that a model drift can be found in a timely manner.

FIG.4illustrates a schematic diagram of overall architecture400of a detection result for determining model performance according to an embodiment of the present disclosure.

As shown inFIG.4, confidence421of the prediction result can be determined based on input feature410with target model420. At the same time, first Shapley value vector441can be determined based on input feature410and target model420with first visualization tool440. It should be understood that first visualization tool440can be a model visualization tool such as DeepSHAP. For example, the importance of each feature of input features x in target model420can be determined with the DeepSHAP. These values can form Shapley value vector DeepSHAP(x)dnn, that is, first Shapley value vector441.

Correspondingly or in parallel, reconstruction error431can be determined based on input feature410with self-coding model430. At the same time, second Shapley value vector451can be determined based on input feature410and self-coding model430with second visualization tool450.

FIG.5illustrates a schematic diagram of example scenario500of a self-coding model according to an embodiment of the present disclosure. As shown inFIG.5, self-coding model520is trained to be able to reconstruct input data. For example, input feature X510of the input data is provided to self-coding model520. Self-coding model520performs down-sampling on the input feature X through a coding process, and reconstructs input feature X′530through a decoding process. When the input feature is normal, a difference (i.e. the reconstruction error) between the reconstructed input feature X′ and the input feature X will be small enough. Thus, self-coding model520can be constructed to monitor input feature410in target model420inFIG.4.

Returning back toFIG.4, it should be understood that second visualization tool450can be the same as first visualization tool440. For example, the importance of each feature of input features x in self-coding model430can be determined with the DeepSHAP. These values can form Shapley value vector DeepSHAP(x)ae, that is, second Shapley value vector451.

Finally, computing device130may determine detection result460based on confidence421, first Shapley value vector441, reconstruction error431, and second Shapley value vector451.

In some embodiments, when the confidence is greater than the first threshold and the reconstruction error is less than the second threshold, computing device130may determine detection result140as being normal. In other words, when target model120has been fully trained and the input data in the field is included in the training dataset for training target model120, it can be determined that target model120does not have a model drift, so target model120can continue to be used normally.

In some embodiments, assuming that a ground truth of the input data in the field can be obtained by means of sampling or in other ways, when the confidence is greater than the first threshold, the reconstruction error is less than the second threshold, and a difference between the prediction result and the ground truth exceeds a predetermined range, computing device130can determine detection result140as a concept drift. It should be understood that the concept drift is usually caused by a change in the environment, so there will be deviations in the prediction result. For example, a plurality of film and television works related to a famous person can be usually obtained after the name of the famous person is entered. However, if the famous person is involved in a certain specific event of great current interest, an output result will become the event, causing a drift. When it is determined that target model120has a drift, computing device130may further retrain target model120on a training dataset that is different from a training dataset which was used for training target model120.

In some embodiments, when the confidence is less than the first threshold and the reconstruction error is less than the second threshold, computing device130can determine that detection result140indicates target model120being under fitted. When it is determined that target model120is under fitted, computing device130may decrease a learning rate for training the target model, and retrain target model120on the training dataset for training target model120using the decreased learning rate.

In some embodiments, when the confidence is less than the first threshold and the reconstruction error is greater than the second threshold, computing device130may determine that detection result140indicates appearance of a new feature pattern. For example, in the application of a face recognition model, new face data appears. When it is determined that the new feature pattern appears in target model120, computing device130can further determine the new feature pattern based on the second Shapley value vector, and incrementally train target model120on a new training dataset that conforms to the new feature pattern. Since the Shapley value vector can determine features with high importance in the new feature pattern, the training data that conforms to the new feature pattern can be purposefully prepared.

In some embodiments, when the confidence is greater than the first threshold and the reconstruction error is greater than the second threshold, if a similarity between the first Shapley value vector and the second Shapley value vector is greater than a third threshold, it means that features that cause an abnormality also contribute to high confidence inference. At this time, computing device130can determine the detection result as a concept drift. Furthermore, computing device130may further retrain target model120on a training dataset that is different from the training dataset which was used for training target model120. However, if the similarity between the first Shapley value vector and the second Shapley value vector is less than the third threshold, the features that cause the abnormality will not contribute to the high confidence inference. At this time, computing device130can determine the detection result as being undetermined. At this time, no measures may be taken, and the model performance is further observed.

Through the above embodiments, the performance of the model can be detected and monitored without a ground truth. Thus, the model drift can be automatically detected throughout the life cycle of the model. In addition, due to the Shapley value vector introduced in the present disclosure, diagnostic opinions and further model updating policies can be provided when the model performance is low. These operations may not increase the labor cost, so the user experience is significantly improved.

FIG.6is a block diagram of example device600that may be configured to implement embodiments of the present disclosure. For example, device600may be configured to implement computing device130as shown inFIG.1. As shown in the drawing, device600includes a central processing unit (CPU)601that may perform various appropriate actions and processing according to computer program instructions stored in read-only memory (ROM)602or computer program instructions loaded from storage unit608into random access memory (RAM)603. Various programs and data required for the operation of device600may also be stored in RAM603. CPU601, ROM602, and RAM603are connected to each other through bus604. Input/output (I/O) interface605is also connected to bus604.

A plurality of components in device600are connected to I/O interface605, including: input unit606, such as a keyboard and a mouse; output unit607, such as various types of displays and speakers; storage unit608, such as a magnetic disk and an optical disc; and communication unit609, such as a network card, a modem, and a wireless communication transceiver. Communication unit609allows device600to exchange information/data with other devices via a computer network, such as the Internet, and/or various telecommunication networks.

CPU601performs the various methods and processing described above, such as process300. For example, in some embodiments, the various methods and processing described above may be implemented as a computer software program or a computer program product, which is tangibly included in a machine-readable medium, such as storage unit608. In some embodiments, part of or all the computer program may be loaded and/or installed onto device600via ROM602and/or communication unit609. When the computer program is loaded into RAM603and executed by CPU601, one or a plurality of steps of any process described above may be implemented. Alternatively, in other embodiments, CPU601may be configured in any other suitable manners (for example, by means of firmware) to perform a process such as process300.

Embodiments of the present disclosure include a method, an apparatus, a system, and/or a computer program product. The computer program product may include a computer-readable storage medium on which computer-readable program instructions for performing various aspects of the present disclosure are loaded.

Various embodiments of the present disclosure have been described above. The foregoing description is illustrative rather than exhaustive, and is not limited to the disclosed various embodiments. Numerous modifications and alterations will be apparent to persons of ordinary skill in the art without departing from the scope and spirit of the illustrated embodiments. The selection of terms used herein is intended to best explain the principles and practical applications of the embodiments and their associated improvements, so as to enable persons of ordinary skill in the art to understand the embodiments disclosed herein.