CN111914945A - Data processing method and device, image generation method and electronic equipment - Google Patents

Data processing method and device, image generation method and electronic equipment Download PDF

Info

Publication number
CN111914945A
CN111914945A CN202010833646.3A CN202010833646A CN111914945A CN 111914945 A CN111914945 A CN 111914945A CN 202010833646 A CN202010833646 A CN 202010833646A CN 111914945 A CN111914945 A CN 111914945A
Authority
CN
China
Prior art keywords
parameter
updating
generator
image data
optimal
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.)
Pending
Application number
CN202010833646.3A
Other languages
Chinese (zh)
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202010833646.3A priority Critical patent/CN111914945A/en
Publication of CN111914945A publication Critical patent/CN111914945A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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; CALCULATING OR 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/2415Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on parametric or probabilistic models, e.g. based on likelihood ratio or false acceptance rate versus a false rejection rate
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Landscapes

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

Abstract

The embodiment of the application discloses a data processing method and device, an image generation method and electronic equipment. In the method, in the process of each training iteration, the generator and the discriminator are updated on the basis of random noise and image data acquired by devices in a training set, respective weight parameters of the generator and the discriminator are obtained, a first updating parameter is obtained, an optimal generator and an optimal discriminator are obtained on the basis of the first updating parameter, the random noise and the image data acquired by the devices in a verification set, and a dual difference value is obtained on the basis of the optimal generator and the optimal discriminator, so that the structural parameter of the generator is updated on the basis of the dual difference value, and a second updating parameter is obtained. Therefore, the parameter quantity and the calculation complexity required in the training process can be reduced through the method, so that the training time consumption is reduced, and the consumption degree of the resources of the electronic equipment for training is favorably reduced. And meanwhile, the performance of the built generator for generating the image can be improved.

Description

Data processing method and device, image generation method and electronic equipment
Technical Field
The present application relates to the field of computer technologies, and in particular, to a data processing method and apparatus, an image generation method, and an electronic device.
Background
A Generative Adaptive Network (GAN) is a type of neural Network that samples complex probability distributions, such as images, text, speech, etc., by training discriminators (discriminators) and generators (generators) in turns to compete against each other. However, the training time of the generated countermeasure network is long, which causes a problem of excessive consumption of resources of the electronic device for training, and the performance of the trained generated countermeasure network is yet to be improved.
Disclosure of Invention
In view of the above problems, the present application provides a data processing method, an apparatus, an image generating method and an electronic device to improve the above problems.
In a first aspect, the present application provides a data processing method, including: in the current training iteration process, based on random noise and respective weight parameters of an image data update generator and a discriminator acquired by devices in a training set, obtaining a first update parameter; obtaining an optimal generator and an optimal discriminator based on the first updating parameter, random noise and image data collected by devices in a verification set; updating the structural parameters of the generator based on a dual difference value to obtain a second updated parameter, wherein the dual difference value is a difference value between a value of the optimal discriminator corresponding to the loss function and a value of the optimal generator corresponding to the loss function; if the training iteration times meet the threshold times, outputting a first updating parameter and a second updating parameter obtained in the current training, and if the training iteration times do not meet the threshold times, entering the next training process; and establishing a generator based on the output first updating parameter and the second updating parameter for image generation based on the established generator.
In a second aspect, the present application provides an image generation method, the method comprising: acquiring randomly generated parameters; inputting the randomly generated parameters into a target generator, and acquiring an image output by the target generator; wherein the target generator is a generator established based on the method.
In a third aspect, the present application provides a data processing apparatus, comprising: the device comprises a weight parameter updating unit, a first network generating unit, a structure parameter updating unit, a parameter output unit and a second network generating unit. The device comprises a weight parameter updating unit, a generator and a discriminator, wherein the weight parameter updating unit is used for updating respective weight parameters of the generator and the discriminator based on random noise and image data acquired by devices in a training set in the current training iteration process to obtain a first updating parameter; the first network generation unit is used for obtaining an optimal generator and an optimal discriminator based on the first updating parameter, the random noise and the image data collected by the devices in the verification set; the structure parameter updating unit is used for updating the structure parameters of the generator based on a dual difference value to obtain a second updating parameter, wherein the dual difference value is a difference value between a value of the optimal discriminator corresponding to the loss function and a value of the optimal generator corresponding to the loss function; the parameter output unit is used for outputting the first updating parameter and the second updating parameter obtained by the current training if the training iteration times meet the threshold times, and entering the next training process if the training iteration times do not meet the threshold times; and the second network generating unit is used for establishing a generator based on the output first updating parameters and the second updating parameters, and generating an image based on the established generator.
In a fourth aspect, the present application provides an image generation apparatus, the apparatus comprising: a random generation acquisition unit and an image generation unit. The device comprises a random generation acquisition unit, a random generation processing unit and a random generation processing unit, wherein the random generation acquisition unit is used for acquiring randomly generated parameters; the image generation unit is used for inputting the randomly generated parameters into a target generator and acquiring an image output by the target generator; wherein the target generator is a generator established based on the method.
In a fifth aspect, the present application provides an electronic device comprising a processor and a memory; one or more programs are stored in the memory and configured to be executed by the processor to implement the methods described above.
In a sixth aspect, the present application provides a computer readable storage medium having program code stored therein, wherein the program code performs the above-mentioned method when executed by a processor.
According to the data processing method and device, the image generation method and the electronic device, the generator is established by the first updating parameter and the second updating parameter which are output through multiple times of training, and the generator is used for generating the image based on the established generator. In each training iteration process, the generator and the discriminator are updated on the basis of random noise and respective weight parameters of image data acquired by devices in a training set to obtain a first updating parameter, the optimal generator and the optimal discriminator are obtained on the basis of the first updating parameter, the random noise and the image data acquired by the devices in a verification set, a dual difference value is obtained on the basis of the optimal generator and the optimal discriminator, so that the structural parameters of the generator are updated on the basis of the dual difference value to obtain a second updating parameter, and when the number of training iterations meets a threshold number, the first updating parameter and the second updating parameter obtained in the next training are output. Therefore, in the training process, the dual difference value can be obtained through the optimal generator and the optimal discriminator to be used as a supervision signal for updating the parameter, so that the quantity of parameters and the calculation complexity required in the training process can be reduced, the training time is reduced, and the consumption degree of the resource of the electronic equipment for training is reduced. And meanwhile, the performance of the built generator for generating the image can be improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 shows a schematic diagram of a generator network topology and a discriminator network topology in an embodiment of the application;
FIG. 2 shows a schematic diagram of the structure of cells in a generator in an embodiment of the present application;
fig. 3 is a flow chart illustrating a data processing method according to an embodiment of the present application;
fig. 4 shows a flow chart of a data processing method according to another embodiment of the present application;
fig. 5 is a flow chart illustrating a data processing method according to still another embodiment of the present application;
fig. 6 shows a flow chart of a data processing method according to a further embodiment of the present application;
fig. 7 shows a flow chart of a data processing method according to a further embodiment of the present application;
fig. 8 is a block diagram illustrating a data processing apparatus according to an embodiment of the present application;
fig. 9 is a block diagram showing a data processing apparatus according to another embodiment of the present application;
fig. 10 is a block diagram showing a configuration of an electronic device for executing a data processing method according to an embodiment of the present application;
fig. 11 illustrates a storage unit for storing or carrying program codes for implementing a data processing method according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Artificial Intelligence (AI) is a theory, method, technique and application system that uses a digital computer or a machine controlled by a digital computer to simulate, extend and expand human Intelligence, perceive the environment, acquire knowledge and use the knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technique of computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can react in a manner similar to human intelligence. Artificial intelligence is the research of the design principle and the realization method of various intelligent machines, so that the machines have the functions of perception, reasoning and decision making.
The artificial intelligence technology is a comprehensive subject and relates to the field of extensive technology, namely the technology of a hardware level and the technology of a software level. The artificial intelligence infrastructure generally includes technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and the like.
With the wider application range of the artificial intelligence technology, the artificial intelligence technology is used in more computing fields. For example, image generation may be performed by generators in a Generative Adaptive Networks (GAN) for generating images (e.g., face images). However, the inventor finds out in research that, in the process of searching (which can be understood as training) for generating the confrontation network, the related searching mode is performed based on reinforcement learning. However, the generative confrontation network search method based on reinforcement learning has a problem that the search time is long and the search space is small because the search cannot be performed in an all-minute end-to-end manner, and the resource of the electronic device to be trained needs to be excessively consumed because the search time is long, and the performance of the trained generative confrontation network needs to be improved.
Therefore, the inventor proposes a data processing method, a data processing device, an image generation method and an electronic device provided by the present application, in which a generator is established by a first update parameter and a second update parameter which are output through a plurality of training times, so as to generate an image based on the established generator. In each training iteration process, the generator and the discriminator are updated on the basis of random noise and respective weight parameters of image data acquired by devices in a training set to obtain a first updating parameter, the optimal generator and the optimal discriminator are obtained on the basis of the first updating parameter, the random noise and the image data acquired by the devices in a verification set, a dual difference value is obtained on the basis of the optimal generator and the optimal discriminator, so that the structural parameters of the generator are updated on the basis of the dual difference value to obtain a second updating parameter, and when the number of training iterations meets a threshold number, the first updating parameter and the second updating parameter obtained in the next training are output.
Therefore, in the training process, the dual difference value can be obtained through the optimal generator and the optimal discriminator to be used as a supervision signal for updating the parameter, so that the quantity of parameters and the calculation complexity required in the training process can be reduced, the training time is reduced, and the consumption degree of the resource of the electronic equipment for training is reduced. And meanwhile, the performance of the built generator for generating the image can be improved.
Before further detailed description of the embodiments of the present application, an application environment related to the embodiments of the present application will be described.
Optionally, the data processing method provided by the embodiment of the present application may be executed by a server. The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a Network service, cloud communication, a middleware service, a domain name service, a security service, a CDN (Content Delivery Network), a big data and artificial intelligence platform, and the like. In the embodiment of the present application, when the data processing method is executed by a server cluster or a distributed system formed by a plurality of physical servers, different steps in the data processing method may be executed by different physical servers respectively, or may be executed by servers constructed based on the distributed system based on a distributed manner.
It should be noted that the data processing method provided in the embodiment of the present application is applied to generating a countermeasure network, where the training process in the embodiment of the present application can also be understood as a search process for generating a countermeasure network. The following description will be made of main technical terms referred to in the embodiments of the present application.
The weight parameter is: the weight parameters characterize the self-contained learnable parameters of operation in the neural network (e.g., generating a countermeasure network). Wherein the operation may be a convolution operation such as 1x1 convolution, 3x3 convolution, 3x3 separable convolution, etc., the weight parameter may be understood as a learnable parameter for each of the operations such as 1x1 convolution, 3x3 convolution, 3x3 separable convolution, etc. Here, the learnable parameters may be understood as parameters that can be updated through network training.
Structural parameters are as follows: the structural parameters characterize the type of operation between nodes in the neural network (e.g., generating a countermeasure network). Wherein the nodes represent nodes in the neural network that produce the signature graph. The operation type may be different operations such as 1x1 convolution, 3x3 convolution, 5x5 convolution, and the like. Illustratively, as shown in fig. 1, are network topologies for generating generators and discriminators, respectively, in a countermeasure network. Wherein, the fully-connected layer in the generator is used for receiving input data, and finally, the output of the data is carried out by a layer fused with operations such as BN (batch normalization), Relu, convolution and normalization. The cell 1 in the discriminator is used to receive input data, while the last fully connected layer performs the output of data. Any of the cells shown in FIG. 1 can be understood as a layer in a generator or a discriminator.
In the structure diagram of a cell in fig. 1, as shown in fig. 2, the connection line between adjacent nodes represents an operation of a corresponding configuration, and illustratively, there are a connection line 10, a connection line 11, and a connection line 12 between a node 0 and a node 1, then the connection line 10 represents an operation of a configuration, then the connection line 11 represents an operation of a configuration, and then the connection line 12 represents an operation of a configuration. The second update parameter output by the data processing method provided in this embodiment may include an operation weight of an operation represented by each of the connection line 10, the connection line 11, and the connection line 12, and if the operation weight corresponding to the operation represented by the connection line 10 is greater than the operation weight corresponding to the operation represented by the connection line 11 and the operation weight corresponding to the operation represented by the connection line 12, the operation represented by the connection line 10 may be regarded as the operation determined between the node 0 and the node 1.
Embodiments of the present application will be described in detail below with reference to the accompanying drawings.
Referring to fig. 3, fig. 3 is a flowchart illustrating a data processing method according to an embodiment of the present application, where the method includes:
s110: in the current training iteration process, the generator and the discriminator are updated based on random noise and respective weight parameters of image data acquired by devices in a training set, and a first updating parameter is obtained.
It should be noted that, in the data processing method provided in the embodiment of the present application, an update process of the weight parameter and the structure parameter is included, and in the data processing method provided in the embodiment of the present application, the weight parameter and the structure parameter are trained for multiple times to obtain an updated weight parameter and structure parameter of a final output. The updating of the weight parameters and the structure parameters is performed once during each training iteration.
In the current training iteration process, random noise and image data collected by a device in a training set are obtained firstly, then fake image data are generated by a generator based on the random noise, the image data collected by the device and the fake image data are input into a discriminator, and then the weight parameters of the discriminator and the generator are updated according to the discrimination output of the discriminator to obtain a first updating parameter.
It should be noted that, before S110 is executed, the image data acquired by the device may be acquired in advance, and the acquired image data acquired by the device is stored in different sets, so as to generate a training set and a verification set. The image data acquired by the device can be understood as an image acquired by an image acquisition device (e.g., a mobile phone camera). Optionally, in order to facilitate the server executing the data processing method provided in this embodiment to distinguish the training set from the verification machine, the server may configure the training set and the verification set in different storage areas, respectively. Different memory areas are understood to be different memories. Again, the random operation obtained may be random noise subject to a gaussian distribution.
S120: and obtaining an optimal generator and an optimal discriminator based on the first updating parameter, the random noise and the image data collected by the device in the verification set.
Note that, in the present embodiment, the loss function against the generation network may be defined as Adv (G, D). The optimal generator may be a generator satisfying the following conditions:
Figure BDA0002638895980000071
the optimal discriminator may be a discriminator satisfying the following conditions:
Figure BDA0002638895980000072
alternatively, the optimal generator and the optimal arbiter are correspondingly present, and optionally, if nash equilibrium is reached between the generator and the arbiter, the generator reaching nash equilibrium is the optimal generator, and the corresponding arbiter reaching nash equilibrium is the optimal arbiter.
S130: and updating the structural parameters of the generator based on the dual difference value to obtain a second updating parameter, wherein the dual difference value is the difference value between the value of the optimal discriminator corresponding to the loss function and the value of the optimal generator corresponding to the loss function.
Optionally, the loss function in the embodiment of the present application may be a cross entropy loss function. In this embodiment, the dual difference value represents the distance between the current generation countermeasure network and the convergence state, and the training of the generation countermeasure network is a process of continuously reducing the distance. The convergence state can be understood as a state in which the generation countermeasure network is at the end of the training. In this embodiment, the dual difference value can be defined by the following formula:
Figure BDA0002638895980000073
where Adv (G, D) is a loss function against the generative network, as shown in the foregoing, and correspondingly,
Figure BDA0002638895980000074
characterizing the value of the optimal generator corresponding to the loss function, and
Figure BDA0002638895980000075
the characterization best arbiter corresponds to the value of the loss function.
S140: and if the training iteration times meet the threshold times, outputting the first updating parameter and the second updating parameter obtained in the current training, and if the training iteration times do not meet the threshold times, entering the next training process.
As shown in the foregoing, the data processing method in this embodiment may include a process of multiple training, and the number of training iterations may be understood as the number of times from S110 to S130. For example, after the first execution of S130, the current number of training iterations is 1. Correspondingly, if S110, S120, and S130 are executed again from S110 after S130 is executed for the first time, the current number of training iterations is 2 times after S130 is executed for the second time.
S150: and establishing a generator based on the output first updating parameter and the second updating parameter for image generation based on the established generator.
After the second update parameter is obtained, operations between nodes in the generator can be determined based on the structural parameter, and the learnable parameters of each determined operation can be updated based on the first update parameter, thereby obtaining the established generator.
In the data processing method provided by this embodiment, the generator is established by obtaining the first updated parameter and the second updated parameter through multiple training processes, so as to generate an image based on the established generator. In addition, the dual difference value can be obtained through the optimal generator and the optimal discriminator to be used as a supervision signal for updating the parameters, so that the quantity of parameters and the calculation complexity required in the training process can be reduced, the training time consumption is reduced, and the consumption degree of resources of the electronic equipment for training is reduced. And meanwhile, the performance of the built generator for generating the image can be improved. In addition, because the dual difference is used as the supervision signal in the training process of the generator in the embodiment, the number of parameters can be effectively reduced, and further, the required number of parameters can be reduced in the image generation process of the established generator, so that the image generation rate of the established generator can be increased.
Referring to fig. 4, fig. 4 is a flowchart illustrating a data processing method according to an embodiment of the present application, where the method includes:
s210: in the current training iteration process, first image data and second image data are obtained, wherein the first image data are image data collected by a device in a training set, and the second image data are image data generated based on random noise.
S220: a first calculation value of the loss function is calculated based on the first image data and the second image data.
S230: and updating the weight parameters of the generator and the discriminator based on the first calculation value of the loss function and the random gradient descent mode to obtain a first updating parameter.
As one method, updating the weight parameters of the generator and the discriminator based on the first calculated value of the loss function and the stochastic gradient descent method to obtain a first updated parameter, includes: obtaining a minimization maximum of a first calculation value of the loss function based on a gradient descent mode; and updating the weight parameters of the generator and the discriminator based on the minimization maximum value to obtain a first updating parameter. Wherein the first update parameter may be derived based on the following formula.
Figure BDA0002638895980000081
Wherein s.t. ω characterizes an updated constraint comprising a weighting parameter ω to the generator by minimizing a maximum valueGAnd weight parameter ω of the discriminatorDAnd (6) updating.
S240: and obtaining an optimal generator and an optimal discriminator based on the first updating parameter, the random noise and the image data collected by the device in the verification set.
S250: and updating the structural parameters of the generator based on the dual difference value to obtain a second updating parameter, wherein the dual difference value is the difference value between the value of the optimal discriminator corresponding to the loss function and the value of the optimal generator corresponding to the loss function.
S260: detecting whether the training iteration number meets a threshold number.
S261: and if the training iteration times meet the threshold times, outputting the first updating parameter and the second updating parameter obtained in the current training.
And if the training iteration times do not meet the threshold times, entering the next training process.
S270: and establishing a generator based on the output first updating parameter and the second updating parameter for image generation based on the established generator.
It should be noted that, in the process of acquiring the first update parameter, as one mode, the first update parameter that is finally output may be obtained through multiple parameter updates. Optionally, in this embodiment, each parameter update may be determined as a weight parameter update, and correspondingly, first image data and second image data are obtained, where the first image data is image data acquired by a device in a training set, and the second image data is image data generated based on random noise, and the method includes: and in the process of updating the current weight parameter, acquiring first image data and second image data corresponding to the current weight parameter updating, wherein the first image data is image data acquired by a device in a training set, and the second image data is image data generated based on random noise.
Correspondingly, calculating a first calculation value of the loss function based on the first image data and the second image data includes: based on the first image data and the second image data corresponding to the current weight parameter updating, calculating to obtain a first calculated value of a loss function in the current weight parameter updating process;
correspondingly, updating the weight parameters of the generator and the discriminator based on the first calculation value of the loss function and the random gradient descent mode to obtain a first updating parameter, which comprises the following steps: updating the weight parameters of the generator and the discriminator based on a first calculation value of the loss function in the current weight parameter updating process and a random gradient descent mode to obtain a reference weight parameter corresponding to the current weight parameter updating;
and if the times corresponding to the current weight parameter updating meet the first target times, taking the reference weight parameter corresponding to the current weight parameter updating as a first updating parameter, and entering the next weight parameter updating if the times corresponding to the current weight parameter updating do not meet the first target times.
Therefore, by the above method, in the process of executing the current weight parameter updating, after the weight parameters of the generator and the discriminator are updated based on the first calculated value of the loss function in the current weight parameter updating process and the random gradient descent method, the updating times of the weight parameters can be updated at the same time, whether the updated times meet the first target times or not is detected after the updating, and then the updated weight parameters of the generator and the discriminator obtained by updating the current weight parameters are output under the condition of meeting the first target times. For example, if the first target number of times is 20, when the number of times after the detection update is 20, the reference weight parameter obtained in the process of updating the weight parameter at the 20 th time is used as the first update parameter.
In the data processing method provided by this embodiment, the generator is established by obtaining the first updated parameter and the second updated parameter through multiple training processes, so as to generate an image based on the established generator. In addition, the dual difference value can be obtained through the optimal generator and the optimal discriminator to be used as a supervision signal for updating the parameters, so that the quantity of parameters and the calculation complexity required in the training process can be reduced, the training time consumption is reduced, and the consumption degree of resources of the electronic equipment for training is reduced. And meanwhile, the performance of the built generator for generating the image can be improved. In addition, in this embodiment, when the first calculation value of the loss function is calculated according to the first image data and the second image data, the weight parameters of the generator and the discriminator may be updated based on the first calculation value of the loss function and a random gradient descent manner, and then the first update parameter may be acquired more quickly in a full-differentiable manner of random gradient descent, so as to improve the overall training efficiency.
Referring to fig. 5, fig. 5 is a flowchart illustrating a data processing method according to an embodiment of the present application, where the method includes:
s310: in the current training iteration process, the generator and the discriminator are updated based on random noise and respective weight parameters of image data acquired by devices in a training set, and a first updating parameter is obtained.
S320: and initializing the weight parameters of the optimal generator and the optimal discriminator based on the first updating parameter to obtain the initialized optimal generator and the initialized optimal discriminator.
S330: and updating the weight parameters of the initialized optimal generator and the initialized optimal discriminator based on the random noise and the image data collected by the devices in the verification set to obtain the optimal generator and the optimal discriminator.
As a mode, updating the weight parameters of the initialized optimal generator and the initialized optimal discriminator based on random noise and image data collected by devices in a verification set to obtain the optimal generator and the optimal discriminator, including: acquiring third image data and fourth image data, wherein the third image data are image data collected by devices in a verification set, and the fourth image data are image data generated based on random noise; calculating a second calculation value of the loss function based on the third image data and the fourth image data; updating the weight parameters of the initialized optimal discriminator based on the second calculation value and a random gradient descent mode to obtain the optimal discriminator; and calculating a third calculated value of the loss function based on the fourth image data and updating the weight parameters of the initialized optimal generator in a random gradient descent mode to obtain the optimal generator.
S340: and updating the structural parameters of the generator based on the dual difference value to obtain a second updating parameter, wherein the dual difference value is the difference value between the value of the optimal discriminator corresponding to the loss function and the value of the optimal generator corresponding to the loss function.
As one mode, updating the structural parameter of the generator based on the dual difference to obtain a second update parameter includes: calculating a dual difference value based on the third image data and the fourth image data;
and updating the structural parameters of the generator based on the dual difference value and a random gradient descent mode to obtain second updating parameters.
Optionally, updating the structural parameter of the generator based on the dual difference and the random gradient descent method to obtain a second update parameter, including: acquiring the gradient of the dual difference value; acquiring the minimum value of the dual difference value based on a random gradient descending mode and a gradient; and updating the structural parameters of the generator based on the minimum value to obtain second updating parameters.
For example, the structure parameter may be updated based on the following formula:
Figure BDA0002638895980000111
wherein the content of the first and second substances,
Figure BDA0002638895980000112
the dual difference is characterized. Wherein
Figure BDA0002638895980000113
It is characterized in that alpha when the minimum value of the dual difference value is obtained is used as the second updating parameter.
S350: detecting whether the training iteration number meets a threshold number.
S351: and if the training iteration times meet the threshold times, outputting the first updating parameter and the second updating parameter obtained in the current training.
And if the training iteration times do not meet the threshold times, entering the next training process.
S360: and establishing a generator based on the output first updating parameter and the second updating parameter for image generation based on the established generator.
It should be noted that, in the process of acquiring the second update parameter, as one mode, the finally output second update parameter may be obtained through multiple parameter updates. Optionally, in this embodiment, each parameter update may be determined as one structural parameter update, and correspondingly, as a manner, the calculating the dual difference value based on the third image data and the fourth image data includes: in the process of updating the current structural parameter, calculating a dual difference value corresponding to the current structural parameter updating based on the third image data and the fourth image data;
updating the structural parameters of the generator based on the dual difference and the random gradient descent mode to obtain second updating parameters, which comprises the following steps: updating the structural parameters of the generator based on the dual difference value corresponding to the current structural parameter update and a random gradient descent mode to obtain a reference structural parameter corresponding to the current structural parameter update; and if the updating times of the current structural parameter meet the second target times, taking the reference structural parameter corresponding to the updating of the current structural parameter as a second updating parameter, and if the updating times of the current structural parameter do not meet the second target times, entering the next structural parameter updating.
Therefore, by the above method, in the process of executing the current structural parameter updating, after the structural parameter of the generator is updated based on the second calculated value of the loss function in the current structural parameter updating process and the random gradient descent mode, the reference structural parameter corresponding to the current structural parameter updating is obtained, the times of updating the structural parameter can be updated simultaneously, whether the updated times meet the second target times or not is detected after the updating, and then the reference structural parameter obtained by updating the current structural parameter is output as the second updating parameter under the condition of meeting the second target times. For example, if the second target number of times is 20, when the number of times after the detection update is 20, the reference weight parameter obtained in the 20 th structural parameter update process is used as the second update parameter.
It should be noted that, in the same embodiment, the method may include obtaining a first updated parameter of a final output through multiple parameter updates, and also include obtaining a second updated parameter of the final output through multiple parameter updates, in this way, in a training process, a multiple weight parameter updating process is performed first to obtain a first updated parameter (including respective first updated parameters of the generator and the discriminator), and then an optimal generator and an optimal discriminator are obtained based on the first updated parameter, so as to obtain a dual difference. Then, a second update parameter is obtained through a plurality of times of structure parameter update processes.
In the data processing method provided by this embodiment, the generator is established by obtaining the first updated parameter and the second updated parameter through multiple training processes, so as to generate an image based on the established generator. In addition, the dual difference value can be obtained through the optimal generator and the optimal discriminator to be used as a supervision signal for updating the parameters, so that the quantity of parameters and the calculation complexity required in the training process can be reduced, the training time consumption is reduced, and the consumption degree of resources of the electronic equipment for training is reduced. And meanwhile, the performance of the built generator for generating the image can be improved. In addition, in this embodiment, when the second calculation value of the loss function is calculated based on the third image data and the fourth image data, the weight parameters of the generator and the arbiter may be updated based on the second calculation value of the loss function and the random gradient descent method, so that the optimal arbiter and the optimal generator may be obtained more quickly in a full-differentiable manner of random gradient descent, and in a subsequent updating process of the structural parameters, the structural parameters of the generator may also be updated based on the dual difference value and the random gradient descent method to obtain the second update parameter, thereby improving the efficiency of obtaining the second update parameter.
Referring to fig. 6, fig. 6 is a flowchart illustrating a data processing method according to an embodiment of the present application, where the method includes:
s410: in the current training iteration process, the generator and the discriminator are updated based on random noise and respective weight parameters of image data acquired by devices in a training set, and a first updating parameter is obtained.
S420: and obtaining an optimal generator and an optimal discriminator based on the first updating parameter, the random noise and the image data collected by the device in the verification set.
S430: and updating the structural parameters of the generator based on the dual difference value to obtain a second updating parameter, wherein the dual difference value is the difference value between the value of the optimal discriminator corresponding to the loss function and the value of the optimal generator corresponding to the loss function.
S440: and if the training iteration times meet the threshold times, outputting the first updating parameter and the second updating parameter obtained in the current training, and if the training iteration times do not meet the threshold times, entering the next training process.
S450: and taking the output first updating parameter as the weight parameter of the established generator.
S460: the operating mode between adjacent nodes in the built generator is determined based on the outputted second updated parameters.
It should be noted that a plurality of operations are preset between adjacent nodes, and the structural parameter represents respective operation weights of the plurality of operations preset between the adjacent nodes. For example, there may be preset between some neighboring nodes: for example, the structure parameters of the resulting output may include operation weights corresponding to 1x1 convolution, operation weights corresponding to 3x3 convolution, and operation weights corresponding to 5x5 convolution, such as 1x1 convolution, 3x3 convolution, and 5x5 convolution. For another example, a plurality of operations such as 3x3 separable convolution, 5x5 separable convolution, and 7x7 separable convolution may be preset between certain adjacent nodes. The resulting structural parameters of the output may include the operational weights corresponding to the 3x3 separable convolution, the 5x5 separable convolution, and the 7x7 separable convolution.
Optionally, determining an operation mode between adjacent nodes in the generator based on the output second update parameter includes: acquiring a target operation weight between each adjacent node, wherein the target operation weight is the maximum operation weight in the respective operation weights of a plurality of operations between the adjacent nodes; and taking the operation corresponding to the target operation weight as the operation mode between the adjacent nodes.
Illustratively, the operation weight corresponding to the convolution with 1x1 is q1, the operation weight corresponding to the convolution with 3x3 is q2, and the operation weight corresponding to the convolution with 5x5 is q 3. If q3 is greater than q2, and q2 is greater than q1, the operation weight q3 corresponding to the convolution of 5x5 can be determined as the target operation weight, and the operation of the convolution of 5x5 corresponding to the operation weight q3 is used as the operation mode between the adjacent nodes. As another example, the operation weight corresponding to the 3x3 separable convolution is q4, the operation weight corresponding to the inclusion of the 5x5 separable convolution is q5, and the operation weight corresponding to the inclusion of the 7x7 separable convolution is q 6. If q4 is greater than q5 and q5 is greater than q6, then the operation weight q4 corresponding to the separable convolution of 3x3 can be determined as the target operation weight, and then the separable convolution of 3x3 corresponding to the operation weight q4 can be used as the operation mode between the adjacent nodes.
It should be noted that, as shown in the foregoing, the data processing method provided by this embodiment may be executed by a server cluster, and in a case that the server cluster includes a plurality of servers, a plurality of steps in the data processing method may be executed by different servers, respectively, and then a generator is established by a specified server in the plurality of servers based on the output first update parameter and the second update parameter, so as to perform image generation based on the established generator.
In the data processing method provided by this embodiment, the generator is established by obtaining the first updated parameter and the second updated parameter through multiple training processes, so as to generate an image based on the established generator. In addition, the dual difference value can be obtained through the optimal generator and the optimal discriminator to be used as a supervision signal for updating the parameters, so that the quantity of parameters and the calculation complexity required in the training process can be reduced, the training time consumption is reduced, and the consumption degree of resources of the electronic equipment for training is reduced. And meanwhile, the performance of the built generator for generating the image can be improved.
Referring to fig. 7, fig. 7 shows an image generating method according to an embodiment of the present application, the method includes:
s510: randomly generated parameters are obtained.
As one approach, the randomly generated parameters may be obtained based on a gaussian random distribution.
S520: and inputting the randomly generated parameters into a target generator, and acquiring an image output by the target generator.
The target generator is a generator established based on the data processing method provided by the foregoing embodiment.
It should be noted that the image generation method provided by the present embodiment can be applied to a plurality of scenes. Alternatively, the method can be applied to game scenes. In a game scene, the game client may acquire the randomly generated parameters, input the acquired randomly generated parameters into the target generator, acquire a face image output by the target generator, and display the face image in the game scene. Optionally, the method may also be applied to an instant messaging scene, and in the instant messaging scene, if the user does not want to use the face image of the user as the chat avatar, the randomly generated parameters may be acquired by the communication client, and then the acquired randomly generated parameters may be input into the target generator, and the face image output by the target generator may be acquired, and the face image output by the target generator may be used as the chat avatar of the user in the instant messaging scene.
Optionally, the target generator may be deployed in a client that obtains the randomly generated parameter, or may be deployed in a server corresponding to the client that obtains the randomly generated parameter.
According to the image generation method, in the training process, the dual difference value can be obtained through the optimal generator and the optimal discriminator to serve as a supervision signal for updating the parameter, so that the quantity of the parameter and the calculation complexity required in the training process can be reduced, the time consumed by training is reduced, and the consumption degree of the resource of the electronic equipment for training is reduced. And meanwhile, the performance of the built generator for generating the image can be improved. It should be noted that, in the generator established by the data processing method in the embodiment of the present application, performance evaluation may be performed based on an Inclusion Score (IS) manner or a Free Inclusion Distance (FID) manner, and when performance evaluation IS performed based on the Inclusion Score (IS) manner or the Free Inclusion Distance (FID) manner, the obtained performance Score IS higher than the performance of the generator established by the correlation manner for image generation.
Referring to fig. 8, fig. 8 is a block diagram illustrating a data processing apparatus 600 according to an embodiment of the present application, where the apparatus 600 includes:
the weight parameter updating unit 610 is configured to update the respective weight parameters of the generator and the discriminator based on the random noise and the image data collected by the device in the training set in the current training iteration process to obtain a first update parameter.
And a first network generating unit 620, configured to obtain an optimal generator and an optimal discriminator based on the first update parameter, the random noise, and the image data collected by the device in the verification set.
The structure parameter updating unit 630 is configured to update the structure parameter of the generator based on a dual difference value, which is a difference value between the value of the optimal discriminator corresponding to the loss function and the value of the optimal generator corresponding to the loss function, to obtain a second update parameter.
And the parameter output unit 640 is configured to output the first update parameter and the second update parameter obtained in the current training if the number of training iterations satisfies the threshold number, and enter the next training process if the number of training iterations does not satisfy the threshold number.
A second network generating unit 650 for building a generator based on the output first update parameter and the second update parameter for image generation based on the built generator.
As one mode, the weight parameter updating unit 610 is specifically configured to obtain first image data and second image data, where the first image data is image data acquired through a device in a training set, and the second image data is image data generated based on random noise; calculating a first calculation value of the loss function based on the first image data and the second image data; and updating the weight parameters of the generator and the discriminator based on the first calculation value of the loss function and the random gradient descent mode to obtain a first updating parameter.
Optionally, the weight parameter updating unit 610 is specifically configured to obtain a maximum minimization value of the first calculation value of the loss function based on a gradient descent manner; and updating the weight parameters of the generator and the discriminator based on the minimization maximum value to obtain a first updating parameter.
As shown in the foregoing, the first update parameter may be obtained through multiple updates, in this way, the weight parameter updating unit 610 is specifically configured to, in the process of updating the current weight parameter, obtain first image data and second image data corresponding to the current weight parameter update, where the first image data is image data acquired by a device in a training set, and the second image data is image data generated based on random noise; based on the first image data and the second image data corresponding to the current weight parameter updating, calculating to obtain a first calculated value of a loss function in the current weight parameter updating process; updating the weight parameters of the generator and the discriminator based on a first calculation value of the loss function in the current weight parameter updating process and a random gradient descent mode to obtain a reference weight parameter corresponding to the current weight parameter updating; and if the times corresponding to the current weight parameter updating meet the first target times, taking the reference weight parameter corresponding to the current weight parameter updating as a first updating parameter, and entering the next weight parameter updating if the times corresponding to the current weight parameter updating do not meet the first target times.
As a manner, the first network generating unit 620 is specifically configured to initialize the weight parameters of the optimal generator and the optimal arbiter based on the first update parameter, so as to obtain an initialized optimal generator and an initialized optimal arbiter; and updating the weight parameters of the initialized optimal generator and the initialized optimal discriminator based on the random noise and the image data collected by the devices in the verification set to obtain the optimal generator and the optimal discriminator. Optionally, the first network generating unit 620 is specifically configured to obtain third image data and fourth image data, where the third image data is image data collected by a device in the verification set, and the fourth image data is image data generated based on random noise; calculating a second calculation value of the loss function based on the third image data and the fourth image data; updating the weight parameters of the initialized optimal discriminator based on the second calculation value and a random gradient descent mode to obtain the optimal discriminator; and calculating a third calculated value of the loss function based on the fourth image data and updating the weight parameters of the initialized optimal generator in a random gradient descent mode to obtain the optimal generator.
As one way, the structure parameter updating unit 630 is specifically configured to calculate a dual difference value based on the third image data and the fourth image data; and updating the structural parameters of the generator based on the dual difference value and a random gradient descent mode to obtain second updating parameters. Optionally, the structure parameter updating unit 530 is specifically configured to obtain a gradient of the dual difference; acquiring the minimum value of the dual difference value based on a random gradient descending mode and a gradient; and updating the structural parameters of the generator based on the minimum value to obtain second updating parameters.
As shown in the foregoing, the second update parameter may be obtained through multiple updates, in this way, the structure parameter updating unit 630 is specifically configured to calculate, during the current structure parameter update, a dual difference corresponding to the current structure parameter update based on the third image data and the fourth image data; updating the structural parameters of the generator based on the dual difference value corresponding to the current structural parameter update and a random gradient descent mode to obtain a reference structural parameter corresponding to the current structural parameter update; and if the updating times of the current structural parameter meet the second target times, taking the reference structural parameter corresponding to the updating of the current structural parameter as a second updating parameter, and if the updating times of the current structural parameter do not meet the second target times, entering the next structural parameter updating.
A second network generating unit 650, specifically configured to use the output first update parameter as the weight parameter of the established generator; the operating mode between adjacent nodes in the built generator is determined based on the outputted second updated parameters. It should be noted that a plurality of operations are preset between adjacent nodes, and the structural parameter represents respective operation weights of the plurality of operations preset between the adjacent nodes, and the second network generating unit 650 is specifically configured to obtain a target operation weight between each adjacent node, where the target operation weight is a maximum operation weight in the respective operation weights of the plurality of operations between the adjacent nodes;
and taking the operation corresponding to the target operation weight as the operation mode between the adjacent nodes.
According to the data processing device, in the training process, the dual difference value can be obtained through the optimal generator and the optimal discriminator to serve as the supervision signal for updating the parameters, so that the quantity of the parameters and the calculation complexity required in the training process can be reduced, the time consumed by training is reduced, and the consumption degree of resources of the electronic equipment for training is reduced. And meanwhile, the performance of the built generator for generating the image can be improved.
Referring to fig. 9, fig. 9 is a diagram illustrating an image generating apparatus 700 according to an embodiment of the present application, the apparatus including: a random generation acquisition unit 710 and an image generation unit 720. The random generation acquiring unit 710 is configured to acquire a randomly generated parameter; an image generating unit 720 for inputting the randomly generated parameters to the target generator and acquiring the image output by the target generator; the target generator is a generator established based on the method.
According to the image generation device, in the training process, the dual difference value can be obtained through the optimal generator and the optimal discriminator to serve as a supervision signal for updating the parameter, so that the quantity of the parameter and the calculation complexity required in the training process can be reduced, the time consumed by training is reduced, and the consumption degree of the resource of the electronic equipment for training is reduced. And meanwhile, the performance of the built generator for generating the image can be improved.
It should be noted that the device embodiment and the method embodiment in the present application correspond to each other, and specific principles in the device embodiment may refer to the contents in the method embodiment, which is not described herein again.
An electronic device provided by the present application will be described with reference to fig. 10.
Referring to fig. 10, based on the data processing method, another electronic device 200 including a processor 102 capable of executing the data processing method is provided in the embodiment of the present application, where the electronic device 200 may be a smart phone, a tablet computer, a portable computer, or the like. The electronic device 200 also includes a memory 104 and a network module 106. The memory 104 stores programs that can execute the content of the foregoing embodiments, and the processor 102 can execute the programs stored in the memory 104.
Processor 102 may include, among other things, one or more cores for processing data and a message matrix unit. The processor 102 interfaces with various components throughout the electronic device 200 using various interfaces and circuitry to perform various functions of the electronic device 200 and process data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 104 and invoking data stored in the memory 104. Alternatively, the processor 102 may be implemented in hardware using at least one of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 102 may integrate one or more of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing display content; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 102, but may be implemented by a communication chip.
The Memory 104 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). The memory 104 may be used to store instructions, programs, code sets, or instruction sets. The memory 104 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing various method embodiments described below, and the like. The storage data area may also store data created by the terminal 100 in use, such as a phonebook, audio-video data, chat log data, and the like.
The network module 106 is configured to receive and transmit electromagnetic waves, and implement interconversion between the electromagnetic waves and the electrical signals, so as to communicate with a communication network or other devices, for example, the network module 106 may transmit broadcast data, and may also analyze broadcast data transmitted by other devices. The network module 106 may include various existing circuit elements for performing these functions, such as an antenna, a radio frequency transceiver, a digital signal processor, an encryption/decryption chip, a Subscriber Identity Module (SIM) card, memory, and so forth. The network module 106 may communicate with various networks, such as the internet, an intranet, a wireless network, or with other devices via a wireless network. The wireless network may comprise a cellular telephone network, a wireless local area network, or a metropolitan area network. For example, the network module 106 may interact with a base station.
Referring to fig. 11, a block diagram of a computer-readable storage medium according to an embodiment of the present application is shown. The computer-readable medium 1100 has stored therein program code that can be called by a processor to perform the method described in the above-described method embodiments.
The computer-readable storage medium 1100 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read only memory), an EPROM, a hard disk, or a ROM. Alternatively, the computer-readable storage medium 1100 includes a non-volatile computer-readable storage medium. The computer readable storage medium 1100 has storage space for program code 1110 for performing any of the method steps of the method described above. The program code can be read from or written to one or more computer program products. The program code 1110 may be compressed, for example, in a suitable form.
In summary, according to the data processing method, the data processing device, the image generation method, and the electronic device provided by the application, the generator is established by obtaining the output first update parameter and the output second update parameter through multiple times of training, so as to generate an image based on the established generator. In each training iteration process, the generator and the discriminator are updated on the basis of random noise and respective weight parameters of image data acquired by devices in a training set to obtain a first updating parameter, the optimal generator and the optimal discriminator are obtained on the basis of the first updating parameter, the random noise and the image data acquired by the devices in a verification set, a dual difference value is obtained on the basis of the optimal generator and the optimal discriminator, so that the structural parameters of the generator are updated on the basis of the dual difference value to obtain a second updating parameter, and when the number of training iterations meets a threshold number, the first updating parameter and the second updating parameter obtained in the next training are output. Therefore, in the training process, the dual difference value can be obtained through the optimal generator and the optimal discriminator to be used as a supervision signal for updating the parameter, so that the quantity of parameters and the calculation complexity required in the training process can be reduced, the training time is reduced, and the consumption degree of the resource of the electronic equipment for training is reduced.
Furthermore, in the embodiment of the present application, in the process of updating the structural parameters, a dual difference value obtained based on a difference value between a value corresponding to the loss function by the optimal discriminator and a value corresponding to the loss function by the optimal generator is used as a supervision signal, so that the data processing method provided by the present embodiment can be applied to training tasks with more data types. And meanwhile, the performance of the built generator for generating the image can be improved.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not necessarily depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (15)

1. A method of data processing, the method comprising:
in the current training iteration process, updating respective weight parameters of a generator and a discriminator based on random noise and image data acquired by devices in a training set to obtain a first updating parameter, wherein the first updating parameter is an updated weight parameter;
obtaining an optimal generator and an optimal discriminator based on the first updating parameter, random noise and image data collected by devices in a verification set;
updating the structural parameters of the generator based on a dual difference value to obtain a second updated parameter, wherein the second updated parameter is the updated structural parameter, and the dual difference value is the difference value between the value of the optimal discriminator corresponding to the loss function and the value of the optimal generator corresponding to the loss function;
if the training iteration times meet the threshold times, outputting a first updating parameter and a second updating parameter obtained by the current training iteration, and if the training iteration times do not meet the threshold times, entering the process of the next training iteration;
and establishing a generator based on the output first updating parameter and the second updating parameter for image generation based on the established generator.
2. The method of claim 1, wherein the obtaining the first update parameter based on the random noise and the respective weight parameters of the image data update generator and the discriminator collected by the device in the training set comprises:
acquiring first image data and second image data, wherein the first image data is image data acquired by a device in a training set, and the second image data is image data generated based on random noise;
calculating a first calculation value of a loss function based on the first image data and the second image data;
and updating the weight parameters of the generator and the discriminator based on the first calculation value of the loss function and a random gradient descending mode to obtain a first updating parameter.
3. The method of claim 2, wherein the updating the weight parameters of the generator and the discriminator based on the first calculated value of the loss function and the random gradient descent manner to obtain a first updated parameter comprises:
obtaining a minimization maximum of a first calculation value of the loss function based on a gradient descent mode;
and updating the weight parameters of the generator and the discriminator based on the maximum minimization value to obtain a first updating parameter.
4. The method of claim 2, wherein the acquiring first image data and second image data, the first image data being image data acquired by a device in a training set, the second image data being image data generated based on random noise, comprises:
in the process of updating the current weight parameter, acquiring first image data and second image data corresponding to the current weight parameter updating, wherein the first image data is image data collected by a device in a training set, and the second image data is image data generated based on random noise;
the calculating a first calculated value of a loss function based on the first image data and the second image data comprises:
updating corresponding first image data and second image data based on the current weight parameter, and calculating to obtain a first calculated value of a loss function in the current weight parameter updating process;
the updating the weight parameters of the generator and the discriminator based on the first calculation value of the loss function and the random gradient descent mode to obtain a first updated parameter includes:
updating the weight parameters of the generator and the discriminator based on a first calculation value of the loss function in the current weight parameter updating process and a random gradient descending mode to obtain a reference weight parameter corresponding to the current weight parameter updating;
and if the times corresponding to the current weight parameter updating meet the first target times, taking the reference weight parameter corresponding to the current weight parameter updating as a first updating parameter, and entering the next weight parameter updating if the times corresponding to the current weight parameter updating do not meet the first target times.
5. The method of claim 1, wherein deriving an optimal generator and an optimal discriminator based on the first updated parameter, random noise, and image data collected by devices in a validation set comprises:
initializing the weight parameters of the optimal generator and the optimal discriminator based on the first updating parameter to obtain an initialized optimal generator and an initialized optimal discriminator;
and updating the weight parameters of the initialized optimal generator and the initialized optimal discriminator based on random noise and image data collected by devices in the verification set to obtain the optimal generator and the optimal discriminator.
6. The method of claim 5, wherein the updating the weight parameters of the initialized optimal generator and the initialized optimal discriminator based on the random noise and the image data collected by the device in the verification set to obtain an optimal generator and an optimal discriminator comprises:
acquiring third image data and fourth image data, wherein the third image data are image data collected by devices in a verification set, and the fourth image data are image data generated based on random noise;
calculating a second calculation value of the loss function based on the third image data and the fourth image data;
updating the weight parameters of the initialized optimal arbiter based on the second calculation value and a random gradient descent mode to obtain an optimal arbiter;
and calculating a third calculated value of the loss function based on the fourth image data and updating the weight parameter of the initialized optimal generator in a random gradient descent mode to obtain the optimal generator.
7. The method of claim 6, wherein updating the structural parameters of the generator based on the dual difference values to obtain second updated parameters comprises:
calculating a dual difference value based on the third image data and the fourth image data;
and updating the structural parameters of the generator based on the dual difference value and a random gradient descent mode to obtain second updated parameters.
8. The method of claim 7, wherein the updating the structural parameters of the generator based on the dual difference values and a stochastic gradient descent method to obtain second updated parameters comprises:
acquiring the gradient of the dual difference value;
acquiring the minimum value of the dual difference value based on a random gradient descending mode and the gradient;
and updating the structural parameters of the generator based on the minimum value to obtain second updated parameters.
9. The method of claim 7, wherein computing a dual difference value based on the third image data and fourth image data comprises:
in the process of updating the current structural parameter, calculating a dual difference value corresponding to the current structural parameter update based on the third image data and the fourth image data;
updating the structural parameters of the generator based on the dual difference and a random gradient descent mode to obtain second updated parameters, wherein the second updated parameters comprise:
updating the structural parameters of the generator based on the dual difference value corresponding to the current structural parameter update and a random gradient descent mode to obtain a reference structural parameter corresponding to the current structural parameter update;
and if the times of updating the current structural parameter meet the second target times, taking the reference structural parameter corresponding to the current structural parameter updating as a second updating parameter, and entering the next structural parameter updating if the times of updating the current structural parameter do not meet the second target times.
10. The method of any of claims 1-9, wherein the generator comprises a plurality of nodes, and wherein building the generator based on the output first updated parameter and the second updated parameter for image generation based on the built generator comprises:
taking the output first updating parameter as the weight parameter of the established generator;
determining a manner of operation between adjacent nodes in the built generator based on the outputted second updated parameter.
11. The method of claim 10, wherein a plurality of operations are preset between adjacent nodes, the structural parameter characterizes respective operation weights of the plurality of operations preset between adjacent nodes, and the determining, based on the output second updated parameter, a manner of operation between adjacent nodes in the generator comprises:
acquiring a target operation weight between each adjacent node, wherein the target operation weight is the maximum operation weight in the respective operation weights of a plurality of operations between the adjacent nodes;
and taking the operation corresponding to the target operation weight as the operation mode between the adjacent nodes.
12. An image generation method, characterized in that the method comprises:
acquiring randomly generated parameters;
inputting the randomly generated parameters into a target generator, and acquiring an image output by the target generator;
wherein the target generator is a generator built based on the method of any one of claims 1-11.
13. A data processing apparatus, characterized in that the apparatus comprises:
the weight parameter updating unit is used for updating respective weight parameters of the generator and the discriminator based on random noise and image data acquired by devices in a training set in the current training iteration process to obtain a first updating parameter;
the first network generation unit is used for obtaining an optimal generator and an optimal discriminator based on the first updating parameter, the random noise and the image data collected by the devices in the verification set;
the structure parameter updating unit is used for updating the structure parameters of the generator based on a dual difference value to obtain a second updating parameter, wherein the dual difference value is a difference value between a value of the optimal discriminator corresponding to the loss function and a value of the optimal generator corresponding to the loss function;
the parameter output unit is used for outputting the first updating parameter and the second updating parameter obtained by the current training if the training iteration times meet the threshold times, and entering the next training process if the training iteration times do not meet the threshold times;
and the second network generating unit is used for establishing a generator based on the output first updating parameters and the second updating parameters, and generating an image based on the established generator.
14. An electronic device comprising a processor and a memory; one or more programs are stored in the memory and configured to be executed by the processor to implement the method of any of claims 1-11.
15. A computer-readable storage medium, having program code stored therein, wherein the program code when executed by a processor performs the method of any of claims 1-11.
CN202010833646.3A 2020-08-18 2020-08-18 Data processing method and device, image generation method and electronic equipment Pending CN111914945A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010833646.3A CN111914945A (en) 2020-08-18 2020-08-18 Data processing method and device, image generation method and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010833646.3A CN111914945A (en) 2020-08-18 2020-08-18 Data processing method and device, image generation method and electronic equipment

Publications (1)

Publication Number Publication Date
CN111914945A true CN111914945A (en) 2020-11-10

Family

ID=73278308

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010833646.3A Pending CN111914945A (en) 2020-08-18 2020-08-18 Data processing method and device, image generation method and electronic equipment

Country Status (1)

Country Link
CN (1) CN111914945A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112508179A (en) * 2020-12-17 2021-03-16 上海依图网络科技有限公司 Method, apparatus and medium for constructing network structure

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110070174A (en) * 2019-04-10 2019-07-30 厦门美图之家科技有限公司 A kind of stabilization training method generating confrontation network
CN110796619A (en) * 2019-10-28 2020-02-14 腾讯科技(深圳)有限公司 Image processing model training method and device, electronic equipment and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110070174A (en) * 2019-04-10 2019-07-30 厦门美图之家科技有限公司 A kind of stabilization training method generating confrontation network
CN110796619A (en) * 2019-10-28 2020-02-14 腾讯科技(深圳)有限公司 Image processing model training method and device, electronic equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
YUESONG TIAN等: "AlphaGAN: Fully Differentiable Architecture Search for Generative Adversarial Networks", ARXIV:2006.09134V1, pages 1 - 6 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112508179A (en) * 2020-12-17 2021-03-16 上海依图网络科技有限公司 Method, apparatus and medium for constructing network structure

Similar Documents

Publication Publication Date Title
CN112181666B (en) Equipment assessment and federal learning importance aggregation method based on edge intelligence
CN110378413A (en) Neural network model processing method, device and electronic equipment
EP4152154A1 (en) Adaptive artificial neural network selection techniques
CN109657539B (en) Face value evaluation method and device, readable storage medium and electronic equipment
CN110166344B (en) Identity identification method, device and related equipment
CN109446171B (en) Data processing method and device
CN111260220B (en) Group control equipment identification method and device, electronic equipment and storage medium
CN116032663B (en) Privacy data processing system, method, equipment and medium based on edge equipment
CN111782401A (en) Data processing method and device and electronic equipment
CN111898484A (en) Method and device for generating model, readable storage medium and electronic equipment
CN111488529A (en) Information processing method, information processing apparatus, server, and storage medium
CN111914945A (en) Data processing method and device, image generation method and electronic equipment
CN110599581A (en) Image model data processing method and device and electronic equipment
CN112487223A (en) Image processing method and device and electronic equipment
CN111813529A (en) Data processing method and device, electronic equipment and storage medium
CN111582382A (en) State recognition method and device and electronic equipment
CN110889467A (en) Company name matching method and device, terminal equipment and storage medium
CN113643706B (en) Speech recognition method, device, electronic equipment and storage medium
CN112667864B (en) Graph alignment method and device, electronic equipment and storage medium
CN115221537A (en) Model processing method and device, storage medium and electronic equipment
CN111898033A (en) Content pushing method and device and electronic equipment
CN114298182A (en) Resource recall method, device, equipment and storage medium
CN113569034A (en) Information searching method and device, electronic equipment and storage medium
CN114625338A (en) Random number acquisition method, random number storage device, electronic equipment and medium
CN113051126A (en) Image construction method, device and equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination