Certificate detection method and device, computer readable storage medium, electronic equipment and computer program product

By determining the preset collection perspective and using the video classification model to process the image sequence of the document in the certificate detection, the problem of unclear certificates in the existing technology in the existing technology improves the accuracy and user experience of the certificate detection.

CN119359979APending Publication Date: 2025-01-24ANT BLOCKCHAIN TECHNOLOGY (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411391139.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

Under the influence of image acquisition environment and equipment parameters, existing certificate detection technology leads to excessive exposure or blurring of document images, which in turn affects the accuracy and user experience of document detection.

Method used

By obtaining the user's target document detection request, determine the preset collection perspective (including the front perspective and the non -positive perspective), and use the image collection based on these perspectives to generate the target certificate image sequence. Then, the video classification model is used to process the image sequence to generate test results to reflect whether the certificate has a counterfeit risk.

Benefits of technology

It improved the accuracy and reliability of the test results, reducing misjudgment caused by unclear image or inappropriate collection perspectives, improved the pass rate of user documents, and ensured the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119359979A_ABST
    Figure CN119359979A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a certificate detection method and device, a computer readable storage medium, electronic equipment and a computer program product. The certificate detection method comprises the steps that when a detection request for a target certificate of a user is responded, the certificate is detected; a target certificate image sequence obtained by carrying out image acquisition on a target certificate according to a preset acquisition view angle comprising a front view angle and a non-front view angle can be obtained, so that the target certificate image sequence is processed by utilizing a video classification model; the detection result is used for reflecting whether the target certificate has the counterfeiting risk or not.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of document detection, and in particular to a document detection method, device, computer-readable storage medium, electronic device and computer program product. Background Art

[0002] With the continuous development of image processing technology, service providers have gradually begun to analyze and process the document images of target documents submitted by users to identify whether the target documents used by users to obtain services through Internet technology have the risk of counterfeiting, thereby protecting the rights and interests of all parties. However, due to factors such as the image acquisition environment and image acquisition equipment parameters, the captured document images may be overexposed, blurred, and other problems, making it impossible for service providers to accurately identify whether the user's target document has the risk of counterfeiting, which in turn causes the user to fail the document detection, affecting the user experience. Summary of the invention

[0003] The embodiments of this specification provide a document detection method, device, computer-readable storage medium, electronic device and computer program product, which can improve the accuracy and reliability of document detection results on the one hand, and alleviate the problem of low user document detection pass rate to a certain extent on the other hand, so as to ensure user experience.

[0004] An embodiment of this specification provides a document detection method, the method comprising:

[0005] Obtain a detection request for the target certificate of the user;

[0006] In response to the detection request, determining a preset capture angle of view required to be used when capturing an image of the target document; the preset capture angle of view includes: a frontal angle of view and a non-frontal angle of view;

[0007] Acquire a target document image sequence obtained by performing image acquisition on the target document according to the preset acquisition angle;

[0008] The target document image sequence is processed using a video classification model to obtain a detection result reflecting whether the target document has a risk of counterfeiting.

[0009] The embodiment of this specification also provides a document detection device, including:

[0010] A first acquisition module, used to acquire a detection request for a target certificate of a user;

[0011] A capture angle determination module, configured to determine, in response to the detection request, a preset capture angle required to be used when capturing an image of the target document; the preset capture angle includes: a frontal angle and a non-frontal angle;

[0012] A second acquisition module is used to acquire a target document image sequence obtained by acquiring images of the target document according to the preset acquisition angle;

[0013] The detection module is used to process the target certificate image sequence using a video classification model to obtain a detection result reflecting whether the target certificate has a risk of counterfeiting.

[0014] The embodiments of the present specification also provide a computer program product, on which at least one instruction is stored, and when the at least one instruction is executed by a processor, the steps of the above method are implemented.

[0015] The embodiments of this specification also provide a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the above method are implemented.

[0016] The embodiment of the present specification also provides an electronic device, including: a processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the steps of the above method.

[0017] In an embodiment of the present specification, when detecting a target certificate of a user, a target certificate image sequence obtained by capturing images of the target certificate according to a preset capture angle can be obtained. Since the preset capture angle can include: a frontal angle and a non-frontal angle, on the one hand, it can increase the possibility of capturing a clear certificate image and reduce the interference of factors such as the image capture environment or image capture device parameters. On the other hand, it can also better stimulate the anti-counterfeiting features of the target certificate so that the target certificate image sequence can carry more key certificate information, thereby improving the accuracy and reliability of the detection results generated by the video classification model based on the target certificate image sequence to reflect whether the target certificate has a risk of counterfeiting, and reducing the problem of misjudgment of user certificate detection failure due to unclear images or failure to capture the certificate anti-counterfeiting features due to inappropriate capture angles, which is beneficial to improving the pass rate of user certificate detection and ensuring user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 A schematic diagram of an application scenario of a certificate detection solution provided in an embodiment of this specification;

[0019] Figure 2 A flowchart of a document detection method provided in an embodiment of this specification;

[0020] Figure 3 A front view of a terminal device provided in an embodiment of this specification;

[0021] Figure 4 A schematic diagram of an application interface of a terminal device provided in an embodiment of this specification;

[0022] Figure 5 A schematic diagram of the structure of a certificate detection device provided in an embodiment of this specification;

[0023] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of this specification. DETAILED DESCRIPTION

[0024] In order to make the purpose, technical solutions and advantages of this specification more clear, the technical solutions of this specification will be clearly and completely described below in combination with the specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of them. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this specification.

[0025] Before specifically describing the document detection solution provided in the embodiments of this specification, the relevant technical background is first described.

[0026] At present, when service providers use Internet technology to provide services to users, online identity verification for users is crucial for the safe development of digital services. At present, users can usually use terminal devices to scan or take pictures of target certificates from a frontal perspective, and service providers can perform quality compliance and anti-counterfeiting tests on the collected certificate images of target certificates to generate test results that reflect whether the target certificates used by users to obtain services have a risk of counterfeiting.

[0027] However, due to the relatively simple requirements for current image acquisition, it is easy for the captured target ID image to be overexposed or blurred, which may cause the service provider to determine that the user's ID has failed the inspection. In addition, since some IDs do not show the anti-counterfeiting mark they carry when viewed from the front, it is necessary to change the acquisition angle of the ID to capture the ID image containing the anti-counterfeiting mark, which may also easily cause the service provider to mistakenly determine that the user's ID has failed the inspection.

[0028] Therefore, how to improve the pass rate of user ID detection and ensure user experience while ensuring the accuracy and reliability of ID detection results has become an urgent problem to be solved.

[0029] See also Figure 1, which is a schematic diagram of an application scenario of a certificate detection solution provided in an embodiment of this specification.

[0030] like Figure 1 As shown, when the user uses the terminal device 101 to obtain services, a detection request for the user's target certificate 102 can be generated; after determining the preset acquisition angle required for image acquisition of the target certificate 102, the terminal device 101 can be used to acquire images of the target certificate 102 according to the preset acquisition angle to obtain a target certificate image sequence; wherein the preset acquisition angle may include: a frontal angle and a non-frontal angle. If a video classification model is deployed at the terminal device 101, the video classification model can be used to process the target certificate image sequence, thereby obtaining a detection result reflecting whether the target certificate 102 has a risk of counterfeiting. If the video classification model is deployed at the server device 103, the terminal device 101 can communicate with the server device 103, thereby using the video classification model at the server device 103 to process the target certificate image sequence, thereby obtaining a detection result reflecting whether the target certificate 102 has a risk of counterfeiting.

[0031] See also Figure 2 , is a flowchart of a document detection method provided in an embodiment of this specification. The execution subject of the process can be a document detection device, or an application installed on the document detection device. Figure 2 The process shown is described in detail, and the document detection method may specifically include the following steps:

[0032] Step 202: Obtain a detection request for the user's target certificate.

[0033] In the embodiments of this specification, the detection request can be a request for verification of a target certificate of a preset type for the user generated by a terminal device when the user uses the terminal device to obtain services, or it can be a request for verification of a target certificate of a preset type for the user generated by a device at a service provider that provides services to the user, and there is no specific limitation on this.

[0034] In actual applications, the preset type of the target certificate requested for verification in the detection request can be set according to actual needs. For example, it can include but is not limited to: a certificate used to reflect the user's identity, a certificate used to reflect the user's academic qualifications, a certificate used to reflect the user's professional qualifications, a certificate used to reflect the user's assets, etc., without specific limitation.

[0035] Step 204, in response to the detection request, determining a preset capture angle of view required for image capture of the target document; the preset capture angle of view includes: a frontal angle of view and a non-frontal angle of view.

[0036] In the embodiments of this specification, in order to prevent users from cheating by injecting a sequence of ID images during the ID detection process, the preset acquisition angle of view required for users to collect images of the target ID can be randomly determined. Also, since the ID image collected at the frontal angle has the least distortion, the accuracy of the ID information it carries is also good, so the preset acquisition angle of view can include the frontal angle of view; in addition, since the anti-counterfeiting marks of some IDs need to be presented at a non-frontal angle of view, and the use of different angles to collect ID images is also conducive to reducing the problem of overexposure or blurring of all collected images, so as to improve the ID detection pass rate. Based on this, the preset acquisition angle of view can also include a non-frontal angle of view.

[0037] The frontal perspective may refer to a perspective in which the target document and the image acquisition device are roughly parallel, so that the frontal view of the target document can be acquired. The document image of the target document acquired according to the frontal perspective is usually closest to the original appearance of the target document in terms of visual perception, and has a smaller degree of deformation. The types of non-frontal perspectives may include at least one of an inclined upward perspective, an inclined downward perspective, an inclined left perspective, and an inclined right perspective.

[0038] For ease of understanding, combined Figure 3 Provide explanation. Figure 3 A front view of a terminal device provided in an embodiment of this specification, assuming that a camera (not shown) is provided at the back of the terminal device, when the user holds the terminal device to collect the document image of the target document, assuming that the front of the target document is parallel to the ground, when the terminal device is located directly above the target document and the vertical center axis 301 of the terminal device is roughly parallel to the ground, it can be a front view. Afterwards, if the terminal device rotates counterclockwise within 90 degrees around the horizontal center axis 302, it can be an inclined upward view; if the terminal device rotates clockwise within 90 degrees around the horizontal center axis 302, it can be an inclined downward view; if the terminal device rotates clockwise within 90 degrees around the vertical center axis 301, it can be an inclined right view; if the terminal device rotates counterclockwise within 90 degrees around the vertical center axis 301, it can be an inclined left view. It is understandable that the front of the target document may also present other angles or postures relative to the ground. At this time, when the terminal device collects the document image of the target document from the front perspective, the angle and posture relative to the ground may usually be different, which will not be elaborated.

[0039] In actual applications, when there are multiple types of non-frontal viewing angles, the user can be required to capture the image of the target document according to a single non-frontal viewing angle at the same time, or can be required to capture the image of the target document according to a viewing angle generated by combining multiple non-frontal viewing angles at the same time. For example, the non-frontal viewing angle can represent: the viewing angle corresponding to an upward tilt of 30 degrees and a left tilt of 15 degrees, or the viewing angle corresponding to a downward tilt of 20 degrees and a right tilt of 25 degrees. It has good flexibility and is not specifically limited.

[0040] Step 206: Acquire a target document image sequence obtained by performing image acquisition on the target document according to the preset acquisition angle.

[0041] In the embodiments of the present specification, the preset acquisition angles can be sorted in advance, so that the document images of the target documents under the preset acquisition angles are sequentially acquired according to the preset order of the preset acquisition angles, and the document images are sorted according to the image acquisition order, so as to obtain a target document image sequence. That is, the order of the document images in the target document image sequence is consistent with the preset order of the corresponding preset acquisition angles. Of course, the document images of the multiple target documents collected can also be sorted according to other methods or strategies to obtain a target document image sequence, which is not specifically limited.

[0042] In practical applications, in order to improve the convenience of user operation, when the non-frontal perspective in the preset acquisition perspective includes the same type of perspectives at different angle values, for example, when the non-frontal perspective in the preset acquisition perspective includes: tilted upward 15 degrees, tilted upward 30 degrees, and tilted upward 45 degrees, or when the non-frontal perspective in the preset acquisition perspective includes: tilted upward 5 degrees to the left, tilted upward 15 degrees, and tilted upward 20 degrees, the document images of the target documents at the above three perspectives can be collected in order from small to large angle values, or from large to small angle values. Of course, in order to prevent video injection attacks, the document images of the target documents at the above three perspectives can also be collected in a random manner, and no specific restrictions are made to this. It can be understood that when the non-frontal perspective in the preset acquisition perspective includes the same type of perspectives at different angle values, the angle values ​​corresponding to each non-frontal perspective can be set according to actual needs, and the angle differences between different non-frontal perspectives can be the same or different, and no specific restrictions are made to this.

[0043] Step 208: Process the target document image sequence using a video classification model to obtain a detection result reflecting whether the target document has a risk of counterfeiting.

[0044] In the embodiments of this specification, the video classification model may refer to a neural network model capable of classifying image sequences. By setting label data indicating whether the corresponding ID sample has a risk of counterfeiting for the ID image sequence sample, and using the ID image sequence sample to train the video classification model, the video classification model can be made capable of identifying whether the user's target ID has a risk of counterfeiting based on the target ID image sequence, so that the video classification model can be used to process the target ID image sequence to obtain a detection result that reflects whether the target ID has a risk of counterfeiting, which is conducive to improving the accuracy, reliability and operating efficiency of the ID detection process.

[0045] In practical applications, when the test result reflects that the target certificate has a risk of counterfeiting, it can be determined that the user's certificate fails the test. Alternatively, when the probability that the target certificate reflects that the test result has a risk of counterfeiting is greater than a preset threshold, it can be determined that the user's certificate fails the test. Of course, other strategies can also be used to decide whether to allow the user to pass the certificate test based on the test result, and this is not specifically limited.

[0046] In the embodiments of this specification, the video vision self-attention model (Video Vision Transformer, ViViT) is a video processing model based on Transformer, which can capture the spatiotemporal dependencies in the video by utilizing the self-attention mechanism of Transformer, so that the ViViT model performs well in video processing tasks, especially in tasks such as video classification and target detection. Therefore, the video classification model may include the video vision self-attention model.

[0047] Based on this, step 208: using the video classification model to process the target document image sequence to obtain a detection result reflecting whether the target document has a counterfeit risk may include:

[0048] The video visual self-attention model is used to classify the target document image sequence to obtain a detection result reflecting whether the target document has a risk of counterfeiting.

[0049] Among them, the video visual self-attention model is a model obtained by pre-training using document image sequence samples carrying label data reflecting whether the document samples have a risk of counterfeiting; the document image sequence samples are training samples generated based on the image sequence obtained by capturing images of the document samples according to the preset acquisition perspective.

[0050] In practical applications, there may be multiple types of video classification models. In addition to the video visual self-attention model, it may also include other neural network models that can perform video classification tasks, and there is no specific limitation on this.

[0051] Figure 2 According to the method, when detecting the target certificate of the user, a target certificate image sequence obtained by capturing the image of the target certificate according to a preset capturing angle can be obtained. Since the preset capturing angle can include: a frontal angle and a non-frontal angle, on the one hand, the possibility of capturing a clear certificate image can be increased, and the interference of factors such as the image capturing environment or the parameters of the image capturing device can be reduced. On the other hand, the anti-counterfeiting features of the target certificate can be better stimulated, so that the target certificate image sequence can carry more key certificate information, thereby improving the accuracy and reliability of the detection result generated by the video classification model for the target certificate image sequence, which reflects whether the target certificate has a counterfeit risk, and reducing the problem of misjudgment of user certificate detection failure due to unclear images or failure to capture the certificate anti-counterfeiting features due to inappropriate capturing angles, which is conducive to improving the pass rate of user certificate detection and ensuring user experience.

[0052] based on Figure 2 The method in this specification also provides some specific implementation plans of the method, which are described below.

[0053] In a feasible implementation manner, step 204, in response to the detection request, determining a preset capture angle required to be used when capturing an image of the target document, may include:

[0054] Obtain at least one of the number of times the target certificate of the user fails the detection within a preset time period and the relevant user data of the user.

[0055] Determine the risk level of the user according to at least one of the number of detections and the relevant user data.

[0056] According to the risk level of the user, the types of preset acquisition viewing angles to be used when acquiring images of the target document and the viewing angle ranges of the preset acquisition viewing angles of each type are determined.

[0057] In the embodiments of the present specification, in order to prevent users from cheating by using pre-forged ID image sequences during the ID detection process, different preset acquisition angles can be set for each ID detection task of different users, so that the preset acquisition angles can have a certain degree of randomness, thereby making the acquisition angle corresponding to the ID image in the ID image sequence pre-forged by the user mismatch with the preset acquisition angle determined by the current ID detection task, so as to determine that the user's ID detection has failed, which is beneficial to improving the security and reliability of the ID detection solution.

[0058] Specifically, since the purpose of document detection is to ensure the security of business operations, users with higher risk levels are generally more likely to bring risks when handling business, while users with lower risk levels are generally less likely to bring risks when handling business, therefore, the type of preset acquisition perspective required for image capture of the target document and the viewing angle range of each type of preset acquisition perspective can be determined based on the user's risk level, and the security and reliability of the document detection process can be improved by controlling the number of document images captured and the difficulty of capture.

[0059] In actual applications, when a user fails the target certificate detection multiple times in the recent period, the possibility that the user is risky is usually high. Therefore, the number of times the user fails the target certificate detection within a preset time period can be positively correlated with the user's risk level, which is convenient and quick. Alternatively, when a user fails the target certificate detection multiple times in the recent period, it may also indicate that the user has difficulty in performing the operation of collecting the certificate image of the target certificate. In order to improve the user experience and improve the identity verification pass rate, the number of times the user fails the target certificate detection within a preset time period can also be negatively correlated with the user's risk level, which is flexible. No specific restrictions are made on this.

[0060] Alternatively, when the service provider also has relevant user data of the user, the user's risk level can also be determined by analyzing the relevant user data of the user. The relevant user data may include, but is not limited to: basic user data of the user, user operation behavior data, historical business data of the business handled by the user, etc., which are not specifically limited. Comprehensive analysis of the relevant user data of the user is conducive to improving the accuracy and reliability of the determined user's risk level.

[0061] Optionally, the risk level of the user is positively correlated with the type of the preset acquisition angle, and the risk level of the user is negatively correlated with the viewing angle range of at least some types of the preset acquisition angle.

[0062] The risk level of the user is negatively correlated with the type of the preset acquisition angle, and the risk level of the user is positively correlated with the viewing angle range of at least some types of the preset acquisition angle.

[0063] The risk level of the user is positively correlated with the type of the preset acquisition angle, and the risk level of the user is positively correlated with the viewing angle range of at least some types of the preset acquisition angle.

[0064] The risk level of the user is negatively correlated with the type of the preset acquisition viewing angle, and the risk level of the user is negatively correlated with the viewing angle range of at least some types of the preset acquisition viewing angle.

[0065] In the embodiments of the present specification, the preset acquisition viewing angles may include: a frontal viewing angle, and a tilted upward viewing angle, a tilted downward viewing angle, a tilted left viewing angle, a tilted right viewing angle and the viewing angles obtained by combining them. When the user's risk level is higher, the number of types of the preset acquisition viewing angles can be more or less; and the viewing angle range of each of the preset acquisition viewing angles can be wider or narrower, and there is no specific limitation on this.

[0066] In practical applications, the document images of the target document collected by the user at various specific angles within the range of the preset acquisition angle can be considered as the document images obtained by performing image acquisition on the target document according to the preset acquisition angle. Therefore, when the span of the range of the preset acquisition angle is large, the requirements for the accuracy of user operations are usually low, so as to reduce the difficulty of user operations; and when the span of the range of the preset acquisition angle is small, the requirements for the accuracy of user operations will be appropriately increased. For example, when the preset acquisition angle is tilted 30 degrees to the left, its viewing angle range can be tilted 25 degrees to 35 degrees to the left, with a large span; when the preset acquisition angle is tilted upward 35 degrees, its viewing angle range can be tilted upward 33 degrees to 37 degrees, with a small span, etc.; no specific limitation is made to this.

[0067] In a feasible implementation manner, before step 204, determining the preset capture angle required to be used when capturing the image of the target document, may also include:

[0068] In response to the detection request, it is determined whether the detection of the first document image of the target document captured according to the frontal viewing angle fails, and a determination result is obtained.

[0069] Correspondingly, the determining of the preset acquisition angle required to be used when acquiring the image of the target document may include:

[0070] If the judgment result indicates that the first document image detection of the target document captured according to the frontal viewing angle fails, a preset capturing viewing angle required to be used when capturing the image of the target document is determined.

[0071] If the judgment result indicates that the first document image of the target document captured according to the frontal perspective has passed the detection, it is prohibited to determine the preset capture perspective required to be used when capturing the image of the target document, and, based on the first document image, generate a detection result reflecting whether the target document has a risk of counterfeiting.

[0072] In the embodiment of the present specification, after obtaining a detection request for a target certificate of a user, a first certificate image of the target certificate captured from a frontal perspective may be obtained first, and the first certificate image may be detected and processed using an existing certificate detection method. If it is determined that the first certificate image detection fails, the first certificate image may be detected and processed according to the method described above. Figure 2 The document detection method shown continues to collect documents, which is beneficial to improving the user's document detection pass rate.

[0073] In actual applications, there may be many reasons for failing the user's ID card detection based on the first ID card image, which can be set according to actual needs; for example, when the clarity of the first ID card image is identified to be less than a threshold, when the first ID card image is incomplete, when the first ID card image has an overexposure problem, when it is determined based on the first ID card image that the target ID card has a risk of counterfeiting, it can be determined that the user has failed the ID card detection, and no specific limitation is made to this.

[0074] In actual applications, although the user's ID card detection is determined to be unsuccessful based on the first ID card image, in order to simplify user operations, the first ID card image can also be used as the image captured for the target ID card in the target ID card image sequence according to the frontal perspective; of course, the user can also re-capture the target ID card according to the frontal perspective as the image required for the target ID card image sequence, and there is no specific limitation on this.

[0075] In a feasible implementation manner, step 206, obtaining a target document image sequence obtained by performing image acquisition on the target document according to the preset acquisition angle, may include:

[0076] The initial document image sequence collected for the target document according to the preset collection angle is determined as the target document image sequence.

[0077] An initial document image sequence captured for the target document according to the preset capture angle of view is obtained.

[0078] Image correction processing is performed on at least a portion of the second document image captured according to the non-frontal viewing angle in the initial document image sequence to obtain a third document image.

[0079] A difference image between the third document image and a fourth document image in the initial document image sequence acquired according to the frontal viewing angle is determined.

[0080] The target document image sequence is generated according to the initial document image sequence and the difference image.

[0081] In the embodiments of the present specification, the initial document image sequence acquired for the target document according to the preset acquisition viewing angle can be directly used as the target document image sequence, which is convenient and quick.

[0082] In actual applications, when users forge or cheat during the document detection process, they may use artificial intelligence AIGC (Artificial Intelligence Generated Content), image processing software, or stretching and rotating images to generate false document images under various preset acquisition angles. After the document images corresponding to different preset acquisition angles are corrected, they often have a high degree of consistency. After the real document images actually collected under different preset acquisition angles are corrected, their consistency will be slightly lower due to problems such as lighting and shooting angles. Based on this phenomenon, image correction can be performed on the second document image collected from a non-frontal perspective in the initial document image sequence to obtain a third document image, and then a difference image between the third document image and the fourth document image collected from a frontal perspective in the initial document image sequence is generated. By combining the difference image with the initial document image sequence to generate a target document image sequence, it is beneficial to improve the accuracy and reliability of the document detection results generated based on the target document image sequence.

[0083] In a feasible implementation manner, step 206, obtaining a target document image sequence obtained by performing image acquisition on the target document according to the preset acquisition angle, may also include:

[0084] The image clarity of each document image in the initial document image sequence is determined.

[0085] Deleting the document images in the initial document image sequence whose image clarity is less than a preset threshold. Or,

[0086] Delete the document image pairs to which the document images whose image clarity is less than a preset threshold value belong in the initial document image sequence; wherein one of the document image pairs includes an image captured according to the same preset capture angle of view for the target document under the illumination of a flash device, and an image captured for the target document not illuminated by the flash device.

[0087] In the embodiments of the present specification, since the user may still capture document images with poor clarity when capturing images of the target document according to the preset capture angle, which may easily affect the accuracy of the document detection results, based on this, when there are many specific types of data of the preset capture angle, images with poor clarity in the initial document image sequence captured for the target document can also be eliminated to ensure that the images in the generated target document image sequence have better clarity.

[0088] In practical applications, when performing image acquisition for a target document according to a preset acquisition angle, only one document image may be acquired for each preset acquisition angle, or, in order to improve the accuracy of the document detection result, one document image may be acquired for each preset acquisition angle under different conditions such as when the flash device is irradiated or not irradiated. In this case, the initial document image sequence may include each document image pair acquired under each preset acquisition angle. When eliminating document images with poor clarity, only the image with poor clarity in each document image pair may be eliminated, or, when the document image pair includes an image with poor clarity, the document image pair may be directly removed to ensure the integrity of the document image pair, and no specific limitation is made to this.

[0089] In a feasible implementation, Figure 2 The method described can be applied to a server device.

[0090] Step 206: acquiring a target document image sequence obtained by performing image acquisition on the target document according to the preset acquisition angle, which may include:

[0091] The target document image sequence is determined based on the image sequence captured by the user's terminal device according to the preset capture angle for the target document.

[0092] Correspondingly, step 208: using the video classification model to process the target certificate image sequence to obtain a detection result reflecting whether the target certificate has a counterfeit risk may include:

[0093] The target certificate image sequence is input into the video classification model installed at the server device to obtain a detection result output by the video classification model to reflect whether the target certificate has a risk of counterfeiting.

[0094] In the embodiments of this specification, the server device can interact with the user's terminal device to transmit the document image of the user's target document, so that the server device can use the video classification model it carries to generate a detection result reflecting whether the target document has a risk of forgery, which has good flexibility.

[0095] In practical applications, it may be necessary to remove document images with poor clarity and / or generate a difference image between the document image captured from the non-frontal perspective and the document image captured from the frontal perspective after correction to obtain a target document image sequence. Therefore, the server device can obtain the initial document image sequence from the user's terminal device and perform the above operations to generate the target document image sequence, or the user's terminal device can perform the above operations on the initial document image sequence to generate the target document image sequence, so that the server device can directly obtain the target document image sequence from the terminal device, which is convenient and quick, and no specific limitation is made.

[0096] In a feasible implementation, Figure 2 The method described can be applied to the terminal equipment of the user.

[0097] Step 206: acquiring a target document image sequence obtained by performing image acquisition on the target document according to the preset acquisition angle, which may include:

[0098] The terminal device is used to perform image acquisition on the target document according to the preset acquisition viewing angle to obtain the target document image sequence.

[0099] Correspondingly, step 208: using the video classification model to process the target certificate image sequence to obtain a detection result reflecting whether the target certificate has a counterfeit risk may include:

[0100] Input the target certificate image sequence into the video classification model installed at the terminal device to obtain the detection result output by the video classification model to reflect whether the target certificate has a risk of counterfeiting. Or,

[0101] The target certificate image sequence is sent to a server device; the server device is used to input the target certificate image sequence into a video classification model to obtain a detection result output by the video classification model to reflect whether the target certificate has a risk of counterfeiting.

[0102] In the embodiments of this specification, the user's terminal device can also be used to collect the document image of the target document by itself, and use the video classification model carried by it to generate a detection result that reflects whether the target document has a risk of forgery. This is not only beneficial to improving the efficiency of document detection, but also beneficial to avoiding the leakage of user privacy data.

[0103] Alternatively, after obtaining the user's authorization to use and transmit the document image, the user's terminal device can send the document image of the target document collected by it to the server device, so as to use the video classification model at the server device to generate a detection result reflecting whether the target document has a risk of counterfeiting. Since there is no need to deploy the video classification model at the user's terminal device, it is beneficial to save storage resources and computing resources at the terminal device, and it can also reduce the risk of users counterfeiting and cheating by attacking the video classification model, and it is also beneficial to ensure the credibility of the document detection results.

[0104] In practical applications, when Figure 2 When the method is applied to the user's terminal device, the terminal device can either execute step 204 by itself to determine the preset acquisition angle, or the terminal device can obtain the preset acquisition angle required to be determined in step 204 from the server device, and there is no specific limitation on this.

[0105] In a feasible implementation manner, before using the terminal device to capture the image of the target document according to the preset capture angle, the following steps may also be included:

[0106] For at least some of the preset acquisition angles, an ID card image acquisition frame matching any of the preset acquisition angles is displayed at the terminal device; wherein the shape of the ID card image acquisition frame is consistent with the shape that the target ID card needs to present at the terminal device when the ID card image is acquired according to any of the preset acquisition angles.

[0107] In the embodiments of this specification, in order to improve the convenience of operation when the user performs image acquisition according to the preset acquisition angle, a document image acquisition frame matching the preset acquisition angle of the image to be acquired can be displayed on the user's terminal device. The document image acquisition frame can be the shape and size that the target document needs to present at the terminal device when the image of the target document that meets the requirements is acquired according to the preset acquisition angle, which is obtained by pre-analysis. In this way, the document image acquisition frame is used to assist and guide the user to acquire the document image that meets the requirements.

[0108] Figure 4A schematic diagram of an application interface of a terminal device provided in an embodiment of this specification, as shown in the figure, when a user uses a terminal device to detect a document, a document image acquisition frame 402 matching a preset acquisition angle (for example, tilted 30 degrees to the left) can be displayed in the application interface 401 of the terminal device to improve the convenience of user operation. It can be understood that the shapes of the document image acquisition frames matching different preset acquisition angles displayed in the application interface of the terminal device can usually be different to meet the actual situation, and no specific limitation is made to this.

[0109] In a feasible implementation manner, after displaying the document image acquisition frame matching any of the preset acquisition viewing angles at the terminal device, the method may further include:

[0110] Determine a target acquisition angle of view corresponding to the current document image acquired by the terminal device for the target document.

[0111] Displaying first prompt information reflecting the target acquisition viewing angle at the terminal device. And / or,

[0112] Determine the perspective difference information between the preset capture perspective corresponding to the document image capture frame displayed at the terminal device and the target capture perspective.

[0113] At least one of second prompt information reflecting the viewing angle difference information and third prompt information guiding the user to reduce the viewing angle difference reflected by the viewing angle difference information is displayed at the terminal device.

[0114] In the embodiments of the present specification, in order to facilitate the user to know the preset capture angle of view required for the current capture of the document image, or to assist the user to adjust the position, angle, etc. of the terminal device or the document so that the terminal device can capture the document image of the target document according to the preset capture angle of view, at least one of the following can be displayed in the application interface of the terminal device: first prompt information reflecting the current target capture angle of view of the terminal device, second prompt information reflecting the perspective difference information between the preset capture angle of view currently required and the current actual target capture angle of view, and third prompt information guiding the user to reduce the perspective difference reflected by the perspective difference information.

[0115] In practical applications, the specific contents of the first prompt information, the second prompt information, and the third prompt information can be set according to actual needs, and no specific limitation is made to this. For ease of understanding, an example is given to illustrate this. Figure 4 As shown, Figure 4 The prompt information 403 shown in the figure can be used as the first prompt information, the second prompt information or the third prompt information. The prompt information 404 can be used as the second prompt information or the third prompt information.

[0116] In a feasible implementation manner, determining the target acquisition angle corresponding to when the terminal device acquires the current document image for the target document may include:

[0117] The current document image is processed using an image acquisition perspective recognition model to obtain the target acquisition perspective. Or,

[0118] Based on the perspective transformation algorithm, the target acquisition angle corresponding to the acquisition of the current document image is determined. Or,

[0119] The target acquisition viewing angle is determined according to the device posture information collected by the preset sensor at the terminal device.

[0120] In an embodiment of the present specification, the image acquisition perspective recognition model can be obtained by training a neural network model using an ID card image that uses the actual acquisition perspective as label data, so that after the current ID card image is input into the image acquisition perspective recognition model, the target acquisition perspective corresponding to the current ID card image output by the image acquisition perspective recognition model can be obtained, that is, the current acquisition perspective of the terminal device for the target ID card, with good accuracy.

[0121] In the embodiments of this specification, the perspective transformation algorithm is a technology used to perform geometric transformation on an image in image processing, which can be used to correct the perspective deformation of an image or change the viewing angle of an image. Based on this, the perspective transformation algorithm can be used to analyze the current document image to determine the target acquisition viewing angle corresponding to the current document image, which is convenient and quick.

[0122] In the embodiment of this specification, when the user uses the terminal device to collect the document image of the target document, the user can keep the position of the terminal device unchanged, and adjust the position of the target document to adjust the terminal device's collection angle of view for the target document. Alternatively, the position of the target document can be kept unchanged, and the terminal device can be adjusted to adjust the terminal device's collection angle of view for the target document. At this time, the target collection angle corresponding to the current document image can also be determined based on the device posture information collected by the preset sensor at the terminal device, which has good flexibility.

[0123] Based on the same idea, the embodiments of this specification also provide a device corresponding to the above method. Figure 5 , is a schematic diagram of the structure of a document detection device provided in an embodiment of this specification. Figure 5As shown, the document detection device 5 can be implemented as all or part of the electronic device through software, hardware or a combination of both. According to some embodiments, the document detection device 5 may include a first acquisition module 51, a collection angle determination module 52, a second acquisition module 53, and a detection module 54, wherein:

[0124] The first acquisition module 51 is used to acquire a detection request for a target certificate of a user.

[0125] The acquisition viewing angle determination module 52 is used to determine the preset acquisition viewing angle required for image acquisition of the target document in response to the detection request; the preset acquisition viewing angle includes: a frontal viewing angle and a non-frontal viewing angle.

[0126] The second acquisition module 53 is used to acquire a target document image sequence obtained by performing image acquisition on the target document according to the preset acquisition angle.

[0127] The detection module 54 is used to process the target document image sequence using a video classification model to obtain a detection result reflecting whether the target document has a risk of counterfeiting.

[0128] Optionally, the acquisition viewing angle determination module 52 may be specifically used for:

[0129] Obtain at least one of the number of times the target certificate of the user fails the detection within a preset time period and the relevant user data of the user.

[0130] Determine the risk level of the user according to at least one of the number of detections and the relevant user data.

[0131] According to the risk level of the user, the types of preset acquisition viewing angles to be used when acquiring images of the target document and the viewing angle ranges of the preset acquisition viewing angles of each type are determined.

[0132] Optionally, the risk level of the user may be positively correlated with the type of the preset acquisition angle, and the risk level of the user may be negatively correlated with the viewing angle range of at least some types of the preset acquisition angle.

[0133] The risk level of the user may be negatively correlated with the type of the preset acquisition angle, and the risk level of the user may be positively correlated with the viewing angle range of at least some types of the preset acquisition angle.

[0134] The risk level of the user may be positively correlated with the type of the preset acquisition angle, and the risk level of the user may be positively correlated with the viewing angle range of at least some types of the preset acquisition angle.

[0135] The risk level of the user may be negatively correlated with the type of the preset acquisition viewing angle, and the risk level of the user may be negatively correlated with the viewing angle range of at least some types of the preset acquisition viewing angle.

[0136] Optionally, the type of the non-frontal perspective in the preset acquisition perspective may include: at least one of an inclined upward perspective, an inclined downward perspective, an inclined left perspective and an inclined right perspective.

[0137] Optional, Figure 5 The device may further include:

[0138] A judgment module, configured to judge, in response to the detection request, whether the first document image of the target document captured from a frontal perspective fails the detection, and obtain a judgment result;

[0139] The acquisition viewing angle determination module 52 can be specifically used for:

[0140] If the judgment result indicates that the first document image detection of the target document captured according to the frontal viewing angle fails, a preset capturing viewing angle required to be used when capturing the image of the target document is determined.

[0141] Optionally, the second acquisition module 53 may be specifically used for:

[0142] An initial document image sequence captured for the target document according to the preset capture angle of view is obtained.

[0143] Image correction processing is performed on at least a portion of the second document image captured according to the non-frontal viewing angle in the initial document image sequence to obtain a third document image.

[0144] A difference image between the third document image and a fourth document image in the initial document image sequence acquired according to the frontal viewing angle is determined.

[0145] The target document image sequence is generated according to the initial document image sequence and the difference image.

[0146] Optionally, the second acquisition module 53 may be specifically used for:

[0147] An initial document image sequence acquired for the target document according to the preset acquisition viewing angle is determined as the target document image sequence.

[0148] Optionally, the second acquisition module 53 may be specifically used for:

[0149] The image clarity of each document image in the initial document image sequence is determined.

[0150] Deleting the document images in the initial document image sequence whose image clarity is less than a preset threshold. Or,

[0151] Delete the document image pairs to which the document images whose image clarity is less than a preset threshold value belong in the initial document image sequence; wherein one of the document image pairs includes an image captured according to the same preset capture angle of view for the target document under the illumination of a flash device, and an image captured for the target document not illuminated by the flash device.

[0152] Optionally, the apparatus may be applied to a server device.

[0153] The second acquisition module 53 may be specifically used for:

[0154] The target document image sequence is determined based on the image sequence captured by the user's terminal device according to the preset capture angle for the target document.

[0155] The detection module 54 may be specifically used for:

[0156] The target certificate image sequence is input into the video classification model installed at the server device to obtain a detection result output by the video classification model to reflect whether the target certificate has a risk of counterfeiting.

[0157] Optionally, the apparatus may be applied to a terminal device of the user.

[0158] The second acquisition module 53 may be specifically used for:

[0159] The terminal device is used to perform image acquisition on the target document according to the preset acquisition viewing angle to obtain the target document image sequence.

[0160] The detection module 54 may be specifically used for:

[0161] Input the target certificate image sequence into the video classification model installed at the terminal device to obtain the detection result output by the video classification model to reflect whether the target certificate has a risk of counterfeiting. Or,

[0162] The target certificate image sequence is sent to a server device; the server device is used to input the target certificate image sequence into a video classification model to obtain a detection result output by the video classification model to reflect whether the target certificate has a risk of counterfeiting.

[0163] Optional, Figure 5 The device described in may also include:

[0164] The first display module is used to display, at the terminal device, a document image acquisition frame that matches any of the preset acquisition angles for at least some of the preset acquisition angles; wherein the shape of the document image acquisition frame is consistent with the shape that the target document needs to present at the terminal device when the document image is acquired according to any of the preset acquisition angles.

[0165] Optional, Figure 5 The device described in may also include:

[0166] The target acquisition viewing angle determination module is used to determine the target acquisition viewing angle corresponding to the current document image acquired by the terminal device for the target document.

[0167] The second display module is used to display the first prompt information reflecting the target acquisition viewing angle at the terminal device. And / or,

[0168] The viewing angle difference information determination module is used to determine the viewing angle difference information between the preset acquisition viewing angle corresponding to the certificate image acquisition frame displayed at the terminal device and the target acquisition viewing angle.

[0169] The third display module is used to display at the terminal device at least one of the second prompt information reflecting the viewing angle difference information and the third prompt information for guiding the user to reduce the viewing angle difference reflected by the viewing angle difference information.

[0170] Optionally, the target acquisition viewing angle determination module can be used to:

[0171] The current document image is processed using an image acquisition perspective recognition model to obtain the target acquisition perspective. Or,

[0172] Based on the perspective transformation algorithm, the target acquisition angle corresponding to the acquisition of the current document image is determined. Or,

[0173] The target acquisition viewing angle is determined according to the device posture information collected by the preset sensor at the terminal device.

[0174] Optionally, the detection module 54 may be specifically used for:

[0175] The video visual self-attention model is used to classify the target document image sequence to obtain a detection result reflecting whether the target document has a risk of counterfeiting.

[0176] Among them, the video visual self-attention model is a model obtained by pre-training using document image sequence samples carrying label data reflecting whether the document samples have a risk of counterfeiting; the document image sequence samples are training samples generated based on the image sequence obtained by capturing images of the document samples according to the preset acquisition perspective.

[0177] The above device embodiments correspond to the method embodiments. For specific descriptions, please refer to the description of the method embodiments, which will not be repeated here. The device embodiments are obtained based on the corresponding method embodiments and have the same technical effects as the corresponding method embodiments. For specific descriptions, please refer to the corresponding method embodiments.

[0178] The present specification also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the above Figure 2 The specific execution process of the certificate detection method shown can refer to the specific description of the relevant embodiments of the certificate detection method, which will not be repeated here.

[0179] The present specification also provides a computer program product, which stores at least one instruction, and the at least one instruction is loaded and executed by the processor as described above. Figure 2 The specific execution process of the certificate detection method shown can refer to the specific description of the relevant embodiments of the certificate detection method, which will not be repeated here.

[0180] The embodiments of this specification also provide Figure 6 The structural diagram of the electronic device shown in FIG. Figure 6 At the hardware level, the electronic device may include a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and may also include other hardware required for the business. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to achieve the above Figure 2 The specific execution process of the certificate detection method shown can refer to the specific description of the relevant embodiments of the certificate detection method, which will not be repeated here.

[0181] Of course, in addition to software implementation, this specification does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is to say, the executor of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0182] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for computer-readable storage media, computer program products and Figure 6As for the electronic device shown, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0183] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages ​​and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.

[0184] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.

[0185] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0186] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0187] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0188] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0189] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0190] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0191] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0192] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0193] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0194] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0195] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0196] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0197] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0198] The above description is only an embodiment of the present specification and is not intended to limit the present specification. For those skilled in the art, the present specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification shall be included in the scope of the claims of the present specification.

Claims

1. A document detection method, the method comprising: Obtain a detection request for the target certificate of the user; In response to the detection request, determining a preset capture angle of view required to be used when capturing an image of the target document; The preset acquisition viewing angles include: a frontal viewing angle and a non-frontal viewing angle; Acquire a target document image sequence obtained by performing image acquisition on the target document according to the preset acquisition angle; The target document image sequence is processed using a video classification model to obtain a detection result reflecting whether the target document has a risk of counterfeiting.

2. The method according to claim 1, wherein, in response to the detection request, determining a preset capture angle required to be used when capturing an image of the target document comprises: Obtain at least one of the number of times the target certificate of the user fails to be detected within a preset time period and relevant user data of the user; determining a risk level of the user according to at least one of the number of detections and the relevant user data; According to the risk level of the user, the types of preset acquisition viewing angles to be used when acquiring images of the target document and the viewing angle ranges of the preset acquisition viewing angles of each type are determined.

3. According to the method of claim 2, the risk level of the user is positively correlated with the type of the preset acquisition angle, and the risk level of the user is negatively correlated with the viewing angle range of at least some types of the preset acquisition angle; or, The risk level of the user is negatively correlated with the type of the preset acquisition angle of view, and the risk level of the user is positively correlated with the viewing angle range of at least some types of the preset acquisition angle of view; or, The risk level of the user is positively correlated with the type of the preset acquisition angle of view, and the risk level of the user is positively correlated with the viewing angle range of at least some types of the preset acquisition angle of view; or, The risk level of the user is negatively correlated with the type of the preset acquisition viewing angle, and the risk level of the user is negatively correlated with the viewing angle range of at least some types of the preset acquisition viewing angle.

4. According to the method of claim 2, the types of the non-frontal viewing angles in the preset acquisition viewing angles include: At least one of a tilted upward viewing angle, a tilted downward viewing angle, a tilted left viewing angle, and a tilted right viewing angle.

5. The method according to any one of claims 1 to 4, before determining the preset capture angle required to be used when capturing the image of the target document, further comprising: In response to the detection request, determining whether the first document image of the target document captured according to the frontal viewing angle fails detection, and obtaining a determination result; The step of determining a preset capture angle of view required for image capture of the target document includes: If the judgment result indicates that the first document image detection of the target document captured according to the frontal viewing angle fails, a preset capturing viewing angle required to be used when capturing the image of the target document is determined.

6. According to the method of claim 1, the step of acquiring a target document image sequence obtained by performing image acquisition on the target document according to the preset acquisition angle comprises: Acquire an initial document image sequence captured for the target document according to the preset capture angle; Performing image correction processing on at least a portion of the second document image captured according to the non-frontal perspective in the initial document image sequence to obtain a third document image; Determine a difference image between the third ID image and a fourth ID image in the initial ID image sequence acquired according to the frontal viewing angle; The target document image sequence is generated according to the initial document image sequence and the difference image.

7. According to the method of claim 1, the step of acquiring a target document image sequence obtained by performing image acquisition on the target document according to the preset acquisition angle comprises: An initial document image sequence acquired for the target document according to the preset acquisition viewing angle is determined as the target document image sequence.

8. The method according to claim 6 or 7, wherein the acquiring the target document image sequence obtained by performing image acquisition on the target document according to the preset acquisition angle further comprises: Determining the image clarity of each document image in the initial document image sequence; Deleting the document images whose image clarity is less than a preset threshold in the initial document image sequence; or, Delete the document image pairs to which the document images whose image clarity is less than a preset threshold value belong in the initial document image sequence; wherein one of the document image pairs includes an image captured according to the same preset capture angle of view for the target document under the illumination of a flash device, and an image captured for the target document not illuminated by the flash device.

9. The method according to claim 1, wherein the method is applied to a server device; The step of acquiring a target document image sequence obtained by performing image acquisition on the target document according to the preset acquisition angle includes: Determining the target document image sequence based on the image sequence captured by the user's terminal device according to the preset capture angle for the target document; The process of processing the target certificate image sequence using the video classification model to obtain a detection result reflecting whether the target certificate has a risk of counterfeiting includes: The target certificate image sequence is input into the video classification model installed at the server device to obtain a detection result output by the video classification model to reflect whether the target certificate has a risk of counterfeiting.

10. The method according to claim 1, wherein the method is applied to a terminal device of the user; The step of acquiring a target document image sequence obtained by performing image acquisition on the target document according to the preset acquisition angle includes: Using the terminal device to perform image acquisition on the target document according to the preset acquisition angle of view to obtain the target document image sequence; The process of processing the target certificate image sequence using the video classification model to obtain a detection result reflecting whether the target certificate has a risk of counterfeiting includes: Inputting the target certificate image sequence into the video classification model carried by the terminal device to obtain the detection result output by the video classification model to reflect whether the target certificate has a risk of counterfeiting; or The target certificate image sequence is sent to a server device; the server device is used to input the target certificate image sequence into a video classification model to obtain a detection result output by the video classification model to reflect whether the target certificate has a risk of counterfeiting.

11. The method according to claim 10, before using the terminal device to capture the image of the target document according to the preset capture angle, further comprising: For at least some of the preset acquisition angles, an ID card image acquisition frame matching any of the preset acquisition angles is displayed at the terminal device; wherein the shape of the ID card image acquisition frame is consistent with the shape that the target ID card needs to present at the terminal device when the ID card image is acquired according to any of the preset acquisition angles.

12. The method according to claim 11, after displaying the document image acquisition frame matching any of the preset acquisition angles at the terminal device, further comprising: Determine a target acquisition angle of view corresponding to when the terminal device acquires a current document image for the target document; Displaying, at the terminal device, first prompt information reflecting the target acquisition viewing angle; and / or, Determine the perspective difference information between the preset capture perspective corresponding to the document image capture frame displayed at the terminal device and the target capture perspective; At least one of second prompt information reflecting the viewing angle difference information and third prompt information guiding the user to reduce the viewing angle difference reflected by the viewing angle difference information is displayed at the terminal device.

13. The method according to claim 12, wherein determining the target acquisition angle corresponding to the current document image acquired by the terminal device for the target document comprises: Processing the current document image using an image acquisition perspective recognition model to obtain the target acquisition perspective; or, Based on a perspective transformation algorithm, determining the target acquisition viewing angle corresponding to when the current document image is acquired; or, The target acquisition viewing angle is determined according to the device posture information collected by the preset sensor at the terminal device.

14. The method according to claim 1, wherein the processing of the target document image sequence by using a video classification model to obtain a detection result reflecting whether the target document has a risk of counterfeiting comprises: Using a video visual self-attention model, the target document image sequence is classified and processed to obtain a detection result reflecting whether the target document has a risk of counterfeiting; Among them, the video visual self-attention model is a model obtained by pre-training using document image sequence samples carrying label data reflecting whether the document samples have a risk of counterfeiting; the document image sequence samples are training samples generated based on the image sequence obtained by capturing images of the document samples according to the preset acquisition perspective.

15. A document detection device, comprising: A first acquisition module, used to acquire a detection request for a target certificate of a user; A capture angle determination module, configured to determine, in response to the detection request, a preset capture angle required to be used when capturing an image of the target document; The preset acquisition viewing angles include: a frontal viewing angle and a non-frontal viewing angle; A second acquisition module is used to acquire a target document image sequence obtained by acquiring images of the target document according to the preset acquisition angle; The detection module is used to process the target certificate image sequence using a video classification model to obtain a detection result reflecting whether the target certificate has a risk of counterfeiting.

16. A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method according to any one of claims 1 to 14.

17. An electronic device comprising: A processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the steps of the method as claimed in any one of claims 1 to 14.

18. A computer program product having at least one instruction stored thereon, wherein when the at least one instruction is executed by a processor, the steps of the method according to any one of claims 1 to 14 are implemented.