WO2022222904A1 - Image verification method and system, and storage medium - Google Patents

Image verification method and system, and storage medium Download PDF

Info

Publication number
WO2022222904A1
WO2022222904A1 PCT/CN2022/087565 CN2022087565W WO2022222904A1 WO 2022222904 A1 WO2022222904 A1 WO 2022222904A1 CN 2022087565 W CN2022087565 W CN 2022087565W WO 2022222904 A1 WO2022222904 A1 WO 2022222904A1
Authority
WO
WIPO (PCT)
Prior art keywords
verification
image
color
target
images
Prior art date
Application number
PCT/CN2022/087565
Other languages
French (fr)
Chinese (zh)
Inventor
张明文
张天明
赵宁宁
Original Assignee
北京嘀嘀无限科技发展有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from CN202110423967.0A external-priority patent/CN113111810B/en
Priority claimed from CN202210246335.6A external-priority patent/CN116824174A/en
Application filed by 北京嘀嘀无限科技发展有限公司 filed Critical 北京嘀嘀无限科技发展有限公司
Publication of WO2022222904A1 publication Critical patent/WO2022222904A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/60Extraction of image or video features relating to illumination properties, e.g. using a reflectance or lighting model

Definitions

  • the present specification relates to the technical field of image processing, and in particular, to a method, system and storage medium for image verification.
  • Image verification is a technology for identification or verification based on images collected by image acquisition devices, and is widely used in application scenarios such as identity verification, authority verification, and target recognition. In practical applications, there may be a problem of illegal verification through camera hijacking and other methods. In addition, due to environmental conditions (for example, low ambient brightness, the presence of colored light in the environment, etc.) may have an impact on the image acquisition process, and the impact of light on different areas of the target may be different, resulting in large errors in the verification results. . In order to ensure the security of target recognition, it is necessary to determine the authenticity of the target image.
  • One of the embodiments of this specification provides an image verification method, the method includes: instructing a terminal device to emit at least two colored light beams to a target; during the process of transmitting the at least two colored light beams, instructing the terminal device to collect the multiple images of the target; selecting at least two target images respectively corresponding to the at least two colored rays from the multiple images; determining a target verification code based on the at least two target images; verifying the target by comparing the The code and the reference verification code corresponding to the at least two colored light beams are used to verify the authenticity of the image.
  • One of the embodiments of the present specification provides an image verification system, the system includes: a light emission module for instructing a terminal device to emit at least two colored light beams to a target.
  • the image verification system further includes an image acquisition module for instructing the terminal device to collect multiple images of the target during the process of emitting the at least two colored light beams and to select the at least two images from the multiple images. At least two target images corresponding to the bundles of colored rays respectively.
  • the image verification system further includes a target verification code determination module for determining a target verification code based on the at least two target images.
  • the image verification system further includes an image authenticity determination module for performing image authenticity verification by comparing the target verification code with the reference verification codes corresponding to the at least two colored light beams.
  • One of the embodiments of this specification provides a computer-readable storage medium, where the storage medium stores computer instructions, and when the computer reads the computer instructions in the storage medium, the computer executes the image verification method disclosed in this specification.
  • the problem of camera hijacking can be effectively solved by instructing the terminal to emit colored light and collecting corresponding images for image verification.
  • the target image is divided into a reference image and a verification image, and the target verification code is determined based on the difference between them (that is, the verification code is determined by self-comparison or self-query); correspondingly, the multi-colored rays are divided into reference rays.
  • the verification light determine the reference verification code based on the difference between each other, and then verify by comparing whether the target verification code and the reference verification code are consistent, which can eliminate the influence of environmental conditions and improve the accuracy of the verification result.
  • the brightness and/or saturation are also considered.
  • the number of digits in the verification code is more, which greatly reduces the probability of being broken, and the verification accuracy and Security is also higher. Furthermore, dividing the reference image and the verification image into multiple image blocks, and performing subsequent similarity processing and analysis based on the multiple image blocks through the transformer structure can effectively solve the problem that light affects different areas of the target differently. Problems, improve the model's refined processing ability, thereby improving the verification effect.
  • FIG. 1 is a schematic diagram of an application scenario of an exemplary image verification system according to some embodiments of the present specification
  • FIG. 2 is a block diagram of an exemplary image verification system according to some embodiments of the present specification.
  • FIG. 3 is a flowchart of an exemplary image verification process according to some embodiments of the present specification.
  • FIG. 4 is an exemplary flowchart of determining a target verification code based on a target image according to some embodiments of the present specification
  • FIG. 5 is a schematic diagram illustrating an exemplary determination of the difference between a reference image and a verification image according to some embodiments of the present specification
  • FIG. 6 is a schematic diagram of an exemplary image verification process according to some embodiments of the present specification.
  • FIG. 7 is a schematic diagram of an exemplary alignment model shown in accordance with some embodiments of the present specification.
  • 8A and 8B are schematic diagrams of determining the similarity between a verification image and a reference image according to some embodiments of the present specification
  • FIG. 9 is a schematic diagram of constructing spatial attention according to some embodiments of the present specification.
  • FIG. 10 is a flowchart of another exemplary image verification process according to some embodiments of the present specification.
  • Figure 11 is a schematic diagram of an exemplary lighting sequence according to some embodiments of the present specification.
  • FIG. 12 is a schematic structural diagram of an exemplary color verification model according to some embodiments of the present specification.
  • system means for distinguishing different components, elements, parts, parts or assemblies at different levels.
  • device means for converting components, elements, parts, parts or assemblies to different levels.
  • images may include still images (eg, individual images, video frames, etc.) or dynamic images (eg, video).
  • Target recognition is a technology for biometric identification based on target objects acquired by image acquisition devices.
  • the target object also referred to as a “target”
  • the target object may be a human face, a fingerprint, a palm print, a pupil, or the like.
  • object recognition may be applied to authorization verification.
  • authorization verification For example, access control authority authentication, account payment authority authentication, etc.
  • target recognition may also be used for authentication.
  • the target identification may be based on matching of the target image captured by the image capture device in real time and the pre-acquired biometric features, thereby verifying the target identity.
  • image capture devices can be hacked or hijacked, and attackers can upload fake target images for authentication.
  • attacker A can directly upload the face image of user B after attacking or hijacking the image acquisition device.
  • the target recognition system also referred to as an "image verification system" performs face recognition based on user B's face image and pre-acquired user B's face biometrics, thereby passing user B's identity verification.
  • FIG. 1 is a schematic diagram of an application scenario of an exemplary image verification system according to some embodiments of the present specification.
  • the image verification system 100 may be applied to scenarios such as facial recognition verification, object verification (eg, vehicle verification, document verification, etc.).
  • an image verification system 100 (also referred to as an "object recognition system”) may include a server 110, a network 120, a terminal device (also referred to as a "terminal”) 130 and storage device 140 .
  • Server 110 may be a single server or a group of servers.
  • the server group may be centralized or distributed (eg, server 110 may be a distributed system).
  • server 110 may be local or remote.
  • the server 110 may access information and/or data stored in the terminal device 130 and/or the storage device 140 through the network 120 .
  • the server 110 may be directly connected to the terminal device 130 and/or the storage device 140 to access stored information and/or data.
  • server 110 may be implemented on a cloud platform.
  • cloud platforms may include private clouds, public clouds, hybrid clouds, community clouds, distributed clouds, internal clouds, multi-tier clouds, etc., or any combination thereof.
  • server 110 may include processing device 112 for implementing the example methods and/or systems described in this specification.
  • the processing device 112 may instruct the terminal device 130 to emit at least two colored rays to the target, and instruct the terminal device 130 to collect multiple images of the target during the process of emitting the colored rays.
  • the processing device 112 may select at least two (may also be referred to as "multiple") target images corresponding to the at least two colored rays from the plurality of images, and determine the target verification code based on the at least two target images. Further, the processing device 112 may perform image authenticity verification by comparing the target verification code with the reference verification codes corresponding to the at least two colored rays.
  • processing device 112 may determine the first color relationship and the second color relationship, and determine the authenticity of the plurality of target images, and the like.
  • processing device 112 may obtain data (eg, instructions) from other components of object recognition system 100 (eg, storage device 140 , terminal 130 ) directly or through network 120 and/or send the processed data to others components for storage or display.
  • server 110 and/or processing device 112 may be implemented by a computing device, eg, a computing device including a processor, memory, network interface, communication interface, display device, and the like.
  • Network 120 may facilitate the exchange of data and/or information.
  • components in image verification system 100 eg, server 110 , terminal device 130 , storage device 140
  • the server 110 may acquire data from the terminal device 130 and/or the storage device 140 through the network 120 .
  • the network 120 may be any one or more of a wired network or a wireless network.
  • the network 120 may include a cable network, a fiber optic network, a telecommunications network, the Internet, a local area network (LAN), a wide area network (WAN), a wireless local area network (WLAN), a metropolitan area network (MAN), a public switched telephone network (PSTN) , Bluetooth network, ZigBee network (ZigBee), Near Field Communication (NFC) network, etc. or any combination thereof.
  • the network connection between the various parts in the object recognition system 100 may adopt one of the above-mentioned manners, or may adopt multiple manners.
  • the network 120 may be of various topologies such as point-to-point, shared, centralized, or a combination of topologies.
  • network 120 may include one or more network access points.
  • network 120 may include wired or wireless network access points, eg, base stations and/or network switching points 120-1, 120-2, . . . , through which one or more components of image verification system 100 are used.
  • a network 120 may be connected to exchange data and/or information.
  • the terminal device 130 may capture an image of the target.
  • the terminal device 130 may include an image capture device 130-1, a mobile device 130-2, a tablet computer 130-3, a laptop computer 130-4, etc., or any combination thereof.
  • the image capture device 130-1 may include a camera, a camera, an image sensor, etc., or any combination thereof.
  • the image capturing device 130-1 may photograph the target object and acquire multiple target images.
  • the terminal device 130 may include any device having an image capture function.
  • the terminal device 130 may emit light (eg, colored light) to the target during image acquisition.
  • the terminal device 130 may emit light through its own light emitting elements (eg, screen, LED lights, etc.).
  • the terminal device 130 may emit light through a light-emitting device (eg, an external LED lamp, a light-emitting diode, etc.) connected to it.
  • the terminal device 130 may communicate with the processing device 112 through the network 120 and transmit the image of the captured object to the processing device 112 .
  • Storage device 140 may be used to store data (eg, lighting sequences, multiple target images, first color relationships, second color relationships, etc.) and/or instructions.
  • the storage device 140 may store data obtained from the server 110 and/or the terminal device 130 (eg, images captured by the terminal device 130 ).
  • storage device 150 may store data and/or instructions for execution or use by server 110 (eg, data and/or instructions for implementing the example methods described herein).
  • the storage device 140 may include one or more storage components, and each storage component may be an independent device or a part of other devices.
  • storage device 140 may include random access memory (RAM), read only memory (ROM), mass storage, removable memory, volatile read-write memory, the like, or any combination thereof.
  • storage device 140 may be implemented on a cloud platform.
  • cloud platforms may include private clouds, public clouds, hybrid clouds, community clouds, distributed clouds, internal clouds, multi-tier clouds, etc., or any combination thereof.
  • storage device 140 may be integrated or included in one or more other components of object recognition system 100 (eg, processing device 112, terminal 130, or other possible components).
  • the storage device 140 may be connected to the network 120 to enable communication with other components in the image verification system 100 (eg, the server 110, the terminal device 130). In some embodiments, the storage device 140 may directly connect or communicate with other components of the image verification system 100 (eg, the server 110, the terminal device 130). In some embodiments, storage device 140 may be part of server 110 or terminal device 130 .
  • FIG. 2 is a block diagram of an exemplary image verification system shown in accordance with some embodiments of the present specification.
  • image verification system 200 may be implemented by processing device 112 .
  • the image verification system 200 may include a light emission module 210, an image acquisition module (which may also be referred to as a "target image acquisition module”) 220, a target verification code determination module 230, and an image authenticity determination module (which may also be referred to as Referred to as an "authentication module”) 240.
  • the light emission module 210 may instruct the terminal device 130 to emit at least two colored lights (at least two colored lights may also be referred to as "lighting sequences") to the target. In some embodiments, the light emission module 210 may instruct the terminal device 130 to randomly emit at least two colored light beams. In some embodiments, the light emission module 210 may instruct the terminal device 130 to emit at least two colored lights based on a preset rule. For more details about the emitted light, please refer to step 310 and its related description, which will not be repeated here.
  • the image acquisition module 220 may instruct the terminal device 130 to acquire multiple images of the target during the process of emitting at least two colored light beams. In some embodiments, the image acquisition module 220 may select at least two target images respectively corresponding to at least two colored rays from the plurality of images. For more content about image acquisition, refer to steps 320 and 330 and their related descriptions, which will not be repeated here.
  • the target image acquisition module may be configured to acquire multiple target images, the shooting time of the multiple target images has a corresponding relationship with the irradiation time of the multiple lightings in the lighting sequence irradiating the target object, and the multiple lightings have a corresponding relationship.
  • colors the plurality of colors include at least one reference color and at least one verification color
  • the plurality of target images include at least one verification image (also referred to as "verification image") and at least one reference image, and at least one reference image
  • Each of the images corresponds to one of the at least one reference color
  • each of the at least one verification image corresponds to one of the at least one verification color.
  • one or more of the at least one reference color is the same as one or more of the at least one verification color.
  • the target verification code determination module 230 may determine the target verification code based on at least two target images. In some embodiments, the target verification code determination module 230 may determine the reference image and the verification image based on the at least two target images, and determine the target verification code based on differences (eg, differences in image parameters) between the reference image and the verification image. In some embodiments, the target verification code determination module 230 may determine one of the at least two target images as a verification image, and use the other image of the at least two target images as a reference image. For more content about the target verification code, refer to step 340 and its related description, which will not be repeated here.
  • the image authenticity determination module 240 may perform image authenticity verification by comparing the target verification code with the reference verification codes corresponding to at least two colored rays. If the target verification code is consistent with the reference verification code, it means that the image authenticity verification has passed, and further indicates that the target's identity verification, authority verification and/or authenticity verification have passed. If the target verification code is inconsistent with the reference verification code, the image authenticity verification fails. For more details about the determination of the authenticity of the image, reference may be made to step 350 and its related description, which will not be repeated here.
  • the target recognition system may further include a first color relationship determination module, a second color relationship determination module, and a model acquisition module.
  • the first color relationship determination module may be configured to determine, for each of the at least one reference image, the first color relationship between the reference image and each verification image.
  • the first color relationship determination module may extract the reference color feature of the reference image and the verification color feature of each verification image; and determine the reference image and each verification image based on the reference color feature and the verification color feature The first color relationship of .
  • each of the at least one reference image and each of the at least one verification image form at least one pair of images, and for each pair of the at least one pair of images, the first color relationship is determined
  • the module can process the image pair based on the color verification model, and determine the first color relationship between the reference image and the verification image in the image pair, and the color verification model is a machine learning model with preset parameters.
  • the color verification model includes a color feature extraction layer and a color relationship determination layer, where the color feature extraction layer is used to extract color features of the image pair; the color relationship determination layer determines the reference image in the image pair based on the color features of the image pair and verify the first color relationship of the image.
  • the second color relationship determination module may be configured to determine, for each of the at least one reference color, a second color relationship between the reference color and each verification color.
  • the verification module may be configured to determine a target verification code based on the at least one first color relationship and a reference verification code based on the at least one second color relationship, and determine the target verification code based on the target verification code and the reference verification code. authenticity. For more details about determining the authenticity of multiple target images based on the target verification code and the reference verification code, please refer to FIG. 10 and related descriptions.
  • the model acquisition module can be used to acquire color verification models.
  • the preset parameters of the color verification model are obtained through end-to-end training.
  • the training process includes acquiring a plurality of training samples, each of the plurality of training samples including a sample image pair and a sample label, the sample label indicating whether the sample images in the sample image pair are illuminated by light of the same color and the initial color verification model is trained based on multiple training samples, and the preset parameters of the color verification model are determined.
  • the target image acquisition module the first color relationship determination module, the second color relationship determination module, the verification module and the model acquisition module, please refer to FIGS.
  • the image verification system 200 and its modules shown in FIG. 2 can be implemented in various ways, for example, implemented by hardware, software, or a combination of software and hardware.
  • the system and its modules of this specification can be implemented not only by hardware circuits such as very large scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, etc., or programmable hardware devices such as field programmable gate arrays, programmable logic devices, etc. , can also be implemented by, for example, software executed by various types of processors, and can also be implemented by a combination of the above-mentioned hardware circuits and software (eg, firmware).
  • the above description of the image verification system 200 and its modules is only for the convenience of description, and does not limit the description to the scope of the illustrated embodiments. It can be understood that for those skilled in the art, after understanding the principle of the system, various modules may be combined arbitrarily, or a subsystem may be formed to connect with other modules without departing from the principle.
  • the light emission module 210 , the image acquisition module 220 , the target verification code determination module 230 and the image authenticity determination module 240 disclosed in FIG. 2 may be different modules in a system, or may be one module to implement the above function of two or more modules.
  • each module may share one storage module, and each module may also have its own storage module. Such deformations are all within the protection scope of this specification.
  • process 300 may be performed by image verification system 100 or 200 .
  • the process 300 can be stored in a storage device (eg, the storage device 140, a storage unit of the processing device 112) in the form of a program or an instruction, and when the processing device 112 or the module shown in FIG. 2 executes the program or the instruction, it can be implemented Process 300.
  • process 300 may be accomplished with one or more additional operations not described below, and/or without one or more operations discussed below. Additionally, the order of operations shown in FIG. 3 is not limiting.
  • Step 310 instructing the terminal device 130 to emit at least two colored light beams to the target.
  • step 310 may be performed by the light emission module 210 .
  • Target refers to the object that requires image validation.
  • the target may be the face of a user requiring authentication and/or authorization.
  • the taxi-hailing platform needs to verify whether the driver who takes the order is a registered driver user approved by the platform, and the target is the face of the driver who takes the order.
  • the payment system needs to verify the payment authority of the payer, and the target is the payer's face.
  • the target may be an object requiring authenticity verification.
  • the vehicle verification platform needs to verify whether the vehicle is a real vehicle, and the target can be the vehicle to be verified.
  • the terminal device 130 may emit colored light through its own light emitting elements (eg, screen, LED lights, etc.). In some embodiments, the terminal device 130 may emit colored light through a light-emitting device (eg, an external LED lamp, a light-emitting diode, etc.) connected thereto.
  • a light-emitting device eg, an external LED lamp, a light-emitting diode, etc.
  • the terminal device 130 may sequentially emit at least two colored light beams in chronological order. In some embodiments, the durations of each colored light beam may be the same or different.
  • the duration of each colored light needs to be set within a preset range.
  • the preset range may be 100-500 milliseconds. In some embodiments, the preset range may be 150-450 milliseconds. In some embodiments, the preset range may be 200-400 milliseconds. In some embodiments, the preset range may be 250-350 milliseconds. In some embodiments, the preset range may be 300 milliseconds. In some embodiments, the preset range may be 250 milliseconds. In some embodiments, the preset range may be 200 milliseconds.
  • different conditions may correspond to different durations. For example, if the ambient brightness is low, the duration may be relatively long; conversely, if the ambient brightness is high, the duration may be relatively short.
  • the terminal device 130 may emit multiple colored light beams, wherein at least two colored light beams have different colors.
  • the subsequently collected images can have a certain degree of distinction to ensure the effect of authenticity verification, and at the same time, to ensure that the imaging effect of the target (for example, the face) is better.
  • the light parameters of the colored light can be represented by the HSV color model, including hue (H), saturation (S), and brightness (V).
  • H hue
  • S saturation
  • V brightness
  • at least two of the multiple colored light beams have different hues (which may reflect the difference in color).
  • the respective hues of the at least two colored lights may be set randomly, and at least one of brightness or saturation may be a variable value.
  • the hue corresponding to the at least two colored rays may be set to a random value between 0 and 1
  • one of brightness or saturation may be set to a variable value between 0 and 1.
  • the respective hues of the at least two colored lights may be set to random values between 0 and 1, and the brightness and saturation may both be set to varying values between 0 and 1.
  • variable value is relative to "fixed value", for example, a change value between 0 and 1 can be understood as a random change value between 0 and 1.
  • the at least two colored light beams respectively correspond to different hues, and at least one of brightness or saturation is different.
  • the respective hues of the at least two colored rays may be set to a value between 0 and 1 different from each other, and one of brightness or saturation may be set to a value between 0 and 1 different from each other.
  • the respective hues of the at least two colored rays may be set to be values between 0 and 1 that are different from each other, and both the brightness and the saturation may be set to be values between 0 and 1 that are different from each other.
  • the hue of at least two colored lights is different, which can ensure that the colors of the colored lights are different, and at least one of the brightness or saturation is different. On the basis of different colors, the distinction between the colored lights can be further strengthened, and the subsequent verification process can be increased. The number of digits involved in the verification code will correspondingly improve the accuracy and security of subsequent image verification.
  • the hue, saturation and brightness corresponding to the at least two colored light beams may be randomly set.
  • the hue, saturation, and brightness corresponding to at least two colored rays may be set to random values between 0 and 1.
  • the hue and brightness corresponding to the at least two colored lights can be set randomly, and the saturation is a fixed value.
  • the hue and brightness corresponding to the at least two colored rays may be set to random values between 0 and 1, and the saturation may be set to a fixed value (eg, 1) between 0 and 1.
  • the hue and saturation corresponding to the at least two colored lights can be randomly set, and the brightness is a fixed value.
  • the hue and saturation corresponding to the at least two colored rays may be set to random values between 0 and 1, and the brightness may be set to a fixed value (eg, 1) between 0 and 1.
  • the light parameters of the colored light can also be represented by other color models, for example, RGB, L ⁇ , CMYK, NTSC, LMS, YcbCr, etc., which are not limited in this specification.
  • the light emission module 210 may instruct the terminal device 130 to randomly emit at least two colored light beams. In some embodiments, the light emission module 210 may instruct the terminal device 130 to emit at least two colored lights based on a preset rule. For example, different verification scenarios can correspond to different colored lights. For another example, different environmental conditions (eg, ambient brightness) may correspond to different colored lights. For another example, different objects (eg, faces, vehicles, etc.) may correspond to different colored lights.
  • the relevant parameters of the colored light can be stored in the storage device 140, and the light emission module 210 can obtain the relevant parameters of the colored light from the storage device 140, and instruct the terminal device 130 to emit the corresponding colored light.
  • Step 320 instructing the terminal device 130 to collect multiple images of the target during the process of emitting at least two colored light beams.
  • step 320 may be performed by image acquisition module 220 .
  • the terminal device 130 may perform one or more image acquisitions on the target. For example, as shown in FIG. 6 , the light emission module 210 instructs the terminal device 130 to emit light 1, light 2, light 3, light 4, light 5 and light 6, a total of 6 colored light beams. During the emission of each colored light beam, the image acquisition module 220 instructs the terminal device 130 to perform one or more image acquisitions on the target to obtain one or more images of the target (eg, the initial image shown in FIG. 6 ).
  • the number of times of image acquisition may be the default value of the system, or may be adjusted according to different situations. For example, if the ambient brightness is low, the number of acquisitions may be relatively large; conversely, if the ambient brightness is high, the number of acquisitions may be relatively small.
  • the duration of each image acquisition may be a system default value, or may be adjusted according to different situations. For example, if the ambient brightness is low, the duration may be correspondingly longer; conversely, if the ambient brightness is high, the duration may be relatively short.
  • the time interval between multiple image acquisitions may be a system default value (eg, 2 milliseconds, 5 milliseconds, 7 milliseconds, 8 milliseconds, 10 milliseconds, 20 milliseconds, etc.), or may be adjusted according to different situations.
  • system default value eg, 2 milliseconds, 5 milliseconds, 7 milliseconds, 8 milliseconds, 10 milliseconds, 20 milliseconds, etc.
  • the format of the image may include Joint Photographic Experts Group (JPEG), Tagged Image File Format (TIFF), Graphics Interchange Format (GIF), Kodak Flash PiX (FPX), Digital Imaging and Communications in Medicine (DICOM) etc. or any combination thereof.
  • the image may be a two-dimensional image, a three-dimensional image, a four-dimensional image, or the like.
  • Step 330 Select at least two target images corresponding to at least two colored rays from the multiple images.
  • step 330 may be performed by image acquisition module 220 .
  • the image acquisition module 220 may select an image containing the target from the multiple initial images corresponding to the bundle of colored rays as the target image. For example, as shown in FIG. 6 , for 6 colored rays, the image acquisition module 220 can respectively determine 6 target images S1 , S2 , S3 , S4 , S5 and S6 .
  • the image acquisition module 220 may randomly select an image containing a target from a plurality of initial images corresponding to the colored light beam as the target image. In some embodiments, the image acquisition module 220 may select an image that satisfies the preset requirements from the multiple initial images corresponding to the bundle of colored rays as the target image.
  • the preset requirements may include that the image quality meets the quality requirements (eg, brightness greater than a preset brightness threshold, sharpness greater than a preset sharpness threshold, contrast greater than a preset contrast threshold, etc.), the position of the target in the image The requirements are met (for example, it is located at or basically in the middle of the image field of view), and the size of the target in the image meets the requirements (for example, the size of the target reaches 79%, 80%, 90% or 95% of the overall size of the image, etc.), etc. or any combination thereof.
  • the quality requirements eg, brightness greater than a preset brightness threshold, sharpness greater than a preset sharpness threshold, contrast greater than a preset contrast threshold, etc.
  • the size of the target in the image meets the requirements (for example, the size of the target reaches 79%, 80%, 90% or 95% of the overall size of the image, etc.), etc. or any combination thereof.
  • the image acquisition module 220 may preprocess the target images to improve image quality, thereby improving the accuracy of subsequent image verification.
  • the preprocessing may include texture uniform processing. It can be understood that during the image acquisition process, the distance, angle, and background of the terminal device 130 and the target may vary, and accordingly, the texture of each target image may be different.
  • the texture uniform processing can make the texture of each target image the same or basically the same, reduce the interference of texture features, and improve the efficiency and accuracy of subsequent image verification.
  • the preprocessing may further include operations such as image denoising, image enhancement, etc., which can improve the effect of subsequent image verification, which is not limited in this specification.
  • Step 340 Determine a target verification code based on the at least two target images.
  • step 340 may be performed by target verification code determination module 230 .
  • the target verification code determination module 230 may determine the reference image and the verification image based on the at least two target images, and determine the target verification code based on differences (eg, differences in image parameters) between the reference image and the verification image. For more details about determining the target verification code based on at least two target images, reference may be made to FIG. 4 and FIG. 5 and related descriptions, and details are not repeated here.
  • the target verification code determination module 230 may also determine the target verification code based on the first color relationship between the reference image and each verification image. For more content about determining the target verification code based on the first color relationship, please refer to FIG. 10 and related descriptions.
  • step 350 the authenticity of the image is verified by comparing the target verification code with the reference verification codes corresponding to at least two beams of colored light.
  • step 350 may be performed by image authenticity determination module 240 .
  • the reference verification code may be determined based on light parameters of at least two colored light beams. In some embodiments, the reference verification code is determined in a manner similar to the determination of the target verification code. For example, the reference light and the verification light are determined based on at least two colored light rays, and the reference verification code is determined based on the difference between the reference light and the verification light (eg, the difference in light parameters). For more description, reference may be made to FIG. 4 and FIG. 5 , which will not be repeated here.
  • the reference verification code may also be determined based on the reference color and the second color relationship of each verification color. For more content about determining the reference verification code based on the second color relationship, please refer to FIG. 10 and related descriptions.
  • the reference verification code may be determined offline and stored in the storage device 140 together with at least two colored rays (or light parameters) corresponding to the reference verification code.
  • the processing device 112 instructs the terminal device 130 to emit at least two colored lights and collect corresponding images
  • the processing device 112 can read the reference verification codes corresponding to the at least two colored lights from the storage device 140 and perform image authenticity verification.
  • processing device 112 may determine the reference verification code at the same time as or after instructing terminal device 130 to emit at least two colored light beams.
  • the target verification code if the target verification code is consistent with the reference verification code, it indicates that the authenticity verification of the image has passed, and further indicates that the identity verification, authority verification and/or authenticity verification of the target has passed. If the target verification code is inconsistent with the reference verification code, the image authenticity verification fails.
  • the processing device 112 may instruct the terminal device 130 to issue a pass or fail related alert or notification.
  • reminders or notifications may be presented in text, images, audio, video, and the like.
  • FIG. 4 is an exemplary flowchart of determining a target verification code based on a target image according to some embodiments of the present specification.
  • process 400 may be performed by image verification system 100 or 200 .
  • the process 400 can be stored in a storage device (eg, the storage device 140, a storage unit of the processing device 112) in the form of a program or an instruction, and when the processing device 112 or the module shown in FIG. 2 executes the program or the instruction, it can be implemented Process 400.
  • process 400 may be accomplished with one or more additional operations not described below, and/or without one or more operations discussed below. Additionally, the order of operations shown in FIG. 4 is not limiting.
  • Step 410 Determine one of the at least two target images as a verification image, and use the other image in the at least two target images as a reference image.
  • step 410 may be accomplished by the target verification code determination module 230 .
  • the target image corresponding to the verification ray may be determined as the verification image
  • the target image corresponding to the reference ray may be determined as the reference image.
  • the verification image/verification ray and the reference image/reference ray may be randomly set.
  • light 6 can be used as the verification light
  • the target image S6 corresponding to light 6 can be used as the verification image
  • light 1, light 2, light 3, light 4, and light 5 can be used as
  • the target images S1 , S2 , S3 , S4 , and S5 corresponding to the ray 1 , the ray 2 , the ray 3 , the ray 4 , and the ray 5 respectively serve as the reference images.
  • Step 420 for each of the reference images, determine the difference between the reference image and the verification image.
  • step 420 may be accomplished by the target verification code determination module 230 .
  • the difference may reflect the difference between the reference image and the verification image in various dimensions or in various aspects (eg, spatial location, gray value, gradient value, resolution, etc.).
  • the light parameters of the colored light can be represented by the HSV color model.
  • the image parameters of the target image corresponding to the colored light can also be represented by the HSV color model.
  • the difference can reflect the difference in hue, brightness, and saturation between the reference image and the verification image.
  • the "Hue” difference is 1, otherwise it is 0; for “Brightness”, if the brightness of the reference image and the verification image are the same, then The difference is 1, otherwise it is 0; for “Saturation”, if the saturation of the reference image and the verification image are the same, the “Saturation” difference is 1, otherwise it is 0.
  • the combined difference of the "hue” difference, the "brightness” difference and the “saturation” difference may be used as the difference between the reference image and the verification image.
  • the difference may be 011.
  • the differences may be represented in numerical values, vectors, matrices, or the like.
  • the reference image and the verification image may be input into the comparison model, and based on the output of the comparison model, the difference between the reference image and the verification image may be determined.
  • the reference image 510 and the verification image 515 may be input into the comparison model 520 , and based on the output of the comparison model 520 , a difference 530 between the reference image 510 and the verification image 515 may be determined.
  • the alignment model 520 may include a consistency check network.
  • the backbone network of the consistency checking network may include a classification structure (eg, a Resnet family of classification structures).
  • the alignment model 520 may include a transformer structure.
  • the transformer structure please refer to FIG. 7 and related descriptions, and details will not be repeated here.
  • the respective hues of the at least two colored lights may be set randomly, and at least one of brightness or saturation may be a variable value.
  • the hue, brightness and saturation have the same regularity. Taking FIG. 6 as an example, the target image S6 is the verification image, and the target images S1, S2, S3, S4, and S5 are the reference images.
  • the HSV parameters of the six target images S1, S2, S3, S4, S5 and S6 are G1(0,1,0.7), G2(0.3,1,0.8), G3(0.6,1,1), G4( 0.3, 1, 1), G5 (0.9, 1, 0.7), Q1 (0.3, 1, 1), where the S value (saturation) is all 1 (that is, the saturation is a fixed value of 1), and the H value (hue ) and the V value (brightness) are variable values (that is, both hue and brightness are random values between 0-1).
  • the HSV parameter of the verification image is referred to as a "check code”
  • the HSV parameter of the reference image is referred to as a "reference code”.
  • the processing device 112 may use a consistency check network to compare the check code with the five reference codes respectively. Since the S value (saturation) is all 1, it is only necessary to compare the difference in the H value (hue) and the V value (brightness). As shown in Table 1 below, if the hue and brightness of the check code and the reference code are the same, the difference is 11; if the hue and brightness of the check code and the reference code are not the same, the difference is 00; If the code and the reference code have the same hue but different brightness, the difference is 10; if the check code and the reference code have different hues but the same brightness, the difference is 01.
  • the verification code Q1 is compared with the five reference codes G1, G2, G3, G4 and G5 respectively, and the corresponding differences of the five reference images are obtained as follows:
  • the processing device 112 divides both the verification image and the reference image into multiple image blocks (for example, 4 image blocks), uses the image block as a processing unit, and determines the verification image and the reference image based on the transformer structure. The differences between the corresponding image blocks are further synthesized to determine the final difference between the verification image and the reference image.
  • the degree of influence of light on different regions of the target may be different, resulting in certain differences in image parameters (for example, HSV parameters) in different regions of the captured image.
  • image parameters for example, HSV parameters
  • the transformer structure to divide the image into multiple image blocks and then perform subsequent similarity processing and analysis, the refinement processing capability of the model can be improved, thereby improving the verification effect.
  • step 430 the target verification code is determined based on the differences corresponding to the reference images respectively.
  • step 410 may be accomplished by the target verification code determination module 230 .
  • the target verification code determination module 230 may arrange and combine the differences corresponding to the respective reference images to determine the target verification code. In some embodiments, the target verification code determination module 230 may determine the target verification code by arranging the differences corresponding to the respective reference images in sequence in the order of the reference images. For example, in conjunction with the above, the target verification code may be 0010011100. In some embodiments, the target verification code determination module 230 may arrange the differences corresponding to the respective reference images in any order to determine the target verification code.
  • the target verification code determination module 230 may perform other forms of processing on the differences corresponding to the respective reference images to determine the target verification code.
  • vectors, determinants, matrices, etc. are not limited in this specification.
  • differences in hue and brightness between the reference image and the verification image are only exemplary, and differences in other dimensions may also be determined according to actual conditions of image parameters of the reference image and the verification image. For example, if the brightness is set to a constant value, the difference in hue and saturation between the reference image and the verification image can also be determined. For another example, if hue, saturation, and hue are all changed values, the difference in three dimensions between the reference image and the verification image can be determined.
  • the combination of "0" and "1" is used to reflect the difference between the reference image and the verification image, and the difference between the two can also be expressed in other forms, such as letters, numbers, character strings, etc. This does not limit.
  • FIG 7 is a schematic diagram of an alignment model according to some embodiments of the present specification.
  • the alignment model can be a transformer structure.
  • Q represents the verification image, and its HSV parameter is (0.3, 1, 1);
  • G represents the reference image, and its HSV parameter is (0.3, 1, 0.8).
  • the processing device 112 may divide the verification image Q into four image blocks of Q1, Q2, Q3, and Q4, and divide the reference image G into four image blocks of G1, G2, G3, and G4.
  • Each image block is then input to a block encoding module (eg, the patch embedding module shown in FIG. 7 ), each image block is encoded into a token, and the token is input to an encoder module (eg, FIG. 7 ) transformer encoder shown in 7).
  • a block encoding module eg, the patch embedding module shown in FIG. 7
  • each image block is encoded into a token
  • the token is input to an encoder module (eg, FIG. 7 ) transformer encoder shown in 7).
  • the encoder module may be a two-head structure, eg, a first head shown on the left side of FIG. 7 and a second head shown on the right side.
  • the encoder module may repeat the process multiple times (eg, L times) based on each marker code to determine the similarity relationship between the verification image and the reference image.
  • the encoder module may determine 4 sets of similarity matrices based on each marker code, each set includes two matrices H QiGi and V QiGi , which respectively represent image blocks corresponding to the two images Similarity in hue and brightness.
  • the first head may generate the similarity matrix H QiGi and the second head may generate the similarity matrix V QiGi .
  • H Q1G1 (representing the tonal similarity between the first image block of the verification image Q and the reference image G) as an example
  • the sub-diagonal elements of the H QiGi matrix corresponding to the multiple processing can be averaged to obtain the hue similarity score H* of the verification image Q and the reference image G, and the sub-diagonal of the V QiGi matrix corresponding to the multiple processing can be obtained.
  • the elements are averaged to obtain the brightness similarity score V* of the verification image Q and the reference image G.
  • hue similarity score H* and brightness similarity score V* with preset thresholds (for example, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, etc., which can be set based on actual needs), which are greater than the preset thresholds. Then, it is considered that the image parameters (eg, hue, brightness) of the verification image Q and the reference image G are "consistent", and the corresponding difference is marked as 1, otherwise, it is marked as 0.
  • preset thresholds for example, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, etc., which can be set based on actual needs
  • the encoder module can further regress the global image parameters (for example, H value and V value).
  • the encoder module may further include an attention module, and through the attention module, spatial attention is constructed in the verification image Q and the reference image G respectively. By constructing spatial attention, the correlation between image blocks in the image can be considered, and the accuracy of the global spatial relationship can be improved.
  • its loss function in the training process of the transformer structure, can be composed of two parts, namely the color parameter loss L1 and the similarity loss L2, wherein the color parameter loss L1 is a global image obtained by regressing two heads The parameters and their true labels are calculated by the mean square error, and the similarity loss L2 is obtained by calculating the cross-entropy loss of the similarity matrices H* and V* respectively generated in multiple processing processes and the corresponding label matrices H target and V target .
  • a ij represents the color parameter similarity between the i-th image and the j-th image
  • the elements a 11 and a 22 on the main diagonal of the matrix both represent the image itself and its own color parameters. Similarity (for example, hue similarity, brightness similarity), so the value is 1, and the elements on the sub-diagonal line represent the similarity of color parameters between different images, if the color parameters are the same, the value is 1, otherwise The value is 0.
  • each image block contains its own local spatial information, and these local spatial relationships are interactively fused through the attention mechanism of the transformer, so as to obtain a global spatial relationship with a larger receptive field.
  • This global spatial relationship can be Aided model training can extract richer and more effective image features, thereby improving the accuracy of similarity relationships.
  • transformer structure is only exemplary and does not constitute a limitation.
  • number of divisions of image blocks is not limited to 4 blocks, and may also be other numbers, such as 16 blocks, 64 blocks, etc., which is not limited in this specification.
  • colored light is emitted during the process of collecting images, and the target verification code is determined based on the image parameters of the collected image.
  • the reference verification code is determined based on the light parameters of the colored light, and the target verification code and the reference verification code are further compared. code for image authenticity verification, which can solve the problem of camera hijacking in verification scenarios. It is understandable that when illegal user B needs to verify, if illegal user B tries to obtain the verification image or video of legal user A through camera hijacking and verify, in this case, unless the parameters of legal user A's verification image or video It is completely consistent with the light parameters of the colored light emitted by the current system, otherwise it is impossible to pass the verification.
  • the target image is divided into a reference image and a verification image, and the target verification code is determined based on the difference between them (that is, the verification code is determined by self-comparison or self-inquiry); It is divided into reference light and verification light, and the reference verification code is determined based on the difference between them, and then the verification is carried out by comparing whether the target verification code and the reference verification code are consistent, which can eliminate the influence of environmental conditions and improve the accuracy of the verification result.
  • the number of digits of the verification code is more, which greatly reduces the probability of being hacked. Verification is also more accurate and secure. For example, assuming that the number of reference rays is N, the number of verification codes is 2N, and the probability of being illegally broken is 1/2 2N .
  • the influence of light on different regions of the target may be different, resulting in certain differences in image parameters (eg, HSV parameters) in different regions of the captured image, which in turn affects the verification results.
  • image parameters eg, HSV parameters
  • the reference image and the verification image are respectively divided into multiple image blocks, and the subsequent similarity processing and analysis are performed based on the multiple image blocks through the transformer structure, which can improve the model refinement processing capability, thereby improving the verification. Effect.
  • FIG. 10 is a flowchart of another exemplary image verification process according to some embodiments of the present specification. As shown in Figure 10, the process 1000 includes the following steps:
  • Step 1010 acquiring multiple target images.
  • the shooting time of the multiple target images has a corresponding relationship with the irradiation time of the multiple illuminations in the illumination sequence in which the terminal illuminates the target object.
  • step 1010 may be performed by a target image acquisition module.
  • the target object refers to the object that needs to be recognized.
  • the target object may be a specific body part of the user, such as face, fingerprint, palm print, or pupil.
  • the target object refers to the face of a user requiring authentication and/or authorization.
  • the platform needs to verify whether the driver who takes the order is a registered driver user reviewed by the platform, and the target object is the driver's face.
  • the payment system needs to verify the payment authority of the payer, and the target object is the payer's face.
  • a lighting sequence includes multiple lights that illuminate the target object.
  • the colors of different lights in a lighting sequence can be the same or different.
  • the plurality of lights comprise at least two lights of different colors, ie the plurality of lights have multiple colors.
  • the plurality of colors includes at least one reference color and at least one verification color.
  • the verification color is one of the colors that is directly used to verify the authenticity of the image.
  • the reference color is one of the colors used to assist verification in determining the authenticity of the target image.
  • the lighting sequence contains information about each of the multiple lights, such as color information, lighting time, and so on.
  • Color information for multiple lights in a lighting sequence can be represented in the same or different ways.
  • color information for multiple lights can be represented by color categories.
  • the colors of the multiple lights in the lighting sequence can be represented as red, yellow, green, purple, cyan, blue, and red.
  • the color information of multiple lights can be represented by color parameters.
  • the colors of multiple lights in a lighting sequence can be represented as RGB(255, 0, 0), RGB(255, 255, 0), RGB(0, 255, 0), RGB(255, 0, 255), RGB (0, 255, 255), RGB(0, 0, 255).
  • a lighting sequence may also be referred to as a color sequence, which contains color information for multiple lights.
  • the illumination times of the plurality of illuminations in the illumination sequence may include the start time, end time, duration, etc., or any combination thereof, for each illumination plan to illuminate the target object.
  • the start time of illuminating the target object with red light is 14:00
  • the start time of illuminating the target object with green light is 14:02.
  • the durations for which the red light and the green light illuminate the target object are both 0.1 seconds.
  • the durations for different illuminations to illuminate the target object may be the same or different.
  • the irradiation time can be expressed in other ways, which will not be repeated here.
  • the terminal may sequentially emit multiple illuminations in a particular order.
  • the terminal may emit light through the light emitting element.
  • the light-emitting element may include a light-emitting element built in the terminal, for example, a screen, an LED light, and the like.
  • the light-emitting element may also include an externally-connected light-emitting element. For example, external LED lights, light-emitting diodes, etc.
  • the terminal when the terminal is hijacked or attacked, the terminal may receive an instruction to emit light, but does not actually emit light. For more details about the lighting sequence, please refer to FIG. 3 and its related description, which will not be repeated here.
  • a terminal or processing device may generate a lighting sequence randomly or based on preset rules. For example, a terminal or processing device may randomly select a plurality of colors from a color library to generate a lighting sequence.
  • the lighting sequence may be set by the user at the terminal, determined according to the default settings of the target recognition system 100, or determined by the processing device through data analysis, and the like.
  • the terminal or storage device may store the lighting sequence.
  • the target image acquisition module can acquire the illumination sequence from the terminal or the storage device through the network.
  • the multiple target images are images used for target recognition.
  • the formats of multiple target images can include Joint Photographic Experts Group (JPEG), Tagged Image File Format (TIFF), Graphics Interchange Format (GIF), Kodak Flash PiX (FPX), Digital Imaging and Communications in Medicine (DICOM), etc.
  • JPEG Joint Photographic Experts Group
  • TIFF Tagged Image File Format
  • GIF Graphics Interchange Format
  • FPX Kodak Flash PiX
  • DICOM Digital Imaging and Communications in Medicine
  • the multiple target images may be two-dimensional (2D, two-dimensional) images or three-dimensional (3D, three-dimensional) images.
  • the target image acquisition module may acquire multiple target images.
  • the target image acquisition module may send acquisition instructions to the terminal through the network, and then receive multiple target images sent by the terminal through the network.
  • the terminal may send multiple target images to a storage device for storage, and the target image acquisition module may acquire multiple target images from the storage device.
  • the target image may not contain or contain the target.
  • the target image may be captured by the image acquisition device of the terminal, or may be determined based on data (eg, video or image) uploaded by the user.
  • the target recognition system 100 will issue a lighting sequence to the terminal.
  • the terminal can sequentially emit multiple lights according to the lighting sequence.
  • the terminal emits one of the multiple illuminations
  • its image acquisition device may be instructed to acquire one or more images within the illumination time of the illumination.
  • the image capture device of the terminal may be instructed to capture video during the entire illumination period of the plurality of illuminations.
  • the terminal or other computing device eg, the processing device 112 ) may intercept one or more images collected during the illumination time of each illumination from the video according to the illumination time of each illumination.
  • One or more images collected by the terminal during the irradiation time of each illumination can be used as multiple target images.
  • the multiple target images are real images captured by the target object when the target object is illuminated by multiple lights. It can be understood that there is a corresponding relationship between the irradiation time of the multiple lights and the shooting time of the multiple target images. If one image is collected within the irradiation time of a single light, the corresponding relationship is one-to-one; if multiple images are collected within the irradiation time of a single light, the corresponding relationship is one-to-many.
  • the hijacker can upload images or videos through the terminal device.
  • Uploaded images or videos may contain target objects or specific body parts of other users, and/or other objects.
  • the uploaded images or videos may be historical images or videos captured by the terminal or other terminals, or synthesized images or videos.
  • a terminal or other computing device eg, processing device 112 may determine a plurality of target images based on the uploaded image or video.
  • the hijacked terminal may extract one or more images corresponding to each illumination from the uploaded image or video according to the illumination sequence and/or illumination duration of each illumination in the illumination sequence.
  • the lighting sequence contains five lights arranged in sequence, and the hijacker can upload five images through the terminal device.
  • the terminal or other computing device will determine the image corresponding to each of the five lights according to the sequence in which the five images are uploaded. For another example, the irradiation time of the five lights in the lighting sequence is 0.5 seconds, respectively, and the hijacker can upload a 2.5-second video through the terminal.
  • the terminal or other computing device can divide the uploaded video into five videos of 0-0.5 seconds, 0.5-1 seconds, 1-1.5 seconds, 1.5-2 seconds and 2-2.5 seconds, and take a screenshot of each video image.
  • the five images captured from the video correspond to the five illuminations in sequence. At this point, the multiple images are fake images uploaded by the hijacker, not real images of the target object when illuminated by multiple lights.
  • the uploading time of the image or the shooting time in the video may be regarded as the shooting time. It can be understood that when the terminal is hijacked, there is also a corresponding relationship between the irradiation time of multiple lights and the shooting time of multiple images.
  • the multiple colors corresponding to the multiple lights in the lighting sequence include at least one reference color and at least one verification color.
  • one or more of the at least one reference color is the same as one or more of the at least one verification color.
  • the multiple target images include at least one reference image and at least one verification image, each of the at least one reference image corresponds to one of the at least one reference color, and each of the at least one verification image corresponds to one of the at least one verification color. a correspondence of .
  • the target image acquisition module may use the color of the light corresponding to the irradiation time and the image capture time in the light sequence as the color corresponding to the image. Specifically, if the irradiation time of the light corresponds to the shooting time of one or more images, the color of the light is used as the color corresponding to the one or more images. It can be understood that when the terminal is not hijacked or attacked, the colors corresponding to the multiple images should be the same as the multiple colors of the multiple lights in the lighting sequence. For example, the multiple colors of multiple lights in the lighting sequence are "red, yellow, blue, green, purple, and red".
  • the colors corresponding to the multiple images obtained by the terminal should also be “red, yellow”. , blue, green, purple, red”.
  • the colors corresponding to multiple images and multiple colors of multiple lights in the lighting sequence may be different.
  • Step 1020 For each of the at least one reference image, determine a target verification code based on the first color relationship between the reference image and each verification image.
  • step 1020 may be performed by a verification module, wherein determining the first color relationship between the reference image and each verification image may be performed by a first color relationship determination module.
  • the first color relationship between the reference image and the verification image refers to the relationship between the color of the light when the reference image is captured and the color of the light when the verification image is captured.
  • the first color relationship includes the same, different, or similar, and the like.
  • the first color relationship may be represented numerically. For example, the same is represented by "1", and the difference is represented by "0".
  • the at least one first color relationship determined based on the at least one reference image and the at least one verification image may be represented by a vector, and each element in the vector may represent one and at least one of the at least one reference image.
  • a first color relationship between one of the verification images For example, if the first color relationship of each of the 1 reference image and the 5 verification images is the same, different, the same, the same, and different, then the first color relationship of the 1 reference image and the 5 verification images can be represented by a vector (1,0,1,1,0) means.
  • the verification module may determine a target verification code (also referred to as a "first verification code") based on the first color relationship, and the target verification code includes a plurality of sub-codes represented by numerical values.
  • the subcode for each position in the target verification code may represent a first color relationship between one of the at least one reference image and one of the at least one verification image.
  • the first color relationship between the above-mentioned one reference image and five verification images can be represented by the target verification code 10110.
  • the first color relationship determination module may extract the reference color feature of the reference image and the verification color feature of each verification image. The first color relationship determination module may further determine the first color relationship between the reference image and each verification image based on the reference color feature and the verification color feature.
  • the reference color feature refers to the color feature of the reference image.
  • Verifying color features refers to verifying the color features of an image.
  • the color feature of an image refers to information related to the color of the image.
  • the color of the image includes the color of the light when the image is captured, the color of the subject in the image, the color of the background in the image, and the like.
  • the color features may include deep features and/or complex features extracted by a neural network.
  • Color features can be represented in a number of ways.
  • the color feature can be represented based on the color value of each pixel in the image in the color space.
  • a color space is a mathematical model that describes color using a set of numerical values, each of which can represent the color value of a color feature on each color channel of the color space.
  • a color space may be represented as a vector space, each dimension of the vector space representing a color channel of the color space. Color features can be represented by vectors in this vector space.
  • the color space may include, but is not limited to, RGB color space, L ⁇ color space, LMS color space, HSV color space, YCrCb color space, HSL color space, and the like.
  • the RGB color space includes red channel R, green channel G, and blue channel B, and color features can be represented by the color values of each pixel in the image on the red channel R, green channel G, and blue channel B, respectively.
  • color features may be represented by other means (eg, color histograms, color moments, color sets, etc.).
  • the histogram statistics are performed on the color values of each pixel in the image in the color space to generate a histogram representing the color features.
  • a specific operation eg, mean, squared difference, etc. is performed on the color value of each pixel in the image in the color space, and the result of the specific operation represents the color feature of the image.
  • the first color relationship determination module may extract color features of the plurality of target images through a color feature extraction algorithm and/or a color verification model (or a portion thereof).
  • Color feature extraction algorithms include color histogram, color moment, color set, etc.
  • the first color relationship determination module may count the gradient histogram based on the color value of each pixel in the image in each color channel of the color space, so as to obtain the color histogram.
  • the first color relationship determination module may divide the image into multiple regions, and use the set of binary indices of the multiple regions established by the color values of each pixel in the image in each color channel of the color space to determine the image. color set.
  • the first color relationship determination module may determine the similarity between the reference color feature of the reference image and the verification color feature of the verification image, and determine at least one first color relationship based on the similarity and the threshold. For example, if the similarity is greater than the first threshold, it is determined to be the same, if it is smaller than the second threshold, it is determined to be different, or larger than the third threshold and smaller than the first threshold, it is determined to be similar, and so on.
  • the first threshold may be greater than the second threshold and the third threshold, and the third threshold may be greater than the second threshold.
  • the similarity may be characterized by the distance between the reference color feature and the verification color feature. The distance may include, but is not limited to, Euclidean distance, Manhattan distance, Chebyshev distance, Minkowski distance, Mahalanobis distance, included angle cosine distance, and the like.
  • the first color relationship determination module may further acquire the first color relationship based on a color relationship determination layer included in the color verification model.
  • a color relationship determination layer included in the color verification model.
  • Step 1030 for each of the at least one reference color, determine a reference verification code based on the reference color and the second color relationship of each verification color.
  • step 230 may be performed by a verification module, wherein determining the reference color and the second color relationship for each verification color may be performed by a second color relationship determination module.
  • the second color relationship of the reference color and the verification color may indicate whether the two colors are the same, different, or similar.
  • the representation manner of the second color relationship may be similar to that of the first color relationship, and details are not described herein again.
  • the form of the reference verification code (which may also be referred to as a "second verification code") may be similar to the target verification code, which will not be repeated here.
  • the second color relationship determination module may determine its second color relationship based on the reference color and the verification color category or color parameter. For example, if the categories in the reference color and the verification color are the same or the numerical difference of the color parameters is less than a certain threshold, the two colors are judged to be the same, otherwise, the two colors are judged to be different.
  • the second color relationship determination module may extract the first color feature of the color template image of the reference color and the second color feature of the color template image of the verification color.
  • the second color relationship determination module may further determine a second color relationship between the reference color and the verification color based on the first color feature and the second color feature. For example, the second color relationship determination module may calculate the similarity between the first color feature and the second color feature to determine the second color relationship.
  • the first color relationship between the reference image and the verification image corresponds to the second color relationship between the reference color corresponding to the reference image and the verification color corresponding to the verification image.
  • Step 1040 based on the target verification code and the reference verification code, perform image authenticity verification.
  • step 1040 may be performed by a verification module.
  • image authenticity verification may be performed by determining the authenticity of multiple target images.
  • the authenticity of the multiple target images can reflect whether the multiple target images are images captured by the target object under illumination of multiple colors. For example, when the terminal is not hijacked or attacked, its light-emitting element can emit light of multiple colors, and its image acquisition device can record or take pictures of the target object to obtain the target image. At this point, the target image is realistic. For another example, when the terminal is hijacked or attacked, the target image is obtained based on the image or video uploaded by the attacker. At this time, the target image does not have authenticity.
  • the authenticity of the target image can be used to determine whether the terminal's image capture device has been hijacked by an attacker. For example, if at least one target image in the multiple target images is not authentic, it means that the image acquisition device is hijacked. For another example, if more than a preset number of target images in the multiple target images are not authentic, it means that the image acquisition device is hijacked.
  • the verification module may select part or all of at least one first color relationship to construct a corresponding first verification code, and construct a corresponding second verification code based on the second color relationship corresponding to the selected first color relationship , to determine the authenticity of multiple target images. Similar to the first vector and the second vector, the positions of the sub-codes in the first verification code and the second verification code are determined based on the correspondence between the first color relationship and the second color relationship. For example, if the first verification code and the second verification code are different, the multiple target images do not have authenticity. For example, if the first verification code is 10110 and the second verification code is 10111, the multiple target images are not authentic.
  • the verification module may determine the authenticity of the multiple target images based on the same number of sub-codes in the first verification code and the second verification code. For example, if the number of identical subcodes is greater than the fifth threshold, the authenticity of the multiple target images is determined, and if the number of identical subcodes is less than the sixth threshold, it is determined that the multiple target images are not authentic.
  • the fifth threshold is 3
  • the sixth threshold is 1
  • the first verification code is 10110
  • the second verification code is 10111
  • the first, second, and third digits of the first verification code and the second verification code are If the correspondence with the subcode of the fourth bit is the same, it is determined that the multiple target images are authentic.
  • the verification module may determine the authenticity of the plurality of target images based on some or all of the at least one first color relationship and the corresponding second color relationship.
  • the first color relationship and the second color relationship may be represented by vectors.
  • the verification module may select part or all of the at least one first color relationship to construct the first vector, and construct the second vector based on the second color relationship corresponding to the selected first color relationship. Further, the verification module may determine the authenticity of the multiple target images based on the similarity between the first vector and the second vector. For example, if the similarity is greater than the fourth threshold, the multiple target images are authentic. It can be understood that the arrangement order of elements in the first vector and the second vector is determined based on the corresponding relationship between the first color relationship and the second color relationship. For example, the element corresponding to a certain first color relationship in the first vector A is A ij , and the element corresponding to the second color relationship corresponding to the first color relationship in the second vector B is B ij .
  • both the reference image and the verification image are captured under the same ambient light conditions and illuminated by the same light-emitting element. Therefore, based on the relationship between the reference image and the verification image, the In the case of authenticity, the influence of external ambient light and light-emitting elements can be eliminated or weakened, thereby improving the accuracy of light color recognition.
  • the preset thresholds (eg, the fifth threshold, the sixth threshold) set for the image authenticity determination in some embodiments of this specification may be related to the degree of shooting stability.
  • the shooting stability degree is the stability degree when the image acquisition device of the terminal acquires the target image.
  • the preset threshold is positively related to the degree of shooting stability. It can be understood that the higher the shooting stability, the higher the quality of the acquired target image, and the more the color features extracted based on multiple target images can truly reflect the color of the illumination when shooting, and the larger the preset threshold is.
  • the shooting stability may be measured based on a motion parameter of the terminal detected by a motion sensor of the terminal (eg, a vehicle-mounted terminal or a user terminal, etc.).
  • the motion sensor may be a sensor that detects the driving situation of the vehicle, and the vehicle may be the vehicle used by the target user.
  • the target user refers to the user to which the target object belongs.
  • the motion sensor may be a motion sensor on the driver's end or the in-vehicle terminal.
  • the preset threshold may also be related to the shooting distance and the rotation angle.
  • the shooting distance is the distance between the target object when the image acquisition device acquires the target image.
  • the rotation angle is the angle between the front of the target object and the terminal screen when the image acquisition device acquires the target image.
  • both the shooting distance and the rotation angle are negatively correlated with the preset threshold. It can be understood that the shorter the shooting distance, the higher the quality of the obtained target image, and the more the color features extracted based on multiple target images can truly reflect the color of the light at the time of shooting, the larger the preset threshold is. The smaller the rotation angle, the higher the quality of the acquired target image, and similarly, the larger the preset threshold.
  • the shooting distance and rotation angle may be determined based on the target image through image recognition techniques.
  • the verification module may perform specific operations (eg, average, standard deviation, etc.) on the shooting stability, shooting distance, and rotation angle of each target image, and based on the specific calculation, the shooting stability, shooting distance, and The shooting angle determines the preset threshold.
  • specific operations eg, average, standard deviation, etc.
  • the verification module acquiring the stability degree of the terminal when multiple target images are acquired includes acquiring the sub-stability degree of the terminal when each of the multiple target images is captured; and fusing the multiple sub-stability degrees to determine the stability degree.
  • obtaining the shooting distance between the target object and the terminal when the multiple target images are captured by the verification module includes: acquiring the sub-shooting distance between the target object and the terminal when each of the multiple target images is captured; fusing the multiple sub-shooting distances to determine the shooting distance.
  • obtaining the rotation angle of the target object relative to the terminal when the multiple target images are captured by the verification module includes acquiring the sub-rotation angle of the target object relative to the terminal when each of the multiple target images is captured; Fusion to determine the rotation angle.
  • the target system 100 will issue a lighting sequence to the terminal, and acquire from the terminal a target image corresponding to a plurality of lightings in the lighting sequence.
  • the processing device can determine whether the target image is an image captured under the illumination sequence of the target object, and further determine whether the terminal is hijacked or attacked. It is understandable that when an attacker does not know the lighting sequence, it is difficult for the color of the light to be the same as the color of multiple lights in the light sequence when the uploaded image or the image in the uploaded video is captured. Even if the kinds of colors are the same, the order of the positions of each color is difficult to be the same.
  • the method disclosed in this specification can improve the difficulty of an attacker's attack and ensure the security of target identification.
  • Figure 11 is a schematic diagram of a lighting sequence according to some embodiments of the present specification.
  • the plurality of colors of lighting in the lighting sequence may include at least one reference color and at least one verification color.
  • the verification color is one of the colors that is directly used to verify the authenticity of the image.
  • the reference color is a color among the colors used to assist the verification color to determine the authenticity of the target image.
  • the target image corresponding to the reference color also referred to as the reference image
  • the verification module may determine the authenticity of the plurality of target images based on the first color relationship.
  • the illumination sequence e contains multiple benchmark colors of illumination "red light, green light, blue light", and multiple verification colors of illumination "yellow light, purple light... cyan light”
  • the illumination sequence f contains multiple Lighting of the reference color "red light, white light...blue light", and light of multiple verification colors "red light..green light”.
  • multiple colors exist for verification.
  • Multiple verification colors can be identical.
  • the verification color can be red, red, red, red.
  • multiple verification colors can be completely different.
  • the verification color can be red, yellow, blue, green, violet.
  • the plurality of verification colors may be partially the same.
  • the verification color can be yellow, green, purple, yellow, red.
  • there are multiple reference colors and the multiple reference colors may be identical, completely different, or partially identical.
  • the verification color may contain only one color, such as green.
  • the at least one reference color and the at least one verification color may be determined according to default settings of the object recognition system 100, manually set by the user, or determined by the object image acquisition module.
  • the target image acquisition module may randomly select the reference color and the verification color.
  • the target image acquisition module may randomly select a part of the colors from the plurality of colors as at least one reference color, and the remaining colors as at least one verification color.
  • the target image acquisition module may determine at least one reference color and at least one verification color based on preset rules.
  • the preset rules may be rules about verifying the relationship between colors, the relationship between reference colors, and/or the relationship between verifying colors and reference colors, and the like.
  • the preset rule is that the verification color can be generated by fusion based on the reference color, and so on.
  • one or more of the at least one reference color is the same as one or more of the at least one verification color.
  • the at least one reference color and the at least one verification color may be completely identical or partially identical.
  • a certain one of the at least one verification color may be the same as a certain one of the at least one reference color.
  • the verification color can also be determined based on at least one reference color, that is, the specific reference color can be used as the verification color. As shown in Figure 11, in the illumination sequence f, multiple reference colors "red, white...blue” and multiple verification colors "red...green” all contain red.
  • the at least one reference color and the at least one verification color may also have other relationships, which are not limited herein.
  • at least one reference color and at least one verification color are the same or different in color family.
  • at least one reference color belongs to a warm color system (eg, red, yellow, etc.)
  • at least one reference color belongs to a cool color system (eg, gray, etc.).
  • the lighting corresponding to the at least one reference color may be arranged in front of or behind the lighting corresponding to the at least one verification color.
  • illuminations of multiple reference colors “red light, green light, blue light” are arranged in front of illuminations of multiple verification colors “yellow light, purple light...cyan light”.
  • illuminations of multiple reference colors “red light, white light...blue light” are arranged behind multiple verification colors “red light...green light”.
  • the illumination corresponding to the at least one reference color may also be arranged at intervals with the illumination corresponding to the at least one verification color, which is not limited herein.
  • FIG. 12 is a schematic diagram of a color verification model according to some embodiments of the present specification.
  • the verification module may determine the authenticity of the plurality of target images based on the color verification model.
  • the color verification model may include a color feature extraction layer 1230 and a color relationship determination layer 1260 .
  • Color feature extraction layer 1230 and color relationship determination layer 1260 may be used to implement step 1020.
  • the verification module may determine the authenticity of the plurality of target images based on the first color relationship and the second color relationship.
  • the at least one reference image and the at least one verification image may form one or more image pairs.
  • Each image pair includes one of at least one reference image and one of at least one verification image.
  • the color verification model may separately analyze one or more image pairs to determine a first color relationship between the reference image and the verification image in the image pair.
  • at least one reference image includes "1220-1, 1220-2...1220-y”
  • at least one verification image includes "1210-1...1210-x”.
  • the image pair formed by the reference image 1220-y and the verification image 1210-1 is taken as an example to expand.
  • the color feature extraction layer 1230 may extract the reference color feature of the reference image 1220-y and the verification color feature of the verification image 1210-1.
  • the type of the color feature extraction layer 1230 may include a Convolutional Neural Networks (CNN) model such as ResNet, ResNeXt, SE-Net, DenseNet, MobileNet, ShuffleNet, RegNet, EfficientNet, or Inception, or a loop Neural network model.
  • CNN Convolutional Neural Networks
  • the input to the color feature extraction layer 1230 may be an image pair (eg, a reference image 1220-y and a verification image 1210-1).
  • the reference image 1220-y and the verification image 1210-1 can be concatenated and input to the color feature extraction layer 1230.
  • the output of the color feature extraction layer 1230 may be the color features of the image pair.
  • the output of the color feature extraction layer 1230 may be the reference color feature 1250-y of the reference image 1220-y and the verification color feature 1240-1 of the verification image 1210-1.
  • the output of the color feature extraction layer 1230 may be the color feature after splicing the color feature 1240-1 of the verification image 1210-1 and the color feature 1250-y of the reference image 1220-y.
  • the color relationship determination layer 1260 is configured to determine the first color relationship of the image pair based on the color features of the image pair. For example, the verification module may input the reference color feature 1250-y of the reference image 1220-y and the verification color feature 1240-1 of the verification image 1210-1 into the color relationship determination layer 1260, which outputs the reference image 1220-y and Verify the first color relationship of image 1210-1.
  • the verification module may input multiple image pairs consisting of at least one reference image and at least one verification image together into the color verification model.
  • the color verification model can simultaneously output the first color relationship for each of multiple pairs of images.
  • the verification module may input a pair of image pairs into the color verification model.
  • the color verification model may output a first color relationship for the pair of images.
  • the color relationship determination layer 1260 may be a classification model, including but not limited to fully connected layers, deep neural networks, decision trees, and the like.
  • the color verification model is a machine learning model with preset parameters.
  • Preset parameters refer to the model parameters learned during the training of the machine learning model.
  • the model parameters include weight and bias.
  • the preset parameters of the color verification model are determined during the training process.
  • the model acquisition module can train an initial color verification model based on multiple training samples with labels to obtain a color verification model.
  • Training samples include one or more sample image pairs with labels. Each sample image pair includes two target images of the sample target object taken under the same or different lights. The labels of the training samples can indicate whether the sample image pairs were captured with the same color of lighting.
  • the model acquisition module may input the training samples into the initial color verification model, and update the parameters of the initial color feature extraction layer and the initial color relationship determination layer through training until the updated color verification model satisfies preset conditions.
  • the updated color verification model may be designated as a preset parameter color verification model, in other words, the updated color verification model may be designated as a trained color verification model.
  • the preset condition may be that the loss function of the updated color verification model is smaller than the threshold, converges, or the number of training iterations reaches the threshold.
  • the model acquisition module can train the initial color feature extraction layer and the initial color relationship determination layer in the initial color verification model through an end-to-end training method.
  • the end-to-end training method means that the training samples are input into the initial model, the loss value is determined based on the output of the initial model, and the initial model is updated based on the loss value.
  • the initial model may contain multiple sub-models or modules that perform different data processing operations, which are treated as a whole during training and updated simultaneously. For example, in the training of the initial color verification model, at least one sample reference image and at least one verification image can be input into the initial color feature extraction layer, and a loss function can be established based on the output results and labels of the initial color relationship determination layer. The parameters of each initial layer in the initial color verification model are updated simultaneously.
  • the color verification model may be pre-trained by the processing device or a third party and stored in the storage device, and the processing device may directly call the color verification model from the storage device.
  • a color verification model may be used to determine the first color relationship.
  • the color relationship determination model of the color verification model may include only a small number of neurons (eg, two neurons) to make the judgment of whether the colors are the same. Compared with the color recognition network in the traditional method, the structure of the color verification model disclosed in this specification is simpler.
  • the target object analysis based on the color verification model also requires relatively less computing resources (eg, computing space), thereby improving the efficiency of light color recognition.
  • the input of the model can be a target image corresponding to any color.
  • the embodiment of this specification has higher applicability.
  • using the color verification model can improve the reliability of the authenticity verification of the target image, reduce or remove the influence of the performance difference of the terminal equipment, and further determine the authenticity of the target image. It can be understood that there are certain differences in the hardware of different terminals. For example, the color light of the same color emitted by the terminal screens of different manufacturers may have differences in parameters such as saturation and brightness, resulting in a large intra-class gap of the same color.
  • the training samples of the initial color verification model can be taken by terminals with different performances.
  • the initial color verification model is learned in the training process, so that the trained color verification model can consider the terminal performance difference when judging the color of the target object, and more accurately determine the color of the target image.
  • both the reference image and the verification image are taken under the same ambient light conditions. Therefore, when the reference image and the verification image are processed based on the color verification model to determine the authenticity of multiple target images, the influence of external ambient light can be eliminated or reduced.

Abstract

Disclosed in the embodiments of the present description are an image verification method, system and apparatus, and a storage medium. The image verification method comprises: instructing a terminal device to emit at least two beams of colored light to a target; during the process of emitting the at least two beams of colored light, instructing the terminal device to collect a plurality of images of the target; selecting, from the plurality of images, at least two target images that respectively correspond to the at least two beams of colored light; on the basis of the at least two target images, determining a target verification code; and performing image authenticity verification by comparing the target verification code with a reference verification code corresponding to the at least two beams of colored light.

Description

图像验证方法、系统及存储介质Image verification method, system and storage medium
交叉引用cross reference
本申请要求于2021年4月20日提交的中国专利申请号202110423967.0和2022年3月14日提交的中国专利申请号202210246335.6的优先权,其全部内容通过引用并入于此。This application claims priority to Chinese Patent Application No. 202110423967.0 filed on April 20, 2021 and Chinese Patent Application No. 202210246335.6 filed on March 14, 2022, the entire contents of which are incorporated herein by reference.
技术领域technical field
本说明书涉及图像处理技术领域,特别涉及用于图像验证的方法、系统及存储介质。The present specification relates to the technical field of image processing, and in particular, to a method, system and storage medium for image verification.
背景技术Background technique
图像验证是基于图像采集设备采集的图像进行识别或验证的技术,被广泛应用于身份验证、权限验证、目标识别等应用场景。在实际应用中,可能存在通过摄像头劫持等方式进行非法验证的问题。此外,由于环境条件(例如,环境亮度较低、环境中本身存在彩色光线等)可能会对图像采集过程有影响,以及光线对目标不同区域的影响程度可能不同,导致验证结果可能存在较大误差。为了保证目标识别的安全性,需要确定目标图像的真实性。Image verification is a technology for identification or verification based on images collected by image acquisition devices, and is widely used in application scenarios such as identity verification, authority verification, and target recognition. In practical applications, there may be a problem of illegal verification through camera hijacking and other methods. In addition, due to environmental conditions (for example, low ambient brightness, the presence of colored light in the environment, etc.) may have an impact on the image acquisition process, and the impact of light on different areas of the target may be different, resulting in large errors in the verification results. . In order to ensure the security of target recognition, it is necessary to determine the authenticity of the target image.
因此,有必要提供一种图像验证方法、系统及存储介质,以确定目标图像的真实性,提高图像验证的准确性和安全性。Therefore, it is necessary to provide an image verification method, system and storage medium to determine the authenticity of the target image and improve the accuracy and security of image verification.
发明内容SUMMARY OF THE INVENTION
本说明书实施例之一提供一种图像验证方法,所述方法包括:指示终端设备发射至少两束彩色光线至目标;在发射所述至少两束彩色光线过程中,指示所述终端设备采集所述目标的多幅图像;从所述多幅图像中选择所述至少两束彩色光线分别对应的至少两幅目标图像;基于所述至少两幅目标图像,确定目标验证码;通过比较所述目标验证码与所述至少两束彩色光线对应的参考验证码,进行图像真实性验证。One of the embodiments of this specification provides an image verification method, the method includes: instructing a terminal device to emit at least two colored light beams to a target; during the process of transmitting the at least two colored light beams, instructing the terminal device to collect the multiple images of the target; selecting at least two target images respectively corresponding to the at least two colored rays from the multiple images; determining a target verification code based on the at least two target images; verifying the target by comparing the The code and the reference verification code corresponding to the at least two colored light beams are used to verify the authenticity of the image.
本说明书实施例之一提供了一种图像验证系统,所述系统包括:光线发射模块,用于指示终端设备发射至少两束彩色光线至目标。所述图像验证系统还包括图像获取模块,用于指示所述终端设备在发射所述至少两束彩色光线过程中采集所述目标的多幅图像并从所述多幅图像中选择所述至少两束彩色光线分别对应的至少两幅目标图像。所述图像验证系统还包括目标验证码确定模块,用于基于所述至少两幅目标图像,确定目标验证码。所述图像验证系统还包括图像真实性确定模块,用于通过比较所述目标验证码与所述至少两束彩色光线对应的参考验证码,进行图像真实性验证。One of the embodiments of the present specification provides an image verification system, the system includes: a light emission module for instructing a terminal device to emit at least two colored light beams to a target. The image verification system further includes an image acquisition module for instructing the terminal device to collect multiple images of the target during the process of emitting the at least two colored light beams and to select the at least two images from the multiple images. At least two target images corresponding to the bundles of colored rays respectively. The image verification system further includes a target verification code determination module for determining a target verification code based on the at least two target images. The image verification system further includes an image authenticity determination module for performing image authenticity verification by comparing the target verification code with the reference verification codes corresponding to the at least two colored light beams.
本说明书实施例之一提供了一种计算机可读存储介质,所述存储介质存储计算机指令,当计算机读取存储介质中的计算机指令时,计算机执行本说明书披露的图像验证方法。One of the embodiments of this specification provides a computer-readable storage medium, where the storage medium stores computer instructions, and when the computer reads the computer instructions in the storage medium, the computer executes the image verification method disclosed in this specification.
在本说明书中,通过指示终端发射彩色光线,并采集相应的图像以进行图像验证,可 以有效解决摄像头劫持问题。此外,将目标图像分为基准图像和校验图像,基于彼此之间的差异确定目标验证码(即通过自比较或自查询方式确定验证码);相应地,将多束彩色光线分为基准光线和校验光线,基于彼此间的差异确定参考验证码,进而通过比较目标验证码和参考验证码是否一致以进行验证,相应可以排除环境条件的影响,提高验证结果的准确性。进一步地,除了考虑光线或图像的颜色(色调)参数外,还考虑亮度和/或饱和度,相应地,验证码的位数更多,极大降低了被攻破的概率,验证的准确度和安全性也更高。更进一步地,将基准图像和校验图像分别划分为多个图像块,通过transformer结构基于多个图像块进行后续的相似性处理和分析,可以有效解决光线对目标的不同区域的影响程度不同的问题,提升模型精细化处理能力,从而提升验证效果。In this manual, the problem of camera hijacking can be effectively solved by instructing the terminal to emit colored light and collecting corresponding images for image verification. In addition, the target image is divided into a reference image and a verification image, and the target verification code is determined based on the difference between them (that is, the verification code is determined by self-comparison or self-query); correspondingly, the multi-colored rays are divided into reference rays. And the verification light, determine the reference verification code based on the difference between each other, and then verify by comparing whether the target verification code and the reference verification code are consistent, which can eliminate the influence of environmental conditions and improve the accuracy of the verification result. Further, in addition to the color (hue) parameters of the light or image, the brightness and/or saturation are also considered. Accordingly, the number of digits in the verification code is more, which greatly reduces the probability of being broken, and the verification accuracy and Security is also higher. Furthermore, dividing the reference image and the verification image into multiple image blocks, and performing subsequent similarity processing and analysis based on the multiple image blocks through the transformer structure can effectively solve the problem that light affects different areas of the target differently. Problems, improve the model's refined processing ability, thereby improving the verification effect.
附图说明Description of drawings
本说明书将以示例性实施例的方式进一步说明,这些示例性实施例将通过附图进行详细描述。这些实施例并非限制性的,在这些实施例中,相同的编号表示相同的结构,其中:The present specification will be further described by way of example embodiments, which will be described in detail with reference to the accompanying drawings. These examples are not limiting, and in these examples, the same numbers refer to the same structures, wherein:
图1是根据本说明书一些实施例所示的示例性图像验证系统的应用场景示意图;1 is a schematic diagram of an application scenario of an exemplary image verification system according to some embodiments of the present specification;
图2是根据本说明书一些实施例所示的示例性图像验证系统的模块图;2 is a block diagram of an exemplary image verification system according to some embodiments of the present specification;
图3是根据本说明书一些实施例所示的示例性图像验证过程的流程图;3 is a flowchart of an exemplary image verification process according to some embodiments of the present specification;
图4是根据本说明书一些实施例所示的示例性基于目标图像确定目标验证码的流程图;FIG. 4 is an exemplary flowchart of determining a target verification code based on a target image according to some embodiments of the present specification;
图5是根据本说明书一些实施例所示的示例性确定基准图像与校验图像间差异的示意图;FIG. 5 is a schematic diagram illustrating an exemplary determination of the difference between a reference image and a verification image according to some embodiments of the present specification;
图6是根据本说明书一些实施例所示的示例性图像验证过程的示意图;6 is a schematic diagram of an exemplary image verification process according to some embodiments of the present specification;
图7是根据本说明书一些实施例所示的示例性比对模型的示意图;7 is a schematic diagram of an exemplary alignment model shown in accordance with some embodiments of the present specification;
图8A和图8B是根据本说明书一些实施例所示的确定校验图像和基准图像间的相似性的示意图;8A and 8B are schematic diagrams of determining the similarity between a verification image and a reference image according to some embodiments of the present specification;
图9是根据本说明书一些实施例所示的构建空间注意力的示意图;9 is a schematic diagram of constructing spatial attention according to some embodiments of the present specification;
图10是根据本说明书一些实施例所示的另一示例性图像验证过程的流程图;10 is a flowchart of another exemplary image verification process according to some embodiments of the present specification;
图11是根据本说明书一些实施例所示的示例性光照序列的示意图;Figure 11 is a schematic diagram of an exemplary lighting sequence according to some embodiments of the present specification;
图12是根据本说明书一些实施例所示的示例性颜色验证模型的结构示意图。FIG. 12 is a schematic structural diagram of an exemplary color verification model according to some embodiments of the present specification.
具体实施方式Detailed ways
为了更清楚地说明本说明书实施例的技术方案,下面将对实施例描述中所需要使用的附图作简单的介绍。显而易见地,下面描述中的附图仅仅是本说明书的一些示例或实施例, 对于本领域的普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图将本说明书应用于其它类似情景。除非从语言环境中显而易见或另做说明,图中相同标号代表相同结构或操作。In order to illustrate the technical solutions of the embodiments of the present specification more clearly, the following briefly introduces the accompanying drawings used in the description of the embodiments. Obviously, the accompanying drawings in the following description are only some examples or embodiments of the present specification. For those of ordinary skill in the art, without any creative effort, the present specification can also be applied to the present specification according to these drawings. other similar situations. Unless obvious from the locale or otherwise specified, the same reference numbers in the figures represent the same structure or operation.
应当理解,本文使用的“系统”、“装置”、“单元”和/或“模块”是用于区分不同级别的不同组件、元件、部件、部分或装配的一种方法。然而,如果其他词语可实现相同的目的,则可通过其他表达来替换所述词语。It is to be understood that "system", "device", "unit" and/or "module" as used herein is a method used to distinguish different components, elements, parts, parts or assemblies at different levels. However, other words may be replaced by other expressions if they serve the same purpose.
如本说明书和权利要求书中所示,除非上下文明确提示例外情形,“一”、“一个”、“一种”和/或“该”等词并非特指单数,也可包括复数。一般说来,术语“包括”与“包含”仅提示包括已明确标识的步骤和元素,而这些步骤和元素不构成一个排它性的罗列,方法或者设备也可能包含其它的步骤或元素。As shown in the specification and claims, unless the context clearly dictates otherwise, the words "a", "an", "an" and/or "the" are not intended to be specific in the singular and may include the plural. Generally speaking, the terms "comprising" and "comprising" only imply that the clearly identified steps and elements are included, and these steps and elements do not constitute an exclusive list, and the method or apparatus may also include other steps or elements.
本说明书中使用了流程图用来说明根据本说明书的实施例的系统所执行的操作。应当理解的是,前面或后面操作不一定按照顺序来精确地执行。相反,可以按照倒序或同时处理各个步骤。同时,也可以将其他操作添加到这些过程中,或从这些过程移除某一步或数步操作。Flowcharts are used in this specification to illustrate operations performed by a system according to an embodiment of this specification. It should be understood that the preceding or following operations are not necessarily performed in the exact order. Instead, the various steps can be processed in reverse order or simultaneously. At the same time, other actions can be added to these procedures, or a step or steps can be removed from these procedures.
在本说明书中,“图像”可以包括静态图像(例如,单独的图像、视频帧等)或动态图像(例如,视频)。In this specification, "images" may include still images (eg, individual images, video frames, etc.) or dynamic images (eg, video).
目标识别(也可以称之为“目标验证”)是基于图像采集设备获取的目标对象进行生物识别的技术。在一些实施例中,目标对象(也可以称之为“目标”)可以是人脸、指纹、掌纹、瞳孔等。在一些实施例中,目标识别可以应用于权限验证。例如,门禁权限认证、账户支付权限认证等。在一些实施例中,目标识别还可以用于身份验证。例如,员工考勤认证、本人注册身份安全认证等。仅作为示例,目标识别可以基于图像采集设备实时采集到的目标图像和预先获取的生物特征进行匹配,从而验证目标身份。Target recognition (also referred to as "target verification") is a technology for biometric identification based on target objects acquired by image acquisition devices. In some embodiments, the target object (also referred to as a "target") may be a human face, a fingerprint, a palm print, a pupil, or the like. In some embodiments, object recognition may be applied to authorization verification. For example, access control authority authentication, account payment authority authentication, etc. In some embodiments, target recognition may also be used for authentication. For example, employee attendance authentication, personal registration identity security authentication, etc. Merely as an example, the target identification may be based on matching of the target image captured by the image capture device in real time and the pre-acquired biometric features, thereby verifying the target identity.
然而,图像采集设备可能被攻击或劫持,攻击者可以上传虚假的目标图像通过身份验证。例如,攻击者A可以在攻击或劫持图像采集设备后,直接上传用户B的人脸图像。目标识别系统(也可以称之为“图像验证系统”)基于用户B的人脸图像和预先获取的用户B的人脸生物特征进行人脸识别,从而通过用户B的身份验证。However, image capture devices can be hacked or hijacked, and attackers can upload fake target images for authentication. For example, attacker A can directly upload the face image of user B after attacking or hijacking the image acquisition device. The target recognition system (also referred to as an "image verification system") performs face recognition based on user B's face image and pre-acquired user B's face biometrics, thereby passing user B's identity verification.
因此,为了保证目标识别的安全性,需要确定目标图像的真实性,即确定目标图像是图像采集设备在目标识别过程中实时采集到的。Therefore, in order to ensure the security of target recognition, it is necessary to determine the authenticity of the target image, that is, to determine that the target image is collected in real time by the image acquisition device during the target recognition process.
图1是根据本说明书一些实施例所示的示例性图像验证系统的应用场景示意图。在一些实施例中,图像验证系统100可以应用于面部识别验证、目标验证(例如,车辆验证、证件验证等)等场景。在一些实施例中,如图1所示,图像验证系统100(也可以称之为“目标 识别系统”)可以包括服务器110、网络120、终端设备(也可以称之为“终端”)130和存储设备140。FIG. 1 is a schematic diagram of an application scenario of an exemplary image verification system according to some embodiments of the present specification. In some embodiments, the image verification system 100 may be applied to scenarios such as facial recognition verification, object verification (eg, vehicle verification, document verification, etc.). In some embodiments, as shown in FIG. 1, an image verification system 100 (also referred to as an "object recognition system") may include a server 110, a network 120, a terminal device (also referred to as a "terminal") 130 and storage device 140 .
服务器110可以是单一服务器或服务器组。服务器组可以是集中式或分布式的(例如,服务器110可以是分布式系统)。在一些实施例中,服务器110可以是本地的或者远程的。例如,服务器110可以通过网络120访问存储在终端设备130和/或存储设备140中的信息和/或数据。再例如,服务器110可以直接连接到终端设备130和/或存储设备140以访问存储的信息和/或数据。在一些实施例中,服务器110可以在云平台上实现。仅作为示例,云平台可以包括私有云、公共云、混合云、社区云、分布云、内部云、多层云等或其任意组合。 Server 110 may be a single server or a group of servers. The server group may be centralized or distributed (eg, server 110 may be a distributed system). In some embodiments, server 110 may be local or remote. For example, the server 110 may access information and/or data stored in the terminal device 130 and/or the storage device 140 through the network 120 . For another example, the server 110 may be directly connected to the terminal device 130 and/or the storage device 140 to access stored information and/or data. In some embodiments, server 110 may be implemented on a cloud platform. By way of example only, cloud platforms may include private clouds, public clouds, hybrid clouds, community clouds, distributed clouds, internal clouds, multi-tier clouds, etc., or any combination thereof.
在一些实施例中,服务器110可以包括处理设备112,用于实现本说明书描述的示例性方法和/或系统。例如,处理设备112可以指示终端设备130发射至少两束彩色光线至目标,并在发射彩色光线过程中,指示终端设备130采集目标的多幅图像。处理设备112可以从多幅图像中选择与至少两束彩色光线分别对应的至少两幅(也可以称为“多幅”)目标图像,并基于至少两幅目标图像,确定目标验证码。进一步地,处理设备112可以通过比较目标验证码与至少两束彩色光线对应的参考验证码,进行图像真实性验证。又例如,处理设备112可以确定第一颜色关系和第二颜色关系,以及确定多幅目标图像的真实性等。在处理过程中,处理设备112可以直接或通过网络120从目标识别系统100的其他组件(例如,存储设备140、终端130)获取数据(例如,指令)和/或将处理后的数据发送给其他组件进行存储或显示。In some embodiments, server 110 may include processing device 112 for implementing the example methods and/or systems described in this specification. For example, the processing device 112 may instruct the terminal device 130 to emit at least two colored rays to the target, and instruct the terminal device 130 to collect multiple images of the target during the process of emitting the colored rays. The processing device 112 may select at least two (may also be referred to as "multiple") target images corresponding to the at least two colored rays from the plurality of images, and determine the target verification code based on the at least two target images. Further, the processing device 112 may perform image authenticity verification by comparing the target verification code with the reference verification codes corresponding to the at least two colored rays. For another example, the processing device 112 may determine the first color relationship and the second color relationship, and determine the authenticity of the plurality of target images, and the like. During processing, processing device 112 may obtain data (eg, instructions) from other components of object recognition system 100 (eg, storage device 140 , terminal 130 ) directly or through network 120 and/or send the processed data to others components for storage or display.
在一些实施例中,服务器110和/或处理设备112可以通过计算设备实现,例如,包括处理器、存储器、网络接口、通信接口、显示设备等的计算设备。In some embodiments, server 110 and/or processing device 112 may be implemented by a computing device, eg, a computing device including a processor, memory, network interface, communication interface, display device, and the like.
网络120可以促进数据和/或信息的交换。在一些实施例中,图像验证系统100中的组件(例如,服务器110、终端设备130、存储设备140)可以通过网络120向图像验证系统100中的其他组件发送信息和/或数据。例如,服务器110可以通过网络120从终端设备130和/或存储设备140获取数据。在一些实施例中,网络120可以是有线网络或无线网络中的任意一种或多种。例如,网络120可以包括电缆网络、光纤网络、电信网络、互联网、局域网络(LAN)、广域网络(WAN)、无线局域网络(WLAN)、城域网(MAN)、公共交换电话网络(PSTN)、蓝牙网络、紫蜂网络(ZigBee)、近场通信(NFC)网络等或其任意组合。在一些实施例中,目标识别系统100中各部分之间的网络连接可以采用上述一种方式,也可以采取多种方式。在一些实施例中,网络120可以是点对点的、共享的、中心式的等各种拓扑结构或者多种拓扑结构的组合。在一些实施例中,网络120可以包括一个或以上网络接入点。例如,网络120可以包括有线或无线网络接入点,例如,基站和/或网络交换点120-1、120-2、…,通过这些网络接入点,图像验证系统100的一个或多个组件可连接到网络120以 交换数据和/或信息。 Network 120 may facilitate the exchange of data and/or information. In some embodiments, components in image verification system 100 (eg, server 110 , terminal device 130 , storage device 140 ) may send information and/or data to other components in image verification system 100 via network 120 . For example, the server 110 may acquire data from the terminal device 130 and/or the storage device 140 through the network 120 . In some embodiments, the network 120 may be any one or more of a wired network or a wireless network. For example, the network 120 may include a cable network, a fiber optic network, a telecommunications network, the Internet, a local area network (LAN), a wide area network (WAN), a wireless local area network (WLAN), a metropolitan area network (MAN), a public switched telephone network (PSTN) , Bluetooth network, ZigBee network (ZigBee), Near Field Communication (NFC) network, etc. or any combination thereof. In some embodiments, the network connection between the various parts in the object recognition system 100 may adopt one of the above-mentioned manners, or may adopt multiple manners. In some embodiments, the network 120 may be of various topologies such as point-to-point, shared, centralized, or a combination of topologies. In some embodiments, network 120 may include one or more network access points. For example, network 120 may include wired or wireless network access points, eg, base stations and/or network switching points 120-1, 120-2, . . . , through which one or more components of image verification system 100 are used. A network 120 may be connected to exchange data and/or information.
终端设备130可以采集目标的图像。在一些实施例中,终端设备130可以包括图像采集设备130-1、移动设备130-2、平板计算机130-3、笔记本电脑130-4等或其任意组合。在一些实施例中,图像采集设备130-1可以包括摄像头、相机、图像传感器等或其任意组合。在一些实施例中,图像采集设备130-1可以拍摄目标对象,获取多幅目标图像。在一些实施例中,终端设备130可以包括任何具有图像采集功能的设备。在一些实施例中,在采集图像过程中,终端设备130可以发射光线(例如,彩色光线)至目标。在一些实施例中,终端设备130可以通过其自身的发光元件(例如,屏幕、LED灯等)发射光线。在一些实施例中,终端设备130可以通过与其相连接的发光设备(例如,外接LED灯、发光二极管等)发射光线。在一些实施例中,终端设备130可以通过网络120与处理设备112通信,并将拍摄的目标的图像传输至处理设备112。The terminal device 130 may capture an image of the target. In some embodiments, the terminal device 130 may include an image capture device 130-1, a mobile device 130-2, a tablet computer 130-3, a laptop computer 130-4, etc., or any combination thereof. In some embodiments, the image capture device 130-1 may include a camera, a camera, an image sensor, etc., or any combination thereof. In some embodiments, the image capturing device 130-1 may photograph the target object and acquire multiple target images. In some embodiments, the terminal device 130 may include any device having an image capture function. In some embodiments, the terminal device 130 may emit light (eg, colored light) to the target during image acquisition. In some embodiments, the terminal device 130 may emit light through its own light emitting elements (eg, screen, LED lights, etc.). In some embodiments, the terminal device 130 may emit light through a light-emitting device (eg, an external LED lamp, a light-emitting diode, etc.) connected to it. In some embodiments, the terminal device 130 may communicate with the processing device 112 through the network 120 and transmit the image of the captured object to the processing device 112 .
存储设备140可以用于存储数据(例如,光照序列、多幅目标图像、第一颜色关系、第二颜色关系等)和/或指令。在一些实施例中,存储设备140可以存储从服务器110和/或终端设备130获取的数据(例如,终端设备130采集的图像)。在一些实施例中,存储设备150可以存储供服务器110执行或使用的数据和/或指令(例如,用于实现本说明书描述的示例性方法的数据和/或指令)。存储设备140可以包括一个或多个存储组件,每个存储组件可以是一个独立的设备,也可以是其他设备的一部分。在一些实施例中,存储设备140可包括随机存取存储器(RAM)、只读存储器(ROM)、大容量存储器、可移动存储器、易失性读写存储器等或其任意组合。在一些实施例中,存储设备140可在云平台上实现。仅作为示例,云平台可以包括私有云、公共云、混合云、社区云、分布云、内部云、多层云等或其任意组合。在一些实施例中,存储设备140可以集成或包括在目标识别系统100的一个或多个其他组件(例如,处理设备112、终端130或其他可能的组件)中。 Storage device 140 may be used to store data (eg, lighting sequences, multiple target images, first color relationships, second color relationships, etc.) and/or instructions. In some embodiments, the storage device 140 may store data obtained from the server 110 and/or the terminal device 130 (eg, images captured by the terminal device 130 ). In some embodiments, storage device 150 may store data and/or instructions for execution or use by server 110 (eg, data and/or instructions for implementing the example methods described herein). The storage device 140 may include one or more storage components, and each storage component may be an independent device or a part of other devices. In some embodiments, storage device 140 may include random access memory (RAM), read only memory (ROM), mass storage, removable memory, volatile read-write memory, the like, or any combination thereof. In some embodiments, storage device 140 may be implemented on a cloud platform. By way of example only, cloud platforms may include private clouds, public clouds, hybrid clouds, community clouds, distributed clouds, internal clouds, multi-tier clouds, etc., or any combination thereof. In some embodiments, storage device 140 may be integrated or included in one or more other components of object recognition system 100 (eg, processing device 112, terminal 130, or other possible components).
在一些实施例中,存储设备140可以与网络120连接以实现与图像验证系统100中的其他组件(例如,服务器110、终端设备130)之间的通信。在一些实施例中,存储设备140可以直接与图像验证系统100的其他组件(例如,服务器110、终端设备130)连接或通信。在一些实施例中,存储设备140可以是服务器110或终端设备130的一部分。In some embodiments, the storage device 140 may be connected to the network 120 to enable communication with other components in the image verification system 100 (eg, the server 110, the terminal device 130). In some embodiments, the storage device 140 may directly connect or communicate with other components of the image verification system 100 (eg, the server 110, the terminal device 130). In some embodiments, storage device 140 may be part of server 110 or terminal device 130 .
需要注意的是,以上对于目标识别系统描述,仅为描述方便,并不能把本说明书限制在所举实施例范围之内。可以理解,对于本领域的技术人员来说,在了解该系统的原理后,可能在不背离这一原理的情况下,对系统及其组件作出改变。It should be noted that the above description of the target recognition system is only for the convenience of description, and does not limit the description to the scope of the illustrated embodiments. It will be appreciated that those skilled in the art, with an understanding of the principles of the system, may make changes to the system and its components without departing from such principles.
图2是根据本说明书一些实施例所示的示例性图像验证系统的模块图。在一些实施例中,图像验证系统200可以通过处理设备112实现。在一些实施例中,图像验证系统200可 以包括光线发射模块210、图像获取模块(也可以称之为“目标图像获取模块”)220、目标验证码确定模块230和图像真实性确定模块(也可以称之为“验证模块”)240。FIG. 2 is a block diagram of an exemplary image verification system shown in accordance with some embodiments of the present specification. In some embodiments, image verification system 200 may be implemented by processing device 112 . In some embodiments, the image verification system 200 may include a light emission module 210, an image acquisition module (which may also be referred to as a "target image acquisition module") 220, a target verification code determination module 230, and an image authenticity determination module (which may also be referred to as Referred to as an "authentication module") 240.
光线发射模块210可以指示终端设备130发射至少两束彩色光线(至少两束彩色光线也可以称之为“光照序列”)至目标。在一些实施例中,光线发射模块210可以指示终端设备130随机发射至少两束彩色光线。在一些实施例中,光线发射模块210可以基于预设规则指示终端设备130发射至少两束彩色光线。关于发射光线的更多内容可以参见步骤310及其相关描述,在此不再赘述。The light emission module 210 may instruct the terminal device 130 to emit at least two colored lights (at least two colored lights may also be referred to as "lighting sequences") to the target. In some embodiments, the light emission module 210 may instruct the terminal device 130 to randomly emit at least two colored light beams. In some embodiments, the light emission module 210 may instruct the terminal device 130 to emit at least two colored lights based on a preset rule. For more details about the emitted light, please refer to step 310 and its related description, which will not be repeated here.
图像获取模块220可以指示终端设备130在发射至少两束彩色光线过程中采集目标的多幅图像。在一些实施例中,图像获取模块220可以从多幅图像中选择至少两束彩色光线分别对应的至少两幅目标图像。关于图像获取的更多内容可以参见步骤320和330及其相关描述,在此不再赘述。The image acquisition module 220 may instruct the terminal device 130 to acquire multiple images of the target during the process of emitting at least two colored light beams. In some embodiments, the image acquisition module 220 may select at least two target images respectively corresponding to at least two colored rays from the plurality of images. For more content about image acquisition, refer to steps 320 and 330 and their related descriptions, which will not be repeated here.
在一些实施例中,目标图像获取模块可以用于获取多幅目标图像,多幅目标图像的拍摄时间与照射到目标对象的光照序列中多个光照的照射时间具有对应关系,多个光照有多个颜色,多个颜色包括至少一个基准颜色和至少一个验证颜色,多幅目标图像包括至少一幅验证图像(也可以称之为“校验图像”)和至少一幅基准图像,至少一幅基准图像的每一幅与至少一幅基准颜色中的一个对应,至少一幅验证图像的每一幅与至少一个验证颜色中的一个对应。在一些实施例中,至少一个基准颜色中的一个或多个与至少一个验证颜色中的一个或多个相同。关于基准颜色、验证颜色的更多内容可以参见图11及其相关说明。In some embodiments, the target image acquisition module may be configured to acquire multiple target images, the shooting time of the multiple target images has a corresponding relationship with the irradiation time of the multiple lightings in the lighting sequence irradiating the target object, and the multiple lightings have a corresponding relationship. colors, the plurality of colors include at least one reference color and at least one verification color, and the plurality of target images include at least one verification image (also referred to as "verification image") and at least one reference image, and at least one reference image Each of the images corresponds to one of the at least one reference color, and each of the at least one verification image corresponds to one of the at least one verification color. In some embodiments, one or more of the at least one reference color is the same as one or more of the at least one verification color. For more information on reference color and verification color, please refer to Figure 11 and its related descriptions.
目标验证码确定模块230可以基于至少两幅目标图像,确定目标验证码。在一些实施例中,目标验证码确定模块230可以基于至少两幅目标图像确定基准图像和校验图像,并基于基准图像和校验图像的差异(例如,图像参数的差异)确定目标验证码。在一些实施例中,目标验证码确定模块230可以将至少两幅目标图像中的其中一幅确定为校验图像,并将至少两幅目标图像中的其他图像作为基准图像。关于目标验证码的更多内容可以参见步骤340及其相关描述,在此不再赘述。The target verification code determination module 230 may determine the target verification code based on at least two target images. In some embodiments, the target verification code determination module 230 may determine the reference image and the verification image based on the at least two target images, and determine the target verification code based on differences (eg, differences in image parameters) between the reference image and the verification image. In some embodiments, the target verification code determination module 230 may determine one of the at least two target images as a verification image, and use the other image of the at least two target images as a reference image. For more content about the target verification code, refer to step 340 and its related description, which will not be repeated here.
图像真实性确定模块240可以通过比较目标验证码与至少两束彩色光线对应的参考验证码,进行图像真实性验证。如果目标验证码与参考验证码一致,则说明图像真实性验证通过,进而表示目标的身份认证、权限验证和/或真实性验证通过。如果目标验证码与参考验证码不一致,则说明图像真实性验证未通过。关于图像真实性确定的更多内容可以参见步骤350及其相关描述,在此不再赘述。The image authenticity determination module 240 may perform image authenticity verification by comparing the target verification code with the reference verification codes corresponding to at least two colored rays. If the target verification code is consistent with the reference verification code, it means that the image authenticity verification has passed, and further indicates that the target's identity verification, authority verification and/or authenticity verification have passed. If the target verification code is inconsistent with the reference verification code, the image authenticity verification fails. For more details about the determination of the authenticity of the image, reference may be made to step 350 and its related description, which will not be repeated here.
在一些实施例中,目标识别系统还可以包括第一颜色关系确定模块、第二颜色关系确定模块和模型获取模块。In some embodiments, the target recognition system may further include a first color relationship determination module, a second color relationship determination module, and a model acquisition module.
第一颜色关系确定模块可以用于对至少一幅基准图像中的每一幅,确定基准图像和每幅验证图像的第一颜色关系。The first color relationship determination module may be configured to determine, for each of the at least one reference image, the first color relationship between the reference image and each verification image.
在一些实施例中,第一颜色关系确定模块可以提取基准图像的基准颜色特征和每一幅验证图像的验证颜色特征;以及基于基准颜色特征和验证颜色特征,确定基准图像和每一幅验证图像的第一颜色关系。In some embodiments, the first color relationship determination module may extract the reference color feature of the reference image and the verification color feature of each verification image; and determine the reference image and each verification image based on the reference color feature and the verification color feature The first color relationship of .
在一些实施例中,至少一幅基准图像中的每一幅和至少一幅验证图像中的每一幅组成至少一对图像对,对于至少一对图像对中每一对,第一颜色关系确定模块可以基于颜色验证模型处理图像对,确定图像对中基准图像和验证图像的第一颜色关系,颜色验证模型为预置参数的机器学习模型。在一些实施例中,颜色验证模型包括颜色特征提取层和颜色关系确定层,颜色特征提取层用于提取图像对的颜色特征;颜色关系确定层基于图像对的颜色特征,确定图像对中基准图像和验证图像的第一颜色关系。In some embodiments, each of the at least one reference image and each of the at least one verification image form at least one pair of images, and for each pair of the at least one pair of images, the first color relationship is determined The module can process the image pair based on the color verification model, and determine the first color relationship between the reference image and the verification image in the image pair, and the color verification model is a machine learning model with preset parameters. In some embodiments, the color verification model includes a color feature extraction layer and a color relationship determination layer, where the color feature extraction layer is used to extract color features of the image pair; the color relationship determination layer determines the reference image in the image pair based on the color features of the image pair and verify the first color relationship of the image.
第二颜色关系确定模块可以用于对至少一个基准颜色中的每一个,确定基准颜色和每个验证颜色的第二颜色关系。The second color relationship determination module may be configured to determine, for each of the at least one reference color, a second color relationship between the reference color and each verification color.
在一些实施例中,验证模块可以用于基于至少一个第一颜色关系确定目标验证码和基于至少一个第二颜色关系确定参考验证码,以及基于目标验证码和参考验证码确定多幅目标图像的真实性。关于基于目标验证码和参考验证码确定多幅目标图像的真实性的更多内容可以参见图10及其相关描述。In some embodiments, the verification module may be configured to determine a target verification code based on the at least one first color relationship and a reference verification code based on the at least one second color relationship, and determine the target verification code based on the target verification code and the reference verification code. authenticity. For more details about determining the authenticity of multiple target images based on the target verification code and the reference verification code, please refer to FIG. 10 and related descriptions.
模型获取模块可以用于获取颜色验证模型。颜色验证模型的预置参数通过端到端的训练方式获得。在一些实施例中,训练过程包括:获取多个训练样本,多个训练样本中的每一个包括样本图像对以及样本标签,样本标签表示样本图像对中的样本图像是否是在相同颜色的光照射下拍摄而成;以及基于多个训练样本训练初始颜色验证模型,确定颜色验证模型的预置参数。The model acquisition module can be used to acquire color verification models. The preset parameters of the color verification model are obtained through end-to-end training. In some embodiments, the training process includes acquiring a plurality of training samples, each of the plurality of training samples including a sample image pair and a sample label, the sample label indicating whether the sample images in the sample image pair are illuminated by light of the same color and the initial color verification model is trained based on multiple training samples, and the preset parameters of the color verification model are determined.
关于目标图像获取模块、第一颜色关系确定模块、第二颜色关系确定模块、验证模块和模型获取模块的更多详细描述可以参见图10-图12,在此不再赘述。For more detailed description of the target image acquisition module, the first color relationship determination module, the second color relationship determination module, the verification module and the model acquisition module, please refer to FIGS.
应当理解,图2所示的图像验证系统200及其模块可以利用各种方式实现,例如,通过硬件、软件或者软件和硬件的结合实现。本说明书的系统及其模块不仅可以有诸如超大规模集成电路或门阵列、诸如逻辑芯片、晶体管等的半导体、或者诸如现场可编程门阵列、可编程逻辑设备等的可编程硬件设备的硬件电路实现,也可以用例如由各种类型的处理器所执行的软件实现,还可以由上述硬件电路和软件的结合(例如,固件)来实现。It should be understood that the image verification system 200 and its modules shown in FIG. 2 can be implemented in various ways, for example, implemented by hardware, software, or a combination of software and hardware. The system and its modules of this specification can be implemented not only by hardware circuits such as very large scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, etc., or programmable hardware devices such as field programmable gate arrays, programmable logic devices, etc. , can also be implemented by, for example, software executed by various types of processors, and can also be implemented by a combination of the above-mentioned hardware circuits and software (eg, firmware).
需要注意的是,以上对于图像验证系统200及其模块的描述,仅为描述方便,并不能把本说明书限制在所举实施例范围之内。可以理解,对于本领域的技术人员来说,在了解该 系统的原理后,可能在不背离这一原理的情况下,对各个模块进行任意组合,或者构成子系统与其他模块连接。在一些实施例中,图2中披露的光线发射模块210、图像获取模块220、目标验证码确定模块230和图像真实性确定模块240可以是一个系统中的不同模块,也可以是一个模块实现上述的两个或两个以上模块的功能。例如,各个模块可以共用一个存储模块,各个模块也可以分别具有各自的存储模块。诸如此类的变形,均在本说明书的保护范围之内。It should be noted that the above description of the image verification system 200 and its modules is only for the convenience of description, and does not limit the description to the scope of the illustrated embodiments. It can be understood that for those skilled in the art, after understanding the principle of the system, various modules may be combined arbitrarily, or a subsystem may be formed to connect with other modules without departing from the principle. In some embodiments, the light emission module 210 , the image acquisition module 220 , the target verification code determination module 230 and the image authenticity determination module 240 disclosed in FIG. 2 may be different modules in a system, or may be one module to implement the above function of two or more modules. For example, each module may share one storage module, and each module may also have its own storage module. Such deformations are all within the protection scope of this specification.
图3是根据本说明书一些实施例所示的示例性图像验证过程的流程图。在一些实施例中,流程300可以由图像验证系统100或200执行。例如,流程300可以以程序或指令的形式存储在存储设备(例如,存储设备140、处理设备112的存储单元)中,当处理设备112或图2所示的模块执行程序或指令时,可以实现流程300。在一些实施例中,流程300可以利用以下未描述的一个或以上附加操作,和/或不通过以下所讨论的一个或以上操作完成。另外,如图3所示的操作的顺序并非限制性的。3 is a flowchart of an exemplary image verification process shown in accordance with some embodiments of the present specification. In some embodiments, process 300 may be performed by image verification system 100 or 200 . For example, the process 300 can be stored in a storage device (eg, the storage device 140, a storage unit of the processing device 112) in the form of a program or an instruction, and when the processing device 112 or the module shown in FIG. 2 executes the program or the instruction, it can be implemented Process 300. In some embodiments, process 300 may be accomplished with one or more additional operations not described below, and/or without one or more operations discussed below. Additionally, the order of operations shown in FIG. 3 is not limiting.
步骤310,指示终端设备130发射至少两束彩色光线至目标。在一些实施例中,步骤310可以由光线发射模块210执行。 Step 310, instructing the terminal device 130 to emit at least two colored light beams to the target. In some embodiments, step 310 may be performed by the light emission module 210 .
目标指需要进行图像验证的对象。在一些实施例中,目标可以是需要进行身份验证和/或权限认证的用户的面部。例如,在在线打车场景中,打车平台需要验证接单司机是否是平台审核通过的注册司机用户,则目标是接单司机的面部。又例如,在支付场景中,支付系统需要验证支付人员的支付权限,则目标是支付人员的面部。在一些实施例中,目标可以是需要进行真实性验证的物体。例如,在车辆验证场景中,车辆验证平台需要验证车辆是否是真实车辆,则目标可以是待验证的车辆。Target refers to the object that requires image validation. In some embodiments, the target may be the face of a user requiring authentication and/or authorization. For example, in an online taxi-hailing scenario, the taxi-hailing platform needs to verify whether the driver who takes the order is a registered driver user approved by the platform, and the target is the face of the driver who takes the order. For another example, in a payment scenario, the payment system needs to verify the payment authority of the payer, and the target is the payer's face. In some embodiments, the target may be an object requiring authenticity verification. For example, in a vehicle verification scenario, the vehicle verification platform needs to verify whether the vehicle is a real vehicle, and the target can be the vehicle to be verified.
在一些实施例中,终端设备130可以通过其自身的发光元件(例如,屏幕、LED灯等)发射彩色光线。在一些实施例中,终端设备130可以通过与其相连接的发光设备(例如,外接LED灯、发光二极管等)发射彩色光线。In some embodiments, the terminal device 130 may emit colored light through its own light emitting elements (eg, screen, LED lights, etc.). In some embodiments, the terminal device 130 may emit colored light through a light-emitting device (eg, an external LED lamp, a light-emitting diode, etc.) connected thereto.
在一些实施例中,终端设备130可以按时间先后顺序依次发射至少两束彩色光线。在一些实施例中,各束彩色光线的持续时长可以相同,也可以不同。In some embodiments, the terminal device 130 may sequentially emit at least two colored light beams in chronological order. In some embodiments, the durations of each colored light beam may be the same or different.
在一些实施例中,为了保证在彩色光线的持续时长内能够采集到目标的图像,同时又避免持续时长过长而影响用户体验,各束彩色光线的持续时长需要设定在预设范围内。在一些实施例中,预设范围可以是100-500毫秒。在一些实施例中,预设范围可以是150-450毫秒。在一些实施例中,预设范围可以是200-400毫秒。在一些实施例中,预设范围可以是250-350毫秒。在一些实施例中,预设范围可以是300毫秒。在一些实施例中,预设范围可以是250毫秒。在一些实施例中,预设范围可以是200毫秒。In some embodiments, in order to ensure that the image of the target can be captured within the duration of the colored light, and at the same time to avoid affecting the user experience due to the long duration, the duration of each colored light needs to be set within a preset range. In some embodiments, the preset range may be 100-500 milliseconds. In some embodiments, the preset range may be 150-450 milliseconds. In some embodiments, the preset range may be 200-400 milliseconds. In some embodiments, the preset range may be 250-350 milliseconds. In some embodiments, the preset range may be 300 milliseconds. In some embodiments, the preset range may be 250 milliseconds. In some embodiments, the preset range may be 200 milliseconds.
在一些实施例中,不同条件可以对应不同的持续时长。例如,如果环境亮度较低,则 持续时长可以相对较长;反之,如果环境亮度较高,则持续时长可以相对较短。In some embodiments, different conditions may correspond to different durations. For example, if the ambient brightness is low, the duration may be relatively long; conversely, if the ambient brightness is high, the duration may be relatively short.
在一些实施例中,终端设备130可以发射多束彩色光线,其中至少两束彩色光线的颜色不同。通过设置不同颜色的彩色光线,可以使得后续采集的图像具有一定区分度以保证真实性验证的效果,同时保证对目标(例如,面部)的成像效果较好。在一些实施例中,彩色光线的光线参数可以通过HSV颜色模型表示,包括色调(H)、饱和度(S)和亮度(V)。相应地,多束彩色光线中至少两束的色调(可以体现颜色的不同)不同。In some embodiments, the terminal device 130 may emit multiple colored light beams, wherein at least two colored light beams have different colors. By setting colored lights of different colors, the subsequently collected images can have a certain degree of distinction to ensure the effect of authenticity verification, and at the same time, to ensure that the imaging effect of the target (for example, the face) is better. In some embodiments, the light parameters of the colored light can be represented by the HSV color model, including hue (H), saturation (S), and brightness (V). Correspondingly, at least two of the multiple colored light beams have different hues (which may reflect the difference in color).
在一些实施例中,至少两束彩色光线分别对应的色调可以随机设定,而亮度或饱和度中的至少一个可以为变化值。例如,可以将至少两束彩色光线分别对应的色调设置为0到1之间的随机值,而将亮度或饱和度之一设置为0到1之间的变化值。又例如,可以将至少两束彩色光线分别对应的色调设置为0到1之间的随机值,而将亮度和饱和度都设置为0到1之间的变化值。通过色调的随机设定,可以基本保证多束彩色光线中至少两束的颜色不同。此外,通过亮度或饱和度的变化,可以使得多束彩色光线的区分更明显,还可以增加后续验证过程中涉及的验证码的位数,从而保证图像验证的准确性和安全性。需要说明的是,在本说明书中,“变化值”是相对于“固定值”而言的,例如,0到1之间的变化值可以理解为0到1之间的随机变化值。In some embodiments, the respective hues of the at least two colored lights may be set randomly, and at least one of brightness or saturation may be a variable value. For example, the hue corresponding to the at least two colored rays may be set to a random value between 0 and 1, and one of brightness or saturation may be set to a variable value between 0 and 1. For another example, the respective hues of the at least two colored lights may be set to random values between 0 and 1, and the brightness and saturation may both be set to varying values between 0 and 1. Through the random setting of the hue, it can be basically ensured that the colors of at least two of the multiple colored lights are different. In addition, through the change of brightness or saturation, the distinction of multiple colored lights can be made more obvious, and the number of digits of the verification code involved in the subsequent verification process can also be increased, thereby ensuring the accuracy and security of image verification. It should be noted that, in this specification, "variation value" is relative to "fixed value", for example, a change value between 0 and 1 can be understood as a random change value between 0 and 1.
在一些实施例中,至少两束彩色光线分别对应的色调不同,亮度或饱和度中的至少一个不同。例如,可以将至少两束彩色光线分别对应的色调设置为彼此不同的0到1之间的值,而将亮度或饱和度之一设置为彼此不同的0到1之间的值。又例如,可以将至少两束彩色光线分别对应的色调设置为彼此不同的0到1之间的值,而将亮度和饱和度都设置为彼此不同的0到1之间的值。至少两束彩色光线的色调不同,可以保证彩色光线的颜色不同,同时亮度或饱和度中至少一个不同,可以在颜色不同的基础上,进一步加强彩色光线彼此间的区分度,增加后续验证过程中涉及的验证码的位数,相应提高后续图像验证的准确性和安全性。In some embodiments, the at least two colored light beams respectively correspond to different hues, and at least one of brightness or saturation is different. For example, the respective hues of the at least two colored rays may be set to a value between 0 and 1 different from each other, and one of brightness or saturation may be set to a value between 0 and 1 different from each other. For another example, the respective hues of the at least two colored rays may be set to be values between 0 and 1 that are different from each other, and both the brightness and the saturation may be set to be values between 0 and 1 that are different from each other. The hue of at least two colored lights is different, which can ensure that the colors of the colored lights are different, and at least one of the brightness or saturation is different. On the basis of different colors, the distinction between the colored lights can be further strengthened, and the subsequent verification process can be increased. The number of digits involved in the verification code will correspondingly improve the accuracy and security of subsequent image verification.
在一些实施例中,至少两束彩色光线分别对应的色调、饱和度和亮度可以都随机设定。例如,可以将至少两束彩色光线分别对应的色调、饱和度和亮度都设置为0到1之间的随机值。在一些实施例中,至少两束彩色光线分别对应的色调和亮度可以随机设定,而饱和度为固定值。例如,可以将至少两束彩色光线分别对应的色调和亮度设置为0到1之间的随机值,而将饱和度设置为0到1之间的一个固定值(例如,1)。在一些实施例,至少两束彩色光线分别对应的色调和饱和度可以随机设定,而亮度为固定值。例如,可以将至少两束彩色光线分别对应的色调和饱和度设置为0到1之间的随机值,而将亮度设置为0到1之间的一个固定值(例如,1)。In some embodiments, the hue, saturation and brightness corresponding to the at least two colored light beams may be randomly set. For example, the hue, saturation, and brightness corresponding to at least two colored rays may be set to random values between 0 and 1. In some embodiments, the hue and brightness corresponding to the at least two colored lights can be set randomly, and the saturation is a fixed value. For example, the hue and brightness corresponding to the at least two colored rays may be set to random values between 0 and 1, and the saturation may be set to a fixed value (eg, 1) between 0 and 1. In some embodiments, the hue and saturation corresponding to the at least two colored lights can be randomly set, and the brightness is a fixed value. For example, the hue and saturation corresponding to the at least two colored rays may be set to random values between 0 and 1, and the brightness may be set to a fixed value (eg, 1) between 0 and 1.
在一些实施例中,还可以通过其他颜色模型表示彩色光线的光线参数,例如,RGB、 Lαβ、CMYK、NTSC、LMS、YcbCr等,本说明书对此不做限制。In some embodiments, the light parameters of the colored light can also be represented by other color models, for example, RGB, Lαβ, CMYK, NTSC, LMS, YcbCr, etc., which are not limited in this specification.
在一些实施例中,光线发射模块210可以指示终端设备130随机发射至少两束彩色光线。在一些实施例中,光线发射模块210可以基于预设规则指示终端设备130发射至少两束彩色光线。例如,不同的验证场景可以对应不同的彩色光线。又例如,不同的环境条件(例如,环境亮度)可以对应不同的彩色光线。又例如,不同的目标(例如,面部、车辆等)可以对应不同的彩色光线。In some embodiments, the light emission module 210 may instruct the terminal device 130 to randomly emit at least two colored light beams. In some embodiments, the light emission module 210 may instruct the terminal device 130 to emit at least two colored lights based on a preset rule. For example, different verification scenarios can correspond to different colored lights. For another example, different environmental conditions (eg, ambient brightness) may correspond to different colored lights. For another example, different objects (eg, faces, vehicles, etc.) may correspond to different colored lights.
在一些实施例中,彩色光线的相关参数可以存储于存储设备140中,光线发射模块210可以从存储设备140中获取彩色光线的相关参数,并指示终端设备130发射相应的彩色光线。In some embodiments, the relevant parameters of the colored light can be stored in the storage device 140, and the light emission module 210 can obtain the relevant parameters of the colored light from the storage device 140, and instruct the terminal device 130 to emit the corresponding colored light.
步骤320,在发射至少两束彩色光线过程中,指示终端设备130采集目标的多幅图像。在一些实施例中,步骤320可以由图像获取模块220执行。 Step 320, instructing the terminal device 130 to collect multiple images of the target during the process of emitting at least two colored light beams. In some embodiments, step 320 may be performed by image acquisition module 220 .
在一些实施例中,在每束彩色光线的发射过程中(即每束彩色光线的持续时长内),终端设备130可以对目标进行一次或多次图像采集。例如,如图6所示,光线发射模块210指示终端设备130发射光线1、光线2、光线3、光线4、光线5和光线6共6束彩色光线。在每束彩色光线的发射过程中,图像获取模块220指示终端设备130对目标进行一次或多次图像采集,得到目标的一幅或多幅图像(例如,图6中所示的初始图像)。In some embodiments, during the emission process of each colored light beam (ie, within the duration of each colored light beam), the terminal device 130 may perform one or more image acquisitions on the target. For example, as shown in FIG. 6 , the light emission module 210 instructs the terminal device 130 to emit light 1, light 2, light 3, light 4, light 5 and light 6, a total of 6 colored light beams. During the emission of each colored light beam, the image acquisition module 220 instructs the terminal device 130 to perform one or more image acquisitions on the target to obtain one or more images of the target (eg, the initial image shown in FIG. 6 ).
在一些实施例中,每束彩色光线的发射过程中,图像采集的次数可以是系统默认值,也可以根据不同情况调整。例如,如果环境亮度较低,则采集次数可以相对较多;反之,如果环境亮度较高,则采集次数可以相对较少。In some embodiments, during the emission process of each colored light beam, the number of times of image acquisition may be the default value of the system, or may be adjusted according to different situations. For example, if the ambient brightness is low, the number of acquisitions may be relatively large; conversely, if the ambient brightness is high, the number of acquisitions may be relatively small.
在一些实施例中,每次图像采集的持续时长可以是系统默认值,也可以根据不同情况调整。例如,如果环境亮度较低,则持续时长可以相应较长;反之,如果环境亮度较高,则持续时长可以相对较短。In some embodiments, the duration of each image acquisition may be a system default value, or may be adjusted according to different situations. For example, if the ambient brightness is low, the duration may be correspondingly longer; conversely, if the ambient brightness is high, the duration may be relatively short.
在一些实施例中,多次图像采集间的时间间隔可以是系统默认值(例如,2毫秒、5毫秒、7毫秒、8毫秒、10毫秒、20毫秒等),也可以根据不同情况调整。In some embodiments, the time interval between multiple image acquisitions may be a system default value (eg, 2 milliseconds, 5 milliseconds, 7 milliseconds, 8 milliseconds, 10 milliseconds, 20 milliseconds, etc.), or may be adjusted according to different situations.
通过在每束彩色光线发射过程中采集多幅初始图像,即使其中某一幅或多幅图像的质量较差或未采集到目标,也可以保证后续可以筛选得到可用的目标图像,进而保证后续图像验证过程的正常进行。By collecting multiple initial images during the emission of each colored light, even if the quality of one or more images is poor or the target is not captured, it can be ensured that the available target images can be screened and the subsequent images can be obtained. The verification process is proceeding normally.
在一些实施例中,图像的格式可以包括Joint Photographic Experts Group(JPEG)、Tagged Image File Format(TIFF)、Graphics Interchange Format(GIF)、Kodak Flash PiX(FPX)、Digital Imaging and Communications in Medicine(DICOM)等或其任意组合。在一些实施例中,图像可以是二维图像、三维图像、四维图像等。In some embodiments, the format of the image may include Joint Photographic Experts Group (JPEG), Tagged Image File Format (TIFF), Graphics Interchange Format (GIF), Kodak Flash PiX (FPX), Digital Imaging and Communications in Medicine (DICOM) etc. or any combination thereof. In some embodiments, the image may be a two-dimensional image, a three-dimensional image, a four-dimensional image, or the like.
步骤330,从多幅图像中选择至少两束彩色光线分别对应的至少两幅目标图像。在一些实施例中,步骤330可以由图像获取模块220执行。Step 330: Select at least two target images corresponding to at least two colored rays from the multiple images. In some embodiments, step 330 may be performed by image acquisition module 220 .
在一些实施例中,对于每束彩色光线来说,图像获取模块220可以从该束彩色光线对应的多幅初始图像中选择一幅包含目标的图像作为目标图像。例如,如图6所示,对于6束彩色光线,图像获取模块220可以分别确定6幅目标图像S1、S2、S3、S4、S5和S6。In some embodiments, for each bundle of colored rays, the image acquisition module 220 may select an image containing the target from the multiple initial images corresponding to the bundle of colored rays as the target image. For example, as shown in FIG. 6 , for 6 colored rays, the image acquisition module 220 can respectively determine 6 target images S1 , S2 , S3 , S4 , S5 and S6 .
在一些实施例中,对于每束彩色光线来说,图像获取模块220可以从该束彩色光线对应的多幅初始图像中随机选择一幅包含目标的图像作为目标图像。在一些实施例中,图像获取模块220可以从该束彩色光线对应的多幅初始图像中选择一幅满足预设要求的图像作为目标图像。在一些实施例中,预设要求可以包括图像质量满足质量要求(例如,亮度大于预设亮度阈值、清晰度大于预设清晰度阈值、对比度大于预设对比度阈值等)、目标在图像中的位置满足要求(例如,位于或基本位于图像视野的中间位置)、目标在图像中的尺寸满足要求(例如,目标的尺寸达到图像整体尺寸的79%、80%、90%或95%以上等)等或其任意组合。In some embodiments, for each colored light beam, the image acquisition module 220 may randomly select an image containing a target from a plurality of initial images corresponding to the colored light beam as the target image. In some embodiments, the image acquisition module 220 may select an image that satisfies the preset requirements from the multiple initial images corresponding to the bundle of colored rays as the target image. In some embodiments, the preset requirements may include that the image quality meets the quality requirements (eg, brightness greater than a preset brightness threshold, sharpness greater than a preset sharpness threshold, contrast greater than a preset contrast threshold, etc.), the position of the target in the image The requirements are met (for example, it is located at or basically in the middle of the image field of view), and the size of the target in the image meets the requirements (for example, the size of the target reaches 79%, 80%, 90% or 95% of the overall size of the image, etc.), etc. or any combination thereof.
在一些实施例中,在确定至少两束彩色光线分别对应的至少两幅目标图像后,图像获取模块220可以对目标图像进行预处理,以提高图像质量,从而提高后续图像验证的准确性。In some embodiments, after determining at least two target images respectively corresponding to the at least two colored rays, the image acquisition module 220 may preprocess the target images to improve image quality, thereby improving the accuracy of subsequent image verification.
在一些实施例中,预处理可以包括纹理一致化处理。可以理解,在图像采集过程中,终端设备130和目标的距离、角度、采集时的背景可能有变化,相应地,各个目标图像的纹理可能不同。而纹理一致化处理可以使得各个目标图像的纹理相同或基本相同,减少纹理特征的干扰,从而提高后续图像验证的效率和准确率。In some embodiments, the preprocessing may include texture uniform processing. It can be understood that during the image acquisition process, the distance, angle, and background of the terminal device 130 and the target may vary, and accordingly, the texture of each target image may be different. The texture uniform processing can make the texture of each target image the same or basically the same, reduce the interference of texture features, and improve the efficiency and accuracy of subsequent image verification.
在一些实施例中,预处理还可以包括图像去噪、图像增强等可以提升后续图像验证效果的操作,本说明书对此不做限制。In some embodiments, the preprocessing may further include operations such as image denoising, image enhancement, etc., which can improve the effect of subsequent image verification, which is not limited in this specification.
步骤340,基于至少两幅目标图像,确定目标验证码。在一些实施例中,步骤340可以由目标验证码确定模块230执行。Step 340: Determine a target verification code based on the at least two target images. In some embodiments, step 340 may be performed by target verification code determination module 230 .
在一些实施例中,目标验证码确定模块230可以基于至少两幅目标图像确定基准图像和校验图像,并基于基准图像和校验图像的差异(例如,图像参数的差异)确定目标验证码。关于基于至少两幅目标图像确定目标验证码的更多内容可以参见图4和图5及其相关描述,此处不再赘述。In some embodiments, the target verification code determination module 230 may determine the reference image and the verification image based on the at least two target images, and determine the target verification code based on differences (eg, differences in image parameters) between the reference image and the verification image. For more details about determining the target verification code based on at least two target images, reference may be made to FIG. 4 and FIG. 5 and related descriptions, and details are not repeated here.
在一些实施例中,目标验证码确定模块230还可以基于基准图像和每幅校验图像的第一颜色关系,确定目标验证码。关于基于第一颜色关系确定目标验证码的更多内容可以参见图10及其相关描述。In some embodiments, the target verification code determination module 230 may also determine the target verification code based on the first color relationship between the reference image and each verification image. For more content about determining the target verification code based on the first color relationship, please refer to FIG. 10 and related descriptions.
步骤350,通过比较目标验证码与至少两束彩色光线对应的参考验证码,进行图像真 实性验证。在一些实施例中,步骤350可以由图像真实性确定模块240执行。In step 350, the authenticity of the image is verified by comparing the target verification code with the reference verification codes corresponding to at least two beams of colored light. In some embodiments, step 350 may be performed by image authenticity determination module 240 .
在一些实施例中,参考验证码可以基于至少两束彩色光线的光线参数确定。在一些实施例中,参考验证码的确定方式与目标验证码的确定方式类似。例如,基于至少两束彩色光线确定基准光线和校验光线,并基于基准光线和校验光线的差异(例如,光线参数的差异)确定参考验证码。更多描述可参考图4和图5,在此不再赘述。In some embodiments, the reference verification code may be determined based on light parameters of at least two colored light beams. In some embodiments, the reference verification code is determined in a manner similar to the determination of the target verification code. For example, the reference light and the verification light are determined based on at least two colored light rays, and the reference verification code is determined based on the difference between the reference light and the verification light (eg, the difference in light parameters). For more description, reference may be made to FIG. 4 and FIG. 5 , which will not be repeated here.
在一些实施例中,参考验证码还可以基于基准颜色和每个验证颜色的第二颜色关系确定。关于基于第二颜色关系确定参考验证码的更多内容可以参见图10及其相关描述。In some embodiments, the reference verification code may also be determined based on the reference color and the second color relationship of each verification color. For more content about determining the reference verification code based on the second color relationship, please refer to FIG. 10 and related descriptions.
结合步骤310,在一些实施例中,参考验证码可以离线确定并与其对应的至少两束彩色光线(或光线参数)一并存储于存储设备140中。处理设备112在指示终端设备130发射至少两束彩色光线并采集相应的图像后,可以从存储设备140中读取该至少两束彩色光线对应的参考验证码,并进行图像真实性验证。在一些实施例中,处理设备112可以在指示终端设备130发射至少两束彩色光线的同时或之后确定参考验证码。In combination with step 310, in some embodiments, the reference verification code may be determined offline and stored in the storage device 140 together with at least two colored rays (or light parameters) corresponding to the reference verification code. After the processing device 112 instructs the terminal device 130 to emit at least two colored lights and collect corresponding images, the processing device 112 can read the reference verification codes corresponding to the at least two colored lights from the storage device 140 and perform image authenticity verification. In some embodiments, processing device 112 may determine the reference verification code at the same time as or after instructing terminal device 130 to emit at least two colored light beams.
在一些实施例中,如果目标验证码与参考验证码一致,则说明图像真实性验证通过,进而表示目标的身份认证、权限验证和/或真实性验证通过。如果目标验证码与参考验证码不一致,则说明图像真实性验证未通过。In some embodiments, if the target verification code is consistent with the reference verification code, it indicates that the authenticity verification of the image has passed, and further indicates that the identity verification, authority verification and/or authenticity verification of the target has passed. If the target verification code is inconsistent with the reference verification code, the image authenticity verification fails.
在一些实施例中,处理设备112可以指示终端设备130发出通过或未通过的相关提醒或通知。在一些实施例中,提醒或通知可以以文字、图像、音频、视频等方式呈现。In some embodiments, the processing device 112 may instruct the terminal device 130 to issue a pass or fail related alert or notification. In some embodiments, reminders or notifications may be presented in text, images, audio, video, and the like.
应当注意的是,上述有关流程300的描述仅仅是为了示例和说明,而不限定本说明书的适用范围。对于本领域技术人员来说,在本说明书的指导下可以对流程300进行各种修正和改变。然而,这些修正和改变仍在本说明书的范围之内。It should be noted that the above description about the process 300 is only for example and illustration, and does not limit the scope of application of this specification. For those skilled in the art, various modifications and changes can be made to the process 300 under the guidance of this specification. However, these corrections and changes are still within the scope of this specification.
图4是根据本说明书一些实施例所示的示例性基于目标图像确定目标验证码的流程图。在一些实施例中,流程400可以由图像验证系统100或200执行。例如,流程400可以以程序或指令的形式存储在存储设备(例如,存储设备140、处理设备112的存储单元)中,当处理设备112或图2所示的模块执行程序或指令时,可以实现流程400。在一些实施例中,流程400可以利用以下未描述的一个或以上附加操作,和/或不通过以下所讨论的一个或以上操作完成。另外,如图4所示的操作的顺序并非限制性的。FIG. 4 is an exemplary flowchart of determining a target verification code based on a target image according to some embodiments of the present specification. In some embodiments, process 400 may be performed by image verification system 100 or 200 . For example, the process 400 can be stored in a storage device (eg, the storage device 140, a storage unit of the processing device 112) in the form of a program or an instruction, and when the processing device 112 or the module shown in FIG. 2 executes the program or the instruction, it can be implemented Process 400. In some embodiments, process 400 may be accomplished with one or more additional operations not described below, and/or without one or more operations discussed below. Additionally, the order of operations shown in FIG. 4 is not limiting.
步骤410,将至少两幅目标图像中的其中一幅确定为校验图像,并将至少两幅目标图像中的其他图像作为基准图像。在一些实施例中,步骤410可以由目标验证码确定模块230完成。Step 410: Determine one of the at least two target images as a verification image, and use the other image in the at least two target images as a reference image. In some embodiments, step 410 may be accomplished by the target verification code determination module 230 .
在一些实施例中,可以将与校验光线对应的目标图像确定为校验图像,将与基准光线对应的目标图像确定为基准图像。在一些实施例中,校验图像/校验光线和基准图像/基准光线 可以随机设定。例如,如图6所示,可以将光线6作为校验光线,与光线6对应的目标图像S6作为校验图像;将光线1、光线2、光线3、光线4、光线5作为基准光线,将与光线1、光线2、光线3、光线4、光线5分别对应的目标图像S1、S2、S3、S4、S5作为基准图像。In some embodiments, the target image corresponding to the verification ray may be determined as the verification image, and the target image corresponding to the reference ray may be determined as the reference image. In some embodiments, the verification image/verification ray and the reference image/reference ray may be randomly set. For example, as shown in FIG. 6 , light 6 can be used as the verification light, and the target image S6 corresponding to light 6 can be used as the verification image; light 1, light 2, light 3, light 4, and light 5 can be used as The target images S1 , S2 , S3 , S4 , and S5 corresponding to the ray 1 , the ray 2 , the ray 3 , the ray 4 , and the ray 5 respectively serve as the reference images.
步骤420,对于基准图像中的每一幅,确定基准图像与校验图像的差异。在一些实施例中,步骤420可以由目标验证码确定模块230完成。 Step 420, for each of the reference images, determine the difference between the reference image and the verification image. In some embodiments, step 420 may be accomplished by the target verification code determination module 230 .
在一些实施例中,差异可以体现基准图像与校验图像在各种维度或各种方面(例如,空间位置、灰度值、梯度值、分辨率等)的区别。在一些实施例中,结合步骤310,彩色光线的光线参数可以通过HSV颜色模型表示。相应地,彩色光线对应的目标图像的图像参数也可以通过HSV颜色模型表示。这种情况下,差异可以体现基准图像与校验图像在色调、亮度和饱和度上的区别。例如,对于“色调”,如果基准图像与校验图像的色调一致,则“色调”差异为1,反之为0;对于“亮度”,如果基准图像与校验图像的亮度一致,则“亮度”差异为1,反之为0;对于“饱和度”,如果基准图像与校验图像的饱和度一致,则“饱和度”差异为1,反之为0。在一些实施例中,可以将“色调”差异、“亮度”差异和“饱和度”差异的综合差异作为基准图像与校验图像的差异。例如,如果基准图像与校验图像的色调不同,而亮度和饱和度一致,则二者的差异可以是011。在一些实施例中,差异可以以数值、向量、矩阵等方式表示。In some embodiments, the difference may reflect the difference between the reference image and the verification image in various dimensions or in various aspects (eg, spatial location, gray value, gradient value, resolution, etc.). In some embodiments, in conjunction with step 310, the light parameters of the colored light can be represented by the HSV color model. Correspondingly, the image parameters of the target image corresponding to the colored light can also be represented by the HSV color model. In this case, the difference can reflect the difference in hue, brightness, and saturation between the reference image and the verification image. For example, for "Hue", if the color tone of the reference image and the verification image are the same, the "Hue" difference is 1, otherwise it is 0; for "Brightness", if the brightness of the reference image and the verification image are the same, then The difference is 1, otherwise it is 0; for "Saturation", if the saturation of the reference image and the verification image are the same, the "Saturation" difference is 1, otherwise it is 0. In some embodiments, the combined difference of the "hue" difference, the "brightness" difference and the "saturation" difference may be used as the difference between the reference image and the verification image. For example, if the reference image and the verification image are different in hue, but the brightness and saturation are the same, the difference may be 011. In some embodiments, the differences may be represented in numerical values, vectors, matrices, or the like.
在一些实施例中,可以将基准图像和校验图像输入比对模型,并基于比对模型的输出,确定基准图像和校验图像的差异。例如,如图5所示,可以将基准图像510和校验图像515输入至比对模型520中,并基于比对模型520的输出,确定基准图像510和校验图像515的差异530。In some embodiments, the reference image and the verification image may be input into the comparison model, and based on the output of the comparison model, the difference between the reference image and the verification image may be determined. For example, as shown in FIG. 5 , the reference image 510 and the verification image 515 may be input into the comparison model 520 , and based on the output of the comparison model 520 , a difference 530 between the reference image 510 and the verification image 515 may be determined.
在一些实施例中,比对模型520可以包括一致性校验网络。在一些实施例中,一致性校验网络的骨干网络可以包括分类结构(例如,Resnet系列分类结构)。In some embodiments, the alignment model 520 may include a consistency check network. In some embodiments, the backbone network of the consistency checking network may include a classification structure (eg, a Resnet family of classification structures).
在一些实施例中,比对模型520可以包括transformer结构。关于transformer结构的更多内容可以参见图7及其相关描述,在此不再赘述。In some embodiments, the alignment model 520 may include a transformer structure. For more details about the transformer structure, please refer to FIG. 7 and related descriptions, and details will not be repeated here.
在一些实施例中,结合步骤310所述,至少两束彩色光线分别对应的色调可以随机设定,而亮度或饱和度中的至少一个可以为变化值。相应地,对于至少两束彩色光线分别对应的至少两幅目标图像来说,其色调、亮度及饱和度具有相同的规律。以图6为例,目标图像S6为校验图像,目标图像S1、S2、S3、S4、S5为基准图像。假设6幅目标图像S1、S2、S3、S4、S5和S6的HSV参数分别为G1(0,1,0.7)、G2(0.3,1,0.8)、G3(0.6,1,1)、G4(0.3,1,1)、G5(0.9,1,0.7)、Q1(0.3,1,1),其中,S值(饱和度)均为1(即饱和度为固定值1),H值(色调)和V值(亮度)为变化值(即色调和亮度均为0-1之间的随机变化值)。 为方便描述,将校验图像的HSV参数称为“校验码”,将基准图像的HSV参数称为“基准码”。In some embodiments, with reference to step 310, the respective hues of the at least two colored lights may be set randomly, and at least one of brightness or saturation may be a variable value. Correspondingly, for at least two target images respectively corresponding to at least two beams of color light, the hue, brightness and saturation have the same regularity. Taking FIG. 6 as an example, the target image S6 is the verification image, and the target images S1, S2, S3, S4, and S5 are the reference images. Suppose the HSV parameters of the six target images S1, S2, S3, S4, S5 and S6 are G1(0,1,0.7), G2(0.3,1,0.8), G3(0.6,1,1), G4( 0.3, 1, 1), G5 (0.9, 1, 0.7), Q1 (0.3, 1, 1), where the S value (saturation) is all 1 (that is, the saturation is a fixed value of 1), and the H value (hue ) and the V value (brightness) are variable values (that is, both hue and brightness are random values between 0-1). For convenience of description, the HSV parameter of the verification image is referred to as a "check code", and the HSV parameter of the reference image is referred to as a "reference code".
进一步地,处理设备112可以利用一致性校验网络,将校验码与五个基准码分别进行比对。由于S值(饱和度)均为1,因此只需比较H值(色调)和V值(亮度)的差异。如下表1所示,如果校验码与基准码中的色调和亮度都相同,则差异为11;如果校验码与基准码中的色调和亮度都不相同,则差异为00;如果校验码与基准码中的色调相同而亮度不相同,则差异为10;如果校验码与基准码中的色调不相同而亮度相同,则差异为01。Further, the processing device 112 may use a consistency check network to compare the check code with the five reference codes respectively. Since the S value (saturation) is all 1, it is only necessary to compare the difference in the H value (hue) and the V value (brightness). As shown in Table 1 below, if the hue and brightness of the check code and the reference code are the same, the difference is 11; if the hue and brightness of the check code and the reference code are not the same, the difference is 00; If the code and the reference code have the same hue but different brightness, the difference is 10; if the check code and the reference code have different hues but the same brightness, the difference is 01.
表1校验码与基准码的比较示例Table 1 Comparison example of check code and reference code
色调\亮度Hue\Brightness 相同same 不相同Are not the same
相同same 1111 1010
不相同Are not the same 0101 0000
相应地,将校验码Q1与五个基准码G1、G2、G3、G4和G5分别进行比对,得到5幅基准图像分别对应的差异如下:Correspondingly, the verification code Q1 is compared with the five reference codes G1, G2, G3, G4 and G5 respectively, and the corresponding differences of the five reference images are obtained as follows:
Q1:G1=(0.3,1):(0,0.7)=00Q1:G1=(0.3,1):(0,0.7)=00
Q1:G2=(0.3,1):(0.3,0.8)=10Q1:G2=(0.3,1):(0.3,0.8)=10
Q1:G3=(0.3,1):(0.6,1)=01Q1:G3=(0.3,1):(0.6,1)=01
Q1:G4=(0.3,1):(0.3,1)=11Q1:G4=(0.3,1):(0.3,1)=11
Q1:G5=(0.3,1):(0.9,0.7)=00Q1:G5=(0.3,1):(0.9,0.7)=00
在一些实施例中,处理设备112将校验图像和基准图像都划分为多个图像快(例如,4个图像块),以图像块为处理单元,基于transformer结构确定校验图像和基准图像中的对应图像块间的差异,并进一步综合多个差异,以确定校验图像和基准图像的最终差异。In some embodiments, the processing device 112 divides both the verification image and the reference image into multiple image blocks (for example, 4 image blocks), uses the image block as a processing unit, and determines the verification image and the reference image based on the transformer structure. The differences between the corresponding image blocks are further synthesized to determine the final difference between the verification image and the reference image.
在图像验证过程中,光线对目标不同区域的影响程度可能不同,导致所采集的图像的不同区域的图像参数(例如,HSV参数)也存在一定差异。相应地,通过采用transformer结构,将图像划分为多个图像块后再进行后续的相似性处理和分析,可以提升模型精细化处理能力,从而提升验证效果。更具体的内容可参考图7及其描述。During the image verification process, the degree of influence of light on different regions of the target may be different, resulting in certain differences in image parameters (for example, HSV parameters) in different regions of the captured image. Correspondingly, by using the transformer structure to divide the image into multiple image blocks and then perform subsequent similarity processing and analysis, the refinement processing capability of the model can be improved, thereby improving the verification effect. For more details, please refer to FIG. 7 and its description.
在步骤430,基于基准图像分别对应的差异,确定目标验证码。在一些实施例中,步骤410可以由目标验证码确定模块230完成。In step 430, the target verification code is determined based on the differences corresponding to the reference images respectively. In some embodiments, step 410 may be accomplished by the target verification code determination module 230 .
在一些实施例中,目标验证码确定模块230可以对各个基准图像分别对应的差异进行排列组合以确定目标验证码。在一些实施例中,目标验证码确定模块230可以按基准图像的顺序,按顺序排列各个基准图像分别对应的差异以确定目标验证码。例如,结合上文,目标验证码可以是0010011100。在一些实施例中,目标验证码确定模块230可以按任意顺序排列各个基准图像分别对应的差异以确定目标验证码。In some embodiments, the target verification code determination module 230 may arrange and combine the differences corresponding to the respective reference images to determine the target verification code. In some embodiments, the target verification code determination module 230 may determine the target verification code by arranging the differences corresponding to the respective reference images in sequence in the order of the reference images. For example, in conjunction with the above, the target verification code may be 0010011100. In some embodiments, the target verification code determination module 230 may arrange the differences corresponding to the respective reference images in any order to determine the target verification code.
在一些实施例中,目标验证码确定模块230可以对各个基准图像分别对应的差异进行其他形式的处理以确定目标验证码。例如,向量、行列式、矩阵等,本说明书对此不作限制。In some embodiments, the target verification code determination module 230 may perform other forms of processing on the differences corresponding to the respective reference images to determine the target verification code. For example, vectors, determinants, matrices, etc., are not limited in this specification.
需要说明的是,以上所描述的关于基准图像和校验图像在色调和亮度上的差异只是示例性的,还可以根据基准图像和校验图像的图像参数的实际情况确定其他维度的差异。例如,如果设定亮度为定值,还可以确定基准图像和校验图像在色调和饱和度上的差异。又例如,如果色调、饱和度和色调均为变化值,可以确定基准图像和校验图像在三个维度上的差异。此外,上述示例中使用了“0”和“1”的组合体现基准图像和校验图像的差异,还可以通过其他形式体现二者的差异,例如,字母、数字、字符串等,本说明书对此不做限制。It should be noted that the above-described differences in hue and brightness between the reference image and the verification image are only exemplary, and differences in other dimensions may also be determined according to actual conditions of image parameters of the reference image and the verification image. For example, if the brightness is set to a constant value, the difference in hue and saturation between the reference image and the verification image can also be determined. For another example, if hue, saturation, and hue are all changed values, the difference in three dimensions between the reference image and the verification image can be determined. In addition, in the above example, the combination of "0" and "1" is used to reflect the difference between the reference image and the verification image, and the difference between the two can also be expressed in other forms, such as letters, numbers, character strings, etc. This does not limit.
图7是根据本说明书一些实施例所示的比对模型的示意图。如图7所示,比对模型可以是transformer结构。Q表示校验图像,其HSV参数为(0.3,1,1);G表示基准图像,其HSV参数为(0.3,1,0.8)。Figure 7 is a schematic diagram of an alignment model according to some embodiments of the present specification. As shown in Figure 7, the alignment model can be a transformer structure. Q represents the verification image, and its HSV parameter is (0.3, 1, 1); G represents the reference image, and its HSV parameter is (0.3, 1, 0.8).
处理设备112可以将校验图像Q划分Q1、Q2、Q3、Q4共4个图像块;将基准图像G划分G1、G2、G3、G4共4个图像块。然后,将各个图像块输入至块编码模块(例如,图7中所示的patch embedding模块),将各个图像块编码为标记码(token),并将标记码输入至编码器模块(例如,图7中所示的transformer encoder)。The processing device 112 may divide the verification image Q into four image blocks of Q1, Q2, Q3, and Q4, and divide the reference image G into four image blocks of G1, G2, G3, and G4. Each image block is then input to a block encoding module (eg, the patch embedding module shown in FIG. 7 ), each image block is encoded into a token, and the token is input to an encoder module (eg, FIG. 7 ) transformer encoder shown in 7).
在一些实施例中,编码器模块可以是双头(two-head)结构,例如,图7左侧所示的第一head和右侧所示的第二head。In some embodiments, the encoder module may be a two-head structure, eg, a first head shown on the left side of FIG. 7 and a second head shown on the right side.
在一些实施例中,编码器模块可以基于各个标记码,重复进行多次(例如,L次)处理,以确定校验图像和基准图像之间的相似性关系。In some embodiments, the encoder module may repeat the process multiple times (eg, L times) based on each marker code to determine the similarity relationship between the verification image and the reference image.
在一些实施例中,在每次处理中,编码器模块可以基于各个标记码,确定4组相似性矩阵,每组包含H QiGi和V QiGi两个矩阵,分别表示两张图像对应位置的图像块在色调和亮度上的相似度。在一些实施例中,如图8A和8B所示,第一head可以生成相似性矩阵H QiGi,第二head可以生成相似性矩阵V QiGi。例如,以H Q1G1(表示校验图像Q和基准图像G的第一个图像块之间的色调相似性)为例,H Q1G1包括四个元素a mn,其中a 11=0.98,表示Q1与Q1自身的色调相似度;a 22=0.99,表示G1与G1的色调相似度;a 12=0.97,表示Q1与G1的色调相似度;a 21=0.99,表示G1与Q1的色调相似度。 In some embodiments, in each processing, the encoder module may determine 4 sets of similarity matrices based on each marker code, each set includes two matrices H QiGi and V QiGi , which respectively represent image blocks corresponding to the two images Similarity in hue and brightness. In some embodiments, as shown in FIGS. 8A and 8B , the first head may generate the similarity matrix H QiGi and the second head may generate the similarity matrix V QiGi . For example, taking H Q1G1 (representing the tonal similarity between the first image block of the verification image Q and the reference image G) as an example, H Q1G1 includes four elements a mn , where a 11 =0.98, representing Q1 and Q1 Its own hue similarity; a 22 =0.99, representing the hue similarity between G1 and G1; a 12 =0.97, representing the hue similarity between Q1 and G1; a 21 =0.99, representing the hue similarity between G1 and Q1.
进一步地,可以对多次处理对应的H QiGi矩阵副对角线元素求均值得到校验图像Q和基准图像G的色调相似性得分H*,对多次处理对应的V QiGi矩阵副对角线元素求均值得到校验图像Q和基准图像G的亮度相似性得分V*。然后将色调相似性得分H*和亮度相似性得分V*分别与预设阈值(例如,0.5、0.55、0.6、0.65、0.7、0.75等,可以基于实际需求设定)进行比较,大于预设阈值则认为校验图像Q和基准图像G的图像参数(例如,色调、亮度)“一 致”,相应的差异标记为1,反之则标记为0。 Further, the sub-diagonal elements of the H QiGi matrix corresponding to the multiple processing can be averaged to obtain the hue similarity score H* of the verification image Q and the reference image G, and the sub-diagonal of the V QiGi matrix corresponding to the multiple processing can be obtained. The elements are averaged to obtain the brightness similarity score V* of the verification image Q and the reference image G. Then compare the hue similarity score H* and brightness similarity score V* with preset thresholds (for example, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, etc., which can be set based on actual needs), which are greater than the preset thresholds Then, it is considered that the image parameters (eg, hue, brightness) of the verification image Q and the reference image G are "consistent", and the corresponding difference is marked as 1, otherwise, it is marked as 0.
在一些实施例中,编码器模块还可以基于各个标记码,经过多次处理,通过第一head和第二head分别回归出校验图像和基准图像分别对应的全局图像参数(例如,H值和V值)。在一些实施例中,如图9所示,编码器模块内部还可以包括注意力模块,通过注意力模块,在校验图像Q和基准图像G内部分别构建空间注意力。通过构建空间注意力,可以考虑图像内各个图像块间的关联,提升全局空间关系的准确性。In some embodiments, the encoder module can further regress the global image parameters (for example, H value and V value). In some embodiments, as shown in FIG. 9 , the encoder module may further include an attention module, and through the attention module, spatial attention is constructed in the verification image Q and the reference image G respectively. By constructing spatial attention, the correlation between image blocks in the image can be considered, and the accuracy of the global spatial relationship can be improved.
在一些实施例中,在transformer结构的训练过程中,其损失函数可以由两部分组成,分别为色参损失L1和相似性损失L2,其中,色参损失L1由两个head回归得到的全局图像参数与其真实标签求均方误差求得,相似性损失L2由多次处理过程中分别生成的相似性矩阵H*和V*分别与对应的标签矩阵H target和V target求交叉熵损失得到。标签矩阵的示例如下表2所示,a ij表示第i张图和第j张图的色参相似度,矩阵主对角线上的元素a 11和a 22都表示图像自己与自己的色参相似度(例如,色调相似度、亮度相似度),所以取值为1,而副对角线上的元素则表示不同图像之间的色参相似度,如果色参相同取值为1,否则取值为0。 In some embodiments, in the training process of the transformer structure, its loss function can be composed of two parts, namely the color parameter loss L1 and the similarity loss L2, wherein the color parameter loss L1 is a global image obtained by regressing two heads The parameters and their true labels are calculated by the mean square error, and the similarity loss L2 is obtained by calculating the cross-entropy loss of the similarity matrices H* and V* respectively generated in multiple processing processes and the corresponding label matrices H target and V target . An example of the label matrix is shown in Table 2 below, a ij represents the color parameter similarity between the i-th image and the j-th image, and the elements a 11 and a 22 on the main diagonal of the matrix both represent the image itself and its own color parameters. Similarity (for example, hue similarity, brightness similarity), so the value is 1, and the elements on the sub-diagonal line represent the similarity of color parameters between different images, if the color parameters are the same, the value is 1, otherwise The value is 0.
表2标签矩阵示例Table 2 Label matrix example
a 11 a 11 a 12 a 12
a 21 a 21 a 22 a 22
通过两个训练任务间的互相促进,可以提升模型的表达能力,进而提升模型使用时的校验准确率。具体地,在训练过程中,各个图像块包含各自的局部空间信息,将这些局部空间关系通过transformer的注意力机制进行交互融合,进而得到感受野更大的全局空间关系,这种全局空间关系可以辅助模型训练,提取得到更丰富更有效的图像特征,进而提升相似性关系的准确率。Through the mutual promotion between the two training tasks, the expressive ability of the model can be improved, thereby improving the verification accuracy of the model when it is used. Specifically, in the training process, each image block contains its own local spatial information, and these local spatial relationships are interactively fused through the attention mechanism of the transformer, so as to obtain a global spatial relationship with a larger receptive field. This global spatial relationship can be Aided model training can extract richer and more effective image features, thereby improving the accuracy of similarity relationships.
需要说明的是,以上关于transformer结构的描述只是示例性的,并不构成限制作用。例如,图像块的划分数量并不限于4块,还可以是其他数量,例如,16块、64块等,本说明书对此不做限制。It should be noted that the above description of the transformer structure is only exemplary and does not constitute a limitation. For example, the number of divisions of image blocks is not limited to 4 blocks, and may also be other numbers, such as 16 blocks, 64 blocks, etc., which is not limited in this specification.
在本说明书实施例中,在采集图像过程中发射彩色光线,并基于所采集的图像的图像参数确定目标验证码,此外基于彩色光线的光线参数确定参考验证码,进一步比较目标验证码和参考验证码以进行图像真实性验证,可以解决验证场景下的摄像头劫持问题。可以理解,当非法用户B需要进行验证时,如果非法用户B试图通过摄像头劫持获取合法用户A的验证图像或视频并进行验证,在这种情况下,除非合法用户A的验证图像或视频的参数与当前系统所指示发射的彩色光线的光线参数完全一致,否则不可能通过验证。In the embodiment of this specification, colored light is emitted during the process of collecting images, and the target verification code is determined based on the image parameters of the collected image. In addition, the reference verification code is determined based on the light parameters of the colored light, and the target verification code and the reference verification code are further compared. code for image authenticity verification, which can solve the problem of camera hijacking in verification scenarios. It is understandable that when illegal user B needs to verify, if illegal user B tries to obtain the verification image or video of legal user A through camera hijacking and verify, in this case, unless the parameters of legal user A's verification image or video It is completely consistent with the light parameters of the colored light emitted by the current system, otherwise it is impossible to pass the verification.
此外,由于环境条件(例如,环境亮度较低、环境中本身存在彩色光线等)会对图像 采集过程有影响,导致所采集的图像可能无法准确匹配采集过程中所发射的彩色光线,进而影响验证结果。而本说明书实施例中将目标图像分为基准图像和校验图像,基于彼此之间的差异确定目标验证码(即通过自比较或自查询方式确定验证码);相应地,将多束彩色光线分为基准光线和校验光线,基于彼此间的差异确定参考验证码,进而通过比较目标验证码和参考验证码是否一致以进行验证,相应可以排除环境条件的影响,提高验证结果的准确性。In addition, due to environmental conditions (for example, low ambient brightness, the presence of colored light in the environment, etc.) that will affect the image acquisition process, the acquired image may not accurately match the colored light emitted during the acquisition process, thereby affecting verification. result. In the embodiment of this specification, the target image is divided into a reference image and a verification image, and the target verification code is determined based on the difference between them (that is, the verification code is determined by self-comparison or self-inquiry); It is divided into reference light and verification light, and the reference verification code is determined based on the difference between them, and then the verification is carried out by comparing whether the target verification code and the reference verification code are consistent, which can eliminate the influence of environmental conditions and improve the accuracy of the verification result.
进一步地,在本说明书中,除了考虑光线或图像的颜色(色调)参数外,还考虑亮度和/或饱和度,相应地,验证码的位数更多,极大降低了被攻破的概率,验证的准确度和安全性也更高。例如,假设基准光线的数量为N,则验证码位数为2N,其被非法攻破的概率为1/2 2NFurther, in this specification, in addition to the color (hue) parameters of light or images, brightness and/or saturation are also considered. Accordingly, the number of digits of the verification code is more, which greatly reduces the probability of being hacked. Verification is also more accurate and secure. For example, assuming that the number of reference rays is N, the number of verification codes is 2N, and the probability of being illegally broken is 1/2 2N .
更进一步地,由于在图像验证过程中,光线对目标不同区域的影响程度可能不同,导致所采集的图像的不同区域的图像参数(例如,HSV参数)也存在一定差异,进而影响验证结果。而本说明书实施例中,将基准图像和校验图像分别划分为多个图像块,通过transformer结构基于多个图像块进行后续的相似性处理和分析,可以提升模型精细化处理能力,从而提升验证效果。Furthermore, during the image verification process, the influence of light on different regions of the target may be different, resulting in certain differences in image parameters (eg, HSV parameters) in different regions of the captured image, which in turn affects the verification results. In the embodiment of this specification, the reference image and the verification image are respectively divided into multiple image blocks, and the subsequent similarity processing and analysis are performed based on the multiple image blocks through the transformer structure, which can improve the model refinement processing capability, thereby improving the verification. Effect.
图10是根据本说明书一些实施例所示的另一示例性图像验证过程的流程图。如图10所示,该流程1000包括以下步骤:FIG. 10 is a flowchart of another exemplary image verification process according to some embodiments of the present specification. As shown in Figure 10, the process 1000 includes the following steps:
步骤1010,获取多幅目标图像。多幅目标图像的拍摄时间与终端照射到目标对象的光照序列中多个光照的照射时间具有对应关系。 Step 1010, acquiring multiple target images. The shooting time of the multiple target images has a corresponding relationship with the irradiation time of the multiple illuminations in the illumination sequence in which the terminal illuminates the target object.
在一些实施例中,步骤1010可以由目标图像获取模块执行。In some embodiments, step 1010 may be performed by a target image acquisition module.
目标对象指需要进行目标识别的对象。例如目标对象可以是用户的特定身体部位,如面部、指纹、掌纹或瞳孔等。在一些实施例中,目标对象指需要进行身份验证和/或权限认证的用户的面部。例如,在网约车应用场景中,平台需要验证接单司机是否为平台审核过的注册司机用户,则目标对象是司机的面部。又例如,在人脸支付应用场景中,支付系统需要验证支付人员的支付权限,则目标对象是支付人员的面部。The target object refers to the object that needs to be recognized. For example, the target object may be a specific body part of the user, such as face, fingerprint, palm print, or pupil. In some embodiments, the target object refers to the face of a user requiring authentication and/or authorization. For example, in the online car-hailing application scenario, the platform needs to verify whether the driver who takes the order is a registered driver user reviewed by the platform, and the target object is the driver's face. For another example, in the face payment application scenario, the payment system needs to verify the payment authority of the payer, and the target object is the payer's face.
为对目标对象进行目标识别,终端会被指示发射光照序列。光照序列包括多个光照,用于照射目标对象。光照序列中不同光照的颜色可以相同,也可以不同。在一些实施例中,多个光照包含至少两个颜色不同的光照,即多个光照有多个颜色。For target recognition of the target object, the terminal is instructed to emit a sequence of illuminations. A lighting sequence includes multiple lights that illuminate the target object. The colors of different lights in a lighting sequence can be the same or different. In some embodiments, the plurality of lights comprise at least two lights of different colors, ie the plurality of lights have multiple colors.
在一些实施例中,多个颜色包括至少一个基准颜色和至少一个验证颜色。验证颜色是多个颜色中直接用于验证图像真实性的颜色。基准颜色是多个颜色中用于辅助验证确定目标图像真实性的颜色。关于基准颜色和验证颜色的更多细节可以参见图3及其相关描述,此处不再赘述。In some embodiments, the plurality of colors includes at least one reference color and at least one verification color. The verification color is one of the colors that is directly used to verify the authenticity of the image. The reference color is one of the colors used to assist verification in determining the authenticity of the target image. For more details about the reference color and the verification color, please refer to FIG. 3 and its related description, which will not be repeated here.
光照序列中包含多个光照中每个光照的信息,例如,颜色信息、照射时间等。光照序列中多个光照的颜色信息可以采用相同或不同的方式表示。例如,多个光照的颜色信息可以用颜色类别来表示。示例的,光照序列中多个光照的颜色可以表示为红、黄、绿、紫、青、蓝、红。又例如,多个光照的颜色信息可以用颜色参数来表示。例如,光照序列中多个光照的颜色可以表示为RGB(255,0,0)、RGB(255,255,0)、RGB(0,255,0)、RGB(255,0,255)、RGB(0,255,255)、RGB(0,0,255)。在一些实施例中,光照序列也可以被称为颜色序列,其包含多个光照的颜色信息。The lighting sequence contains information about each of the multiple lights, such as color information, lighting time, and so on. Color information for multiple lights in a lighting sequence can be represented in the same or different ways. For example, color information for multiple lights can be represented by color categories. For example, the colors of the multiple lights in the lighting sequence can be represented as red, yellow, green, purple, cyan, blue, and red. For another example, the color information of multiple lights can be represented by color parameters. For example, the colors of multiple lights in a lighting sequence can be represented as RGB(255, 0, 0), RGB(255, 255, 0), RGB(0, 255, 0), RGB(255, 0, 255), RGB (0, 255, 255), RGB(0, 0, 255). In some embodiments, a lighting sequence may also be referred to as a color sequence, which contains color information for multiple lights.
光照序列中多个光照的照射时间可以包括每个光照计划照射目标对象上的开始时间、结束时间、持续时长等或其任意组合。例如,红光照射目标对象的开始时间为14:00、绿光照射目标对象的开始时间为14:02。又例如,红光和绿光照射目标对象的持续时长均为0.1秒。在一些实施例中,不同光照照射目标对象的持续时长可以相同,也可以不同。照射时间可以通过其他方式表示,在此不再赘述。The illumination times of the plurality of illuminations in the illumination sequence may include the start time, end time, duration, etc., or any combination thereof, for each illumination plan to illuminate the target object. For example, the start time of illuminating the target object with red light is 14:00, and the start time of illuminating the target object with green light is 14:02. For another example, the durations for which the red light and the green light illuminate the target object are both 0.1 seconds. In some embodiments, the durations for different illuminations to illuminate the target object may be the same or different. The irradiation time can be expressed in other ways, which will not be repeated here.
在一些实施例中,终端可以按照特定顺序依次发射多个光照。在一些实施例中,终端可以通过发光元件发射光照。发光元件可以包括终端内置的发光元件,例如,屏幕、LED灯等。发光元件也可以包括外接的发光元件。例如,外接LED灯、发光二极管等。在一些实施例中,当终端被劫持或攻击时,终端可能会接受发射光照的指示,但实际并不会发出光照。关于光照序列的更多细节可以参见图3及其相关描述,此处不再赘述。In some embodiments, the terminal may sequentially emit multiple illuminations in a particular order. In some embodiments, the terminal may emit light through the light emitting element. The light-emitting element may include a light-emitting element built in the terminal, for example, a screen, an LED light, and the like. The light-emitting element may also include an externally-connected light-emitting element. For example, external LED lights, light-emitting diodes, etc. In some embodiments, when the terminal is hijacked or attacked, the terminal may receive an instruction to emit light, but does not actually emit light. For more details about the lighting sequence, please refer to FIG. 3 and its related description, which will not be repeated here.
在一些实施例中,终端或处理设备(例如,目标图像获取模块)可以随机生成或者基于预设规则生成光照序列。例如,终端或处理设备可以从颜色库中随机抽取多个颜色生成光照序列。在一些实施例中,光照序列可以由用户在终端设定、根据目标识别系统100的默认设置确定、或由处理设备通过数据分析确定等。在一些实施例中,终端或者存储设备可以存储光照序列。相应的,目标图像获取模块可以通过网络从终端或者存储设备中获取光照序列。In some embodiments, a terminal or processing device (eg, a target image acquisition module) may generate a lighting sequence randomly or based on preset rules. For example, a terminal or processing device may randomly select a plurality of colors from a color library to generate a lighting sequence. In some embodiments, the lighting sequence may be set by the user at the terminal, determined according to the default settings of the target recognition system 100, or determined by the processing device through data analysis, and the like. In some embodiments, the terminal or storage device may store the lighting sequence. Correspondingly, the target image acquisition module can acquire the illumination sequence from the terminal or the storage device through the network.
多幅目标图像是用于目标识别的图像。多幅目标图像的格式可以包括Joint Photographic Experts Group(JPEG)、Tagged Image File Format(TIFF)、Graphics Interchange Format(GIF)、Kodak Flash PiX(FPX)、Digital Imaging and Communications in Medicine(DICOM)等。多幅目标图像可以是二维(2D,two-dimensional)图像或三维(3D,three-dimensional)图像。The multiple target images are images used for target recognition. The formats of multiple target images can include Joint Photographic Experts Group (JPEG), Tagged Image File Format (TIFF), Graphics Interchange Format (GIF), Kodak Flash PiX (FPX), Digital Imaging and Communications in Medicine (DICOM), etc. The multiple target images may be two-dimensional (2D, two-dimensional) images or three-dimensional (3D, three-dimensional) images.
在一些实施例中,目标图像获取模块可以获取多幅目标图像。例如,目标图像获取模块可以通过网络发送获取指令至终端,然后通过网络接收终端发送的多幅目标图像。或者,终端可以将多幅目标图像发送至存储设备中进行存储,目标图像获取模块可以从存储设备中获取多幅目标图像。目标图像中可能不包含或包含目标。In some embodiments, the target image acquisition module may acquire multiple target images. For example, the target image acquisition module may send acquisition instructions to the terminal through the network, and then receive multiple target images sent by the terminal through the network. Alternatively, the terminal may send multiple target images to a storage device for storage, and the target image acquisition module may acquire multiple target images from the storage device. The target image may not contain or contain the target.
目标图像可以是由终端的图像采集设备拍摄,也可以是基于用户上传的数据(例如,视频或图像)确定。例如,在目标对象验证的过程中,目标识别系统100会给终端下发光照序列。当终端未被劫持或攻击时,终端可以根据光照序列依次发射多个光照。当终端发出多个光照中某一个时,其图像采集设备可以被指示在该光照的照射时间内采集一幅或多幅图像。或者,终端的图像采集设备可以被指示在多个光照的整个照射期间拍摄视频。终端或其他计算设备(例如,处理设备112)可以根据各光照的照射时间从视频中截取各光照的照射时间内采集的一幅或多幅图像。终端在各个光照的照射时间内采集的一幅或多幅图像可以作为多幅目标图像。此时,多幅目标图像为目标对象在被多个光照照射时拍摄的真实图像。可以理解,多个光照的照射时间与多幅目标图像的拍摄时间之间存在对应关系。若在单个光照的照射时间内采集一幅图像,则该对应关系是一对一;若在单个光照的照射时间内采集多幅图像,则该对应关系是一对多。The target image may be captured by the image acquisition device of the terminal, or may be determined based on data (eg, video or image) uploaded by the user. For example, in the process of target object verification, the target recognition system 100 will issue a lighting sequence to the terminal. When the terminal is not hijacked or attacked, the terminal can sequentially emit multiple lights according to the lighting sequence. When the terminal emits one of the multiple illuminations, its image acquisition device may be instructed to acquire one or more images within the illumination time of the illumination. Alternatively, the image capture device of the terminal may be instructed to capture video during the entire illumination period of the plurality of illuminations. The terminal or other computing device (eg, the processing device 112 ) may intercept one or more images collected during the illumination time of each illumination from the video according to the illumination time of each illumination. One or more images collected by the terminal during the irradiation time of each illumination can be used as multiple target images. At this time, the multiple target images are real images captured by the target object when the target object is illuminated by multiple lights. It can be understood that there is a corresponding relationship between the irradiation time of the multiple lights and the shooting time of the multiple target images. If one image is collected within the irradiation time of a single light, the corresponding relationship is one-to-one; if multiple images are collected within the irradiation time of a single light, the corresponding relationship is one-to-many.
当终端被劫持时,劫持者可以通过终端设备上传图像或视频。上传的图像或视频可以包含目标对象或者其他用户的特定身体部位,和/或其他物体。上传的图像或视频可以是由终端或者其他终端拍摄的历史图像或视频,或者是合成的图像或视频。终端或其他计算设备(例如,处理设备112)可以基于上传的图像或视频确定多幅目标图像。例如,被劫持的终端可以根据光照序列中每个光照的照射顺序和/或照射时长,从上传的图像或视频中抽取每个光照对应的一幅或多幅图像。仅作为示例,光照序列中包含依次排列的五个光照,劫持者可以通过终端设备上传五幅图像。终端或其他计算设备会根据五幅图像被上传的先后顺序确定五个光照中每个光照对应的图像。又例如,光照序列中五个光照的照射时间分别为0.5秒,劫持者可以通过终端上传时长2.5秒的视频。终端或其他计算设备可以将被上传的视频分为0-0.5秒、0.5-1秒、1-1.5秒、1.5-2秒和2-2.5秒五段视频,并在每段视频中截取一幅图像。从视频中截取的五幅图像与五个光照依次对应。此时,多幅图像是被劫持者上传的虚假图像,而非目标对象在被多个光照照射时拍摄的真实图像。在一些实施例中,若图像是由劫持者通过终端上传,可以将该图像的上传时间或其在视频中拍摄时间视为其拍摄时间。可以理解,当终端被劫持时,多个光照的照射时间与多幅图像的拍摄时间之间同样存在对应关系。When the terminal is hijacked, the hijacker can upload images or videos through the terminal device. Uploaded images or videos may contain target objects or specific body parts of other users, and/or other objects. The uploaded images or videos may be historical images or videos captured by the terminal or other terminals, or synthesized images or videos. A terminal or other computing device (eg, processing device 112) may determine a plurality of target images based on the uploaded image or video. For example, the hijacked terminal may extract one or more images corresponding to each illumination from the uploaded image or video according to the illumination sequence and/or illumination duration of each illumination in the illumination sequence. Just as an example, the lighting sequence contains five lights arranged in sequence, and the hijacker can upload five images through the terminal device. The terminal or other computing device will determine the image corresponding to each of the five lights according to the sequence in which the five images are uploaded. For another example, the irradiation time of the five lights in the lighting sequence is 0.5 seconds, respectively, and the hijacker can upload a 2.5-second video through the terminal. The terminal or other computing device can divide the uploaded video into five videos of 0-0.5 seconds, 0.5-1 seconds, 1-1.5 seconds, 1.5-2 seconds and 2-2.5 seconds, and take a screenshot of each video image. The five images captured from the video correspond to the five illuminations in sequence. At this point, the multiple images are fake images uploaded by the hijacker, not real images of the target object when illuminated by multiple lights. In some embodiments, if the image is uploaded by the hijacker through the terminal, the uploading time of the image or the shooting time in the video may be regarded as the shooting time. It can be understood that when the terminal is hijacked, there is also a corresponding relationship between the irradiation time of multiple lights and the shooting time of multiple images.
如前所述,光照序列中多个光照对应的多个颜色包括至少一个基准颜色和至少一个验证颜色。在一些实施例中,至少一个基准颜色中的一个或多个与至少一个验证颜色中的一个或多个相同。多幅目标图像包括至少一幅基准图像和至少一幅验证图像,至少一幅基准图像的每幅与至少一幅基准颜色中的一个对应,至少一幅验证图像的每幅与至少一个验证颜色中的一个对应。As mentioned above, the multiple colors corresponding to the multiple lights in the lighting sequence include at least one reference color and at least one verification color. In some embodiments, one or more of the at least one reference color is the same as one or more of the at least one verification color. The multiple target images include at least one reference image and at least one verification image, each of the at least one reference image corresponds to one of the at least one reference color, and each of the at least one verification image corresponds to one of the at least one verification color. a correspondence of .
对于多幅图像中的每一幅,目标图像获取模块可以将光照序列中照射时间与图像拍摄 时间对应的光照的颜色,作为图像对应的颜色。具体的,若光照的照射时间与一幅或多幅图像的拍摄时间相对应,则将光照的颜色作为一幅或多幅图像对应的颜色。可以理解,当终端未被劫持或攻击时,多幅图像对应的颜色应当和光照序列中多个光照的多个颜色相同。例如,光照序列多个光照的多个颜色是“红、黄、蓝、绿、紫、红”,当终端未被劫持或攻击时,终端获取的多幅图像对应的颜色应该也是“红、黄、蓝、绿、紫、红”。当终端被劫持或攻击时,多幅图像对应的颜色和光照序列中多个光照的多个颜色可能不同。For each of the multiple images, the target image acquisition module may use the color of the light corresponding to the irradiation time and the image capture time in the light sequence as the color corresponding to the image. Specifically, if the irradiation time of the light corresponds to the shooting time of one or more images, the color of the light is used as the color corresponding to the one or more images. It can be understood that when the terminal is not hijacked or attacked, the colors corresponding to the multiple images should be the same as the multiple colors of the multiple lights in the lighting sequence. For example, the multiple colors of multiple lights in the lighting sequence are "red, yellow, blue, green, purple, and red". When the terminal is not hijacked or attacked, the colors corresponding to the multiple images obtained by the terminal should also be "red, yellow". , blue, green, purple, red". When the terminal is hijacked or attacked, the colors corresponding to multiple images and multiple colors of multiple lights in the lighting sequence may be different.
步骤1020,对至少一幅基准图像中的每一幅,基于基准图像和每幅验证图像的第一颜色关系,确定目标验证码。Step 1020: For each of the at least one reference image, determine a target verification code based on the first color relationship between the reference image and each verification image.
在一些实施例中,步骤1020可以由验证模块执行,其中,确定基准图像和每幅验证图像的第一颜色关系可以由第一颜色关系确定模块执行。In some embodiments, step 1020 may be performed by a verification module, wherein determining the first color relationship between the reference image and each verification image may be performed by a first color relationship determination module.
基准图像和验证图像之间的第一颜色关系是指基准图像被拍摄时光照的颜色和验证图像被拍摄时光照的颜色之间的关系。第一颜色关系包括相同、不同或相似等。在一些实施例中,第一颜色关系可以用数值表示。例如,相同用“1”表示,不同用“0”表示。The first color relationship between the reference image and the verification image refers to the relationship between the color of the light when the reference image is captured and the color of the light when the verification image is captured. The first color relationship includes the same, different, or similar, and the like. In some embodiments, the first color relationship may be represented numerically. For example, the same is represented by "1", and the difference is represented by "0".
在一些实施例中,基于至少一幅基准图像和至少一幅验证图像确定的至少一个第一颜色关系可以用向量表示,向量中每个元素可以表示至少一幅基准图像中的一幅和至少一幅验证图像中的一幅之间的第一颜色关系。例如,1幅基准图像和5幅验证图像中每一幅的第一颜色关系分别为相同、不同、相同、相同、不同,则1幅基准图像和5幅验证图像的第一颜色关系可以用向量(1,0,1,1,0)表示。In some embodiments, the at least one first color relationship determined based on the at least one reference image and the at least one verification image may be represented by a vector, and each element in the vector may represent one and at least one of the at least one reference image. A first color relationship between one of the verification images. For example, if the first color relationship of each of the 1 reference image and the 5 verification images is the same, different, the same, the same, and different, then the first color relationship of the 1 reference image and the 5 verification images can be represented by a vector (1,0,1,1,0) means.
在一些实施例中,验证模块可以基于第一颜色关系确定目标验证码(也可以称之为“第一验证码”),目标验证码中包括多个用数值表示的子码。目标验证码中每个位置的子码可以表示至少一幅基准图像中的一幅和至少一幅验证图像中的一幅之间的第一颜色关系。例如,上述1幅基准图像和5幅验证图像的第一颜色关系可以用目标验证码10110表示。In some embodiments, the verification module may determine a target verification code (also referred to as a "first verification code") based on the first color relationship, and the target verification code includes a plurality of sub-codes represented by numerical values. The subcode for each position in the target verification code may represent a first color relationship between one of the at least one reference image and one of the at least one verification image. For example, the first color relationship between the above-mentioned one reference image and five verification images can be represented by the target verification code 10110.
在一些实施例中,第一颜色关系确定模块可以提取基准图像的基准颜色特征和每一幅验证图像的验证颜色特征。第一颜色关系确定模块可以进一步基于基准颜色特征和验证颜色特征,确定基准图像和每一幅验证图像的第一颜色关系。In some embodiments, the first color relationship determination module may extract the reference color feature of the reference image and the verification color feature of each verification image. The first color relationship determination module may further determine the first color relationship between the reference image and each verification image based on the reference color feature and the verification color feature.
基准颜色特征是指基准图像的颜色特征。验证颜色特征是指验证图像的颜色特征。图像的颜色特征是指与图像的颜色相关的信息。图像的颜色包括拍摄图像时光照的颜色、图像中拍摄对象的颜色、图像中背景的颜色等。在一些实施例中,颜色特征可以包括由神经网络提取的深度特征和/或复杂特征。The reference color feature refers to the color feature of the reference image. Verifying color features refers to verifying the color features of an image. The color feature of an image refers to information related to the color of the image. The color of the image includes the color of the light when the image is captured, the color of the subject in the image, the color of the background in the image, and the like. In some embodiments, the color features may include deep features and/or complex features extracted by a neural network.
颜色特征可以通过多种方式表示。在一些实施例中,颜色特征可以基于图像中各像素点在颜色空间中的颜色值表示。颜色空间是使用一组数值描述颜色的数学模型,该组数值中 每个数值可以表示颜色特征在颜色空间的每个颜色通道上的颜色值。在一些实施例中,颜色空间可以表示为向量空间,该向量空间的每个维度表示颜色空间的一个颜色通道。颜色特征可以用该向量空间中的向量来表示。在一些实施例中,颜色空间可以包括但不限于RGB颜色空间、Lαβ颜色空间、LMS颜色空间、HSV颜色空间、YCrCb颜色空间和HSL颜色空间等。可以理解,不同的颜色空包含不同的颜色通道。例如,RGB颜色空间包含红色通道R、绿色通道G和蓝色通道B,颜色特征可以用图像中各像素点分别在红色通道R、绿色通道G和蓝色通道B上的颜色值表示。Color features can be represented in a number of ways. In some embodiments, the color feature can be represented based on the color value of each pixel in the image in the color space. A color space is a mathematical model that describes color using a set of numerical values, each of which can represent the color value of a color feature on each color channel of the color space. In some embodiments, a color space may be represented as a vector space, each dimension of the vector space representing a color channel of the color space. Color features can be represented by vectors in this vector space. In some embodiments, the color space may include, but is not limited to, RGB color space, Lαβ color space, LMS color space, HSV color space, YCrCb color space, HSL color space, and the like. Understandably, different color spaces contain different color channels. For example, the RGB color space includes red channel R, green channel G, and blue channel B, and color features can be represented by the color values of each pixel in the image on the red channel R, green channel G, and blue channel B, respectively.
在一些实施例中,颜色特征可以通过其他方式表示(如,颜色直方图、颜色矩、颜色集等)。例如,对图像中各像素点在颜色空间中的颜色值进行直方图统计,生成表示颜色特征的直方图。又例如,对图像中各像素点在颜色空间中的颜色值进行特定运算(如,均值、平方差等),将该特定运算的结果表示该图像的颜色特征。In some embodiments, color features may be represented by other means (eg, color histograms, color moments, color sets, etc.). For example, the histogram statistics are performed on the color values of each pixel in the image in the color space to generate a histogram representing the color features. For another example, a specific operation (eg, mean, squared difference, etc.) is performed on the color value of each pixel in the image in the color space, and the result of the specific operation represents the color feature of the image.
在一些实施例中,第一颜色关系确定模块可以通过颜色特征提取算法和/或颜色验证模型(或其部分)来提取多幅目标图像的颜色特征。颜色特征提取算法包括颜色直方图、颜色矩、颜色集等。例如,第一颜色关系确定模块可以基于图像中各像素点分别在颜色空间的每个颜色通道的颜色值,统计梯度直方图,从而获取颜色直方图。又例如,第一颜色关系确定模块可以将图像分割为多个区域,用图像中各像素点分别在颜色空间的每个颜色通道的颜色值建立的多个区域的二进制索引的集合,以确定图像的颜色集。In some embodiments, the first color relationship determination module may extract color features of the plurality of target images through a color feature extraction algorithm and/or a color verification model (or a portion thereof). Color feature extraction algorithms include color histogram, color moment, color set, etc. For example, the first color relationship determination module may count the gradient histogram based on the color value of each pixel in the image in each color channel of the color space, so as to obtain the color histogram. For another example, the first color relationship determination module may divide the image into multiple regions, and use the set of binary indices of the multiple regions established by the color values of each pixel in the image in each color channel of the color space to determine the image. color set.
在一些实施例中,第一颜色关系确定模块可以确定基准图像的基准颜色特征和验证图像的验证颜色特征之间的相似度,基于相似度和阈值确定至少一个第一颜色关系。例如,相似度大于第一阈值则判断为相同,小于第二阈值则判断为不同,或者大于第三阈值小于第一阈值则判断为相似等。其中,第一阈值可以大于第二阈值和第三阈值,第三阈值可以大于第二阈值。在一些实施例中,相似度可以用基准颜色特征和验证颜色特征之间的距离表征。距离可以包括但不限于欧氏距离、曼哈顿距离、切比雪夫距离、闵可夫斯基距离、马氏距离、夹角余弦距离等。In some embodiments, the first color relationship determination module may determine the similarity between the reference color feature of the reference image and the verification color feature of the verification image, and determine at least one first color relationship based on the similarity and the threshold. For example, if the similarity is greater than the first threshold, it is determined to be the same, if it is smaller than the second threshold, it is determined to be different, or larger than the third threshold and smaller than the first threshold, it is determined to be similar, and so on. The first threshold may be greater than the second threshold and the third threshold, and the third threshold may be greater than the second threshold. In some embodiments, the similarity may be characterized by the distance between the reference color feature and the verification color feature. The distance may include, but is not limited to, Euclidean distance, Manhattan distance, Chebyshev distance, Minkowski distance, Mahalanobis distance, included angle cosine distance, and the like.
在一些实施例中,第一颜色关系确定模块还可以基于颜色验证模型包含的颜色关系确定层获取第一颜色关系。关于颜色关系确定层的详细描述可以参见图12及其相关描述,在此不再赘述。In some embodiments, the first color relationship determination module may further acquire the first color relationship based on a color relationship determination layer included in the color verification model. For a detailed description of the color relationship determination layer, reference may be made to FIG. 12 and its related descriptions, which will not be repeated here.
步骤1030,对至少一个基准颜色中的每一个,基于基准颜色和每个验证颜色的第二颜色关系,确定参考验证码。 Step 1030, for each of the at least one reference color, determine a reference verification code based on the reference color and the second color relationship of each verification color.
在一些实施例中,步骤230可以由验证模块执行,其中,确定基准颜色和每个验证颜色的第二颜色关系可以由第二颜色关系确定模块执行。In some embodiments, step 230 may be performed by a verification module, wherein determining the reference color and the second color relationship for each verification color may be performed by a second color relationship determination module.
基准颜色和验证颜色的第二颜色关系可以表示这两个颜色是否相同、不同,或者相似。在一些实施例中,第二颜色关系表示方式可以与第一颜色关系类似,在此不再赘述。在一些实施例中,参考验证码(也可以称之为“第二验证码”)的形式可以与目标验证码类似,在此不再赘述。The second color relationship of the reference color and the verification color may indicate whether the two colors are the same, different, or similar. In some embodiments, the representation manner of the second color relationship may be similar to that of the first color relationship, and details are not described herein again. In some embodiments, the form of the reference verification code (which may also be referred to as a "second verification code") may be similar to the target verification code, which will not be repeated here.
在一些实施例中,第二颜色关系确定模块可以基于基准颜色和验证颜色类别或颜色参数,确定其第二颜色关系。例如,如果基准颜色和验证颜色中的类别相同或颜色参数的数值差小于一定阈值,则判断这两个颜色相同,反之则判断这两个颜色不同。In some embodiments, the second color relationship determination module may determine its second color relationship based on the reference color and the verification color category or color parameter. For example, if the categories in the reference color and the verification color are the same or the numerical difference of the color parameters is less than a certain threshold, the two colors are judged to be the same, otherwise, the two colors are judged to be different.
在一些实施例中,第二颜色关系确定模块可以提取基准颜色的颜色模板图像的第一颜色特征和验证颜色的颜色模板图像的第二颜色特征。第二颜色关系确定模块可以进一步基于第一颜色特征和第二颜色特征,确定基准颜色和验证颜色的第二颜色关系。例如,第二颜色关系确定模块可以计算第一颜色特征和第二颜色特征之间的相似度以确定第二颜色关系。In some embodiments, the second color relationship determination module may extract the first color feature of the color template image of the reference color and the second color feature of the color template image of the verification color. The second color relationship determination module may further determine a second color relationship between the reference color and the verification color based on the first color feature and the second color feature. For example, the second color relationship determination module may calculate the similarity between the first color feature and the second color feature to determine the second color relationship.
在一些实施例中,至少一个第一颜色关系和至少一个第二颜色关系存在一对一的对应关系。具体的,基准图像和验证图像之间的第一颜色关系与该基准图像对应的基准颜色和该验证图像对应的验证颜色之间第二颜色关系相对应。In some embodiments, there is a one-to-one correspondence between at least one first color relationship and at least one second color relationship. Specifically, the first color relationship between the reference image and the verification image corresponds to the second color relationship between the reference color corresponding to the reference image and the verification color corresponding to the verification image.
步骤1040,基于目标验证码和参考验证码,进行图像真实性验证。 Step 1040, based on the target verification code and the reference verification code, perform image authenticity verification.
在一些实施例中,步骤1040可以由验证模块执行。In some embodiments, step 1040 may be performed by a verification module.
在一些实施例中,可以通过确定多幅目标图像的真实性进行图像真实性验证。多幅目标图像的真实性可以反映多幅目标图像是否是目标对象在多个颜色的光照的照射下拍摄获取的图像。例如,当终端未被劫持或攻击时,其发光元件可以发射多个颜色的光照,同时其图像采集设备可以目标对象进行录像或拍照以获取的目标图像。此时,目标图像具有真实性。又例如,当终端被劫持或攻击时,目标图像是基于攻击者上传的图像或视频获取。此时,目标图像不具有真实性。In some embodiments, image authenticity verification may be performed by determining the authenticity of multiple target images. The authenticity of the multiple target images can reflect whether the multiple target images are images captured by the target object under illumination of multiple colors. For example, when the terminal is not hijacked or attacked, its light-emitting element can emit light of multiple colors, and its image acquisition device can record or take pictures of the target object to obtain the target image. At this point, the target image is realistic. For another example, when the terminal is hijacked or attacked, the target image is obtained based on the image or video uploaded by the attacker. At this time, the target image does not have authenticity.
目标图像的真实性可以用于确定终端的图像采集设备是否被攻击者劫持。例如,多幅目标图像中若存在至少一幅目标图像不具有真实性,则说明图像采集设备被劫持。又例如,多幅目标图像中若超过预设数量的目标图像不具有真实性,则说明图像采集设备被劫持。The authenticity of the target image can be used to determine whether the terminal's image capture device has been hijacked by an attacker. For example, if at least one target image in the multiple target images is not authentic, it means that the image acquisition device is hijacked. For another example, if more than a preset number of target images in the multiple target images are not authentic, it means that the image acquisition device is hijacked.
在一些实施例中,验证模块可以选择至少一个第一颜色关系中的部分或全部构建对应的第一验证码,基于被选择的第一颜色关系对应的第二颜色关系构建对应的第二验证码,确定多幅目标图像的真实性。与第一向量和第二向量类似地,第一验证码和第二验证码中子码的位置基于第一颜色关系和第二颜色关系之间的对应关系确定。例如,第一验证码和第二验证码不同,则多幅目标图像不具有真实性。示例的,第一验证码为10110,第二验证码为10111,则多幅目标图像不具有真实性。又例如,验证模块可以基于第一验证码和第二验证码中子码 相同的个数,确定多幅目标图像的真实性。例如,子码相同的个数大于第五阈值,则确定多幅目标图像的真实性,子码相同的个数小于第六阈值,则确定多幅目标图像不具有真实性。示例的,第五阈值为3,第六阈值为1,第一验证码为10110,第二验证码为10111,第一验证码和第二验证码的第一位、第二位、第三位和第四位的子码对应相同,则确定多幅目标图像具有真实性。In some embodiments, the verification module may select part or all of at least one first color relationship to construct a corresponding first verification code, and construct a corresponding second verification code based on the second color relationship corresponding to the selected first color relationship , to determine the authenticity of multiple target images. Similar to the first vector and the second vector, the positions of the sub-codes in the first verification code and the second verification code are determined based on the correspondence between the first color relationship and the second color relationship. For example, if the first verification code and the second verification code are different, the multiple target images do not have authenticity. For example, if the first verification code is 10110 and the second verification code is 10111, the multiple target images are not authentic. For another example, the verification module may determine the authenticity of the multiple target images based on the same number of sub-codes in the first verification code and the second verification code. For example, if the number of identical subcodes is greater than the fifth threshold, the authenticity of the multiple target images is determined, and if the number of identical subcodes is less than the sixth threshold, it is determined that the multiple target images are not authentic. Exemplarily, the fifth threshold is 3, the sixth threshold is 1, the first verification code is 10110, the second verification code is 10111, and the first, second, and third digits of the first verification code and the second verification code are If the correspondence with the subcode of the fourth bit is the same, it is determined that the multiple target images are authentic.
在一些实施例中,验证模块可以基于至少一个第一颜色关系中的部分或全部,和对应的第二颜色关系,确定多幅目标图像的真实性。In some embodiments, the verification module may determine the authenticity of the plurality of target images based on some or all of the at least one first color relationship and the corresponding second color relationship.
在一些实施例中,第一颜色关系和第二颜色关系可以通过向量表示。在一些实施例中,验证模块可以选择至少一个第一颜色关系中的部分或全部构建第一向量,基于被选择的第一颜色关系对应的第二颜色关系构建第二向量。进一步,验证模块可以基于第一向量和第二向量的相似度确定多幅目标图像的真实性。例如,相似度大于第四阈值,则多幅目标图像具有真实性。可以理解的,第一向量和第二向量中元素的排列顺序基于第一颜色关系和第二颜色关系之间的对应关系确定。例如,第一向量A中某第一颜色关系对应的元素为A ij,第二向量B中该第一颜色关系对应的第二颜色关系对应的元素为B ijIn some embodiments, the first color relationship and the second color relationship may be represented by vectors. In some embodiments, the verification module may select part or all of the at least one first color relationship to construct the first vector, and construct the second vector based on the second color relationship corresponding to the selected first color relationship. Further, the verification module may determine the authenticity of the multiple target images based on the similarity between the first vector and the second vector. For example, if the similarity is greater than the fourth threshold, the multiple target images are authentic. It can be understood that the arrangement order of elements in the first vector and the second vector is determined based on the corresponding relationship between the first color relationship and the second color relationship. For example, the element corresponding to a certain first color relationship in the first vector A is A ij , and the element corresponding to the second color relationship corresponding to the first color relationship in the second vector B is B ij .
如前所述,基准图像和验证图像都是在相同的外界环境光的条件下、被相同的发光元件照射时拍摄的,因此,基于基准图像和验证图像之间的关系确定多幅目标图像的真实性时,可以消除或减弱外界环境光和发光元件的影响,从而提高光照颜色的识别准确率。As mentioned above, both the reference image and the verification image are captured under the same ambient light conditions and illuminated by the same light-emitting element. Therefore, based on the relationship between the reference image and the verification image, the In the case of authenticity, the influence of external ambient light and light-emitting elements can be eliminated or weakened, thereby improving the accuracy of light color recognition.
在一些实施例中,本说明书一些实施例中针对图像真实性判断设定的预设阈值(例如,第五阈值、第六阈值)可以和拍摄稳定程度相关。拍摄稳定程度是终端的图像采集设备获取目标图像时的稳定程度。在一些实施例中,预设阈值与拍摄稳定程度正相关。可以理解,拍摄稳定程度越高,则获取的目标图像质量越高,基于多幅目标图像提取的颜色特征越能真实反应被拍摄时光照的颜色,则预设阈值越大。在一些实施例中,拍摄稳定度可以基于终端(例如,车载终端或用户终端等)的运动传感器检测到的终端的运动参数衡量。例如,运动传感器检测到的运动速度、震动频率等。示例的,运动参数越大,或者运动参数变化率越大,说明拍摄稳定程度越低。运动传感器可以是检测车辆行驶情况的传感器,车辆可以是目标用户使用的车辆。目标用户是指目标对象所属的用户。例如,目标用户为网约车司机,则运动传感器可以是司机端或者车载终端的运动传感器。In some embodiments, the preset thresholds (eg, the fifth threshold, the sixth threshold) set for the image authenticity determination in some embodiments of this specification may be related to the degree of shooting stability. The shooting stability degree is the stability degree when the image acquisition device of the terminal acquires the target image. In some embodiments, the preset threshold is positively related to the degree of shooting stability. It can be understood that the higher the shooting stability, the higher the quality of the acquired target image, and the more the color features extracted based on multiple target images can truly reflect the color of the illumination when shooting, and the larger the preset threshold is. In some embodiments, the shooting stability may be measured based on a motion parameter of the terminal detected by a motion sensor of the terminal (eg, a vehicle-mounted terminal or a user terminal, etc.). For example, the motion speed, vibration frequency, etc. detected by the motion sensor. For example, the larger the motion parameter, or the larger the change rate of the motion parameter, the lower the shooting stability. The motion sensor may be a sensor that detects the driving situation of the vehicle, and the vehicle may be the vehicle used by the target user. The target user refers to the user to which the target object belongs. For example, if the target user is an online car-hailing driver, the motion sensor may be a motion sensor on the driver's end or the in-vehicle terminal.
在一些实施例中,预设阈值还可以与拍摄距离和转动角度相关。拍摄距离是图像采集设备获取目标图像时和目标对象之间的距离。转动角度是图像采集设备获取目标图像时目标对象正面与终端屏幕的角度。在一些实施例中,拍摄距离和转动角度都与预设阈值负相关。可以理解,拍摄距离越短,则获取的目标图像质量越高,基于多幅目标图像提取的颜色特征 越能真实反应被拍摄时光照的颜色,则预设阈值越大。转动角度越小,则获取的目标图像质量越高,同理,则预设阈值越大。在一些实施例中,拍摄距离和转动角度可以通过图像识别技术基于目标图像确定。In some embodiments, the preset threshold may also be related to the shooting distance and the rotation angle. The shooting distance is the distance between the target object when the image acquisition device acquires the target image. The rotation angle is the angle between the front of the target object and the terminal screen when the image acquisition device acquires the target image. In some embodiments, both the shooting distance and the rotation angle are negatively correlated with the preset threshold. It can be understood that the shorter the shooting distance, the higher the quality of the obtained target image, and the more the color features extracted based on multiple target images can truly reflect the color of the light at the time of shooting, the larger the preset threshold is. The smaller the rotation angle, the higher the quality of the acquired target image, and similarly, the larger the preset threshold. In some embodiments, the shooting distance and rotation angle may be determined based on the target image through image recognition techniques.
在一些实施例中,验证模块可以对每幅目标图像的拍摄稳定程度、拍摄距离和转动角度进行特定运算(如,求平均、标准差等),基于特定运算后的拍摄稳定程度、拍摄距离和拍摄角度确定预设阈值。In some embodiments, the verification module may perform specific operations (eg, average, standard deviation, etc.) on the shooting stability, shooting distance, and rotation angle of each target image, and based on the specific calculation, the shooting stability, shooting distance, and The shooting angle determines the preset threshold.
例如,验证模块获取多幅目标图像被获取时终端的稳定程度包括获取多幅目标图像中每一幅被拍摄时终端的子稳定程度;对多个子稳定程度进行融合,确定稳定程度。For example, the verification module acquiring the stability degree of the terminal when multiple target images are acquired includes acquiring the sub-stability degree of the terminal when each of the multiple target images is captured; and fusing the multiple sub-stability degrees to determine the stability degree.
又例如,验证模块获取多幅目标图像被拍摄时目标对象与终端的拍摄距离包括:获取多幅目标图像中每一幅被拍摄时目标对象与终端的子拍摄距离;对多个子拍摄距离进行融合,确定拍摄距离。For another example, obtaining the shooting distance between the target object and the terminal when the multiple target images are captured by the verification module includes: acquiring the sub-shooting distance between the target object and the terminal when each of the multiple target images is captured; fusing the multiple sub-shooting distances to determine the shooting distance.
又例如,验证模块获取多幅目标图像被拍摄时目标对象相对于终端的转动角度包括获取多幅目标图像中每一幅被拍摄时目标对象相对于终端的子转动角度;对多个子转动角度进行融合,确定转动角度。For another example, obtaining the rotation angle of the target object relative to the terminal when the multiple target images are captured by the verification module includes acquiring the sub-rotation angle of the target object relative to the terminal when each of the multiple target images is captured; Fusion to determine the rotation angle.
在本说明书一些实施例中,目标系别系统100会给终端下发光照序列,并从终端获取与光照序列中多个光照存在对应关系的目标图像。处理设备通过识别目标脸图像被拍摄时光照的颜色,可以确定目标图像是否是在目标对象被光照序列照射下拍摄的图像,进一步确定终端是否被劫持或攻击。可以理解,攻击者在不知道光照序列的情况下,上传的图像或上传的视频中的图像被拍摄时光照的颜色很难与光照序列中的多个光照的颜色相同。即使颜色的种类相同,每个颜色的位置顺序也很难相同。本说明书中披露的方法可以提高攻击者攻击的难度,保证目标识别的安全性。In some embodiments of the present specification, the target system 100 will issue a lighting sequence to the terminal, and acquire from the terminal a target image corresponding to a plurality of lightings in the lighting sequence. By recognizing the color of the illumination when the target face image is captured, the processing device can determine whether the target image is an image captured under the illumination sequence of the target object, and further determine whether the terminal is hijacked or attacked. It is understandable that when an attacker does not know the lighting sequence, it is difficult for the color of the light to be the same as the color of multiple lights in the light sequence when the uploaded image or the image in the uploaded video is captured. Even if the kinds of colors are the same, the order of the positions of each color is difficult to be the same. The method disclosed in this specification can improve the difficulty of an attacker's attack and ensure the security of target identification.
图11是根据本说明书一些实施例所示的光照序列的示意图。Figure 11 is a schematic diagram of a lighting sequence according to some embodiments of the present specification.
在一些实施例中,光照序列中光照的多个颜色可以包含至少一个基准颜色和至少一个验证颜色。验证颜色是多个颜色中直接用于验证图像真实性的颜色。基准颜色是多个颜色中用于辅助验证颜色确定目标图像真实性的颜色。例如,基准颜色对应的目标图像(又称基准图像)可以基于验证颜色对应的目标图像(又称为验证图像)确定第一颜色关系。进一步的,验证模块可以基于第一颜色关系确定多幅目标图像的真实性。如图3所示,光照序列e中包含多个基准颜色的光照“红光、绿光、蓝光”,多个验证颜色的光照“黄光、紫光…青光”;光照序列f中包含多个基准颜色的光照“红光、白光…蓝光”,多个验证颜色的光照“红光..绿光”。In some embodiments, the plurality of colors of lighting in the lighting sequence may include at least one reference color and at least one verification color. The verification color is one of the colors that is directly used to verify the authenticity of the image. The reference color is a color among the colors used to assist the verification color to determine the authenticity of the target image. For example, the target image corresponding to the reference color (also referred to as the reference image) may determine the first color relationship based on the target image corresponding to the verification color (also referred to as the verification image). Further, the verification module may determine the authenticity of the plurality of target images based on the first color relationship. As shown in Figure 3, the illumination sequence e contains multiple benchmark colors of illumination "red light, green light, blue light", and multiple verification colors of illumination "yellow light, purple light... cyan light"; the illumination sequence f contains multiple Lighting of the reference color "red light, white light...blue light", and light of multiple verification colors "red light..green light".
在一些实施例中,验证颜色存在多个。多个验证颜色可以完全相同。例如,验证颜色 可以是红、红、红、红。或者,多个验证颜色也可以完全不同。例如,验证颜色可以是红、黄、蓝、绿、紫。又或者,多个验证颜色还可以部分相同。例如,验证颜色可以是黄、绿、紫、黄、红。与验证颜色类似地,在一些实施例中,基准颜色存在多个,多个基准颜色可以完全相同、完全不同或部分相同。在一些实施例中,验证颜色可以仅包含一个颜色,例如绿色。In some embodiments, multiple colors exist for verification. Multiple verification colors can be identical. For example, the verification color can be red, red, red, red. Alternatively, multiple verification colors can be completely different. For example, the verification color can be red, yellow, blue, green, violet. Alternatively, the plurality of verification colors may be partially the same. For example, the verification color can be yellow, green, purple, yellow, red. Similar to the verification color, in some embodiments, there are multiple reference colors, and the multiple reference colors may be identical, completely different, or partially identical. In some embodiments, the verification color may contain only one color, such as green.
在一些实施例中,至少一个基准颜色和至少一个验证颜色可以根据目标识别系统100的默认设定确定、由用户手动设定,或者由目标图像获取模块确定。例如,目标图像获取模块可以随机选取基准颜色和验证颜色。仅作为示例,目标图像获取模块可以从多个颜色中随机选取部分颜色作为至少一个基准颜色,剩余的颜色作为至少一个验证颜色。在一些实施例中,目标图像获取模块可以基于预设规则确定至少一个基准颜色和至少一个验证颜色。预设规则可以是关于验证颜色之间关系、基准颜色之间关系,和/或验证颜色和基准颜色之间关系等的规则。例如,预设规则为验证颜色可以基于基准颜色融合生成等。In some embodiments, the at least one reference color and the at least one verification color may be determined according to default settings of the object recognition system 100, manually set by the user, or determined by the object image acquisition module. For example, the target image acquisition module may randomly select the reference color and the verification color. Just as an example, the target image acquisition module may randomly select a part of the colors from the plurality of colors as at least one reference color, and the remaining colors as at least one verification color. In some embodiments, the target image acquisition module may determine at least one reference color and at least one verification color based on preset rules. The preset rules may be rules about verifying the relationship between colors, the relationship between reference colors, and/or the relationship between verifying colors and reference colors, and the like. For example, the preset rule is that the verification color can be generated by fusion based on the reference color, and so on.
在一些实施例中,至少一个基准颜色中的一个或多个与至少一个验证颜色中的一个或多个相同。至少一个基准颜色和至少一个验证颜色之间可以全部相同或部分相同。例如,至少一个验证颜色中的某一个可以与至少一个基准颜色中特定一个颜色相同。可以理解的,该验证颜色也可以基于至少一个基准颜色确定,即,将该特定基准颜色作为该验证颜色即可。如图11所示,光照序列f中,多个基准颜色“红、白…蓝”和多个验证颜色“红..绿”均包含红色。In some embodiments, one or more of the at least one reference color is the same as one or more of the at least one verification color. The at least one reference color and the at least one verification color may be completely identical or partially identical. For example, a certain one of the at least one verification color may be the same as a certain one of the at least one reference color. It can be understood that the verification color can also be determined based on at least one reference color, that is, the specific reference color can be used as the verification color. As shown in Figure 11, in the illumination sequence f, multiple reference colors "red, white...blue" and multiple verification colors "red...green" all contain red.
在一些实施例中,至少一个基准颜色和至少一个验证颜色还可以存在其他关系,在此不做限制。例如,至少一个基准颜色和至少一个验证颜色的色系相同或不同。示例的,至少一个基准颜色属于暖色系的颜色(如,红色、黄色等),至少一个基准颜色属于冷色系的颜色(如,灰色等)。In some embodiments, the at least one reference color and the at least one verification color may also have other relationships, which are not limited herein. For example, at least one reference color and at least one verification color are the same or different in color family. Exemplarily, at least one reference color belongs to a warm color system (eg, red, yellow, etc.), and at least one reference color belongs to a cool color system (eg, gray, etc.).
在一些实施例中,在光照序列中,至少一个基准颜色对应的光照可以排列在至少一个验证颜色对应的光照的前面或后面。如图3所示,光照序列e中,多个基准颜色的光照“红光、绿光、蓝光”排列在多个验证颜色的光照“黄光、紫光…青光”前面。光照序列f中,多个基准颜色的光照“红光、白光…蓝光”排列在多个验证颜色“红光..绿光”的后面。在一些实施例中,至少一个基准颜色对应的光照还可以和至少一个验证颜色对应的光照间隔排列,在此不做限制。In some embodiments, in the lighting sequence, the lighting corresponding to the at least one reference color may be arranged in front of or behind the lighting corresponding to the at least one verification color. As shown in Fig. 3, in the illumination sequence e, illuminations of multiple reference colors "red light, green light, blue light" are arranged in front of illuminations of multiple verification colors "yellow light, purple light...cyan light". In the illumination sequence f, illuminations of multiple reference colors "red light, white light...blue light" are arranged behind multiple verification colors "red light...green light". In some embodiments, the illumination corresponding to the at least one reference color may also be arranged at intervals with the illumination corresponding to the at least one verification color, which is not limited herein.
图12是根据本说明书一些实施例所示的颜色验证模型的示意图。FIG. 12 is a schematic diagram of a color verification model according to some embodiments of the present specification.
在一些实施例中,验证模块可以基于颜色验证模型确定多幅目标图像的真实性。如图12所示,颜色验证模型可以包括颜色特征提取层1230和颜色关系确定层1260。颜色特征提 取层1230和颜色关系确定层1260可以用于实现步骤1020。进一步的,验证模块可以基于第一颜色关系和第二颜色关系,确定多幅目标图像的真实性。In some embodiments, the verification module may determine the authenticity of the plurality of target images based on the color verification model. As shown in FIG. 12 , the color verification model may include a color feature extraction layer 1230 and a color relationship determination layer 1260 . Color feature extraction layer 1230 and color relationship determination layer 1260 may be used to implement step 1020. Further, the verification module may determine the authenticity of the plurality of target images based on the first color relationship and the second color relationship.
在一些实施例中,至少一幅基准图像和至少一幅验证图像可以组成一个或多个图像对。每个图像对包括至少一幅基准图像中的一幅和至少一幅验证图像中一幅。颜色验证模型可以分别对一个或多个图像对进行分析,确定该图像对中基准图像和验证图像之间的第一颜色关系。例如,如图12所示,至少一幅基准图像包括“1220-1、1220-2…1220-y”,至少一幅验证图像包括“1210-1…1210-x”。出于说明目的,下文以基准图像1220-y和验证图像1210-1构成的图像对为例展开。In some embodiments, the at least one reference image and the at least one verification image may form one or more image pairs. Each image pair includes one of at least one reference image and one of at least one verification image. The color verification model may separately analyze one or more image pairs to determine a first color relationship between the reference image and the verification image in the image pair. For example, as shown in FIG. 12, at least one reference image includes "1220-1, 1220-2...1220-y", and at least one verification image includes "1210-1...1210-x". For the purpose of illustration, the image pair formed by the reference image 1220-y and the verification image 1210-1 is taken as an example to expand.
颜色特征提取层1230可以提取基准图像1220-y的基准颜色特征和验证图像1210-1的验证颜色特征。在一些实施例中,颜色特征提取层1230的类型可以包括ResNet、ResNeXt、SE-Net、DenseNet、MobileNet、ShuffleNet、RegNet、EfficientNet或Inception等卷积神经网络(Convolutional Neural Networks,CNN)模型,或循环神经网络模型。The color feature extraction layer 1230 may extract the reference color feature of the reference image 1220-y and the verification color feature of the verification image 1210-1. In some embodiments, the type of the color feature extraction layer 1230 may include a Convolutional Neural Networks (CNN) model such as ResNet, ResNeXt, SE-Net, DenseNet, MobileNet, ShuffleNet, RegNet, EfficientNet, or Inception, or a loop Neural network model.
颜色特征提取层1230的输入可以是图像对(如,基准图像1220-y和验证图像1210-1)。例如,可以将基准图像1220-y和验证图像1210-1拼接后输入颜色特征提取层1230。颜色特征提取层1230的输出可以是图像对的颜色特征。例如,颜色特征提取层1230的输出可以是基准图像1220-y的基准颜色特征1250-y和验证图像1210-1的验证颜色特征1240-1。又例如,颜色特征提取层1230的输出可以是验证图像1210-1的颜色特征1240-1和基准图像1220-y的颜色特征1250-y拼接后的颜色特征。The input to the color feature extraction layer 1230 may be an image pair (eg, a reference image 1220-y and a verification image 1210-1). For example, the reference image 1220-y and the verification image 1210-1 can be concatenated and input to the color feature extraction layer 1230. The output of the color feature extraction layer 1230 may be the color features of the image pair. For example, the output of the color feature extraction layer 1230 may be the reference color feature 1250-y of the reference image 1220-y and the verification color feature 1240-1 of the verification image 1210-1. For another example, the output of the color feature extraction layer 1230 may be the color feature after splicing the color feature 1240-1 of the verification image 1210-1 and the color feature 1250-y of the reference image 1220-y.
颜色关系确定层1260用于基于图像对的颜色特征,确定图像对的第一颜色关系。例如,验证模块可以将基准图像1220-y的基准颜色特征1250-y和验证图像1210-1的验证颜色特征1240-1输入颜色关系确定层1260,颜色关系确定层1260输出基准图像1220-y和验证图像1210-1的第一颜色关系。The color relationship determination layer 1260 is configured to determine the first color relationship of the image pair based on the color features of the image pair. For example, the verification module may input the reference color feature 1250-y of the reference image 1220-y and the verification color feature 1240-1 of the verification image 1210-1 into the color relationship determination layer 1260, which outputs the reference image 1220-y and Verify the first color relationship of image 1210-1.
在一些实施例中,验证模块可以将至少一个基准图像和至少一个验证图像组成的多对图像对一起输入颜色验证模型。颜色验证模型可以同时输出多对图像对中每一对的第一颜色关系。在一些实施例中,验证模块可以将多对图像对中某一对输入颜色验证模型。颜色验证模型可以输出该对图像对的第一颜色关系。In some embodiments, the verification module may input multiple image pairs consisting of at least one reference image and at least one verification image together into the color verification model. The color verification model can simultaneously output the first color relationship for each of multiple pairs of images. In some embodiments, the verification module may input a pair of image pairs into the color verification model. The color verification model may output a first color relationship for the pair of images.
在一些实施例中,颜色关系确定层1260可以是分类模型,包括但不限于全连接层、深度神经网络、决策树等。In some embodiments, the color relationship determination layer 1260 may be a classification model, including but not limited to fully connected layers, deep neural networks, decision trees, and the like.
在一些实施例中,颜色验证模型为预置参数的机器学习模型。预置参数是指机器学习模型训练过程中,学习到的模型参数。以神经网络为例,模型参数包括权重(Weight)和偏置(bias)等。颜色验证模型的预置参数在训练过程确定。例如,模型获取模块可以基于带有标 签的多个训练样本训练初始颜色验证模型,以得到颜色验证模型。In some embodiments, the color verification model is a machine learning model with preset parameters. Preset parameters refer to the model parameters learned during the training of the machine learning model. Taking a neural network as an example, the model parameters include weight and bias. The preset parameters of the color verification model are determined during the training process. For example, the model acquisition module can train an initial color verification model based on multiple training samples with labels to obtain a color verification model.
训练样本包括带有标签的一个或多个样本图像对。每个样本图像对包括样本目标对象在相同或不同灯光的照射下拍摄的两张目标图像。训练样本的标签可以说明样本图像对被拍摄时光照的颜色是否相同。Training samples include one or more sample image pairs with labels. Each sample image pair includes two target images of the sample target object taken under the same or different lights. The labels of the training samples can indicate whether the sample image pairs were captured with the same color of lighting.
在一些实施例中,模型获取模块可以将训练样本输入初始颜色验证模型,通过训练更新初始颜色特征提取层和初始颜色关系确定层的参数,直到更新后的颜色验证模型满足预设条件。更新后的颜色验证模型可以被指定为预置参数的颜色验证模型,换言之,更新后的颜色验证模型可以被指定为训练后的颜色验证模型。预设条件可以是更新后的颜色验证模型的损失函数小于阈值、收敛,或训练迭代次数达到阈值。In some embodiments, the model acquisition module may input the training samples into the initial color verification model, and update the parameters of the initial color feature extraction layer and the initial color relationship determination layer through training until the updated color verification model satisfies preset conditions. The updated color verification model may be designated as a preset parameter color verification model, in other words, the updated color verification model may be designated as a trained color verification model. The preset condition may be that the loss function of the updated color verification model is smaller than the threshold, converges, or the number of training iterations reaches the threshold.
在一些实施例中,模型获取模块可以通过端到端的训练方式,训练初始颜色验证模型中的初始颜色特征提取层和初始颜色关系确定层。端到端的训练方式是指将训练样本输入初始模型,并基于初始模型的输出确定损失值,基于损失值更新初始模型。初始模型可能会包含用于执行不同数据处理操作的多个子模型或模块,其会在训练中被视为整体,进行同时更新。例如,在初始颜色验证模型训练中,可以将至少一幅样本基准图像和至少一幅验证图像输入初始颜色特征提取层,基于初始颜色关系确定层的输出结果和标签建立损失函数,基于损失函数对初始颜色验证模型中各初始层的参数进行同时更新。In some embodiments, the model acquisition module can train the initial color feature extraction layer and the initial color relationship determination layer in the initial color verification model through an end-to-end training method. The end-to-end training method means that the training samples are input into the initial model, the loss value is determined based on the output of the initial model, and the initial model is updated based on the loss value. The initial model may contain multiple sub-models or modules that perform different data processing operations, which are treated as a whole during training and updated simultaneously. For example, in the training of the initial color verification model, at least one sample reference image and at least one verification image can be input into the initial color feature extraction layer, and a loss function can be established based on the output results and labels of the initial color relationship determination layer. The parameters of each initial layer in the initial color verification model are updated simultaneously.
在一些实施例中,颜色验证模型可以由处理设备或第三方预先训练后保存在存储设备中,处理设备可以从存储设备中直接调用颜色验证模型。In some embodiments, the color verification model may be pre-trained by the processing device or a third party and stored in the storage device, and the processing device may directly call the color verification model from the storage device.
基于第一颜色关系和第二颜色关系确定多幅目标图像的真实性,可以无需识别目标图像被拍摄时光照的类型,直接通过对比颜色特征确定被拍摄时光照的类型是否一致来进行识别,这相当于把颜色识别任务转化为判断颜色是否相同的二分类任务。在一些实施例中,可以使用颜色验证模型来确定第一颜色关系。颜色验证模型的颜色关系确定模型可以只包括数量较少的神经元(例如,两个神经元)来进行颜色是否相同的判断。相比于传统方法中的颜色识别网络,本说明书中披露的颜色验证模型结构更加简单。基于颜色验证模型进行的目标对象分析所需要的计算资源(如计算空间)也相对更少,由此可以提高光照颜色的识别效率。同时,模型的输入可以是任意颜色对应的目标图像,与其他需要限定输入颜色种类数量的算法相比,本说明书实施例的适用性更高。而且,使用颜色验证模型可以提高目标图像真实性验证的可靠性,减少或者去除终端设备的性能差异的影响,进一步确定目标图像的真实性。可以理解,不同终端的硬件存在一定差异,例如,不同厂商的终端屏幕发射的相同颜色彩色光在饱和度、亮度等参数上可能会有差异,导致同一种颜色的类内差距比较大。初始颜色验证模型的训练样本可以是由不同性能的终端拍摄的。初始颜色验证模型在训练过程中通过学 习,可以使得训练后的颜色验证模型在进行目标对象颜色判断时可以考虑终端性能差异,较为准确地确定目标图像的颜色。此外,当终端未被劫持时,基准图像和验证图像都是在相同的外界环境光的条件下拍摄的。因此,基于颜色验证模型对基准图像和验证图像进行处理,确定多幅目标图像的真实性时,可以消除或减弱外界环境光的影响。To determine the authenticity of multiple target images based on the first color relationship and the second color relationship, it is possible to identify whether the type of illumination when the target image is photographed is consistent directly by comparing the color features without identifying the type of illumination when the target image was photographed. It is equivalent to converting the color recognition task into a binary classification task of judging whether the colors are the same. In some embodiments, a color verification model may be used to determine the first color relationship. The color relationship determination model of the color verification model may include only a small number of neurons (eg, two neurons) to make the judgment of whether the colors are the same. Compared with the color recognition network in the traditional method, the structure of the color verification model disclosed in this specification is simpler. The target object analysis based on the color verification model also requires relatively less computing resources (eg, computing space), thereby improving the efficiency of light color recognition. Meanwhile, the input of the model can be a target image corresponding to any color. Compared with other algorithms that need to limit the number of input color types, the embodiment of this specification has higher applicability. Moreover, using the color verification model can improve the reliability of the authenticity verification of the target image, reduce or remove the influence of the performance difference of the terminal equipment, and further determine the authenticity of the target image. It can be understood that there are certain differences in the hardware of different terminals. For example, the color light of the same color emitted by the terminal screens of different manufacturers may have differences in parameters such as saturation and brightness, resulting in a large intra-class gap of the same color. The training samples of the initial color verification model can be taken by terminals with different performances. The initial color verification model is learned in the training process, so that the trained color verification model can consider the terminal performance difference when judging the color of the target object, and more accurately determine the color of the target image. In addition, when the terminal is not hijacked, both the reference image and the verification image are taken under the same ambient light conditions. Therefore, when the reference image and the verification image are processed based on the color verification model to determine the authenticity of multiple target images, the influence of external ambient light can be eliminated or reduced.
上文已对基本概念做了描述,显然,对于本领域技术人员来说,上述详细披露仅仅作为示例,而并不构成对本说明书的限定。虽然此处并没有明确说明,本领域技术人员可能会对本说明书进行各种修改、改进和修正。该类修改、改进和修正在本说明书中被建议,所以该类修改、改进、修正仍属于本说明书示范实施例的精神和范围。The basic concepts have been described above. Obviously, for those skilled in the art, the above detailed disclosure is merely an example, and does not constitute a limitation of the present specification. Although not explicitly described herein, various modifications, improvements, and corrections to this specification may occur to those skilled in the art. Such modifications, improvements, and corrections are suggested in this specification, so such modifications, improvements, and corrections still belong to the spirit and scope of the exemplary embodiments of this specification.
同时,本说明书使用了特定词语来描述本说明书的实施例。如“一个实施例”、“一实施例”、和/或“一些实施例”意指与本说明书至少一个实施例相关的某一特征、结构或特点。因此,应强调并注意的是,本说明书中在不同位置两次或多次提及的“一实施例”或“一个实施例”或“一个替代性实施例”并不一定是指同一实施例。此外,本说明书的一个或多个实施例中的某些特征、结构或特点可以进行适当的组合。Meanwhile, the present specification uses specific words to describe the embodiments of the present specification. Such as "one embodiment," "an embodiment," and/or "some embodiments" means a certain feature, structure, or characteristic associated with at least one embodiment of this specification. Therefore, it should be emphasized and noted that two or more references to "an embodiment" or "one embodiment" or "an alternative embodiment" in various places in this specification are not necessarily referring to the same embodiment . Furthermore, certain features, structures or characteristics of the one or more embodiments of this specification may be combined as appropriate.
此外,除非权利要求中明确说明,本说明书所述处理元素和序列的顺序、数字字母的使用、或其他名称的使用,并非用于限定本说明书流程和方法的顺序。尽管上述披露中通过各种示例讨论了一些目前认为有用的发明实施例,但应当理解的是,该类细节仅起到说明的目的,附加的权利要求并不仅限于披露的实施例,相反,权利要求旨在覆盖所有符合本说明书实施例实质和范围的修正和等价组合。例如,虽然以上所描述的系统组件可以通过硬件设备实现,但是也可以只通过软件的解决方案得以实现,如在现有的服务器或移动设备上安装所描述的系统。Furthermore, unless explicitly stated in the claims, the order of processing elements and sequences described in this specification, the use of alphanumerics, or the use of other names is not intended to limit the order of the processes and methods of this specification. While the foregoing disclosure discusses by way of various examples some embodiments of the invention presently believed to be useful, it is to be understood that such details are for purposes of illustration only and that the appended claims are not limited to the disclosed embodiments, but rather The requirements are intended to cover all modifications and equivalent combinations that fall within the spirit and scope of the embodiments of this specification. For example, although the system components described above may be implemented by hardware devices, they may also be implemented by software-only solutions, such as installing the described systems on existing servers or mobile devices.
同理,应当注意的是,为了简化本说明书披露的表述,从而帮助对一个或多个发明实施例的理解,前文对本说明书实施例的描述中,有时会将多种特征归并至一个实施例、附图或对其的描述中。但是,这种披露方法并不意味着本说明书对象所需要的特征比权利要求中提及的特征多。实际上,实施例的特征要少于上述披露的单个实施例的全部特征。Similarly, it should be noted that, in order to simplify the expressions disclosed in this specification and thus help the understanding of one or more embodiments of the invention, in the foregoing description of the embodiments of this specification, various features may sometimes be combined into one embodiment, in the drawings or descriptions thereof. However, this method of disclosure does not imply that the subject matter of the description requires more features than are recited in the claims. Indeed, there are fewer features of an embodiment than all of the features of a single embodiment disclosed above.
一些实施例中使用了描述成分、属性数量的数字,应当理解的是,此类用于实施例描述的数字,在一些示例中使用了修饰词“大约”、“近似”或“大体上”来修饰。除非另外说明,“大约”、“近似”或“大体上”表明所述数字允许有±20%的变化。相应地,在一些实施例中,说明书和权利要求中使用的数值参数均为近似值,该近似值根据个别实施例所需特点可以发生改变。在一些实施例中,数值参数应考虑规定的有效数位并采用一般位数保留的方法。尽管本说明书一些实施例中用于确认其范围广度的数值域和参数为近似值,在具体实施例中,此类数值的设定在可行范围内尽可能精确。Some examples use numbers to describe quantities of ingredients and attributes, it should be understood that such numbers used to describe the examples, in some examples, use the modifiers "about", "approximately" or "substantially" to retouch. Unless stated otherwise, "about", "approximately" or "substantially" means that a variation of ±20% is allowed for the stated number. Accordingly, in some embodiments, the numerical parameters set forth in the specification and claims are approximations that can vary depending upon the desired characteristics of individual embodiments. In some embodiments, the numerical parameters should take into account the specified significant digits and use a general digit reservation method. Notwithstanding that the numerical fields and parameters used in some embodiments of this specification to confirm the breadth of their ranges are approximations, in specific embodiments such numerical values are set as precisely as practicable.
针对本说明书引用的每个专利、专利申请、专利申请公开物和其他材料,如文章、书籍、说明书、出版物、文档等,特此将其全部内容并入本说明书作为参考。与本说明书内容不一致或产生冲突的申请历史文件除外,对本说明书权利要求最广范围有限制的文件(当前或之后附加于本说明书中的)也除外。需要说明的是,如果本说明书附属材料中的描述、定义、和/或术语的使用与本说明书所述内容有不一致或冲突的地方,以本说明书的描述、定义和/或术语的使用为准。For each patent, patent application, patent application publication, and other material, such as article, book, specification, publication, document, etc., cited in this specification, the entire contents of which are hereby incorporated by reference into this specification are hereby incorporated by reference. Application history documents that are inconsistent with or conflict with the contents of this specification are excluded, as are documents (currently or hereafter appended to this specification) limiting the broadest scope of the claims of this specification. It should be noted that, if there is any inconsistency or conflict between the descriptions, definitions and/or use of terms in the accompanying materials of this specification and the contents of this specification, the descriptions, definitions and/or use of terms in this specification shall prevail .
最后,应当理解的是,本说明书中所述实施例仅用以说明本说明书实施例的原则。其他的变形也可能属于本说明书的范围。因此,作为示例而非限制,本说明书实施例的替代配置可视为与本说明书的教导一致。相应地,本说明书的实施例不仅限于本说明书明确介绍和描述的实施例。Finally, it should be understood that the embodiments described in this specification are only used to illustrate the principles of the embodiments of this specification. Other variations are also possible within the scope of this specification. Accordingly, by way of example and not limitation, alternative configurations of the embodiments of this specification may be considered consistent with the teachings of this specification. Accordingly, the embodiments of this specification are not limited to those expressly introduced and described in this specification.

Claims (20)

  1. 一种图像验证方法,所述方法包括:An image verification method, the method includes:
    指示终端设备发射至少两束彩色光线至目标;Instruct the terminal equipment to emit at least two colored light beams to the target;
    在发射所述至少两束彩色光线过程中,指示所述终端设备采集所述目标的多幅图像;In the process of emitting the at least two colored light beams, instructing the terminal device to collect multiple images of the target;
    从所述多幅图像中选择所述至少两束彩色光线分别对应的至少两幅目标图像;Selecting at least two target images respectively corresponding to the at least two colored rays from the plurality of images;
    基于所述至少两幅目标图像,确定目标验证码;以及determining a target verification code based on the at least two target images; and
    通过比较所述目标验证码与所述至少两束彩色光线对应的参考验证码,进行图像真实性验证。Image authenticity verification is performed by comparing the target verification code with the reference verification codes corresponding to the at least two beams of colored light.
  2. 根据权利要求1所述的方法,所述至少两束彩色光线包括多束彩色光线,其中至少两束彩色光线的颜色不同。The method of claim 1, the at least two colored light beams comprising a plurality of colored light beams, wherein the at least two colored light beams are of different colors.
  3. 根据权利要求1所述的方法,所述至少两束彩色光线的光线参数包括色调、饱和度和亮度,其中,所述色调随机设定,所述饱和度或所述亮度中的至少一种为变化值。The method according to claim 1, the light parameters of the at least two colored lights include hue, saturation and brightness, wherein the hue is randomly set, and at least one of the saturation or the brightness is change value.
  4. 根据权利要求1所述的方法,所述基于所述至少两幅目标图像,确定目标验证码包括:The method according to claim 1, wherein the determining of the target verification code based on the at least two target images comprises:
    以所述至少两幅目标图像中的其中一幅作为校验图像,其他作为基准图像;One of the at least two target images is used as a verification image, and the other is used as a reference image;
    对于所述基准图像中的每一幅,确定所述基准图像与所述校验图像的差异;以及For each of the reference images, determining the difference between the reference image and the verification image; and
    基于所述基准图像分别对应的差异,确定所述目标验证码。The target verification code is determined based on the differences corresponding to the reference images respectively.
  5. 根据权利要求4所述的方法,所述差异体现色调差异及饱和度差异或亮度差异中的至少一种。5. The method of claim 4, wherein the difference represents at least one of a hue difference and a saturation difference or a brightness difference.
  6. 根据权利要求4所述的方法,所述确定所述基准图像与所述校验图像的差异包括:The method of claim 4, wherein the determining the difference between the reference image and the verification image comprises:
    分别将所述基准图像和所述校验图像划分为多个图像块;以及dividing the reference image and the verification image into a plurality of image blocks, respectively; and
    基于所述多个图像块,通过比对模型确定所述基准图像与所述校验图像的所述差异。Based on the plurality of image blocks, the difference between the reference image and the verification image is determined by a comparison model.
  7. 根据权利要求1所述的方法,The method of claim 1,
    所述至少两束彩色光线分别对应至少两个颜色,所述至少两个颜色包括至少一个基准颜色和至少一个验证颜色;以及The at least two colored light beams correspond to at least two colors respectively, and the at least two colors include at least one reference color and at least one verification color; and
    所述至少两幅目标图像包括至少一幅校验图像和至少一幅基准图像,所述至少一幅基准图像的每一幅与所述至少一个基准颜色中的一个对应,所述至少一幅校验图像的每一幅与所 述至少一个验证颜色中的一个对应。The at least two target images include at least one calibration image and at least one reference image, each of the at least one reference image corresponds to one of the at least one reference color, the at least one calibration image. Each of the verification images corresponds to one of the at least one verification color.
  8. 根据权利要求7所述的方法,所述至少一个基准颜色中的一个或多个与所述至少一个验证颜色中的一个或多个相同。8. The method of claim 7, wherein one or more of the at least one reference color is the same as one or more of the at least one verification color.
  9. 根据权利要求7所述的方法,所述通过比较所述目标验证码与所述至少两束彩色光线对应的参考验证码,进行图像真实性验证包括:The method according to claim 7, wherein the performing image authenticity verification by comparing the target verification code with the reference verification codes corresponding to the at least two colored rays comprises:
    对所述至少一幅基准图像中的每一幅,基于所述基准图像和所述每幅校验图像的第一颜色关系,确定所述目标验证码;For each of the at least one reference image, determine the target verification code based on the first color relationship between the reference image and each verification image;
    对所述至少一个基准颜色中的每一个,基于所述基准颜色和每个所述验证颜色的第二颜色关系,确定所述参考验证码;以及for each of the at least one reference color, determining the reference verification code based on the reference color and a second color relationship of each of the verification colors; and
    基于所述目标验证码和所述参考验证码,进行图像真实性验证。Based on the target verification code and the reference verification code, image authenticity verification is performed.
  10. 根据权利要求9所述的方法,The method of claim 9,
    所述至少一幅基准图像中的每一幅和所述至少一幅校验图像中的每一幅组成至少一对图像对;以及each of the at least one reference image and each of the at least one verification image form at least one pair of images; and
    所述对所述至少一幅基准图像中的每一幅,确定所述基准图像和所述每幅校验图像的第一颜色关系包括:For each of the at least one reference image, determining the first color relationship between the reference image and each of the verification images includes:
    对于所述至少一对图像对中每一对,基于颜色验证模型处理所述图像对,确定所述图像对中所述基准图像和所述验证图像的第一颜色关系,所述颜色验证模型为预置参数的机器学习模型。For each of the at least one pair of image pairs, the image pair is processed based on a color verification model to determine a first color relationship between the reference image and the verification image in the image pair, and the color verification model is A machine learning model with preset parameters.
  11. 根据权利要求10所述的方法,所述颜色验证模型包括颜色特征提取层和颜色关系确定层,其中,The method according to claim 10, wherein the color verification model comprises a color feature extraction layer and a color relationship determination layer, wherein:
    所述颜色特征提取层提取所述图像对的颜色特征;以及the color feature extraction layer extracts color features of the image pair; and
    所述颜色关系确定层基于所述图像对的颜色特征,确定所述图像对中所述基准图像和所述校验图像的第一颜色关系。The color relationship determination layer determines a first color relationship between the reference image and the verification image in the image pair based on the color feature of the image pair.
  12. 根据权利要求11所述的方法,所述颜色验证模型的所述预置参数通过端到端的训练方式获得。The method according to claim 11, wherein the preset parameters of the color verification model are obtained through an end-to-end training method.
  13. 根据权利要求10所述的方法,所述颜色验证模型的所述预置参数通过训练过程生成,所述训练过程包括:The method of claim 10, wherein the preset parameters of the color verification model are generated through a training process, the training process comprising:
    获取多个训练样本,所述多个训练样本中的每一个包括样本图像对以及样本标签,所述样本标签表示所述样本图像对中的样本图像是否是在相同颜色的光照射下拍摄而成;以及Acquiring a plurality of training samples, each of the plurality of training samples includes a sample image pair and a sample label, the sample label indicating whether the sample images in the sample image pair are photographed under the illumination of the same color of light ;as well as
    基于所述多个训练样本训练初始颜色验证模型,确定所述颜色验证模型的所述预置参数。An initial color verification model is trained based on the plurality of training samples, and the preset parameters of the color verification model are determined.
  14. 根据权利要求9所述的方法,所述对所述至少一幅基准图像中的每一幅,确定所述基准图像和所述每幅验证图像的第一颜色关系包括:The method of claim 9, wherein, for each of the at least one reference image, determining the first color relationship between the reference image and each of the verification images comprises:
    提取所述基准图像的基准颜色特征和所述每一幅验证图像的验证颜色特征;以及extracting the reference color feature of the reference image and the verification color feature of each of the verification images; and
    基于所述基准颜色特征和所述验证颜色特征,确定所述基准图像和所述每一幅验证图像的第一颜色关系。Based on the reference color feature and the verification color feature, a first color relationship between the reference image and each of the verification images is determined.
  15. 一种图像验证系统,所述系统包括:An image verification system, the system includes:
    至少一个存储介质,存储计算机指令;at least one storage medium storing computer instructions;
    至少一个处理器,执行所述计算机指令,实现下述方法:At least one processor, executing the computer instructions, implements the following methods:
    指示终端设备发射至少两束彩色光线至目标;Instruct the terminal equipment to emit at least two colored light beams to the target;
    在发射所述至少两束彩色光线过程中,指示所述终端设备采集所述目标的多幅图像;In the process of emitting the at least two colored light beams, instructing the terminal device to collect multiple images of the target;
    从所述多幅图像中选择所述至少两束彩色光线分别对应的至少两幅目标图像;Selecting at least two target images respectively corresponding to the at least two colored rays from the plurality of images;
    基于所述至少两幅目标图像,确定目标验证码;以及determining a target verification code based on the at least two target images; and
    通过比较所述目标验证码与所述至少两束彩色光线对应的参考验证码,进行图像真实性验证。Image authenticity verification is performed by comparing the target verification code with the reference verification codes corresponding to the at least two beams of colored light.
  16. 根据权利要求15所述的系统,所述基于所述至少两幅目标图像,确定目标验证码包括:The system of claim 15, wherein the determining a target verification code based on the at least two target images comprises:
    以所述至少两幅目标图像中的其中一幅作为校验图像,其他作为基准图像;One of the at least two target images is used as a verification image, and the other is used as a reference image;
    对于所述基准图像中的每一幅,确定所述基准图像与所述校验图像的差异;以及For each of the reference images, determining the difference between the reference image and the verification image; and
    基于所述基准图像分别对应的差异,确定所述目标验证码。The target verification code is determined based on the differences corresponding to the reference images respectively.
  17. 根据权利要求16所述的系统,所述确定所述基准图像与所述校验图像的差异包括:The system of claim 16, the determining the difference between the reference image and the verification image comprising:
    分别将所述基准图像和所述校验图像划分为多个图像块;以及dividing the reference image and the verification image into a plurality of image blocks, respectively; and
    基于所述多个图像块,通过比对模型确定所述基准图像与所述校验图像的所述差异。Based on the plurality of image blocks, the difference between the reference image and the verification image is determined by a comparison model.
  18. 根据权利要求15所述的系统,The system of claim 15,
    所述至少两束彩色光线分别对应至少两个颜色,所述至少两个颜色包括至少一个基准颜色和至少一个验证颜色;以及The at least two colored light beams correspond to at least two colors respectively, and the at least two colors include at least one reference color and at least one verification color; and
    所述至少两幅目标图像包括至少一幅校验图像和至少一幅基准图像,所述至少一幅基准图像的每一幅与所述至少一个基准颜色中的一个对应,所述至少一幅校验图像的每一幅与所述至少一个验证颜色中的一个对应。The at least two target images include at least one calibration image and at least one reference image, each of the at least one reference image corresponds to one of the at least one reference color, the at least one calibration image. Each of the verification images corresponds to one of the at least one verification color.
  19. 根据权利要求18所述的系统,所述通过比较所述目标验证码与所述至少两束彩色光线对应的参考验证码,进行图像真实性验证包括:The system according to claim 18, the performing image authenticity verification by comparing the target verification code with the reference verification codes corresponding to the at least two colored rays of light comprises:
    对至少一幅基准图像中的每一幅,基于所述基准图像和每幅校验图像的第一颜色关系,确定所述目标验证码;For each of the at least one reference image, determine the target verification code based on the first color relationship between the reference image and each verification image;
    对所述至少一个基准颜色中的每一个,基于所述基准颜色和每个验证颜色的第二颜色关系,确定所述参考验证码;以及for each of the at least one reference color, determining the reference verification code based on the reference color and a second color relationship of each verification color; and
    基于所述目标验证码和所述参考验证码,进行图像真实性验证。Based on the target verification code and the reference verification code, image authenticity verification is performed.
  20. 一种计算机可读存储介质,所述存储介质存储计算机指令,当计算机读取所述计算机指令时,所述计算机执行下述方法:A computer-readable storage medium storing computer instructions, when a computer reads the computer instructions, the computer executes the following method:
    指示终端设备发射至少两束彩色光线至目标;Instruct the terminal equipment to emit at least two colored light beams to the target;
    在发射所述至少两束彩色光线过程中,指示所述终端设备采集所述目标的多幅图像;In the process of emitting the at least two colored light beams, instructing the terminal device to collect multiple images of the target;
    从所述多幅图像中选择所述至少两束彩色光线分别对应的至少两幅目标图像;Selecting at least two target images respectively corresponding to the at least two colored rays from the plurality of images;
    基于所述至少两幅目标图像,确定目标验证码;determining a target verification code based on the at least two target images;
    通过比较所述目标验证码与所述至少两束彩色光线对应的参考验证码,进行图像真实性验证。Image authenticity verification is performed by comparing the target verification code with the reference verification codes corresponding to the at least two beams of colored light.
PCT/CN2022/087565 2021-04-20 2022-04-19 Image verification method and system, and storage medium WO2022222904A1 (en)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN202110423967.0 2021-04-20
CN202110423967.0A CN113111810B (en) 2021-04-20 2021-04-20 Target identification method and system
CN202210246335.6A CN116824174A (en) 2022-03-14 2022-03-14 Image verification method, system, device and storage medium
CN202210246335.6 2022-03-14

Publications (1)

Publication Number Publication Date
WO2022222904A1 true WO2022222904A1 (en) 2022-10-27

Family

ID=83721963

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/087565 WO2022222904A1 (en) 2021-04-20 2022-04-19 Image verification method and system, and storage medium

Country Status (1)

Country Link
WO (1) WO2022222904A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0718808A2 (en) * 1994-12-10 1996-06-26 NCR International, Inc. Document authentication system
US20170147875A1 (en) * 2015-11-23 2017-05-25 365id AB Method and a scanner for verifying an authenticity of an identity document
CN113111810A (en) * 2021-04-20 2021-07-13 北京嘀嘀无限科技发展有限公司 Target identification method and system
CN113111806A (en) * 2021-04-20 2021-07-13 北京嘀嘀无限科技发展有限公司 Method and system for object recognition
CN113361349A (en) * 2021-05-25 2021-09-07 北京百度网讯科技有限公司 Face living body detection method and device, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0718808A2 (en) * 1994-12-10 1996-06-26 NCR International, Inc. Document authentication system
US20170147875A1 (en) * 2015-11-23 2017-05-25 365id AB Method and a scanner for verifying an authenticity of an identity document
CN113111810A (en) * 2021-04-20 2021-07-13 北京嘀嘀无限科技发展有限公司 Target identification method and system
CN113111806A (en) * 2021-04-20 2021-07-13 北京嘀嘀无限科技发展有限公司 Method and system for object recognition
CN113361349A (en) * 2021-05-25 2021-09-07 北京百度网讯科技有限公司 Face living body detection method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
George et al. Biometric face presentation attack detection with multi-channel convolutional neural network
CN109446981B (en) Face living body detection and identity authentication method and device
CN109543640B (en) Living body detection method based on image conversion
WO2022222575A1 (en) Method and system for target recognition
CN103383723B (en) Method and system for spoof detection for biometric authentication
Yan et al. Recolored image detection via a deep discriminative model
WO2019152983A2 (en) System and apparatus for face anti-spoofing via auxiliary supervision
WO2022222569A1 (en) Target discrimation method and system
US11354917B2 (en) Detection of fraudulently generated and photocopied credential documents
CN110163078A (en) The service system of biopsy method, device and application biopsy method
CN108664843B (en) Living object recognition method, living object recognition apparatus, and computer-readable storage medium
CN109086723B (en) Method, device and equipment for detecting human face based on transfer learning
CN112232323B (en) Face verification method and device, computer equipment and storage medium
WO2022222585A1 (en) Target identification method and system
CN109871845B (en) Certificate image extraction method and terminal equipment
KR102145132B1 (en) Surrogate Interview Prevention Method Using Deep Learning
CN113111810B (en) Target identification method and system
KR20230169104A (en) Personalized biometric anti-spoofing protection using machine learning and enrollment data
WO2022222904A1 (en) Image verification method and system, and storage medium
WO2022222957A1 (en) Method and system for identifying target
CN116229528A (en) Living body palm vein detection method, device, equipment and storage medium
CN114038030A (en) Image tampering identification method, device and computer storage medium
CN116824174A (en) Image verification method, system, device and storage medium
CN117456589B (en) Human face identification access control method based on AI and access control system
Suresh et al. Deep learning-based image forgery detection system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22791012

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22791012

Country of ref document: EP

Kind code of ref document: A1