Risk detection method and system and electronic equipment
By using the first model to extract and predict the image of the object to be processed, it determines whether there is a risk, and solves the payment timeout and related risks caused by untimely invoice approval, and improves the accuracy of risk prediction and the timeliness of the approval process.
Patent Information
- Application Number
- CN202510120700.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-24
- Publication Date
- 2025-05-13
AI Technical Summary
When purchasing items, inadequate invoice approval will lead to payment timeout, causing a series of risks.
Through a risk detection method, the first model uses the first model to extract and predict the image of the object to be processed, and determines whether there is a risk in the object to be processed corresponding to the image. The first model is obtained based on the second model, and the model parameters of the second model are more than the model parameters of the first model.
Improve the accuracy of risk prediction, avoid payment timeouts and related risks caused by failure to predict in time, and ensure the timeliness and accuracy of the approval process.
Smart Images

Figure CN119992576A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing, and in particular to a risk detection method, system and electronic equipment. Background Art
[0002] When purchasing goods, the supplier issues an invoice, which is then reviewed and approved by relevant personnel. Usually, payment is made according to the agreed payment schedule after the invoice is reviewed and approved. However, if the invoice cannot be paid on time due to untimely review and approval, payment will be overdue, which will cause a series of risks. Summary of the invention
[0003] In view of this, the present application provides a risk detection method, system and electronic device, and its specific solutions are as follows:
[0004] A risk detection method, comprising:
[0005] obtaining an image of an object to be processed;
[0006] Inputting the data corresponding to the image into the first model, extracting features of the data corresponding to the image using the first model, and performing prediction based on the extracted target feature data to obtain a prediction result, wherein the prediction result indicates whether the object to be processed corresponding to the image has a risk;
[0007] The first model is obtained based on the second model, and the model parameters of the second model are more than the model parameters of the first model.
[0008] Furthermore, inputting the data corresponding to the image into the first model includes:
[0009] Inputting the image into a second model, and performing feature processing on the image using the second model to obtain data corresponding to the image;
[0010] The data corresponding to the image output by the second model is input into the first model.
[0011] Furthermore, the feature processing performed by the second model on the image includes at least one of the following:
[0012] Non-numeric type features are converted into corresponding vector features, missing value features are supplemented, and outlier features are processed.
[0013] Furthermore, the inputting of the data corresponding to the image into the first model, extracting features of the data corresponding to the image using the first model, and performing prediction based on the extracted target feature data to obtain a prediction result includes:
[0014] Inputting the data corresponding to the image into a feature extraction module in the first model, and using the feature extraction module to perform feature extraction on the data corresponding to the image to obtain extracted target feature data;
[0015] The target feature data is input into the prediction model in the first model, and the target feature data is predicted using the prediction model to obtain the prediction result.
[0016] Furthermore, it also includes:
[0017] Obtaining the feature extraction module;
[0018] Wherein, obtaining the feature extraction module includes:
[0019] Inputting feature data of the training sample image into the second model to obtain an initial feature extraction code output by the second model;
[0020] Verifying the initial feature extraction code to obtain a target feature extraction code;
[0021] The feature extraction module is obtained based on the target feature extraction code.
[0022] Further, the initial feature extraction code is verified to obtain a target feature extraction code, including:
[0023] extracting sample target feature data of the test sample image using the initial feature extraction code;
[0024] Inputting the sample target feature data into the prediction model to obtain the sample prediction result output by the prediction model;
[0025] Verifying the sample prediction result to determine a verification result of the sample prediction result;
[0026] If the verification result of the sample prediction result indicates that the sample target feature data has passed the verification, determining the initial feature extraction code as the target feature extraction code;
[0027] If the verification result of the sample prediction result indicates that the sample target feature data has not passed the verification, a prompt message is output to prompt the second model to regenerate feature extraction code.
[0028] Further, the verifying the sample prediction result to determine the verification result of the sample prediction result includes:
[0029] Determining a performance evaluation value of the initial feature extraction code based on the sample prediction result, and determining the performance evaluation value as a verification result of the sample prediction result;
[0030] If the performance evaluation value is greater than the target value, it is determined that the verification result indicates that the sample target feature data has passed the verification; if the performance evaluation value is less than the target value, it is determined that the verification result indicates that the sample target feature data has not passed the verification.
[0031] Furthermore, it also includes:
[0032] Obtaining the prediction model;
[0033] Wherein, obtaining the prediction model comprises:
[0034] Using the training feature data in the target feature data of the data corresponding to the sample image extracted by the feature extraction module, model training is performed to obtain an initial prediction model;
[0035] The initial prediction model is verified using the test feature data in the target feature data of the data corresponding to the sample image extracted by the feature extraction module to determine whether the initial prediction model can be determined as the prediction model.
[0036] A risk detection system, comprising:
[0037] An acquisition unit, used for acquiring an image of an object to be processed;
[0038] A prediction unit, configured to input the data corresponding to the image into a first model, extract features of the data corresponding to the image using the first model, and perform prediction based on the extracted target feature data to obtain a prediction result, wherein the prediction result indicates whether the object to be processed corresponding to the image has a risk;
[0039] The first model is obtained based on the second model, and the model parameters of the second model are more than the model parameters of the first model.
[0040] An electronic device, comprising:
[0041] a processor, configured to obtain an image of an object to be processed, input data corresponding to the image into a first model, extract features of the data corresponding to the image using the first model, and perform prediction based on the extracted target feature data to obtain a prediction result, wherein the prediction result indicates whether the object to be processed corresponding to the image has a risk, wherein the first model is obtained based on a second model, and the model parameters of the second model are more than the model parameters of the first model;
[0042] The memory is used to store the program required by the processor to execute the above processing process. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0044] Figure 1 A flow chart of a risk detection method disclosed in an embodiment of the present application;
[0045] Figure 2 A flow chart of a risk detection method disclosed in an embodiment of the present application;
[0046] Figure 3 A schematic diagram of data flow corresponding to a risk detection method disclosed in an embodiment of the present application;
[0047] Figure 4 A flow chart of a risk detection method disclosed in an embodiment of the present application;
[0048] Figure 5 A schematic diagram of the structure of a risk detection system disclosed in an embodiment of the present application;
[0049] Figure 6 A schematic diagram of the structure of an electronic device disclosed in an embodiment of the present application. DETAILED DESCRIPTION
[0050] The following describes the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation method section of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application.
[0051] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0052] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0053] This application discloses a risk detection method, and its flow chart is as follows: Figure 1 As shown, including:
[0054] Step S11, obtaining an image of the object to be processed;
[0055] Step S12: input the data corresponding to the image into the first model, use the first model to extract features of the data corresponding to the image, and make predictions based on the extracted target feature data to obtain prediction results, which characterize whether there is a risk for the object to be processed corresponding to the image; wherein the first model is obtained based on the second model, and the model parameters of the second model are more than the model parameters of the first model.
[0056] When purchasing goods, the supplier issues an invoice, which is then reviewed and approved by relevant personnel. Usually, payment is made according to the agreed payment schedule after the invoice is reviewed and approved. However, if the invoice cannot be paid on time due to untimely review and approval, payment will be overdue, which will cause a series of risks.
[0057] Based on this, in this solution, the first model is used to extract and predict features of the image of the object to be processed, so as to predict whether there is a risk for the object to be processed through the first model. The accuracy of the prediction is guaranteed, and the problem of untimely or inaccurate prediction of whether there is a risk for the object to be processed is avoided, which may affect subsequent payments and cause a series of risks, and avoid the problem of untimely review caused by manual review of the object to be processed. In addition, the first model is obtained based on the second model, and the model parameters of the second model are more than the model parameters of the first model. Then the second model can be a large model, and the first model is generated by the large model, which ensures the accuracy of the first model and improves the accuracy of the prediction.
[0058] Specifically, when it is determined that there is an object to be processed, it is necessary to obtain an image corresponding to the object to be processed, wherein the object to be processed can be: an invoice that needs to be reviewed, or other objects that need to be reviewed, and the image of the object to be processed can correspond to: an image of the invoice that needs to be reviewed, or, an image of other objects that need to be reviewed.
[0059] Since prediction needs to be made through the first model, and the model can usually only analyze and predict images, it is necessary to obtain an image of the object to be processed so that the first model can analyze the image and then use the first model to make predictions on the obtained image.
[0060] An image of the object to be processed is obtained, data corresponding to the image is determined, and the determined data corresponding to the image is input into the first model so that the first model processes the input data.
[0061] The first model is obtained based on the second model. The model parameters of the second model are more than those of the first model. The second model may be a large model, while the first model is not a large model. Then the model parameters of the second model are much larger than those of the first model.
[0062] In this embodiment, the first model is obtained through the large model, and the first model is obtained by taking advantage of the large model to extract information, so that the prediction of the first model can be more accurate, and the first model is used to predict whether the object to be processed has risks, which takes advantage of the small model (i.e., the first model) that can output stable results, so that the prediction results of the first model are more accurate and stable; and, compared with the large model, the small model (i.e., the first model) is used for prediction. The model parameters are fewer, the structure is relatively simple, and the consumption of computing resources in the training and prediction process is lower; and the complexity of the small model is relatively low, and it is not easy to overfit; in addition, due to the small amount of calculation, the training time of the small model (i.e., the first model) is short, which enables the training to be completed quickly when the data is updated or the first model needs to be retrained, even if the first model is adjusted to adapt to the new data distribution, thereby maintaining the stability and timeliness of the output results of the first model; secondly, the storage space occupied by the small model (the first model) is small, and it is easier to be deployed on various devices, which is convenient for the promotion and application of the first model; and the small model (the first model) has better adaptability and can maintain stable output.
[0063] After obtaining the data corresponding to the image to be processed, the first model can first perform feature extraction on the data corresponding to the image to obtain the target feature data corresponding to the image. After obtaining the target feature data, the first model can predict whether there is a risk in the object to be processed corresponding to the image based on the target feature data.
[0064] Specifically, if the object to be processed is an invoice to be reviewed, an image of the invoice to be reviewed is obtained, and data corresponding to the image of the invoice to be reviewed is input into the first model. The first model can perform feature extraction on the data corresponding to the image of the invoice to be reviewed, obtain target feature data corresponding to the image of the invoice to be reviewed, and output a prediction result using the target feature data. The prediction result can characterize whether the invoice to be reviewed has risks. If the prediction result characterizes that the invoice to be reviewed has risks, risk warning information is output to facilitate manual intervention, such as giving the invoice to be reviewed a processing result of failing the review to avoid risks. If the prediction result characterizes that the invoice to be reviewed has no risks, a prompt message is output. At this time, a processing result of passing the review can be output based on the prediction result.
[0065] The risk detection method disclosed in this embodiment obtains an image of an object to be processed; inputs data corresponding to the image into a first model, extracts features from the data corresponding to the image using the first model, and predicts based on the extracted target feature data to obtain a prediction result, which characterizes whether the object to be processed corresponding to the image has a risk; wherein the first model is obtained based on the second model, and the model parameters of the second model are more than the model parameters of the first model. This solution uses the second model to obtain the first model, and when there is an image of the object to be processed, inputs the data corresponding to the image into the first model, so as to extract features from the data corresponding to the image through the first model, and predicts based on the extracted target feature data, so as to predict whether the object to be processed corresponding to the image has a risk. Prediction is performed through the first model, which ensures the efficiency of the prediction and avoids problems caused by untimely prediction; in addition, since the first model is obtained based on the second model, the model parameters of the second model are more than the model parameters of the first model, which ensures the accuracy of the prediction of the first model.
[0066] This embodiment discloses a risk detection method, and its flow chart is as follows: Figure 2 As shown, including:
[0067] Step S21, obtaining an image of the object to be processed;
[0068] Step S22: input the image into the second model, and use the second model to perform feature processing on the image to obtain data corresponding to the image;
[0069] Step S23, input the data corresponding to the image output by the second model into the first model, use the first model to extract features of the data corresponding to the image, and make predictions based on the extracted target feature data to obtain prediction results, which characterize whether there is a risk for the object to be processed corresponding to the image. The first model is obtained based on the second model, and the model parameters of the second model are more than the model parameters of the first model.
[0070] After determining the object to be processed, firstly obtain an image of the object to be processed, and process the image of the object to be processed to obtain image data of the object to be processed. The process of processing the image of the object to be processed to obtain image data can be performed by the second model.
[0071] The second model is a large model whose model parameters are far more than those of the first model. The second model performs feature processing on the image of the object to be processed so that the second model can be continuously optimized during the feature processing process to improve the accuracy and efficiency of the feature processing. Performing feature processing by a large model (second model) can make the feature processing process more flexible to reduce the manual processing process.
[0072] The image of the object to be processed is input into the second model, the second model directly performs feature processing on the image to obtain data corresponding to the image, the second model outputs the data corresponding to the image, and further, the data corresponding to the image output by the second model is used as the input of the first model, so as to use the data corresponding to the image to predict the object to be processed corresponding to the image.
[0073] Specifically, the schematic diagram of the data flow corresponding to the risk detection method disclosed in this embodiment can be as follows: Figure 3 As shown, the image of the object to be processed is input into the second model. After the second model performs feature processing, the data corresponding to the image output by the second model is input into the first model. The first model performs feature extraction and prediction to obtain a prediction result.
[0074] Among them, the feature processing performed by the second model on the image of the object to be processed may include at least one of the following: converting non-numeric type features into corresponding vector features, supplementing missing value features, and processing outlier features.
[0075] The second model performs feature processing on the image of the object to be processed. First, a feature set consisting of multiple features included in the image of the object to be processed can be determined. If the feature set is a feature set matrix with m rows and n columns, and m and n are positive integers, ,in, represents the set of features of the nth column, , .
[0076] After determining the feature set included in the image of the object to be processed, the second model is used to perform feature processing on the feature set.
[0077] Among them, the second model converts non-numeric type features into corresponding vector features, which can be specifically: automatically identifying non-numeric type features in the feature set, and inputting the identified non-numeric type features into the second model, so that the second model converts the obtained non-numeric type features into vector features, and replaces the original non-numeric type features in the feature set with the converted vector features.
[0078] For example, the feature input to the second model is F, and the feature output by the second model is Specifically, copy feature F into ,cycle Each feature set in ,cycle Each feature in , using regular expressions to identify If one of the values is non-numeric, stop Cycle, will Convert to vector features and write the new features back to overlay ,at this time, The cycle ends, The loop ends. For each feature in each column in , determine whether the feature in each column is a non-numeric type feature.
[0079] The second model supplements the missing value features, which can be specifically: automatically identifying features with missing values and inputting them into the second model, so that the second model can supplement the missing values.
[0080] For example: The features input to the second model are , the features output by the second model are Specifically, the characteristics Copy ,cycle Each feature set in ,cycle Each feature in , using empty logic to identify If it is empty, stop cycle, the second model is Supplement missing values, generate new sets, and write new features back to overwrite ,at this time, The cycle ends, The loop ends.
[0081] The second model performs outlier feature processing, which can be specifically as follows: a small model (such as the third model) is used to identify features with outliers. If outliers are identified, the features with outliers are input into the second model to process the outlier features to obtain features without outliers.
[0082] For example: The input feature is The output features are ,cycle Each feature set in ,Will Input to the third model, the output is: , loop through the collections The value in , take the absolute value, if the absolute value is greater than or equal to a certain value, it is determined to be an outlier, and the determined outlier and its column are combined Input to the second model so that the second model can rewrite the outliers, generate a new set, and write back the overwrite .
[0083] The risk detection method disclosed in this embodiment obtains an image of an object to be processed; inputs the image into a second model, and uses the second model to perform feature processing on the image to obtain data corresponding to the image; inputs the data corresponding to the image output by the second model into the first model, and uses the first model to perform feature extraction on the data corresponding to the image, and performs prediction based on the extracted target feature data to obtain a prediction result, and the prediction result characterizes whether the object to be processed corresponding to the image has a risk, and the first model is obtained based on the second model, and the model parameters of the second model are more than the model parameters of the first model. After obtaining the image of the object to be processed, this solution first inputs the image into the second model, and the second model performs feature processing on the image to obtain data corresponding to the image, and the data obtained after the second model processing is input into the first model, so that the first model performs prediction based on the data output by the second model to determine whether the object to be processed corresponding to the image has a risk, and the second model performs feature processing on the image to ensure the efficiency of feature processing and improve the efficiency of model prediction.
[0084] This embodiment discloses a risk detection method, and its flow chart is as follows: Figure 4 As shown, including:
[0085] Step S41, obtaining an image of the object to be processed;
[0086] Step S42, inputting the data corresponding to the image into the feature extraction module in the first model, and using the feature extraction module to perform feature extraction on the data corresponding to the image to obtain extracted target feature data;
[0087] Step S43: input the target feature data into the prediction model in the first model, and use the prediction model to predict the target feature data to obtain a prediction result, which characterizes whether there is a risk in the object to be processed corresponding to the image. The first model is obtained based on the second model, and the model parameters of the second model are more than the model parameters of the first model.
[0088] When an object to be processed needs to be predicted to determine whether there is a risk, the data corresponding to the image of the object to be processed is input into the first model so that the first model can perform feature extraction and prediction based on the data corresponding to the image of the object to be processed, thereby determining whether there is a risk for the object to be processed based on the prediction result.
[0089] Among them, after the first model obtains the data corresponding to the image of the object to be processed, the first model must first perform the feature extraction step. After the feature extraction obtains the target feature data, the first model then performs risk prediction based on the target feature data. That is, the first model needs to go through two different steps to obtain the prediction result based on the data input into the first model. Then, in this embodiment, the first model can be divided into two parts, one part is the feature extraction module, and the other part is the prediction model.
[0090] The feature extraction module is used to extract features from the data corresponding to the image input into the first model to obtain target feature data; the prediction model is used to obtain the target feature data output by the feature extraction module, and use the target feature data for prediction to obtain a prediction result.
[0091] The first model is obtained based on the second model, and the feature extraction module and the prediction module in the first model are both obtained based on the second model, that is, the feature extraction module and the prediction module can be obtained respectively based on the second model.
[0092] Among them, obtaining the feature extraction module can be specifically as follows: inputting the feature data of the training sample image into the second model to obtain the initial feature extraction code output by the second model; verifying the initial feature extraction code to obtain the target feature extraction code; and obtaining the feature extraction module based on the target feature extraction code.
[0093] A training sample image is obtained, and data of the training sample image is obtained, that is, data obtained after the second model performs feature processing on the training sample image, and the data obtained after the second model performs feature processing on the training sample image is determined as feature data of the training sample image.
[0094] Specifically, the training sample image can be input into the second model, and the second model can be used to perform feature processing on the training sample image to obtain feature data of the training sample image, wherein the feature processing performed by the second model on the training sample image can include at least one of the following: converting non-numeric type features into corresponding vector features, supplementing missing value features, and processing outlier features.
[0095] After the second model performs the above-mentioned feature processing on the training sample image, the feature data of the training sample image is obtained, and the feature data of the training sample image is input into the second model again, so that the second model can generate feature extraction code using the feature data of the training sample image, thereby being able to perform feature extraction operations using the feature extraction code generated by the second model.
[0096] When the second model uses the feature data of the training sample image to generate the feature extraction code, it can be specifically as follows: the second model obtains the feature data of the training sample image, and can first determine whether the current amount of data to be processed reaches a certain specific threshold. If the specific threshold is not reached, the second model can directly perform a feature extraction operation on the obtained data; if the specific threshold is reached, at this time, if the second model performs a feature extraction operation on the obtained data, there will be data processing limitations due to the large amount of data. Therefore, when it is determined that the current amount of data to be processed reaches the specific threshold, the second model does not directly perform the feature extraction operation, but generates a code for performing the feature extraction operation, that is, the initial feature extraction code, and uses the code to perform the feature extraction operation, thereby avoiding the problem of limitations when the second model processes a large amount of data.
[0097] After obtaining the initial feature extraction code output by the second model for performing feature extraction operations, the code can be directly used to perform feature extraction operations. Alternatively, instead of directly using the code to perform feature extraction operations, the initial feature extraction code obtained is verified. When the verification is passed, the code is used to obtain a feature extraction module so that the feature extraction module can be used to perform feature extraction operations.
[0098] Among them, the verification of the initial feature extraction code can be specifically as follows:
[0099] The sample target feature data of the test sample image is extracted using the initial feature extraction code; the sample target feature data is input into the prediction model to obtain the sample prediction result output by the prediction model; the sample prediction result is verified to determine the verification result of the sample prediction result; if the verification result of the sample prediction result indicates that the sample target feature data has passed the verification, the initial feature extraction code is determined as the target feature extraction code; if the verification result of the sample prediction result indicates that the sample target feature data has not passed the verification, a prompt message is output to prompt the second model to regenerate the feature extraction code.
[0100] The training sample images include multiple images, and the test sample images also include multiple images, so as to ensure the accuracy of training and testing.
[0101] After using the second model to obtain the initial feature extraction code, the initial feature extraction code is used to extract the features of the test sample image to obtain sample target feature data corresponding to the test sample image, and the obtained sample target feature data is input into the prediction model according to the prediction process, so as to use the prediction model to predict whether the test sample image including the sample target feature data has risks and obtain a sample prediction result.
[0102] Afterwards, the sample prediction result is verified to obtain the verification result of the sample prediction result. The verification result of the sample prediction result can characterize whether the sample target feature data has passed the verification. If it has passed the verification, it can be determined that the initial feature extraction code used to extract the sample target feature data has passed the verification. If the sample target feature data has not passed the verification, it can be determined that the initial feature extraction code used to extract the sample target feature data has not passed the verification, that is, the verification result based on the sample prediction result can determine whether the initial feature extraction code has passed the verification.
[0103] If the verification result of the sample prediction result indicates that the sample target feature data has passed the verification, it can be determined that the initial feature extraction code used to extract the sample target feature data has passed the verification. At this time, the initial feature extraction code can be directly determined as the target feature extraction code, and the target feature extraction code can be used to obtain a feature extraction module, so that when predicting the image of the object to be processed, the feature extraction module can be used to perform feature extraction.
[0104] If the verification result of the sample prediction result indicates that the sample target feature data has not passed the verification, it can be determined that the initial feature extraction code used to extract the sample target feature data has not passed the verification. At this time, a prompt message is output to prompt the second model to regenerate the feature extraction code.
[0105] After the second model obtains the prompt information, in response to the prompt information, the feature extraction code is regenerated using the feature data of the training sample image input to the second model and outputted. After the system on which the risk verification method disclosed in this embodiment is based obtains the regenerated feature extraction code output by the second model, the regenerated feature extraction code is verified to determine whether the regenerated feature extraction code can be determined as the target feature extraction code.
[0106] Furthermore, when the second model obtains prompt information and determines that the feature extraction code needs to be regenerated, it can obtain the data generated in the process of verifying the initial feature extraction code, so as to analyze the data and predict the problems existing in the initial feature extraction code and the desirable parts of the initial extraction code. After predicting the problems existing in the initial feature extraction code and the desirable parts of the initial extraction code, the feature extraction code is regenerated using this information to ensure that the regenerated feature extraction code can avoid the problems existing in the initial feature extraction code. At the same time, the desirable parts of the initial feature extraction code can be directly used, or the desirable parts of the initial feature extraction code can be optimized to ensure that the feature extraction code regenerated by the second model has better feature extraction effect than the initial feature extraction code.
[0107] In addition, the sample prediction results can be verified by directly comparing the actual risk results of the test sample images with the sample prediction results to determine whether the sample prediction results have passed the verification. In this process, a large number of test sample images are required. Based on each test sample image, the sample prediction results are obtained using the initial feature extraction code and the prediction model, and the verification is performed based on multiple sample prediction results to ensure the accuracy of the sample prediction results when verifying the initial feature extraction code.
[0108] Alternatively, to verify the sample prediction results, you can also:
[0109] A performance evaluation value of the initial feature extraction code is determined based on the sample prediction result, and the performance evaluation value is determined as a verification result of the sample prediction result; if the performance evaluation value is greater than the target value, it is determined that the verification result represents that the sample target feature data has passed the verification; if the performance evaluation value is less than the target value, it is determined that the verification result represents that the sample target feature data has not passed the verification.
[0110] In the method disclosed in this embodiment, the AUC Score (Area Under the Curve) can be used to verify the sample prediction result, thereby verifying the initial feature extraction code.
[0111] Among them, AUC Score can be used to measure the performance of the binary classification model. For example, when AUC=1, it can be determined that the currently verified model is a complete model that can correctly distinguish positive and negative samples; when 0.5<AUC<1, it can be determined that the model performs well and can better distinguish positive and negative samples; when AUC=0.5, it can be determined that the model has no distinguishing ability, which is equivalent to random guessing; when AUC<0.5, it can be determined that the performance of the model is poor.
[0112] In this embodiment, the AUC value corresponding to the initial feature extraction code is determined based on the sample prediction result, that is, the performance evaluation value corresponding to the initial feature extraction code, and the verification result of the sample prediction result is determined based on the size of the performance evaluation value, and the performance of the initial feature extraction code is determined thereby.
[0113] If the performance evaluation value AUC corresponding to the initial feature extraction code determined based on the sample prediction result is greater than the target value, it can be determined that the sample target feature data has passed the verification, that is, it is determined that the initial feature extraction code has passed the verification, and the initial feature extraction code can be directly determined as the target feature extraction code, and a feature extraction model can be obtained based on the target feature extraction code;
[0114] If the performance evaluation value AUC corresponding to the initial feature extraction code determined based on the sample prediction result is smaller than the target value, it can be determined that the sample target feature data has not passed the verification, that is, it is determined that the initial feature extraction code has not passed the verification. At this time, a prompt message needs to be output to prompt the second model to regenerate the feature extraction code, and after the second model regenerates the feature extraction code, the feature extraction code regenerated by the second model is verified until the feature extraction code generated by the second model passes the verification and the target feature extraction code is determined.
[0115] The target value may be 0.95, or 0.9, etc.
[0116] The risk detection method disclosed in this embodiment obtains an image of the object to be processed; inputs the data corresponding to the image into the feature extraction module in the first model, and uses the feature extraction module to extract features from the data corresponding to the image to obtain extracted target feature data; inputs the target feature data into the prediction model in the first model, and uses the prediction model to predict the target feature data to obtain a prediction result, which characterizes whether there is a risk in the object to be processed corresponding to the image. The first model is obtained based on the second model, and the model parameters of the second model are more than the model parameters of the first model. This solution divides the first model into two parts: a feature extraction module and a prediction model. Both the feature extraction module and the prediction model are obtained based on the second model, which ensures the accuracy of feature extraction by the feature extraction module in the first model and the accuracy of prediction by the prediction model.
[0117] Furthermore, the risk detection method disclosed in this embodiment may also include:
[0118] Obtain a prediction model.
[0119] The prediction model is a model in the first model used for risk prediction based on target feature data, and the prediction model is obtained based on the second model.
[0120] Specifically, model training is performed using the training feature data in the target feature data of the data corresponding to the sample image extracted by the feature extraction module to obtain an initial prediction model; and the initial prediction model is verified using the test feature data in the target feature data of the data corresponding to the sample image extracted by the feature extraction module to determine whether the initial prediction model can be determined as a prediction model.
[0121] The model can be trained using at least part of the target feature data corresponding to the sample image extracted by the feature extraction network, or using part of the target feature data corresponding to the sample image for which it is known whether there is a risk, to obtain an initial prediction model.
[0122] After obtaining the initial prediction model, the initial prediction model is verified. The test feature data other than the training feature data in the data corresponding to the sample image extracted by the feature extraction network can be used to verify the initial prediction model to determine whether the initial prediction model can be used as the final prediction model, thereby realizing cross-validation of the feature extraction module and the prediction model; or, the prediction model can be verified using another part of the target feature data in the data corresponding to the sample image that is known to have risks.
[0123] For example: the target feature data in the data corresponding to the sample image extracted by the feature extraction module is used to train and verify the model. 70% of the target feature data extracted by the feature extraction module can be determined as training feature data, and the remaining 30% of the data can be used as test feature data. The extreme gradient boosting model XGBoost is used, and grid search is used to adjust the hyperparameters of the model, thereby determining the prediction model.
[0124] After obtaining the prediction model, the AUC Score can also be used to verify the prediction model to determine whether the prediction model meets the requirements. If the AUC value of the prediction model reaches a specific value, it can be determined that the prediction model meets the requirements, and the prediction model can be used as part of the first model to predict whether there is a risk for the object to be processed; if the AUC value of the prediction model does not reach the specific value, it can be determined that the prediction model does not meet the usage requirements. At this time, the prediction model can continue to be trained to ensure that the AUC value of the final prediction model can reach a specific value so that it meets the actual usage requirements.
[0125] Furthermore, after the feature extraction module and the prediction model in the first model are determined, they can be updated at specific time intervals using the data received within the specific time period, so that the feature extraction module and the prediction model in the first model can always conform to the latest received data, thereby ensuring the accuracy of the prediction of whether there is a risk for the object to be processed.
[0126] This embodiment discloses a risk detection system, and its structural diagram is as follows: Figure 5 As shown, including:
[0127] A first obtaining unit 51 and a predicting unit 52 .
[0128] Wherein, the first obtaining unit 51 is used to obtain an image of the object to be processed;
[0129] The prediction unit 52 is used to input the data corresponding to the image into the first model, use the first model to extract features of the data corresponding to the image, and perform prediction based on the extracted target feature data to obtain a prediction result, which indicates whether the object to be processed corresponding to the image has a risk;
[0130] The first model is obtained based on the second model, and the model parameters of the second model are more than the model parameters of the first model.
[0131] Furthermore, the prediction unit is used to:
[0132] The image is input into the second model, and the second model is used to perform feature processing on the image to obtain data corresponding to the image; the data corresponding to the image output by the second model is input into the first model.
[0133] Furthermore, the feature processing performed by the second model on the image includes at least one of the following:
[0134] Non-numeric type features are converted into corresponding vector features, missing value features are supplemented, and outlier features are processed.
[0135] Furthermore, the prediction unit is used to:
[0136] The data corresponding to the image is input into the feature extraction module in the first model, and the feature extraction module is used to extract features from the data corresponding to the image to obtain extracted target feature data; the target feature data is input into the prediction model in the first model, and the prediction model is used to predict the target feature data to obtain a prediction result.
[0137] Furthermore, the risk detection system disclosed in this embodiment may also include:
[0138] A second obtaining unit is used to obtain a feature extraction module;
[0139] Wherein, the second obtaining unit is used for:
[0140] Input the feature data of the training sample image into the second model to obtain the initial feature extraction code output by the second model; verify the initial feature extraction code to obtain the target feature extraction code; and obtain the feature extraction module based on the target feature extraction code.
[0141] Furthermore, the second obtaining unit is used for:
[0142] The sample target feature data of the test sample image is extracted using the initial feature extraction code; the sample target feature data is input into the prediction model to obtain the sample prediction result output by the prediction model; the sample prediction result is verified to determine the verification result of the sample prediction result; if the verification result of the sample prediction result indicates that the sample target feature data has passed the verification, the initial feature extraction code is determined as the target feature extraction code; if the verification result of the sample prediction result indicates that the sample target feature data has not passed the verification, a prompt message is output to prompt the second model to regenerate the feature extraction code.
[0143] Furthermore, the second obtaining unit is used for:
[0144] A performance evaluation value of the initial feature extraction code is determined based on the sample prediction result, and the performance evaluation value is determined as a verification result of the sample prediction result; if the performance evaluation value is greater than the target value, it is determined that the verification result represents that the sample target feature data has passed the verification; if the performance evaluation value is less than the target value, it is determined that the verification result represents that the sample target feature data has not passed the verification.
[0145] Furthermore, the risk detection system disclosed in this embodiment may also include:
[0146] A third obtaining unit, used to obtain the prediction model;
[0147] Wherein, the third obtaining unit is used for:
[0148] The model is trained using the training feature data in the target feature data of the data corresponding to the sample image extracted by the feature extraction module to obtain an initial prediction model; the initial prediction model is verified using the test feature data in the target feature data of the data corresponding to the sample image extracted by the feature extraction module to determine whether the initial prediction model can be determined as a prediction model.
[0149] The risk detection system disclosed in this embodiment is implemented based on the risk detection method disclosed in the above embodiment, which will not be described in detail here.
[0150] The risk detection system disclosed in this embodiment obtains an image of an object to be processed; inputs data corresponding to the image into a first model, extracts features from the data corresponding to the image using the first model, and predicts based on the extracted target feature data to obtain a prediction result, which characterizes whether the object to be processed corresponding to the image has a risk; wherein the first model is obtained based on the second model, and the model parameters of the second model are more than the model parameters of the first model. This solution uses the second model to obtain the first model, and when there is an image of the object to be processed, inputs the data corresponding to the image into the first model, so as to extract features from the data corresponding to the image through the first model, and predicts based on the extracted target feature data, so as to predict whether the object to be processed corresponding to the image has a risk. Prediction is performed through the first model, which ensures the efficiency of the prediction and avoids problems caused by untimely prediction; in addition, since the first model is obtained based on the second model, the model parameters of the second model are more than the model parameters of the first model, which ensures the accuracy of the prediction of the first model.
[0151] This embodiment discloses an electronic device, and its structural diagram is as follows: Figure 6 As shown, including:
[0152] Processor 61 and memory 62.
[0153] The processor 61 is used to obtain an image of the object to be processed, input data corresponding to the image into the first model, use the first model to extract features of the data corresponding to the image, and make predictions based on the extracted target feature data to obtain prediction results, which characterize whether the object to be processed corresponding to the image has risks. The first model is obtained based on the second model, and the model parameters of the second model are more than the model parameters of the first model.
[0154] The memory 62 is used to store the programs required by the processor to execute the above processing procedures.
[0155] The electronic device disclosed in this embodiment is implemented based on the risk detection method disclosed in the above embodiments, which will not be described in detail here.
[0156] The electronic device disclosed in this embodiment obtains an image of an object to be processed; inputs data corresponding to the image into a first model, extracts features from the data corresponding to the image using the first model, and predicts based on the extracted target feature data to obtain a prediction result, the prediction result characterizing whether the object to be processed corresponding to the image has a risk; wherein the first model is obtained based on the second model, and the model parameters of the second model are more than the model parameters of the first model. This solution uses the second model to obtain the first model, and when there is an image of the object to be processed, inputs the data corresponding to the image into the first model, so as to extract features from the data corresponding to the image through the first model, and predicts based on the extracted target feature data, so as to predict whether the object to be processed corresponding to the image has a risk. Prediction is performed by the first model, which ensures the efficiency of the prediction and avoids problems caused by untimely prediction; in addition, since the first model is obtained based on the second model, the model parameters of the second model are more than the model parameters of the first model, which ensures the accuracy of the prediction of the first model.
[0157] The embodiment of the present application also provides a readable storage medium on which a computer program is stored. The computer program is loaded and executed by a processor to implement the steps of the above-mentioned risk detection method. The specific implementation process can refer to the description of the corresponding part of the above-mentioned embodiment, which will not be repeated in this embodiment.
[0158] The present application also proposes a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the electronic device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the electronic device executes the method provided in various optional implementations of the risk detection method or the risk detection system. The specific implementation process can refer to the description of the corresponding embodiment above, and will not be repeated.
[0159] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.
[0160] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0161] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.
[0162] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a training device, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, training device, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
Claims
1. A risk detection method, comprising: obtaining an image of an object to be processed; Inputting the data corresponding to the image into the first model, extracting features of the data corresponding to the image using the first model, and performing prediction based on the extracted target feature data to obtain a prediction result, wherein the prediction result indicates whether the object to be processed corresponding to the image has a risk; The first model is obtained based on the second model, and the model parameters of the second model are more than the model parameters of the first model.
2. The method according to claim 1, wherein inputting the data corresponding to the image into the first model comprises: Inputting the image into a second model, and performing feature processing on the image using the second model to obtain data corresponding to the image; The data corresponding to the image output by the second model is input into the first model.
3. According to the method of claim 2, the feature processing performed by the second model on the image includes at least one of the following: Non-numeric type features are converted into corresponding vector features, missing value features are supplemented, and outlier features are processed.
4. The method according to claim 1, wherein the inputting the data corresponding to the image into the first model, extracting features of the data corresponding to the image using the first model, and performing prediction based on the extracted target feature data to obtain a prediction result comprises: Inputting the data corresponding to the image into a feature extraction module in the first model, and using the feature extraction module to perform feature extraction on the data corresponding to the image to obtain extracted target feature data; The target feature data is input into the prediction model in the first model, and the target feature data is predicted using the prediction model to obtain the prediction result.
5. The method according to claim 4, further comprising: Obtaining the feature extraction module; Wherein, obtaining the feature extraction module includes: Inputting feature data of the training sample image into the second model to obtain an initial feature extraction code output by the second model; Verifying the initial feature extraction code to obtain a target feature extraction code; The feature extraction module is obtained based on the target feature extraction code.
6. The method according to claim 5, wherein the verifying the initial feature extraction code to obtain the target feature extraction code comprises: extracting sample target feature data of the test sample image using the initial feature extraction code; Inputting the sample target feature data into the prediction model to obtain the sample prediction result output by the prediction model; Verifying the sample prediction result to determine a verification result of the sample prediction result; If the verification result of the sample prediction result indicates that the sample target feature data has passed the verification, determining the initial feature extraction code as the target feature extraction code; If the verification result of the sample prediction result indicates that the sample target feature data has not passed the verification, a prompt message is output to prompt the second model to regenerate feature extraction code.
7. The method according to claim 6, wherein the verifying the sample prediction result and determining the verification result of the sample prediction result comprises: Determining a performance evaluation value of the initial feature extraction code based on the sample prediction result, and determining the performance evaluation value as a verification result of the sample prediction result; If the performance evaluation value is greater than the target value, determining that the verification result indicates that the sample target feature data has passed the verification; If the performance evaluation value is less than the target value, it is determined that the verification result indicates that the sample target feature data has failed verification.
8. The method according to claim 4, further comprising: Obtaining the prediction model; Wherein, obtaining the prediction model comprises: Using the training feature data in the target feature data of the data corresponding to the sample image extracted by the feature extraction module, model training is performed to obtain an initial prediction model; The initial prediction model is verified using the test feature data in the target feature data of the data corresponding to the sample image extracted by the feature extraction module to determine whether the initial prediction model can be determined as the prediction model.
9. A risk detection system comprising: An acquisition unit, used for acquiring an image of an object to be processed; A prediction unit, configured to input the data corresponding to the image into a first model, extract features of the data corresponding to the image using the first model, and perform prediction based on the extracted target feature data to obtain a prediction result, wherein the prediction result indicates whether the object to be processed corresponding to the image has a risk; The first model is obtained based on the second model, and the model parameters of the second model are more than the model parameters of the first model.
10. An electronic device comprising: a processor, configured to obtain an image of an object to be processed, input data corresponding to the image into a first model, extract features of the data corresponding to the image using the first model, and perform prediction based on the extracted target feature data to obtain a prediction result, wherein the prediction result indicates whether the object to be processed corresponding to the image has a risk, wherein the first model is obtained based on a second model, and the model parameters of the second model are more than the model parameters of the first model; The memory is used to store the program required by the processor to execute the above processing process.