Summary of the invention
In order to solve the problems, such as at least one mentioned in above-mentioned background technique, the present invention provides a kind of authentication sides
Method, device, computer equipment and storage medium.
Specific technical solution provided in an embodiment of the present invention is as follows:
In a first aspect, the present invention provides a kind of authentication method, which comprises
Receive the video for the anti-counterfeiting product that terminal uploads;
Multiple image comprising the anti-counterfeiting product is extracted from the video;
The characteristic value of default feature, and the characteristic value based on the default feature are extracted from the multiple image, are formed
Two eigenvalue clusters;
Described two eigenvalue clusters are respectively corresponded and are input in preset two regression models, video is obtained and identifies score value
With score value confidence level, wherein the video identifies that score value is set for characterizing the probability that the anti-counterfeiting product is genuine piece, the score value
Reliability is used to characterize the reliability of the video identification score value;
Judge whether the video identification score value and the score value confidence level meet the first preset threshold condition, if satisfied,
Then determine that the anti-counterfeiting product is genuine piece.
In a preferred embodiment, the multiple image extracted from the video comprising the anti-counterfeiting product,
Include:
The video is sampled, the fixed image sequence of frame number is obtained;
The anti-counterfeiting product in each frame image of described image sequence is detected, to the image for detecting the anti-counterfeiting product
It is extracted, obtains the multiple image.
In a preferred embodiment, when the anti-counterfeiting product is certificate, the default feature includes fisrt feature and the
Two features, the fisrt feature include at least one of color shifting ink, dynamic printing and characteristic block, and the second feature includes
At least one of image definition and image bloom.
In a preferred embodiment, the extraction process of the characteristic value of the color shifting ink, comprising:
First area subgraph where extracting color shifting ink in each frame image in the multiple image respectively, and from each
Color shifting ink and background are partitioned into a first area subgraph;
Color according to the color mean value of the color shifting ink in each first area subgraph and the background is equal
Value calculates the normalization color of the color shifting ink in each first area subgraph, to obtain in the multiple image
The color shifting ink normalization color matrix;
According to the normalization color matrix of the color shifting ink, the angle matrix for meeting preset condition is calculated;
According to the angle matrix, the characteristic value of the color shifting ink is obtained.
In a preferred embodiment, the extraction process of the characteristic value of the dynamic printing, comprising:
Initialize the first preset characters image, the frequency of occurrence of the second preset characters image is zero;
Extract the second area subgraph where dynamic printing respectively from each frame image in the multiple image;
The each second area subgraph extracted is preset with the first preset characters image, described second respectively
Character picture is matched, and corresponding first similarity of each second area subgraph and the second similarity are calculated;
According to corresponding first similarity of each second area subgraph and the second similarity, it is default to count described first
Frequency of occurrence in each leisure multiple image of character picture, the second preset characters image;
The first preset characters image, each leisure of the second preset characters image multiframe figure that statistics is obtained
Frequency of occurrence as in is collectively as the dynamic characteristic value printed.
In a preferred embodiment, the extraction process of the characteristic value of the characteristic block, comprising:
Third region subgraph where extracting characteristic block in each frame image in the multiple image respectively;
The each third region subgraph extracted is matched with preset characteristic block image, is calculated each described
The corresponding characteristic block similarity of third region subgraph, to obtain the corresponding characteristic block similarity vector of the multiple image;
According to the characteristic block similarity vector, the characteristic value of the characteristic block is obtained.
In a preferred embodiment, the extraction process of the characteristic value of described image clarity, comprising:
The multiple image is subjected to gray processing processing respectively;
For each frame image in the multiple image after gray processing, described image is calculated separately using Sobel operator
Gradient image on the direction x, y, and the quadratic sum of each pixel gradient on the direction x, y in described image is calculated, it makes even
Obtain the clarity of described image;
According to the clarity of each frame described image, the clarity vector of the multiple image is obtained;
According to the clarity vector, the characteristic value of described image clarity is obtained.
In a preferred embodiment, the extraction process of the characteristic value of described image bloom, comprising:
The multiple image is subjected to gray processing processing respectively;
For each frame image in the multiple image after gray processing, the intensity intermediate value of described image is calculated, and by picture
Plain intensity is more than that the pixel of highlight strength threshold value is determined as the high light pixel of described image, wherein the highlight strength threshold value is
The intensity intermediate value of described image and the product of predetermined coefficient, the predetermined coefficient are greater than 1;
Bloom ratio of the high light pixel for calculating each frame described image in each frame described image is respectively corresponded, described in acquisition
The bloom ratio vector of multiple image;
According to the bloom ratio vector, the characteristic value of described image bloom is obtained.
In a preferred embodiment, described two eigenvalue clusters include the First Eigenvalue group and Second Eigenvalue group, institute
The characteristic value based on the default feature is stated, two eigenvalue clusters are formed, comprising:
In characteristic value, the characteristic value of the dynamic printing and the characteristic value of the characteristic block based on the color shifting ink
At least one, and the characteristic value of described image bloom is combined, form the First Eigenvalue group, wherein the First Eigenvalue
Group is for calculating the video identification score value;
At least one of characteristic value and the characteristic value of described image bloom based on described image clarity, and combine institute
The characteristic value for stating characteristic block forms the Second Eigenvalue group, wherein the Second Eigenvalue group is set for calculating the score value
Reliability.
In a preferred embodiment, the respective feature weight parameter of described two regression models is to preset or in advance
First obtained using the method training of machine learning.
In a preferred embodiment, the respective regression function of described two regression models is returned using linear regression, logic
Return, tree-model or neural network.
In a preferred embodiment, the training includes:
Obtain the multiple Sample videos marked, wherein comprising true anti-counterfeiting product in the multiple Sample video
The video of video and the anti-counterfeiting product of imitation;
For each of the multiple Sample video Sample video, sample characteristics are extracted from the Sample video
Characteristic value forms two sample characteristics groups based on the characteristic value of the sample characteristics;
Described two sample characteristics groups are respectively corresponded to be input in described two regression models and are trained, institute is obtained
State the respective feature weight parameter of two regression models.
In a preferred embodiment, the method also includes:
If the video identification score value and the score value confidence level meet the second preset threshold condition, it is determined that described anti-fake
Product is adulterant;
If the video identification score value and the score value confidence level meet third predetermined threshold value condition, the video is sent out
It is sent to default terminal, so that the video goes to the manual examination and verification stage;
If the video identification score value and the score value confidence level meet the 4th preset threshold condition, will with predetermined probabilities
The video is sent to the default terminal, so that the video goes to the manual examination and verification stage, otherwise sends prompt information to institute
Terminal is stated, to prompt the terminal to resurvey the video of the anti-counterfeiting product.
In a preferred embodiment, the method also includes:
The qualification result by manual examination and verification that the default terminal returns is obtained, and institute is optimized based on the qualification result
State the respective feature weight parameter of two regression models.
Second aspect, provides a kind of authentication device, and described device includes:
Receiving module, the video of the anti-counterfeiting product for receiving terminal upload;
Abstraction module, for extracting multiple image comprising the anti-counterfeiting product from the video;
Extraction module, for extracting the characteristic value of default feature from the multiple image;
Grouping module forms two eigenvalue clusters for the characteristic value based on the default feature;
Prediction module is input in preset two regression models for respectively corresponding described two eigenvalue clusters, obtains
Obtain video identification score value and score value confidence level, wherein the video identifies score value for characterizing the anti-counterfeiting product as genuine piece
Probability, the score value confidence level are used to characterize the reliability of the video identification score value;
Module is identified, for judging whether the video identification score value and the score value confidence level meet the first preset threshold
Condition, if satisfied, then determining that the anti-counterfeiting product is genuine piece.
The third aspect provides a kind of computer equipment, comprising:
One or more processors;
Storage device, for storing one or more programs;
When one or more of programs are executed by one or more of processors, so that one or more of processing
Device realizes the method as described in first aspect is any.
Fourth aspect provides a kind of computer readable storage medium, is stored thereon with computer program, described program quilt
The method as described in first aspect is any is realized when processor executes.
The embodiment of the invention provides a kind of authentication method, apparatus, computer equipment and storage mediums, pass through reception
The video for the anti-counterfeiting product that terminal uploads extracts multiple image comprising anti-counterfeiting product, later from multiple image from video
The middle characteristic value for extracting default feature, and the characteristic value based on default feature, form two eigenvalue clusters, by two eigenvalue clusters
It respectively corresponds and is input in preset two regression models, obtain video identification score value and score value confidence level, wherein video identification
Score value is used to characterize the probability that anti-counterfeiting product is genuine piece, and score value confidence level is used to characterize the reliability of video identification score value, and
It identifies that score value and score value confidence level meet the first preset threshold condition in video, determines that anti-counterfeiting product is genuine piece.The present invention provides
Technical solution without using complicated evaluation apparatus, only need user by the simple interaction between terminal and server,
It realizes and authenticity is carried out to anti-counterfeiting products such as certificate, bank note, and authentication is accurate, reliable;In addition, skill provided by the invention
Art scheme scalability is strong, can adapt to the anti-fake demand under several scenes.
Specific embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with attached in the embodiment of the present invention
Figure, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is only this
Invention a part of the embodiment, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art exist
Every other embodiment obtained under the premise of creative work is not made, shall fall within the protection scope of the present invention.
It should be noted that in the description of the present invention, term " first ", " second " etc. are used for description purposes only, without
It can be interpreted as indication or suggestion relative importance.In addition, in the description of the present invention, unless otherwise indicated, the meaning of " multiple "
It is two or more.
Fig. 1 is the application environment schematic diagram of authentication method provided in an embodiment of the present invention.As shown in Figure 1, first is whole
End 102 and second terminal 106 are communicated by network with server 104 respectively.Wherein, first terminal 102 is for will be anti-fake
On the video of product is uploaded onto the server, server is used to receive the video of the upload of first terminal 102, and carries out feature to video
The authenticity to realize anti-counterfeiting product is extracted, second terminal 106 is used for the true and false in the fubaritic anti-counterfeiting product of server 104
When, manual examination and verification are carried out to the anti-counterfeiting product in video, and manual examination and verification result is returned into server 104.Wherein, first eventually
End 102 can be the electronic equipment with built-in video acquisition module or external video acquisition module, which can
With but be not limited to various personal computers, laptop, smart phone and tablet computer, second terminal 106 can with but not
It is limited to be various personal computers, laptop, smart phone and tablet computer, server 104 can use independent service
The server cluster of device either multiple servers composition is realized.
It should be noted that authentication method provided by the invention, can be applied to except identity card, identity card
Anti-fake certificate, banknote, credit card, bank securities and antifalsification label carry out authenticity, for example when opening underwriting account, insurance is public
Department need user provide ID card information and verify user identity card it is whether true, for another example network payment when, need consumer
Whether offer credit card information and check credit card are true, etc., and the embodiment of the present invention is not construed as limiting concrete application scene.
Identification method provided in an embodiment of the present invention is said for being demonstrate,proved using 2003 editions Hong Kong identities as anti-counterfeiting product
It is bright.
In one embodiment, as shown in Fig. 2, providing a kind of authentication method, this method comprises:
Step 201, the video for the anti-counterfeiting product that terminal uploads is received.
Specifically, the video for the anti-counterfeiting product that server receiving terminal uploads.
Illustratively, user carries out opening account in the client of terminal (i.e. first terminal in Fig. 1) and (for example insures
Account) operation when, client inform user need captured identity demonstrate,prove video, and by the video-capture operations of identity card illustrate with text
The form of word or video example is supplied to user, so that user illustrates that carrying out video to identity card adopts according to video-capture operations
Collect, after the completion of video acquisition, the video of identity card is sent to server by client.
In the present embodiment, in order to enable the video of anti-counterfeiting product can dynamic change, so as to accurately be mentioned from video
Take out anti-counterfeiting product anti-counterfeiting characteristic, video-capture operations illustrate in may include the rotation direction for being used to indicate anti-counterfeiting product
And/or the require information of rotational angle.For example, during user carries out video capture to identity card using mobile phone, it is desirable that use
Family is first rotated up identity card, rotates (or first turning left, then turn right) still further below, during being somebody's turn to do, does not need
User's close alignment certificate position does not need harsh background or environment light requirement yet.
Step 202, multiple image comprising anti-counterfeiting product is extracted from video.
Specifically, server can include anti-fake system to what is detected by detecting to the anti-counterfeiting product in video
The image of product is extracted.Wherein, detection method includes but is not limited to the method based on deep learning, the side based on edge detection
Method etc..
It should be noted that authentication method can carry out authenticity to the anti-counterfeiting product under concrete application scene,
Such as identity card, when can be applicable to the authenticity of the anti-counterfeiting product under different application scene, such as identity card, credit card
Deng.
If when the authenticity for the anti-counterfeiting product being suitable under different application scene, server includes anti-fake system extracting
After a variety of images of product, server may recognize that the classification of anti-counterfeiting product to be identified, that is, identify that the anti-counterfeiting product is
Identity card, credit card, bank note or other classifications anti-counterfeiting product, then extracted from multiple image it is corresponding identify it is anti-fake
The default feature of product.Wherein, server can carry out the identification of anti-counterfeiting product classification, including base using preset recognition methods
In deep learning or the method for traditional characteristic, wherein the method based on deep learning includes directly training using original image as input
Convolutional neural networks (CNN) extract characteristics of image (such as SIFT) in region to image classification, then use classifier (such as SVM)
To image classification.
Step 203, the characteristic value of default feature, and the characteristic value based on default feature are extracted from multiple image, are formed
Two eigenvalue clusters.
In the present embodiment, the default self-characteristic for being characterized in anti-counterfeiting characteristic and anti-counterfeiting product previously according to anti-counterfeiting product
And feature that is determining and being extracted by the method for video acquisition.Different classes of anti-counterfeiting product can correspond to phase
With or different default features, (such as 2003 editions Hong Kong identities cards) corresponding default feature may include but not for example, identity card
It is limited to color shifting ink, dynamic printing, characteristic block, image definition and image bloom.The corresponding default feature (such as 2015 editions of bank note
RMB) it can include but is not limited to portrait watermark, vertical and horizontal even numbers code, image definition and image bloom.Wherein, anti-counterfeiting product
Corresponding relationship between default feature is prestored on server.
Wherein, color shifting ink refers to that anti-counterfeiting product chromic ink colors under different angle change.Innervation is printed
Refer to that the anti-fake character printed on anti-counterfeiting product is shown as a letter under certain angles, is shown as another word under certain angles
Mother, for example, the anti-fake character on 2003 editions Hong Kong identity cards is shown as H in certain angles, certain angles are shown as K.Characteristic block
Refer to the chip block in anti-counterfeiting product.Image definition refers to whether edge of every frame image comprising anti-counterfeiting product etc. is clear;
Image bloom refers to that image influences the identification of anti-counterfeiting product with the presence or absence of strong bloom.Illustrate so that 2003 editions Hong Kong identities are demonstrate,proved as an example
Above-mentioned default feature, as shown in figure 3, Fig. 3 is the schematic diagram of the default feature of certificate video provided in an embodiment of the present invention, arrow
Default feature pointed by head a, b, c, d, e is that color shifting ink, dynamic printing, characteristic block, image definition and image are high respectively
Light.
Specifically, server can determine anti-counterfeiting product pair according to the corresponding relationship between anti-counterfeiting product and default feature
The default feature answered extracts the characteristic value of default feature from the multiple image comprising anti-counterfeiting product.For example, if anti-counterfeiting product is
Identity card, the characteristic value for the default feature that server extracts are as follows: the characteristic value of color shifting ink, the characteristic value of dynamic printing, spy
Levy characteristic value, the characteristic value of the characteristic value of image definition and image bloom of block.
The characteristic value for the default feature extracted is carried out being divided into two groups by server according to default packet mode, obtains two
Eigenvalue cluster.Wherein, the characteristic value for the default feature that each eigenvalue cluster includes can be one or more.For example, a feature
Value group includes the characteristic value of color shifting ink and the characteristic value of dynamic printing, for calculating video identification score value;Another characteristic value
The characteristic value of the group characteristic value comprising image definition and image bloom, for calculating the score value confidence level of video identification score value,
The specific packet mode of the embodiment of the present invention is not construed as limiting.
Step 204, two eigenvalue clusters are respectively corresponded and is input in preset two regression models, obtain video identification
Score value and score value confidence level, wherein video identifies that score value is used for for characterizing the probability that anti-counterfeiting product is genuine piece, score value confidence level
Characterize the reliability of video identification score value.
Specifically, server is according to the respective feature weight parameter of two regression models and regression function, to two features
Characteristic value in value group is weighted respectively, obtains video identification score value and score value confidence level.That is, two eigenvalue clusters
x1,x2It corresponds to and is input to two regression model f (), in g (), export and identify score value y=f (x for video1,w1) and score value set
Reliability z=g (x2,w2)。
Wherein, the respective feature weight parameter of two regression models can be preset, that is, be directed to each feature
All features in value group successively set the corresponding weight of each feature previously according to the importance degree of different characteristic, and two
What the respective feature weight parameter of regression model can also obtain for the preparatory method training using machine learning.Wherein, two
The respective regression function of regression model can use linear regression, logistic regression, tree-model or neural network.
Step 205, judge whether video identification score value and score value confidence level meet the first preset threshold condition, if satisfied,
Then determine that anti-counterfeiting product is genuine piece.
Wherein, different threshold conditions is preset for identifying the true and false of anti-counterfeiting product.First preset threshold condition
It can be set as when video identification score value is greater than first threshold, and score value confidence level is greater than second threshold, anti-counterfeiting product is true
Product.First threshold, second threshold can be set according to actual needs, for example, setting first threshold is 0.7, the second threshold is arranged
Value is 0.5.
Authentication method provided in an embodiment of the present invention, by receiving the video for the anti-counterfeiting product that terminal uploads, from view
Multiple image comprising anti-counterfeiting product is extracted in frequency, extracts the characteristic value of default feature from multiple image later, and is based on
The characteristic value of default feature, forms two eigenvalue clusters, and two eigenvalue clusters are respectively corresponded and are input to preset two recurrence
In model, video identification score value and score value confidence level are obtained, wherein video identifies score value for characterizing anti-counterfeiting product as genuine piece
Probability, score value confidence level is used to characterize the reliability of video identification score value, and identifies that score value and score value confidence level are full in video
The first preset threshold condition of foot determines that anti-counterfeiting product is genuine piece.Technical solution provided by the invention is without using complicated identification
Equipment only needs user by the simple interaction between terminal and server, can realize and carry out to anti-counterfeiting products such as certificate, bank note
Authenticity, and authentication is accurate, reliable;In addition, technical solution scalability provided by the invention is strong, can adapt to a variety of
Anti-fake demand under scene.
It is above-mentioned in one of the embodiments, that the step of including the multiple image of anti-counterfeiting product is extracted from video,
The process may include:
Video is sampled, the fixed image sequence of frame number is obtained, it is anti-fake in each frame image of detection image sequence
Product extracts the image for detecting anti-counterfeiting product, obtains multiple image.
Uniform sampling can be used in above-mentioned video sampling method, obtains the fixed image sequence of frame number.For example, using equal
Even sampling goes out M=60 frame to video extraction, forms image sequence.It is understood that video sampling can also use existing skill
Other methods in art, such as key-frame extraction, the present invention is not especially limit this.
Above-mentioned detection method can use Scale invariant features transform (Scale-invariant feature
Transform, SIFT) realize the detection of anti-counterfeiting product in every frame image.It is understood that the detection of anti-counterfeiting product can be with
Using other methods in the prior art, such as based on the method for deep learning, the method etc. based on edge detection, the present invention is implemented
Example is not especially limited this.
Optionally, for convenient for it is subsequent it is more acurrate, the feature of default feature is quickly extracted from the image comprising anti-counterfeiting product
Value, to detecting that the image of anti-counterfeiting product extracts, after obtaining multiple image step, method can also include:
Processing of becoming a full member is carried out to the anti-counterfeiting product in each frame image being drawn into, the multiframe of the anti-counterfeiting product after being become a full member
Image.Wherein, Scale invariant features transform can be used in processing of becoming a full member.Further, it is also possible to using its other party in the prior art
Method, the method such as based on deep learning carry out anti-counterfeiting product and become a full member.As shown in Fig. 4 a, Fig. 4 b, Fig. 4 a mentions for the embodiment of the present invention
The schematic diagram of a certain frame certificate image supplied, Fig. 4 b are the result signal that certificate provided in an embodiment of the present invention detects and becomes a full member
Figure, by being detected to a certain frame certificate image shown in Fig. 4 a and processing of becoming a full member, available result as shown in Figure 4 b.
When anti-counterfeiting product is certificate in one of the embodiments, default feature includes fisrt feature and second feature, the
One feature includes at least one of color shifting ink, dynamic printing and characteristic block, and second feature includes image definition and image
At least one of bloom.In order to more accurately carry out authenticity, such as identity card authenticity, Ke Yicong to anti-counterfeiting product
Color shifting ink, dynamic printing, characteristic block, image definition and each spy of image bloom are extracted in a variety of images comprising identity card
The characteristic value of sign.
The extraction process of the characteristic value of above-mentioned color shifting ink in one of the embodiments, may include:
First area subgraph where extracting color shifting ink in each frame image in multiple image respectively, and from each
Color shifting ink and background are partitioned into one region subgraph;According to the color mean value of the color shifting ink in each first area subgraph and
The color mean value of background calculates the normalization color of the color shifting ink in each first area subgraph, to obtain in multiple image
Color shifting ink normalization color matrix;According to the normalization color matrix of color shifting ink, the folder for meeting preset condition is calculated
Angular moment battle array;According to angle matrix, the characteristic value of color shifting ink is obtained.
Specifically, to each frame image k, extract color shifting ink region subgraph and mark off color shifting ink part and
Background parts.Wherein it is possible to be partitioned into from each first area subgraph using the dividing method based on threshold value color shifting ink and
Background can additionally use other methods in the prior art, such as dividing method based on region, the segmentation side based on edge
Method etc..As shown in figure 5, Fig. 5 is the schematic diagram in color shifting ink region and background area provided in an embodiment of the present invention, in Fig. 5 institute
It is color shifting ink region pointed by arrow F in the color shifting ink region subgraph shown, is background area pointed by arrow B
Domain.
In the present embodiment, for the first area subgraph in each frame image k, the color of color shifting ink part is calculated first
Mean valueWith the color mean value of background partsCalculate normalization colorObtain the normalization color matrix of all image discoloration ink portionsAccording to the normalization color matrix of color shifting ink, the angle matrix A for meeting preset condition is calculated,
Middle angle matrix A, the i-th row jth column element meetBy in angle matrix A most
Mitre amaxCharacteristic value of=the max (A) as color shifting ink.
The extraction process of the characteristic value of above-mentioned dynamic printing in one of the embodiments, may include:
Initialize the first preset characters image, the frequency of occurrence of the second preset characters image is zero;From multiple image
In each frame image in extract second area subgraph where dynamic printing respectively;By each second area subgraph extracted point
It is not matched with the first preset characters image, the second preset characters image, calculates each second area subgraph corresponding first
Similarity and the second similarity;According to corresponding first similarity of each second area subgraph and the second similarity, statistics first
Frequency of occurrence in each comfortable multiple image of preset characters image, the second preset characters image;First that statistics is obtained is preset
The characteristic value that frequency of occurrence in each comfortable multiple image of character picture, the second preset characters image is printed collectively as innervation.
Wherein, the first preset characters image, the second preset characters image are an anti-fake characters on anti-counterfeiting product not
With the image shown respectively under angle.
Illustratively, the characteristic value for extracting color shifting ink is illustrated so that 2003 editions Hong Kong identities are demonstrate,proved as an example, left side letter exists
It is shown as H under certain angles, is shown as K under certain angles.Initialize letter H, K frequency of occurrence CK=0, CH=0, to each frame
Image k extracts subgraph where dynamic printing part, and by itself and alphabetical H, K subgraph match made in advance, calculates separately
Similarity (the V of H and K outK,VH), work as VK≥0.8VHAnd VKThink to capture primary letter K, i.e. C when >=0.7KAdd 1, similarly,
Work as VH≥0.8VKAnd VHC when >=0.7HAdd 1.By (CK,CH) as the dynamic characteristic value printed.
The extraction process of the characteristic value of above-mentioned characteristic block in one of the embodiments, may include:
Third region subgraph where extracting characteristic block in each frame image in multiple image respectively;It is each by what is extracted
A third region subgraph is matched with preset characteristic block image, and it is similar to calculate the corresponding characteristic block of each third region subgraph
Degree, to obtain the corresponding characteristic block similarity vector of multiple image;According to characteristic block similarity vector, the feature of characteristic block is obtained
Value.
Specifically, to each frame image k, extract subgraph where characteristic block part, and with the characteristic block made in advance
Subgraph is matched, and similarity s is calculatedk, obtain the characteristic block similarity vector s=(s of all images1,s2,...,
sk,...)T, it is maximized smax=max (s) is used as feature block feature.
The extraction process of the characteristic value of above-mentioned image definition in one of the embodiments, may include:
Multiple image is subjected to gray processing processing respectively;For each frame image in the multiple image after gray processing, utilize
Sobel operator calculates separately gradient image of the image on the direction x, y, and calculates each pixel in image on the direction x, y
The quadratic sum of gradient is averaged to obtain the clarity of image;According to the clarity of each frame image, the clarity of multiple image is obtained
Vector;According to clarity vector, the characteristic value of image definition is obtained.
Specifically, to each frame image k, grayscale image is first converted, calculates separately it along x, the side y using Sobel operator
Upward gradient image, and the quadratic sum of gradient on the direction x, y of each pixel is calculated, it is averaged to obtain clarity dk, obtain
The clarity vector d=(d of all images1,d2,...,dk,...)T, take most intermediate value dmed=median (d) is used as image clearly
The characteristic value of degree.
The extraction process of the characteristic value of above-mentioned image bloom in one of the embodiments, may include:
Multiple image is subjected to gray processing processing respectively;For each frame image in the multiple image after gray processing, calculate
The intensity intermediate value of image, and the pixel that image pixel intensities are more than highlight strength threshold value is determined as the high light pixel of image, wherein it is high
Intensity threshold is the intensity intermediate value of image and the product of predetermined coefficient, and predetermined coefficient is greater than 1;It respectively corresponds and calculates each frame image
Bloom ratio of the high light pixel in each frame image, obtain the bloom ratio vector of multiple image;According to bloom ratio vector,
Obtain the characteristic value of image bloom.
Specifically, to each frame image k, grayscale image is first converted, calculates its intensity intermediate value omed, define image intensity o
Meet o > η omedWhen be highlight, take η=1.4 in the present embodiment, calculate ratio h of the highlight pixel in entire videok,
Obtain the bloom ratio vector h=(h of all images1,h2,...,hk,...)T, take intermediate value hmed=median (h) is used as image
The characteristic value of bloom.
Two eigenvalue clusters include the First Eigenvalue group and Second Eigenvalue group in one of the embodiments, above-mentioned
Based on the characteristic value of default feature, the step of forming two eigenvalue clusters, may include:
At least one of characteristic value and the characteristic value of characteristic block of characteristic value, dynamic printing based on color shifting ink, and
In conjunction with the characteristic value of image bloom, the First Eigenvalue group is formed, wherein the First Eigenvalue group is for calculating video identification score value;
At least one of characteristic value and the characteristic value of image bloom based on image definition, and the characteristic value of binding characteristic block, shape
At Second Eigenvalue group, wherein Second Eigenvalue group is for calculating score value confidence level.
In the present embodiment, in order to more accurately carry out authenticity, such as identity card authenticity to anti-counterfeiting product, choose
Color shifting ink, dynamic printing, four features of feature Block- matching and highlight detection characteristic value, totally 5 dimensional features are used to identify score value
Spy, i.e. the First Eigenvalue group x1=(amax,CK,CH,smax,hmed)T, selected characteristic Block- matching, image definition and highlight detection
The characteristic value of three features, totally 3 dimensional features are used to calculate score value confidence level, i.e. Second Eigenvalue group x2=(smax,dmed,hmed)T。
Above-mentioned training process in one of the embodiments, may include:
Obtain the multiple Sample videos marked, wherein include the video of true anti-counterfeiting product in multiple Sample videos
Sample is extracted from Sample video for each of multiple Sample videos Sample video with the video of the anti-counterfeiting product of imitation
The characteristic value of eigen, the characteristic value based on sample characteristics form two sample characteristics groups;By two sample characteristics components
It Dui Ying not be input in two regression models and be trained, obtain the respective feature weight parameter of two regression models.
Wherein, two regression models include identification score value model and score value confidence level model.
Illustratively, acquire N=30 certificate video, including real docu-ment and imitation certificate (such as to the printing of certificate or
Reproduction), acquisition condition be high quality and low quality, wherein high-quality video acquire when image clearly and bloom it is less, low-quality
It is obscured when measuring video acquisition or often there is a wide range of bloom to occur.0 is assigned to low quality video score value confidence level, is not used to train mirror
Determine score value model;High-quality video score value confidence level assigns 1, and real docu-ment identifies that score value assigns 1, copys certificate identification score value and assigns 0.It is right
This N number of video extraction feature, training identification score value model and score value confidence level model, obtain initial parameter w.
Method in one of the embodiments, further include:
If video identifies that score value and score value confidence level meet the second preset threshold condition, it is determined that anti-counterfeiting product is adulterant,
If video identification score value and score value confidence level meet third predetermined threshold value condition, default terminal is sent the video to, so that view
Frequency goes to the manual examination and verification stage, if video identification score value and score value confidence level meet the 4th preset threshold condition, with default general
Rate sends the video to default terminal, so that video goes to the manual examination and verification stage, otherwise sends prompt information to terminal, with prompt
Terminal resurveys the video of anti-counterfeiting product.
Wherein, the second preset threshold condition can be set as being less than third threshold value, and score value confidence when video identification score value
When degree is greater than second threshold, anti-counterfeiting product is adulterant.Third threshold value can be set according to actual needs, for example, setting third
Threshold value is 0.4.
Wherein, third predetermined threshold value condition can be set as when video identification score value between third threshold value and first threshold it
Between, and score value confidence level be greater than second threshold when, be unable to judge accurately the true and false of anti-counterfeiting product at this time, can send the video to
Default terminal, so that video goes to the manual examination and verification stage.
Wherein, when the 4th preset threshold condition can be set as score value confidence level less than second threshold, with the general of P=0.1
Rate sends the video to default terminal, so that video goes to the manual examination and verification stage, otherwise sends prompt information to terminal and carries out weight
New acquisition video.
Method in one of the embodiments, further include:
The qualification result by manual examination and verification that default terminal returns is obtained, and two recurrence moulds are optimized based on qualification result
The respective feature weight parameter of type.
It, can be according to the new weight of the label computation model manually marked more when entering manual examination and verification in the present embodiment
New Δ w, obtains new Model Weight wnew=w- λ Δ w, takes λ=0.001 as preferred this example.When do not need enter manual examination and verification
When, directly waiting new video uploads.
In one embodiment, as shown in fig. 6, providing a kind of authentication device, device includes:
Receiving module 61, the video of the anti-counterfeiting product for receiving terminal upload;
Abstraction module 62, for extracting multiple image comprising anti-counterfeiting product from video;
Extraction module 63, for extracting the characteristic value of default feature from multiple image;
Grouping module 64 forms two eigenvalue clusters for the characteristic value based on default feature;
Prediction module 65 is input in preset two regression models for respectively corresponding two eigenvalue clusters, is obtained
Video identifies score value and score value confidence level, wherein video identifies that score value is set for characterizing the probability that anti-counterfeiting product is genuine piece, score value
Reliability is used to characterize the reliability of video identification score value;
Identify module 66, for judging whether video identification score value and score value confidence level meet the first preset threshold condition,
If satisfied, then determining that anti-counterfeiting product is genuine piece.
In a preferred embodiment, abstraction module 62 is specifically used for:
Video is sampled, the fixed image sequence of frame number is obtained;
Anti-counterfeiting product in each frame image of detection image sequence, extracts the image for detecting anti-counterfeiting product, obtains
To multiple image.
In a preferred embodiment, when anti-counterfeiting product is certificate, default feature includes fisrt feature and second feature, the
One feature includes at least one of color shifting ink, dynamic printing and characteristic block, and second feature includes image definition and image
At least one of bloom.
In a preferred embodiment, extraction module 63 is specifically used for:
First area subgraph where extracting color shifting ink in each frame image in multiple image respectively, and from each
Color shifting ink and background are partitioned into one region subgraph;
According to the color mean value of the color mean value of the color shifting ink in each first area subgraph and background, each the is calculated
The normalization color of color shifting ink in one region subgraph, to obtain the normalization color moment of the color shifting ink in multiple image
Battle array;
According to the normalization color matrix of color shifting ink, the angle matrix for meeting preset condition is calculated;
According to angle matrix, the characteristic value of color shifting ink is obtained.
In a preferred embodiment, extraction module 63 is specifically used for:
Initialize the first preset characters image, the frequency of occurrence of the second preset characters image is zero;
Extract the second area subgraph where dynamic printing respectively from each frame image in multiple image;
The each second area subgraph extracted is carried out with the first preset characters image, the second preset characters image respectively
Matching, calculates corresponding first similarity of each second area subgraph and the second similarity;
According to corresponding first similarity of each second area subgraph and the second similarity, the first preset characters figure is counted
Frequency of occurrence in each comfortable multiple image of picture, the second preset characters image;
Go out occurrence in each comfortable multiple image of the first preset characters image, the second preset characters image that statistics is obtained
Characteristic value of the number collectively as innervation printing.
In a preferred embodiment, extraction module 63 is specifically used for:
Third region subgraph where extracting characteristic block in each frame image in multiple image respectively;
The each third region subgraph extracted is matched with preset characteristic block image, calculates each third region
The corresponding characteristic block similarity of subgraph, to obtain the corresponding characteristic block similarity vector of multiple image;
According to characteristic block similarity vector, the characteristic value of characteristic block is obtained.
In a preferred embodiment, extraction module 63 is specifically used for:
Multiple image is subjected to gray processing processing respectively;
For each frame image in the multiple image after gray processing, image is calculated separately along the direction x, y using Sobel operator
On gradient image, and calculate the quadratic sum of each pixel gradient on the direction x, y in image, be averaged to obtain the clear of image
Clear degree;
According to the clarity of each frame image, the clarity vector of multiple image is obtained;
According to clarity vector, the characteristic value of image definition is obtained.
In a preferred embodiment, extraction module 63 is specifically used for:
Multiple image is subjected to gray processing processing respectively;
For each frame image in the multiple image after gray processing, the intensity intermediate value of image is calculated, and image pixel intensities are surpassed
The pixel of excessively high intensity threshold is determined as the high light pixel of image, wherein highlight strength threshold value be image intensity intermediate value with
The product of predetermined coefficient, predetermined coefficient are greater than 1;
Bloom ratio of the high light pixel for calculating each frame image in each frame image is respectively corresponded, the height of multiple image is obtained
Light ratio vector;
According to bloom ratio vector, the characteristic value of image bloom is obtained.
In a preferred embodiment, two eigenvalue clusters include the First Eigenvalue group and Second Eigenvalue group, are grouped mould
Block 64 is specifically used for:
At least one of characteristic value and the characteristic value of characteristic block of characteristic value, dynamic printing based on color shifting ink, and
In conjunction with the characteristic value of image bloom, the First Eigenvalue group is formed, wherein the First Eigenvalue group is for calculating video identification score value;
At least one of characteristic value and the characteristic value of image bloom based on image definition, and the spy of binding characteristic block
Value indicative forms Second Eigenvalue group, wherein Second Eigenvalue group is for calculating score value confidence level.
In a preferred embodiment, the respective feature weight parameter of two regression models is to preset or make in advance
It is obtained with the method training of machine learning.
In a preferred embodiment, two respective regression functions of regression model use linear regression, logistic regression, tree
Model or neural network.
In a preferred embodiment, device further includes training module 67, and training module 67 is specifically used for:
Obtain the multiple Sample videos marked, wherein include the video of true anti-counterfeiting product in multiple Sample videos
With the video of the anti-counterfeiting product of imitation;
For each of multiple Sample videos Sample video, the characteristic value of sample characteristics is extracted from Sample video,
Characteristic value based on sample characteristics forms two sample characteristics groups;
Two sample characteristics groups are respectively corresponded to be input in two regression models and are trained, two recurrence moulds are obtained
The respective feature weight parameter of type.
In a preferred embodiment, identification module 66 is specifically also used to:
If video identifies that score value and score value confidence level meet the second preset threshold condition, it is determined that anti-counterfeiting product is adulterant;
Device further includes sending module 68, and sending module 68 is specifically used for:
If video identification score value and score value confidence level meet third predetermined threshold value condition, send the video to default whole
End, so that video goes to the manual examination and verification stage;
If video identifies that score value and score value confidence level meet the 4th preset threshold condition, video is sent with predetermined probabilities
To default terminal, so that video goes to the manual examination and verification stage, prompt information is otherwise sent to terminal, is resurveyed with prompt terminal
The video of anti-counterfeiting product.
In a preferred embodiment, device further includes optimization module 69, and optimization module 69 is specifically used for:
The qualification result by manual examination and verification that default terminal returns is obtained, and two recurrence moulds are optimized based on qualification result
The respective feature weight parameter of type.
Authentication device provided in this embodiment belongs to same with authentication method provided by the embodiment of the present invention
Authentication method provided by the embodiment of the present invention can be performed in inventive concept, has and executes the corresponding function of authentication method
It can module and beneficial effect.The not technical detail of detailed description in the present embodiment, reference can be made to provided in an embodiment of the present invention anti-
Pseudo- identification method, is not repeated here herein.
In addition, the embodiment of the present invention also provides a kind of computer equipment, which includes:
One or more processor;
Memory;
Program stored in memory, when being executed by one or more processor, program executes processor
The step of stating the authentication method of embodiment.
Another embodiment of the present invention also provides a kind of computer readable storage medium, and computer-readable recording medium storage has
Program, when program is executed by processor, so that the step of processor executes the authentication method of above-described embodiment.
It should be understood by those skilled in the art that, the embodiment in the embodiment of the present invention can provide as method, system or meter
Calculation machine program product.Therefore, complete hardware embodiment, complete software embodiment can be used in the embodiment of the present invention or combine soft
The form of the embodiment of part and hardware aspect.Moreover, being can be used in the embodiment of the present invention in one or more wherein includes meter
Computer-usable storage medium (including but not limited to magnetic disk storage, CD-ROM, the optical memory of calculation machine usable program code
Deng) on the form of computer program product implemented.
It is referring to the method for middle embodiment, equipment (system) according to embodiments of the present invention and to calculate in the embodiment of the present invention
The flowchart and/or the block diagram of machine program product describes.It should be understood that can be realized by computer program instructions flow chart and/or
The combination of the process and/or box in each flow and/or block and flowchart and/or the block diagram in block diagram.It can mention
For the processing of these computer program instructions to general purpose computer, special purpose computer, Embedded Processor or other programmable datas
The processor of equipment is to generate a machine, so that being executed by computer or the processor of other programmable data processing devices
Instruction generation refer to for realizing in one or more flows of the flowchart and/or one or more blocks of the block diagram
The device of fixed function.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates,
Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or
The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting
Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or
The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one
The step of function of being specified in a box or multiple boxes.
Although the preferred embodiment in the embodiment of the present invention has been described, once a person skilled in the art knows
Basic creative concept, then additional changes and modifications may be made to these embodiments.So appended claims are intended to explain
Being includes preferred embodiment and all change and modification for falling into range in the embodiment of the present invention.
Obviously, various changes and modifications can be made to the invention without departing from essence of the invention by those skilled in the art
Mind and range.In this way, if these modifications and changes of the present invention belongs to the range of the claims in the present invention and its equivalent technologies
Within, then the present invention is also intended to include these modifications and variations.