Website verification code self-learning method based on RPA and machine learning

By introducing self-learning methods based on RPA and machine learning in the verification code recognition system, the verification code recognition model is automatically collected and optimized, and the problem of single model and untimely update in the existing technology is solved, and efficient and accurate verification code recognition is achieved.

CN119691720APending Publication Date: 2025-03-25WUXI RONGZHI TECH CO LTD +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411761320.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

The existing verification code identification deployment method has a single model, which cannot be dynamically adjusted, the model is not updated in time, manpower is required, which takes a long time and restricts work and rest time.

Method used

The website verification code self-learning method based on RPA and machine learning is adopted, and the verification code pictures are automatically collected through RPA robots, combined with machine learning models for automated training and optimization, and the accuracy of identification is monitored in real time and the training and data set acquisition process is dynamically adjusted.

Benefits of technology

Automatic collection, training and optimization of verification code recognition are realized, and the model is dynamically adjusted, efficiency and accuracy are improved, manual maintenance time is reduced, and resource waste is avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119691720A_ABST
    Figure CN119691720A_ABST
Patent Text Reader

Abstract

The invention discloses a website verification code self-learning method based on RPA and machine learning. Comprising the following steps: S1, obtaining a verification code to be identified; s2, identifying code classification; s3, checking the machine learning model; s4, performing identification by using an existing machine learning model; s5, judging whether the training verification code picture is sufficient or not; s6, starting training and exporting the model; s7, verifying a result; s8, storing the identification pictures according to classification; s9, calculating an overall machine learning model recognition rate; s10, identifying whether the success rate is low or not; according to the method, RPA and machine learning are combined, automatic collection, training and optimization of verification code recognition are achieved, the model is dynamically adjusted, and efficiency and accuracy are improved; the data set collection and machine learning model training process is automatically adjusted, so that the training process is more intelligent and efficient, and unnecessary resource consumption is avoided; when the accuracy reaches a set threshold, training and data collection are stopped, and system resources are saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of intelligent recognition technology, and more specifically, particularly relates to a method for self-learning of website verification codes based on RPA and machine learning. Background Art

[0002] RPA refers to the use of software automation to simulate manual operation tasks of computer terminals, allowing software robots to automatically handle a large number of repetitive, rule-based workflow tasks. Its advantages and value are mainly reflected in the lack of coding, low learning cost, and short development cycle; non-invasive, with little impact on the existing IT architecture; improving work quality, reducing repetitive manual operations, and allowing uninterrupted work; high security, reducing human errors; liberating manpower, freeing up personnel to engage in more creative work content, reducing costs and increasing efficiency. RPA can automate repetitive workflows, and no longer requires manual labor to consume a lot of time and energy to complete.

[0003] Machine learning is a multi-disciplinary subject that involves probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory, and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. It is the core of artificial intelligence and the fundamental way to make computers intelligent.

[0004] When performing tasks, RPA robots usually simulate human operations to interact with applications or web pages. When the system detects abnormal traffic or automated behavior, it usually triggers a verification code to ensure that the operation is performed by a real user rather than an automated program. The process of RPA robots triggering verification codes actually simulates the user's browser behavior, causing the target website to actively generate verification codes.

[0005] However, there are some problems with the existing technology: the existing verification code recognition deployment method has a single model, and the model cannot be dynamically adjusted after one deployment; the model is not updated in a timely manner. Once the process is running, from the recognition failure of the process to the collection of samples and the training results, human maintenance is required. The installation and deployment takes a relatively long time and restricts people's work and rest time. Therefore, we propose a website verification code self-learning method based on RPA and machine learning. Summary of the invention

[0006] In view of the problems existing in the prior art, the purpose of the present invention is to provide a method for self-learning of website verification codes based on RPA and machine learning, which utilizes robotic process automation technology combined with a machine learning model for verification code recognition to realize the automatic collection, training and optimization of verification code images, and monitors the accuracy of verification code recognition in real time through a program. The training and data set collection processes are dynamically adjusted according to the accuracy to ensure efficient training and deployment of the recognition model.

[0007] To achieve the above object, the present invention provides the following technical solution: a method for self-learning website verification codes based on RPA and machine learning, comprising the following steps:

[0008] S1. Obtain the verification code to be identified: Use the RPA robot to simulate manual access to the website, trigger the verification code display, automatically capture the relevant data of the verification code image, and use the machine learning model to process the automatically captured verification code image;

[0009] S2, verification code classification: preliminary classification of automatically captured verification code images;

[0010] S3. Check machine learning model: Check whether a machine learning model already exists.

[0011] When the machine learning model already exists, enter S4.

[0012] When the machine learning model does not exist, enter S5;

[0013] S4. Use the existing machine learning model for recognition: The automatically captured verification code image is processed by the existing machine learning model or the trained machine learning model, and the data of the automatically captured verification code image is input into the machine learning model to recognize the data of the automatically captured verification code image. The machine learning model recognizes the verification code and returns the character result. The RPA robot completes the input of the verification code according to the output of the machine learning model and continues to execute the subsequent automation process. After the RPA robot successfully cracks the verification code, the machine learning model automatically updates its training set and performs online update of the machine learning model.

[0014] S5, judging whether the training verification code pictures are sufficient: if the training verification code pictures are sufficient, proceed to S4; if the training verification code pictures are insufficient, supplement the data and proceed to S6;

[0015] S6. Start training and export the model: train a new machine learning model based on the data of the training verification code image and export it for use;

[0016] S7, result verification: verify the trained machine learning model to verify the accuracy of the recognition results;

[0017] S8. Save the recognized images by category: save the recognized images by category for later use or analysis;

[0018] S9. Calculate the overall machine learning model recognition rate: Calculate the recognition rate and evaluate the overall performance of the model;

[0019] S10: Is the recognition success rate low? If the success rate is low, return to S6 to retrain or optimize the model. If the success rate is high, the machine learning model training is completed.

[0020] Specifically, the steps for the RPA robot in S1 to access the website are as follows:

[0021] S101, simulate user access to the website: the RPA robot starts the automation script and opens the target website;

[0022] S102. Simulate browser operations: The RPA robot simulates mouse clicks, page scrolling, and data input.

[0023] S103, Login or other interactions: The RPA robot fills in the form and submits it to log in, register, search or purchase products;

[0024] S104, loading the verification code page: the browser simulated by the RPA robot will load a page or pop-up window containing the verification code;

[0025] S105. Verification code type and processing: The RPA robot obtains image verification codes, text verification codes, sliding verification codes, or arithmetic problem verification codes, and performs data enhancement on the verification code images, including rotation, scaling, and noise removal, to simulate different variations of verification codes and enhance the robustness of the machine learning model.

[0026] Specifically, the calculation formula for noise removal is as follows:

[0027]

[0028] Among them, σ is the standard deviation, (x, y) is the coordinate of the Gaussian kernel, G(x, y) is the value of the Gaussian kernel, and e is the base of the natural logarithm. By convolving the Gaussian kernel with the image, It is a Gaussian function that describes the relative position of each pixel in the image to the center point. The farther away the pixel is, the smaller its weight is. is a normalization constant that ensures that the sum of the entire function is 1, thus smoothing the image and removing noise.

[0029] Specifically, the calculation formula of the rotation is as follows:

[0030] Given a rotation angle θ, the rotation matrix R is calculated as follows:

[0031]

[0032] Among them, (c x ,c y ) is the center coordinate of the image, and the matrix will rotate each pixel in the image by an angle θ; calculate the rotation angle and perform image correction;

[0033] The scaling calculation formula is as follows:

[0034] The original image size is W orig and H orig ,

[0035] The target width is W target , the target height H needs to be calculated target , or the target height is H target , we need to calculate the target width W target ;

[0036] Given a target width, calculate the target height:

[0037]

[0038] Calculate the target height by the target width while maintaining the aspect ratio;

[0039] Set the target height and calculate the target width:

[0040]

[0041] The target width is calculated by the target width while maintaining the aspect ratio.

[0042] Specifically, the preliminary classification in S2 is to classify the automatically captured verification code picture into an image verification code, a text verification code, a sliding verification code or an arithmetic problem verification code.

[0043] Specifically, the algorithm used by the machine learning model in S4 is a convolutional neural network:

[0044] Input image: size H target ×W target ×C in ;

[0045] Convolution layer: Use convolution kernel to calculate output feature map and activation function;

[0046] The calculation formula of the convolution kernel is as follows:

[0047]

[0048] Among them, the size of K is F h ×F w , where F h is the height of the convolution kernel, Fw is the width of the convolution kernel, and C in input channels and C out output channels; Y(i,j,k) is the value of position (i,j) and the kth output channel in the output feature map; X(i+m-1,j+n-1,c) is the value of position (i+m-1,j+n-1) and the cth channel in the input feature map; K(m,n,c,k) is the weight of the convolution kernel on the cth channel and the kth output channel; b k is the bias of the kth output channel;

[0049] Pooling layer: pooling the output of the convolutional layer to reduce the size;

[0050] Assume that the size of the pooling window is P h ×P w , the step size is S, and the maximum pooling operation is expressed as:

[0051]

[0052] Among them, Y(i,j) is the value of the i-th row and j-th column in the output feature map after pooling, and X(iS+m-1,jS+n-1) is the maximum value in the pooling window;

[0053] Fully connected layer: Flatten the pooled output and input it into the fully connected layer;

[0054] The calculation formula of the fully connected layer is as follows:

[0055] Y=WX+b,

[0056] Among them, X is the input vector, which is the flattened output of the convolutional layer or pooling layer; W is the weight matrix; b is the bias term; Y is the output of the fully connected layer;

[0057] Output: Output the classification result or regression result through the final activation function;

[0058] The calculation formula of the activation function is as follows:

[0059]

[0060] Specifically, the algorithm used for online updating of the machine learning model in S4 is stochastic gradient descent, and the calculation formula of stochastic gradient descent is as follows:

[0061]

[0062] in, is the parameter at the tth iteration, η is the learning rate, usually a constant, is the loss function Parameters The gradient of

[0063] Each iteration, the parameter It will be updated in the opposite direction of the gradient, and the learning rate η controls the step size of the update.

[0064] Specifically, the data of the training verification code pictures in S6 is a large number of verification code pictures, and the training verification code pictures are classified, the verification code pictures are divided into two, and the classification is performed according to the ratio of 2:8;

[0065] A large number of verification code images are used as a training set to train a new machine learning model, and a small number of verification code images are used as a verification set to verify the training of the new machine learning model.

[0066] Specifically, the machine learning model in S6 is trained, and the collected training algorithm is the Adam algorithm, which combines the advantages of the gradient descent method, the momentum method and RMSprop, and dynamically adjusts the learning rate of each parameter by calculating the first-order moment and the second-order moment;

[0067] The update formula of the first-order moment is:

[0068]

[0069] Among them, m t is the estimate of the first-order moment, which represents the weighted average of the gradient; β1 is the decay rate of the first-order moment, which is set to 0.9, indicating the importance of past gradients; m t-1 is the first-order moment estimate of the previous moment; is the gradient of the loss function J(θ) with respect to the parameter θ;

[0070] The update formula of the second-order moment is:

[0071]

[0072] Among them, v t is the estimate of the second-order moment, which represents the weighted average of the square of the gradient; β2 is the decay rate of the second-order moment, which is set to 0.999, indicating the importance of the square of the past gradient; v t-1 is the second-order moment estimate of the previous moment; is the square of the gradient;

[0073] Since the initial values ​​of the first and second moments are zero, the estimates will be low at the beginning, so bias correction is introduced;

[0074] Deviation correction formula:

[0075]

[0076] in, is the bias-corrected first-order moment estimate; is the bias-corrected second-order moment estimate; t is the current time step, the number of iterations;

[0077] Adjust the learning rate and update the model parameters through the deviation correction of the first-order moment and the second-order moment;

[0078] Update formula:

[0079]

[0080] Among them, θ is the parameter of the model; η is the learning rate; ε is a constant to prevent division by zero errors.

[0081] Specifically, the calculation formula of the recognition rate of the machine learning model in S9 is as follows:

[0082]

[0083] Among them, TP is a true positive example, which indicates the number of samples correctly predicted as positive by the machine learning model; TN is a true negative example, which indicates the number of samples correctly predicted as negative by the machine learning model; FP is a false positive example, which indicates the number of samples incorrectly predicted as positive by the model; FN is a false negative example, which indicates the number of samples incorrectly predicted as negative by the model.

[0084] Technical effects and advantages of the present invention:

[0085] The present invention combines RPA with machine learning to realize automatic collection, training and optimization of verification code recognition, dynamically adjust the model, and improve efficiency and accuracy; combines RPA technology to realize automatic collection and management of verification code images, simplifies the manual collection process, and improves the efficiency of data collection; through real-time monitoring of the accuracy of verification code recognition, automatically adjusts the data set collection and machine learning model training process, making the training process more intelligent and efficient, and avoiding unnecessary resource consumption; stops training and data collection when the accuracy reaches the set threshold, saving system resources; and restarts collection and training when the accuracy drops, ensuring that the machine learning model always maintains a high recognition rate.

[0086] Further features and advantages of the present invention will become apparent from the following detailed description of exemplary embodiments of the present invention with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0087] Figure 1 It is a schematic diagram of the steps provided by the present invention;

[0088] Figure 2 It is a flow chart of the RPA robot accessing a website provided by the present invention. DETAILED DESCRIPTION

[0089] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention is further described in detail below in conjunction with specific embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0090] like Figure 1 to Figure 2 As shown, a method for self-learning a website verification code based on RPA and machine learning provided by an embodiment of the present invention includes the following steps:

[0091] S1. Obtain the verification code to be identified: Use the RPA robot to simulate manual access to the website, trigger the verification code display, automatically capture the relevant data of the verification code image, and use the machine learning model to process the automatically captured verification code image;

[0092] S2, verification code classification: preliminary classification of automatically captured verification code images;

[0093] S3. Check machine learning model: Check whether a machine learning model already exists.

[0094] When the machine learning model already exists, enter S4.

[0095] When the machine learning model does not exist, enter S5;

[0096] S4. Use the existing machine learning model for recognition: The automatically captured verification code image is processed by the existing machine learning model or the trained machine learning model, and the data of the automatically captured verification code image is input into the machine learning model to recognize the data of the automatically captured verification code image. The machine learning model recognizes the verification code and returns the character result. The RPA robot completes the input of the verification code according to the output of the machine learning model and continues to execute the subsequent automation process. After the RPA robot successfully cracks the verification code, the machine learning model automatically updates its training set and performs online update of the machine learning model.

[0097] S5, judging whether the training verification code pictures are sufficient: if the training verification code pictures are sufficient, proceed to S4; if the training verification code pictures are insufficient, supplement the data and proceed to S6;

[0098] S6. Start training and export the model: train a new machine learning model based on the data of the training verification code image and export it for use;

[0099] S7, result verification: verify the trained machine learning model to verify the accuracy of the recognition results;

[0100] S8. Save the recognized images by category: save the recognized images by category for later use or analysis;

[0101] S9. Calculate the overall machine learning model recognition rate: Calculate the recognition rate and evaluate the overall performance of the model;

[0102] S10: Is the recognition success rate low? If the success rate is low, return to S6 to retrain or optimize the model. If the success rate is high, the machine learning model training is completed.

[0103] In this embodiment, preferably, the steps of the RPA robot in S1 accessing the website are:

[0104] S101, simulate user access to the website: the RPA robot starts the automation script and opens the target website;

[0105] S102. Simulate browser operations: The RPA robot simulates mouse clicks, page scrolling, and data input.

[0106] S103, Login or other interactions: The RPA robot fills in the form and submits it to log in, register, search or purchase products;

[0107] S104, loading the verification code page: the browser simulated by the RPA robot will load a page or pop-up window containing the verification code;

[0108] S105, verification code type and processing: The RPA robot obtains image verification codes, text verification codes, sliding verification codes, or arithmetic verification codes, and performs data enhancement on the verification code images, including rotation, scaling, and noise removal, to simulate different variations of verification codes and enhance the robustness of the machine learning model.

[0109] It should be noted that when performing tasks, RPA robots usually simulate manual operations to interact with applications or web pages. When the system detects abnormal traffic or automated behavior, it usually triggers a verification code to ensure that the operation is performed by a real user rather than an automated program. The process of RPA robots triggering a verification code is actually to simulate the user's browser behavior, causing the target website to actively generate a verification code.

[0110] In this embodiment, preferably, the calculation formula for noise removal is as follows:

[0111]

[0112] Among them, σ is the standard deviation, (x, y) is the coordinate of the Gaussian kernel, G(x, y) is the value of the Gaussian kernel, and e is the base of the natural logarithm. By convolving the Gaussian kernel with the image, It is a Gaussian function that describes the relative position of each pixel in the image to the center point. The farther away the pixel is, the smaller its weight is. is a normalization constant that ensures that the sum of the entire function is 1, thereby smoothing the image and removing noise;

[0113] It should be noted that Gaussian filtering is applied to smooth the image and remove noise while keeping the edges relatively clear; the core idea of ​​Gaussian blur is to use Gaussian distribution as a weight to perform weighted averaging on each pixel of the image to achieve a smoothing effect.

[0114] In this embodiment, preferably, the calculation formula of the rotation is as follows:

[0115] Given a rotation angle θ, the rotation matrix R is calculated as follows:

[0116]

[0117] Among them, (c x ,c y ) is the center coordinate of the image, and the matrix will rotate each pixel in the image by an angle θ; calculate the rotation angle and perform image correction;

[0118] The scaling calculation formula is as follows:

[0119] The original image size is W orig and H orig ,

[0120] The target width is W target , the target height H needs to be calculated target , or the target height is H target , we need to calculate the target width W target ;

[0121] Given a target width, calculate the target height:

[0122]

[0123] Calculate the target height by the target width while maintaining the aspect ratio;

[0124] Set the target height and calculate the target width:

[0125]

[0126] Calculate the target width by using the target width while maintaining the aspect ratio;

[0127] It should be noted that the characters in the verification code image may be rotated to a certain angle, making it difficult to directly apply a simple character recognition algorithm. By rotating the verification code image, the verification code image is easier to recognize; the characters in the verification code image may be of different sizes, or they are scaled to different proportions, which also increases the difficulty of recognition. First, standardize the image to a uniform size through scaling operations, and then perform character recognition; scale the image to a fixed size to ensure that the characters in the verification code can match the input size of the training model.

[0128] In this embodiment, preferably, the preliminary classification in S2 is to classify the automatically captured verification code picture into an image verification code, a text verification code, a sliding verification code or an arithmetic problem verification code;

[0129] It should be noted that classifying verification code images by type makes it easier to process verification code images separately, and to classify and store recognized data information for analysis and tracking.

[0130] In this embodiment, preferably, the algorithm adopted by the machine learning model in S4 is a convolutional neural network:

[0131] Input image: size H target ×W target ×C in ;

[0132] Convolution layer: Use convolution kernel to calculate output feature map and activation function;

[0133] The calculation formula of the convolution kernel is as follows:

[0134]

[0135] Among them, the size of K is F h ×F w , where F h is the height of the convolution kernel, F w is the width of the convolution kernel, and C in input channels and C out output channels; Y(i,j,k) is the value of position (i,j) and the kth output channel in the output feature map; X(i+m-1,j+n-1,c) is the value of position (i+m-1,j+n-1) and the cth channel in the input feature map; K(m,n,c,k) is the weight of the convolution kernel on the cth channel and the kth output channel; b k is the bias of the kth output channel;

[0136] Pooling layer: pooling the output of the convolutional layer to reduce the size;

[0137] Assume that the size of the pooling window is Ph ×P w , the step size is S, and the maximum pooling operation is expressed as:

[0138]

[0139] Among them, Y(i,j) is the value of the i-th row and j-th column in the output feature map after pooling, and X(iS+m-1,jS+n-1) is the maximum value in the pooling window;

[0140] Fully connected layer: Flatten the pooled output and input it into the fully connected layer;

[0141] The calculation formula of the fully connected layer is as follows:

[0142] Y=WX+b,

[0143] Among them, X is the input vector, which is the flattened output of the convolutional layer or pooling layer; W is the weight matrix; b is the bias term; Y is the output of the fully connected layer;

[0144] Output: Output the classification result or regression result through the final activation function;

[0145] The calculation formula of the activation function is as follows:

[0146]

[0147] It should be noted that the calculation of convolutional neural networks is essentially to filter the input image through the convolution kernel to extract local features, and then reduce the amount of calculation through pooling operations. Finally, the classification or regression task is completed through the fully connected layer and activation function to realize image processing. The convolution layer is the most core part, responsible for extracting image features.

[0148] In this embodiment, preferably, the algorithm used for online updating of the machine learning model in S4 is stochastic gradient descent, and the calculation formula of stochastic gradient descent is as follows:

[0149]

[0150] in, is the parameter at the tth iteration, η is the learning rate, usually a constant, is the loss function Parameters The gradient of

[0151] Each iteration, the parameter It will be updated in the opposite direction of the gradient, and the learning rate η controls the step size of the update;

[0152] It should be noted that the automatic update algorithm of the machine learning model can update and adjust itself when new data arrives to improve prediction accuracy and avoid obsolescence or overfitting. Stochastic gradient descent updates the parameters of the model by continuously using a single training sample or a small batch of samples.

[0153] In this embodiment, preferably, the data of the training verification code pictures in S6 is a large number of verification code pictures, and the training verification code pictures are classified, the verification code pictures are divided into two, and the classification is performed according to the ratio of 2:8;

[0154] A large number of verification code images are used as a training set to train a new machine learning model, and a small number of verification code images are used as a verification set to verify the training of the new machine learning model;

[0155] It should be noted that by classifying the verification code pictures, the verification code pictures can be divided into two categories. A large number of verification code pictures are used as training sets to train new machine learning models, and a small number of verification code pictures are used as verification sets to verify the training of new machine learning models, thereby realizing the training processing of machine learning models.

[0156] In this embodiment, preferably, the machine learning model in S6 is trained, and the collected training algorithm is the Adam algorithm, which combines the advantages of the gradient descent method, the momentum method and RMSprop, and dynamically adjusts the learning rate of each parameter by calculating the first-order moment and the second-order moment;

[0157] The update formula of the first-order moment is:

[0158]

[0159] Among them, m t is the estimate of the first-order moment, which represents the weighted average of the gradient; β1 is the decay rate of the first-order moment, which is set to 0.9, indicating the importance of past gradients; m t-1 is the first-order moment estimate of the previous moment; is the gradient of the loss function J(θ) with respect to the parameter θ;

[0160] The update formula of the second-order moment is:

[0161]

[0162] Among them, v t is the estimate of the second-order moment, which represents the weighted average of the square of the gradient; β2 is the decay rate of the second-order moment, which is set to 0.999, indicating the importance of the square of the past gradient; v t-1 is the second-order moment estimate of the previous moment; is the square of the gradient;

[0163] Since the initial values ​​of the first and second moments are zero, the estimates will be low at the beginning, so bias correction is introduced;

[0164] Deviation correction formula:

[0165]

[0166] in, is the bias-corrected first-order moment estimate; is the bias-corrected second-order moment estimate; t is the current time step, the number of iterations;

[0167] Adjust the learning rate and update the model parameters through the deviation correction of the first-order moment and the second-order moment;

[0168] Update formula:

[0169]

[0170] Among them, θ is the parameter of the model; η is the learning rate; ε is a constant to prevent division by zero errors;

[0171] It should be noted that it combines the advantages of gradient descent, momentum method and RMSprop, and dynamically adjusts the learning rate of each parameter by calculating the first-order moment (mean of the gradient) and the second-order moment (mean of the square of the gradient), thereby accelerating convergence and avoiding oscillation; Adam uses the first-order moment estimate of the gradient to dynamically adjust the learning rate, which is regarded as the exponential decay average of the gradient; Adam also uses the second-order moment estimate of the gradient to adjust the learning rate, which is the exponential decay average of the square of the gradient; since the initial values ​​of the first-order moment and the second-order moment are zero, their estimates will be low at the beginning. In order to compensate for this deviation, Adam introduces deviation correction; the learning rate is adjusted and the parameters of the model are updated through the deviation correction of the first-order moment and the second-order moment; when processing large-scale data sets and models with more parameters, it shows good performance and convergence speed.

[0172] In this embodiment, preferably, the calculation formula of the recognition rate of the machine learning model in S9 is as follows:

[0173]

[0174] Among them, TP is a true positive example, which indicates the number of samples correctly predicted as positive by the machine learning model; TN is a true negative example, which indicates the number of samples correctly predicted as negative by the machine learning model; FP is a false positive example, which indicates the number of samples incorrectly predicted as positive by the model; FN is a false negative example, which indicates the number of samples incorrectly predicted as negative by the model;

[0175] It should be noted that recognition rate accuracy is a simple ratio that is easy to understand and calculate. It is suitable for balanced data sets. When the number of samples in each category is roughly the same, accuracy is an effective measurement indicator.

[0176] The specific steps of this application are:

[0177] Step 1: Get the verification code to be identified: Use the RPA robot to simulate manual access to the website, trigger the verification code display, automatically capture the relevant data of the verification code image, and use the machine learning model to process the automatically captured verification code image;

[0178] Step 2: Verification code classification: preliminary classification of automatically captured verification code images;

[0179] Step 3: Check the machine learning model: Check whether a machine learning model already exists.

[0180] When the machine learning model already exists, proceed to step 4.

[0181] When the machine learning model does not exist, go to step 5;

[0182] Step 4: Use the existing machine learning model for recognition: Use the existing machine learning model or the trained machine learning model to process the automatically captured verification code image, input the data of the automatically captured verification code image into the machine learning model, and recognize the data of the automatically captured verification code image. The machine learning model recognizes the verification code and returns the character result. The RPA robot completes the input of the verification code according to the output of the machine learning model and continues to execute the subsequent automation process. After the RPA robot successfully cracks the verification code, the machine learning model automatically updates its training set and performs online update of the machine learning model.

[0183] Step 5: Determine whether the training verification code images are sufficient: if the training verification code images are sufficient, proceed to step 4; if the training verification code images are insufficient, supplement the data and proceed to step 6;

[0184] Step 6. Start training and export the model: Train a new machine learning model based on the data of the training verification code image and export it for use;

[0185] Step 7: Result verification: Verify the trained machine learning model to verify the accuracy of the recognition results;

[0186] Step 8. Save the recognized images by category: Save the recognized results by category for later use or analysis;

[0187] Step 9: Calculate the overall machine learning model recognition rate: Count the recognition rate and evaluate the overall performance of the model;

[0188] Step 10: Check whether the recognition success rate is low: If the success rate is low, return to step 6 to retrain or optimize the model. If the success rate is high, the machine learning model training is completed.

[0189] Finally, it should be noted that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A website verification code self-learning method based on RPA and machine learning, characterized in that: The steps include: S1. Obtain the verification code to be identified: Use the RPA robot to simulate manual access to the website, trigger the verification code display, automatically capture the relevant data of the verification code image, and use the machine learning model to process the automatically captured verification code image; S2, verification code classification: preliminary classification of automatically captured verification code images; S3. Check machine learning model: Check whether a machine learning model already exists. When the machine learning model already exists, enter S4. When the machine learning model does not exist, enter S5; S4. Use the existing machine learning model for recognition: The automatically captured verification code image is processed by the existing machine learning model or the trained machine learning model, and the data of the automatically captured verification code image is input into the machine learning model to recognize the data of the automatically captured verification code image. The machine learning model recognizes the verification code and returns the character result. The RPA robot completes the input of the verification code according to the output of the machine learning model and continues to execute the subsequent automation process. After the RPA robot successfully cracks the verification code, the machine learning model automatically updates its training set and performs online update of the machine learning model. S5, judging whether the training verification code pictures are sufficient: if the training verification code pictures are sufficient, proceed to S4; if the training verification code pictures are insufficient, supplement the data and proceed to S6; S6. Start training and export the model: train a new machine learning model based on the data of the training verification code image and export it for use; S7, result verification: verify the trained machine learning model to verify the accuracy of the recognition results; S8. Save the recognized images by category: save the recognized images by category for later use or analysis; S9. Calculate the overall machine learning model recognition rate: Calculate the recognition rate and evaluate the overall performance of the model; S10: Is the recognition success rate low? If the success rate is low, return to S6 to retrain or optimize the model. If the success rate is high, the machine learning model training is completed.

2. According to claim 1, a method for self-learning website verification codes based on RPA and machine learning is characterized in that: The steps for the RPA robot in S1 to access the website are as follows: S101, simulate user access to the website: the RPA robot starts the automation script and opens the target website; S102. Simulate browser operations: The RPA robot simulates mouse clicks, page scrolling, and data input. S103, Login or other interactions: The RPA robot fills in the form and submits it to log in, register, search or purchase products; S104, loading the verification code page: the browser simulated by the RPA robot will load a page or pop-up window containing the verification code; S105. Verification code type and processing: The RPA robot obtains image verification codes, text verification codes, sliding verification codes, or arithmetic problem verification codes, and performs data enhancement on the verification code images, including rotation, scaling, and noise removal, to simulate different variations of verification codes and enhance the robustness of the machine learning model.

3. According to claim 2, a method for self-learning website verification codes based on RPA and machine learning is characterized in that: The calculation formula for the noise removal is as follows: Among them, σ is the standard deviation, (x, y) is the coordinate of the Gaussian kernel, G(x, y) is the value of the Gaussian kernel, and e is the base of the natural logarithm. By convolving the Gaussian kernel with the image, It is a Gaussian function that describes the relative position of each pixel in the image to the center point. The farther away the pixel is, the smaller its weight is. is a normalization constant that ensures that the sum of the entire function is 1, thus smoothing the image and removing noise.

4. According to claim 2, a method for self-learning website verification codes based on RPA and machine learning is characterized in that: The calculation formula for the rotation is as follows: Given a rotation angle θ, the rotation matrix R is calculated as follows: Among them, (c x ,c y ) is the center coordinate of the image, and the matrix will rotate each pixel in the image by an angle θ; calculate the rotation angle and perform image correction; The scaling calculation formula is as follows: The original image size is W orig and H orig , The target width is W target , the target height H needs to be calculated target , or the target height is H target , we need to calculate the target width W target ; Given a target width, calculate the target height: Calculate the target height by the target width while maintaining the aspect ratio; Set the target height and calculate the target width: The target width is calculated by the target width while maintaining the aspect ratio.

5. According to claim 1, a method for self-learning website verification codes based on RPA and machine learning is characterized in that: The preliminary classification in S2 is to divide the automatically captured verification code picture into an image verification code, a text verification code, a sliding verification code or an arithmetic problem verification code.

6. According to claim 1, a method for self-learning website verification codes based on RPA and machine learning is characterized in that: The algorithm used by the machine learning model in S4 is a convolutional neural network: Input image: size H target ×W target ×C in ; Convolution layer: Use convolution kernel to calculate output feature map and activation function; The calculation formula of the convolution kernel is as follows: Among them, the size of K is F h ×F w , where F h is the height of the convolution kernel, F w is the width of the convolution kernel, and C in input channels and C out output channels; Y(i,j,k) is the value of position (i,j) and the kth output channel in the output feature map; X(i+m-1,j+n-1,c) is the value of position (i+m-1,j+n-1) and the cth channel in the input feature map; K(m,n,c,k) is the weight of the convolution kernel on the cth channel and the kth output channel; b k is the bias of the kth output channel; Pooling layer: pooling the output of the convolutional layer to reduce the size; Assume that the size of the pooling window is P h ×P w , the step size is S, and the maximum pooling operation is expressed as: Among them, Y(i,j) is the value of the i-th row and j-th column in the output feature map after pooling, and X(iS+m-1,jS+n-1) is the maximum value in the pooling window; Fully connected layer: Flatten the pooled output and input it into the fully connected layer; The calculation formula of the fully connected layer is as follows: Y=WX+b, Among them, X is the input vector, which is the flattened output of the convolutional layer or pooling layer; W is the weight matrix; b is the bias term; Y is the output of the fully connected layer; Output: Output the classification result or regression result through the final activation function; The calculation formula of the activation function is as follows:

7. According to claim 1, a method for self-learning website verification codes based on RPA and machine learning is characterized in that: The algorithm used for online updating of the machine learning model in S4 is stochastic gradient descent, and the calculation formula of stochastic gradient descent is as follows: in, is the parameter at the tth iteration, η is the learning rate, usually a constant, is the loss function Parameters The gradient of Each iteration, the parameter It will be updated in the opposite direction of the gradient, and the learning rate η controls the step size of the update.

8. According to claim 1, a method for self-learning website verification codes based on RPA and machine learning is characterized in that: The data of the training verification code pictures in S6 is a large number of verification code pictures, and the training verification code pictures are classified, the verification code pictures are divided into two, and the classification is performed according to the ratio of 2:8; A large number of verification code images are used as a training set to train a new machine learning model, and a small number of verification code images are used as a verification set to verify the training of the new machine learning model.

9. According to claim 1, a method for self-learning website verification codes based on RPA and machine learning is characterized in that: The machine learning model in S6 is trained, and the collected training algorithm is the Adam algorithm, which combines the advantages of the gradient descent method, the momentum method and RMSprop, and dynamically adjusts the learning rate of each parameter by calculating the first-order moment and the second-order moment; The update formula of the first-order moment is: Among them, m t is the estimate of the first-order moment, which represents the weighted average of the gradient; β1 is the decay rate of the first-order moment, which is set to 0.9, indicating the importance of past gradients; m t-1 is the first-order moment estimate of the previous moment; is the gradient of the loss function J(θ) with respect to the parameter θ; The update formula of the second-order moment is: Among them, v t is the estimate of the second-order moment, which represents the weighted average of the square of the gradient; β2 is the decay rate of the second-order moment, which is set to 0.999, indicating the importance of the square of the past gradient; v t-1 is the second-order moment estimate of the previous moment; is the square of the gradient; Since the initial values ​​of the first and second moments are zero, the estimates will be low at the beginning, so bias correction is introduced; Deviation correction formula: in, is the bias-corrected first-order moment estimate; is the bias-corrected second-order moment estimate; t is the current time step, the number of iterations; Adjust the learning rate and update the model parameters through the deviation correction of the first-order moment and the second-order moment; Update formula: Among them, θ is the parameter of the model; η is the learning rate; ε is a constant to prevent division by zero errors.

10. According to claim 1, a method for self-learning website verification codes based on RPA and machine learning is characterized in that: The calculation formula of the recognition rate of the machine learning model in S9 is as follows: Among them, TP is a true positive example, which indicates the number of samples correctly predicted as positive by the machine learning model; TN is a true negative example, which indicates the number of samples correctly predicted as negative by the machine learning model; FP is a false positive example, which indicates the number of samples incorrectly predicted as positive by the model; FN is a false negative example, which indicates the number of samples incorrectly predicted as negative by the model.

Citation Information

Cited By

  • Rapid nondestructive testing system based on fusion of near infrared spectrum and Raman spectrum

    CN120121571A