Card identification method and device, computer device and storage medium

By acquiring video of cards and certificates under a preset lighting change mode and selecting images using a frame selection algorithm, and combining and fusing the authentication results, the problem of low efficiency and accuracy of existing card and certificate authentication technologies is solved, and efficient and accurate card and certificate authentication is achieved.

CN119169319BActive Publication Date: 2026-11-24PING AN TECH (SHENZHEN) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411132810.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-16
Publication Date
2026-11-24
Estimated Expiration
2044-08-16

AI Technical Summary

Technical Problem

Existing card and document authentication technologies are inefficient and inaccurate. Users need to adjust the shooting angle multiple times, and they are easily affected by lighting and angle, leading to misidentification or missed identification, which affects the accuracy of authentication.

Method used

Video of the card is captured under a preset lighting change mode. Images under standard lighting and flash lighting are selected by a frame selection algorithm, combined and input into the card authentication model for authentication, and the fusion result generates the final authentication result.

Benefits of technology

This avoids requiring users to adjust the shooting angle multiple times, improving user experience, ensuring image quality, reducing the possibility of misidentification and missed identification, and improving the efficiency and accuracy of card and document authentication.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119169319B_ABST
    Figure CN119169319B_ABST
Patent Text Reader

Abstract

This application belongs to the field of artificial intelligence and relates to a card authentication method, comprising: acquiring a video of the card from a preset angle under a preset illumination change mode; selecting a first image under standard illumination and a second and third image under flash illumination from the video using a preset frame selection algorithm; combining the first and second images to obtain a first image combination, and combining the first and third images to obtain a second image combination; inputting the first image combination into a card authentication model to obtain a first authentication result, and inputting the second image combination into the card authentication model to obtain a second authentication result; generating a card authentication result based on the first and second authentication results. This application also provides a card authentication device, a computer device, and a storage medium. This application improves the efficiency and accuracy of card authentication.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a card authentication method, device, computer equipment, and storage medium. Background Technology

[0002] In the financial and insurance sectors, identity verification is a crucial step in preventing fraud and ensuring transaction security, which can be achieved through the authentication of cards and documents that record identity information. Currently, mobile card and document authentication technology mainly relies on photographing cards and documents and performing visual analysis. Existing card and document authentication technologies often require users to adjust the shooting angle and distance multiple times. This complex process not only wastes user time but also easily leads to user fatigue and dissatisfaction. In practical applications, card and document photos may be affected by factors such as blurriness, insufficient lighting, and shadows, leading to misidentification or missed identification and reducing the accuracy of authentication. In addition, different shooting angles may cause truncated or distorted information in the photo, affecting the accuracy of authentication. Therefore, existing card and document authentication technologies are insufficient in both efficiency and accuracy. Summary of the Invention

[0003] The purpose of this application is to provide a card and certificate authentication method, device, computer equipment, and storage medium to solve the problem of low efficiency and accuracy of the card and certificate supervision committee.

[0004] To address the aforementioned technical problems, this application provides a card authentication method, employing the following technical solution:

[0005] Under the preset lighting change mode, capture video of the card from a preset angle;

[0006] Using a preset frame selection algorithm, the first image under standard lighting and the second and third images under flash lighting are selected from the video of the card;

[0007] The first image is combined with the second image to obtain a first image combination, and the first image is combined with the third image to obtain a second image combination;

[0008] The first image combination is input into the card authentication model to obtain the first authentication result, and the second image combination is input into the card authentication model to obtain the second authentication result.

[0009] The card authentication result is generated based on the first authentication result and the second authentication result.

[0010] To address the aforementioned technical problems, this application also provides a card authentication device, which employs the following technical solution:

[0011] The video capture module is used to capture video of the card from a preset angle under a preset lighting change mode;

[0012] The image selection module is used to select a first image under standard lighting and a second and third image under flash lighting from the card video using a preset frame selection algorithm.

[0013] An image combination module is used to combine the first image and the second image to obtain a first image combination, and to combine the first image and the third image to obtain a second image combination;

[0014] The combined input module is used to input the first image into the card authentication model to obtain a first authentication result, and to input the second image into the card authentication model to obtain a second authentication result.

[0015] The result generation module is used to generate the card authentication result of the card based on the first authentication result and the second authentication result.

[0016] To address the aforementioned technical problems, this application also provides a computer device that employs the following technical solution:

[0017] Under the preset lighting change mode, capture video of the card from a preset angle;

[0018] Using a preset frame selection algorithm, the first image under standard lighting and the second and third images under flash lighting are selected from the video of the card;

[0019] The first image is combined with the second image to obtain a first image combination, and the first image is combined with the third image to obtain a second image combination;

[0020] The first image combination is input into the card authentication model to obtain the first authentication result, and the second image combination is input into the card authentication model to obtain the second authentication result.

[0021] The card authentication result is generated based on the first authentication result and the second authentication result.

[0022] To address the aforementioned technical problems, this application also provides a computer-readable storage medium, employing the technical solution described below:

[0023] Under the preset lighting change mode, capture video of the card from a preset angle;

[0024] Using a preset frame selection algorithm, the first image under standard lighting and the second and third images under flash lighting are selected from the video of the card;

[0025] The first image is combined with the second image to obtain a first image combination, and the first image is combined with the third image to obtain a second image combination;

[0026] The first image combination is input into the card authentication model to obtain the first authentication result, and the second image combination is input into the card authentication model to obtain the second authentication result.

[0027] The card authentication result is generated based on the first authentication result and the second authentication result.

[0028] Compared with the prior art, the embodiments of this application have the following main advantages: Capturing card / certificate video from a preset angle under a preset lighting change mode avoids the need for users to adjust the shooting angle multiple times, improving user experience; Utilizing a preset frame selection algorithm to select a first image under standard lighting and a second and third image under flash lighting from the card / certificate video ensures the quality of the selected images, facilitating the capture of visual features of the card / certificate under different lighting conditions and obtaining more information, thus ensuring the accuracy of subsequent image processing; Combining the first and second images to obtain a first image combination, and combining the first and third images to obtain a second image combination, then inputting the first and second image combinations into the card / certificate authentication model, can more effectively extract and identify authentication features in the images; Fusing the authentication results of the two combinations to obtain the card / certificate authentication result reduces the possibility of misidentification and missed identification, improving the efficiency and accuracy of card / certificate authentication. Attached Figure Description

[0029] To more clearly illustrate the solutions in this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0030] Figure 1 This is an exemplary system architecture diagram to which this application can be applied;

[0031] Figure 2 This is a flowchart of an embodiment of the card authentication method according to this application;

[0032] Figure 3 This is a schematic diagram of a structure of an embodiment of the card authentication device according to this application;

[0033] Figure 4 This is a schematic diagram of the structure of one embodiment of the computer device according to this application. Detailed Implementation

[0034] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein in the specification of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "comprising" and "having," and any variations thereof, in the specification, claims, and foregoing drawings of this application, are intended to cover non-exclusive inclusion. The terms "first," "second," etc., in the specification, claims, or foregoing drawings of this application are used to distinguish different objects, not to describe a particular order.

[0035] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0036] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.

[0037] like Figure 1 As shown, system architecture 100 may include terminal devices 101, 102, and 103, a network 104, and a server 105. Network 104 serves as the medium for providing communication links between terminal devices 101, 102, and 103 and server 105. Network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.

[0038] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, and 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social media platform software, etc.

[0039] Terminal devices 101, 102, and 103 can be various electronic devices with displays and support web browsing, including but not limited to smartphones, tablets, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 players (Moving Picture Experts Group Audio Layer IV), laptops, and desktop computers, etc.

[0040] Server 105 can be a server that provides various services, such as a backend server that supports the pages displayed on terminal devices 101, 102, and 103.

[0041] It should be noted that the card authentication method provided in this application is generally executed by a terminal device, and correspondingly, the card authentication device is generally installed in the terminal device.

[0042] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0043] Continue to refer to Figure 2 The diagram illustrates a flowchart of an embodiment of the card authentication method according to this application. The card authentication method includes the following steps:

[0044] Step S201: Under the preset lighting change mode, capture the video of the card from a preset angle.

[0045] In this embodiment, the card authentication method operates on an electronic device (e.g., Figure 1 The terminal device shown can communicate with the server via wired or wireless connection. It should be noted that the aforementioned wireless connection methods may include, but are not limited to, 3G / 4G / 5G connections, Wi-Fi connections, Bluetooth connections, Wi-Fi connections, Zigbee connections, UWB (ultra-Width band) connections, and other currently known or future wireless connection methods.

[0046] Specifically, the terminal instructs the user to position the card at a fixed shooting angle and initiates the recording process to obtain a video of the card. Typically, video recording is taken from the front of the card. The video recording follows a preset lighting pattern, which refers to the on / off switching of the flash during recording.

[0047] Step S202: Using a preset frame selection algorithm, select the first image under standard lighting and the second and third images under flash lighting from the video of the card.

[0048] Specifically, the video of the card certificate contains a large number of video frames. For example, a 1.5-second recording contains about 30 frames. Card certificate authentication only requires two frames where the authentication features show obvious texture or optical changes. The required images can be obtained through frame selection algorithms.

[0049] The video is processed using a preset frame selection algorithm. This algorithm detects each frame in the video from preset detection dimensions and selects frames that meet the criteria. It selects a suitable first image under standard lighting (no flash) and two suitable frames under flash lighting as the second and third images.

[0050] Step S203: Combine the first image with the second image to obtain a first image combination, and combine the first image with the third image to obtain a second image combination.

[0051] Specifically, a first image without flash is combined with a second image with flash to form a first image combination; similarly, a first image is combined with a third image to form a second image combination. In one embodiment, the combination method can be feature-level fusion, that is, extracting features from the two images and fusing them.

[0052] Step S204: Input the first image combination into the card authentication model to obtain the first authentication result, and input the second image combination into the card authentication model to obtain the second authentication result.

[0053] Specifically, the first image combination and the second image combination are input into a pre-trained card authentication model. This model can be built based on a Shuffling network and, after extensive training, can identify authentication features in the images. The model will output the first authentication result for the first image combination and the second authentication result for the second image combination, representing the authenticity judgment of each pair of combined images.

[0054] Shuffling is a lightweight convolutional neural network designed for resource-constrained environments such as mobile devices and embedded systems. It aims to reduce computational cost and parameter count while maintaining high accuracy. It improves efficiency through two innovations: Channel Shuffling and Group Convolution.

[0055] Shuffling divides the standard convolution operation into multiple groups, with each group performing convolution operations separately, which significantly reduces the amount of computation, but also leads to insufficient information exchange between channels.

[0056] Channel shuffling addresses the problems caused by grouped convolution. After each grouped convolution, the network rearranges (shuffles) the channels, allowing feature information from different groups to be fully integrated. This ensures the transfer and exchange of feature information throughout the network and improves the model's expressive power.

[0057] Channel shuffling and grouped convolutions significantly optimize computational complexity and model size for Shuff Lenet, making it well-suited for resource-constrained environments while maintaining high accuracy in tasks such as image classification.

[0058] Step S205: Generate the card authentication result based on the first authentication result and the second authentication result.

[0059] Specifically, the first and second authentication results are combined to generate the final card authentication result. The fusion method can be logical operation or a weighted voting mechanism to improve the reliability of the result.

[0060] Furthermore, step S205 may include: generating a card authentication result indicating that the card is genuine when both the first authentication result and the second authentication result indicate that the card is genuine; and generating a card authentication result indicating that the card is fake when neither the first authentication result nor the second authentication result indicates that the card is genuine.

[0061] Specifically, the first image combination and the second image combination are input into the card authentication model respectively to obtain the first authentication result and the second authentication result. These two authentication results are then checked. If both results indicate that the card is genuine, the final card authentication result is generated, indicating that the card is authentic.

[0062] If one or both of the first and second authentication results indicate that the card is fake, then the final card authentication result is generated, indicating that the card is fake.

[0063] This method of judgment ensures strict control over the authenticity of cards and certificates, and improves the accuracy and security of counterfeit detection.

[0064] In this embodiment, the final authentication result of the card being genuine is generated only when both the first and second authentication results show that the card is genuine, ensuring the rigor of the judgment. The dual verification mechanism improves the security of card authentication and reduces the risk of misjudgment. When one of the two authentication results shows that the card is fake, the final authentication result of the card being fake is generated. The conservative judgment strategy prevents fake cards from passing and improves the ability to identify fake cards.

[0065] In this embodiment, the video of the card is captured from a preset angle under a preset lighting change mode, avoiding the need for the user to adjust the shooting angle multiple times and improving the user experience. A preset frame selection algorithm is used to select a first image under standard lighting and two images under flash lighting from the video of the card, ensuring the quality of the selected images. This facilitates the capture of the visual features of the card under different lighting conditions and the acquisition of more information, ensuring the accuracy of subsequent image processing. The first image and the second image are combined to obtain a first image combination, and the first image and the third image are combined to obtain a second image combination. The first image combination and the second image combination are then input into the card authentication model, enabling more effective extraction and recognition of authentication features in the images. The authentication results of the two combinations are fused to obtain the card authentication result, reducing the possibility of misidentification and missed identification, and improving the efficiency and accuracy of card authentication.

[0066] Furthermore, step S201 may include: turning on the flash and recording video of the card from a preset angle under flash illumination; turning off the flash and continuing to record video of the card from a preset angle under standard illumination to obtain a video of the card.

[0067] Specifically, the user places the card at a fixed shooting angle, and the terminal can activate the flash. Under flash illumination, the terminal continuously captures multiple frames of images, forming a video. This video contains clear details of the card under flash illumination, especially some counterfeit-proof features that can be displayed under strong light.

[0068] The flash was then turned off, and multiple frames were taken under standard lighting conditions without flash. The second half of the video recorded the card under natural light, preserving the card's natural color and texture.

[0069] Ultimately, a video of the card under two different lighting conditions was obtained. This shooting method improves the diversity and quality of the images. The video frames under flash lighting highlight certain anti-counterfeiting features of the card, such as hidden anti-counterfeiting marks and reflective elements, while the video frames under standard lighting preserve the card's natural appearance and details. Users only need to hold the card upright against the terminal and take a picture once.

[0070] In this embodiment, video recording is performed using both flash and standard lighting modes. This ensures that the visual features of the card are captured under different lighting conditions, allowing for the acquisition of more information and helping the subsequent frame selection algorithm provide high-quality input for the counterfeit detection model.

[0071] Furthermore, step S202 may include: performing grayscale processing on each frame of the video to obtain grayscale images of each frame; cropping each grayscale image to obtain target images in each grayscale image; filtering target images whose grayscale values ​​meet the grayscale value conditions to obtain multiple first target images; filtering first target images whose clarity meets the clarity conditions to obtain multiple candidate images; selecting one candidate image under standard illumination as the first image, and selecting two candidate images under flash illumination as the second image and the third image, respectively.

[0072] Specifically, each frame of the video in the card is converted to grayscale to obtain a grayscale image of each frame. This reduces the complexity and computational load of the image data while preserving the main structural information of the image. The grayscale image contains only brightness information and not color information.

[0073] Each grayscale image is cropped to extract the target region, i.e., the part containing the card. Cropping is usually based on a preset ROI (Region of Interest) to ensure that subsequent processing only targets the card itself and ignores other irrelevant content in the image.

[0074] The cropped target image is then filtered by grayscale value. A grayscale value threshold is preset; if the grayscale value of the target image is less than or equal to the threshold, it meets the grayscale value condition, i.e., the brightness meets the condition. In one embodiment, if the grayscale value of the target image is greater than 220, it is considered to meet the grayscale value condition. By using the grayscale value condition, target images that do not meet the brightness condition can be eliminated, which is beneficial for subsequent anti-counterfeiting analysis. After filtering, multiple first target images are obtained, all of which have grayscale values ​​within a suitable range, ensuring the visibility of the images.

[0075] Next, the first target image is screened for sharpness. Sharpness is one of the important indicators for measuring image quality, and it is especially important for counterfeit detection analysis. The sharpness value of the first target image can be calculated. If the sharpness value meets the preset sharpness conditions, the sharpness of the first target image meets the requirements and can be used as a candidate image, ensuring the accuracy of subsequent counterfeit detection analysis.

[0076] One image under standard lighting is selected from the candidate images as the first image, and two images under flash lighting are selected as the second and third images, respectively. These three images will serve as input to the authentication model for subsequent authentication analysis.

[0077] In one embodiment, the times when the flash is turned on and off are known according to a preset acquisition time period (e.g., completing the acquisition process within 1.5 seconds). Therefore, the frames where the flash is on and off can be automatically distinguished based on the acquisition time sequence, thereby selecting images under standard lighting and images under flash lighting.

[0078] In this embodiment, by performing grayscale processing, cropping, grayscale value filtering, and sharpness filtering, low-quality images are effectively eliminated, while high-quality images are retained for counterfeit detection analysis. This reduces the false recognition rate of the algorithm and improves the accuracy of counterfeit detection. In addition, the unique frame selection algorithm and efficient image processing flow make the entire counterfeit detection process faster and improve processing efficiency.

[0079] Furthermore, the step of selecting a first target image whose sharpness meets the sharpness condition and obtaining multiple candidate images may include: for each first target image, performing a Fourier transform on the first target image to obtain the power spectrum of the first target image; performing a spectral center swap on the power spectrum to obtain a second target image; performing an inverse Fourier transform on the second target image to obtain a third target image; setting the center region of the third target image to zero according to a preset region size to obtain a fourth target image, and calculating the average pixel value of the fourth target image; when the average pixel value is greater than a preset average value threshold, determining that the first target image meets the sharpness condition, and using the first target image as a candidate image.

[0080] Specifically, a Fourier transform is performed on each first target image to convert it from the spatial domain to the frequency domain, yielding the power spectrum of that image. The power spectrum reflects the energy distribution of the image across different frequency components.

[0081] The power spectrum undergoes a spectral center swap, which involves exchanging the center and edge portions of the spectrum. This process rearranges the frequency components, placing low-frequency components in the central region of the image. In one embodiment, the first target image is N×N in size. After obtaining its power spectrum, it is divided into four quadrants using the center point of the power spectrum image as the dividing point. The spectral center swap involves exchanging the first and third quadrants, and the second and fourth quadrants.

[0082] After the frequency center is swapped, the second target image is obtained. The second target image is then subjected to an inverse Fourier transform to convert it from the frequency domain back to the spatial domain, thus obtaining the third target image.

[0083] Then, obtain two pre-set hyperparameters F1 and F2, where F1 is the region size and F2 is the average threshold for pixels.

[0084] Based on a preset region size, the central region of the third target image is set to zero, thereby removing low-frequency components (usually corresponding to the overall brightness and general outline of the image) and retaining high-frequency components (usually corresponding to the details of the image), resulting in the fourth target image. Setting the central region to zero means setting the pixel values ​​in the region [(N-F1) / 2:(N+F1) / 2,(N-F1) / 2:(N+F1) / 2] of the third target image to 0 (continuing from the previous text, the size of the third target image is N×N).

[0085] Calculate the average pixel value of the fourth target image, which reflects the sharpness of the image details. If the average pixel value of the fourth target image is greater than a preset average value threshold F2, it indicates that the image has sufficient sharpness. In this case, the first target image is determined to meet the sharpness condition and is selected as a candidate image; otherwise, the first target image is considered not to meet the sharpness condition.

[0086] In this embodiment, the image is transformed from the spatial domain to the frequency domain through Fourier transform, allowing the frequency characteristics of the image to be displayed. The frequency components of the image are further processed through spectral center exchange and inverse Fourier transform, enabling the distinction between low-frequency and high-frequency components. Low-frequency components are removed by setting the center region to zero, while high-frequency details are preserved. The average pixel value of the high-frequency portion of the image is calculated, effectively evaluating the image's sharpness. Images meeting the sharpness criteria are selected using a preset average threshold, ensuring that high-quality images are used in subsequent processing. This improves the accuracy of image sharpness judgment and enhances image processing capabilities in various complex environments, making card and document authentication more accurate.

[0087] Furthermore, before the step of setting the center region of the third target image to zero according to the preset region size to obtain the fourth target image, the method may further include: acquiring a dataset containing multiple clear images and multiple blurred images; calculating the average pixel value of all images in the dataset for each candidate region size; selecting the minimum average pixel value among the average pixel values ​​of each clear image as a candidate average value threshold; calculating the recognition accuracy of each blurred image based on the candidate average value threshold, according to the average pixel value and label of each blurred image; and selecting the candidate region size corresponding to the maximum recognition accuracy and its corresponding candidate average value threshold as the region size and average value threshold for application, respectively.

[0088] Specifically, prepare a dataset containing a large number of labeled sharp and blurry images. Sharp images will be used as positive samples X_P and blurry images will be used as negative samples X_N. These images will be used to optimize the region size and the average threshold.

[0089] A range of candidate region sizes [F1_a, F1_b] is pre-defined. For each possible candidate region size within this range, the average pixel value of all images in the dataset under that region size is calculated (the calculation process is described above, the center region of the image is set to zero according to the candidate region size, and then the average pixel value of each pixel in the new image is calculated), thereby finding the image feature representation under different region sizes.

[0090] For each candidate region size, the minimum pixel average value among all clear images is selected as the candidate average value threshold for that region size.

[0091] Using the obtained candidate average threshold, the pixel average of each blurred image under the candidate region size is calculated (the calculation process is described above, the central region of the image is set to zero according to the candidate region size, and then the pixel average of each pixel in the new image is calculated). Based on the label of the blurred image (the label indicates that the image is blurred), its recognition accuracy pre_N is calculated. Recognition accuracy refers to the accuracy of the algorithm when recognizing blurred images.

[0092] That is, after calculating the average pixel value of each blurred image under the candidate region size, the average pixel value of each blurred image is compared with the candidate average value threshold corresponding to the candidate region size. If the average pixel value is less than or equal to the candidate average value threshold, it means that the algorithm in the optimization process has identified the image as a blurred image and completed the correct recognition. Then, the recognition accuracy can be calculated based on the prediction result of each blurred image.

[0093] Ultimately, the candidate region size with the highest recognition accuracy and its corresponding candidate average threshold were selected as the region size and average threshold for practical applications, ensuring that the system uses the optimal parameters to determine image sharpness in real-world environments.

[0094] In this embodiment, the preset dataset contains both clear and blurry images, providing a reliable foundation for parameter optimization. For each candidate region size, the average pixel value of all images is calculated and compared, ensuring that the performance of image features under different candidate region sizes is fully evaluated. The minimum average pixel value of each clear image is selected as the candidate threshold, ensuring that the discrimination criteria for clear images are rigorous under different candidate region sizes. The recognition accuracy of blurry images is calculated, and the candidate region size and average threshold that make blurry image discrimination most accurate are found. The parameter with the highest recognition accuracy is selected, ensuring that image clarity can be judged more accurately in practical applications, improving the accuracy of card and document authentication. The data-driven parameter optimization method enhances adaptability in complex environments, ensuring the reliability of image clarity judgment under various lighting and shooting conditions.

[0095] Furthermore, the step of inputting the first image combination into the card authentication model to obtain the first authentication result may include: extracting features from the first image combination into the card authentication model to obtain a first authentication feature vector of the first image and a second authentication feature vector of the second image; combining the first authentication feature vector and the second authentication feature vector to obtain a combined authentication feature vector; and inputting the combined authentication feature vector into the classifier in the card authentication model to obtain the first authentication result.

[0096] Specifically, the first image combination (the first image in flashless mode and the second image in flash mode) is input into the card authentication model. The card authentication model processes the first and second images separately, extracts their authentication features, and generates a first authentication feature vector and a second authentication feature vector.

[0097] The anti-spoofing feature vectors extracted from the two images are combined to form a comprehensive combined anti-spoofing feature vector, which realizes the fusion of feature information under two different lighting conditions, enhancing the comprehensiveness and robustness of feature representation.

[0098] The combined anti-counterfeiting feature vector is input into the classifier in the card and certificate authentication model. The classifier judges the authenticity of the card and certificate based on the combined anti-counterfeiting feature vector and generates the first authentication result.

[0099] It is understandable that the card authentication model processes the second image combination in the same way, which will not be elaborated here.

[0100] In this embodiment, the first image in flashless mode and the second image in flash mode are combined and input into the model to extract rich anti-counterfeiting features from different lighting conditions, generating a first anti-counterfeiting feature vector and a second anti-counterfeiting feature vector, ensuring the comprehensiveness of feature information. The two feature vectors are combined to comprehensively utilize feature information under different lighting conditions, forming a more robust combined anti-counterfeiting feature vector. The combined feature vector is input into a classifier for classification processing, which can more accurately determine the authenticity of the card, improve the accuracy of feature extraction and classification, and enhance the anti-counterfeiting capability of the card in various complex environments.

[0101] It should be emphasized that, to further ensure the privacy and security of the aforementioned card and certificate videos, these videos can also be stored in a blockchain node.

[0102] The blockchain referred to in this application is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Essentially, a blockchain is a decentralized database, a chain of data blocks linked together using cryptographic methods. Each data block contains information about a batch of network transactions, used to verify the validity of the information (anti-counterfeiting) and generate the next block. A blockchain can include an underlying blockchain platform, a platform product service layer, and an application service layer.

[0103] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.

[0104] Foundational technologies for artificial intelligence generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.

[0105] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing related hardware through computer-readable instructions. These computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the methods described above. The aforementioned storage medium can be a non-volatile storage medium such as a magnetic disk, optical disk, or read-only memory (ROM), or random access memory (RAM).

[0106] It should be understood that although the steps in the flowcharts of the accompanying figures are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the accompanying figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.

[0107] Further reference Figure 3 As a response to the above Figure 2 The implementation of the method shown in this application provides an embodiment of a card authentication device, which is similar to... Figure 2 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.

[0108] like Figure 3 As shown, the card authentication device 300 described in this embodiment includes: a video acquisition module 301, an image selection module 302, an image combination module 303, a combination input module 304, and a result generation module 305, wherein:

[0109] The video acquisition module 301 is used to acquire video of the card from a preset angle under a preset lighting change mode.

[0110] The image selection module 302 is used to select a first image under standard lighting and a second and third image under flash lighting from the card video using a preset frame selection algorithm.

[0111] The image combination module 303 is used to combine the first image and the second image to obtain a first image combination, and to combine the first image and the third image to obtain a second image combination.

[0112] The combined input module 304 is used to obtain a first authentication result from the first image combined input card authentication model and to obtain a second authentication result from the second image combined input card authentication model.

[0113] The result generation module 305 is used to generate the card authentication result of the card based on the first authentication result and the second authentication result.

[0114] In this embodiment, the video of the card is captured from a preset angle under a preset lighting change mode, avoiding the need for the user to adjust the shooting angle multiple times and improving the user experience. A preset frame selection algorithm is used to select a first image under standard lighting and two images under flash lighting from the video of the card, ensuring the quality of the selected images. This facilitates the capture of the visual features of the card under different lighting conditions and the acquisition of more information, ensuring the accuracy of subsequent image processing. The first image and the second image are combined to obtain a first image combination, and the first image and the third image are combined to obtain a second image combination. The first image combination and the second image combination are then input into the card authentication model, enabling more effective extraction and recognition of authentication features in the images. The authentication results of the two combinations are fused to obtain the card authentication result, reducing the possibility of misidentification and missed identification, and improving the efficiency and accuracy of card authentication.

[0115] In some optional implementations of this embodiment, the video acquisition module 301 may include:

[0116] The flash recording submodule is used to turn on the flash and record video of the card from a preset angle under flash illumination.

[0117] The standard recording submodule is used to turn off the flash and continue recording the card from a preset angle under standard lighting conditions to obtain the card video.

[0118] In some optional implementations of this embodiment, the image selection module 302 may include:

[0119] The grayscale processing submodule is used to perform grayscale processing on each frame of the video to obtain grayscale images of each frame.

[0120] The image cropping submodule is used to crop each grayscale image to obtain the target image from each grayscale image.

[0121] The grayscale filtering submodule is used to filter target images whose grayscale values ​​meet the grayscale value conditions, and obtain multiple first target images.

[0122] The clarity filtering submodule is used to filter the first target image whose clarity meets the clarity criteria, resulting in multiple candidate images.

[0123] The candidate selection submodule is used to select one candidate image under standard lighting as the first image, and two candidate images under flash lighting as the second and third images, respectively.

[0124] In some optional implementations of this embodiment, the clear filtering submodule may include:

[0125] The Fourier transform unit is used to perform a Fourier transform on each first target image to obtain the power spectrum of the first target image.

[0126] The central exchange unit is used to perform spectral central exchange on the power spectrum to obtain the second target image.

[0127] The inverse transform unit is used to perform an inverse Fourier transform on the second target image to obtain the third target image.

[0128] The center zeroing unit is used to zero out the center region of the third target image according to the preset region size to obtain the fourth target image, and to calculate the average pixel value of the fourth target image.

[0129] The clarity determination unit is used to determine that the first target image meets the clarity condition when the average pixel value is greater than a preset average value threshold, and to use the first target image as a candidate image.

[0130] In some optional implementations of this embodiment, the clear filtering submodule may further include:

[0131] The dataset acquisition unit is used to acquire a dataset containing multiple clear images and multiple blurry images.

[0132] The averaging unit is used to calculate the average pixel value of all images in the dataset for each candidate region size.

[0133] The minimum selection unit is used to select the minimum pixel average value among the pixel average values ​​of each clear image as the candidate average value threshold.

[0134] The accuracy calculation unit is used to calculate the recognition accuracy of each blurred image based on the candidate average threshold, the pixel average value of each blurred image and its label.

[0135] The maximum selection unit is used to select the candidate region size corresponding to the maximum recognition accuracy and its corresponding candidate average threshold, which are used as the region size and average threshold when applied.

[0136] In some optional implementations of this embodiment, the combined input module 304 may include:

[0137] The first input submodule is used to extract features from the first image combined with the card authentication model to obtain the first authentication feature vector of the first image and the second authentication feature vector of the second image.

[0138] The vector combination submodule is used to combine the first and second anti-spoofing feature vectors to obtain a combined anti-spoofing feature vector.

[0139] The combined input submodule is used to input the combined anti-counterfeiting feature vector into the classifier in the card authentication model to obtain the first anti-counterfeiting result.

[0140] In some optional implementations of this embodiment, the result generation module 305 may include:

[0141] The first generation submodule is used to generate a card authentication result indicating that the card is genuine when both the first and second authentication results show that the card is genuine.

[0142] The second generation submodule is used to generate a card authentication result indicating that the card is fake when neither the first nor the second authentication result shows that the card is genuine.

[0143] To address the aforementioned technical problems, embodiments of this application also provide a computer device. Please refer to [link / reference needed]. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.

[0144] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are interconnected via a system bus. It should be noted that only the computer device 4 with components 41-43 is shown in the figure; however, it should be understood that it is not required to implement all the shown components, and more or fewer components can be implemented alternatively. Those skilled in the art will understand that the computer device described here is a device capable of automatically performing numerical calculations and / or information processing according to pre-set or stored instructions. Its hardware includes, but is not limited to, microprocessors, application-specific integrated circuits (ASICs), programmable gate arrays (FPGAs), digital digital processors (DSPs), embedded devices, etc.

[0145] The computer device can be a desktop computer, laptop, handheld computer, or cloud server, etc. The computer device can interact with the user via a keyboard, mouse, remote control, touchpad, or voice control.

[0146] The memory 41 includes at least one type of readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 41 may be an internal storage unit of the computer device 4, such as the hard disk or memory of the computer device 4. In other embodiments, the memory 41 may also be an external storage device of the computer device 4, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the computer device 4. Of course, the memory 41 may include both the internal storage unit and its external storage device of the computer device 4. In this embodiment, the memory 41 is typically used to store the operating system and various application software installed on the computer device 4, such as computer-readable instructions for card authentication methods. In addition, the memory 41 can also be used to temporarily store various types of data that have been output or will be output.

[0147] In some embodiments, the processor 42 may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip. The processor 42 is typically used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to execute computer-readable instructions stored in the memory 41 or to process data, for example, to execute computer-readable instructions for the card authentication method.

[0148] The network interface 43 may include a wireless network interface or a wired network interface, which is typically used to establish communication connections between the computer device 4 and other electronic devices.

[0149] The computer device provided in this embodiment can execute the card authentication method described above. Here, the card authentication method can be any of the card authentication methods described in the various embodiments above.

[0150] In this embodiment, the video of the card is captured from a preset angle under a preset lighting change mode, avoiding the need for the user to adjust the shooting angle multiple times and improving the user experience. A preset frame selection algorithm is used to select a first image under standard lighting and two images under flash lighting from the video of the card, ensuring the quality of the selected images. This facilitates the capture of the visual features of the card under different lighting conditions and the acquisition of more information, ensuring the accuracy of subsequent image processing. The first image and the second image are combined to obtain a first image combination, and the first image and the third image are combined to obtain a second image combination. The first image combination and the second image combination are then input into the card authentication model, enabling more effective extraction and recognition of authentication features in the images. The authentication results of the two combinations are fused to obtain the card authentication result, reducing the possibility of misidentification and missed identification, and improving the efficiency and accuracy of card authentication.

[0151] This application also provides another embodiment, namely, providing a computer-readable storage medium storing computer-readable instructions that can be executed by at least one processor to cause the at least one processor to perform the steps of the card authentication method described above.

[0152] In this embodiment, the video of the card is captured from a preset angle under a preset lighting change mode, avoiding the need for the user to adjust the shooting angle multiple times and improving the user experience. A preset frame selection algorithm is used to select a first image under standard lighting and two images under flash lighting from the video of the card, ensuring the quality of the selected images. This facilitates the capture of the visual features of the card under different lighting conditions and the acquisition of more information, ensuring the accuracy of subsequent image processing. The first image and the second image are combined to obtain a first image combination, and the first image and the third image are combined to obtain a second image combination. The first image combination and the second image combination are then input into the card authentication model, enabling more effective extraction and recognition of authentication features in the images. The authentication results of the two combinations are fused to obtain the card authentication result, reducing the possibility of misidentification and missed identification, and improving the efficiency and accuracy of card authentication.

[0153] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0154] Obviously, the embodiments described above are only some embodiments of this application, not all embodiments. The accompanying drawings show preferred embodiments of this application, but do not limit the patent scope of this application. This application can be implemented in many different forms; rather, the purpose of providing these embodiments is to provide a more thorough and comprehensive understanding of the disclosure of this application. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing specific embodiments, or make equivalent substitutions for some of the technical features. Any equivalent structures made using the content of this application's specification and drawings, directly or indirectly applied to other related technical fields, are similarly within the scope of patent protection of this application.

Claims

1. A card authentication method, characterized by, Includes the following steps: Under the preset lighting change mode, capture video of the card from a preset angle; Using a preset frame selection algorithm, the first image under standard lighting and the second and third images under flash lighting are selected from the video of the card; The first image is combined with the second image to obtain a first image combination, and the first image is combined with the third image to obtain a second image combination; The first image combination is input into the card authentication model to obtain the first authentication result, and the second image combination is input into the card authentication model to obtain the second authentication result. Generate the card authentication result of the card based on the first authentication result and the second authentication result; The step of selecting the first image under standard lighting and the second and third images under flash lighting from the card video using a preset frame selection algorithm includes: Each frame of the video of the card is converted to grayscale to obtain a grayscale image of each frame. Each grayscale image is cropped to obtain the target image in each grayscale image; Target images whose grayscale values ​​meet the grayscale value conditions are filtered to obtain multiple first target images; The first target image whose sharpness meets the sharpness criteria is selected to obtain multiple candidate images; One candidate image under standard lighting is selected as the first image, and two candidate images under flash lighting are selected as the second and third images, respectively. The step of selecting a first target image whose sharpness meets the sharpness condition to obtain multiple candidate images includes: For each first target image, perform a Fourier transform on the first target image to obtain the power spectrum of the first target image; The power spectrum is subjected to spectral center swapping to obtain a second target image; Perform an inverse Fourier transform on the second target image to obtain the third target image; The third target image is obtained by setting the center region to zero according to the preset region size, and the average pixel value of the fourth target image is calculated. When the average pixel value is greater than a preset average value threshold, the first target image is determined to meet the sharpness condition, and the first target image is used as a candidate image. Prior to the step of setting the center region of the third target image to zero according to a preset region size to obtain the fourth target image, the method further includes: Obtain a dataset containing multiple clear images and multiple blurry images; For each candidate region size, calculate the average pixel value of all images in the dataset; Among the pixel averages of all clear images, the minimum pixel average is selected as the candidate average threshold. Based on the candidate average threshold, the recognition accuracy of each blurred image is calculated according to the pixel average value and label of each blurred image; Select the candidate region size corresponding to the maximum recognition accuracy and its corresponding candidate average threshold, and use them as the region size and average threshold when applying the application, respectively. Among them, the power spectrum is subjected to spectral center swapping, which involves exchanging the center and edge parts of the spectrum. This process rearranges the frequency components so that the low-frequency components are located in the central region of the image.

2. The card authentication method according to claim 1, wherein The step of capturing video of the card from a preset angle under a preset lighting change mode includes: Turn on the flash and record a video of the card from a preset angle under the flash illumination; The flash is turned off, and video recording of the card is continued from the preset angle under standard lighting to obtain the card video.

3. The card authentication method according to claim 1, wherein The step of inputting the first image combination into the card authentication model to obtain the first authentication result includes: The first image combination is input into the card authentication model for feature extraction to obtain the first authentication feature vector of the first image and the second authentication feature vector of the second image. The first and second anti-spoofing feature vectors are combined to obtain a combined anti-spoofing feature vector. The combined anti-counterfeiting feature vector is input into the classifier in the card and document anti-counterfeiting model to obtain the first anti-counterfeiting result.

4. The card authentication method according to claim 1, wherein The step of generating the card authentication result of the card based on the first authentication result and the second authentication result includes: When both the first authentication result and the second authentication result show that the card is genuine, a card authentication result indicating that the card is genuine is generated. If neither the first authentication result nor the second authentication result indicates that the card is genuine, an authentication result indicating that the card is fake is generated.

5. A card authentication device, characterized by comprising: include: The video capture module is used to capture video of the card from a preset angle under a preset lighting change mode; The image selection module is used to select a first image under standard lighting and a second and third image under flash lighting from the card video using a preset frame selection algorithm. An image combination module is used to combine the first image and the second image to obtain a first image combination, and to combine the first image and the third image to obtain a second image combination; The combined input module is used to input the first image into the card authentication model to obtain a first authentication result, and to input the second image into the card authentication model to obtain a second authentication result. The result generation module is used to generate the card authentication result of the card based on the first authentication result and the second authentication result. The image selection module includes: The grayscale processing submodule is used to perform grayscale processing on each frame of the video to obtain the grayscale image of each frame. The image cropping submodule is used to crop each grayscale image to obtain the target image in each grayscale image; The grayscale filtering submodule is used to filter target images whose grayscale values ​​meet the grayscale value conditions, and obtain multiple first target images; The clarity filtering submodule is used to filter the first target image whose clarity meets the clarity criteria, and obtain multiple candidate images; The candidate selection submodule is used to select one candidate image under standard lighting as the first image, and select two candidate images under flash lighting as the second and third images, respectively. The Clear Filtering submodule includes: The Fourier transform unit is used to perform a Fourier transform on each first target image to obtain the power spectrum of the first target image. The central exchange unit is used to perform spectrum center exchange on the power spectrum to obtain a second target image; The inverse transform unit is used to perform an inverse Fourier transform on the second target image to obtain the third target image; The center zeroing unit is used to zero out the center region of the third target image according to the preset region size to obtain the fourth target image, and to calculate the average pixel value of the fourth target image; The sharpness determination unit is used to determine that the first target image meets the sharpness condition when the average pixel value is greater than a preset average value threshold, and to use the first target image as a candidate image. The Clear Filtering submodule also includes: The dataset acquisition unit is used to acquire a dataset containing multiple clear images and multiple blurry images; The averaging unit is used to calculate the average pixel value of all images in the dataset for each candidate region size. The minimum selection unit is used to select the minimum pixel average value among the pixel average values ​​of each clear image as the candidate average value threshold. The accuracy calculation unit is used to calculate the recognition accuracy of each blurred image based on the candidate average threshold, the pixel average value of each blurred image and its label; The maximum selection unit is used to select the candidate region size corresponding to the maximum recognition accuracy and its corresponding candidate average threshold, which are used as the region size and average threshold when applied. Among them, the power spectrum is subjected to spectral center swapping, which involves exchanging the center and edge parts of the spectrum. This process rearranges the frequency components so that the low-frequency components are located in the central region of the image.

6. A computer device comprising a memory and a processor, wherein the memory stores computer-readable instructions, and the processor, when executing the computer-readable instructions, implements the steps of the card authentication method as described in any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the steps of the card authentication method as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Anti-counterfeit detection method and device, electronic device, and storage medium

    CN109359502A

  • Infrared image quality evaluation method and infrared equipment detection method using same

    CN117710298A

  • Mobile terminal card authentic identification method, device, equipment and medium

    CN118097385A