A model detection method, device, apparatus and storage medium

By performing feature extraction and multimodal fusion processing on the data to be detected, and combining the metric model and outlier data updates, the problem of decreased accuracy of the prediction model under unknown samples was solved, thereby improving prediction accuracy and model adaptability.

CN114419420BActive Publication Date: 2026-07-28LENOVO (BEIJING) LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
LENOVO (BEIJING) LTD
Filing Date
2021-12-31
Publication Date
2026-07-28

AI Technical Summary

Technical Problem

Existing prediction models suffer a sharp drop in accuracy when encountering unknown samples that are different from the training samples, failing to meet the needs of industrial applications.

Method used

By performing feature extraction and multimodal fusion processing on the data to be detected, target features are obtained. The distribution information of training samples is determined using a metric model for metric calculation, the correctness of the prediction results is judged, and the model is updated using outlier data.

Benefits of technology

It improved the accuracy of prediction results, reduced the impact of erroneous predictions on the production process, clarified the direction of model updates, and improved the adaptability and accuracy of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114419420B_ABST
    Figure CN114419420B_ABST
Patent Text Reader

Abstract

The embodiment of the application discloses a model detection method, device and equipment and a storage medium. The method comprises the following steps: inputting to-be-detected data into a target prediction model to obtain a prediction result; performing feature extraction on the to-be-detected data to determine a plurality of features corresponding to the to-be-detected data; performing multi-modal fusion processing on the plurality of features to obtain target features corresponding to the to-be-detected data; determining training sample distribution information corresponding to the target prediction model through a measurement model, performing measurement calculation on the training sample distribution information and the target features, and obtaining a measurement result; and determining whether the prediction result is correct according to the measurement result. In this way, the measurement result between the target features of the to-be-detected data and the training sample distribution information can be used to determine whether the prediction result of the target prediction model is correct, and the target prediction model in the production environment can be supervised.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer software technology, and in particular to a model testing method, apparatus, device, and storage medium. Background Technology

[0002] With the continuous development of artificial intelligence technology, various prediction models are being applied to industrial application scenarios. For prediction models, the accuracy is high when encountering samples similar to the training samples; however, when encountering unknown samples different from the training samples, the accuracy of the prediction model drops sharply, thus failing to meet the application requirements of real-world scenarios. Summary of the Invention

[0003] This application provides a model testing method, apparatus, device, and storage medium.

[0004] The technical solution of this application is implemented as follows:

[0005] In a first aspect, embodiments of this application provide a model detection method, the method comprising:

[0006] Input the data to be detected into the target prediction model to obtain the prediction result;

[0007] Feature extraction is performed on the data to be detected to determine multiple features corresponding to the data to be detected.

[0008] Multimodal fusion processing is performed on multiple features to obtain the target features corresponding to the data to be detected;

[0009] The distribution information of training samples corresponding to the target prediction model is determined by the metric model, and the metric calculation is performed on the distribution information of training samples and target features to obtain the metric result.

[0010] Based on the measurement results, determine whether the prediction results are correct.

[0011] Secondly, embodiments of this application provide a model detection device, including:

[0012] The prediction unit is configured to input the data to be detected into the target prediction model to obtain the prediction result;

[0013] The extraction unit is configured to extract features from the data to be detected and determine multiple features corresponding to the data to be detected.

[0014] The fusion unit is configured to perform multimodal fusion processing on multiple features to obtain the target features corresponding to the data to be detected;

[0015] The computing unit is configured to determine the training sample distribution information corresponding to the target prediction model through the metric model, perform metric calculations on the training sample distribution information and target features, and obtain the metric results.

[0016] The processing unit is configured to determine whether the prediction result is correct based on the measurement result.

[0017] Thirdly, embodiments of this application provide a model detection device, which includes a memory and a processor; wherein,

[0018] Memory is used to store computer programs that can run on a processor;

[0019] A processor is used to execute steps such as those in the first aspect when running a computer program.

[0020] Fourthly, embodiments of this application provide a computer storage medium storing a computer program that, when executed, implements the steps of the method described in the first aspect.

[0021] This application provides a model detection method, apparatus, device, and storage medium. The method includes: inputting data to be detected into a target prediction model to obtain a prediction result; extracting features from the data to be detected to determine multiple features corresponding to the data; performing multimodal fusion processing on the multiple features to obtain target features corresponding to the data to be detected; determining the distribution information of training samples corresponding to the target prediction model through a metric model; performing metric calculation on the distribution information of training samples and the target features to obtain a metric result; and determining whether the prediction result is correct based on the metric result. Thus, by performing feature extraction and multimodal fusion processing on the data to be detected, the obtained target features can more comprehensively reflect the relevant information of the data to be detected, improving the accuracy of subsequent judgments. Furthermore, by using the metric result between the target features of the data to be detected and the distribution information of training samples to determine whether the data to be detected is abnormal, the accuracy of the prediction result of the target prediction model can be judged, enabling supervision of the target prediction model in the production environment and reducing erroneous prediction results. Attached Figure Description

[0022] Figure 1 A schematic flowchart of a model detection method provided in an embodiment of this application;

[0023] Figure 2 A flowchart illustrating another model detection method provided in an embodiment of this application;

[0024] Figure 3 This is a schematic diagram of the structure of a model detection device provided in an embodiment of this application;

[0025] Figure 4 This is a schematic diagram illustrating the working process of a model detection device provided in this application embodiment;

[0026] Figure 5 A schematic diagram of another model detection device provided in an embodiment of this application;

[0027] Figure 6 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application;

[0028] Figure 7 This is a schematic diagram of the composition structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0029] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It is understood that the specific embodiments described herein are merely for explaining the relevant application and not for limiting the application. Furthermore, it should be noted that, for ease of description, only the parts relevant to the application are shown in the accompanying drawings.

[0030] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0031] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0032] It should be noted that the terms "first, second, and third" used in the embodiments of this application are only used to distinguish similar objects and do not represent a specific order of objects. It is understood that "first, second, and third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.

[0033] It should be understood that with the rapid development of artificial intelligence, various predictive models (such as edge inference models) are constantly being implemented in actual production. For predictive models to be used in actual production processes, a large number of training samples are needed to determine various model parameters. However, in actual production, changes in the production environment may generate some unknown samples that differ significantly from the training samples. In these cases, the predictive model cannot accurately judge them, causing a sharp drop in accuracy, and even failing to meet industrial application standards. In other words, these unknown samples can seriously affect the predictive accuracy of the model when applied, causing problems in the actual production process.

[0034] Based on this, this application provides a model detection method. The basic idea is as follows: input the data to be detected into a target prediction model to obtain a prediction result; extract features from the data to be detected to determine multiple features corresponding to the data; perform multimodal fusion processing on the multiple features to obtain target features corresponding to the data to be detected; determine the training sample distribution information corresponding to the target prediction model through a metric model; perform metric calculations on the training sample distribution information and the target features to obtain a metric result; and determine whether the prediction result is correct based on the metric result. In this way, by performing feature extraction and multimodal fusion processing on the data to be detected, the obtained target features can more comprehensively reflect the relevant information of the data to be detected, improving the accuracy of subsequent judgments. Furthermore, by using the metric result between the target features of the data to be detected and the training sample distribution information to determine whether the data to be detected is abnormal, the accuracy of the prediction result of the target prediction model can be judged, enabling supervision of the target prediction model in the production environment and reducing losses caused by erroneous prediction results.

[0035] The embodiments of this application will now be described in detail with reference to the accompanying drawings.

[0036] In one embodiment of this application, see Figure 1 This illustrates a flowchart of a model detection method provided in an embodiment of this application. Figure 1 As shown, the method may include:

[0037] S101: Input the data to be detected into the target prediction model to obtain the prediction result.

[0038] It should be noted that the model detection method provided in this application embodiment can be applied to various electronic devices with computing functions.

[0039] In the embodiments of this application, the target prediction model can be a reasoning model from various fields, such as image processing, speech recognition, natural language recognition, etc. Specifically, the target prediction model is used to perform specific detections on the data to be detected in order to output prediction results.

[0040] S102: Extract features from the data to be detected and determine multiple features corresponding to the data to be detected.

[0041] It should be noted that feature extraction is performed across multiple dimensions, thereby obtaining multiple features corresponding to the data to be detected. In this way, multiple features can reflect information about the data to be detected from different dimensions, improving the accuracy of subsequent judgments.

[0042] S103: Perform multimodal fusion processing on multiple features to obtain the target features corresponding to the data to be detected.

[0043] It should be noted that through multimodal fusion processing, features from multiple dimensions are fused into target features to facilitate subsequent processing. Here, multimodal fusion processing can employ various principles, such as front-end fusion, intermediate fusion, and back-end fusion.

[0044] S104: Determine the distribution information of the training samples corresponding to the target prediction model through the measurement model, perform measurement calculations on the distribution information of the training samples and the target features, and obtain the measurement results.

[0045] It should be noted that the training sample distribution information refers to the characteristics of the sample data (hereinafter referred to as the original training samples) used to train the target prediction model.

[0046] In one specific embodiment, the training sample distribution information is obtained by clustering the target features of the original training samples. In this case, the target features of the original training samples form multiple cluster centers after clustering, and the measurement result can be obtained by the distance between the target features and the cluster centers.

[0047] It should be understood that the target prediction model is trained using a large number of original training samples. If the data to be detected is similar to the original training samples, the prediction result is relatively reliable; if the data to be detected deviates significantly from the original training samples, the prediction result is unreliable. Based on this, the metric model obtains a metric result by detecting the distance between the data to be detected and the original training samples. This metric result can then be used to further verify the accuracy of the target prediction model's predictions.

[0048] Furthermore, in some embodiments, the metric model may include an anti-forgetting module and at least one metric calculation sub-model. The step of determining the training sample distribution information corresponding to the target prediction model through the metric model, and performing metric calculations on the training sample distribution information and target features to obtain the metric result includes:

[0049] Obtain training sample distribution information from the anti-forgetting module;

[0050] The target features and training sample distribution information are calculated based on at least one metric calculation sub-model to obtain at least one metric score information;

[0051] At least one metric score is determined as the metric result.

[0052] It should be noted that the metric model includes an anti-forgetting module for storing the distribution information of training samples and a metric calculation sub-model for performing metric calculations.

[0053] The metric calculation sub-model can perform metric calculation and scoring on the target features and the distribution features of the original training samples to obtain metric score information. In this way, the similarity between the data to be detected and the original training samples can be determined through the metric score information.

[0054] Here, the number of metric calculation sub-models is at least one, which allows for the determination of the similarity between the data to be detected and the original training samples from different dimensions, thereby improving the comprehensiveness and accuracy of the metric results.

[0055] S104: Based on the measurement results, determine whether the prediction results are correct.

[0056] It should be noted that if the measurement result indicates a high similarity between the data to be detected and the original training samples, then the prediction result is determined to be correct; if the measurement result indicates a low similarity between the data to be detected and the original training samples, then the prediction result is determined to be incorrect.

[0057] Thus, the model detection method provided in this application can determine whether the prediction result of the target prediction model is correct based on the difference between the sample to be detected and the original training sample, thereby realizing automated detection of the prediction result.

[0058] Furthermore, in some embodiments, the method may further include:

[0059] If the prediction is correct, output the prediction result;

[0060] In the event of an incorrect prediction, the data to be detected is identified as anomalous; the anomalous data is stored in the target area; and when the number of anomalous data in the target area reaches the target threshold, all anomalous data is used to update the target prediction model and metric model.

[0061] In this way, if the prediction result is determined to be correct, the prediction result is output to the user for further application. If the prediction result is determined to be incorrect, the data to be detected is stored as abnormal data, and the target prediction model is updated later using the abnormal data. This improves the reliability of the target prediction model, preventing erroneous predictions from negatively impacting the production process. It also clarifies the update direction of the target prediction model, improving the efficiency of model updates. Furthermore, through the model detection method provided in this application, if abnormal data accumulates to a certain amount (or other model update conditions are met), the target prediction model can be automatically updated using the abnormal data in the target area without user interaction, achieving seamless updates.

[0062] It should be noted that after updating the target prediction model using outlier data, the outlier data actually becomes part of the "original training samples" of the target prediction model. Therefore, it is also necessary to use outlier data to update the metric model in order to update the training sample distribution information in the metric model.

[0063] Furthermore, embodiments of this application categorize abnormal data into three anomaly types to facilitate the subsequent selection of different strategies to update the target prediction model. Therefore, in some implementations, the method may further include:

[0064] Interpolate at least one metric score to obtain outlier values ​​for the outlier data;

[0065] The outlier values ​​and outlier thresholds of the abnormal data are compared to determine the outlier category of the abnormal data.

[0066] It should be noted that outliers are calculated using at least one metric score. The higher the outlier, the greater the deviation between the outlier and the original training samples. Interpolation is not mandatory here; methods such as mean calculation can also be used to determine outliers.

[0067] It should be noted that, in this embodiment, abnormal data is categorized into three types based on the degree of deviation between the abnormal data and the original training samples: novel samples, difficult-to-learn samples, or drifting samples. A difficult-to-learn sample refers to abnormal data that falls within the coverage of the original training samples but is difficult to predict; a drifting sample refers to abnormal data that deviates from the original training samples, but the deviation is not significant; and a novel sample refers to abnormal data that is of a different type than the original training samples.

[0068] For example, suppose the target prediction model is used to identify cats in the data to be detected. The original training samples are a large number of pictures of orange cats. Then, hard-learning samples, drift samples, and new type samples can be understood as follows: hard-learning samples are still pictures of orange cats, but they are different from the original training samples; drift samples may be pictures of black cats; and new type samples may be pictures of dogs.

[0069] In one specific embodiment, the outliers of hard-to-learn samples, drift samples, and novel samples increase sequentially. Accordingly, the outlier thresholds include a first outlier threshold and a second outlier threshold, with the first outlier threshold being less than the second outlier threshold.

[0070] If the outlier value of the outlier is less than or equal to the first outlier threshold, the outlier is identified as a difficult-to-learn sample.

[0071] If the outlier of the abnormal data is greater than the first abnormal data and the outlier of the abnormal data is less than or equal to the second abnormal threshold, the abnormal data is determined to be a drift sample.

[0072] If the outlier of the abnormal data is greater than that of the first person's abnormal data, the abnormal data is determined to be a new type of sample.

[0073] By following these steps, we can determine the anomaly category of the data, thus providing guidance for users to annotate it.

[0074] In some embodiments, after determining the anomaly category of the abnormal data, the method may further include determining annotation suggestion information for the abnormal data based on the anomaly category of the abnormal data;

[0075] Send abnormal data to users based on the annotation suggestions for abnormal data;

[0076] Receive the real tags of abnormal data sent by users.

[0077] It's important to note that annotation suggestion information refers to information used to guide users in annotation. For example, to help users quickly annotate outlier data, some preset options might be provided for users to choose from. In this case, annotation suggestion information refers to what preset options are provided.

[0078] For example, for difficult-to-learn samples and drifting samples, it is necessary to ask the user whether the prediction result is wrong; for new types of samples, it is necessary to ask the user what the true category of the abnormal data is.

[0079] It should be noted that since hard-to-learn samples, drifting samples, and novel samples are automatically classified based on an anomaly threshold, classification errors may occur. Therefore, the anomaly threshold can be designed to be adaptive. In other words, after the user labels the anomaly data with its true label, the anomaly threshold will also be adaptively adjusted based on the true label of the anomaly data.

[0080] In some embodiments, such as Figure 2 As shown, the process of updating the target prediction model using all abnormal data may include:

[0081] S201: Perform statistical analysis on the abnormal data belonging to new types of samples, the abnormal data belonging to difficult-to-learn samples, and the abnormal data belonging to drift samples, and obtain the statistical results.

[0082] It should be noted that when the number of abnormal data in the target area reaches the target threshold, it indicates that the reliability of the target prediction model can no longer meet the requirements of production practice, and therefore it needs to be updated.

[0083] After the update begins, the anomaly types of the abnormal data are statistically analyzed to determine the update direction of the target prediction model.

[0084] S202: Determine the data offset value based on the statistical results.

[0085] It should be noted that, here, the data offset value is used to indicate the degree of deviation between the data to be detected and the original training samples. In other words, the data offset value can be used to quantitatively detect the degree of deviation between the data to be detected and the original training samples.

[0086] Based on the foregoing, the degree of deviation between difficult-to-learn samples, drift samples, and novel samples and the original training samples differs. For example, if the abnormal data is predominantly composed of difficult-to-learn samples and / or drift samples, the data deviation value is small, indicating a small deviation between the data to be detected in production practice and the original training samples. Conversely, if the abnormal data is predominantly composed of novel samples, the data deviation value is large, indicating a large deviation between the data to be detected in production practice and the original training samples.

[0087] Here, the specific calculation method for the data offset value can be determined according to the actual application scenario. For example, the proportion of new type samples to all abnormal data can be used as the data offset value; or, a certain weight can be assigned to each type of abnormal data, and then a weighted calculation can be performed.

[0088] S203: When the data offset value is greater than the offset threshold, the target prediction model is updated based on the first type of update strategy, using all the abnormal data and the true labels of all the abnormal data.

[0089] S204: When the data offset value is less than or equal to the offset threshold, the target prediction model is updated based on the second type of update strategy, using all the abnormal data and the true labels of all the abnormal data.

[0090] Here, the retention rate of the original model features of the target prediction model in the first type of update strategy is less than the retention rate of the original model features of the target prediction model in the second type of update strategy.

[0091] It should be noted that if the data offset value is large, it means that the deviation between the data to be detected in production practice and the original training samples is greater, and the importance of the original model features is smaller. In this case, fewer original model features are retained during the update process. Conversely, if the data offset value is small, it means that the deviation between the data to be detected in production practice and the original training samples is smaller, and the importance of the original model features is greater. In this case, more original model features are retained during the update process.

[0092] For example, the first type of update strategy can be Few-Shot Learning, and the second type of update strategy can be Transfer Learning.

[0093] In other words, the target prediction model is obtained by training the neural network model using the original training samples. The target prediction model largely depends on the original training samples selected during the initial model training process, and it can only be applied to detection data similar to the original training samples. However, in real-world production environments, the detection data is constantly changing, and it cannot be guaranteed that the original training samples can cover all types of detection data. Therefore, the target prediction model needs to be continuously updated to adapt to these changes.

[0094] Specifically, the purpose of model updating is to adapt to the detection data (i.e., outlier data) that deviates significantly from the original training samples. Therefore, the specific strategy for model updating also depends on the type of outlier data. In the embodiments of this application, at least the following three scenarios exist:

[0095] Scenario 1: The data to be detected in the production environment remains basically unchanged, except for some difficult-to-learn samples. For example, abnormal data still falls within the coverage of the original training samples, but the result of the target prediction model is still wrong.

[0096] Scenario 2: The data to be tested in the production environment has some offset compared to the original training samples, but the overall offset is not large, that is, drifted samples, for example, the original training data was orange cats, and now it is black cats, etc.

[0097] Scenario 3: The data to be tested in the production environment has a large deviation compared to the original training samples, and new types of samples have appeared. For example, the original training data was cats, but now there are dogs in the samples.

[0098] For the above situations, different update strategies need to be adopted when updating the model: (1) For scenario one and scenario two, the transfer learning method is adopted, which is the second type of update strategy; (2) For scenario three, the Few-Shot Learning method is adopted. Generally, the model update method is to first infer the features of the original data, and then update these features during the update.

[0099] The difference between Transfer Learning and Few-Shot Learning lies in the proportion of pre-saved features updated. In other words, the update strategy depends entirely on the degree of input data offset. The model detection method provided in this application can quantitatively detect the degree of input data offset, and then selects one of the two different update strategies based on the detected offset during model updates.

[0100] In simple terms, the update strategy depends entirely on the degree of offset of the input data. This method can quantitatively detect the degree of offset of the input data, and then select one of the two different update strategies mentioned above based on the different degrees of offset detected during model update.

[0101] In this way, based on the anomaly category of the abnormal data, the update strategy of the target prediction model can be clearly defined, thereby improving the efficiency of model update.

[0102] Furthermore, in some embodiments, the method may further include:

[0103] The original training samples are used to train and a target prediction model is established; and,

[0104] Obtain the target features of the original training samples, and determine the training sample distribution information of the target prediction model based on the target features of the original training samples.

[0105] Store the training sample distribution information in the anti-forgetting module;

[0106] If the prediction result is correct, the target features of the data to be detected are used to update the training sample distribution information in the anti-forgetting module;

[0107] In the event of an incorrect prediction, during the training of the target prediction model using anomalous data and the true labels of the anomalous data, the target features of the anomalous data are determined and the training sample distribution information in the anti-forgetting module is updated.

[0108] It should be noted that the calculation methods for the target features of the original training samples and the target features of the abnormal data can refer to the calculation methods for the target features of the data to be detected.

[0109] It should be noted that the anti-forgetting module can be understood as a database storing group feature vectors that can represent all input samples, where each specific feature vector can represent a subset of data samples. The role of the anti-forgetting module is to prevent catastrophic forgetting during the model update process. Catastrophic forgetting refers to the situation where the target prediction model forgets the original data features while learning new features, resulting in poor performance on the initial task. During model updates, it is relatively easy to train the model with new data (i.e., the anomalous data in this embodiment) so that the model learns the features of the new data, thus performing better and achieving higher accuracy on the new data. The more challenging aspect is to learn new features without forgetting the features of historical data, achieving high accuracy on both new and old tasks. The anti-forgetting module prevents catastrophic forgetting by updating only a small subset of group feature vectors most relevant to the new data and controlling the degree of updating these vectors.

[0110] In addition, the generation of the anti-forgetting module can be divided into the following steps: (1) Initialization stage, that is, when the target prediction model is deployed to the device, the anti-forgetting module is calculated based on all the original training samples in the training set. It should be understood that most of the original training samples will be correctly predicted by the target prediction model. (2) Model usage stage, the target features of the samples to be detected with correct prediction results are updated into the anti-forgetting module; (2) Model update stage, the target features of abnormal samples are updated into the anti-forgetting module.

[0111] In addition, the metric model is essentially a non-parametric model. The metric model can be updated by updating the distribution information of the training data in the metric model, which results in fast computation speed and low computational pressure.

[0112] In summary, the model detection method utilizes multimodal fusion features and various learnable metric models to detect data from different dimensions. It can determine whether a sample is an anomaly and provide classification suggestions. Furthermore, the metric model is non-parametric, allowing for correction of the target prediction model's output, and its computational load is relatively low, placing no additional burden on the equipment. Thus, the model detection method provided in this application not only allows for secondary evaluation of the target detection model's prediction results, improving its accuracy, but also clarifies the update direction, ensuring the updated model is adaptable to real-world production environments.

[0113] This application provides a model detection method, which includes: inputting the data to be detected into a target prediction model to obtain a prediction result; extracting features from the data to be detected to determine multiple features corresponding to the data; performing multimodal fusion processing on the multiple features to obtain target features corresponding to the data to be detected; determining the distribution information of training samples corresponding to the target prediction model through a metric model; performing metric calculation on the distribution information of training samples and target features to obtain a metric result; and determining whether the prediction result is correct based on the metric result. In this way, by performing feature extraction and multimodal fusion processing on the data to be detected, the obtained target features can more comprehensively reflect the relevant information of the data to be detected, improving the accuracy of subsequent judgments. Furthermore, by using the metric result between the target features of the data to be detected and the distribution information of training samples to determine whether the data to be detected is abnormal, the accuracy of the prediction result of the target prediction model can be judged. This allows for the supervision of the target prediction model in the production environment, reducing losses caused by erroneous prediction results.

[0114] In another embodiment of this application, see Figure 3 This illustrates a schematic diagram of the structure of a model detection device 30 provided in an embodiment of this application. Figure 3As shown, the model detection device may include an outlier detection module 301, a user annotation suggestion module 302, and an outlier sample management module 303.

[0115] See Figure 4 This illustrates a schematic diagram of the working process of a model detection device 30 provided in an embodiment of this application. Figure 4 As shown, after the target prediction model predicts the data to be detected and obtains the model prediction result, the model detection device 30 further determines whether the model prediction result is correct through the outlier detection module 301, the user annotation suggestion module 302, and the outlier sample management module 303. Specific details are as follows:

[0116] The working process of the outlier detection module 301 includes: (1) Feature extraction by pre-trained network. After receiving the data to be detected, the features of the data to be detected are extracted using the pre-trained network. (2) Multimodal fusion processing. Due to the diversity of samples in real-world scenarios, this embodiment performs multimodal fusion processing on the various features of the data to be detected to obtain the target features of the data to be detected. (3) Measurement calculation using training data distribution information. The training data distribution information is obtained from the anti-forgetting module, and the training data distribution information is used to indicate the features of the training samples of the target prediction model. Measurement calculations are performed on the target features of the data to be detected and the training data distribution information in different dimensions to obtain multiple measurement results. (4) Comprehensive scoring based on multiple measurement results. The correctness of the prediction result of the target prediction model is calculated by comprehensively considering the scores of multiple measurement results.

[0117] Here, if the prediction is correct, the prediction result is output, and the distribution information of the training samples in the anti-forgetting module is updated using the target features of the data to be detected to improve the accuracy of judging subsequent samples and prevent "catastrophic forgetting". If the prediction result is incorrect, the outlier value of the data to be detected is calculated by using an interpolation algorithm based on the scoring information of multiple metrics. Subsequently, the user interaction annotation module 302 will also provide anomaly category suggestions based on the task scenario and the outlier value of the data to be detected, such as whether the data to be detected is a new category sample, and then push the data to be detected to the user interaction interface to guide the user in annotating the data to be detected.

[0118] Specifically, the user interaction annotation module 302 works by comparing the outlier values ​​of the data to be detected calculated by the outlier detection module 301 with an adaptive outlier threshold, distinguishing the outlier data as belonging to one of three types of outlier samples, and then guiding manual category annotation and verification. Here, misclassified samples can be divided into three types: the first is hard-to-learn samples, the second is concept drift samples, and the third is samples that are far from the distribution of the training dataset.

[0119] Thus, after the user interaction annotation module 302 determines the anomaly category of the abnormal data, it provides annotation suggestions based on the anomaly category, thereby guiding the user to annotate the abnormal data. Figure 4 "User interaction annotation abnormal data" in the text.

[0120] The abnormal sample data management module 303 can collect, manage, and store user-annotated abnormal data, which is equivalent to the aforementioned target area. Then, based on the category and quantity of accumulated abnormal data within the target area, the detection type of the target prediction model, and the specific production scenario, a dynamic update strategy is formulated. Subsequently, the model update process of the target prediction model is automatically triggered, improving the detection capability of the target prediction model in the current production environment and increasing the model accuracy. Figure 4 The phrase "update the model based on data information" appears in the text.

[0121] In addition, during the model update process, it is necessary not only to use the data information in the abnormal sample data management and storage module 303 to update the target prediction model, but also to update the anti-forgetting module.

[0122] In summary, in real-world industrial applications, changes in the production environment often lead to unpredictable unknown samples (equivalent to the aforementioned anomalous data) encountered by the target prediction model, causing a sharp drop in model accuracy, sometimes even failing to meet industrial application standards. These unknown samples severely impact the prediction accuracy of the model. Therefore, detecting anomalous data that affects model accuracy in real-world scenarios is a core issue, and this step is crucial for subsequent model updates and lifelong learning.

[0123] To address this issue, this application provides a model detection device based on metric computation, which offers the following advantages: Firstly, this application utilizes a multi-dimensional learnable metric model (equivalent to a metric learning sub-model) to comprehensively score multiple metric results, enabling the model detection device to detect various types of anomalous data, making it more adaptable to real-world production environments and improving model accuracy. Secondly, by detecting outliers in anomalous data and comparing them with adaptive anomaly thresholds, the model detection device identifies the anomalous category of the data (including hard-to-learn samples, drifting samples, or novel types of samples) and guides users in labeling the anomalous data. This step is crucial for subsequent model update strategy selection. Thirdly, the model detection device is a non-parametric model, requiring minimal computational resources for training, allowing for real-time updates.

[0124] The model detection device provided in this application can at least partially improve the following problems: in actual production environment, it can detect the data to be detected of the target prediction model, thereby detecting abnormal data that may be predicted incorrectly by the target prediction model, and at the same time determine the true label for the detected abnormal data; collect and store abnormal data, automatically trigger the update of the target prediction model, and improve the prediction accuracy of the target prediction model for abnormal data; at the same time, the model detection device can also be adapted to a self-learning dynamic update system.

[0125] This application provides a model detection method. This embodiment elaborates on the specific implementation method of the aforementioned embodiments. It can be seen that by performing feature extraction and multimodal fusion processing on the data to be detected, the obtained target features can more comprehensively reflect the relevant information of the data to be detected, improving the accuracy of subsequent judgments. In addition, by using the measurement results between the target features of the data to be detected and the distribution information of the training samples, it is determined whether the data to be detected is abnormal, thereby judging whether the prediction results of the target prediction model are correct. This can supervise the target prediction model in the production environment and reduce the losses caused by erroneous prediction results.

[0126] In another embodiment of this application, see [link to application]. Figure 5 This illustrates a structural schematic diagram of another model detection device 30 provided in an embodiment of this application. For example... Figure 5 As shown, the model detection device 30 includes:

[0127] Prediction unit 401 is configured to input the data to be detected into the target prediction model to obtain the prediction result;

[0128] The extraction unit 402 is configured to extract features from the data to be detected and determine multiple features corresponding to the data to be detected.

[0129] The fusion unit 403 is configured to perform multimodal fusion processing on multiple features to obtain the target features corresponding to the data to be detected;

[0130] The computing unit 404 is configured to determine the training sample distribution information corresponding to the target prediction model through the metric model, perform metric calculations on the training sample distribution information and target features, and obtain the metric result.

[0131] Processing unit 405 is configured to determine whether the prediction result is correct based on the measurement result.

[0132] In some embodiments, the metric model includes an anti-forgetting module and at least one metric calculation sub-model. Accordingly, the calculation unit 404 is specifically configured to obtain training sample distribution information from the anti-forgetting module; calculate the target features and training sample distribution information based on at least one metric calculation sub-model to obtain at least one metric score; and determine the at least one metric score as the metric result.

[0133] In some embodiments, the processing unit 405 is further configured to output a prediction result if the prediction result is correct; determine that the data to be detected is abnormal data if the prediction result is incorrect; store the abnormal data in a target area; and update the target prediction model and metric model using all the abnormal data when the number of abnormal data in the target area reaches a target threshold.

[0134] In some embodiments, the processing unit 405 is further configured to, in the event of an error in the prediction result, interpolate at least one metric score information to obtain an anomaly value of the abnormal data; compare the anomaly value of the abnormal data with an anomaly threshold to determine the anomaly category of the abnormal data; wherein the anomaly category includes at least one of the following: novel type sample, difficult-to-learn sample, or drift sample.

[0135] In some embodiments, the processing unit 405 is further configured to determine annotation suggestion information for abnormal data based on the abnormality category of the abnormal data; send the abnormal data to the user based on the annotation suggestion information for the abnormal data; and receive the actual label of the abnormal data sent by the user.

[0136] In some embodiments, the processing unit 405 is further configured to perform statistical analysis on abnormal data belonging to new types of samples, abnormal data belonging to difficult-to-learn samples, and abnormal data belonging to drift samples to obtain statistical results; determine data offset values ​​based on the statistical results; if the data offset value is greater than an offset threshold, update the target prediction model using all abnormal data and the true labels of all abnormal data based on a first type of update strategy; if the data offset value is less than or equal to the offset threshold, update the target prediction model using all abnormal data and the true labels of all abnormal data based on a second type of update strategy; wherein the retention ratio of the original model features of the target prediction model in the first type of update strategy is less than the retention ratio of the original model features of the target prediction model in the second type of update strategy.

[0137] In some embodiments, the processing unit 405 is further configured to train the original training samples to establish a target prediction model; and to acquire the target features of the original training samples, determine the training sample distribution information of the target prediction model based on the target features of the original training samples; store the training sample distribution information in the anti-forgetting module; update the training sample distribution information in the anti-forgetting module using the target features of the data to be detected when the prediction result is correct; and update the training sample distribution information in the anti-forgetting module using the target features of the abnormal data during the training of the target prediction model using the abnormal data and the true labels of the abnormal data when the prediction result is incorrect.

[0138] Understandably, in this embodiment, a "unit" can be a portion of a circuit, a portion of a processor, a portion of a program or software, etc., and can also be a module or a non-modular component. Furthermore, the components in this embodiment can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional module.

[0139] If the integrated unit is implemented as a software functional module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the part of the technical solution that essentially contributes to this embodiment, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the method of this embodiment. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0140] Therefore, this embodiment provides a computer storage medium storing a computer program that, when executed by a plurality of processors, implements the steps of any of the methods in the foregoing embodiments.

[0141] Based on the above-described composition of a model detection device 30 and its computer storage medium, see [link to relevant documentation]. Figure 6 This illustrates a schematic diagram of the hardware structure of an electronic device 50 provided in an embodiment of this application. Figure 6As shown, electronic device 50 may include: a communication interface 501, a memory 502, and a processor 503; the various components are coupled together via a bus device 504. It is understood that the bus device 504 is used to implement communication between these components. In addition to a data bus, the bus device 504 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in... Figure 6 All buses are labeled as bus devices 504. Among them, the communication interface 501 is used for receiving and sending signals during information exchange with other external network elements.

[0142] Memory 502 is used to store computer programs that can run on processor 503;

[0143] Processor 503 is used to perform the following when running computer programs:

[0144] Input the data to be detected into the target prediction model to obtain the prediction result;

[0145] Feature extraction is performed on the data to be detected to determine multiple features corresponding to the data to be detected.

[0146] Multimodal fusion processing is performed on multiple features to obtain the target features corresponding to the data to be detected;

[0147] The distribution information of training samples corresponding to the target prediction model is determined by the metric model, and the metric calculation is performed on the distribution information of training samples and target features to obtain the metric result.

[0148] Based on the measurement results, determine whether the prediction results are correct.

[0149] It is understood that the memory 502 in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate Synchronous DRAM (DDRSDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The memory 502 of the apparatus and method described in this application is intended to include, but is not limited to, these and any other suitable types of memory.

[0150] The processor 503 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 503 or by instructions in software form. The processor 503 can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory 502, and the processor 503 reads the information in memory 502 and, in conjunction with its hardware, completes the steps of the above method.

[0151] It is understood that the embodiments described in this application can be implemented using hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions of this application, or combinations thereof.

[0152] For software implementation, the technology of this application can be implemented through modules (e.g., procedures, functions, etc.) that perform the functions of this application. The software code can be stored in memory and executed by a processor. The memory can be implemented in the processor or external to the processor.

[0153] Alternatively, as another embodiment, the processor 503 is also configured to perform the steps of any of the methods in the foregoing embodiments when running a computer program.

[0154] In another embodiment of this application, a schematic diagram of the composition of the model detection device 30 described above is provided (see attached diagram). Figure 7 This illustrates a schematic diagram of the composition structure of another electronic device 50 provided in an embodiment of this application. For example... Figure 7 As shown, the electronic device 50 includes at least the model detection device 30 of any of the foregoing embodiments.

[0155] For electronic device 50, since it includes model detection device 30, by performing feature extraction and multimodal fusion processing on the data to be detected, the obtained target features can more comprehensively reflect the relevant information of the data to be detected, and improve the accuracy of subsequent judgments. In addition, by using the measurement results between the target features of the data to be detected and the distribution information of training samples, it is determined whether the data to be detected is abnormal, thereby judging whether the prediction results of the target prediction model are correct. This can supervise the target prediction model in the production environment and reduce the losses caused by erroneous prediction results.

[0156] The above are merely preferred embodiments of this application and are not intended to limit the scope of protection of this application.

[0157] It should be noted that, in this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0158] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0159] The methods disclosed in the several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.

[0160] The features disclosed in the several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.

[0161] The features disclosed in the several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method or device embodiments.

[0162] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A model detection method, the method comprising: Input the data to be detected into the target prediction model to obtain the prediction result; Feature extraction is performed on the data to be detected to determine multiple features corresponding to the data to be detected; Multimodal fusion processing is performed on the multiple features to obtain the target features corresponding to the data to be detected; The distribution information of training samples corresponding to the target prediction model is determined by the metric model, and the metric calculation is performed on the distribution information of training samples and the target features to obtain the metric result. Based on the measurement results, determine whether the prediction results are correct; If the measurement result indicates that the similarity between the data to be detected and the original training samples is greater than a threshold value, then the prediction result is output; If the measurement result indicates that the similarity between the data to be detected and the original training samples is below a threshold, then the prediction result is determined to be incorrect, the data to be detected is identified as abnormal data, and the abnormal data is stored in the target region.

2. The method according to claim 1, wherein the metric model includes an anti-forgetting module and at least one metric calculation sub-model, and the step of determining the training sample distribution information corresponding to the target prediction model through the metric model, and performing metric calculation on the training sample distribution information and the target features to obtain the metric result includes: The training sample distribution information is obtained from the anti-forgetting module; Based on the at least one metric calculation sub-model, the target features and the training sample distribution information are calculated to obtain at least one metric score information; The at least one metric score information is determined as the metric result.

3. The method according to claim 2, further comprising: When the number of abnormal data in the target area reaches the target threshold, the target prediction model and the measurement model are updated using all the abnormal data.

4. The method according to claim 3, wherein if the prediction result is incorrect, the method further comprises: Interpolate the at least one metric score information to obtain the outlier value of the outlier data; The outlier values ​​and outlier thresholds of the abnormal data are compared to determine the outlier category of the abnormal data; wherein the outlier category includes at least one of the following: novel type samples, difficult-to-learn samples, or drifting samples.

5. The method according to claim 4, after determining the anomaly category of the abnormal data, the method further includes: Based on the anomaly category of the anomaly data, determine the suggested labeling information for the anomaly data; The abnormal data is sent to the user based on the annotation suggestion information of the abnormal data; Receive the real label of the abnormal data sent by the user.

6. The method according to claim 5, wherein updating the target prediction model using all abnormal data includes: Statistical analysis was performed on anomalous data belonging to new sample types, anomalous data belonging to difficult-to-learn samples, and anomalous data belonging to drift samples to obtain statistical results; Based on the statistical results, determine the data offset value; If the data offset value is greater than the offset threshold, the target prediction model is updated based on the first type of update strategy, using all the abnormal data and the true labels of all the abnormal data. If the data offset value is less than or equal to the offset threshold, the target prediction model is updated based on the second type of update strategy, using all the abnormal data and the true labels of all the abnormal data. Wherein, the retention ratio of the original model features of the target prediction model in the first type of update strategy is less than the retention ratio of the original model features of the target prediction model in the second type of update strategy.

7. The method according to any one of claims 3-6, further comprising: The target prediction model is established by training the original training samples; as well as, Obtain the target features of the original training samples, and determine the training sample distribution information of the target prediction model based on the target features of the original training samples; The training sample distribution information is stored in the anti-forgetting module; If the prediction result is correct, the distribution information of the training samples in the anti-forgetting module is updated using the target features of the data to be detected; In the event of an incorrect prediction result, during the training of the target prediction model using the abnormal data and the true labels of the abnormal data, the target features of the abnormal data are determined to update the distribution information of the training samples in the anti-forgetting module.

8. A model testing device, comprising: The prediction unit is configured to input the data to be detected into the target prediction model to obtain the prediction result; The extraction unit is configured to extract features from the data to be detected and determine multiple features corresponding to the data to be detected. The fusion unit is configured to perform multimodal fusion processing on the multiple features to obtain the target features corresponding to the data to be detected; The computing unit is configured to determine the training sample distribution information corresponding to the target prediction model through a metric model, perform metric calculations on the training sample distribution information and the target features, and obtain a metric result. The processing unit is configured to determine whether the prediction result is correct based on the measurement result; if the measurement result indicates that the similarity between the data to be detected and the original training samples is greater than a threshold value, then the prediction result is output. If the measurement result indicates that the similarity between the data to be detected and the original training samples is below a threshold, then the prediction result is determined to be incorrect, the data to be detected is identified as abnormal data, and the abnormal data is stored in the target region.

9. An electronic device comprising a memory and a processor; wherein, The memory is used to store computer programs that can run on the processor; The processor is configured to perform the method as described in any one of claims 1 to 7 when running the computer program.

10. A computer storage medium, characterized in that, The computer storage medium stores a computer program that, when executed by at least one processor, implements the method as described in any one of claims 1 to 7.