Two-dimensional code anti-photographing identification method and system, storage medium and server
Patent Information
- Application Number
- CN202611417866.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-14
- Publication Date
- 2026-10-16
AI Technical Summary
由于复制得到的二维码编码内容与原始二维码完全一致,传统校验机制仅识别二维码编码信息,无法区分原始实体二维码与屏幕展示的复制二维码,进而被攻击者利用,造成窜货稽查失效、抽奖权益被骗取、电子签到记录伪造等安全问题
[0027] (1) The photo-taking action and the QR code scanning steps are deeply integrated, so users do not need to click twice, and the operation experience is smooth;
Smart Images

Figure CN122927341A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the technical field of QR code recognition, and relates to a QR code anti-reproduction recognition method, system, storage medium and server. Background Technology
[0002] With its advantages of large information capacity, convenient recognition, and low deployment cost, QR codes have been widely used in mobile payment, electronic ticketing, anti-counterfeiting and traceability, QR code lottery, electronic check-in, and other business scenarios, becoming an important information exchange carrier in modern society. Conventional QR code verification methods mainly parse the QR code's encoded content and complete information verification based on the backend business database, realizing business functions such as identity verification, rights redemption, and product traceability.
[0003] However, the widespread adoption of QR code technology has also brought about risks of QR code forgery attacks, such as screenshotting and re-photographing. Attackers obtain legitimate QR code images through methods such as screenshots and camera re-photographing, and then display the copied QR code on their mobile phones or computer screens for devices to scan. Because the encoded content of the copied QR code is completely identical to the original QR code, traditional verification mechanisms only recognize the QR code encoding information and cannot distinguish between the original physical QR code and the copied QR code displayed on the screen. This allows attackers to exploit the system, resulting in security problems such as ineffective cross-border e-commerce checks, fraudulent acquisition of lottery rights, and forgery of electronic check-in records.
[0004] This type of attack has a low barrier to entry, requiring only a regular mobile phone to capture and reproduce screenshots. The attack is highly covert and difficult for business systems to detect. Existing QR code security solutions mostly focus on methods such as encrypting QR code content and dynamically updating it, making it difficult to effectively identify replay attacks resulting from screen capture and copying. They also cannot distinguish between the original physical QR code and the forged code reproduced on the screen at the source of scanning, making it difficult to prevent the aforementioned fraudulent activities. This has become a critical technical challenge that urgently needs to be addressed in QR code security applications. Summary of the Invention
[0005] The purpose of this invention is to provide a QR code anti-reproduction identification method, system, storage medium, and server that automatically triggers photo taking and QR code reproduction identification when scanning the code, effectively defending against QR code reproduction attacks without changing the user's operating habits.
[0006] In a first aspect, the present invention provides a method for preventing QR code re-engraving, the method comprising the following steps: acquiring a scene image containing the QR code collected by a smart terminal while scanning the QR code; extracting multi-level spatial feature maps of the scene image; performing global context modeling on the multi-level spatial feature maps based on a multi-head self-attention mechanism, and outputting a weighted feature map that enhances the feature weights of abnormal feature regions; extracting re-engraving discrimination features in parallel based on the weighted feature map, the re-engraving discrimination features including screen moiré pattern recognition features, screen reflected light features, screen noise distribution features, screen border and environmental context features; calculating a re-engraving confidence score based on the re-engraving confidence score; and obtaining the re-engraving recognition result of the QR code based on the re-engraving confidence score.
[0007] In one implementation of the first aspect, multi-level spatial feature maps of the scene image are extracted based on the EfficientNet backbone network; re-photographing discrimination features are extracted in parallel based on a multi-dimensional feature fusion discrimination engine; and a re-photographing confidence score is calculated based on a feature fusion and classification engine.
[0008] In one implementation of the first aspect, the method further includes collecting missed / false alarm samples generated by online services, actively learning and labeling the missed / false alarm samples; using the labeled missed / false alarm samples to retrain the EfficientNet backbone network, the multi-head self-attention mechanism, the multi-dimensional feature fusion discriminant engine, and the feature fusion and classification engine, and performing A / B binning verification, incrementally updating the EfficientNet backbone network, the multi-head self-attention mechanism, the multi-dimensional feature fusion discriminant engine, and the feature fusion and classification engine.
[0009] In one implementation of the first aspect, the abnormal feature area includes a reflected halo area at the junction of the screen display area and the physical frame of the smart terminal, a moiré periodic texture area, an unnatural specular highlight patch area, and edge artifacts and blurred transition zones caused by secondary photography.
[0010] Secondly, the present invention provides a QR code anti-reproduction identification system, the system comprising an acquisition module, a first extraction module, a weighting module, a second extraction module, a calculation module, and a discrimination module;
[0011] The acquisition module is used to acquire a scene image containing the QR code collected by the smart terminal while scanning the QR code;
[0012] The first extraction module is used to extract multi-level spatial feature maps of the scene image;
[0013] The weighting module is used to perform global context modeling on the multi-level spatial feature map based on the multi-head self-attention mechanism, and output a weighted feature map that enhances the feature weights of abnormal feature regions.
[0014] The second extraction module is used to extract re-enactment discrimination features in parallel based on the weighted feature map. The re-enactment discrimination features include screen moiré pattern recognition features, screen reflected light features, screen noise distribution features, screen border and environmental context features.
[0015] The calculation module is used to calculate the re-reproduction confidence score based on the re-reproduction discrimination features;
[0016] The discrimination module is used to obtain the scan recognition result of the QR code based on the scan confidence score.
[0017] Thirdly, the present invention provides a server, the server comprising: a processor and a memory;
[0018] The memory is used to store computer programs;
[0019] The processor is used to execute the computer program stored in the memory, so that the server performs the above-described QR code anti-reproduction identification method.
[0020] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a server, implements the above-described QR code anti-reproduction identification method.
[0021] Fifthly, the present invention provides a QR code anti-reproduction identification system, including a smart terminal and the aforementioned server;
[0022] The smart terminal is used to capture a scene image containing the QR code while scanning the QR code, and to provide the scene image to the server.
[0023] In one implementation of the fifth aspect, the smart terminal is further configured to preprocess the scene image so as to provide the preprocessed scene image to the server;
[0024] The preprocessing includes one or more combinations of checking the integrity of the scene image, compressing the scene image, and embedding identification information in the scene image.
[0025] In one implementation of the fifth aspect, when the scanned QR code is the original QR code, the smart terminal is further configured to perform the associated jump action of the QR code; when the scanned QR code is a scanned QR code, the associated jump action is stopped.
[0026] As described above, the QR code anti-reproduction identification method, system, storage medium, and server of the present invention have the following beneficial effects:
[0027] (1) The photo-taking action and the QR code scanning steps are deeply integrated, so users do not need to click twice, and the operation experience is smooth;
[0028] (2) By utilizing the differences in physical characteristics between real and copied photos, fake QR codes can be accurately identified, thereby effectively defending against copy attacks;
[0029] (3) Smart terminals such as mobile phones are only responsible for taking pictures, compressing, uploading and displaying results, and do not run complex models. They are compatible with various mainstream smart terminals.
[0030] (4) Only the photo taking and identification branches need to be inserted into the original scanning process. The business logic changes are small and it is easy to deploy quickly. Attached Figure Description
[0031] Figure 1 The flowchart shown is an embodiment of the QR code anti-reproduction recognition method of the present invention;
[0032] Figure 2 The diagram shown is a structural schematic of the QR code anti-reproduction recognition system of the present invention in one embodiment;
[0033] Figure 3 The diagram shown is a structural schematic of the server of the present invention in one embodiment.
[0034] Figure 4 The diagram shown is a structural schematic of another embodiment of the QR code anti-reproduction recognition system of the present invention. Detailed Implementation
[0035] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that, unless otherwise specified, the following embodiments and features described therein can be combined with each other.
[0036] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Therefore, the drawings only show the components related to the present invention and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.
[0037] Furthermore, in this invention, descriptions involving "first," "second," etc., are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first" or "second" may explicitly or implicitly include at least one of that feature. Additionally, the technical solutions of the various embodiments can be combined with each other, but only on the basis of being achievable by those skilled in the art. When the combination of technical solutions is contradictory or impossible to implement, such a combination of technical solutions should be considered non-existent and not within the scope of protection claimed by this invention.
[0038] like Figure 1 As shown, in one embodiment, the QR code anti-reproduction identification method of the present invention includes steps S1-S6.
[0039] Step S1: Obtain a scene image containing the QR code captured by the smart terminal while scanning the QR code.
[0040] Specifically, the intelligent terminal described in this invention refers to an electronic device equipped with an intelligent operating system and a display screen, which has QR code scanning and image acquisition functions, including smartphones, tablets, and laptops with displays. When performing a QR code scanning service, the intelligent terminal simultaneously acquires a complete scene image containing the QR code and its surrounding environment through a camera module. The scene image fully preserves image information outside the QR code area, including any possible traces of the photograph, such as screen borders, reflective halos, moiré patterns, specular highlights, edge artifacts, desktop elements, and fingers.
[0041] In one embodiment, the smart terminal triggers an image acquisition operation while performing QR code recognition. The image acquisition operation has the following characteristics:
[0042] 1) The field of view of the image acquisition covers the entire QR code area and its surrounding background environment;
[0043] 2) The image is captured the instant the QR code is recognized, requiring no additional user intervention;
[0044] 3) Image acquisition parameters (resolution, exposure, focus) are set to preset values to ensure image feature consistency.
[0045] After the scene image is acquired, the smart terminal uploads the scene image and business request parameters (such as user ID, QR code information, timestamp, etc.) to the server via the HTTP protocol, so that the server can perform anti-reproduction recognition based on the preset QR code anti-reproduction recognition algorithm.
[0046] Step S2: Extract multi-level spatial feature maps of the scene image.
[0047] Specifically, the EfficientNet backbone network performs multi-stage convolutional downsampling processing on the scene image to obtain the multi-level spatial feature set. The multi-level spatial features retain the spatial location association information corresponding to image pixels and output as corresponding multi-level spatial feature maps. The multi-level feature set includes shallow spatial features and deep spatial features. The shallow spatial features have high spatial resolution and are used to characterize local image details, capturing subtle copying traces such as moiré patterns, specular highlights, and edge artifacts. The deep spatial features have a larger receptive field and are used to characterize global image context information, capturing large-scale copying traces such as screen borders and large-scale reflective halos.
[0048] Step S3: Perform global context modeling on the multi-level spatial feature map based on the multi-head self-attention mechanism, and output a weighted feature map with enhanced feature weights for abnormal feature regions.
[0049] Specifically, the multi-head self-attention mechanism performs global context modeling on the multi-level spatial feature map output by the EfficientNet backbone network, automatically calculates attention weights at different spatial locations, increases the feature weights of abnormal feature regions around the QR code, and outputs a weighted feature map enhanced by the abnormal feature weights, thereby autonomously focusing on abnormal feature regions around the QR code. Through this multi-head self-attention mechanism, discriminative feature distributions can be learned from the data without manual annotation of abnormal feature regions, significantly improving the ability to capture subtle abnormal patterns in copying traces.
[0050] The abnormal feature areas mentioned include reflected halo areas at the junction of the smart terminal's screen display area and the physical frame, moiré patterned texture areas, unnatural specular highlight patches, edge artifacts, and blurred transition bands caused by secondary photography. It should be noted that the junction of the smart terminal's screen display area and the physical frame refers to the physical transition point between the outer boundary of the smart terminal's effectively illuminated image and the frame of the casing surrounding the display. When the smart terminal screen is photographed a second time, the screen light is reflected at this physical transition point, forming a band-shaped reflected halo. This reflected halo is a unique image trace characteristic of photographed screen images.
[0051] Step S4: Extract re-photographing discrimination features in parallel based on the weighted feature map. The re-photographing discrimination features include screen moiré pattern recognition features, screen reflected light features, screen noise distribution features, screen border and environmental context features.
[0052] Specifically, a multi-dimensional feature fusion discrimination engine is used to extract re-photographing discrimination features in parallel. For the scene image, if the image exhibits the texture of a real physical medium, natural lighting changes, and continuous depth information, it is considered a non-re-photographed image; if the image has re-photographing features such as moiré patterns, screen pixels, secondary reflections, and edge anomalies, it is considered a re-photographed image. Therefore, the re-photographing discrimination features of this invention specifically include the following categories:
[0053] 1) Screen moiré pattern recognition features
[0054] By analyzing the periodic moiré pattern generated by the spatial frequency aliasing of the CMOS sensor and the screen pixel array within the QR code area, frequency domain peak values and phase features are extracted.
[0055] 2) Characteristics of screen reflected light
[0056] The difference in optical properties between specular and diffuse reflection on the screen surface is detected to capture the non-natural illumination consistency deviation introduced during the secondary imaging process.
[0057] 3) Screen noise distribution characteristics
[0058] The statistical distribution characteristics of sensor noise, JPEG compression noise, and screen pixel noise introduced during the reproduction process are analyzed to distinguish between the original physical image and the screen-reproduced image.
[0059] 4) Screen border and environmental context features
[0060] In application scenarios that allow for a wider field of view, unique environmental cues specific to photocopying, such as reflections on the edges and borders of the phone screen and finger obstructions, can be identified as auxiliary criteria for judgment.
[0061] The aforementioned features for identifying re-production capture unique traces of re-production from multiple dimensions, including texture artifacts, optical reflection, pixel noise, and environmental background, enabling multi-clue complementary verification.
[0062] Step S5: Calculate the re-reproduction confidence score based on the re-reproduction discrimination features.
[0063] Specifically, a re-enactment confidence score is calculated based on a feature fusion and classification engine. The feature fusion and classification layer receives four re-enactment discrimination features output by the multi-dimensional feature fusion discrimination engine. First, it performs feature fusion processing, mapping the screen moiré pattern recognition features, screen reflected light features, screen noise distribution features, screen border and environmental context features to the same feature space, achieving information aggregation of multi-branch heterogeneous features. Then, a classification network performs mapping calculation, outputting a re-enactment confidence score p with a value range of 0 to 1. The confidence score represents the probability that the QR code in the scene image belongs to a re-enacted QR code.
[0064] Step S6: Obtain the QR code's re-photographing recognition result based on the re-photographing confidence score.
[0065] Specifically, when the confidence score p for re-engraving is greater than or equal to a preset threshold T, the re-engraving recognition result is that the QR code in the scene image is a re-engraved QR code; when the confidence score p for re-engraving is less than the preset threshold T, the re-engraving recognition result is that the QR code in the scene image is the original QR code. The server sends the obtained re-engraving recognition result to the smart terminal.
[0066] When the scan recognition result indicates that the QR code in the scene image is a scanned QR code, the smart terminal stops executing the associated redirection action and triggers an alarm. The user needs to repeat the scan + photo process (or switch to manual qualification verification). When the scan recognition result indicates that the QR code in the scene image is the original QR code, the smart terminal executes the associated redirection action of the QR code (such as redirecting to business processing, authorization login, payment confirmation, etc.) to complete the corresponding QR code function.
[0067] It should be noted that, for users, the time interval between scanning the QR code and obtaining the image recognition result on the smart terminal is controlled within 200ms. The user only perceives "waiting a moment after scanning the code" and there is no extra operational burden.
[0068] In one embodiment, the QR code anti-reproduction identification method of the present invention further includes collecting missed / false alarm samples generated by online business, actively learning and labeling the missed / false alarm samples; using the labeled missed / false alarm samples to retrain and perform A / B binning verification on the EfficientNet backbone network, the multi-head self-attention mechanism, the multi-dimensional feature fusion discriminant engine, and the feature fusion and classification engine, and incrementally updating the EfficientNet backbone network, the multi-head self-attention mechanism, the multi-dimensional feature fusion discriminant engine, and the feature fusion and classification engine. Through the above steps, the present invention establishes a model iteration mechanism with continuous evolution capabilities, ensuring the model's continuous resistance to new reproduction attack methods, and significantly improving the long-term robustness and adversarial adaptability of anti-reproduction identification.
[0069] The scope of protection of the QR code anti-reproduction identification method described in this embodiment is not limited to the execution order of the steps listed in this embodiment. Any solution implemented by adding, subtracting, or replacing steps in the prior art based on the principle of this invention is included within the scope of protection of this invention.
[0070] This invention also provides a QR code anti-reproduction identification system. The QR code anti-reproduction identification system can implement the QR code anti-reproduction identification method described in this invention. However, the implementation device of the QR code anti-reproduction identification system described in this invention includes, but is not limited to, the structure of the QR code anti-reproduction identification system listed in this embodiment. All structural modifications and substitutions of the prior art made according to the principles of this invention are included within the protection scope of this invention.
[0071] like Figure 2 As shown, in one embodiment, the QR code anti-reproduction identification system of the present invention includes an acquisition module 21, a first extraction module 22, a weighting module 23, a second extraction module 24, a calculation module 25, and a discrimination module 26 connected in sequence.
[0072] The acquisition module 21 is used to acquire a scene image containing the QR code collected by the smart terminal while scanning the QR code.
[0073] The first extraction module 22 is used to extract multi-level spatial feature maps of the scene image.
[0074] The weighting module 23 is used to perform global context modeling on the multi-level spatial feature map based on the multi-head self-attention mechanism, and output a weighted feature map that enhances the feature weights of abnormal feature regions.
[0075] The second extraction module 24 is used to extract re-photographing discrimination features in parallel based on the weighted feature map. The re-photographing discrimination features include screen moiré pattern recognition features, screen reflected light features, screen noise distribution features, screen border and environmental context features.
[0076] The calculation module 25 is used to calculate the re-reproduction confidence score based on the re-reproduction discrimination features.
[0077] The discrimination module 26 is used to obtain the re-photographing recognition result of the QR code based on the re-photographing confidence score.
[0078] The structure and principle of the acquisition module 21, the first extraction module 22, the weighting module 23, the second extraction module 24, the calculation module 25, and the discrimination module 26 correspond one-to-one with the steps in the above-mentioned QR code anti-reproduction identification method, so they will not be described in detail here.
[0079] In the embodiments provided by this invention, it should be understood that the disclosed systems, apparatuses, or methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of modules / units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or units may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection of apparatuses or modules or units may be electrical, mechanical, or other forms.
[0080] The modules / units described as separate components may or may not be physically separate. The components shown as modules / units may or may not be physical modules; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules / units can be selected to achieve the objectives of the embodiments of the present invention, depending on actual needs. For example, the functional modules / units in the various embodiments of the present invention may be integrated into one processing module, or each module / unit may exist physically separately, or two or more modules / units may be integrated into one module / unit.
[0081] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0082] This invention also provides a computer-readable storage medium. Those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing a processor. The program can be stored in a computer-readable storage medium, which is a non-transitory medium, such as random access memory, read-only memory, flash memory, hard disk, solid-state drive, magnetic tape, floppy disk, optical disk, and any combination thereof. The storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., digital video disc (DVD)), or a semiconductor medium (e.g., solid-state drive (SSD)).
[0083] This invention also provides a server. The server includes a processor and a memory.
[0084] The memory is used to store computer programs.
[0085] The memory includes various media capable of storing program code, such as ROM, RAM, magnetic disk, USB flash drive, memory card, or optical disk.
[0086] The processor is connected to the memory and is used to execute the computer program stored in the memory, so that the server performs the above-described QR code anti-reproduction identification method.
[0087] Preferably, the processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0088] like Figure 3As shown, the server of the present invention is embodied in the form of a general-purpose computing device. The components of the server may include, but are not limited to: one or more processors or processing units 31, memory 32, and bus 33 connecting different system components (including memory 32 and processing unit 31).
[0089] Bus 33 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. For example, these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.
[0090] Servers typically include a variety of computer system-readable media. These media can be any available media that can be accessed by the server, including volatile and non-volatile media, and removable and non-removable media.
[0091] Memory 32 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 321 and / or cache memory 322. The server may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 323 may be used to read and write non-removable, non-volatile magnetic media (…). Figure 3 Not shown; usually referred to as a "hard drive"). Although Figure 3 As not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 33 via one or more data media interfaces. Memory 32 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of the present invention.
[0092] A program / utility 324 having a set (at least one) of program modules 3241 may be stored, for example, in memory 32. Such program modules 3241 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 3241 typically perform the functions and / or methods described in the embodiments of the present invention.
[0093] The server can also communicate with one or more external devices (e.g., keyboard, pointing device, monitor, etc.), one or more devices that enable users to interact with the server, and / or any device that enables the server to communicate with one or more other computing devices (e.g., network interface card, modem, etc.). This communication can be performed through input / output (I / O) interface 34. Furthermore, the server can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) through network adapter 35. Figure 3 As shown, network adapter 35 communicates with other modules of the server via bus 33. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the server, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0094] like Figure 4 As shown, in one embodiment, the QR code anti-reproduction recognition system of the present invention includes a smart terminal 41 and the aforementioned server 42.
[0095] The smart terminal 41 is used to capture a scene image containing the QR code while scanning the QR code, and to provide the scene image to the server 42.
[0096] In one embodiment, the smart terminal 41 is further configured to preprocess the scene image to provide the preprocessed scene image to the server 42. The preprocessing includes one or more combinations of checking the integrity of the scene image, compressing the scene image, and embedding identification information in the scene image.
[0097] When checking the integrity of the scene image, the QR code in the scene image is first decoded. If decoding fails, the image is directly determined to be damaged, and a prompt message is output to remind the user to scan the code again, without executing the subsequent anti-reproduction recognition process. If decoding is successful, the image metadata and image content are further verified: the width and height of the image are checked to see if they meet the preset minimum resolution conditions, and the image color channels are checked to see if they are complete. The percentage of effective pixels within the image is counted. When the percentage of effective pixels is less than a preset percentage threshold, the image is determined to be damaged, and the user is prompted to scan the code again.
[0098] When compressing the scene image, the resolution is compressed to within 1080P and the size is controlled to less than 1MB to reduce upload traffic.
[0099] When embedding identification information into the scene image, a unique identifier for this session (Session ID) can be embedded to prevent replay attacks.
[0100] The above embodiments are merely illustrative of the principles and effects of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in the present invention should still be covered by the claims of the present invention.
Claims
1. A method for preventing the re-photographing of QR codes, characterized in that, The method includes the following steps: Acquire a scene image containing the QR code captured by the smart terminal while scanning the QR code; Extract multi-level spatial feature maps from the scene image; The multi-head self-attention mechanism is used to perform global context modeling on the multi-level spatial feature map, and output a weighted feature map with enhanced feature weights for abnormal feature regions. Based on the weighted feature map, the re-enactment discrimination features are extracted in parallel. The re-enactment discrimination features include screen moiré pattern recognition features, screen reflected light features, screen noise distribution features, screen border and environmental context features. Calculate the re-production confidence score based on the aforementioned re-production discrimination features; The QR code's re-photographing recognition result is obtained based on the re-photographing confidence score.
2. The QR code anti-reproduction identification method according to claim 1, characterized in that, Multi-level spatial feature maps of the scene image are extracted based on the EfficientNet backbone network; Parallel extraction of re-photographing discrimination features based on a multi-dimensional feature fusion discrimination engine; The confidence score for remakes is calculated based on feature fusion and a classification engine.
3. The QR code anti-reproduction identification method according to claim 2, characterized in that, It also includes collecting missed / false positive samples generated by online services, actively learning and labeling the missed / false positive samples; using the labeled missed / false positive samples to retrain and perform A / B binning verification on the EfficientNet backbone network, the multi-head self-attention mechanism, the multi-dimensional feature fusion discriminant engine, and the feature fusion and classification engine, and incrementally updating the EfficientNet backbone network, the multi-head self-attention mechanism, the multi-dimensional feature fusion discriminant engine, and the feature fusion and classification engine.
4. The QR code anti-reproduction identification method according to claim 1, characterized in that, The abnormal feature areas include the reflected halo area at the junction of the screen display area and the physical frame of the smart terminal, the moiré periodic texture area, the unnatural specular highlight patch area, and the edge artifacts and blurred transition zone caused by secondary photography.
5. A QR code anti-reproduction identification system, characterized in that, The system includes an acquisition module, a first extraction module, a weighting module, a second extraction module, a calculation module, and a discrimination module; The acquisition module is used to acquire a scene image containing the QR code collected by the smart terminal while scanning the QR code; The first extraction module is used to extract multi-level spatial feature maps of the scene image; The weighting module is used to perform global context modeling on the multi-level spatial feature map based on the multi-head self-attention mechanism, and output a weighted feature map that enhances the feature weights of abnormal feature regions. The second extraction module is used to extract re-enactment discrimination features in parallel based on the weighted feature map. The re-enactment discrimination features include screen moiré pattern recognition features, screen reflected light features, screen noise distribution features, screen border and environmental context features. The calculation module is used to calculate the re-reproduction confidence score based on the re-reproduction discrimination features; The discrimination module is used to obtain the scan recognition result of the QR code based on the scan confidence score.
6. A server, characterized in that, The server includes: a processor and memory; The memory is used to store computer programs; The processor is used to execute the computer program stored in the memory, so that the server performs the QR code anti-reproduction identification method according to any one of claims 1 to 4.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the server, it implements the QR code anti-reproduction identification method as described in any one of claims 1 to 4.
8. A QR code anti-reproduction identification system, characterized in that, Includes a smart terminal and the server as described in claim 6; The smart terminal is used to capture a scene image containing the QR code while scanning the QR code, and to provide the scene image to the server.
9. The QR code anti-reproduction identification system according to claim 8, characterized in that, The smart terminal is also used to preprocess the scene image so as to provide the preprocessed scene image to the server; The preprocessing includes one or more combinations of checking the integrity of the scene image, compressing the scene image, and embedding identification information in the scene image.
10. The QR code anti-reproduction identification system according to claim 8, characterized in that, When the scanned QR code is identified as the original QR code, the smart terminal is also used to perform the associated jump action of the QR code; when the scanned QR code is identified as a scanned QR code, the associated jump action is stopped.