WO2019200702A1 - 去网纹系统训练方法、去网纹方法、装置、设备及介质 - Google Patents

去网纹系统训练方法、去网纹方法、装置、设备及介质 Download PDF

Info

Publication number
WO2019200702A1
WO2019200702A1 PCT/CN2018/092569 CN2018092569W WO2019200702A1 WO 2019200702 A1 WO2019200702 A1 WO 2019200702A1 CN 2018092569 W CN2018092569 W CN 2018092569W WO 2019200702 A1 WO2019200702 A1 WO 2019200702A1
Authority
WO
WIPO (PCT)
Prior art keywords
error function
network
texture
pixel value
training sample
Prior art date
Legal status (The legal status 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 status listed.)
Ceased
Application number
PCT/CN2018/092569
Other languages
English (en)
French (fr)
Inventor
徐玲玲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
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
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to US16/627,755 priority Critical patent/US20200125836A1/en
Priority to SG11201913728SA priority patent/SG11201913728SA/en
Priority to JP2019563812A priority patent/JP6812086B2/ja
Publication of WO2019200702A1 publication Critical patent/WO2019200702A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/73Deblurring; Sharpening
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/088Non-supervised learning, e.g. competitive learning
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2413Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on distances to training or reference patterns
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/0464Convolutional networks [CNN, ConvNet]
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/047Probabilistic or stochastic networks
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/0475Generative networks
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/09Supervised learning
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/094Adversarial learning
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/772Determining representative reference patterns, e.g. averaging or distorting patterns; Generating dictionaries
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/774Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/168Feature extraction; Face representation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/168Feature extraction; Face representation
    • G06V40/171Local features and components; Facial parts ; Occluding parts, e.g. glasses; Geometrical relationships
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/172Classification, e.g. identification
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • G06T2207/10008Still image; Photographic image from scanner, fax or copier

Definitions

  • the present application relates to the field of image processing, and in particular, to a method for training a netting system, a method for removing a netting, an apparatus, a device, and a medium.
  • the embodiment of the present application provides a method, a device, a device and a medium for training a de-grid system, so as to solve the problem that the de-meshing effect of the current de-meshing model is poor.
  • a method for training a netting system comprising:
  • Extracting a sample to be trained includes a meshed training sample having an equal number of samples and a meshless training sample;
  • a de-grid system training device comprising:
  • a training sample obtaining module configured to extract a sample to be trained, wherein the sample to be trained includes a meshed training sample with an equal number of samples and a meshless training sample;
  • a first error function acquiring module configured to input the meshed training sample into the texture extractor, extract a texture position, obtain a first error function based on the texture position and a preset label value, and The first error function updates a network parameter of the texture extractor;
  • a second error function acquiring module configured to input the texture position and the meshed training sample into a generated confrontation network generator, generate a simulation picture, and based on the simulated picture and the untextured Training the sample to obtain a second error function;
  • a discriminating result obtaining module configured to input the simulated picture and the untextured training sample into a generating type anti-network discriminator, obtain a discriminating result, and obtain a third error function and a fourth error according to the discriminating result function;
  • a fifth error function acquiring module configured to extract a feature A of the simulated picture and a feature B of the untrained training sample by using a pre-trained face recognition model, and obtain the feature B according to the feature A and the feature B Fifth error function;
  • the embodiment of the present application further provides a method, device, device and medium for removing the netting, so as to solve the problem that the current descreening effect is poor.
  • a method of removing the netting comprising:
  • the texture extractor Inputting the texture image to be input into the texture extractor, extracting the texture position of the to-be-removed picture; the texture extractor is obtained by using the de-grid system training method;
  • the generated anti-network generator adopts the Obtained by the netting system training method.
  • a descreening device comprising:
  • a moiré position extraction module configured to input the to-be-removed picture into the texture extractor, extract the position of the texture of the to-be-removed picture, and the texture extractor uses the de-grid system to train Method obtained;
  • a target de-texture picture generating module configured to input the mesh position of the to-be-removed picture and the to-be-removed picture into a generation-oriented network generator, to generate a target de-texture picture, and generate the target
  • the anti-mesh generator is obtained by the de-grid system training method.
  • a computer device comprising a memory, a processor, and computer readable instructions stored in the memory and operative on the processor, the processor executing the computer readable instructions to:
  • Extracting a sample to be trained includes a meshed training sample having an equal number of samples and a meshless training sample;
  • a computer device comprising a memory, a processor, and computer readable instructions stored in the memory and operative on the processor, the processor executing the computer readable instructions to:
  • the texture extractor uses the above-described de-grid system training method to update the texture according to the first error function Obtained by the network parameters of the extractor;
  • the generation-oriented network generator adopts the above-mentioned de-networking
  • the pattern system training method acquires the network parameters of the generator against the network generator according to the sixth error function.
  • a computer readable storage medium storing computer readable instructions that, when executed by a processor, implement the following steps:
  • Extracting a sample to be trained includes a meshed training sample having an equal number of samples and a meshless training sample;
  • a computer readable storage medium storing computer readable instructions, the processor implementing the computer readable instructions to implement the following steps:
  • the texture extractor uses the above-described de-grid system training method to update the texture according to the first error function Obtained by the network parameters of the extractor;
  • the generation-oriented network generator adopts the above-mentioned de-networking
  • the pattern system training method acquires the network parameters of the generator against the network generator according to the sixth error function.
  • the first error function (e_loss) is obtained based on the position of the mesh and the preset tag value, based on the simulated picture and the sample without the mesh training.
  • the characteristics including the generated anti-network generator and the generated anti-network discriminator) are obtained according to the second error function, the third error function, the fourth error function and the fifth error function, and the error function of the generated generation against the network generator is sixth.
  • the error function (g_loss) and the seventh error function (d_loss) of the error function of the generation against the network discriminator, the corresponding error function is constructed by the error generated in the training de-grid system, and the network is updated according to the error function.
  • the network parameters of each part of the model in the system enable full and effective training of the de-grid system.
  • the de-grid system covers the factors affecting the netting effect of the netting system during the training process of the de-grid system, so that the de-meshing system has a very good de-meshing effect when the image is descreened.
  • the mesh position of the tomographic image is extracted by inputting the to-be-removed picture into the texture extractor, and the network to be removed
  • the texture position of the picture and the picture to be removed are input into the generation-resisting network generator to generate a target-to-mesh picture, and the de-meshing effect using the de-grid method is very good.
  • FIG. 1 is an application environment diagram of a mesh system training method according to an embodiment of the present application
  • FIG. 2 is a flow chart of a method for training a mesh system in an embodiment of the present application
  • FIG. 3 is a specific flow chart of step S20 of Figure 2;
  • FIG. 4 is a specific flow chart of step S50 of Figure 2;
  • FIG. 5 is a flowchart of a method for removing a mesh in an embodiment of the present application.
  • FIG. 6 is a schematic diagram of a mesh system training device according to an embodiment of the present application.
  • FIG. 7 is a schematic diagram of a de-meshing device in an embodiment of the present application.
  • FIG. 8 is a schematic diagram of a computer device in an embodiment of the present application.
  • the de-meshing system in the de-grid system training method includes a texture extractor, a face recognition model, a generated confrontation network generator, and a generated confrontation network discriminator, and the process of training the netting system is training to remove the texture. Network parameters for each component of the system.
  • FIG. 1 shows an application environment of a de-grid system training method provided by an embodiment of the present application.
  • the application environment of the de-netting system training method includes a server and a client, wherein the server and the client are connected through a network, and the client is a device capable of human-computer interaction with the user, including but not limited to a computer.
  • the server can be implemented by a server cluster consisting of a separate server or multiple servers.
  • the descreening system training method provided by the embodiment of the present application is applied to a server.
  • FIG. 2 is a flowchart of a method for training a de-griding system according to an embodiment of the present application.
  • the voice distinguishing method includes the following steps:
  • Extracting a sample to be trained, the sample to be trained includes a meshed training sample with an equal number of samples and a meshless training sample.
  • the meshed training sample refers to a picture with a netting for training the netting system
  • the untextured training sample refers to a picture without a netting for training the netting system.
  • the meshed training samples and the untextured training samples in the samples to be trained are identical except for the netting. For example, take the user's webbed photo and the user's untextured photo as a set of netted training samples and an equal number of untextured training samples for the training to the netting system.
  • the equal number means that the proportional relationship between the netted training sample and the untextured training sample is 1:1.
  • the sample to be trained is extracted, and the sample to be trained includes a meshed training sample with equal sample numbers and a meshless training sample, and the meshed training sample and the equal number of untextured training samples may be
  • the sample size of the meshed training sample and the equal number of untextured training samples should be large enough, and the sample size is too small to fully train the netting system, resulting in poor descreening effect of the de-mesh system obtained by training.
  • the sample size may specifically be 40,000 sets of textured training samples and no textured training samples.
  • the difference between the meshed training sample and the non-reticulated training sample is only the presence or absence of a netting, so that sufficient training can be performed according to the difference to extract the meshed training samples and the number of equals.
  • the distinguishing feature between the meshless training samples lays the foundation for effective training of the de-grid system.
  • the texture extractor here is a pre-trained texture extraction model capable of extracting the position of the picture texture.
  • the position of the netting is the relative position of the netting with the textured training sample in the textured training sample (such as a textured photo).
  • the tag value refers to the actual situation of the meshed position in the meshed training sample and the corresponding meshless training sample (that is, the tag value is obtained by manual labeling according to the actual situation).
  • the label value is used to calculate the error of the texture position extracted by the texture extractor and the actual position of the texture, and construct a corresponding error function to update the network parameters in the texture extractor according to the error function (the texture extractor is It is trained by the neural network model, so the texture extractor includes network parameters in the neural network).
  • the first error function ie e_loss
  • the first error function refers to an error function constructed from the error between the texture position extracted by the texture extractor and the preset label value.
  • the meshed training sample is input to the network extractor, and the network extractor extracts the textured position of the meshed training sample, and extracts the extracted textured position and the preset label value.
  • a suitable error function e_loss is constructed to measure the error between the extracted texture position and the preset label value. It can be understood that there is an error in the position of the mesh extracted from the meshed training sample by using the pre-trained mesh extractor (the actual position of the textured position, that is, the label value), due to the presence of the mesh.
  • Training samples need to be trained in other model parts of the descreening system (such as the generated confrontation network generator and the generated anti-network discriminator), so the networked extractor should be trained here to train the network extractor.
  • the network extractor is optimized so that the network extractor can more accurately extract the texture position of the meshed training sample, and improve the accuracy of the subsequent de-grid system training.
  • step S20 the meshed training sample is input into the texture extractor, the position of the texture is extracted, and e_loss is obtained based on the position of the texture and the preset label value, and Updating the network parameters of the texture extractor according to e_loss includes the following steps:
  • each pixel value of the texture position is obtained according to the texture extractor, and each pixel value is normalized into the interval of [0, 1] to obtain a normalized pixel value (ie, returning The pixel value after processing).
  • a normalized pixel value ie, returning The pixel value after processing.
  • the pixel value of an image has a pixel value level of 2 8 , 2 12 , and 2 16 , and a pair of images may contain a large number of different pixel values, which makes calculation inconvenient, so the method of normalizing pixel values is adopted.
  • Each pixel value at the position of the texture is compressed in the same range, which simplifies the calculation and speeds up the training process of the de-grid system.
  • the normalized pixel values of the meshless training samples are first calculated and acquired (the pixel values without the mesh training samples may also be normalized in advance, and normalized without calculation),
  • the normalized pixel value of the texture position obtained in step S21 and the normalized normalized non-netted training sample are subtracted and taken as absolute values (which can be expressed as
  • the pixel difference between the textured and the untextured is very obvious, so the use of the pixel difference can well represent the position of the texture.
  • the preset demarcation value refers to a reference value set in advance for differentiating the pixel into values of 0 and 1.
  • the binarized texture position is the position of the texture obtained by comparing the normalized pixel value with the preset boundary value and changing the normalized pixel value of the texture position.
  • the preset boundary value may be set to 0.3. At this time, if the pixel difference is greater than 0.3, the normalized pixel value corresponding to the texture position is taken as 1; if the pixel value is not greater than 0.3, the network is The normalized pixel value corresponding to the land position is taken as 0.
  • the binarized mesh position obtained by the preset boundary value can express the position of the mesh in a simple manner according to the characteristics of the texture on the picture, and can accelerate the training of the de-grid system.
  • S24 calculating, according to each pixel value of the binarized mesh position and each pixel value corresponding to the preset tag value, acquiring a first error function, and updating a network parameter of the mesh extractor according to the first error function;
  • the calculation formula of the first error function is Where n is the number of pixel values, x i represents the i-th pixel value of the binarized texture position, and y i represents the ith pixel value of the preset tag value corresponding to x i .
  • each pixel value corresponding to the preset label value is represented by two types of values: the pixel value corresponding to the texture position is 1 (ie, "true” in the actual case), and is not the pixel value of the texture position. Is 0 (that is, "false” in the actual situation).
  • the calculation is performed according to each pixel value of the binarized mesh position and each pixel value corresponding to the preset tag value, and the calculation process is a process of acquiring e_loss.
  • e_loss is calculated as Where n is the number of pixel values, x i represents the i-th pixel value of the binarized texture position, and y i represents the ith pixel value of the preset tag value corresponding to x i .
  • the e_loss refers to an error function constructed according to an error between a mesh position extracted by the texture extractor and a preset label value, and the error function can effectively reflect the position of the texture extracted by the texture extractor and the actual situation.
  • the error function constructed by the error can be used to reverse the error of the network parameters in the texture extractor, and the network parameters in the texture extractor are updated.
  • the method of updating the network parameters by the error function back propagation adopts the gradient descent method, and the gradient descent method here is not limited to the batch gradient descent method, the small batch gradient descent method and the stochastic gradient descent method.
  • Gradient descent method can be used to find the minimum value of the error function, and the error function is minimized, so that the network parameters in the netting extractor can be updated effectively, so that the netting extractor after extracting the network parameters can extract the mesh position better. .
  • updating the texture extractor according to the pixel value to extract the position of the texture is applicable to different types of texture (type of texture position), that is, in training the texture extractor.
  • type of texture position a variety of different mesh types can be trained together; and in the texture extraction stage, any type of texture position can be directly extracted by the texture extractor, and there is no limitation of the texture type when extracting the texture position. .
  • Generative Adversarial Networks is a deep learning model and one of the methods of unsupervised learning in complex distribution.
  • the model learns to produce outputs that are fairly close to people's expectations through the mutual game of (at least) two modules in the framework: the Generative Model and the Discriminative Model.
  • the generative confrontation network is actually updating the model of optimizing itself (including the generation model and the discriminant model) according to the game between the generation model and the discriminant model, and the generation model is responsible for generating an output highly similar to the training sample.
  • the discriminant model is responsible for discriminating the authenticity of the output generated by the generated model and the height of the training sample.
  • the "simulation" capability of the generated model will be stronger, and the output will be closer to the training sample.
  • the discriminative ability of the discriminant model is also stronger, and the output of the height "simulation” generated by the generating module can be identified.
  • the probability of the final discriminant model discriminating is about 50%, it means that the discriminant model can not distinguish the authenticity at this time ( About ⁇ guess, the simulation sample generated by the generation module is almost the same as the real training sample.
  • the simulated image is generated by the generated image against the network generator, which can be known by the characteristics of the generated against the network generator.
  • the generative confrontation network generator refers to a generation model of the generative confrontation network.
  • the texture position and the textured training sample extracted by the texture extractor are input into a generation-oriented network generator (also a model), and the generation-resistance network generator is based on the texture position and the network.
  • the pattern training samples generate corresponding simulation pictures.
  • the generated confrontation network generator processes the input texture position and the textured training sample by using network parameters (weights and offsets) in the generator, and calculates a simulated picture. Since the simulated picture is generated, it is only the maximum to simulate and approximate the "pattern" of the meshless training sample.
  • the second error function ie, l_loss
  • the untrained training sample ie, the actual situation, here is the label action.
  • L_loss refers to the error function constructed based on the error between the simulated image generated by the generator against the network generator and the actual situation (without the mesh training sample). Specifically, the error function l_loss constructed according to the error between the simulated picture and the actual situation can be used to inversely transmit the error of the network parameter in the generation against the network generator, and update the network parameter of the generation against the network generator.
  • step S30 the mesh position and the meshed training sample are input into the generated confrontation network generator to generate a simulation picture, and the l_loss is obtained based on the simulated picture and the untrained training sample.
  • l_loss is calculated as Where n is the number of pixel values, x i represents the ith pixel value of the simulated picture, and y i represents the ith pixel value corresponding to x i without the textured training sample.
  • the pixel values respectively represented by x i and y i are subjected to an operation of the error function after the normalization process, which can effectively simplify the calculation and speed up the training process of the de-grid system.
  • the simulated picture and the untextured training sample are input into a generation-response network discriminator to obtain a discrimination result.
  • the generated anti-network discriminator is a network model corresponding to the generated anti-network generator, and is used for discriminating the authenticity of the generated simulated image against the network generator. That is, the generated confrontation network discriminator refers to a discriminant model of the generated confrontation network.
  • gan_g_loss a third error function (ie, gan_g_loss) and a fourth error function (ie, gan_d_loss) according to the discriminating result of the generated anti-network discriminator
  • gan_g_loss is an error function reflecting the generated anti-network generator generating the simulation picture, according to the error function
  • the error is back-transferred to the network parameters in the generated anti-network generator, and the network parameters are updated
  • gan_d_loss is an error function reflecting the generated anti-network discriminator discriminating simulation picture, which can be based on the error function in the generation against the network discriminator
  • the network parameters are error-backed, and the generation parameters are updated against the network parameters in the network discriminator.
  • step S40 the simulated picture and the non-mesh training sample are input into the generation-oriented network discriminator, and the determination result is obtained, and gan_g_loss and gan_d_loss are obtained according to the determination result, which specifically includes: a generation confrontation
  • the discriminant results of the network discriminator output are D(G(X)) and D(Y)
  • X represents the input of the generator against the network generator
  • X consists of n x i
  • x i represents the generator against the network generator input.
  • the ith pixel value, G(X) represents the output of the generator against the network generator
  • D(G(X)) represents the output of the generator against the network generator (ie, the simulated picture, as a generator against the network discriminator Input) the output of the generated anti-network discriminator (after discriminating)
  • Y represents the input of the non-mesh training sample in the generator against the network discriminator
  • Y consists of n y i
  • y i represents no netting
  • the training samples are input to the i-th pixel value of the generated anti-network discriminator
  • D(Y) represents the output of the non-mesh training sample in the generation against the network discriminator.
  • gan_g_loss is an error function describing the error that occurs when the generator against the network discriminator discriminates the output of the generator against the network generator.
  • the calculation formula of gan_d_loss is Among them, gan_d_loss is an error function describing the error of the generated against the network discriminator when discriminating the sample without the netting training.
  • the pixel values in step S40 are all subjected to an operation of the error function after the normalization process, which can effectively simplify the calculation and speed up the training process of the de-grid system.
  • the face recognition model is pre-trained, and the face recognition model can be acquired by using an open source face set.
  • the pre-trained face recognition model is used to extract the feature A of the simulated picture and the feature B without the mesh training sample (actual case), and obtain the corresponding fifth error according to the feature A and the feature B.
  • Function (ie i_loss) It can be understood that the feature A of the simulated picture and the feature B without the mesh training sample are extracted by the face recognition model, and the error function i_loss constructed according to the feature A and the feature B can reflect the simulated picture and the untrained training sample. The degree of similarity on the subtle features, the subtle features extracted by the face recognition model can reflect the difference between the simulated picture and the unlined training sample. According to the difference, the appropriate error function i_loss can be constructed and generated according to the i_loss update.
  • the network parameters in the anti-network generator and the network parameters in the generation against the network discriminator make the simulation image generated by the generator against the network generator more "true", and the more powerful the discriminative ability of the generation against the network discriminator (Because the simulated picture is used as an input in the generator against the network discriminator, an error is also generated, so i_loss can also update the network parameters in the generation against the network discriminator).
  • step S50 the feature A of the simulated picture and the feature B without the mesh training sample are extracted by using the pre-trained face recognition model, and acquired according to the feature A and the feature B.
  • I_loss including the following steps:
  • the feature of the face recognition model extracting the simulated picture is that the feature image is extracted from the pre-trained face recognition model by inputting the simulation picture into the face recognition model, and the feature is taken as a feature.
  • the feature A may specifically refer to extracting each pixel value in the simulated picture by the pre-trained face recognition model.
  • S52 Input the untrained training sample into the pre-trained face recognition model to extract feature B.
  • the face recognition model extracts the feature without the mesh training sample by extracting the untrained training sample into the face recognition model, and extracting the mesh without the netted face recognition model from the pre-trained face recognition model
  • the feature that is included in the training sample is taken as the feature B.
  • the feature B may specifically refer to extracting each pixel value corresponding to the feature A in the simulated picture by the pre-trained face recognition model.
  • S53 Calculate the Euclidean distance of the feature A and the feature B, and obtain a fifth error function, and the calculation formula of the fifth error function is Where n is the number of pixel values, a i represents the ith pixel value in feature A, and b i represents the ith pixel value in feature B.
  • the Euclidean distance is used as the error function of the feature A and the feature B, and the error function can well describe the difference between the feature A and the feature B.
  • the error function i_loss constructed according to the difference can be back-reversed and updated.
  • the network parameters and generation in the network generator counter the network parameters in the network discriminator, so that the generated simulated picture achieves almost the same effect as the untextured training sample.
  • the pixel values respectively represented by a i and b i are subjected to an operation of the error function after the normalization process, which can effectively simplify the calculation and speed up the training process of the de-grid system.
  • the sixth error function (ie, g_loss) is the error function finally adopted by the update generation against the network parameters in the network generator.
  • l_loss reflects the error between the generated simulation image generated by the network generator and the actual situation (without the mesh training sample);
  • gan_g_loss reflects the generation of the simulation image generated by the generated network generator.
  • the error in discriminating against the network discriminator this error is reflected in the simulation picture as the input of the generation network discriminator, which is different from l_loss);
  • i_loss reflects between the simulated picture and the unlined training sample.
  • Feature difference ie error
  • the method of updating the network parameters by the error function back propagation adopts the gradient descent method, and the gradient descent method here is not limited to the batch gradient descent method, the small batch gradient descent method and the stochastic gradient descent method.
  • the seventh error function (ie, d_loss) is an error function finally adopted by the update generation against the network parameter in the network discriminator.
  • gan_d_loss reflects the error that occurs when the generated against the network discriminator discriminates against the unlined training samples.
  • I_loss reflects the error in the feature extracted from the face recognition model between the simulated picture and the unlined training sample. The error can be obtained by using the simulated picture and the non-mesh training sample as the generation-oriented network discriminator. It is reflected when input.
  • the error functions in the sense of these two different dimensions can reflect the error of the discriminant result when the generator against the network discriminator is discriminated. Therefore, both error functions can be used to update the generated anti-network discriminator.
  • the method of updating the network parameters by the error function back propagation adopts the gradient descent method, and the gradient descent method here is not limited to the batch gradient descent method, the small batch gradient descent method and the stochastic gradient descent method.
  • e_loss is obtained based on the position of the mesh and the preset tag value, and the network parameter of the nettext extractor is updated in reverse according to e_loss, so that the nettext extractor updated according to e_loss is obtained.
  • the mesh position of extracting the meshed training sample and the data without the mesh training sample is more accurate, and the accuracy of the subsequent de-grid system training is improved.
  • the network discriminator obtains the error function g_loss of the generator against the network generator and the error function d_loss of the generator against the network discriminator according to l_loss, gan_g_loss, gan_g_loss and i_loss, by the error generated by each part of the model in the training de-grid system,
  • the corresponding error function is constructed by different error functions in multiple dimensions, and the error functions in multiple dimensions are added, and the error function is finally adopted according to the generator-against network generator and the generated-against network discriminator.
  • the network parameters of each part of the network system are updated to achieve full and effective training of the de-grid system.
  • the de-grid system covers the factors affecting the netting effect of the netting system during the training process of the netting system. Each factor reflects the possible errors in the respective dimensions, and constructs an appropriate error function according to the error and reverses
  • the network parameters are updated and the entire de-grid system is trained, so that the de-grid system can achieve very excellent effects when the image is descreened.
  • Fig. 5 is a block diagram showing the principle of the de-grid system training apparatus corresponding to the de-mesh system training method in the embodiment.
  • the de-grid system training device includes a training sample acquisition module 10, a first error function acquisition module 20, a second error function acquisition module 30, a discrimination result acquisition module 40, and a fifth error function acquisition module 50.
  • the implementation function of the acquisition module 70 corresponds to the steps corresponding to the de-mesh system training method in the embodiment. To avoid redundancy, the embodiment is not described in detail.
  • the training sample obtaining module 10 is configured to extract the samples to be trained, and the samples to be trained include the meshed training samples with the same number of samples and the untrained training samples.
  • the first error function obtaining module 20 is configured to input the meshed training sample into the texture extractor, extract the texture position, obtain the first error function based on the texture position and the preset label value, and obtain the first error according to the first error.
  • the function updates the network parameters of the texture extractor.
  • the second error function obtaining module 30 is configured to input the mesh position and the meshed training sample into the generated confrontation network generator, generate a simulation picture, and acquire a second error function based on the simulated picture and the untextured training sample. .
  • the discriminating result obtaining module 40 is configured to input the simulated picture and the untextured training sample into the generated anti-network discriminator, obtain the discriminating result, and obtain the third error function and the fourth error function according to the discriminating result.
  • the fifth error function obtaining module 50 is configured to extract the feature A of the simulated picture and the feature B without the mesh training sample by using the pre-trained face recognition model, and acquire the fifth error function according to the feature A and the feature B.
  • the first error function acquisition module 20 includes a normalization unit 21, a pixel difference acquisition unit 22, a texture position binarization unit 23, and a first error function acquisition unit 24.
  • the normalization unit 21 is configured to obtain each pixel value of the texture position, and normalize each pixel value to obtain a normalized pixel value; wherein the formula for obtaining the normalized pixel value is MaxValue represents the maximum of all pixel values of the texture position, MinValue represents the minimum of all pixel values of the texture position, x is the value of each pixel, and y is the normalized pixel value.
  • the pixel difference acquisition unit 22 is configured to obtain a pixel difference of the normalized pixel value of the texture position and the corresponding normalized pixel value of the meshless training sample.
  • the texture position binarization unit 23 is configured to: if the pixel difference is greater than the preset boundary value, the normalized pixel value corresponding to the texture position is taken as 1, and if the pixel difference is not greater than the preset boundary value, the texture is The normalized pixel value corresponding to the position is taken as 0, and the binarized texture position is obtained.
  • the first error function acquiring unit 24 is configured to perform calculation according to each pixel value of the binarized mesh position and each pixel value corresponding to the preset tag value, obtain a first error function, and update according to the first error function.
  • a network parameter of the texture extractor wherein the calculation formula of the first error function is Where n is the number of pixel values, x i represents the i-th pixel value of the binarized texture position, and y i represents the ith pixel value of the preset tag value corresponding to x i .
  • the calculation formula of the second error function is Where n is the number of pixel values, x i represents the ith pixel value of the simulated picture, and y i represents the ith pixel value corresponding to x i without the textured training sample.
  • the discrimination result is D(G(X)) and D(Y)
  • X represents the input of the generator against the network generator
  • X is composed of n x i
  • x i represents the generation of the generator against the network generator input.
  • G(X) represents the output of the generator against the network generator
  • D(G(X)) represents the output of the generator against the network generator
  • Y means no network
  • the pattern of the training pattern is generated by the generator against the network discriminator, Y consists of n y i , and y i represents the i-th pixel value of the non-mesh training sample input to the generated anti-network discriminator, D(Y) represents No mesh training samples are generated in the output against the network discriminator;
  • the fifth error function acquisition module 50 includes a feature A extraction unit 51, a feature B extraction unit 52, and a fifth error function acquisition unit 53.
  • a feature A extracting unit 51 configured to input a simulated picture into a pre-trained face recognition model, and extract feature A;
  • a feature B extracting unit 52 configured to input a meshless training sample into a pre-trained face recognition model, and extract feature B;
  • the fifth error function acquiring unit 53 is configured to calculate the Euclidean distance of the feature A and the feature B, and obtain a fifth error function, and the calculation formula of the fifth error function is Where n is the number of pixel values, a i represents the ith pixel value in feature A, and b i represents the ith pixel value in feature B.
  • Figure 6 shows a flow chart of a method of descreening in an embodiment.
  • the de-grain method can be applied to financial institutions such as banks, securities, investment and insurance, or other computer equipment that needs to perform image de-texting, in order to perform re-texturing on pictures with netting to achieve artificial intelligence.
  • the computer device is a device capable of human-computer interaction with a user, including but not limited to a computer, a smart phone, and a tablet.
  • the de-meshing method includes the following steps:
  • the picture to be removed refers to the target picture to be subjected to the texture processing.
  • the screen to be removed is input into the texture extractor, and the texture position of the texture image to be removed is extracted by the texture extractor, and the target texture image is generated according to the texture position.
  • the netting extractor formed by updating the network parameter of the netting extractor by using the first error function obtained by the de-grid system training method in the embodiment can accurately extract the mesh position of the to-be-removed image, and effectively improve the netting extraction. The accuracy.
  • the target to the netted picture refers to the target picture obtained after the texture pattern is to be removed.
  • the texture position extracted by the texture extractor in the screen to be removed is input into the generated confrontation network generator together with the to-be-removed picture, and the generated network is based on the texture.
  • the position removes the texture to be removed from the textured image, and generates a target to the textured image.
  • the generation of the anti-network generator formed by the sixth error function obtained by the de-mesh system training method in the embodiment is used to accurately remove the texture in the screen to be removed, which can effectively Improve the texture effect.
  • the texture position of the to-be-removed picture is first extracted by the texture extractor, and the first error function obtained by the de-grid system training method in the embodiment is used to update the texture extractor.
  • the netting extractor formed by the network parameter can accurately extract the position of the mesh to be removed from the textured image, effectively improve the accuracy of the netting extraction, and then remove the mesh to be removed according to the position of the mesh by the generating type against the network generator.
  • the netting in the picture, the target to the netted picture is generated, and the sixth error function obtained by the de-meshing system training method in the embodiment is used to update the generated type against the network parameter of the network generator, and the generated generation against the network generator is accurately removed.
  • the texture of the netted image can be effectively improved to remove the netting effect.
  • the target to be netted by the de-netting method has almost no difference with the corresponding image before the netting, which can achieve very good. Go to the net effect.
  • Fig. 7 is a block diagram showing the principle of the de-meshing apparatus corresponding to the de-meshing method in the embodiment.
  • the de-meshing device includes a textured position extraction module 80 and a target de-griple picture generation module 90.
  • the implementation functions of the mesh position extraction module 80 and the target descreening image generation module 90 are in one-to-one correspondence with the steps corresponding to the de-meshing method in the embodiment. To avoid redundancy, the present embodiment will not be described in detail.
  • the mesh position extraction module 80 is configured to input the to-be-removed picture into the texture extractor, and extract the position of the texture to be removed from the texture image, and the texture extractor is obtained by using the de-grid system training method in the embodiment.
  • the first error function is obtained after updating the network parameters of the texture extractor.
  • the target de-grid picture generation module 90 is configured to input the texture position of the to-be-removed picture and the to-be-removed picture into the generation-oriented network generator, generate a target de-grid picture, and generate a confrontation network generator. It is obtained by using the sixth error function obtained by the de-grid system training method in the embodiment to update the network parameters of the generated generator against the network generator.
  • the embodiment provides a computer readable storage medium on which computer readable instructions are stored.
  • the computer readable instructions are executed by the processor, the method for training the descreening system in the embodiment is implemented. I won't go into details here.
  • the computer readable instructions are executed by the processor, the functions of the modules/units of the descreening system training device in the embodiment are implemented. To avoid repetition, details are not described herein again.
  • the computer readable instructions are executed by the processor, the functions of the steps in the descreening method in the embodiment are implemented. To avoid repetition, details are not described herein.
  • the computer readable instructions are executed by the processor, the functions of the modules/units in the descreening device in the embodiment are implemented. To avoid repetition, details are not described herein.
  • FIG. 8 is a schematic diagram of a computer device according to an embodiment of the present application.
  • the computer device 100 of this embodiment includes a processor 101, a memory 102, and computer readable instructions 103 stored in the memory 102 and executable on the processor 101, the computer readable instructions 103 being processed
  • the computer readable instructions 103 are implemented by the processor 101 to implement the functions of the models/units in the de-grid system training device in the embodiment.
  • the computer readable instructions 103 are implemented by the processor 101 to implement the functions of the steps in the descreening method in the embodiment.
  • the computer readable instructions 103 when executed by the processor 101, implement the functions of the various modules/units in the descreening device of the embodiment. To avoid repetition, we will not go into details here.
  • computer readable instructions 103 may be partitioned into one or more modules/units, one or more modules/units being stored in memory 102 and executed by processor 101 to complete the application.
  • the one or more modules/units may be an instruction segment of a series of computer readable instructions 103 capable of performing a particular function, which is used to describe the execution of computer readable instructions 103 in computer device 100.
  • the computer readable instructions 103 can be divided into the training sample acquisition module 10, the first error function acquisition module 20, the second error function acquisition module 30, the discrimination result acquisition module 40, and the fifth error function acquisition module 50 in the embodiment.
  • the sixth error function acquisition module 60 and the seventh error function acquisition module 100, or the texture position extraction module 80 and the target de-grid picture generation module 90 in the embodiment, the specific functions of each module are as shown in the embodiment, Avoid duplication, not to repeat them here.
  • the computer device 100 can be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server.
  • Computer devices may include, but are not limited to, processor 101, memory 102. It will be understood by those skilled in the art that FIG. 8 is merely an example of the computer device 100 and does not constitute a limitation of the computer device 100, and may include more or less components than those illustrated, or may combine certain components or different components.
  • the computer device may also include an input and output device, a network access device, a bus, and the like.
  • the processor 101 may be a central processing unit (CPU), or may be other general-purpose processors, a digital signal processor (DSP), an application specific integrated circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc.
  • the general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
  • the memory 102 can be an internal storage unit of the computer device 100, such as a hard disk or memory of the computer device 100.
  • the memory 102 can also be an external storage device of the computer device 100, such as a plug-in hard disk equipped on the computer device 100, a smart memory card (SMC), a Secure Digital (SD) card, and a flash memory card (Flash). Card) and so on.
  • the memory 102 may also include both an internal storage unit of the computer device 100 and an external storage device.
  • Memory 102 is used to store computer readable instructions 103 and other programs and data required by the computer device.
  • the memory 102 can also be used to temporarily store data that has been or will be output.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • General Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Multimedia (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Engineering & Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Computational Linguistics (AREA)
  • Mathematical Physics (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Molecular Biology (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Medical Informatics (AREA)
  • Databases & Information Systems (AREA)
  • Human Computer Interaction (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Probability & Statistics with Applications (AREA)
  • Image Analysis (AREA)

Abstract

本申请公开了一种去网纹系统训练方法、去网纹方法、装置、设备及介质。该去网纹系统训练方法包括:基于网纹位置和预设的标签值获取第一误差函数,基于仿真图片和不带网纹训练样本获取第二误差函数,根据判别结果获取第三误差函数和第四误差函数,根据特征A和特征B获取第五误差函数,并基于生成式对抗网络的特点,根据第二误差函数、第三误差函数、第三误差函数和第五误差函数分别获取第六误差函数和第七误差函数,再根据训练产生的误差构建误差函数,采用误差函数反传更新去网络系统中各部分模型的网络参数。该去网纹系统去除了去网纹系统训练过程中多个影响去网纹系统去网纹效果的误差因素,使得该去网纹系统的去网纹效果比较好。

Description

去网纹系统训练方法、去网纹方法、装置、设备及介质
本申请以2018年4月20日提交的申请号为201810360251.9,名称为“去网纹系统训练方法、去网纹方法、装置、设备及介质”的中国专利申请为基础,并要求其优先权。
技术领域
本申请涉及图像处理领域,尤其涉及一种去网纹系统训练方法、去网纹方法、装置、设备及介质。
背景技术
目前的证件照很多是经过加网纹处理的,以提高证件照的安全性。但加了网纹的证件照,很难进行人脸特征点的检测,使得其无法直接进行人脸识别。因此,在进行人脸特征点的检测之前需要先去掉网纹,才能够进行人脸识别。目前业界的去网纹模型的去网纹效果比较差,容易使得去网纹后的证件照或者其他图片上的人脸出现变形的现象。
发明内容
本申请实施例提供一种去网纹系统训练方法、装置、设备及介质,以解决当前去网纹模型的去网纹效果差的问题。
一种去网纹系统训练方法,包括:
提取待训练样本,所述待训练样本包括样本数量相等的带网纹训练样本和不带网纹训练样本;
将所述带网纹训练样本输入到网纹提取器中,提取网纹位置,基于所述网纹位置和预设的标签值获取第一误差函数,并根据所述第一误差函数更新网纹提取器的网络参数;
将所述网纹位置和所述带网纹训练样本输入到生成式对抗网络生成器中,生成仿真图片,并基于所述仿真图片和所述不带网纹训练样本获取第二误差函数;
将所述仿真图片和所述不带网纹训练样本输入到生成式对抗网络判别器中,获取判别结果,并根据所述判别结果获取第三误差函数和第四误差函数;
采用预先训练好的人脸识别模型提取所述仿真图片的特征A和所述不带网纹训练样本的特征B,根据所述特征A和所述特征B获取第五误差函数;
获取第六误差函数,根据所述第六误差函数更新生成式对抗网络生成器中的网络参数,其中,第六误差函数=第二误差函数+第三误差函数+第五误差函数;
获取第七误差函数,根据所述第七误差函数更新生成式对抗网络判别器中的网络参数,其中,第七误差函数=第四误差函数+第五误差函数。
一种去网纹系统训练装置,包括:
训练样本获取模块,用于提取待训练样本,所述待训练样本包括样本数量相等的带网纹训练样本和不带网纹训练样本;
第一误差函数获取模块,用于将所述带网纹训练样本输入到网纹提取器中,提取网纹位置,基于所述网纹位置和预设的标签值获取第一误差函数,并根据所述第一误差函数更新网纹提取器的网络参数;
第二误差函数获取模块,用于将所述网纹位置和所述带网纹训练样本输入到生成式对抗网络生成器中,生成仿真图片,并基于所述仿真图片和所述不带网纹训练样本获取第二误差函数;
判别结果获取模块,用于将所述仿真图片和所述不带网纹训练样本输入到生成式对抗网络判别器中,获取判别结果,并根据所述判别结果获取第三误差函数和第四误差函数;
第五误差函数获取模块,用于采用预先训练好的人脸识别模型提取所述仿真图片的特征A和所述不带网纹训练样本的特征B,根据所述特征A和所述特征B获取第五误差函数;
第六误差函数获取模块,用于获取第六误差函数,根据所述第六误差函数更新生成式对抗网络生成器中的网络参数,其中,第六误差函数=第二误差函数+第三误差函数+第五误差函数;
第七误差函数获取模块,用于获取第七误差函数,根据所述第七误差函数更新生成式对抗网络判别器中的网络参数,其中,第七误差函数=第四误差函数+第五误差函数。
本申请实施例还提供一种去网纹方法、装置、设备及介质,以解决当前去网纹效果差的问题。
一种去网纹方法,包括:
将待去网纹图片输入到网纹提取器中,提取所述待去网纹图片的网纹位置;所述网纹提取器是采用所述去网纹系统训练方法获取到的;
将所述待去网纹图片的网纹位置和所述待去网纹图片输入到生成式对抗网络生成器中,生成目标去网纹图片;所述生成式对抗网络生成器是采用所述去网纹系统训练方法获取到的。
一种去网纹装置,包括:
网纹位置提取模块,用于将待去网纹图片输入到网纹提取器中,提取所述待去网纹图片的网纹位置,所述网纹提取器是采用所述去网纹系统训练方法获取到的;
目标去网纹图片生成模块,用于将所述待去网纹图片的网纹位置和所述待去网纹图片输入到生成式对抗网络生成器中,生成目标去网纹图片,所述生成式对抗网络生成器是采用所述去网纹系统训练方法获取到的。
一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如下步骤:
提取待训练样本,所述待训练样本包括样本数量相等的带网纹训练样本和不带网纹训练样本;
将所述带网纹训练样本输入到网纹提取器中,提取网纹位置,基于所述网纹位置和预设的标签值获取第一误差函数,并根据所述第一误差函数更新网纹提取器的网络参数;
将所述网纹位置和所述带网纹训练样本输入到生成式对抗网络生成器中,生成仿真图片,并基于所述仿真图片和所述不带网纹训练样本获取第二误差函数;
将所述仿真图片和所述不带网纹训练样本输入到生成式对抗网络判别器中,获取判别结果,并根据所述判别结果获取第三误差函数和第四误差函数;
采用预先训练好的人脸识别模型提取所述仿真图片的特征A和所述不带网纹训练样本的特征B,根据所述特征A和所述特征B获取第五误差函数;
获取第六误差函数,根据所述第六误差函数更新生成式对抗网络生成器中的网络参数,其中,第六误差函数=第二误差函数+第三误差函数+第五误差函数;
获取第七误差函数,根据所述第七误差函数更新生成式对抗网络判别器中的网络参数,其中,第七误差函数=第四误差函数+第五误差函数。
一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如下步骤:
将待去网纹图片输入到网纹提取器中,提取所述待去网纹图片的网纹位置;所述网纹提取器是采用上述去网纹系统训练方法根据第一误差函数更新网纹提取器的网络参数获取到的;
将所述待去网纹图片的网纹位置和所述待去网纹图片输入到生成式对抗网络生成器中,生成目标去网纹图片;所述生成式对抗网络生成器是采用上述去网纹系统训练方法根据第六误差函数更新生成式对抗网络生成器的网络参数获取到的。
一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可读指令,所述计算机可读指令被处理器执行时实现如下步骤:
提取待训练样本,所述待训练样本包括样本数量相等的带网纹训练样本和不带网纹训练样本;
将所述带网纹训练样本输入到网纹提取器中,提取网纹位置,基于所述网纹位置和预设的标签值获取第一误差函数,并根据所述第一误差函数更新网纹提取器的网络参数;
将所述网纹位置和所述带网纹训练样本输入到生成式对抗网络生成器中,生成仿真图片,并基于所述仿真图片和所述不带网纹训练样本获取第二误差函数;
将所述仿真图片和所述不带网纹训练样本输入到生成式对抗网络判别器中,获取判别结果,并根据所述判别结果获取第三误差函数和第四误差函数;
采用预先训练好的人脸识别模型提取所述仿真图片的特征A和所述不带网纹训练样本的特征B,根据所述特征A和所述特征B获取第五误差函数;
获取第六误差函数,根据所述第六误差函数更新生成式对抗网络生成器中的网络参数,其中,第六误差函数=第二误差函数+第三误差函数+第五误差函数;
获取第七误差函数,根据所述第七误差函数更新生成式对抗网络判别器中的网络参数,其中,第七误差函数=第四误差函数+第五误差函数。
一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可读指令,所述处理器执行所述计算机可读指令时实现如下步骤:
将待去网纹图片输入到网纹提取器中,提取所述待去网纹图片的网纹位置;所述网纹提取器是采用上述去网纹系统训练方法根据第一误差函数更新网纹提取器的网络参数获取到的;
将所述待去网纹图片的网纹位置和所述待去网纹图片输入到生成式对抗网络生成器中,生成目标去网纹图片;所述生成式对抗网络生成器是采用上述去网纹系统训练方法根据第六误差函数更新生成式对抗网络生成器的网络参数获取到的。
本申请实施例所提供的去网纹系统训练方法、装置、设备及介质中,基于网纹位置和预设的标签值获取第一误差函数(e_loss),基于仿真图片和不带网纹训练样本获取第二误差函数(l_loss),根据判别结果获取第三误差函数(gan_g_loss)和第四误差函数(gan_d_loss),根据特征A和特征B获取第五误差函数(i_loss),并基于生成式对抗网络的特点(包括生成式对抗网络生成器和生成式对抗网络判别器)根据第二误差函数、第三误差函数、第四误差函数和第五误差函数获取生成式对抗网络生成器的误差函数第六误差函数(g_loss)和生成式对抗网络判别器的误差函数第七误差函数(d_loss),通过在训练去网纹系统中产生的误差构造相对应的误差函数,并根据误差函数反传更新去网络系统中各部分模型的网络参数,实现去网纹系统充分、有效的训练。该去网纹系统涵盖了去网纹系统训练过程中每一影响去网纹系统去网纹效果的因素,使得该去网纹系统对图片进行去网纹操作时的去网纹效果非常好。
本申请实施例所提供的去网纹方法、装置、设备及介质中,通过将待去网纹图片输入到网纹提取器中,提取待去网纹图片的网纹位置,并将待去网纹图片的网纹位置和待去网纹图片输入到生成式对抗网络生成器中,生成目标去网纹图片,采用该去网纹方法的去网纹效果非常好。
附图说明
为了更清楚地说明本申请实施例的技术方案,下面将对本申请实施例的描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是本申请一实施例中网纹系统训练方法的一应用环境图;
图2是本申请一实施例中网纹系统训练方法的一流程图;
图3是图2中步骤S20的一具体流程图;
图4是图2中步骤S50的一具体流程图;
图5是本申请一实施例中去网纹方法的一流程图;
图6是本申请一实施例中网纹系统训练装置的一示意图;
图7是本申请一实施例中去网纹装置的一示意图;
图8是本申请一实施例中计算机设备的一示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
该去网纹系统训练方法中的去网纹系统包括网纹提取器、人脸识别模型、生成式对抗网络生成器和生成式对抗网络判别器,训练去网纹系统的过程即训练去网纹系统中各组成部分的网络参数。
图1示出本申请实施例提供的去网纹系统训练方法的应用环境。该去网纹系统训练方法的应用环境包括服务端和客户端,其中,服务端和客户端之间通过网络进行连接,客户端是可与用户进行人机交互的设备,包括但不限于电脑、智能手机和平板等设备,服务端具体可以用独立的服务器或者多个服务器组成的服务器集群实现。本申请实施例提供的去网纹系统训练方法应用于服务端。
如图2所示,图2示出本申请实施例中去网纹系统训练方法的一流程图,该语音区分方法包括如下步骤:
S10:提取待训练样本,待训练样本包括样本数量相等的带网纹训练样本和不带网纹训练样本。
其中,带网纹训练样本是指用于训练去网纹系统的带有网纹的图片,不带网纹训练样本是指用于训练去网纹系统的不带网纹的图片。待训练样本中的带网纹训练样本和不带网纹训练样本除了在网纹上,其他部分都是相同的。例如:取用户甲的带网纹证件照和用户甲的不带网纹证件照作为训练去网纹系统的一组带网纹训练样本和数量相等的不带网纹训练样本。数量相等的意思是即带网纹训练样本和不带网纹训练样本两者间的比例关系为1:1。
在一实施例中,提取待训练样本,待训练样本包括样本数量相等的带网纹训练样本和不带网纹训练样本,带网纹训练样本和数量相等的不带网纹训练样本具体可以是采用大量人的带网纹证件照和不带网纹证件照,两者之间的区别仅在于有无网纹。该带网纹训练样本和数量相等的不带网纹训练样本的样本容量应该足够大,样本容量过小将无法充分训练去网纹系统,导致训练获取的去网纹系统的去网纹效果较差。在一实施例中,样本容量具体可以是取40000组带网纹训练样本和不带网纹训练样本。可以理解地,该带网纹训练样本和不带网纹训练样本的区别之处仅在于有无带网纹,因此能够根据该区别进行充分训练,以提取出带网纹训练样本和数量相等的不带网纹训练样本之间的区别特征,为去网纹系统的有效训练奠定了基础。
S20:将带网纹训练样本输入到网纹提取器中,提取网纹位置,基于网纹位置和预设的标签值获取第一误差函数,并根据第一误差函数更新网纹提取器的网络参数。
其中,这里的网纹提取器是预先训练好的、能够提取图片网纹位置的网纹提取模型。网纹位置是指带网纹训练样本的网纹在带网纹训练样本(如带网纹的证件照)中相对的位 置。标签值是指带网纹训练样本和相对应的不带网纹训练样本中网纹位置的实际情况(即标签值根据实际情况预先进行人工标注获取的)。该标签值用来计算网纹提取器提取的网纹位置和实际情况的网纹位置的误差,并构建相应的误差函数,根据误差函数更新网纹提取器中的网络参数(网纹提取器是由神经网络模型训练而来的,因此该网纹提取器包括神经网络中的网络参数)。第一误差函数(即e_loss)是指根据网纹提取器提取的网纹位置和预设的标签值之间的误差所构建的误差函数。
在一实施例中,将带网纹训练样本输入到网络提取器中,让网络提取器提取出带网纹训练样本的网纹位置,并将该提取出的网纹位置与预设的标签值作比较,构建合适的误差函数e_loss来衡量提取出的网纹位置和预设的标签值之间的误差。可以理解地,采用预先训练好的网纹提取器对带网纹训练样本提取出的网纹位置与实际情况(网纹位置的真实位置,即标签值)是存在误差的,由于该带网纹训练样本需要在去网纹系统的其他模型部分(如生成式对抗网络生成器和生成式对抗网络判别器)进行训练,因此在这里应采用该带网纹训练样本对网络提取器进行训练,以优化该网络提取器,使得该网络提取器在提取该带网纹训练样本的网纹位置时能够更加精确,提高后续去网纹系统训练的精确度。
在一具体实施方式中,如图3所示,步骤S20中,将带网纹训练样本输入到网纹提取器中,提取网纹位置,基于网纹位置和预设的标签值获取e_loss,并根据e_loss更新网纹提取器的网络参数,包括如下步骤:
S21:获取网纹位置的每一像素值,将每一像素值进行归一化处理,获取归一化像素值;其中,获取归一化像素值的公式为
Figure PCTCN2018092569-appb-000001
MaxValue表示网纹位置的所有像素值中的最大值,MinValue表示网纹位置的所有像素值中的最小值,x为每一像素值,y为归一化像素值。
在一实施例中,根据网纹提取器获取网纹位置的每一像素值,并将每一像素值归一化到[0,1]的区间中,获取归一化像素值(即进行归一化处理后的像素值)。一般来说,图像的像素值有2 8、2 12和2 16等像素值级别,一副图像中可以包含大量不同的像素值,使得计算不方便,因此采用将像素值归一化的方式把网纹位置上的各个像素值都压缩在同一个范围区间内,能够简化计算并且加快去网纹系统的训练过程。
S22:获取网纹位置的归一化像素值和对应的不带网纹训练样本的归一化像素值的像素差。
在一实施例中,先计算并获取不带网纹训练样本的归一化像素值(不带网纹训练样本的像素值也可以预先就归一化好,不必计算时才归一化),将步骤S21中获取的网纹位置的归一化像素值和对应的不带网纹训练样本的归一化作相减并取绝对值的运算(用公式可以表示为|x i-y i|,其中,x i表示网纹位置第i个像素值对应的归一化像素值,y i表示不带网纹训练样本的与x i相对应的第i个像素值对应的归一化像素值),获取网纹位置的归一化像素值和对应的不带网纹训练样本的归一化像素值的像素差。可以理解地,带网纹和不带网纹之间的像素差是非常明显的,因此采用像素差可以很好地表示网纹位置。
S23:若像素差大于预设分界值,则将网纹位置对应的归一化像素值取作1,若像素差不大于预设分界值,则将网纹位置对应的归一化像素值取作0,获取二值化网纹位置。
其中,预设分界值是指预先设置好的用于将像素差分为0和1两类值的参考值。二值化网纹位置是指将归一化像素值跟预设分界值作比较并更改网纹位置的归一化像素值后获取的网纹位置。
在一实施例中,预设分界值可以设置为0.3,此时,若像素差大于0.3,则把网纹位 置对应的归一化像素值取作1;若像素值不大于0.3,则把网纹位置对应的归一化像素值取作0。通过该预设分界值获取的二值化网纹位置能够根据网纹在图片上的特点,用简洁的方式表示网纹位置,能够加快该去网纹系统的训练。
S24:根据二值化网纹位置的每一像素值和预设的标签值对应的每一像素值进行计算,获取第一误差函数,并根据第一误差函数更新网纹提取器的网络参数;其中,第一误差函数的计算公式为
Figure PCTCN2018092569-appb-000002
其中,n为像素值个数,x i表示二值化网纹位置的第i个像素值,y i表示预设的标签值与x i相对应的第i个像素值。
其中,预设的标签值对应的每一像素值采用1,0两类值进行表示,网纹位置对应的像素值为1(即实际情况中的“真”),不是网纹位置的像素值为0(即实际情况中的“假”)。
在一实施例中,根据二值化网纹位置的每一像素值和预设的标签值对应的每一像素值进行计算,该计算过程即获取e_loss的过程。其中,e_loss的计算公式为
Figure PCTCN2018092569-appb-000003
其中,n为像素值个数,x i表示二值化网纹位置的第i个像素值,y i表示预设的标签值与x i相对应的第i个像素值。该e_loss是指根据网纹提取器提取的网纹位置和预设的标签值之间的误差所构建的误差函数,该误差函数能够有效反映网纹提取器提取出来的网纹位置和实际情况之间的误差,能够根据该误差构建的误差函数对网纹提取器中的网络参数进行误差反传,更新网纹提取器中的网络参数。由误差函数反传更新网络参数的方法采用的是梯度下降法,这里的梯度下降法不限于批量梯度下降法、小批量梯度下降法和随机梯度下降法。采用梯度下降法能够找到误差函数的最小值,得到最小化的误差函数,从而有效实现网纹提取器中网络参数的更新,使得更新网络参数后的网纹提取器提取网纹位置的效果更好。
需要说明的是,采用步骤S21-S24,根据该像素值提取网纹位置的方式更新网纹提取器是可以适用不同的网纹类型(网纹位置的类型)的,即在训练网纹提取器阶段可以将多种不同的网纹类型一同进行训练;并且在网纹提取阶段,可以通过网纹提取器直接提取任意类型的网纹位置,在提取网纹位置时不会有网纹类型的局限。
S30:将网纹位置和带网纹训练样本输入到生成式对抗网络生成器中,生成仿真图片,并基于仿真图片和不带网纹训练样本获取第二误差函数。
其中,生成式对抗网络(GAN,Generative Adversarial Networks),是一种深度学习模型,是复杂分布上无监督学习的方法之一。该模型通过框架中(至少)两个模块:生成模型(Generative Model)和判别模型(Discriminative Model)的互相博弈,学习产生与人们期望相当接近的输出。可以理解地,生成式对抗网络实际上就是根据生成模型和判别模型之间的博弈而不断地更新优化自身的模型(包括生成模型和判别模型),生成模型负责产生与训练样本高度相似的输出,判别模型则负责判别由生成模型生成的与训练样本高度相似的输出的真伪性,随着训练次数的增多,生成模型的“仿真”能力将会越强,产生的输出也会越接近训练样本,而判别模型的判别能力也会更强,能够识别由生成模块生成的高度“仿真”的输出,当最后判别模型判别的概率大概在50%时,代表此时判别模型已经不能分辨真伪(约等于瞎猜),此时生成模块生成的仿真样本已经与真实的训练样本相差无几了。仿真图片即生成式对抗网络生成器生成的图片,由生成式对抗网络生成器的特点即可得知。在一实施例中,生成式对抗网络生成器是指生成式对抗网络的生成模型。
在一实施例中,将网纹提取器提取的网纹位置和带网纹训练样本输入到生成式对抗网 络生成器(也是一个模型)中,生成式对抗网络生成器根据网纹位置和带网纹训练样本生成相对应的仿真图片。具体地,生成式对抗网络生成器通过生成器中的网络参数(权值和偏置)对输入的网纹位置和带网纹训练样本进行处理,计算得到仿真图片。由于仿真图片是生成的,故只是最大程度地去模拟、近似不带网纹训练样本的“模样”。获取仿真图片后,根据仿真图片与不带网纹训练样本(即实际情况,在这里起的是标签作用)获取第二误差函数(即l_loss)。l_loss是指根据生成式对抗网络生成器生成出来的仿真图片和实际情况(不带网纹训练样本)之间的误差所构建的误差函数。具体地,能够根据仿真图片和实际情况之间的误差构建的误差函数l_loss对生成式对抗网络生成器中的网络参数进行误差反传,更新生成式对抗网络生成器的网络参数。
在一具体实施方式中,步骤S30中,将网纹位置和带网纹训练样本输入到生成式对抗网络生成器中,生成仿真图片,并基于仿真图片和不带网纹训练样本获取l_loss,具体包括:l_loss的计算公式为
Figure PCTCN2018092569-appb-000004
其中,n为像素值个数,x i表示仿真图片的第i个像素值,y i表示不带网纹训练样本与x i相对应的第i个像素值。优选地,为了便于计算,这里的x i和y i各自代表的像素值都是经过归一化处理后才进行误差函数的运算,能够有效简化计算并且加快去网纹系统的训练过程。
S40:将仿真图片和不带网纹训练样本输入到生成式对抗网络判别器中,获取判别结果,并根据判别结果获取第三误差函数和第四误差函数。
在一实施例中,将仿真图片和不带网纹训练样本输入到生成式对抗网络判别器中,获取判别结果。其中,该生成式对抗网络判别器是与生成式对抗网络生成器相对应的一种网络模型,用于判别生成式对抗网络生成器的生成的仿真图片的真伪。即生成式对抗网络判别器是指生成式对抗网络的判别模型。根据生成式对抗网络判别器的判别结果获取第三误差函数(即gan_g_loss)和第四误差函数(即gan_d_loss),gan_g_loss是反映生成式对抗网络生成器生成仿真图片的误差函数,能够根据该误差函数对生成式对抗网络生成器中的网络参数进行误差反传,更新网络参数;gan_d_loss是反映生成式对抗网络判别器判别仿真图片的误差函数,能够根据该误差函数对生成式对抗网络判别器中的网络参数进行误差反传,更新生成式对抗网络判别器中的网络参数。
在一具体实施方式中,步骤S40中,将仿真图片和不带网纹训练样本输入到生成式对抗网络判别器中,获取判别结果,并根据判别结果获取gan_g_loss和gan_d_loss,具体包括:生成式对抗网络判别器输出的判别结果为D(G(X))和D(Y),X表示生成式对抗网络生成器的输入,X由n个x i组成,x i表示生成式对抗网络生成器输入的第i个像素值,G(X)表示生成式对抗网络生成器的输出,D(G(X))表示生成式对抗网络生成器的输出(即仿真图片,作为生成式对抗网络判别器的输入)在生成式对抗网络判别器(进行判别后)的输出,Y表示不带网纹训练样本在生成式对抗网络判别器的输入,Y由n个y i组成,y i表示不带网纹训练样本输入到生成式对抗网络判别器的第i个像素值,D(Y)表示不带网纹训练样本在生成式对抗网络判别器的输出。gan_g_loss的计算公式为
Figure PCTCN2018092569-appb-000005
其中,gan_g_loss是描述生成式对抗网络判别器在对 生成式对抗网络生成器的输出判别时出现误差的误差函数。gan_d_loss的计算公式为
Figure PCTCN2018092569-appb-000006
其中,gan_d_loss是描述生成式对抗网络判别器在对不带网纹训练样本判别时出现误差的误差函数。优选地,步骤S40中的像素值都是经过归一化处理后才进行误差函数的运算,能够有效简化计算并且加快去网纹系统的训练过程。
S50:采用预先训练好的人脸识别模型提取仿真图片的特征A和不带网纹训练样本的特征B,根据特征A和特征B获取第五误差函数。
其中,人脸识别模型是预先训练好的,该人脸识别模型可以采用开源的人脸集进行训练获取。
在一实施例中,采用预先训练好的人脸识别模型提取仿真图片的特征A和不带网纹训练样本(实际情况)的特征B,并根据特征A和特征B获取相对应的第五误差函数(即i_loss)。可以理解地,通过人脸识别模型提取仿真图片的特征A和不带网纹训练样本的特征B,并根据特征A和特征B构建的误差函数i_loss能够反映仿真图片和不带网纹训练样本在细微特征上的相似程度,借助人脸识别模型提取的细微特征可反映出仿真图片和不带网纹训练样本之间的特征差异,根据该差异可以构建合适的误差函数i_loss,并根据i_loss更新生成式对抗网络生成器中的网络参数和生成式对抗网络判别器中的网络参数,使得生成式对抗网络生成器生成的仿真图片越“真”,生成式对抗网络判别器的判别能力越“强”(因为仿真图片在生成式对抗网络判别器中是作为输入,也产生了误差,因此i_loss也可以更新生成式对抗网络判别器中的网络参数)。
在一具体实施方式中,如图4所示,步骤S50中,采用预先训练好的人脸识别模型提取仿真图片的特征A和不带网纹训练样本的特征B,根据特征A和特征B获取i_loss,包括如下步骤:
S51:将仿真图片输入到预先训练好的人脸识别模型,提取特征A。
在一实施例中,人脸识别模型提取仿真图片的特征是通过将仿真图片输入到人脸识别模型,由该预先训练好的人脸识别模型提取仿真图片中拥有的特征,该特征取为特征A,该特征A具体可以是指由预先训练好的人脸识别模型提取仿真图片中的每一像素值。
S52:将不带网纹训练样本输入到预先训练好的人脸识别模型,提取特征B。
在一实施例中,人脸识别模型提取不带网纹训练样本的特征是通过将不带网纹训练样本输入到人脸识别模型,由该预先训练好的人脸识别模型提取不带网纹训练样本中拥有的特征,该特征取为特征B,该特征B具体可以是指由预先训练好的人脸识别模型提取仿真图片中的与特征A相对应的每一像素值。
S53:计算特征A和特征B的欧式距离,获取第五误差函数,第五误差函数的计算公式为
Figure PCTCN2018092569-appb-000007
其中,n为像素值个数,a i表示特征A中的第i个像素值,b i表示特征B中的第i个像素值。
在一实施例中,采用欧式距离作为特征A和特征B的误差函数,该误差函数能够很好地描述特征A和特征B的差异,根据该差异构建的误差函数i_loss能够反传更新生成式对抗网络生成器中的网络参数和生成式对抗网络判别器中的网络参数,使得生成的仿真图片达到与不带网纹训练样本几乎相同的效果。优选地,a i和b i各自代表的的像素值都是经过归一化处理后才进行误差函数的运算,能够有效简化计算并且加快去网纹系统的训练过程。
S60:获取第六误差函数,根据第六误差函数更新生成式对抗网络生成器中的网络参数,其中,第六误差函数=第二误差函数+第三误差函数+第五误差函数。
其中,第六误差函数(即g_loss)是更新生成式对抗网络生成器中的网络参数最终采用的误差函数。
在一实施例中,获取g_loss,g_loss=l_loss+gan_g_loss+i_loss。可以理解地,l_loss反映的是生成式对抗网络生成器生成出来的仿真图片和实际情况(不带网纹训练样本)之间的误差;gan_g_loss反映的是生成式对抗网络生成器生成仿真图片在生成式对抗网络判别器进行判别时的误差(该误差体现在仿真图片作为生成式网络判别器的输入,与l_loss是不同的误差);i_loss反映的是仿真图片和不带网纹训练样本之间的特征差异(即误差)。这3个不同维度意义上的误差函数都能够反映生成式对抗网络生成器生成出来的仿真图片的误差,因此,这3个误差函数都可以用于更新生成式对抗网络生成器中的网络参数。由于这3个误差函数代表的是不同维度意义上的误差函数,因此将l_loss、gan_g_loss和i_loss结合起来能够达到非常优异的训练效果,更新网络参数后的生成式对抗网络生成器生成的图片几乎与不带网纹训练样本相同,能够达到“以假乱真”的效果。需要说明的是,g_loss=l_loss+gan_g_loss+i_loss中的算术符号“+”是指算术相加。由误差函数反传更新网络参数的方法采用的是梯度下降法,这里的梯度下降法不限于批量梯度下降法、小批量梯度下降法和随机梯度下降法。
S70:获取第七误差函数,根据第七误差函数更新生成式对抗网络判别器中的网络参数,其中,第七误差函数=第四误差函数+第五误差函数。
其中,第七误差函数(即d_loss)是更新生成式对抗网络判别器中的网络参数最终采用的误差函数。在一实施例中,获取d_loss,d_loss=gan_d_loss+i_loss。可以理解地,gan_d_loss反映的是生成式对抗网络判别器在对不带网纹训练样本判别时出现的误差。i_loss反映的是仿真图片和不带网纹训练样本之间在人脸识别模型分别提取的特征所存在的误差,该误差可通过仿真图片和不带网纹训练样本作为生成式对抗网络判别器的输入时体现出来。这两个不同维度意义上的误差函数都能够反映生成式对抗网络判别器在判别时,得出判别结果的误差,因此,这两个误差函数都可以用于更新生成式对抗网络判别器中的网络参数。由于这两个误差函数倒闭的是不同维度意义上的误差函数,因此将gan_d_loss和i_loss结合起来能够达到非常优异的训练效果,使得更新后的生成式对抗网络判别器的判别能力更强,进一步地提高生成式对抗网络生成器生成仿真图片的能力,直至生成式对抗判别网络处于瞎猜阶段(判别概率为50%),使得生成式对抗网络生成器生成的仿真图片与不带网纹的训练样本达到难以区分的效果。需要说明的是,d_loss=gan_d_loss+i_loss中的算术符号“+”是指算术相加。由误差函数反传更新网络参数的方法采用的是梯度下降法,这里的梯度下降法不限于批量梯度下降法、小批量梯度下降法和随机梯度下降法。
本实施例所提供的去网纹系统训练方法中,基于网纹位置和预设的标签值获取e_loss,根据e_loss反向更新网纹提取器的网络参数,使得根据e_loss更新后的网纹提取器在提取带网纹训练样本和不带网纹训练样本数据的网纹位置更为精确,提高后续去网纹系统训练的精确度。基于仿真图片和不带网纹训练样本获取l_loss,根据判别结果获取gan_g_loss和gan_d_loss,根据特征A和特征B获取i_loss,并基于生成式对抗网络的特点(包括生成式对抗网络生成器和生成式对抗网络判别器)根据l_loss、gan_g_loss、gan_g_loss和i_loss获取生成式对抗网络生成器的误差函数g_loss和生成式对抗网络判别器的误差函数d_loss,通过在训练去网纹系统中各部分模型产生的误差,由多维度上的不同误差函数构造相对应的误差函数,并将多个维度上的误差函数相加后,根据生成式对抗网络生成器和生成式对抗网络判别器最终分别采用的误差函数,反传更新去网络系统中各部分模型的网络参数,实现去网纹系统的充分有效训练。该去网纹系统涵盖了去网纹系 统训练过程中每一影响去网纹系统去网纹效果的因素,每一因素反映了各自维度上可能存在的误差,根据误差构建适宜的误差函数并反传更新网络参数,训练整个去网纹系统,使得该去网纹系统对图片进行去网纹操作时能够达到非常优异的效果。
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
图5示出与实施例中去网纹系统训练方法一一对应的去网纹系统训练装置的原理框图。如图5所示,该去网纹系统训练装置包括训练样本获取模块10、第一误差函数获取模块20、第二误差函数获取模块30、判别结果获取模块40、第五误差函数获取模块50、第六误差函数获取模块60和第七误差函数获取模块70。其中,训练样本获取模块10、第一误差函数获取模块20、第二误差函数获取模块30、判别结果获取模块40、第五误差函数获取模块50、第六误差函数获取模块60和第七误差函数获取模块70的实现功能与实施例中去网纹系统训练方法对应的步骤一一对应,为避免赘述,本实施例不一一详述。
训练样本获取模块10,用于提取待训练样本,待训练样本包括样本数量相等的带网纹训练样本和不带网纹训练样本。
第一误差函数获取模块20,用于将带网纹训练样本输入到网纹提取器中,提取网纹位置,基于网纹位置和预设的标签值获取第一误差函数,并根据第一误差函数更新网纹提取器的网络参数。
第二误差函数获取模块30,用于将网纹位置和带网纹训练样本输入到生成式对抗网络生成器中,生成仿真图片,并基于仿真图片和不带网纹训练样本获取第二误差函数。
判别结果获取模块40,用于将仿真图片和不带网纹训练样本输入到生成式对抗网络判别器中,获取判别结果,并根据判别结果获取第三误差函数和第四误差函数。
第五误差函数获取模块50,用于采用预先训练好的人脸识别模型提取仿真图片的特征A和不带网纹训练样本的特征B,根据特征A和特征B获取第五误差函数。
第六误差函数获取模块60,用于获取第六误差函数,根据第六误差函数更新生成式对抗网络生成器中的网络参数,其中,第六误差函数=第二误差函数+第三误差函数+第五误差函数。
第七误差函数获取模块70,用于获取第七误差函数,根据第七误差函数更新生成式对抗网络判别器中的网络参数,其中,第七误差函数=第四误差函数+第五误差函数。
优选地,第一误差函数获取模块20包括归一化单元21、像素差获取单元22、网纹位置二值化单元23和第一误差函数获取单元24。
归一化单元21,用于获取网纹位置的每一像素值,将每一像素值进行归一化处理,获取归一化像素值;其中,获取归一化像素值的公式为
Figure PCTCN2018092569-appb-000008
MaxValue表示网纹位置的所有像素值中的最大值,MinValue表示网纹位置的所有像素值中的最小值,x为每一像素值,y为归一化像素值。
像素差获取单元22,用于获取网纹位置的归一化像素值和对应的不带网纹训练样本的归一化像素值的像素差。
网纹位置二值化单元23,用于若像素差大于预设分界值,则将网纹位置对应的归一化像素值取作1,若像素差不大于预设分界值,则将网纹位置对应的归一化像素值取作0,获取二值化网纹位置。
第一误差函数获取单元24,用于根据二值化网纹位置的每一像素值和预设的标签值对应的每一像素值进行计算,获取第一误差函数,并根据第一误差函数更新网纹提取器的网络参数;其中,第一误差函数的计算公式为
Figure PCTCN2018092569-appb-000009
其 中,n为像素值个数,x i表示二值化网纹位置的第i个像素值,y i表示预设的标签值与x i相对应的第i个像素值。
优选地,第二误差函数的计算公式为
Figure PCTCN2018092569-appb-000010
其中,n为像素值个数,x i表示仿真图片的第i个像素值,y i表示不带网纹训练样本与x i相对应的第i个像素值。
优选地,判别结果为D(G(X))和D(Y),X表示生成式对抗网络生成器的输入,X由n个x i组成,x i表示生成式对抗网络生成器输入的第i个像素值,G(X)表示生成式对抗网络生成器的输出,D(G(X))表示生成式对抗网络生成器的输出在生成式对抗网络判别器的输出,Y表示不带网纹训练样本在生成式对抗网络判别器的输入,Y由n个y i组成,y i表示不带网纹训练样本输入到生成式对抗网络判别器的第i个像素值,D(Y)表示不带网纹训练样本在生成式对抗网络判别器的输出;
第三误差函数的计算公式为
Figure PCTCN2018092569-appb-000011
第四误差函数的计算公式为
Figure PCTCN2018092569-appb-000012
优选地,第五误差函数获取模块50包括特征A提取单元51、特征B提取单元52和第五误差函数获取单元53。
特征A提取单元51,用于将仿真图片输入到预先训练好的人脸识别模型,提取特征A;
特征B提取单元52,用于将不带网纹训练样本输入到预先训练好的人脸识别模型,提取特征B;
第五误差函数获取单元53,用于计算特征A和特征B的欧式距离,获取第五误差函数,第五误差函数的计算公式为
Figure PCTCN2018092569-appb-000013
其中,n为像素值个数,a i表示特征A中的第i个像素值,b i表示特征B中的第i个像素值。
图6示出在一实施例中去网纹方法的一流程图。该去网纹方法可应用在银行、证券、投资和保险等金融机构或者需进行图片去网纹的其他机构的计算机设备上,以便对带有网纹的图片进行去网纹处理,达到人工智能目的。其中,该计算机设备是可与用户进行人机交互的设备,包括但不限于电脑、智能手机和平板等设备。如图6所示,该去网纹方法包括如下步骤:
S80:将待去网纹图片输入到网纹提取器中,提取待去网纹图片的网纹位置,网纹提取器是采用实施例中去网纹系统训练方法获取的第一误差函数更新网纹提取器的网络参数后得到的。
其中,待去网纹图片是指待进行去网纹处理的目标图片。
在一实施例中,将待去网纹图片输入到网纹提取器中,并由网纹提取器提取待去网纹图片的网纹位置,为后续根据该网纹位置生成目标去网纹图片提供了技术前提。采用实施 例中去网纹系统训练方法获取的第一误差函数更新网纹提取器的网络参数后形成的网纹提取器能够精确地提取待去网纹图片的网纹位置,有效提高网纹提取的精确性。
S90:将待去网纹图片的网纹位置和待去网纹图片输入到生成式对抗网络生成器中,生成目标去网纹图片,生成式对抗网络生成器是采用实施例中去网纹系统训练方法获取的第六误差函数更新生成式对抗网络生成器的网络参数后得到的。
其中,目标去网纹图片是指由待去网纹图片经去网纹处理后获取的目标图片。
在一实施例中,将由网纹提取器在待去网纹图片中提取的网纹位置和待去网纹图片一同输入到生成式对抗网络生成器中,由生成式对抗网络生成器根据网纹位置去掉待去网纹图片中的网纹,生成目标去网纹图片。采用实施例中去网纹系统训练方法获取的第六误差函数更新生成式对抗网络生成器的网络参数后形成的生成式对抗网络生成器精确去除了待去网纹图片中的网纹,能够有效提高去网纹效果。
本实施例所提供的去网纹方法中,先通过网纹提取器提取待去网纹图片的网纹位置,采用实施例中去网纹系统训练方法获取的第一误差函数更新网纹提取器的网络参数后形成的网纹提取器能够精确地提取待去网纹图片的网纹位置,有效提高网纹提取的精确性,再通过生成式对抗网络生成器根据网纹位置去掉待去网纹图片中的网纹,生成目标去网纹图片,采用实施例中去网纹系统训练方法获取的第六误差函数更新生成式对抗网络生成器的网络参数后形成的生成式对抗网络生成器精确去除了待去网纹图片中的网纹,能够有效提高去网纹效果,采用该去网纹方法生成的目标去网纹图片与没加网纹之前对应的图片几乎没有区别,能够实现非常好的去网纹效果。
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
图7示出与实施例中去网纹方法一一对应的去网纹装置的原理框图。如图7所示,该去网纹装置包括网纹位置提取模块80和目标去网纹图片生成模块90。其中,网纹位置提取模块80和目标去网纹图片生成模块90的实现功能与实施例中去网纹方法对应的步骤一一对应,为避免赘述,本实施例不一一详述。
网纹位置提取模块80,用于将待去网纹图片输入到网纹提取器中,提取待去网纹图片的网纹位置,网纹提取器是采用实施例中去网纹系统训练方法获取的第一误差函数更新网纹提取器的网络参数后得到的。
目标去网纹图片生成模块90,用于将待去网纹图片的网纹位置和待去网纹图片输入到生成式对抗网络生成器中,生成目标去网纹图片,生成式对抗网络生成器是采用实施例中去网纹系统训练方法获取的第六误差函数更新生成式对抗网络生成器的网络参数后得到的。
本实施例提供一计算机可读存储介质,该计算机可读存储介质上存储有计算机可读指令,该计算机可读指令被处理器执行时实现实施例中去网纹系统训练方法,为避免重复,这里不再赘述。或者,该计算机可读指令被处理器执行时实现实施例中去网纹系统训练装置的各模块/单元的功能,为避免重复,这里不再赘述。或者,该计算机可读指令被处理器执行时实现实施例中去网纹方法中各步骤的功能,为避免重复,此处不一一赘述。或者,该计算机可读指令被处理器执行时实现实施例中去网纹装置中各模块/单元的功能,为避免重复,此处不一一赘述。
图8是本申请一实施例提供的计算机设备的示意图。如图8所示,该实施例的计算机设备100包括:处理器101、存储器102以及存储在存储器102中并可在处理器101上运行的计算机可读指令103,该计算机可读指令103被处理器101执行时实现实施例中的去网纹系统训练方法,为避免重复,此处不一一赘述。或者,该计算机可读指令103被处理器101执行时实现实施例中去网纹系统训练装置中各模型/单元的功能,为避免重复,此处不一一赘述。或者,该计算机可读指令103被处理器101执行时实现实施例中去网纹方 法中各步骤的功能,为避免重复,此处不一一赘述。或者,该计算机可读指令103被处理器101执行时实现实施例中去网纹装置中各模块/单元的功能。为避免重复,此处不一一赘述。
示例性的,计算机可读指令103可以被分割成一个或多个模块/单元,一个或者多个模块/单元被存储在存储器102中,并由处理器101执行,以完成本申请。一个或多个模块/单元可以是能够完成特定功能的一系列计算机可读指令103的指令段,该指令段用于描述计算机可读指令103在计算机设备100中的执行过程。例如,计算机可读指令103可被分割成实施例中的训练样本获取模块10、第一误差函数获取模块20、第二误差函数获取模块30、判别结果获取模块40、第五误差函数获取模块50、第六误差函数获取模块60和第七误差函数获取模块100,或者实施例中的网纹位置提取模块80和目标去网纹图片生成模块90,各模块的具体功能如实施例所示,为避免重复,此处不一一赘述。
计算机设备100可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。计算机设备可包括,但不仅限于,处理器101、存储器102。本领域技术人员可以理解,图8仅仅是计算机设备100的示例,并不构成对计算机设备100的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如计算机设备还可以包括输入输出设备、网络接入设备、总线等。
所称处理器101可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
存储器102可以是计算机设备100的内部存储单元,例如计算机设备100的硬盘或内存。存储器102也可以是计算机设备100的外部存储设备,例如计算机设备100上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,存储器102还可以既包括计算机设备100的内部存储单元也包括外部存储设备。存储器102用于存储计算机可读指令103以及计算机设备所需的其他程序和数据。存储器102还可以用于暂时地存储已经输出或者将要输出的数据。
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。

Claims (20)

  1. 一种去网纹系统训练方法,其特征在于,包括:
    提取待训练样本,所述待训练样本包括样本数量相等的带网纹训练样本和不带网纹训练样本;
    将所述带网纹训练样本输入到网纹提取器中,提取网纹位置,基于所述网纹位置和预设的标签值获取第一误差函数,并根据所述第一误差函数更新网纹提取器的网络参数;
    将所述网纹位置和所述带网纹训练样本输入到生成式对抗网络生成器中,生成仿真图片,并基于所述仿真图片和所述不带网纹训练样本获取第二误差函数;
    将所述仿真图片和所述不带网纹训练样本输入到生成式对抗网络判别器中,获取判别结果,并根据所述判别结果获取第三误差函数和第四误差函数;
    采用预先训练好的人脸识别模型提取所述仿真图片的特征A和所述不带网纹训练样本的特征B,根据所述特征A和所述特征B获取第五误差函数;
    获取第六误差函数,根据所述第六误差函数更新生成式对抗网络生成器中的网络参数,其中,第六误差函数=第二误差函数+第三误差函数+第五误差函数;
    获取第七误差函数,根据所述第七误差函数更新生成式对抗网络判别器中的网络参数,其中,第七误差函数=第四误差函数+第五误差函数。
  2. 根据权利要求1所述的去网纹系统训练方法,其特征在于,所述基于所述网纹位置和预设的标签值获取第一误差函数,并根据所述第一误差函数更新网纹提取器的网络参数,包括:
    获取所述网纹位置的每一像素值,将每一所述像素值进行归一化处理,获取归一化像素值;其中,获取归一化像素值的公式为
    Figure PCTCN2018092569-appb-100001
    MaxValue表示所述网纹位置的所有像素值中的最大值,MinValue表示所述网纹位置的所有像素值中的最小值,x为每一像素值,y为归一化像素值;
    获取所述网纹位置的归一化像素值和对应的不带网纹训练样本的归一化像素值的像素差;
    若所述像素差大于预设分界值,则将所述网纹位置对应的所述归一化像素值取作1,若所述像素差不大于所述预设分界值,则将所述网纹位置对应的所述归一化像素值取作0,获取二值化网纹位置;
    根据所述二值化网纹位置的每一像素值和预设的标签值对应的每一像素值进行计算,获取第一误差函数,并根据所述第一误差函数更新网纹提取器的网络参数;其中第一误差函数的计算公式为
    Figure PCTCN2018092569-appb-100002
    其中,n为像素值个数,x i表示所述二值化网纹位置的第i个像素值,y i表示预设的标签值与所述x i相对应的第i个像素值。
  3. 根据权利要求1所述的去网纹系统训练方法,其特征在于,第二误差函数的计算公式为
    Figure PCTCN2018092569-appb-100003
    其中,n为像素值个数,x i表示所述仿真图片的第i个像素值,y i表示所述不带网纹训练样本与所述x i相对应的第i个像素值。
  4. 根据权利要求1所述的去网纹系统训练方法,其特征在于,所述判别结果为D(G (X))和D(Y),X表示所述生成式对抗网络生成器的输入,X由n个x i组成,x i表示生成式对抗网络生成器输入的第i个像素值,G(X)表示所述生成式对抗网络生成器的输出,D(G(X))表示所述生成式对抗网络生成器的输出在所述生成式对抗网络判别器的输出,Y表示所述不带网纹训练样本在所述生成式对抗网络判别器的输入,Y由n个y i组成,y i表示所述不带网纹训练样本输入到所述生成式对抗网络判别器的第i个像素值,D(Y)表示所述不带网纹训练样本在所述生成式对抗网络判别器的输出;
    所述第三误差函数的计算公式为
    Figure PCTCN2018092569-appb-100004
    所述第四误差函数的计算公式为
    Figure PCTCN2018092569-appb-100005
  5. 根据权利要求1所述的去网纹系统训练方法,其特征在于,所述采用预先训练好的人脸识别模型提取所述仿真图片的特征A和所述不带网纹训练样本的特征B,根据所述特征A和所述特征B获取第五误差函数,包括:
    将所述仿真图片输入到预先训练好的所述人脸识别模型,提取特征A;
    将所述不带网纹训练样本输入到预先训练好的所述人脸识别模型,提取特征B;
    计算所述特征A和所述特征B的欧式距离,获取第五误差函数,所述第五误差函数的计算公式为
    Figure PCTCN2018092569-appb-100006
    其中,n为像素值个数,a i表示所述特征A中的第i个像素值,b i表示所述特征B中的第i个像素值。
  6. 一种去网纹方法,其特征在于,包括:
    将待去网纹图片输入到网纹提取器中,提取所述待去网纹图片的网纹位置;所述网纹提取器是采用权利要求1-5任一项所述去网纹系统训练方法根据第一误差函数更新网纹提取器的网络参数获取到的;
    将所述待去网纹图片的网纹位置和所述待去网纹图片输入到生成式对抗网络生成器中,生成目标去网纹图片;所述生成式对抗网络生成器是采用权利要求1-5任一项所述去网纹系统训练方法根据第六误差函数更新生成式对抗网络生成器的网络参数获取到的。
  7. 一种去网纹系统训练装置,其特征在于,包括:
    训练样本获取模块,用于提取待训练样本,所述待训练样本包括样本数量相等的带网纹训练样本和不带网纹训练样本;
    第一误差函数获取模块,用于将所述带网纹训练样本输入到网纹提取器中,提取网纹位置,基于所述网纹位置和预设的标签值获取第一误差函数,并根据所述第一误差函数更新网纹提取器的网络参数;
    第二误差函数获取模块,用于将所述网纹位置和所述带网纹训练样本输入到生成式对抗网络生成器中,生成仿真图片,并基于所述仿真图片和所述不带网纹训练样本获取第二误差函数;
    判别结果获取模块,用于将所述仿真图片和所述不带网纹训练样本输入到生成式对抗网络判别器中,获取判别结果,并根据所述判别结果获取第三误差函数和第四误差函数;
    第五误差函数获取模块,用于采用预先训练好的人脸识别模型提取所述仿真图片的特征A和所述不带网纹训练样本的特征B,根据所述特征A和所述特征B获取第五误差函数;
    第六误差函数获取模块,用于获取第六误差函数,根据所述第六误差函数更新生成式对抗网络生成器中的网络参数,其中,第六误差函数=第二误差函数+第三误差函数+第五误差函数;
    第七误差函数获取模块,用于获取第七误差函数,根据所述第七误差函数更新生成式对抗网络判别器中的网络参数,其中,第七误差函数=第四误差函数+第五误差函数。
  8. 一种去网纹装置,其特征在于,包括:
    网纹位置提取模块,用于将待去网纹图片输入到网纹提取器中,提取所述待去网纹图片的网纹位置,所述网纹提取器是采用权利要求1-5任一项所述去网纹系统训练方法根据第一误差函数更新网纹提取器的网络参数获取到的;
    目标去网纹图片生成模块,用于将所述待去网纹图片的网纹位置和所述待去网纹图片输入到生成式对抗网络生成器中,生成目标去网纹图片,所述生成式对抗网络生成器是采用权利要求1-5任一项所述去网纹系统训练方法根据第六误差函数更新生成式对抗网络生成器的网络参数获取到的。
  9. 一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,其特征在于,所述处理器执行所述计算机可读指令时实现如下步骤:
    提取待训练样本,所述待训练样本包括样本数量相等的带网纹训练样本和不带网纹训练样本;
    将所述带网纹训练样本输入到网纹提取器中,提取网纹位置,基于所述网纹位置和预设的标签值获取第一误差函数,并根据所述第一误差函数更新网纹提取器的网络参数;
    将所述网纹位置和所述带网纹训练样本输入到生成式对抗网络生成器中,生成仿真图片,并基于所述仿真图片和所述不带网纹训练样本获取第二误差函数;
    将所述仿真图片和所述不带网纹训练样本输入到生成式对抗网络判别器中,获取判别结果,并根据所述判别结果获取第三误差函数和第四误差函数;
    采用预先训练好的人脸识别模型提取所述仿真图片的特征A和所述不带网纹训练样本的特征B,根据所述特征A和所述特征B获取第五误差函数;
    获取第六误差函数,根据所述第六误差函数更新生成式对抗网络生成器中的网络参数,其中,第六误差函数=第二误差函数+第三误差函数+第五误差函数;
    获取第七误差函数,根据所述第七误差函数更新生成式对抗网络判别器中的网络参数,其中,第七误差函数=第四误差函数+第五误差函数。
  10. 根据权利要求9所述的计算机设备,其特征在于,所述处理器执行所述计算机可读指令时实现如下步骤:
    获取所述网纹位置的每一像素值,将每一所述像素值进行归一化处理,获取归一化像素值;其中,获取归一化像素值的公式为
    Figure PCTCN2018092569-appb-100007
    MaxValue表示所述网纹位置的所有像素值中的最大值,MinValue表示所述网纹位置的所有像素值中的最小值,x为每一像素值,y为归一化像素值;
    获取所述网纹位置的归一化像素值和对应的不带网纹训练样本的归一化像素值的像素差;
    若所述像素差大于预设分界值,则将所述网纹位置对应的所述归一化像素值取作1,若所述像素差不大于所述预设分界值,则将所述网纹位置对应的所述归一化像素值取作0,获取二值化网纹位置;
    根据所述二值化网纹位置的每一像素值和预设的标签值对应的每一像素值进行计算,获取第一误差函数,并根据所述第一误差函数更新网纹提取器的网络参数;其中第一误差 函数的计算公式为
    Figure PCTCN2018092569-appb-100008
    其中,n为像素值个数,x i表示所述二值化网纹位置的第i个像素值,y i表示预设的标签值与所述x i相对应的第i个像素值。
  11. 根据权利要求9所述的计算机设备,其特征在于,第二误差函数的计算公式为
    Figure PCTCN2018092569-appb-100009
    其中,n为像素值个数,x i表示所述仿真图片的第i个像素值,y i表示所述不带网纹训练样本与所述x i相对应的第i个像素值。
  12. 根据权利要求9所述的计算机设备,其特征在于,所述判别结果为D(G(X))和D(Y),X表示所述生成式对抗网络生成器的输入,X由n个x i组成,x i表示生成式对抗网络生成器输入的第i个像素值,G(X)表示所述生成式对抗网络生成器的输出,D(G(X))表示所述生成式对抗网络生成器的输出在所述生成式对抗网络判别器的输出,Y表示所述不带网纹训练样本在所述生成式对抗网络判别器的输入,Y由n个y i组成,y i表示所述不带网纹训练样本输入到所述生成式对抗网络判别器的第i个像素值,D(Y)表示所述不带网纹训练样本在所述生成式对抗网络判别器的输出;
    所述第三误差函数的计算公式为
    Figure PCTCN2018092569-appb-100010
    所述第四误差函数的计算公式为
    Figure PCTCN2018092569-appb-100011
  13. 根据权利要求9所述的计算机设备,其特征在于,所述处理器执行所述计算机可读指令时实现如下步骤:
    将所述仿真图片输入到预先训练好的所述人脸识别模型,提取特征A;
    将所述不带网纹训练样本输入到预先训练好的所述人脸识别模型,提取特征B;
    计算所述特征A和所述特征B的欧式距离,获取第五误差函数,所述第五误差函数的计算公式为
    Figure PCTCN2018092569-appb-100012
    其中,n为像素值个数,a i表示所述特征A中的第i个像素值,b i表示所述特征B中的第i个像素值。
  14. 一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,其特征在于,所述处理器执行所述计算机可读指令时实现如下步骤:
    将待去网纹图片输入到网纹提取器中,提取所述待去网纹图片的网纹位置;所述网纹提取器是采用权利要求1-5任一项所述去网纹系统训练方法根据第一误差函数更新网纹提取器的网络参数获取到的;
    将所述待去网纹图片的网纹位置和所述待去网纹图片输入到生成式对抗网络生成器中,生成目标去网纹图片;所述生成式对抗网络生成器是采用权利要求1-5任一项所述去 网纹系统训练方法根据第六误差函数更新生成式对抗网络生成器的网络参数获取到的。
  15. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可读指令,其特征在于,所述计算机可读指令被处理器执行时实现如下步骤:
    提取待训练样本,所述待训练样本包括样本数量相等的带网纹训练样本和不带网纹训练样本;
    将所述带网纹训练样本输入到网纹提取器中,提取网纹位置,基于所述网纹位置和预设的标签值获取第一误差函数,并根据所述第一误差函数更新网纹提取器的网络参数;
    将所述网纹位置和所述带网纹训练样本输入到生成式对抗网络生成器中,生成仿真图片,并基于所述仿真图片和所述不带网纹训练样本获取第二误差函数;
    将所述仿真图片和所述不带网纹训练样本输入到生成式对抗网络判别器中,获取判别结果,并根据所述判别结果获取第三误差函数和第四误差函数;
    采用预先训练好的人脸识别模型提取所述仿真图片的特征A和所述不带网纹训练样本的特征B,根据所述特征A和所述特征B获取第五误差函数;
    获取第六误差函数,根据所述第六误差函数更新生成式对抗网络生成器中的网络参数,其中,第六误差函数=第二误差函数+第三误差函数+第五误差函数;
    获取第七误差函数,根据所述第七误差函数更新生成式对抗网络判别器中的网络参数,其中,第七误差函数=第四误差函数+第五误差函数。
  16. 根据权利要求15所述的计算机可读存储介质,其特征在于,所述计算机可读指令被处理器执行时实现如下步骤:
    获取所述网纹位置的每一像素值,将每一所述像素值进行归一化处理,获取归一化像素值;其中,获取归一化像素值的公式为
    Figure PCTCN2018092569-appb-100013
    MaxValue表示所述网纹位置的所有像素值中的最大值,MinValue表示所述网纹位置的所有像素值中的最小值,x为每一像素值,y为归一化像素值;
    获取所述网纹位置的归一化像素值和对应的不带网纹训练样本的归一化像素值的像素差;
    若所述像素差大于预设分界值,则将所述网纹位置对应的所述归一化像素值取作1,若所述像素差不大于所述预设分界值,则将所述网纹位置对应的所述归一化像素值取作0,获取二值化网纹位置;
    根据所述二值化网纹位置的每一像素值和预设的标签值对应的每一像素值进行计算,获取第一误差函数,并根据所述第一误差函数更新网纹提取器的网络参数;其中第一误差函数的计算公式为
    Figure PCTCN2018092569-appb-100014
    其中,n为像素值个数,x i表示所述二值化网纹位置的第i个像素值,y i表示预设的标签值与所述x i相对应的第i个像素值。
  17. 根据权利要求15所述的计算机可读存储介质,其特征在于,第二误差函数的计算公式为
    Figure PCTCN2018092569-appb-100015
    其中,n为像素值个数,x i表示所述仿真图片的第i个像素值,y i表示所述不带网纹训练样本与所述x i相对应的第i个像素值。
  18. 根据权利要求15所述的计算机可读存储介质,其特征在于,所述判别结果为D(G(X))和D(Y),X表示所述生成式对抗网络生成器的输入,X由n个x i组成,x i表示生 成式对抗网络生成器输入的第i个像素值,G(X)表示所述生成式对抗网络生成器的输出,D(G(X))表示所述生成式对抗网络生成器的输出在所述生成式对抗网络判别器的输出,Y表示所述不带网纹训练样本在所述生成式对抗网络判别器的输入,Y由n个y i组成,y i表示所述不带网纹训练样本输入到所述生成式对抗网络判别器的第i个像素值,D(Y)表示所述不带网纹训练样本在所述生成式对抗网络判别器的输出;
    所述第三误差函数的计算公式为
    Figure PCTCN2018092569-appb-100016
    所述第四误差函数的计算公式为
    Figure PCTCN2018092569-appb-100017
  19. 根据权利要求15所述的计算机可读存储介质,其特征在于,所述计算机可读指令被处理器执行时实现如下步骤:
    将所述仿真图片输入到预先训练好的所述人脸识别模型,提取特征A;
    将所述不带网纹训练样本输入到预先训练好的所述人脸识别模型,提取特征B;
    计算所述特征A和所述特征B的欧式距离,获取第五误差函数,所述第五误差函数的计算公式为
    Figure PCTCN2018092569-appb-100018
    其中,n为像素值个数,a i表示所述特征A中的第i个像素值,b i表示所述特征B中的第i个像素值。
  20. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可读指令,其特征在于,所述计算机可读指令被处理器执行时实现如下步骤:
    将待去网纹图片输入到网纹提取器中,提取所述待去网纹图片的网纹位置;所述网纹提取器是采用权利要求1-5任一项所述去网纹系统训练方法根据第一误差函数更新网纹提取器的网络参数获取到的;
    将所述待去网纹图片的网纹位置和所述待去网纹图片输入到生成式对抗网络生成器中,生成目标去网纹图片;所述生成式对抗网络生成器是采用权利要求1-5任一项所述去网纹系统训练方法根据第六误差函数更新生成式对抗网络生成器的网络参数获取到的。
PCT/CN2018/092569 2018-04-20 2018-06-25 去网纹系统训练方法、去网纹方法、装置、设备及介质 Ceased WO2019200702A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
US16/627,755 US20200125836A1 (en) 2018-04-20 2018-06-25 Training Method for Descreening System, Descreening Method, Device, Apparatus and Medium
SG11201913728SA SG11201913728SA (en) 2018-04-20 2018-06-25 Training method for descreening system, descreening method, device, apparatus and medium
JP2019563812A JP6812086B2 (ja) 2018-04-20 2018-06-25 網状パターン除去システムのトレーニング方法、網状パターン除去方法、装置、機器及び媒体

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810360251.9 2018-04-20
CN201810360251.9A CN108734673B (zh) 2018-04-20 2018-04-20 去网纹系统训练方法、去网纹方法、装置、设备及介质

Publications (1)

Publication Number Publication Date
WO2019200702A1 true WO2019200702A1 (zh) 2019-10-24

Family

ID=63939701

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/092569 Ceased WO2019200702A1 (zh) 2018-04-20 2018-06-25 去网纹系统训练方法、去网纹方法、装置、设备及介质

Country Status (5)

Country Link
US (1) US20200125836A1 (zh)
JP (1) JP6812086B2 (zh)
CN (1) CN108734673B (zh)
SG (1) SG11201913728SA (zh)
WO (1) WO2019200702A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111325317A (zh) * 2020-01-21 2020-06-23 北京空间机电研究所 一种基于生成对抗网络的波前像差确定方法及装置
CN112785495A (zh) * 2021-01-27 2021-05-11 驭势科技(南京)有限公司 图像处理模型训练方法、图像生成方法、装置和设备

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107103271A (zh) * 2016-02-23 2017-08-29 芋头科技(杭州)有限公司 一种人脸检测方法
KR102366777B1 (ko) * 2019-04-01 2022-02-24 한국전자통신연구원 도메인 적응 기반 객체 인식 장치 및 그 방법
CN110097130B (zh) * 2019-05-07 2022-12-13 深圳市腾讯计算机系统有限公司 分类任务模型的训练方法、装置、设备及存储介质
CN110175961B (zh) * 2019-05-22 2021-07-27 艾特城信息科技有限公司 一种基于人脸图像分割对抗思想的去网纹方法
CN110647805B (zh) * 2019-08-09 2023-10-31 平安科技(深圳)有限公司 一种网纹图像识别方法、装置及终端设备
CN110765843B (zh) * 2019-09-03 2023-09-22 平安科技(深圳)有限公司 人脸验证方法、装置、计算机设备及存储介质
CN112836701A (zh) * 2019-11-25 2021-05-25 中国移动通信集团浙江有限公司 人脸识别方法、装置及计算设备
CN111695605B (zh) * 2020-05-20 2024-05-10 平安科技(深圳)有限公司 基于oct图像的图像识别方法、服务器及存储介质
CN114882897B (zh) * 2022-05-13 2025-06-20 平安科技(深圳)有限公司 语音转换模型的训练及语音转换方法、装置和相关设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5777367B2 (ja) * 2011-03-29 2015-09-09 キヤノン株式会社 パターン識別装置、パターン識別方法及びプログラム
CN105760859A (zh) * 2016-03-22 2016-07-13 中国科学院自动化研究所 基于多任务卷积神经网络的网纹人脸图像识别方法及装置
CN105930797A (zh) * 2016-04-21 2016-09-07 腾讯科技(深圳)有限公司 一种人脸验证方法及装置
CN106548159A (zh) * 2016-11-08 2017-03-29 中国科学院自动化研究所 基于全卷积神经网络的网纹人脸图像识别方法与装置

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106203333A (zh) * 2016-07-08 2016-12-07 乐视控股(北京)有限公司 人脸识别方法及系统
CN107766844A (zh) * 2017-11-13 2018-03-06 杭州有盾网络科技有限公司 一种网纹照人脸识别的方法、装置、设备

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5777367B2 (ja) * 2011-03-29 2015-09-09 キヤノン株式会社 パターン識別装置、パターン識別方法及びプログラム
CN105760859A (zh) * 2016-03-22 2016-07-13 中国科学院自动化研究所 基于多任务卷积神经网络的网纹人脸图像识别方法及装置
CN105930797A (zh) * 2016-04-21 2016-09-07 腾讯科技(深圳)有限公司 一种人脸验证方法及装置
CN106548159A (zh) * 2016-11-08 2017-03-29 中国科学院自动化研究所 基于全卷积神经网络的网纹人脸图像识别方法与装置

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111325317A (zh) * 2020-01-21 2020-06-23 北京空间机电研究所 一种基于生成对抗网络的波前像差确定方法及装置
CN111325317B (zh) * 2020-01-21 2023-12-12 北京空间机电研究所 一种基于生成对抗网络的波前像差确定方法及装置
CN112785495A (zh) * 2021-01-27 2021-05-11 驭势科技(南京)有限公司 图像处理模型训练方法、图像生成方法、装置和设备

Also Published As

Publication number Publication date
SG11201913728SA (en) 2020-01-30
JP6812086B2 (ja) 2021-01-13
JP2020522780A (ja) 2020-07-30
CN108734673B (zh) 2019-11-15
US20200125836A1 (en) 2020-04-23
CN108734673A (zh) 2018-11-02

Similar Documents

Publication Publication Date Title
WO2019200702A1 (zh) 去网纹系统训练方法、去网纹方法、装置、设备及介质
WO2021077984A1 (zh) 对象识别方法、装置、电子设备及可读存储介质
US8792722B2 (en) Hand gesture detection
CN111695392B (zh) 基于级联的深层卷积神经网络的人脸识别方法及系统
US20120027263A1 (en) Hand gesture detection
WO2019109743A1 (zh) Url攻击检测方法、装置以及电子设备
CN107944020A (zh) 人脸图像查找方法及装置、计算机装置和存储介质
CN109359214A (zh) 基于神经网络的视频描述生成方法、存储介质及终端设备
CN110765843B (zh) 人脸验证方法、装置、计算机设备及存储介质
WO2017166586A1 (zh) 基于卷积神经网络的图片鉴别方法、系统和电子设备
CN114677565B (zh) 特征提取网络的训练方法和图像处理方法、装置
WO2021258699A1 (zh) 一种图像识别方法、装置、电子设备和计算机可读介质
CN108875533A (zh) 人脸识别的方法、装置、系统及计算机存储介质
WO2021051497A1 (zh) 肺结核判定方法、装置、计算机设备及存储介质
CN114627534B (zh) 活体判别方法及电子设备、存储介质
CN110047081A (zh) 胸部x光图像的实例分割方法、装置、设备及介质
CN113869253A (zh) 活体检测方法、训练方法、装置、电子设备及介质
CN111310724A (zh) 基于深度学习的活体检测方法、装置、存储介质及设备
TWI803243B (zh) 圖像擴增方法、電腦設備及儲存介質
CN112580668A (zh) 一种背景欺诈检测方法、装置及电子设备
CN116266419B (zh) 一种活体检测方法、装置和计算机设备
Jakhar et al. Effective near-duplicate image detection using perceptual hashing and deep learning
CN113762042B (zh) 视频识别方法、装置、设备以及存储介质
CN109993178B (zh) 一种特征数据生成和特征匹配方法及装置
CN113569707A (zh) 活体检测方法、装置、电子设备以及存储介质

Legal Events

Date Code Title Description
ENP Entry into the national phase

Ref document number: 2019563812

Country of ref document: JP

Kind code of ref document: A

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

Ref document number: 18915717

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 26.01.2021)

122 Ep: pct application non-entry in european phase

Ref document number: 18915717

Country of ref document: EP

Kind code of ref document: A1