A method, device and computer equipment for standardizing conversion of hand-painted logos

By constructing a normalized conversion network and utilizing generative adversarial networks and mutual information optimization, the real-time normalized conversion problem of hand-drawn sign recognition is solved, the ability to understand irregular signs is improved, and situational awareness and command decision-making are supported.

CN115565029BActive Publication Date: 2025-09-23NAT UNIV OF DEFENSE TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211206592.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-29
Publication Date
2025-09-23
Estimated Expiration
2042-09-29

AI Technical Summary

Technical Problem

Existing hand-drawn sign recognition methods cannot achieve real-time and rapid normalization conversion in situation mapping, especially the computer's ability to understand irregular signs is insufficient, which affects situational awareness and command decision-making.

Method used

A normalized transformation network is constructed, including an encoding network and a generative adversarial network. By obtaining a training set of identification samples, the mutual information and distance objective functions of the generation network and the identification network are used to optimize the network to generate the expected output identification.

Benefits of technology

It improves the robustness of the standardized conversion of hand-drawn signs, enhances the ability to understand irregular signs, and supports real-time and rapid situational awareness and command decision-making.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115565029B_ABST
    Figure CN115565029B_ABST
Patent Text Reader

Abstract

The present application relates to a method, apparatus, and computer device for normalized conversion of hand-drawn logos, comprising: constructing a normalized conversion network; the normalized conversion network comprising an encoding network and a generative adversarial network; inputting hand-drawn logo samples from a logo sample training set into a pre-trained encoding network to obtain corresponding implicit codes; using a generative network to obtain generated logos based on random noise and the implicit codes; constructing a first objective function of the generative network based on the mutual information between the implicit codes and the generated logos; constructing a second objective function of the discriminative network based on the distance between the generated logos and corresponding standard logo samples; optimizing the first and second objective functions to obtain a trained normalized conversion network; and using the trained normalized conversion network to perform normalized conversion of hand-drawn logos. The present invention can improve the robustness of normalized conversion of hand-drawn logos.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer vision technology, and in particular to a method, apparatus, and computer device for standardizing conversion of hand-drawn logos. Background Art

[0002] Situation mapping is an important way and means to adapt to informationized confrontation, improve command and decision-making capabilities, and accelerate the awareness of the situation in the task execution environment. At present, the main means used for situation mapping is still based on database correlation technology, supplemented by computer graphics. Its disadvantage is that some mapping information cannot be accurately identified, resulting in information exchange deficit, affecting situation awareness capabilities, and interfering with commanders' judgment of the environmental situation.

[0003] Existing methods for hand-drawn symbol recognition can be divided into two categories: matching recognition methods based on structural features and databases, and recognition methods based on statistical models. Matching recognition based on structural features and databases is a traditional method for hand-drawn military symbol recognition. This method first defines image categories based on different features and then compares the identified features with a database. Common algorithms include methods based on primitive representation and recognition methods based on geometric features. Methods based on statistical models utilize machine learning. These methods can achieve hand-drawn symbol recognition, but post-recognition standardization has not been further developed. Currently, the mapping of confrontational situations requires real-time and rapid performance, placing higher demands on algorithm recognition efficiency. Furthermore, in situation mapping, in addition to standard symbols, a large number of irregular symbols exist that cannot be described using formatted data. These irregular symbols often represent important information such as mission paths, attack directions, and strategic tactics, playing a vital role in mission command. Therefore, computer understanding of these irregular symbols has long been a focus of research. Summary of the Invention

[0004] Based on this, it is necessary to provide a method, device and computer equipment for the standardized conversion of hand-drawn signs to address the above technical problems, so as to improve the robustness of the standardized conversion of hand-drawn signs.

[0005] A method for standardizing and converting hand-drawn logos, comprising:

[0006] Obtaining a logo sample training set; the logo sample training set includes paired hand-drawn logo samples and standard logo samples;

[0007] Constructing a normalized transformation network; the normalized transformation network includes an encoding network and a generative adversarial network; the generative adversarial network includes a generating network and a discriminating network;

[0008] Inputting hand-drawn logo samples in the logo sample training set into the pre-trained encoding network to obtain corresponding implicit codes, using a generative network to obtain generated logos based on the implicit codes and random noise obtained by random sampling, constructing a first objective function of the generative network based on the mutual information between the implicit codes and the generated logos, and constructing a second objective function of the discriminative network based on the distance between the generated logos and the corresponding standard logo samples;

[0009] Optimizing the first objective function and the second objective function to obtain a trained normalized conversion network;

[0010] The trained normalized conversion network is used to perform normalized conversion of hand-drawn logos.

[0011] A device for converting hand-painted marks into standardized form, the device comprising:

[0012] An acquisition module is used to acquire a logo sample training set; the logo sample training set includes paired hand-drawn logo samples and standard logo samples;

[0013] A network construction module, configured to construct a normalized transformation network; the normalized transformation network includes an encoding network and a generative adversarial network; the generative adversarial network includes a generative network and a discriminative network;

[0014] a function construction module, configured to input the hand-drawn identification samples in the identification sample training set into the pre-trained encoding network to obtain corresponding implicit codes, use a generative network to obtain generated identifications based on random noise obtained by random sampling and the implicit codes, construct a first objective function of the generative network based on the mutual information between the implicit codes and the generated identifications, and construct a second objective function of the discriminative network based on the distance between the generated identifications and the corresponding standard identification samples;

[0015] A training module is used to optimize the first objective function and the second objective function to obtain a trained normalized conversion network.

[0016] The conversion module is used to perform the normalized conversion of the hand-drawn logo using the trained normalized conversion network.

[0017] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and wherein the processor implements the steps of the method described in any one of the above embodiments when executing the computer program.

[0018] The above-mentioned method, device and computer equipment for the normalized conversion of hand-drawn logos include: constructing a normalized conversion network; the normalized conversion network includes a coding network and a generative adversarial network; inputting hand-drawn logo samples in the logo sample training set into a pre-trained coding network to obtain corresponding implicit codes, using a generative network to obtain random noise and implicit codes obtained by random sampling to obtain a generated logo, constructing a first objective function of the generative network according to the mutual information of the implicit code and the generated logo, constructing a second objective function of the identification network according to the distance between the generated logo and the corresponding standard logo sample, and using Huber loss as the overall objective function of the normalized conversion network; optimizing the first objective function, the second objective function and the overall objective function to obtain a trained normalized conversion network; and using the trained normalized conversion network to perform normalized conversion of hand-drawn logos. Unlike traditional generative networks that take a single noise vector as input, the input of the generative network in the present invention is a concatenated vector of random noise and implicit code. At the same time, the present invention uses mutual information to constrain the relationship between the implicit code and the generated logo in the random variable (i.e., the hand-drawn logo sample), thereby increasing the diversity of the model input and giving the trained model a certain ability to resist interference. At the same time, the use of mutual information makes the coupling between the generated vector and the implicit code greater, and under the same input, a more expected output logo will be generated. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 A schematic flow chart of a method for normalizing hand-drawn logos according to an embodiment;

[0020] Figure 2 A general diagram of the military standard in one embodiment;

[0021] Figure 3 Schematic diagram comparing the enhanced military standard and the original military standard in one embodiment: (a) is the original military standard before enhancement, and (b) is the enhanced military standard;

[0022] Figure 4 A schematic diagram of image segmentation results in another embodiment;

[0023] Figure 5 A schematic diagram of image grayscale processing results in one embodiment;

[0024] Figure 6 A schematic diagram of an image dataset increment in one embodiment;

[0025] Figure 7 This is a graph of manual annotation results for an embodiment;

[0026] Figure 8 A diagram of a network model architecture in one embodiment;

[0027] Figure 9It is a structural block diagram of a normalization conversion device for hand-drawn marks in one embodiment;

[0028] Figure 10 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0029] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0030] In one embodiment, Figure 1 As shown, a method for normalizing hand-drawn logos is provided, comprising the following steps:

[0031] Step 102: Obtain a training set of identified samples.

[0032] The logo sample training set includes paired hand-drawn logo samples and standard logo samples.

[0033] Step 104: construct a normalized transformation network.

[0034] The normalized transformation network includes the encoding network and the generative adversarial network. The generative adversarial network includes the generator network and the discriminator network.

[0035] In step 106, the hand-drawn identification samples in the identification sample training set are input into a pre-trained encoding network to obtain the corresponding implicit code, and a generation network is used to obtain random noise based on the implicit code and random sampling to obtain a generated identification. The first objective function of the generation network is constructed based on the mutual information between the implicit code and the generated identification, and the second objective function of the identification network is constructed based on the distance between the generated identification and the corresponding standard identification sample.

[0036] Step 108: Optimize the first objective function and the second objective function to obtain a trained normalized conversion network.

[0037] Step 110: Use the trained normalized conversion network to perform normalized conversion of the hand-drawn logo.

[0038] The above-mentioned method for normalized conversion of hand-drawn logos includes: constructing a normalized conversion network; the normalized conversion network includes an encoding network and a generative adversarial network; inputting hand-drawn logo samples in a logo sample training set into a pre-trained encoding network to obtain corresponding implicit codes; using a generative network to obtain random noise and implicit codes obtained by random sampling to obtain a generated logo; constructing a first objective function of the generative network based on the mutual information between the implicit code and the generated logo, and constructing a second objective function of the discriminative network based on the distance between the generated logo and the corresponding standard logo sample; optimizing the first objective function and the second objective function to obtain a trained normalized conversion network; and using the trained normalized conversion network to perform normalized conversion of the hand-drawn logo. Unlike traditional generative networks that use a single noise vector as input, the input of the generative network in the present invention is a concatenation vector of random noise and implicit codes. At the same time, the present invention uses mutual information to constrain the relationship between the implicit codes in the random variables (i.e., the hand-drawn logo samples) and the generated logo, thereby increasing the diversity of the model input and giving the trained model a certain ability to resist interference; and using mutual information to make the coupling between the generated vector and the implicit code greater, so that under the same input, a more expected output logo will be generated.

[0039] In one embodiment, the step of obtaining a training set of identified samples includes:

[0040] Obtaining an original logo sample set; the original logo sample set includes an original hand-drawn logo sample and an original standard logo sample;

[0041] The original logo sample set is subjected to clarity enhancement, region segmentation, and grayscale processing to obtain an intermediate logo sample set; the intermediate logo sample set includes intermediate hand-painted logo samples and intermediate standard samples;

[0042] Each hand-drawn logo sample and the intermediate standard sample in the intermediate logo sample set is rotated at multiple angles to obtain a logo sample training set with an expanded data volume.

[0043] Taking the standard military standards used by the Navy as an example, the sample collection process and military standard preprocessing process are introduced in detail.

[0044] Get the general map of 113 military standards, such as Figure 2 shown.

[0045] However, this image is still far from the dataset required for this experiment, so image preprocessing is performed below.

[0046] The first step of image preprocessing is to enhance the clarity. Since the original image cannot be directly obtained, Figure 2 If the clarity is not enough, the clarity is enhanced and the enhanced image is compared with the original image. Figure 3 shown.

[0047] The second step of image preprocessing is image segmentation. Since the data set required for this experiment is a single military standard image, Figure 3 (b) is used to perform region segmentation. The method used is to use the crop function in the Image package under the PIL library. The original image is evenly divided according to its length and width. After segmentation, the resize function is used to unify the image pixels to 256×256. At the same time, the generated images are sorted and named. The results after processing are as follows Figure 4 shown.

[0048] The third step of image preprocessing is image grayscale. To further enhance the image representation, and considering that the computational complexity of a single grayscale channel is much smaller than that of RGB3 channels in model training, and that this experiment has no requirements for color space, image grayscale processing is performed. The results after processing are as follows: Figure 5 shown.

[0049] The fourth step of image preprocessing is to increase the image dataset. Since 113 images are too small for training complex neural network models, gradient vanishing and model overfitting problems are prone to occur during training. Therefore, a data increment operation is performed to rotate each image by 90°, 180° and 270°, so that the image dataset is expanded by 3 times to 452 images. In order to train the model more fully, the processing is as follows: Figure 6 shown.

[0050] After the above four steps of image preprocessing, a standard military standard dataset that can be used for pre-training is basically obtained. In addition, for the corresponding hand-drawn dataset, 113 corresponding hand-drawn pictures are marked manually, such as Figure 7 As shown, the same preprocessing operation is then performed.

[0051] In one embodiment, the hand-drawn logo samples in the logo sample training set are input into a pre-trained encoding network to obtain corresponding implicit codes, including:

[0052] The hand-drawn logo samples in the logo sample training set are input into a pre-trained encoding network; the encoding network includes a feature pyramid, and a single feature vector of the last layer of the encoding network is obtained. The single feature vector includes multiple layers of feature maps extracted according to the feature pyramid. The hand-drawn logo samples are encoded into an extended latent space according to the single feature vector to obtain the corresponding latent code.

[0053] In one embodiment, a generation network is used to obtain a generation identifier based on random noise and implicit coding obtained by random sampling, including:

[0054] The coarse-grained features and medium-grained features of a single feature vector are retained. The coarse-grained features and medium-grained features are extracted through the feature pyramid. Random noise with the same total dimension as the coarse-grained features and medium-grained features is obtained by random sampling in the extended latent space. The coarse-grained features, medium-grained features and random noise are input into the generation network to obtain the generation identity.

[0055] In one embodiment, constructing a first objective function of a generative network based on the mutual information of the implicit code and the generated identifier includes:

[0056] The first objective function of constructing the generative network based on the mutual information between the implicit code and the generated identity is:

[0057] min G V1(D,G)=V(D,G)-λI(c;G(z,c)) (1)

[0058] Among them, D represents the identification network, G represents the generation network, c represents the implicit code, z represents random noise, min G V1(D, G) represents the loss function of the minimization generative network, V(D, G) represents the loss function of the generative adversarial network, λ is a preset hyperparameter, and I(c; G(z, c)) represents the mutual information between the implicit code and the generated identity.

[0059] The second objective function of the identification network is constructed according to the distance between the generated identification and the corresponding standard identification sample, including:

[0060]

[0061] Among them, V(G, D) represents the loss function of the identification network, Indicates the EM distance between the generated logo and the corresponding standard logo sample.

[0062] The Lipschitz function in the formula is defined as follows

[0063] ||f(x1)-f(x2)||≤K||x1-x2|| (3)

[0064] This formula requires that the change in input multiplied by K be greater than the change in output. This means that a change in input cannot cause a large change in output. In other words, the output cannot change too quickly to ensure a smooth function. When the multiplier K = 1, the Lipschitz function is called 1-Lipschitz.

[0065] EM distance, also known as Wasserstein distance, is defined as follows:

[0066] W(P,Q)=inf γ∈∩(P,Q) E (x,y)~γ [||xy||] (4)

[0067] Among them, ∩(P, Q) represents the set of all possible joint probability distributions of P and Q; γ(x, y) represents the probability that x appears in P and y appears in Q at the same time, and the marginal probability distribution of γ is P and Q.

[0068] Compared with traditional GAN, the model using EM distance has the following four changes:

[0069] Remove sigmoid from the last layer of the discriminator

[0070] The loss of the generator and discriminator is no longer log

[0071] When training the discriminator, the value of each parameter update is limited to a range

[0072] No longer uses the momentum-based gradient optimization algorithm, but uses the stochastic gradient descent SGD algorithm

[0073] The first two points indicate that JS divergence is no longer used, while the third point is used to ensure the smoothness of the discriminator's objective function in actual training, and the last point avoids large fluctuations in the discriminator loss.

[0074] The above four points ensure that the discriminator will not make very different judgments for two slightly different input data. However, in the actual training of GAN, it is usually hoped that the loss returned by the discriminator can maximize the score gap between the real data and the generated data. The strategy in the second point will limit the value range of each parameter in the discriminator.

[0075] In one embodiment, optimizing the first objective function includes:

[0076] The variational inference method is used to solve the lower bound of the mutual information in the first objective function:

[0077] I(c;G(z,c)=H(c)-H(c|G(z,c))=

[0078] =H(c)+∫∫P(G(z,c))P(c|G(z,c))logP(c|G(z,c))dcd(G(z,c))

[0079] Where H(c) represents the marginal entropy of the implicit code, H(c|G(z, c)) represents the conditional entropy of the implicit code and the generated identity, P(G(z, c)) represents the probability of the generated identity, and P(c|G(z, c)) represents the conditional probability of the implicit code and the generated identity.

[0080] Let x = G(z, c),

[0081]

[0082] Among them, KL(P||Q) represents the KL divergence of P(c|x) and Q(c|x), P(c|x) represents the true distribution, that is, the distribution of the standard identification sample, and Q(c|x) represents the non-true distribution, that is, the distribution of the generated identification;

[0083] Since KL(p||q) is always greater than or equal to 0, we obtain the lower bound of -H(c|G(z, c)):

[0084] -H(c|G(z,c))≥∫∫P(x)P(c|x)logP(c|x)dcdx

[0085] Write the integral in expected form:

[0086] -H(c|G(z,c))≥E x~G(z,c) [E c’~P(c|x) logQ(c′,x)

[0087] Substitute the obtained lower bound into the mutual information to obtain the lower bound of the mutual information:

[0088] I(c;G(z,c))=H(c)-H(c|G(z,c))≥E x~G(z,c) [E c’~P(c|x) logQ(c′|x)+H(c)

[0089] Among them, c' represents the generated identifier;

[0090] Define a function L1(G,Q)=E c~P(c)x~G(z,c) [logQ(c|x)]+H(c), due to arbitrary variables X, Y and function f(x, y), under certain conditions, the following equation is satisfied:

[0091] E x~X,y~Y|x [f(x, y)] = E x~X,y~Y|x,x’~X|y [f(x′, y)]

[0092] Therefore, the function L1(G, Q) is the lower bound of the mutual information of I(c; G(z, c)):

[0093] L1(G,Q)=E c~P(c)x~G(z,c) [logQ(c|x)]+H(c)

[0094] =E x~G(z,c) [E c’~P(c|x) logQ(c′|x)]+H(c)≤I(c;G(z,c))

[0095] The first objective function is optimized by combining the lower bound of mutual information.

[0096] In general, the network training process involved in this method is divided into three parts: the first part trains the discriminator, training the ability to distinguish real images from randomly generated images, mainly using Huber loss as cross entropy to provide a descending gradient for training; the second part trains the generator, fixing the discriminator in the first part and not participating in the training, and using formula (1); the third part fixes the generator and trains the discriminator to distinguish real images from generated images, using formula (2).

[0097] In one embodiment, a fusion model of the pix2pix encoding network and the StyleGAN generation network is used. The hand-drawn logo is input into the pix2pix encoding network; then, based on the feature pyramid network structure, the style vector is extracted from different pyramid scales, and the feature vector is directly input into the StyleGAN generation network according to its spatial scale. In this way, the image can be reconstructed directly, avoiding the time-consuming optimization process. The pix2pix encoder can obtain the hidden features of the input image through unsupervised learning, including the object posture and object shape, and use the learned features to reconstruct the original data; then, StyleGAN is used to reconstruct a new view that is different from the original object shape through the posture and shape data. The model architecture diagram is shown in the figure below. Figure 8 shown.

[0098] Our Pixel&StyleGAN framework is built on a pre-trained StyleGAN generator and the representational power of the W+ latent space. In order to leverage this representation and be able to match each input image to an accurate encoding of the latent domain, the architecture uses an encoding network from pix2pix. A simple technique for embedding this domain is to directly encode a given input image to W+ using a single 512-dimensional vector obtained from the last layer of the encoder network, thereby learning all style vectors together. In StyleGAN, it is shown that different style inputs correspond to different levels of detail, which are roughly divided into three groups: coarse, medium, and fine. Based on the above observations, in Pixel&StyleGAN, the encoder network is extended with a feature pyramid to generate three layers of feature maps, and the feature maps are trained using Figure 8 The simple intermediate network Pixel2Style shown extracts the style from these feature maps. After the style is aligned with the hierarchical representation, the output image is generated based on the size of the style input generator, and the conversion from input pixels to output pixels is completed through the intermediate style representation. The complete architecture is shown in Figure 8 However, such an architecture has a strong bottleneck and is difficult to fully express the details of the original image, thus limiting the reconstruction quality.

[0099] As in StyleGAN, we further define w as the average style vector of the pre-trained generator. Given an input image x, the output of our model is defined as

[0100]

[0101] where E(·) and G(·) denote the encoder and StyleGAN generator, respectively. In this formulation, the encoder aims to learn the latent code relative to the mean style vector, which can be better initialized.

[0102] Translating between images via the style domain distinguishes Pixel2Style from many standard image-to-image translation frameworks because it enables the model to operate globally rather than locally, without requiring pixel-to-pixel correspondences. This is a desirable property, as local biases have been shown to limit current approaches when dealing with non-local translations. This ability to independently manipulate semantic properties motivates another desirable property: support for multimodal synthesis. Since some translation tasks are ambiguous, a single input image may correspond to multiple outputs, enabling optimal sampling of these possible outputs. While this requires specialized changes in standard image-to-image architectures, our framework inherently supports this by simply sampling the style vector. In practice, this is accomplished by randomly sampling a vector w and generating the corresponding latent code in w+. Style mixing is then computed by replacing the latent layer with the randomly generated latent vector with an α parameter to mix the two styles.

[0103] It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. In addition, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0104] In one embodiment, Figure 9 As shown, a device for normalizing and converting hand-drawn marks is provided, comprising: an acquisition module, a network construction module, a training module, and a conversion module, wherein:

[0105] An acquisition module is used to acquire a logo sample training set; the logo training set includes paired hand-drawn logo samples and standard logo samples;

[0106] A network building module for constructing a normalized transformation network; the normalized transformation network includes an encoding network and a generative adversarial network;

[0107] A function construction module is used to input hand-drawn logo samples in the logo sample training set into a pre-trained encoding network to obtain the corresponding implicit code, use a generative network to obtain random noise and implicit codes obtained by random sampling to obtain a generated logo, construct a first objective function of the generative network based on the mutual information between the implicit code and the generated logo, and construct a second objective function of the discriminative network based on the distance between the generated logo and the corresponding standard logo sample;

[0108] The training module is used to optimize the first objective function and the second objective function to obtain a trained normalized conversion network.

[0109] The conversion module is used to perform normalized conversion of hand-drawn logos using a trained normalized conversion network.

[0110] The specific definition of a standardized conversion device for hand-drawn marks can be found in the definition of the standardized conversion method for hand-drawn marks above, and will not be repeated here. The various modules in the above-mentioned standardized conversion device for hand-drawn marks can be implemented in whole or in part by software, hardware, or a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to the above modules.

[0111] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 10 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a standardized conversion method for hand-painted markings is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad provided on the computer device housing, or an external keyboard, touchpad or mouse.

[0112] Those skilled in the art will understand that Figure 10The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0113] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps of the method in the above embodiment when executing the computer program.

[0114] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0115] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0116] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.

Claims

1. A method for standardizing the conversion of hand-drawn logos, characterized in that: The method comprises: Obtaining a logo sample training set; the logo sample training set includes paired hand-drawn logo samples and standard logo samples; Constructing a normalized transformation network; the normalized transformation network includes an encoding network and a generative adversarial network; the generative adversarial network includes a generating network and a discriminating network; Inputting hand-drawn logo samples in the logo sample training set into the pre-trained encoding network to obtain corresponding implicit codes, using a generative network to obtain generated logos based on the implicit codes and random noise obtained by random sampling, constructing a first objective function of the generative network based on the mutual information between the implicit codes and the generated logos, and constructing a second objective function of the discriminative network based on the distance between the generated logos and the corresponding standard logo samples; Optimize the first objective function and the second objective function to obtain a trained normalized transformation network; and use a variational inference method to obtain a lower bound of the mutual information in the first objective function: in, represents the marginal entropy of the implicit code, represents the conditional entropy of implicit encoding and generated identity, represents the probability of generating identification, represents the conditional probability of implicit encoding and generated identification; make , in, )express and The KL divergence of represents the true distribution, that is, the distribution of the standard identification sample, represents the non-real distribution, i.e., the distribution that generates the identity; because Always greater than or equal to 0, you can get The lower bound of : Write the integral in expected form: Substitute the obtained lower bound into the mutual information to obtain the lower bound of the mutual information: in, Indicates the generation of identification; Define a function , since any variables X, Y and function f(x,y) satisfy the following formula under certain conditions: Therefore the function , which is The lower bound of mutual information is: Optimizing the first objective function in combination with a lower bound of the mutual information; The trained normalized conversion network is used to perform normalized conversion of hand-drawn logos.

2. The method according to claim 1, characterized in that The constructing the first objective function of the generation network according to the mutual information between the implicit code and the generation identifier includes: The first objective function of the generation network constructed according to the mutual information between the implicit code and the generation identifier is: (1) in, represents the identification network, represents the generative network, Indicates implicit encoding, represents random noise, represents the loss function that minimizes the generation network, represents the loss function of the generative network, To preset hyperparameters, represents the mutual information between the implicit encoding and the generated identity.

3. The method according to claim 1, characterized in that Constructing a second objective function of the identification network according to the distance between the generated identification and the corresponding standard identification sample, including: The second objective function of the identification network is constructed based on the EM distance between the generated identification and the corresponding standard identification sample: (2) in, represents the loss function of the identification network, Indicates the EM distance between the generated logo and the corresponding standard logo sample.

4. The method according to claim 1, wherein Inputting the hand-drawn logo samples in the logo sample training set into the pre-trained encoding network to obtain corresponding implicit codes, including: Inputting the hand-drawn logo samples in the logo sample training set into the pre-trained encoding network; the encoding network includes a feature pyramid; Obtaining a single feature vector of the last layer of the encoding network; the single feature vector includes multiple layers of feature maps extracted according to the feature pyramid; The hand-drawn logo sample is encoded into an extended implicit space according to the single feature vector to obtain a corresponding implicit code.

5. The method according to claim 4, characterized in that A generation network is used to obtain a generation identifier based on random noise obtained by random sampling and the implicit code, including: retaining the coarse-grained features and the medium-grained features of the single feature vector; the coarse-grained features and the medium-grained features are extracted through the feature pyramid; Randomly sampling in the expanded latent space to obtain random noise with the same total dimension as the coarse-grained features and the medium-grained features; The coarse-grained features, the medium-grained features and the random noise are input into a generation network to obtain a generation identifier.

6. The method according to claim 1, characterized in that The steps to obtain the identification sample training set include: Obtaining an original logo sample set; the original logo sample set includes an original hand-drawn logo sample and an original standard sample; The original logo sample set is subjected to definition enhancement, region segmentation, and grayscale processing to obtain an intermediate logo sample set; the intermediate logo sample set includes intermediate hand-drawn logo samples and intermediate standard logo samples; Each hand-drawn logo sample and the intermediate standard sample in the intermediate logo sample set is rotated at multiple angles to obtain a logo sample training set with an expanded data volume.

7. A standardized conversion device for hand-drawn logos, characterized in that: The device for normalizing and converting hand-drawn marks is used to implement the method according to any one of claims 1 to 6, and the device comprises: An acquisition module is used to acquire a logo sample training set; the logo sample training set includes paired hand-drawn logo samples and standard logo samples; A network construction module, configured to construct a normalized transformation network; the normalized transformation network includes an encoding network and a generative adversarial network; the generative adversarial network includes a generative network and a discriminative network; a function construction module, configured to input the hand-drawn identification samples in the identification sample training set into the pre-trained encoding network to obtain corresponding implicit codes, use a generative network to obtain generated identifications based on random noise obtained by random sampling and the implicit codes, construct a first objective function of the generative network based on the mutual information between the implicit codes and the generated identifications, and construct a second objective function of the discriminative network based on the distance between the generated identifications and the corresponding standard identification samples; A training module, configured to optimize the first objective function and the second objective function to obtain a trained normalized conversion network; The conversion module is used to perform the normalized conversion of the hand-drawn logo using the trained normalized conversion network.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Handwritten numeral generation method based on parameter optimization generative adversarial network

    CN110598806A

  • Transformation of hand-drawn sketches to digital images

    US20210064858A1