Electronic certificate photo compliance detection method and system

By using externally configured centralized management and multi-dimensional image analysis, the problems of insufficient flexibility and intelligent detection in existing technologies have been solved, realizing automated and intelligent detection of electronic ID photos, improving detection efficiency and accuracy, and reducing the pressure of manual review.

CN121582940APending Publication Date: 2026-02-27GUIZHOU JIUYUAN YINHAI SOFTWARE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511678066.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-17
Publication Date
2026-02-27

AI Technical Summary

Technical Problem

Existing technologies lack flexibility in electronic ID photo verification, making it difficult to quickly adapt to diverse and dynamically changing business standards. Furthermore, they lack in-depth intelligent analysis of photo content, increasing the burden of manual review and affecting the accuracy of identity verification.

Method used

By configuring centralized management verification rules externally, and combining multi-dimensional image analysis and pre-trained models, automated and intelligent ID photo detection is achieved. It supports dynamic configuration and service restart without needing to restart, and integrates multi-dimensional detection such as size, number of faces, and clarity to generate compliance detection results.

Benefits of technology

It enhances the flexibility and maintainability of the detection system, achieves comprehensive automated detection from format to content, replaces manual screening, ensures data quality and verification security, and improves detection efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121582940A_ABST
    Figure CN121582940A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an electronic certificate photo compliance detection method and system, and belongs to the technical field of certificate photo detection. The method comprises the following steps: receiving electronic certificate photo data sent by a service system, and analyzing the electronic certificate photo data based on a file byte stream to obtain original image data; loading a verification rule and a threshold parameter from the external configuration file; and performing compliance detection on the original image data to obtain a multi-dimensional image detection result, generating a compliance detection result of the certificate photo according to the multi-dimensional image detection result, and returning the compliance detection result to the business system to complete compliance detection. According to the invention, the verification rule is managed in a centralized manner through external configuration, so that the detection standard can dynamically adapt to the policy change without restarting the service, and the flexibility and maintainability are remarkably improved. Multi-dimensional intelligent analysis of size, face, definition and the like is performed on image data, and comprehensive automatic detection from format to content is realized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of ID photo detection, and in particular to an electronic ID photo compliance detection method and system. BACKGROUND

[0002] In current online business (such as ID application) handling, the compliance verification of electronic ID photos is a key link to ensure business safety and efficiency. However, existing technical solutions often show certain limitations when facing diversified and dynamically changing business specifications. Most systems rely on fixed verification logic, which is difficult to quickly adapt to subtle standard differences in different scenarios. The adjustment process often involves complex code modification and system restart, and the flexibility and timeliness need to be improved. At the same time, traditional detection dimensions are mostly focused on basic file attributes, and there is a lack of in-depth and integrated intelligent analysis capability for the quality of photo content itself, which not only increases the pressure of manual review, but also may affect the accuracy of subsequent identity verification. SUMMARY

[0003] The purpose of the present application is to provide an electronic ID photo compliance detection method and system for automatically and intelligently detecting the compliance of user-uploaded ID photos in the online application process of social security cards and other electronic IDs.

[0004] To achieve the above purpose, the present application provides an electronic ID photo compliance detection method, comprising: receiving electronic ID photo data sent by a business system, and based on file byte stream analysis of the electronic ID photo data, obtaining original image data; loading verification rules and threshold parameters from an external configuration file; based on the verification rules and the threshold parameters, performing compliance detection on the original image data to obtain multi-dimensional image detection results, the compliance detection including size detection, face number detection, head proportion calculation, sharpness evaluation, and background purity analysis; generating a compliance detection result of the ID photo according to the multi-dimensional image detection results, and returning the compliance detection result to the business system.

[0005] Optionally, the file byte stream analysis of the electronic ID photo data comprises: analyzing the byte stream length of the electronic ID photo data to obtain the image file size; calling an image processing library to decode the byte stream to generate original image data available for pixel-level operation; and obtaining the width value and height value of the original image data.

[0006] Optionally, the loading of the check rules and threshold parameters from the externalized configuration file comprises: before performing each compliance detection on the electronic certificate photo, reading a current modification timestamp of the externalized configuration file and comparing it with a historical timestamp corresponding to the configuration cache maintained locally by the detection system; if the current modification timestamp is inconsistent with the historical timestamp, re-reading the check rules and threshold parameters in the externalized configuration file, updating to the configuration cache and synchronously updating the historical timestamp; if the current modification timestamp is consistent with the historical timestamp, reusing the check rules and threshold parameters in the configuration cache, so as to realize hot reloading of the configuration rules.

[0007] Optionally, the performing of the compliance detection on the original image data based on the check rules and the threshold parameters comprises: reading a pre-configured enabled rule list from the externalized configuration file; based on the enabled rule list, only performing the check rules defined in the enabled rule list; the check rules not listed in the enabled rule list are not detected.

[0008] Optionally, the compliance detection further comprises: processing the original image data through a pre-trained binary classification model to output a probability that the electronic certificate photo is a real face; loading a reality threshold parameter from the externalized configuration file; if the probability that the electronic certificate photo is a real face is lower than the reality threshold parameter, determining that the electronic certificate photo is an AI-generated image or a cartoon image, and generating a detection result of non-compliance of reality.

[0009] Optionally, the face quantity detection comprises: calling a face detection function built-in the detection system to process the original image data, identify the face target in the image and obtain the face quantity; comparing the face quantity with a preset face quantity threshold parameter loaded from the externalized configuration file; the face detection function realizes face recognition and statistics through at least one of a model based on a Haar feature cascade classifier, a support vector machine classifier of a histogram of oriented gradients feature, a multi-task cascade convolutional neural network or a lightweight deep learning model; when the obtained face quantity is not equal to the preset face quantity threshold parameter, determining that the face quantity is non-compliant.

[0010] Optionally, the compliance detection on the original image data further comprises: performing the detection on multiple detection dimensions including size detection, face number detection, head proportion calculation, definition evaluation and background purity analysis independently; after completing the detection on one detection dimension, the detection result of the detection dimension and corresponding related data are recorded; the related data includes the actual detection value of the detection dimension and the corresponding threshold parameter; when any detection dimension is determined as non-compliant, the non-compliant result is recorded, and subsequent detection of all enabled detection dimensions is continued to ensure that the final multi-dimensional image detection result contains all non-compliant items.

[0011] Optionally, the compliance detection result includes an overall pass state identifier and a non-compliant item detail set; the overall pass state identifier is of a Boolean type; when there is a non-compliant item, each entry in the non-compliant item detail set includes the name of the non-compliant dimension, the actual detection value and the corresponding standard threshold parameter.

[0012] Optionally, the returning of the compliance detection result to the business system comprises: generating visual guidance information corresponding to the error type based on the compliance detection result; and returning the visual guidance information and the compliance detection result to the business system to complete the compliance detection.

[0013] In another aspect, the present application provides an electronic certificate photo compliance detection system for implementing the electronic certificate photo compliance detection method, which comprises a control module including a memory, a processor and a computer program stored on the memory and executable on the processor, and the processor executes the computer program to implement the electronic certificate photo compliance detection method.

[0014] The above technical solution realizes the decoupling of business strategy and code by externally configuring centralized management verification rules, enables the detection standard to dynamically adapt to policy changes without the need to restart the service, and significantly improves flexibility and maintainability. It performs multi-dimensional intelligent analysis on image data such as size, face and definition, realizes comprehensive automatic detection from format to content, effectively replaces manual screening, guarantees data quality and verification security. As a standardized service module, the method is loosely coupled with the business system for integration, has strong reusability and scalability.

[0015] Other features and advantages of the present application will be described in detail in the following specific embodiments. BRIEF DESCRIPTION OF DRAWINGS

[0016] The accompanying drawings are included to provide a further understanding of the present application, and constitute a part of the specification, and are used together with the following specific embodiments to explain the present application, but do not constitute a limitation on the present application. In the drawings: Figure 1is an electronic certificate photo compliance detection method flowchart.

[0017] Figure 2 is a certificate photo compliance detection system flowchart. DETAILED DESCRIPTION

[0018] The following description will be made in conjunction with the accompanying drawings as Figure 1 - the accompanying drawings Figure 2 The specific implementation of the embodiments of the present application is described in detail. It should be understood that the specific implementation described herein is only used to illustrate and explain the embodiments of the present application, and is not used to limit the embodiments of the present application.

[0019] It should be noted that the acquisition, transmission, storage, use, processing, etc. of data in the technical solutions of the present application comply with the relevant provisions of national laws and regulations. In the embodiments of the present application, some existing industry solutions may be mentioned, such as software, components, models, etc. They should be considered as exemplary, and their purpose is only to illustrate the feasibility of the implementation of the technical solutions of the present application, but it does not mean that the applicant has or will necessarily use the solution.

[0020] The present inventors found in the process of implementing the present application that the verification rules of the prior art use a hard coding method, which leads to system rigidity, cumbersome modification and service restart; at the same time, only shallow file verification can be performed, and the image content quality (such as blur, multiple faces, etc.) cannot be intelligently detected, and still highly relies on inefficient manual review.

[0021] Embodiment 1 Reference Figures 1-2 As the first embodiment of the present application, the embodiment provides an electronic certificate photo compliance detection method, comprising: S100: receiving electronic certificate photo data sent by a business system, and parsing the electronic certificate photo data based on a file byte stream to obtain original image data.

[0022] In the embodiments of the present application, the length of the byte stream of the parsed electronic certificate photo data is analyzed to obtain the size of the image file; an image processing library is called to decode the byte stream to generate original image data available for pixel-level operation; the width value and the height value of the original image data are obtained.

[0023] In the preferred embodiments of the present application, the detection system receives the electronic certificate photo data sent by the business system (such as a social security card application platform) through a standardized RESTful API interface (such as POST / api / v1 / validate-photo). The electronic certificate photo data can be a raw JPG file byte stream or a Base64 encoded string.

[0024] Further, the detection system calculates the length of the received file byte stream as the image file size (unit: bytes) and the basis for comparison with the preset file size threshold (e.g., ≤1MB) in the configuration file in subsequent size detection.

[0025] Further, the detection system calls the image processing library (e.g., OpenCV) integrated therein to decode the received byte stream or the decoded Base64 byte stream, and converts it into raw image data (e.g., a pixel matrix represented in BGR or RGB format in memory) that can be operated and calculated by a computer at the pixel level.

[0026] In the above example, the detection system directly reads the pixel values of the width and height (e.g., 358 pixels x 441 pixels) of the decoded raw image data as the basic parameters for subsequent resolution verification and header proportion calculation.

[0027] S200: Load verification rules and threshold parameters from the externalized configuration file.

[0028] In the embodiments of the present application, before performing each compliance detection on an electronic certificate photo, the current modification timestamp of the externalized configuration file is read and compared with the historical timestamp corresponding to the configuration cache maintained locally by the detection system; if the current modification timestamp is inconsistent with the historical timestamp, the verification rules and threshold parameters in the externalized configuration file are re-read, updated to the configuration cache, and the historical timestamp is updated synchronously; if the current modification timestamp is consistent with the historical timestamp, the verification rules and threshold parameters in the configuration cache are reused, thereby realizing hot reloading of configuration rules.

[0029] In the preferred embodiments of the present application, when the detection system completes the reception and analysis of the raw image data, the current modification timestamp of the externalized configuration file (e.g., config.yaml) is automatically read by the configuration management module of the detection system before performing compliance detection.

[0030] It should be noted that if the current modification timestamp is inconsistent with the historical timestamp, the configuration management module re-reads all verification rules, enabled rule lists (enabled_rules), and threshold parameters corresponding to each rule from the externalized configuration file, updates the local configuration cache, and synchronously updates the historical timestamp; if they are consistent, the configurations in the cache are directly reused. The configuration management module provides the currently effective verification rule set, enabled rule list, and threshold parameter to the rule engine module. This process ensures that configuration changes take effect without restarting the detection system.

[0031] The above solution achieves hot reloading of configuration by comparing timestamps in the configuration file, ensuring that any changes to verification rules or thresholds take effect without restarting the service. This frees verification rules from hard-coding and delegates them to external configuration files for management. Business administrators can adjust rules themselves by editing text files or using a web interface without developer intervention, decoupling business rules from system code, improving operational response speed. Furthermore, a single system can easily adapt to the subtle differences in document photo requirements across various levels of human resources and social security departments by loading different configuration files, avoiding the redundant investment of custom-developing a compliance detection system and saving development and maintenance resources.

[0032] S300: Based on verification rules and threshold parameters, it performs compliance checks on the original image data to obtain multi-dimensional image detection results. The compliance checks include size detection, face count detection, head proportion calculation, sharpness assessment, and background purity analysis.

[0033] In the embodiments of this application, a pre-configured list of enabling rules is read from an externalized configuration file; based on the list of enabling rules, only the verification rules defined in the list of enabling rules are executed; verification rules not included in the list of enabling rules are not tested.

[0034] In the embodiments of this application, multiple detection dimensions, including size detection, face count detection, head proportion calculation, sharpness assessment, and background purity analysis, are executed independently. After each detection dimension is completed, the detection result and corresponding related data for that dimension are recorded. The related data includes the actual detection value and the corresponding threshold parameter for that detection dimension. When any detection dimension is determined to be non-compliant, the non-compliant result is recorded, and the detection of all subsequent enabled detection dimensions continues to be executed to ensure that the final multi-dimensional image detection result includes all non-compliant items.

[0035] In a preferred embodiment of this application, the rule engine module of the detection system dynamically loads and prepares to execute the corresponding verification rules based on the acquired list of enabled rules. The rule engine module sequentially calls the corresponding functions in the multi-dimensional image intelligent analysis module to perform enabled compliance detection on the original image data.

[0036] During size detection, the image width and height obtained from S100 are compared with the standard resolution parameters in the configuration, and the image file size is compared with the size threshold in the configuration to determine whether the size of the electronic ID photo is compliant.

[0037] Face count detection processes the raw image data by calling the built-in face detection function of the detection system (such as OpenCV Haar, DlibHOG, or MTCNN), identifies face targets in the image, and counts the number of faces. The number of faces is then compared with a preset face count threshold parameter (usually 1), which is loaded from an externalized configuration file. The face detection function integrates at least one of the following models to achieve face recognition and counting: a cascaded classifier based on Haar features, a support vector machine classifier based on histogram of oriented gradients features, a multi-task cascaded convolutional neural network, or a lightweight deep learning model. When the counted number of faces is not equal to the preset face count threshold parameter, it is determined that the face count is non-compliant.

[0038] The head proportion calculation is based on the output of face count detection. The multi-dimensional image intelligent analysis module of the detection system obtains the bounding box information of each identified face region. This bounding box is typically defined by the coordinates of its top-left and bottom-right vertices in the image coordinate system, or equivalently by the top-left vertices, the width, and the height of the box. Further, based on the obtained bounding box information, the area of ​​each individual face detection box is calculated, and the total area of ​​the entire image is calculated using the obtained image width and height. Then, the ratio of the area of ​​each individual face detection box to the total image area is calculated and converted into a percentage to obtain the head proportion.

[0039] Following the example above, the preset minimum head percentage threshold and maximum head percentage threshold are read from the hot reload configuration. The calculated head percentage is then compared with the minimum head percentage threshold and the maximum head percentage threshold to determine whether the head percentage is compliant.

[0040] In a preferred embodiment of this application, when multiple faces are detected in an image, the calculation can be performed by selecting the maximum face proportion, the average face proportion, or not, depending on the specific circumstances. Since multiple faces are inherently non-compliant (in most cases), the proportion calculation can be skipped or only the proportion value of each face can be recorded as reference information, but the final result will still primarily show "non-compliant number of faces".

[0041] Sharpness assessment uses image processing algorithms (such as the Laplacian variance method) to calculate the image's sharpness value and compares it with the sharpness threshold in the configuration. Background purity analysis is performed by statistically analyzing the proportion of pixels in the image whose RGB channel values ​​are all higher than the white background threshold in the configuration and comparing it with the minimum white background percentage threshold in the configuration.

[0042] In a preferred embodiment of this application, a pre-trained model is used to determine whether an image is a real human face. The original image data is processed using a pre-trained binary classification model to output the probability that the electronic ID photo is a real human face; an authenticity threshold parameter is loaded from an externalized configuration file; if the probability that the electronic ID photo is a real human face is lower than the authenticity threshold parameter, the electronic ID photo is determined to be an AI-generated image or a cartoon image, and a detection result indicating non-compliance with authenticity is generated.

[0043] In the embodiments of this application, if a violation of the rules is found in each detection step, the rule engine module will immediately generate a structured error message and record it in the result set of this detection, but will not interrupt the execution of subsequent rules. After all enabled rules have been executed, the rule engine module generates the final multi-dimensional image detection result.

[0044] The aforementioned solution integrates multiple dimensions of detection, including size, face, head proportion, clarity, background, and authenticity. It achieves automated, in-depth content-based evaluation of the entire process of ID photo quality, replacing inefficient and subjective manual visual inspection, thus improving detection efficiency and objectivity. Furthermore, the compliance detection system can flexibly enable or disable specific rules, easily supporting complex business scenarios such as gray-scale releases and temporary exemptions (e.g., disabling AI-generated detection in pilot cities). Regarding the detection execution strategy, even if the rule engine module detects a non-compliance during the detection process, it will continue to execute all subsequent detections using enabled rules, ensuring that all non-compliance items are fed back to the user in a complete and timely manner, optimizing the user experience.

[0045] S400: Based on the multi-dimensional image detection results, generate compliance detection results for the ID photo and return the compliance detection results to the business system to complete the compliance detection.

[0046] In the embodiments of this application, the compliance detection result includes an overall pass status identifier and a set of non-compliance item details; the overall pass status identifier is a Boolean type; when there are non-compliance items, each entry in the non-compliance item details set contains the name of the non-compliance dimension, the actual detection value, and the corresponding standard threshold parameter.

[0047] In a preferred embodiment of this application, the rule engine module checks the detection results of all enabled rules. If all enabled rules are compliant, the overall pass status is set to True (passed); if one or more rules are non-compliant, the overall pass status is set to False (failed). When there is a non-compliant item, the rule engine module iterates through all recorded non-compliant results, generates a structured detail entry for each non-compliant result, and each detail entry includes the non-compliant dimension name, the actual detection value, and the corresponding standard threshold parameter. The compliance detection result is then returned to the business system to complete the compliance detection.

[0048] In a preferred embodiment of this application, returning the compliance detection results to the business system further includes: generating visual guidance information corresponding to the error type based on the compliance detection results; and returning the visual guidance information and the compliance detection results together to the business system.

[0049] It should be noted that the visual guidance information is presented through visual methods such as image overlay, region annotation, and anomaly highlighting. The visual guidance information includes one or more of the following: head proportion visualization, non-white background visualization, and multi-face detection visualization, or a combination of the above visualization presentation forms, and is not limited to the aforementioned types. It can also cover other visual guidance forms related to various dimensions of electronic document photo compliance testing.

[0050] Head proportion visualization uses existing face detection libraries (such as OpenCV) to obtain the position and size (boundary box) of the face in the image. Based on the configured head proportion requirement (e.g., 30%), a standard reference box size is calculated. On the user-uploaded image, two colored boxes are overlaid: a red box (or dashed box) represents the actual face region detected by the algorithm; a green box (or dashed box) represents the reference region conforming to the standard head proportion. This allows users to intuitively see whether the head is too large or too small in the photo and by what extent it needs to be adjusted.

[0051] Non-white background visualization works by iterating through each pixel of an image and determining if its RGB values ​​fall within a set "pure white threshold" (e.g., R, G, and B values ​​are all greater than 220). Pixels that do not meet the pure white condition are then highlighted with a semi-transparent red layer, ultimately generating a new image by overlaying the original image with the highlighted red areas. This visualization allows users to immediately see which areas in the background are not pure white, such as shadows on walls or the edges of furniture, guiding them to retake the photo or reprocess the background.

[0052] The multi-face detection visualization uses a face detection library to detect all faces in an image. On the image, all detected faces are selected with different colored boxes and labeled with their sequence numbers, directly telling the user "the system detected 2 faces" and clearly pointing it out to avoid user disputes.

[0053] The above solution transforms the raw data generated by multi-dimensional detection into precise guidance that users can intuitively understand, significantly reducing the user's understanding cost and operational threshold, and also increasing the success rate of subsequent re-uploads, thereby improving the end-user experience.

[0054] The present invention also provides an electronic document photo compliance detection system for implementing an electronic document photo compliance detection method. The system includes a control module, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor executes the computer program to implement the electronic document photo compliance detection method.

[0055] This invention provides a storage medium storing a program that, when executed by a processor, implements a method for detecting the compliance of electronic document photos.

[0056] This invention provides a processor for running a program, wherein the program executes a method for detecting the compliance of electronic document photos.

[0057] This invention provides a device including a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it implements a method for detecting the compliance of electronic document photos. The device described herein can be a server, PC, PAD, mobile phone, etc.

[0058] This application also provides a computer program product that, when executed on a data processing device, is suitable for performing a method for detecting the compliance of electronic document photos.

[0059] Those skilled in the art will understand that embodiments of this application can provide methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0060] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0061] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0062] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

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

[0064] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

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

[0066] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0067] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A method for detecting the compliance of electronic ID photo, characterized in that, include: Receive electronic certificate photo data sent by the business system, and parse the electronic certificate photo data based on the file byte stream to obtain the original image data; Load validation rules and threshold parameters from the externalized configuration file; Based on the verification rules and the threshold parameters, compliance detection is performed on the original image data to obtain multi-dimensional image detection results. The compliance detection includes size detection, face count detection, head proportion calculation, sharpness assessment, and background purity analysis. Based on the multi-dimensional image detection results, a compliance detection result for the ID photo is generated, and the compliance detection result is returned to the business system to complete the compliance detection.

2. The method for detecting the compliance of electronic ID photo according to claim 1, characterized in that, The process of parsing the electronic ID photo data based on file byte streams includes: Parse the byte stream length of the electronic ID photo data to obtain the image file size; The image processing library is called to decode the byte stream and generate raw image data that can be manipulated at the pixel level. Obtain the width and height values ​​of the original image data.

3. The method for detecting the compliance of electronic document photos according to claim 1, characterized in that, The loading of validation rules and threshold parameters from the externalized configuration file includes: Before performing each compliance check on the electronic certificate photo, read the current modification timestamp of the externalized configuration file and compare it with the historical timestamp corresponding to the configuration cache maintained locally by the detection system; If the current modified timestamp is inconsistent with the historical timestamp, the verification rules and threshold parameters in the externalized configuration file are reread, updated to the configuration cache, and the historical timestamp is updated synchronously. If the current modification timestamp is consistent with the historical timestamp, the verification rules and threshold parameters in the configuration cache are reused to achieve hot reloading of the configuration rules.

4. The method for detecting the compliance of electronic document photos according to claim 1, characterized in that, The compliance check performed on the original image data based on the verification rules and the threshold parameters includes: Read the pre-configured list of enabled rules from the externalized configuration file; Based on the list of enabled rules, only the verification rules defined in the list of enabled rules will be executed; Verification rules not listed in this enabled rules list will not be executed.

5. The method for detecting the compliance of electronic document photos according to claim 1, characterized in that, The compliance testing also includes: The original image data is processed by a pre-trained binary classification model to output the probability that the electronic ID photo is a real human face. Load the authenticity threshold parameter from the externalized configuration file; If the probability that the electronic ID photo is a real face is lower than the authenticity threshold parameter, then the electronic ID photo is determined to be an AI-generated image or a cartoon image, and an authenticity non-compliance detection result is generated.

6. The method for detecting the compliance of electronic document photos according to claim 1, characterized in that, The face count detection includes: The built-in face detection function of the detection system is called to process the original image data, identify face targets in the image, and count the number of faces; The number of faces is compared with a preset face number threshold parameter, which is loaded from an externalized configuration file; The face detection function achieves face recognition and statistics by integrating at least one of the following models: a cascaded classifier based on Haar features, a support vector machine classifier based on histogram of oriented gradient features, a multi-task cascaded convolutional neural network, or a lightweight deep learning model. When the number of faces obtained from the statistics is not equal to the preset face number threshold parameter, it is determined that the number of faces is non-compliant.

7. The method for detecting the compliance of electronic document photos according to claim 1, characterized in that, Performing compliance checks on the raw image data also includes: Multiple detection dimensions, including size detection, face count detection, head proportion calculation, sharpness assessment, and background purity analysis, are performed independently. After each detection dimension is completed, the detection results and corresponding data for that detection dimension are recorded. The relevant data includes the actual detection value and the corresponding threshold parameter for that detection dimension; When any detection dimension is determined to be non-compliant, the non-compliance result is recorded, and subsequent detections of all enabled detection dimensions are performed to ensure that the final multi-dimensional image detection result includes all non-compliant items.

8. The method for detecting the compliance of electronic document photos according to claim 1, characterized in that, The compliance test results include an overall pass status indicator and a set of non-compliance item details; the overall pass status indicator is a Boolean type; when there are non-compliance items, each entry in the non-compliance item details set contains the name of the non-compliance dimension, the actual test value, and the corresponding standard threshold parameter.

9. The method for detecting the compliance of electronic document photos according to claim 1, characterized in that, Returning the compliance test results to the business system includes: generating visual guidance information corresponding to the error type based on the compliance test results; and returning the visual guidance information and the compliance test results together to the business system.

10. A compliance detection system for electronic ID photos, characterized in that, The system includes a control module, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor executes the computer program to implement the electronic document photo compliance detection method according to any one of claims 1-9.

Citation Information

Patent Citations

  • Dynamic configuration loading method, system and equipment based on galaxy framework and storage medium

    CN117827305A