Card light spot detection method, device and equipment and storage medium
Through the card certificate spot detection model, the card certificate is predicted by multi-modal area, and the proportion of the spot area is identified and calculated, which solves the problem of low error identification and detection accuracy in the existing technology, and achieves more efficient and accurate card certificate spot detection.
Patent Information
- Application Number
- CN202411540393.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2025-03-14
AI Technical Summary
The existing card-certified spot detection methods cannot effectively distinguish the reflection of color-changing ink from spots, and there is a false recognition phenomenon, and the detection accuracy is low when high-reflective objects or non-white light sources exist.
By obtaining the feature vector of the target card certificate, and using the card certificate spot detection model to predict multi-modal area, identifying the card certificate area, spot area, color-changing ink reflective area and high-brightness area, and calculating the proportion of the spot area to improve detection accuracy.
It improves the accuracy of card certificate spot detection, enhances the anti-counterfeiting feature detection capabilities under complex lighting conditions, improves the efficiency and automation level of card certificate verification process, and ensures stronger adaptability and robustness in different scenarios.
Smart Images

Figure CN119625250A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image recognition technology, which is applied to the field of financial technology business, and in particular to a card light spot detection method, a card light spot detection device, a computer device and a computer-readable storage medium. Background Art
[0002] As a pre-quality detection module of the card identification algorithm, the card spot detection algorithm has been widely used by various financial-related companies in digital human card identification technology. In related technologies, card spot detection is mainly achieved through the following two methods: one is an algorithm based on traditional optical calculation, which determines whether there is a light spot by calculating the brightness value of the image; the other is a solution based on deep learning, which uses a segmentation-like algorithm to find the high-brightness area and then determine whether there is a light spot.
[0003] However, the card light spot detection method of the related technology has the following defects: first, it is impossible to distinguish the reflection of the color-changing ink from the light spot, and there are a lot of misidentification phenomena; second, if there are some highly reflective objects in the background of the card during the detection process, they are easily mistaken for the light spot of the card and cause misjudgment; third, the detection rate of the reflected light spot generated by non-white light sources is relatively low. Summary of the invention
[0004] The present application provides a card light spot detection method, a card light spot detection device, a computer device and a computer-readable storage medium, which aim to realize the light spot detection of the target card through the card light spot detection model, and then obtain the proportion of the light spot area corresponding to the target card with relatively accurate results.
[0005] To achieve the above purpose, the present application also provides a card spot detection method, comprising:
[0006] Acquire a target card, and perform feature extraction on the target card to obtain a target feature vector corresponding to the target card;
[0007] Performing multimodal area prediction on the target card through the card light spot detection model to obtain multiple initial areas of the target card, wherein the initial areas include the card area, the light spot area, the color-changing ink reflective area and the high-brightness area;
[0008] The proportion of the light spot area corresponding to the target card is determined based on the multiple initial areas.
[0009] To achieve the above purpose, the present application also provides a card spot detection device, including:
[0010] An acquisition module is used to acquire a target card and perform feature extraction on the target card to obtain a target feature vector corresponding to the target card;
[0011] A prediction module, used for performing multimodal area prediction on the target card through a card light spot detection model to obtain a plurality of initial areas of the target card, wherein the initial areas include a card area, a light spot area, a color-changing ink reflective area, and a high-brightness area;
[0012] The detection module is used to determine the proportion of the light spot area corresponding to the target card based on the multiple initial areas.
[0013] In addition, to achieve the above-mentioned purpose, the present application also provides a computer device, which includes a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and implement the steps of any one of the card spot detection methods provided in the embodiments of the present application when executing the computer program.
[0014] In addition, to achieve the above-mentioned purpose, the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the processor implements the steps of the card spot detection method provided in any one of the embodiments of the present application.
[0015] The card spot detection method, card spot detection device, computer equipment and computer-readable storage medium disclosed in the embodiment of the present application. The method includes obtaining a target card, extracting features of the target card, and obtaining a target feature vector corresponding to the target card; performing multimodal region prediction on the target card through a card spot detection model to obtain multiple initial regions of the target card, wherein the initial region includes a card region, a spot region, a color-changing ink reflection region and a high-brightness region; and determining the proportion of the spot region corresponding to the target card based on the multiple initial regions. The embodiment of the present application can accurately identify multiple initial regions of the card, including the spot, the color-changing ink reflection and the high-brightness region, through the multimodal region prediction technology. Based on the identification of these regions and the calculation of the spot proportion, not only the accuracy of the card spot detection method is improved, but also the anti-counterfeiting feature detection capability under complex lighting conditions is enhanced. In addition, the method greatly improves the efficiency and automation level of the card verification process, ensuring stronger adaptability and robustness in different scenarios, especially maintaining the stability of the recognition performance under the influence of highlights and reflections. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0017] Figure 1 This is a scene schematic diagram of a card spot detection method provided in an embodiment of the present application;
[0018] Figure 2 It is a flow chart of a card spot detection method provided in an embodiment of the present application;
[0019] Figure 3 It is a flow chart of obtaining a card spot detection model provided in an embodiment of the present application.
[0020] Figure 4 is a schematic block diagram of a card spot detection device provided in an embodiment of the present application;
[0021] Figure 5 It is a schematic block diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0022] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0023] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor do they have to be executed in the order described. For example, some operations / steps can also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions. In addition, although the functional modules are divided in the device schematic, in some cases, the module division can be different from that in the device schematic.
[0024] The term "and / or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0025] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0026] like Figure 1 As shown, the card spot detection method provided in the embodiment of the present application can be applied to Figure 1In the application environment shown. The application environment includes a terminal device 110 and a server 120, wherein the terminal device 110 can communicate with the server 120 through a network. Specifically, the server 120 can obtain a target card, and extract features of the target card to obtain a target feature vector corresponding to the target card; perform multimodal area prediction on the target card through a card spot detection model to obtain multiple initial areas of the target card, wherein the initial area includes a card area, a spot area, a color-changing ink reflective area, and a high-brightness area; determine the proportion of the spot area corresponding to the target card based on the multiple initial areas, and then send the proportion of the spot area corresponding to the target card to the terminal device 110. Among them, the server 120 can be an independent server, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. The terminal device 110 may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto. The terminal and the server may be directly or indirectly connected via wired or wireless communication, and this application does not limit this.
[0027] See also Figure 2 , Figure 2 FIG. 1 is a flow chart of a card spot detection method provided in an embodiment of the present application. Figure 2 As shown, the card spot detection method can be implemented through steps S11 to S13.
[0028] Step S11: Acquire a target card, and perform feature extraction on the target card to obtain a target feature vector corresponding to the target card.
[0029] For example, the image of the target card can be captured by scanning, taking a photo or video. After the image of the target card is acquired, the target feature vector of the target card, such as the shape, color, text information, and other visual features of the card, can be extracted by a feature extraction algorithm (such as a convolutional neural network or other image processing algorithm). These features can describe the global information or local information of the card.
[0030] It should be noted that the target feature vector can be used to represent the main features of the target card image and can be used for subsequent analysis and model prediction.
[0031] Step S12: Perform multimodal region prediction on the target card through the card spot detection model to obtain multiple initial regions of the target card.
[0032] For example, the card spot detection model is used to detect the spot area in the image, which is usually a highlight area caused by reflection or uneven lighting during shooting. The spot detection model can be a deep learning model, such as a convolutional neural network, etc., which is not limited in this application, so that different brightness or reflection areas in the image can be identified.
[0033] It should be noted that the multimodality in multimodal region prediction refers to the comprehensive use of different features (such as color, brightness, texture, etc.). Through the card spot detection model, multiple areas where spots may exist in the target card image can be predicted.
[0034] For example, the output of the card light spot detection model is the coordinates or masks of several initial regions in the target card image. For example, the initial region may be a candidate region where the light spot may exist, which can be used for subsequent analysis.
[0035] Step S13: Determine the proportion of the light spot area corresponding to the target card based on the multiple initial areas.
[0036] For example, the area of the light spot region can be calculated by image processing technology, and then these areas can be compared with the area of the entire card image to obtain the ratio of the light spot region to the total card area. This ratio can be used as a quality assessment indicator for light spot detection or for subsequent processing.
[0037] The above implementation method can detect the spot area of the target card and extract relevant feature information by processing and analyzing the target to ensure the validity of the target card or the quality of the image. This can be applied to scenarios such as automated identity authentication or bank card image processing in financial business scenarios.
[0038] The card spot detection method, card spot detection device, computer equipment and computer-readable storage medium disclosed in the embodiment of the present application. The method includes obtaining a target card, extracting features of the target card, and obtaining a target feature vector corresponding to the target card; performing multimodal region prediction on the target card through a card spot detection model to obtain multiple initial regions of the target card, wherein the initial region includes a card region, a spot region, a color-changing ink reflection region and a high-brightness region; and determining the proportion of the spot region corresponding to the target card based on the multiple initial regions. The embodiment of the present application can accurately identify multiple initial regions of the card, including the spot, the color-changing ink reflection and the high-brightness region, through the multimodal region prediction technology. Based on the identification of these regions and the calculation of the spot proportion, not only the accuracy of the card spot detection method is improved, but also the anti-counterfeiting feature detection capability under complex lighting conditions is enhanced. In addition, the method greatly improves the efficiency and automation level of the card verification process, ensuring stronger adaptability and robustness in different scenarios, especially maintaining the stability of the recognition performance under the influence of highlights and reflections.
[0039] See also Figure 3 , Figure 3 FIG. 1 is a flow chart of obtaining a card spot detection model provided by an embodiment of the present application. Figure 3 As shown, the card spot detection model can be obtained through steps S21 to S23.
[0040] Step S21: Obtain training data.
[0041] The training data includes card data of several scenarios.
[0042] Furthermore, card data refers to images or scanned data of various cards and certificates with identity information or anti-counterfeiting information. Card data can include the following: identity documents such as ID cards and driver's licenses; financial cards such as credit cards and debit cards; and scene-specific cards such as passes and work permits.
[0043] For example, card data can be collected from multiple scenes for subsequent model training. The data sources can include card images taken under different shooting conditions, such as card images taken under different lighting, angles, and resolutions, thereby ensuring that the collected data is sufficiently diverse and representative.
[0044] Step S22: labeling the training data to obtain labeled data.
[0045] For example, after the training data is collected, the training data may be annotated, for example, by marking specific areas or features involved in the card data by a system or manually to generate annotated data.
[0046] The annotation data includes color-changing ink reflection data and light spot data.
[0047] It should be noted that color-changing ink is a common anti-counterfeiting technology on cards. The color of the ink will change significantly with changes in angle and light. In order to train the model to recognize this type of anti-counterfeiting feature, the annotation data needs to accurately mark the reflective area of the color-changing ink and provide the specific location and optical characteristics of the reflection.
[0048] Furthermore, the spot data is used to characterize the reflective spots or spots formed on the card surface under specific lighting conditions. These spots can be formed due to the smooth material or other optical characteristics of the card surface. The annotation of the spot data needs to accurately mark the size, position, shape and other characteristics of the spot, so that the model can handle these interference information under complex lighting conditions.
[0049] The above implementation method can better extract the anti-counterfeiting information on the card by annotating the color-changing ink reflection data and the light spot data. These annotated data can be used to train the model so that it can automatically identify the card in practical applications and deal with image feature interference in different scenarios.
[0050] Step S23: Train the initial deep learning model based on the training data and the labeled data to obtain a card spot detection model.
[0051] Among them, the card light spot detection model is used to perform multimodal area prediction on the target card and obtain multiple initial areas of the target card. The initial areas include the card area, the light spot area, the color-changing ink reflective area and the high-brightness area. The card light spot detection model is also used to obtain the proportion of the light spot area based on multiple initial areas.
[0052] For example, the card training data obtained in step S21 and the annotated data generated in step S22 can be used to train the initial deep learning model. The initial deep learning model can be a pre-designed neural network architecture, such as a network structure related to image processing, such as a convolutional neural network. Specifically, the card data in the training data can be used as input, and the annotated data can be used as labels. The initial deep learning model is iteratively optimized so that the model can learn different features in the card image and their corresponding areas. During the training process, the model can gradually learn how to classify and segment the card according to its image features, such as how to identify the main area, light spot area, and color-changing ink reflective area of the card. After multiple rounds of training and verification, the initial deep learning model will converge and generate an optimized model, namely the card light spot detection model. The card light spot detection model can be applied to the target card to achieve accurate recognition and segmentation of the card area.
[0053] For example, after training, the card spot detection model has the ability to predict multiple regions in a multi-modal manner. Multi-modal region prediction means that the model can simultaneously predict multiple types of regions based on different features in the image (such as optical features, anti-counterfeiting features, etc.). In actual application, the card spot detection model will make the following regional predictions for the target card: Card area, which is the main area of the target card. The model needs to accurately identify the outline of the card, eliminate background interference, and determine the core area of the document. Spot area, the model will predict the reflective spot area that may exist on the surface of the document based on the spot data learned during the training process, which is usually a bright spot or reflection point caused by light exposure. Color-changing ink reflective area, the model identifies the area on the document where color-changing ink is used through the color-changing ink reflective features learned during the training process. This type of area will show different colors as the light changes, which is a common anti-counterfeiting feature; high brightness area, the area on the target card that is brighter than the ordinary area, shows higher brightness than other areas due to material or optical properties, and the model will also mark these areas by identifying changes in image brightness.
[0054] For example, after the card light spot detection model identifies multiple initial areas (such as the card area, light spot area, color-changing ink reflective area, etc.), it will also calculate the proportion of the light spot area in the entire card image. Among them, the proportion of the light spot area can be used to analyze the quality of the card image or evaluate the impact of light on image recognition. If the proportion of the light spot area is too high, it may affect the model's correct recognition of other areas (such as the color-changing ink reflective area).
[0055] In the above embodiments, the card spot detection model can not only segment and identify multiple areas of the card, but also further calculate the proportion of the spot area, providing more accurate information for subsequent card verification and anti-counterfeiting identification. This multimodal prediction and proportion calculation helps to improve the reliability and accuracy of card recognition, especially under complex lighting conditions or multiple interferences, and can still accurately capture the anti-counterfeiting features on the card.
[0056] Optionally, after obtaining the training data, it also includes: performing augmentation processing on the training data to obtain augmented training data, wherein the augmentation processing includes brightness augmentation and color cast augmentation; labeling the training data to obtain labeled data, including: labeling the augmented training data to obtain labeled data.
[0057] Brightness augmentation refers to changing the brightness of an image so that the training data covers situations in different brightness environments. For example, the image can be brighter or darker to simulate different lighting conditions. This processing helps the model to correctly identify and process targets when facing changes in lighting conditions.
[0058] Color cast augmentation is used to change the color of an image by adjusting the color shift of the image. For example, increasing or decreasing the intensity of a color channel causes the image to have a reddish, bluish, or greenish effect. This operation helps the enhanced model to accurately process color-changing data when facing different camera devices or environmental conditions.
[0059] It should be understood that the training data after augmentation will be more diverse than the original data, thereby improving the training effect and generalization ability of the model. Furthermore, for each augmented data, its specific target area must be re-labeled, and the labeled data still includes key features, such as color-changing ink reflection data and light spot data.
[0060] The above embodiments can make the training data more diverse after brightness and color cast augmentation, and annotate these data to provide the model with feature information under different lighting and color conditions, thereby improving the recognition accuracy and stability of the model.
[0061] Optionally, the card spot detection model is also used to obtain the proportion of the spot area through the following formula:
[0062]
[0063] Among them, fth is the binarization function, Sthresh is the confidence threshold of the spot area, and Cthresh is the confidence threshold of the card area; C mask S is the card area; mask is the light spot area; I mask B is the reflective area of the color-changing ink; mask High brightness area.
[0064] In the embodiment of the present application, the proportion of the light spot area can be obtained by the above formula, thereby improving the accuracy of the card light spot detection method.
[0065] Optionally, an initial deep learning model is trained based on the training data and the labeled data to obtain a card light spot detection model, including: in response to the training data coming from the video stream, the training data and the labeled data are spliced on the timeline to obtain the spliced labeled results; based on the training data and the spliced labeled results, the initial deep learning model is trained to obtain the card light spot detection model.
[0066] For example, if the training data comes from a video stream, the training data and the labeled data need to be spliced on the timeline to generate continuous labeling results. For example, the dynamic changes of the scene and the association of target features at different time points can be captured by connecting the data in the video frame in a time series. Afterwards, the initial deep learning model is trained based on the spliced labeling results and the original training data, and the learning ability of the model is enhanced by using the information on the time series, and finally a more accurate and robust card spot detection model is obtained, which can better handle multimodal area prediction tasks in video scenes.
[0067] Optionally, after obtaining the card light spot detection model, it also includes: iteratively training the card light spot detection model to extract data features and calculate the loss function; iteratively training the loss function with the purpose of reducing the value of the loss function using a preset method until the expected threshold requirement is met; based on the loss function after iterative training, obtaining the iterative card light spot detection model.
[0068] It can be understood that in order to train a card light spot detection model with higher accuracy, the card light spot detection model can be repeatedly iterated to continuously reduce the loss function until the loss function meets the expected threshold requirement, and then a more accurate detection result can be obtained based on the iterated card light spot detection model.
[0069] It should be noted that the present application does not limit the above-mentioned preset method and expected threshold. For example, the preset method may be a gradient descent algorithm, a batch gradient descent algorithm, a stochastic gradient descent algorithm, etc. The present application takes the gradient descent algorithm as an example for explanation.
[0070] The purpose of the gradient descent algorithm is to find the minimum value of the loss function through iteration, or to converge to the minimum value. In a geometric sense, the gradient descent algorithm means that the gradient decreases fastest in the direction opposite to the vector where the function changes the fastest, so it is easier to find the minimum value of the function. Based on this, in the embodiment of the present application, the card spot detection model can be repeatedly iterated and trained by the gradient descent algorithm so that the loss function is continuously reduced, thereby reducing the error of the calculation result.
[0071] In the embodiment of the present application, the denoising model is repeatedly iteratively trained using a gradient descent algorithm so that the loss function is continuously reduced to obtain an iterative card light spot detection model, and then a more accurate detection result can be obtained based on the iterative card light spot detection model.
[0072] Optionally, the card light spot detection model also includes a self-attention model, which is used to extract features of the target card to obtain the feature vector with the highest weight in the target card. The card light spot detection model is used to analyze the feature vector to obtain the proportion of the light spot area.
[0073] Optionally, after the initial deep learning model is trained based on the training data and the labeled data to obtain the card light spot detection model, it also includes: deploying the card light spot detection model to a preset platform so that the user can scan the target card based on the preset platform and obtain the proportion of the light spot area corresponding to the target card.
[0074] For example, the trained card light spot detection model can be deployed on a preset platform (such as a cloud platform, server or mobile device), which can provide users with an interface where they can scan target cards. The platform processes these scanned target cards through the card light spot detection model.
[0075] For example, a user scans a target card on a preset platform, and the target card is converted into a feature vector understandable by the model by the platform and processed by the card spot detection model. The card spot detection model can perform detection based on the target card to obtain the corresponding detection result.
[0076] The above method can successfully apply the card spot detection model to the task of the card spot detection method, and by deploying it on the platform, users can easily use this technology to improve the results of the card spot detection method.
[0077] See also Figure 4 , Figure 4 1 is a schematic block diagram of a card light spot detection device provided in an embodiment of the present application. The card light spot detection device can be configured in a server to execute the aforementioned card light spot detection method.
[0078] like Figure 4 As shown, the card light spot detection device 200 includes: an acquisition module 201 , a prediction module 202 and a detection module 203 .
[0079] The acquisition module 201 is used to acquire a target card and perform feature extraction on the target card to obtain a target feature vector corresponding to the target card;
[0080] The prediction module 202 is used to perform multimodal area prediction on the target card through the card light spot detection model to obtain multiple initial areas of the target card, wherein the initial areas include the card area, the light spot area, the color-changing ink reflective area and the high-brightness area;
[0081] The detection module 203 is used to determine the proportion of the light spot area corresponding to the target card based on the multiple initial areas.
[0082] The acquisition module 201 is also used to acquire training data, wherein the training data includes card data of several scenes; annotate the training data to obtain annotated data, wherein the annotated data includes color-changing ink reflection data and light spot data; and train the initial deep learning model based on the training data and the annotated data to obtain the card light spot detection model.
[0083] The acquisition module 201 is further used to perform augmentation processing on the training data to obtain augmented training data, wherein the augmentation processing includes brightness augmentation and color cast augmentation; the labeling module 202 is used to label the augmented training data to obtain the labeled data.
[0084] The acquisition module 201 is also used to, in response to the training data being derived from a video stream, splice the training data and the annotation data on a time axis to obtain a spliced annotation result; train the initial deep learning model based on the training data and the spliced annotation result to obtain the card spot detection model.
[0085] The acquisition module 201 is also used to iteratively train the card light spot detection model to extract data features and calculate the loss function; iteratively train the loss function using a preset method for the purpose of reducing the value of the loss function until the expected threshold requirement is met; based on the loss function after iterative training, the iterative card light spot detection model is obtained.
[0086] The acquisition module 201 is further used to deploy the card light spot detection model to a preset platform, so that the user can scan the target card based on the preset platform and obtain the proportion of the light spot area corresponding to the target card.
[0087] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0088] The method and apparatus of the present application can be used in many general or special computing system environments or configurations, such as personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer terminal devices, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices.
[0089] Exemplarily, the above method and apparatus may be implemented in the form of a computer program. The computer program may be implemented in the form of a computer program. Figure 4 Runs on the computer device shown.
[0090] See also Figure 4 , Figure 4 1 is a schematic diagram of a computer device provided in an embodiment of the present application. The computer device may be a server.
[0091] like Figure 4 As shown, the computer device includes a processor, a memory and a network interface connected through a system bus, wherein the memory may include a volatile storage medium, a non-volatile storage medium and an internal memory.
[0092] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions, and when the program instructions are executed, the processor can execute any card light spot detection method.
[0093] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.
[0094] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any card light spot detection method.
[0095] The network interface is used for network communication, such as sending assigned tasks, etc. Those skilled in the art can understand that the structure of the computer device is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0096] It should be understood that the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0097] Among them, in some embodiments, the processor is used to obtain a target card and perform feature extraction on the target card to obtain a target feature vector corresponding to the target card; perform multimodal area prediction on the target card through a card light spot detection model to obtain multiple initial areas of the target card, wherein the initial area includes a card area, a light spot area, a color-changing ink reflective area, and a high-brightness area; based on the multiple initial areas, determine the proportion of the light spot area corresponding to the target card.
[0098] In some embodiments, the processor is used to obtain training data, wherein the training data includes card data of several scenes; annotate the training data to obtain annotated data, wherein the annotated data includes color-changing ink reflection data and light spot data; train an initial deep learning model based on the training data and the annotated data to obtain a card light spot detection model, wherein the card light spot detection model is used to perform multimodal area prediction on a target card and obtain multiple initial areas of the target card, wherein the initial area includes a card area, a light spot area, a color-changing ink reflection area, and a high-brightness area, and the card light spot detection model is also used to obtain a proportion of the light spot area based on the multiple initial areas.
[0099] In some embodiments, the processor is further used to perform augmentation processing on the training data to obtain augmented training data, wherein the augmentation processing includes brightness augmentation and color cast augmentation; and annotate the augmented training data to obtain the annotated data.
[0100] In some embodiments, the processor is also used to, in response to the training data being derived from a video stream, splice the training data and the annotation data on a timeline to obtain a spliced annotation result; and train the initial deep learning model based on the training data and the spliced annotation result to obtain the card spot detection model.
[0101] In some embodiments, the processor is also used to iteratively train the card light spot detection model to extract data features and calculate a loss function; iteratively train the loss function using a preset method for the purpose of reducing the value of the loss function until the expected threshold requirement is met; based on the iteratively trained loss function, obtain the iterative card light spot detection model.
[0102] In some implementations, the processor is further configured to deploy the card light spot detection model to a preset platform, so that a user can scan the target card based on the preset platform and obtain a proportion of the light spot area corresponding to the target card.
[0103] The embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. The computer program includes program instructions, and when the program instructions are executed, any card spot detection method provided in the embodiment of the present application is implemented.
[0104] The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiment, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc., equipped on the computer device.
[0105] Furthermore, the computer-readable storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function, and the like.
[0106] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A card spot detection method, characterized in that: The method comprises: Acquire a target card, and perform feature extraction on the target card to obtain a target feature vector corresponding to the target card; Performing multimodal area prediction on the target card through the card light spot detection model to obtain multiple initial areas of the target card, wherein the initial areas include the card area, the light spot area, the color-changing ink reflective area and the high-brightness area; The proportion of the light spot area corresponding to the target card is determined based on the multiple initial areas.
2. The method according to claim 1, characterized in that The card spot detection model is obtained by the following method: Acquire training data, wherein the training data includes card data of several scenarios; Annotating the training data to obtain annotated data, wherein the annotated data includes color-changing ink reflection data and light spot data; The initial deep learning model is trained based on the training data and the labeled data to obtain the card light spot detection model.
3. The method according to claim 2, characterized in that After obtaining the training data, the method further includes: Performing augmentation processing on the training data to obtain augmented training data, wherein the augmentation processing includes brightness augmentation and color cast augmentation; The step of labeling the training data to obtain labeled data includes: The augmented training data is labeled to obtain the labeled data.
4. The method according to claim 2, characterized in that: The initial deep learning model is trained based on the training data and the annotated data to obtain the card spot detection model, including: In response to the training data being derived from a video stream, the training data and the annotation data are spliced on a time axis to obtain a spliced annotation result; The initial deep learning model is trained based on the training data and the spliced annotation results to obtain the card spot detection model.
5. The method according to claim 4, characterized in that After obtaining the card spot detection model, the method further includes: Iteratively training the card spot detection model to extract data features, and calculate the loss function; Iteratively training the loss function using a preset method for the purpose of reducing the value of the loss function until the expected threshold value is met; Based on the loss function after iterative training, the card spot detection model after iteration is obtained.
6. The method according to claim 2, characterized in that The card light spot detection model also includes a self-attention model, which is used to extract features from the target card to obtain the feature vector with the highest weight in the target card. The card light spot detection model is used to analyze the feature vector to obtain the proportion of the light spot area.
7. The method according to claim 2, characterized in that After the initial deep learning model is trained based on the training data and the annotated data to obtain the card spot detection model, the method further includes: The card light spot detection model is deployed to a preset platform, so that a user can scan the target card based on the preset platform and obtain the proportion of the light spot area corresponding to the target card.
8. A card spot detection device, characterized in that: The card spot detection device comprises: An acquisition module is used to acquire a target card and perform feature extraction on the target card to obtain a target feature vector corresponding to the target card; A prediction module, used for performing multimodal area prediction on the target card through a card light spot detection model to obtain a plurality of initial areas of the target card, wherein the initial areas include a card area, a light spot area, a color-changing ink reflective area, and a high-brightness area; The detection module is used to determine the proportion of the light spot area corresponding to the target card based on the multiple initial areas.
9. A computer device, characterized in that: include: A memory and a processor; wherein the memory is connected to the processor and is used to store a program; the processor is used to implement the steps of the card spot detection method according to any one of claims 1 to 7 by running the program stored in the memory.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the steps of the card light spot detection method according to any one of claims 1 to 7.