Form style conversion method and device based on generative adversarial neural network, equipment and medium
Patent Information
- Application Number
- CN202311137492.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-04
- Publication Date
- 2026-10-20
- Estimated Expiration
- 2043-09-04
AI Technical Summary
[0004]本发明的目的是提供一种基于生成对抗神经网络的表单风格转换方法、装置、计算机设备及计算机可读存储介质,用以解决现有表单设计工具所存在增加用户操作负担和无法根据用户需求进行个性化修改,使得难以满足用户的多样化个性需求的问题
[0040](1)本发明创造性提供了一种采用表单模板和生成对抗神经网络进行表单风格转换模型训练并应用的新方案,即先应用具有不同风格的多个表单模板,对包括有表单生成器和表单鉴别器的生成对抗神经网络进行训练,得到基于所述生成对抗神经网络的且已完成预训练的表单风格转换模型,然后获取用户提供的待转表单和至少一个用户指定风格标签,并将所述待转表单作为原始表单,以及将所述至少一个用户指定风格标签作为目标风格标签,输入在所述表单风格转换模型中的所述表单生成器,生成得到转后新表单,如此不但可以根据用户需求自动、快速且准确地将表单转换成符合用户想象和需求的风格结果,还可以大大减轻用户的操作负担(即用户仅需上传待转表单和指定目标风格标签),便于实际应用和推广;
Smart Images

Figure CN117131850B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of information processing technology, and specifically relates to a method, apparatus, device and medium for form style conversion based on generative adversarial neural networks. Background Technology
[0002] Forms are digital media used to store data. They contain various components, and users can design and generate forms according to their needs. In modern enterprise information systems, forms are widely used for data input and management, and have become an important tool for executing business processes in large organizations. On a form page, style design is a crucial factor in its appearance. Most existing form design tools allow users to manually modify form styles, such as changing button colors and background patterns. However, this usually requires users to have some design knowledge and spare time, thus increasing the user's operational burden.
[0003] Currently, although some form design tools offer form templates for users to choose from, these templates have fixed styles and lack an understanding of user habits and design intentions. They cannot be customized according to user needs, making it difficult to meet diverse individual user requirements. Therefore, how to automatically, quickly, and accurately convert forms into styles that match user expectations and needs, while reducing the user's operational burden, is a topic that urgently needs to be researched by those skilled in the art. Summary of the Invention
[0004] The purpose of this invention is to provide a form style conversion method, apparatus, computer device, and computer-readable storage medium based on generative adversarial neural networks, in order to solve the problems of existing form design tools that increase the user's operational burden and cannot be customized according to user needs, making it difficult to meet the diverse individual needs of users.
[0005] To achieve the above objectives, the present invention adopts the following technical solution:
[0006] Firstly, a form style transfer method based on generative adversarial neural networks is provided, including:
[0007] Obtain multiple form templates with different styles, wherein each form template has at least one pre-marked style tag;
[0008] By applying the multiple form templates, a generative adversarial neural network including a form generator and a form discriminator is trained to obtain a pre-trained form style transfer model based on the generative adversarial neural network. The form generator is used to generate a new form after inputting an original form and at least one target style tag. The form discriminator is used to identify the authenticity of the new form based on the target form having the at least one target style tag.
[0009] Obtain the form to be converted provided by the user and at least one user-specified style tag, wherein the at least one user-specified style tag is completely different from or partially different from at least one current style tag of the form to be converted;
[0010] The form to be converted is used as the original form, and the at least one user-specified style tag is used as the at least one target style tag. These are input into the form generator in the form style conversion model to generate the new converted form.
[0011] The new form after the conversion is returned to the user.
[0012] Based on the above-mentioned invention, a novel scheme is provided for training and applying a form style conversion model using form templates and a generative adversarial neural network (GAN). First, multiple form templates with different styles are applied to train the GAN, which includes a form generator and a form discriminator, resulting in a pre-trained form style conversion model based on the GAN. Then, the user-provided form to be converted and at least one user-specified style tag are obtained. The form to be converted is used as the original form, and the at least one user-specified style tag is used as the target style tag. These are input into the form generator within the form style conversion model to generate the converted new form. This not only automatically, quickly, and accurately converts forms to a style that matches the user's expectations and needs, but also significantly reduces the user's workload (i.e., the user only needs to upload the form to be converted and the specified target style tag), facilitating practical application and promotion.
[0013] In one possible design, the at least one style tag, the at least one target style tag, the at least one user-specified style tag, or the at least one current style tag includes a form page background style tag, a form page text style tag, a form page control style tag, and / or a form page control typography style tag.
[0014] In one possible design, the multiple form templates are applied to train a generative adversarial neural network (GAN) including a form generator and a form discriminator, resulting in a pre-trained form style transfer model based on the GAN, comprising:
[0015] Select each pair of original form and target form from the plurality of form templates, wherein the original form is the first form template among the plurality of form templates, and the target form is the second form template among the plurality of form templates that is different from the first form template;
[0016] The original form and the target form in each pair of original forms and target forms are input into the form generator of the generative adversarial neural network, and the target form is input into the form discriminator of the generative adversarial neural network. The generative adversarial neural network is trained to obtain a pre-trained form style transfer model based on the generative adversarial neural network. The form generator is used to generate a new form after inputting the original form and at least one target style tag, and the form discriminator is used to identify the authenticity of the new form based on the target form with the at least one target style tag.
[0017] In one possible design, the multiple form templates are applied to train a generative adversarial neural network (GAN) including a form generator and a form discriminator, resulting in a pre-trained form style transfer model based on the GAN, comprising:
[0018] Select each pair of original form and target form from the plurality of form templates, wherein the original form is the first form template among the plurality of form templates, and the target form is the second form template among the plurality of form templates that is different from the first form template;
[0019] For each pair of original forms and target forms, the at least one style tag of the corresponding original form and the corresponding target form is input into the form generator of the generative adversarial neural network, and the corresponding target form is input into the form discriminator of the generative adversarial neural network. The generative adversarial neural network is trained to obtain a corresponding pre-trained form style transfer model based on the generative adversarial neural network. The form generator is used to generate a new form after inputting the original form and at least one target style tag, and the form discriminator is used to identify the authenticity of the new form based on the target form with the at least one target style tag.
[0020] In one possible design, the form to be converted is used as the original form, and the at least one user-specified style tag is used as the at least one target style tag. These are input into the form generator in the form style conversion model to generate a new converted form, including:
[0021] Find an original form with at least one current style tag and a target form with at least one user-specified style tag from the plurality of form templates;
[0022] The form to be converted is used as the original form, and the at least one user-specified style tag is used as the at least one target style tag. These are input into the form generator in the specific form style conversion model to generate a new form after conversion. The specific form style conversion model refers to the form style conversion model corresponding to the original form and the target form.
[0023] In one possible design, returning the new form to the user after the redirection includes:
[0024] The user previews the new form after conversion and at least one adjustable style label on the human-computer interaction interface, wherein each of the at least one adjustable style label provides at least two fine-tuning options;
[0025] When it is detected that the user has made a fine-tuning selection of the at least one adjustable style tag and made a re-conversion decision, the re-converted new form is used as the original form, and the user's fine-tuning selection result of the at least one adjustable style tag is used as the at least one target style tag. These are then re-entered into the form generator in the form style conversion model to generate a new re-converted form.
[0026] The new form after the conversion is returned to the user.
[0027] In one possible design, after previewing the new form and at least one adjustable style tag, the method further includes:
[0028] When it is detected that the user has not made a fine-tuning selection of the at least one adjustable style tag and has made a one-click application to the whole site decision, each form to be converted selected in the one-click application to the whole site decision will be used as the original form, and at least one current style tag of the converted new form will be used as the at least one target style tag. These will be input into the form generator in the form style conversion model to generate each converted new form that corresponds one-to-one with each form to be converted. The at least one current style tag of the converted new form is completely different or partially different from the at least one current style tag of each form to be converted.
[0029] The various new forms after the conversion are returned to the user.
[0030] Secondly, a form style conversion device based on a generative adversarial neural network is provided, including a form template acquisition module, a conversion model training module, a user requirement acquisition module, a conversion model application module, and a new form return module;
[0031] The form template acquisition module is used to acquire multiple form templates with different styles, wherein each form template in the multiple form templates has at least one pre-marked style tag;
[0032] The conversion model training module is communicatively connected to the form template acquisition module. It is used to apply the multiple form templates to train a generative adversarial neural network including a form generator and a form discriminator to obtain a pre-trained form style conversion model based on the generative adversarial neural network. The form generator is used to generate a new form after inputting an original form and at least one target style tag. The form discriminator is used to identify the authenticity of the new form based on the target form with the at least one target style tag.
[0033] The user requirement acquisition module is used to acquire the form to be transferred provided by the user and at least one user-specified style tag, wherein the at least one user-specified style tag is completely different from or partially different from at least one current style tag of the form to be transferred;
[0034] The conversion model application module is communicatively connected to the conversion model training module and the user requirement acquisition module, respectively. It is used to input the form to be converted as the original form and the at least one user-specified style tag as the at least one target style tag into the form generator in the form style conversion model to generate a new form after conversion.
[0035] The new form return module is communicatively connected to the conversion model application module and is used to return the converted new form to the user.
[0036] Thirdly, the present invention provides a computer device comprising a memory, a processor, and a transceiver connected in sequence, wherein the memory is used to store a computer program, the transceiver is used to send and receive messages, and the processor is used to read the computer program and execute the form style conversion method as described in the first aspect or any possible design in the first aspect.
[0037] Fourthly, the present invention provides a computer-readable storage medium storing instructions that, when executed on a computer, perform the form style conversion method as described in the first aspect or any possible design in the first aspect.
[0038] Fifthly, the present invention provides a computer program product containing instructions that, when executed on a computer, cause the computer to perform the form style conversion method as described in the first aspect or any possible design in the first aspect.
[0039] The beneficial effects of the above scheme are:
[0040] (1) This invention creatively provides a new scheme for training and applying a form style conversion model using form templates and generative adversarial neural networks. First, multiple form templates with different styles are applied to train a generative adversarial neural network including a form generator and a form discriminator to obtain a pre-trained form style conversion model based on the generative adversarial neural network. Then, the form to be converted and at least one user-specified style tag provided by the user are obtained. The form to be converted is used as the original form, and the at least one user-specified style tag is used as the target style tag. These are input into the form generator in the form style conversion model to generate a new form after conversion. In this way, the form can be automatically, quickly and accurately converted into a style result that meets the user's imagination and needs according to the user's requirements. It can also greatly reduce the user's operational burden (i.e., the user only needs to upload the form to be converted and the specified target style tag), which is convenient for practical application and promotion.
[0041] (2) It can also preview and fine-tune the style of the new form after conversion, and quickly apply the form to the whole site with one click when the user is satisfied, further reducing the user's operational burden;
[0042] (3) It can also train corresponding conversion models for each pair of original forms and target forms, which can not only help to quickly complete model pre-training, but also further ensure the accuracy of form style conversion.
[0043] (4) It can also select the most suitable conversion model for table style conversion based on the form to be converted and the specified style tag provided by the user, so as to further ensure the accuracy of form style conversion. Attached Figure Description
[0044] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0045] Figure 1 This is a flowchart illustrating the form style transfer method based on a generative adversarial neural network provided in an embodiment of this application.
[0046] Figure 2 This is a schematic diagram of the form style transfer device based on a generative adversarial neural network provided in an embodiment of this application.
[0047] Figure 3 A schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0048] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the present invention will be briefly introduced below in conjunction with the accompanying drawings and descriptions of the embodiments or the prior art. Obviously, the following description of the structure of the accompanying drawings is only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. It should be noted that the description of these embodiments is for the purpose of helping to understand the present invention, but does not constitute a limitation of the present invention.
[0049] It should be understood that although the terms "first" and "second", etc., may be used herein to describe various objects, these objects should not be limited by these terms. These terms are only used to distinguish one object from another. For example, the first object may be referred to as the second object, and similarly, the second object may be referred to as the first object, without departing from the scope of the exemplary embodiments of the invention.
[0050] It should be understood that the term "and / or" that may appear in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, B exists alone, or A and B exist simultaneously. Another example is A, B and / or C, which can mean that any one of A, B, and C or any combination thereof exists. The term " / and" that may appear in this document describes another relationship between related objects, indicating that two relationships can exist. For example, A / and B can mean: A exists alone or A and B exist simultaneously. In addition, the character " / " that may appear in this document generally indicates that the related objects before and after it are in an "or" relationship.
[0051] Example:
[0052] like Figure 1As shown, the form style transfer method based on generative adversarial neural networks provided in the first aspect of this embodiment can be executed, but is not limited to, by a computer device with certain computing resources, such as a platform server, a personal computer (PC, referring to a multi-purpose computer of a size, price, and performance suitable for personal use; desktop computers, laptops, mini-laptops, tablets, and ultrabooks are all considered personal computers), a smartphone, a personal digital assistant (PDA), or a wearable device. Figure 1 As shown, the form style conversion method may include, but is not limited to, the following steps S1 to S5.
[0053] S1. Obtain multiple form templates with different styles, wherein each form template in the multiple form templates has at least one pre-marked style tag.
[0054] In step S1, the form template refers to existing form style design results, which are used as sample data for subsequent model training. For example, existing form style design results with various styles such as minimalist, business, and artistic can be collected as form templates. Elements such as color, shape, and layout for each form style can be tagged to obtain at least one style tag for each form template. Specifically, the at least one style tag includes, but is not limited to, form page background style tags, form page text style tags, form page control style tags, and / or form page control layout style tags. Furthermore, the specific method for obtaining the multiple form templates can be, but is not limited to, conventional reading from a form database.
[0055] S2. Using the multiple form templates, train a generative adversarial neural network including a form generator and a form discriminator to obtain a pre-trained form style transfer model based on the generative adversarial neural network. The form generator is used to generate a new form after inputting an original form and at least one target style tag. The form discriminator is used to identify the authenticity of the new form based on the target form having the at least one target style tag.
[0056] In step S2, the Generative Adversarial Network (GAN) is a novel framework for estimating generative models: two models are trained simultaneously, one for capturing the data distribution and the other for discriminating whether the data is real or generated (pseudo-data). The data discrimination task uses a neural network such as a CNN to analyze and process the input data to obtain information related to the content of the input data. In contrast to the data discrimination task, in the data generation task, the data generation model generates data based on the information related to the content of the input data. For the data generation task, the input of the data generation model is uncertain, depending on the scenario and the specific model design, with style transfer being one such scenario. Generative Adversarial Networks (GANs) can be applied to style transfer. The generative adversarial neural network (GAN) has two core components: a generator (the aforementioned generative model) and a discriminator (the aforementioned discriminative model). Both the discriminator and the generator can be constructed using a multilayer perceptron (which can be viewed as a fully connected neural network, i.e., FC). During training, the key steps embodying the "adversarial" nature are: first, fixing the generator's parameters and training and optimizing the discriminator so that it can distinguish between "real data" and "fake data" as accurately as possible; then, fixing the discriminator's parameters and training and optimizing the generator so that it cannot accurately distinguish between "real data" and "fake data." After the model training is complete, the trained generator can be used to generate data. Furthermore, the discriminator can also use a convolutional neural network (Strided Convolution, a standard convolution operation; without padding, the number of channels will decrease), and the generator can also be implemented using transposed convolution (which can also be viewed as deconvolution).
[0057] In step S2, based on the principles of the generative adversarial neural network (GAN), the model can be trained to understand and imitate various form template styles. This allows the generator to attempt to generate simulated form styles, and the discriminator to attempt to distinguish between generated and real form styles. Through this adversarial interaction, the model can ultimately generate form styles closer to reality. For example, to train the model to generate retro-style forms, the generator needs to attempt to generate new retro-style forms, while the discriminator needs to distinguish between genuine and fake forms from real retro-style forms. When it is determined that the difference cannot be made, the generator can then be used to generate retro-style forms. Thus, multiple form templates can be applied, and the GAN, including the form generator and the form discriminator, can be trained to obtain the form style conversion model. Specifically, applying multiple form templates to train the GAN, including the form generator and the form discriminator, yields a pre-trained form style conversion model based on the GAN, including but not limited to steps S21-S22.
[0058] S21. Select each pair of original form and target form from the plurality of form templates, wherein the original form is the first form template among the plurality of form templates, and the target form is the second form template among the plurality of form templates that is different from the first form template.
[0059] In step S21, for example, assuming that the plurality of form templates include form template A, form template B, form template C, and form template D, the following pairs of original forms and target forms can be determined: form template A and form template B, form template B and form template A, form template A and form template C, form template C and form template A, form template A and form template D, form template D and form template A, form template B and form template C, form template C and form template B, form template B and form template D, form template D and form template B, form template C and form template D, and form template D and form template C, etc.
[0060] S22. The at least one style tag of the original form and the target form in each pair of original forms and target forms is input into the form generator of the generative adversarial neural network, and the target form is input into the form discriminator of the generative adversarial neural network. The generative adversarial neural network is trained to obtain a pre-trained form style transfer model based on the generative adversarial neural network. The form generator is used to generate a new form after inputting the original form and at least one target style tag, and the form discriminator is used to identify the authenticity of the new form based on the target form having the at least one target style tag.
[0061] In step S22, the specific method for training the generative adversarial neural network can be derived conventionally by referring to existing generative adversarial neural network training methods. Furthermore, the at least one target style tag also includes, but is not limited to, form page background style tags, form page text style tags, form page control style tags, and / or form page control layout style tags.
[0062] S3. Obtain the form to be transferred provided by the user and at least one user-specified style tag, wherein the at least one user-specified style tag is completely different from or partially different from at least one current style tag of the form to be transferred.
[0063] In step S3, the form to be converted can be, but is not limited to, uploaded by the user, and the at least one user-specified style tag can be, but is not limited to, input by the user through conventional human-computer interaction methods. For example, if an enterprise information system has a customer information collection form with a current style tag of minimalism and black-and-white color scheme, and the user wants to modify the form to make it more vivid and dynamic, i.e., to change the form style to bright colors and rounded shapes, then the user can select bright colors style tag and rounded shape style tag as the at least one user-specified style tag on the human-computer interaction interface, and upload the customer information collection form as the form to be converted. Furthermore, the at least one user-specified style tag or the at least one current style tag also includes, but is not limited to, form page background style tag, form page text style tag, form page control style tag, and / or form page control layout style tag, etc.
[0064] S4. The form to be converted is used as the original form, and the at least one user-specified style tag is used as the at least one target style tag. These are input into the form generator in the form style conversion model to generate the new converted form.
[0065] In step S4, since the form generator has been pre-trained to prevent the form discriminator from identifying the authenticity of the generated new form, it can generate the transformed new form with at least one user-specified style tag. This achieves the goal of automatically, quickly, and accurately converting the form into a style result that matches the user's expectations and needs. Furthermore, the specific number of transformed new forms generated can be pre-specified, i.e., one or more, for the user to choose from.
[0066] S5. Return the new form after conversion to the user.
[0067] In step S5, to achieve the purpose of previewing and fine-tuning the style of the converted new form, preferably, the converted new form is returned to the user, including but not limited to the following steps S51-S53: S51. Preview the converted new form and at least one adjustable style tag on the human-computer interaction interface for the user, wherein each of the at least one adjustable style tag provides at least two fine-tuning options; S52. When it is detected that the user has made a fine-tuning selection for the at least one adjustable style tag and made a re-conversion decision, the converted new form is used as the original form, and the user's fine-tuning selection result for the at least one adjustable style tag is used as the at least one target style tag, and re-entered into the form generator in the form style conversion model to generate a new converted new form; S53. The new converted new form is returned to the user. The at least one adjustable style tag also includes, but is not limited to, form page background style tags, form page text style tags, form page control style tags, and / or form page control layout style tags, etc. The aforementioned detection method utilizes existing conventional human-computer interaction methods, such as detecting whether the user has clicked the "re-convert" button. If so, the detection confirms that a re-conversion decision has been made. Furthermore, the user can also fine-tune certain styles on the re-converted form to obtain the final form. For example, during the form preview, the user can change the button color from yellow to the company logo color—orange—and click "confirm" after making the adjustments to directly generate the final form.
[0068] Following step S51, to further reduce the user's workload by quickly applying the entire site's forms with one click while ensuring user satisfaction, preferably, after previewing the converted new forms and at least one adjustable style tag, the method also includes, but is not limited to, the following steps S511-S512: S511. When it is detected that the user has not made a fine-tuning selection of the at least one adjustable style tag and has made a decision to apply the entire site with one click, each of the forms to be converted selected in the decision to apply the entire site with one click is taken as the original forms, and at least one current style tag of the converted new forms is taken as the at least one target style tag, and input into the form generator in the form style conversion model to generate each converted new form that corresponds one-to-one with each of the forms to be converted, wherein at least one current style tag of the converted new forms is completely different or partially different from at least one current style tag of each of the forms to be converted; S512. The converted new forms are returned to the user. The aforementioned detection method is also a conventional human-computer interaction method, such as detecting whether the user has clicked the "Apply to the whole site with one click" button. If so, the detection confirms that the decision to apply to the whole site with one click has been made, so that the user can apply the satisfactory style to all forms with one click after being satisfied.
[0069] Therefore, based on the form style conversion method described in steps S1 to S5 above and based on a generative adversarial neural network, a new scheme is provided for training and applying a form style conversion model using form templates and a generative adversarial neural network. First, multiple form templates with different styles are applied to train a generative adversarial neural network including a form generator and a form discriminator, resulting in a pre-trained form style conversion model based on the generative adversarial neural network. Then, the user-provided form to be converted and at least one user-specified style tag are obtained. The form to be converted is used as the original form, and the at least one user-specified style tag is used as the target style tag. These are input into the form generator in the form style conversion model to generate a new converted form. This not only automatically, quickly, and accurately converts forms into style results that meet user expectations and needs, but also greatly reduces the user's operational burden (i.e., the user only needs to upload the form to be converted and the specified target style tag), facilitating practical application and promotion.
[0070] Based on the aforementioned first aspect of the technical solution, this embodiment also provides another possible design for training a corresponding conversion model for each pair of original forms and target forms. That is, the multiple form templates are used to train a generative adversarial neural network including a form generator and a form discriminator to obtain a pre-trained form style conversion model based on the generative adversarial neural network, including but not limited to the following steps S201 to S202.
[0071] S201. Select each pair of original form and target form from the plurality of form templates, wherein the original form is a first form template among the plurality of form templates, and the target form is a second form template among the plurality of form templates that is different from the first form template.
[0072] In step S201, specific examples of selection can be found in step S21 above, and will not be repeated here.
[0073] S202. For each pair of original forms and target forms, input the at least one style tag of the corresponding original form and the corresponding target form into the form generator of the generative adversarial neural network, and input the corresponding target form into the form discriminator of the generative adversarial neural network, train the generative adversarial neural network, and obtain the corresponding form style transfer model based on the generative adversarial neural network and which has been pre-trained. The form generator is used to generate a new form after inputting the original form and at least one target style tag, and the form discriminator is used to identify the authenticity of the new form based on the target form having the at least one target style tag.
[0074] In step S202, examples can be given of form templates A and B, B and A, C and C, A and D, D and A, B and C, C and B, B and D, D and B, C and B, C and D, C and D, C and D, or D and C, to train the corresponding form style conversion model.
[0075] Therefore, based on the aforementioned possible design one, corresponding conversion models can be trained for each pair of original forms and target forms. This not only facilitates rapid model pre-training but also further ensures the accuracy of form style conversion.
[0076] Based on the aforementioned possible design one technical solution, this embodiment also provides a possible design two for how to specifically apply the form style conversion model of each pair of original forms and target forms. That is, the form to be converted is used as the original form, and the at least one user-specified style tag is used as the at least one target style tag. These are input into the form generator in the form style conversion model to generate at least one new converted form, including but not limited to the following steps S401 to S402.
[0077] S401. Find an original form with at least one current style tag and a target form with at least one user-specified style tag from the plurality of form templates.
[0078] In step S401, if no original form with the at least one current style tag and / or no target form with the at least one user-specified style tag can be found directly, then a form template with a style tag most similar to the at least one current style tag can be used as an original form with the at least one current style tag, and / or a form template with a style tag most similar to the at least one user-specified style tag can be used as a target form with the at least one user-specified style tag.
[0079] S402. The form to be converted is used as the original form, and the at least one user-specified style tag is used as the at least one target style tag. The form is input into the form generator in the specific form style conversion model to generate a new form after conversion. The specific form style conversion model refers to the form style conversion model corresponding to the original form and the target form.
[0080] Therefore, based on the aforementioned possible design two, the most suitable conversion model can be selected for table style conversion based on the form to be converted and the specified style tag provided by the user, further ensuring the accuracy of form style conversion.
[0081] like Figure 2 As shown, the second aspect of this embodiment provides a virtual device for implementing the form style conversion method described in the first aspect or any possible design in the first aspect, including a form template acquisition module, a conversion model training module, a user requirement acquisition module, a conversion model application module, and a new form return module;
[0082] The form template acquisition module is used to acquire multiple form templates with different styles, wherein each form template in the multiple form templates has at least one pre-marked style tag;
[0083] The conversion model training module is communicatively connected to the form template acquisition module. It is used to apply the multiple form templates to train a generative adversarial neural network including a form generator and a form discriminator to obtain a pre-trained form style conversion model based on the generative adversarial neural network. The form generator is used to generate a new form after inputting an original form and at least one target style tag. The form discriminator is used to identify the authenticity of the new form based on the target form with the at least one target style tag.
[0084] The user requirement acquisition module is used to acquire the form to be transferred provided by the user and at least one user-specified style tag, wherein the at least one user-specified style tag is completely different from or partially different from at least one current style tag of the form to be transferred;
[0085] The conversion model application module is communicatively connected to the conversion model training module and the user requirement acquisition module, respectively. It is used to input the form to be converted as the original form and the at least one user-specified style tag as the at least one target style tag into the form generator in the form style conversion model to generate a new form after conversion.
[0086] The new form return module is communicatively connected to the conversion model application module and is used to return the converted new form to the user.
[0087] The working process, working details and technical effects of the aforementioned device provided in the second aspect of this embodiment can be found in the form style conversion method described in the first aspect or any possible design in the first aspect, and will not be repeated here.
[0088] like Figure 3 As shown, the third aspect of this embodiment provides a computer device for executing the form style conversion method as described in the first aspect or any possible design of the first aspect. The device includes a memory, a processor, and a transceiver connected sequentially in communication. The memory stores a computer program, the transceiver sends and receives messages, and the processor reads the computer program and executes the form style conversion method as described in the first aspect or any possible design of the first aspect. Specifically, the memory may include, but is not limited to, random-access memory (RAM), read-only memory (ROM), flash memory, first-in-first-out (FIFO) memory, and / or first-in-last-out (FILO) memory, etc.; the processor may include, but is not limited to, a microprocessor of the STM32F105 series. Furthermore, the computer device may also include, but is not limited to, a power module, a display screen, and other necessary components.
[0089] The working process, working details and technical effects of the aforementioned computer device provided in the third aspect of this embodiment can be found in the form style conversion method described in the first aspect or any possible design in the first aspect, and will not be repeated here.
[0090] This fourth aspect of the embodiment provides a computer-readable storage medium storing instructions comprising a form style conversion method as described in the first aspect or any possible design of the first aspect. Specifically, the computer-readable storage medium stores instructions that, when executed on a computer, perform the form style conversion method as described in the first aspect or any possible design of the first aspect. The computer-readable storage medium refers to a data storage medium, which may include, but is not limited to, floppy disks, optical disks, hard disks, flash memory, USB flash drives, and / or Memory Sticks. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
[0091] The working process, working details and technical effects of the aforementioned computer-readable storage medium provided in the fourth aspect of this embodiment can be found in the form style conversion method described in the first aspect or any possible design in the first aspect, and will not be repeated here.
[0092] This fifth aspect of the embodiment provides a computer program product containing instructions that, when executed on a computer, cause the computer to perform the form style conversion method as described in the first aspect or any possible design in the first aspect. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device.
[0093] Finally, it should be noted that the above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A form style transfer method based on generative adversarial neural networks, characterized in that, include: Obtain multiple form templates with different styles, wherein each form template has at least one pre-marked style tag; By applying the multiple form templates, a generative adversarial neural network including a form generator and a form discriminator is trained to obtain a pre-trained form style transfer model based on the generative adversarial neural network. The form generator is used to generate a new form after inputting an original form and at least one target style tag. The form discriminator is used to identify the authenticity of the new form based on the target form having the at least one target style tag. Obtain the form to be converted provided by the user and at least one user-specified style tag, wherein the at least one user-specified style tag is completely different from or partially different from at least one current style tag of the form to be converted; The form to be converted is used as the original form, and the at least one user-specified style tag is used as the at least one target style tag. These are input into the form generator in the form style conversion model to generate the new converted form. Returning the transformed new form to the user specifically includes: previewing the transformed new form and at least one adjustable style tag on the human-computer interaction interface, wherein each of the at least one adjustable style tag provides at least two fine-tuning options; when it is detected that the user has made a fine-tuning selection for the at least one adjustable style tag and made a re-transformation decision, the transformed new form is used as the original form, and the user's fine-tuning selection result for the at least one adjustable style tag is used as the at least one target style tag, and these are re-entered into the form generator in the form style conversion model to generate a new transformed new form; the new transformed new form is then returned to the user. After previewing the new form and at least one adjustable style tag, the method further includes: when it is detected that the user has not made a fine-tuning selection for the at least one adjustable style tag and has made a one-click application decision for the entire site, the forms to be converted selected in the one-click application decision are respectively used as the original forms, and at least one current style tag of the new form is used as the at least one target style tag, and these are input into the form generator in the form style conversion model to generate each new form corresponding to each form to be converted, wherein at least one current style tag of the new form is completely different or partially different from at least one current style tag of each form to be converted; and the new forms are returned to the user.
2. The form style conversion method according to claim 1, characterized in that, The at least one style tag, the at least one target style tag, the at least one user-specified style tag, or the at least one current style tag includes a form page background style tag, a form page text style tag, a form page control style tag, and / or a form page control layout style tag.
3. The form style conversion method according to claim 1, characterized in that, By applying the aforementioned multiple form templates, a generative adversarial neural network (GAN) including a form generator and a form discriminator is trained to obtain a pre-trained form style transfer model based on the GAN, comprising: Select each pair of original form and target form from the plurality of form templates, wherein the original form is the first form template among the plurality of form templates, and the target form is the second form template among the plurality of form templates that is different from the first form template; The original form and the target form in each pair of original forms and target forms are input into the form generator of the generative adversarial neural network, and the target form is input into the form discriminator of the generative adversarial neural network. The generative adversarial neural network is trained to obtain a pre-trained form style transfer model based on the generative adversarial neural network. The form generator is used to generate a new form after inputting the original form and at least one target style tag, and the form discriminator is used to identify the authenticity of the new form based on the target form with the at least one target style tag.
4. The form style conversion method according to claim 1, characterized in that, By applying the aforementioned multiple form templates, a generative adversarial neural network (GAN) including a form generator and a form discriminator is trained to obtain a pre-trained form style transfer model based on the GAN, comprising: Select each pair of original form and target form from the plurality of form templates, wherein the original form is the first form template among the plurality of form templates, and the target form is the second form template among the plurality of form templates that is different from the first form template; For each pair of original forms and target forms, the at least one style tag of the corresponding original form and the corresponding target form is input into the form generator of the generative adversarial neural network, and the corresponding target form is input into the form discriminator of the generative adversarial neural network. The generative adversarial neural network is trained to obtain a corresponding pre-trained form style transfer model based on the generative adversarial neural network. The form generator is used to generate a new form after inputting the original form and at least one target style tag, and the form discriminator is used to identify the authenticity of the new form based on the target form with the at least one target style tag.
5. The form style conversion method according to claim 4, characterized in that, The form to be converted is used as the original form, and the at least one user-specified style tag is used as the at least one target style tag. These are input into the form generator in the form style conversion model to generate a new converted form, including: Find an original form with at least one current style tag and a target form with at least one user-specified style tag from the plurality of form templates; The form to be converted is used as the original form, and the at least one user-specified style tag is used as the at least one target style tag. These are input into the form generator in the specific form style conversion model to generate a new form after conversion. The specific form style conversion model refers to the form style conversion model corresponding to the original form and the target form.
6. A computer device, characterized in that, The device includes a memory, a processor, and a transceiver that are sequentially and communicatively connected. The memory is used to store a computer program, the transceiver is used to send and receive messages, and the processor is used to read the computer program and execute the form style conversion method as described in any one of claims 1 to 5.
7. A computer-readable storage medium, characterized in that... The computer-readable storage medium stores instructions that, when executed on a computer, perform the form style conversion method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Image processing method and device, electronic equipment and storage medium
CN110516201A
Image processing method, device and apparatus and computer readable storage medium
CN111494946A