Verification code automatic identification method of improved RPA robot

By introducing the self-attention layer and attention mechanism into the YOLOv8 model, the sliding verification code recognition is optimized, which solves the problems of sliding verification code interference and low recognition efficiency in the RPA process, and achieves higher recognition accuracy and process stability.

CN118711044APending Publication Date: 2024-09-27HANGZHOU DIANZI UNIV +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410749626.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-12
Publication Date
2024-09-27

AI Technical Summary

Technical Problem

The interference of the sliding verification code on the RPA process leads to low execution efficiency. Traditional image processing technology has poor recognition results in different environments. The RPA production environment has poor stability and requires a lot of manual intervention.

Method used

Introducing the self-attention layer into the YOLOv8 model, combining channel attention and spatial attention mechanisms, optimizing the target detection algorithm, adapting to different login pages through incremental training, and encapsulating it into a plug-in for sliding verification code recognition, reducing the number of retries and improving Recognition accuracy.

Benefits of technology

It significantly improves the recognition rate and process execution efficiency of sliding verification codes, enhances the model's recognition ability in low-resolution scenarios, reduces manual intervention and the number of retries, and improves the stability and accuracy of the RPA process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118711044A
    Figure CN118711044A
Patent Text Reader

Abstract

The invention discloses a verification code automatic identification method for an improved RPA robot, and the method comprises the steps: firstly collecting a real image of a sliding verification code, marking an image gap, storing the image gap, and mixing the image gap with an open-source sliding verification code data set to obtain a training data set; secondly, constructing a self-attention layer in YOLOv8, taking the training data set as input, completing automatic identification of the verification code, and obtaining an initial sliding verification code identification model after training; and packaging the initial sliding verification code model into a plug-in, calling the plug-in to complete verification code background information analysis, and returning the distance between the sliding block and the gap to complete verification identification. And finally, the plug-in automatically records a data pair passing through the verification code, and incremental training is performed on the initial sliding verification code identification model by using the data pair. According to the method, the recognition rate of a target detection algorithm is remarkably improved, and the model structure is adjusted through adaptive incremental training.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of process automation, and in particular relates to a method for improving automatic recognition of verification codes of an RPA robot. Background Art

[0002] With the development of the digital economy, many industries and organizations are facing new opportunities and challenges. The rise of the digital economy has brought about extensive technological applications and digital transformation.

[0003] Robotic process automation (RPA) provides a relatively simple, fast, efficient and cost-effective new solution for enterprise digital transformation. Robotic process automation refers to the use of software automation systems to simulate human operations in digital devices such as computers, assisting employees to complete a large number of repetitive, rule-based and time-consuming operations, and automating business processes. In business process automation, robots need to pass various verification code mechanisms before they can execute subsequent processes. The verification code mechanism not only affects the efficiency of RPA process execution, but may even cause the process to be terminated. Common verification codes are divided into text verification codes, image verification codes and behavior verification codes. Text verification codes and image verification codes currently have relatively mature libraries with high pass rates.

[0004] However, the behavior-verified sliding verification code not only needs to check whether the user performs the correct operation, but also needs to analyze the dragging behavior of the mouse to further determine whether the user is a legitimate human user. At the same time, the stability of the RPA production environment is often poor. Manual intervention in processing verification codes requires a lot of time and human resources, and the stability of the process operation will be greatly reduced. When facing different real-world scenarios, the use of traditional image processing technology cannot achieve good detection results on all verification codes. YOLO, as a target detection algorithm with strong real-time processing capabilities and universality, is very suitable for verification and recognition. However, the designers of the sliding verification code will use complex background images and add interference items to increase the difficulty. RPA can work in different resolution environments, and the targets in low-resolution images often lose details, making it difficult to extract the features of the target. The attention network mechanism can effectively help YOLO better remove background noise in the sliding verification code, reduce the interference of the background on the slider position positioning, enhance the model's attention to important features and capture of global context, and improve the accuracy of slider recognition. Summary of the invention

[0005] The purpose of the present invention is to optimize the RPA process. In order to effectively reduce the interference of sliding verification codes on the RPA process, a verification code automatic recognition method for improving the RPA robot is proposed to solve the above problems.

[0006] The present invention ensures the process execution efficiency of the RPA robot working in a private domain environment, optimizes the target detection algorithm, adaptively adjusts to different login pages, and reduces the time wasted due to too many login failure retries.

[0007] A method for improving automatic verification code recognition of an RPA robot includes the following steps:

[0008] Step 1. Collect real images of sliding verification codes, use annotation tools to annotate the image gaps, save them, and mix them with the sliding verification code dataset from the open source dataset website to obtain the training dataset.

[0009] Step 2. Build a self-attention layer in YOLOv8, take the model training data set obtained in step 1 as input, and obtain the initial sliding verification code recognition model after training.

[0010] Step 3. Encapsulate the original sliding verification code model into a plug-in for verification code recognition.

[0011] Step 4. When RPA faces a sliding verification code, it calls the plug-in to parse the verification code background information, return the distance between the slider and the gap, drag the slider to the target area, and complete the verification recognition.

[0012] Step 5. At the same time, the plug-in in step 3 automatically records the data pairs that pass the verification code, customizes the verification code recognition model for different private domain environments, and uses the saved data pairs to perform incremental training on the initial sliding verification code recognition model.

[0013] The self-attention layer added in step 2:

[0014] The channel attention mechanism in the NAM module is connected in series with the spatial attention mechanism in the CBAM module. The connected attention mechanism module is expressed as follows:

[0015]

[0016] M c (F) = sigmoid(W γ (BN(F))) (2)

[0017] M s (F′)=σ(f 7×7 ([AvgPool(F′);MaxPool(F′)])) (3)

[0018]

[0019] Wherein, formula (1) and (2) represent the NAM channel attention calculation formula, F represents the input feature map, μ θ and σθ are the mean and standard deviation of the small batch θ, ∈ and β represent the trainable affine transformation parameters (scale and displacement), γ represents the scaling factor in the BN layer, the scaling factor reflects the change size of each channel and also indicates the importance of the channel, and the weight is where γ i and γ j Represents the scaling factor corresponding to channels i and j. Formula (3) represents the CBMA spatial attention calculation module, F′ is the feature map after channel attention weighting, and two feature maps are obtained after global maximum pooling and global average pooling of the channel, and then through convolution operation, finally the spatial attention feature map is generated. Formula (4) (5) indicates that the spatial attention mechanism and the channel attention mechanism are combined in series. After adding the self-attention layer to the SPPF layer (fast spatial pyramid pooling layer) in the Backone of the YOLOv8 model, the model's ability to select and focus on features can be improved. The attention module receives the feature map output by the SPPF layer and adjusts and optimizes these features by learning the importance of each position in the feature map. It enables the model to pay more attention to areas that are more helpful for the current task when performing target detection.

[0020] In step 3, the original sliding verification code model is encapsulated into a plug-in and provided to users. The original sliding verification code model is integrated into the RPA platform and exposed in the form of a Restful interface. It is only necessary to input the sliding verification code image into this interface and wait for the model to return the required sliding distance.

[0021] In steps 4 and 5, the results returned by the initial sliding verification code model can obtain the coordinates of the center point of the gap and the relative width and height of the rectangular frame. After calculation, the distance required to slide can be obtained. If the RPA successfully passes the sliding verification code recognition, the results returned by the model and the verification code background image, that is, the data pair in step 5, can be used as the subsequent incremental training data set. The working environment of RPA is a private domain environment, and the login process does not change frequently. It only needs to customize the model for the resident website to greatly improve the accuracy of slider recognition and achieve process acceleration. Even if the internal details of the sliding verification code are adjusted, the customized model can also achieve adaptation.

[0022] Beneficial effects of the present invention:

[0023] Effect 1: The target detection algorithm YOLO was successfully optimized, and the attention mechanism was introduced, which significantly improved the recognition rate of the target detection algorithm.

[0024] Effect 2: By adjusting the existing attention mechanism, the channel attention module and the spatial attention module are better coupled, further improving the module recognition effect. At the same time, in view of the low efficiency of RPA in sliding verification code recognition in low-resolution environments, the YOLO model's recognition efficiency in low-resolution scenes is improved by embedding the attention mechanism module.

[0025] Effect three: In a private domain environment, adaptive incremental training is performed to adjust the model structure in response to the differences in verification code recognition in different scenarios, and the ability to recognize verification codes in different scenarios is further improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 This is an architectural diagram of an improved RPA robot verification code automatic recognition method proposed by the present invention;

[0027] Figure 2 is the improved attention network diagram;

[0028] Figure 3 The present invention is a flowchart of a method for improving the automatic recognition of verification codes of an RPA robot. DETAILED DESCRIPTION

[0029] The following case study Figure 1 , Figure 1 This is an improved RPA robot verification code automatic recognition method proposed by the present invention. It can be evaluated on Geetest verification code, NetEase Yidun verification code, and Tencent verification code, and YOLOv8 is selected as its initialization model. The model is divided into two parts: one part is Backone, which is mainly responsible for extracting features from the input image, and the features are used for subsequent target detection. The second part is Head, which is responsible for mapping the features extracted by Backone to the target detection box and identifying the objects in the image.

[0030] A method for improving automatic verification code recognition of an RPA robot includes the following steps:

[0031] Step 1. Collect real images of sliding verification codes, use the labeling tool LabelImg to label the image gaps, save the labeled image information, and mix the sliding verification code dataset from the open source dataset website to obtain the training dataset.

[0032] Step 2. Build a self-attention layer in the existing target detection algorithm YOLOv8, take the model training data set obtained in step 1 as input, and obtain the initial sliding verification code recognition model after training.

[0033] Step 3. Encapsulate the original sliding verification code model into a plug-in for verification code recognition.

[0034] Step 4. When RPA encounters a sliding verification code, it calls the plug-in to parse the verification code background information, returns the distance between the slider and the gap, and uses RPA's mouse simulation to drag the slider to the target area to complete the verification and recognition.

[0035] Step 5. At the same time, the plug-in in step 3 automatically records the data pairs that pass the verification code, customizes the verification code recognition model for different private domain environments, and uses the saved data pairs to perform incremental training on the initial sliding verification code recognition model.

[0036] To further explain, the private domain environment refers to the digital channels that the enterprise owns, can control, and can directly reach users, such as corporate websites, personal blogs, WeChat public accounts, etc. The private domain is closed, and only specific people can enter and use the resources in it. At the same time, the private domain also has a certain degree of security and reliability, which can protect the information and data in it from being accessed or used by unauthorized persons.

[0037] At the same time, adding an attention network to Backone of YOLOv8 helps to better capture the important features of the sliding verification code image. The attention mechanism is also redesigned, retaining the channel weight extraction method of the NAMAttention channel attention submodule and integrating it with the spatial attention submodule of CBAM. The improved attention network diagram is referenced Figure 2 .

[0038] The specific pseudocode implementation steps of the improved attention mechanism network are as follows:

[0039]

[0040]

[0041] The present invention is further described below and supplemented with examples. The present invention example is to obtain the distance between the slider and the notch through the above solution, and use the RPA process automation robot to pass the website sliding verification code mechanism.

[0042] The specific implementation steps are as follows:

[0043] Step 1. After RPA opens the login page through the URL, enter a series of instructions such as username and password, use the RPA tool to capture the verification code image, and obtain the background and gap images of the slider.

[0044] It should be noted that the method of obtaining the picture in this embodiment is to recognize the slider background and the gap picture through the OCR (Optical Character Recognition) library to obtain the position of the gap relative to the background picture.

[0045] Step 2. After obtaining the gap image and slider background image, upload them to the server through the Restful API interface. The YOLOv8 model is deployed in the server, and the model incorporates an optimized attention mechanism. When the image is input into the model, the distance between the slider and the gap will be returned. This distance is also fed back to the RPA robot through the Restful API interface.

[0046] It should be noted that the results returned by YOLOv8 when identifying the gap position include the object category, confidence level and coordinates (x, y, width and height) on the image. This information is also needed to calculate the relative distance of the gap.

[0047] Step 3. After the RPA robot obtains the distance information, it will operate the sliding button at the bottom of the image to slide the corresponding distance.

[0048] The robot controls the sliding of the sliding button by obtaining the element component to obtain the xpath position of the sliding button in the page. If there is one, the mouse pointer points to the sliding button, and then the mouse sliding component is used. This component can choose to long-click the left mouse button and drag the slider to the specified position, so that the sliding button can slide to the specified position.

[0049] Step 4. Finally, the robot clicks the login button to determine whether it can log in. If it can log in, it proves that the sliding verification code is recognized accurately, and the verification code image of this website and other parameter records are stored in a certain location on the local machine. Otherwise, if the login fails, the retry mechanism of the RPA process will be started. If multiple retries fail, the RPA process will be interrupted.

[0050] Login failure affects the efficiency of RPA process execution. This method is to improve the recognition efficiency of sliding verification codes to optimize the RPA process.

[0051] The recognition efficiency of sliding verification codes can be further improved. RPA process automation robots usually work in private domain environments. The verification code mechanism of websites rarely undergoes large-scale adjustments, which means that the code of the login process will not change significantly. The problem is still to collect data pairs that pass the verification code mechanism as incremental training data sets. Regularly using incremental data sets to incrementally train the general sliding verification code model can improve model performance and make it better in specific fields. Figure 3 The operation performed in the incremental learning area is marked in the figure. The present invention is aimed at the sliding verification code in the verification code mechanism, and further improves the recognition efficiency of the sliding verification code.

[0052] The specific steps are as follows:

[0053] RPA continuously obtains website verification code data through the recognition mechanism and saves the correct recognition results locally. Over time, data will continue to accumulate to form a data set that can be used to train the model. It can be used for the general model initially trained to create a more customized verification code recognition model for websites in private domain environments. During the incremental training process, a threshold can be determined according to needs. When the recognition rate of the model stably reaches the set threshold, it is considered that the model has sufficient accuracy and can enter the production use stage. At this point, there is no need to continue collecting correct recognition data, which can reduce the pressure on computer storage space.

[0054] Through incremental training and setting appropriate thresholds, the general model can be customized to have more accurate verification code recognition capabilities on websites in private domain environments, ensuring the stability and reliability of the model in the production environment, and reducing the time spent on the retry mechanism caused by the login process, thereby optimizing the RPA process.

[0055] Table 1: Experimental results details

[0056] Model Accuracy (%) mAP50(%) mAP50-95(%) YOLOv8n 86.893 86.066 62.196 YOLOv8n+SENet 87.864 88.193 64.04 YOLOv8n+CBAM 76.214 95.5 73.881 YOLOv8n+ResBlock_CBAM 88.350 87.0 68.529 YOLOv8n+NAM Attention(ch*) 93.203 90.16 67.85 YOLOv8n+ShuffleAttention 90.777 92.037 69.605 YOLOv8n+CoordinateAttention 91.748 91.761 64.322 YOLOv8n+GAMAttention 89.320 92.763 73.687 The present invention 94.660 92.857 75.046 YOLOv8n+SelfAttention(head) 93.689 94.404 74.365 YOLOv8n+SelfAttention(c2f) 90.776 87.217 66.754

[0057] Table 1 shows the experimental results obtained in the process of improving the YOLO algorithm. The performance evaluation indicators used in the experiment are Accuracy, mAP50 and mAP50-95. The performance of YOLO with different attention network models is compared, and the position where attention is added to YOLO is also compared. Finally, the model with the redesigned attention module has a relatively high accuracy.

[0058] The above is the implementation process of the present invention. Any changes made according to the technology of the present invention, as long as the resulting functions do not exceed the scope of the technical solution of the present invention, shall fall within the protection scope of the present invention.

Claims

1. A method for improving the automatic recognition of verification codes of RPA robots, characterized in that: The steps include: Step 1. Collect the real image of the sliding verification code, use the annotation tool to annotate the image gaps, save it and mix it with the open source sliding verification code dataset to obtain the training dataset; Step 2. Build a self-attention layer in YOLOv8, take the training data set as input, complete the automatic recognition of the verification code, and obtain the initial sliding verification code recognition model after training; Step 3. Encapsulate the original sliding verification code model into a plug-in for verification code recognition; Step 4. When facing the sliding verification code, RPA calls the plug-in to complete the verification code background information analysis, returns the distance between the slider and the gap, drags the slider to the target area, and completes the verification recognition; Step 5. At the same time, the plug-in in step 3 automatically records the data pairs that pass the verification code, and uses the data pairs to perform incremental training on the initial sliding verification code recognition model.

2. According to claim 1, the method for improving the automatic recognition of verification codes of RPA robots is characterized in that: The self-attention layer described in step 2 is as follows: The channel attention mechanism in the NAM module is connected in series with the spatial attention mechanism in the CBAM module. The connected attention mechanism module is expressed as follows: M c (F)=sigmoid(W γ (BN(F))) (2) M s (F′)=σ(f 7×7 ([AvgPool(F′);MaxPool(F′)])) (3) Wherein, formula (1) and (2) represent the NAM channel attention calculation formula, F represents the input feature map, μ θ and σ θ are the mean and standard deviation of the small batch θ, ∈ and β represent the trainable affine transformation parameters, γ represents the scaling factor in the BN layer, reflecting the change size of each channel, and the weight is where γ i and γ j represents the scaling factor corresponding to channels i and j; Formula (3) represents the CBMA spatial attention calculation module, F′ is the feature map after channel attention weighting, and two feature maps are obtained through global maximum pooling and global average pooling of the channel, and then the spatial attention feature map is generated through convolution operation; Formulas (4) and (5) indicate that the spatial attention mechanism and the channel attention mechanism are combined in series.

3. The method for improving the automatic recognition of verification codes of RPA robots according to claim 2 is characterized in that: The specific operation of adding the self-attention layer in YOLOv8 is as follows: the self-attention layer is added after the fast spatial pyramid pooling layer SPPF layer in Backone of the YOLOv8 model, the self-attention layer receives the feature map output by the SPPF layer, and adjusts and optimizes the features by learning the importance of each position in the feature map.

4. The method for improving the automatic recognition of verification codes of RPA robots according to claim 3 is characterized in that: In step 3, the initial sliding verification code recognition model is encapsulated into a plug-in and provided to users. The initial sliding verification code recognition model is integrated into the RPA platform and exposed in the form of a Restful interface. The sliding verification code image is input into this interface and the sliding distance is returned.

5. The method for improving the automatic recognition of verification codes of RPA robots according to any one of claims 1 to 4, characterized in that: In steps 4 and 5, the results returned by the sliding verification code recognition model obtain the coordinates of the center point of the gap and the relative width and height of the rectangular frame, and the sliding distance is calculated. If the RPA successfully passes the sliding verification code recognition, the result returned by the model and the verification code background image, i.e., the data pair in step 5, are used as the subsequent incremental training data set.

Citation Information

Cited By

  • RPA verification code interaction method and system based on asynchronous man-machine cooperation

    CN121167704A