Model training method and device and automobile modeling design automatic generation method and device

By training LORA in the Stable Diffusion model and using ControlNet technology, the problem that existing models have difficulty in generating new energy vehicle styling is solved, and efficient generation of vehicle styling images that meet design goals is achieved.

CN120654329APending Publication Date: 2025-09-16HOHAI UNIV CHANGZHOU
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510880345.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-27
Publication Date
2025-09-16

AI Technical Summary

Technical Problem

Existing image generation models are difficult to generate car styling designs that conform to the unique styling features and details of new energy vehicles, and model training is needed to improve design effects.

Method used

LORA training is performed within the framework of the Stable Diffusion model. Combined with ControlNet technology, by building an image and label database, adjusting the number of training rounds and learning rate, and using low-rank matrix decomposition and loss function to optimize the model, a car shape that conforms to the target image is generated.

Benefits of technology

This significantly reduces the number of samples and computing power required for model training, improves learning efficiency, and generates car styling images that are more in line with the target design.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120654329A_ABST
    Figure CN120654329A_ABST
Patent Text Reader

Abstract

The invention relates to the field of automobile modeling design, in particular to a model training method and device and an automatic generation method and device of automobile modeling design. According to the model training method, corresponding LORA training in the aspect of automobile modeling is carried out under the framework of Stable Diffusion, so that the number of samples and computing power required in the fine adjustment process of model training are greatly reduced, and the learning efficiency of the model is improved; and details are further perfected through a ControlNet technology, so that an automobile modeling picture more biased to the image can be autonomously selected as a model training element to generate an automobile modeling design more conforming to the target image and the target design. Besides, according to the automatic generation model of the automobile modeling design, the automatic generation model can more accurately understand the features of the image by inputting the sketch and the semantic words, the accuracy of the generated automobile modeling image is improved, and the satisfaction degree of the user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of automobile styling design, and in particular relates to a model training method and device, and an automobile styling design automatic generation method and device. Background Art

[0002] With the development of AIGC (Artificial Intelligence Generated Content), AI painting has quickly become popular due to its rich creativity and convenient tools. Designers, users, research institutes, etc. have begun to use image generation models for design creation, provide design ideas, and shorten the design cycle.

[0003] Although the image generation model using existing technology can quickly generate car styling pictures to achieve the purpose of car styling design, the untrained model is difficult to take into account the content of vertical fields such as new energy vehicles, such as the unique styling features, independent design elements or other more detailed and specific content of some new energy vehicles. Therefore, it is necessary to train corresponding fine-tuning models to better carry out design plans in the field of car styling, so as to achieve the purpose of batch generating car styling renderings that meet the design goals.

[0004] Therefore, it is necessary to propose a new model training method. Summary of the Invention

[0005] Based on the above-mentioned problems existing in the prior art, the purpose of the embodiments of the present invention is to provide a model training method and device, as well as a method and device for automatically generating automobile styling designs. By performing corresponding LORA training on automobile styling under the framework of Stable Diffusion, the number of samples and computing power required in the process of model training and fine-tuning are greatly reduced, thereby improving the learning efficiency of the model. The details are further improved through ControlNet technology, so that automobile styling pictures that are more image-oriented can be independently selected as model training elements to generate automobile styling designs that are more in line with the target image and target design.

[0006] The technical solution adopted by the present invention to solve its technical problem is: In a first aspect, the present invention provides a model training method. The model training method comprises: Obtain sketches containing car styling features and design elements and build an image database set; semantically annotating features of the sketch and constructing a label database set; Input the image database set and the label database set into a pre-trained Stable Diffusion model, and perform LORA model training on the Stable Diffusion model; Adjust the training rounds and learning rate of the Stable Diffusion model in model training, and save the intermediate model corresponding to the training rounds; Record the loss value of the Stable Diffusion model during model training through a loss function and draw a loss value change chart; Testing and screening the intermediate model according to the loss value change chart to obtain an optimal automobile styling generation model; The automobile styling generation model takes the sketch and semantic words as input and outputs a styling design solution.

[0007] Preferably, the step of adjusting the training rounds and learning rate of the Stable Diffusion model in the model training and saving the intermediate model corresponding to the training rounds includes: Setting the training rounds to the maximum training rounds, wherein the intermediate model corresponding to the training rounds is saved every 1 to 2 training rounds; The learning rate is automatically adjusted based on the training rounds.

[0008] Preferably, the step of performing LORA model training on the Stable Diffusion model includes: Insert the LORA adaptation layer into the Stable Diffusion model and constrain the parameter update amount through low-rank matrix decomposition Update the parameters, specifically: The update amount The low-rank decomposition is the product of two small matrices: ; in, The shape of is d×k, the shape of A is r×k, and the shape of B is d×r. ; Original weight matrix Keep it frozen and only train the low-rank matrices A and B.

[0009] Preferably, the step of testing and screening the intermediate model according to the loss value variation chart to obtain the optimal automobile styling generation model further includes: Based on the loss value change chart, select several intermediate models when the loss value change tends to be stable for testing; Inputting characteristic semantic words that meet the design objectives into several intermediate models respectively, testing them in combination with ControlNet technology, and generating several automobile styling drawings; Comparing a plurality of the automobile styling drawings, selecting the intermediate model corresponding to the automobile styling drawing that best meets the design goal, and obtaining a final automobile styling generation model; The characteristic semantic words include positive prompt words and negative prompt words.

[0010] Preferably, the step of constructing the image database set further includes: All the sketches in the image database are resized.

[0011] Preferably, the step of semantically annotating the features of the sketch and constructing a label database set includes: Semantically annotating the image features of the sketches by manual labeling and expert review to construct a label database set; The tag database set includes at least one of the following: model calling words, automobile styling elements, sensory image words, picture background, and picture composition.

[0012] In a second aspect, the present invention provides a model training device. The model training device comprises: The first acquisition module is used to obtain sketches containing automobile styling features and design elements and build an image database set; A second acquisition module is used to semantically annotate features of the sketch and construct a label database set; A model training module, configured to input the image database set and the label database set into a pre-trained Stable Diffusion model, and perform LORA model training on the Stable Diffusion model; A model adjustment module is used to adjust the training rounds and learning rate of the Stable Diffusion model in model training and save the intermediate models corresponding to the training rounds; A numerical recording module is used to record the loss value of the Stable Diffusion model during model training through a loss function and draw a loss value change chart; A testing and screening module, configured to test and screen the intermediate model according to the loss value variation chart to obtain an optimal vehicle styling generation model; The automobile styling generation model outputs the sketch, semantic words, and design scheme renderings.

[0013] In a third aspect, the present invention provides a method for automatically generating a car styling design. The method comprises: Obtain a sketch of the car design to be generated and semantic words; Inputting the sketch and the semantic words into a car styling generation model to generate a large number of styling design solutions; Select the best design solution based on preset screening criteria and design goals; The optimal design solution is inputted into the automobile styling generation model again, and the details are generated and screened again using ControlNet technology to obtain the design solution rendering that meets the design goal; Wherein, the automobile styling generation model is obtained through the model training method described in the first aspect.

[0014] In a fourth aspect, the present invention provides an automatic generation device for automobile styling design. The automatic generation device comprises: The third acquisition module is used to obtain the sketch and semantic words of the car design to be generated; A design generation module, configured to input the sketch and the semantic words into a car styling generation model to generate a design scheme rendering of the car styling design; The scheme screening module is used to select the optimal design scheme based on the preset screening criteria and design goals; An optimal solution generation module is used to input the optimal design solution into the automobile styling generation model again, and regenerate and filter the details using ControlNet technology to obtain the design solution rendering that meets the design goal; Wherein, the automobile styling generation model is obtained through the model training device described in the second aspect.

[0015] In a fifth aspect, the present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the model training method described in any one of the first aspects or the automatic generation method of automobile styling design described in the third aspect.

[0016] The beneficial effects of the present invention are as follows: the model training method, device, and automatic generation method and device of automobile styling design of the present invention. The model training method includes obtaining a sketch containing automobile styling features and design elements to construct an image database set; semantically annotating the features of the sketch to construct a label database set; inputting the image database set and the label database set into a pre-trained Stable Diffusion model to perform LORA model training; adjusting the training rounds and learning rate in the model training, and saving the intermediate models corresponding to the training rounds; recording the loss value of the Stable Diffusion model in the model training through a loss function and drawing a loss value change chart; testing and screening the intermediate models according to the loss value change chart to obtain the optimal automobile styling generation model. The model training method of the present invention significantly reduces the number of samples and computing power required in the model training fine-tuning process by performing corresponding LORA training on automobile styling under the framework of Stable Diffusion, thereby improving the learning efficiency of the model; and further improving the details through ControlNet technology, so that automobile styling pictures that are more inclined to imagery can be independently selected as model training elements to generate automobile styling designs that are more in line with the target imagery and target design. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The present invention will be further described below with reference to the accompanying drawings and examples.

[0018] Figure 1 1 is a flow chart of the model training method according to embodiment 1 of the present invention; Figure 2 1 is a flow chart of step S6 of the model screening method according to embodiment 1 of the present invention; Figure 3 2 is a schematic diagram of a module of a model training device according to embodiment 2 of the present invention; Figure 4 1 is a flow chart of a method for automatically generating a car shape according to a third embodiment of the present invention; Figure 5 4 is a schematic diagram of a module of an automatic generation device for automobile shapes according to a fourth embodiment of the present invention; Figure 6 1 is a schematic diagram of the automatic generation process of automobile shapes in Examples 3 and 4 of the present invention; Figure 7 It is a design scheme effect diagram of the automobile shape of the present invention. DETAILED DESCRIPTION

[0019] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0020] Example 1 This embodiment provides a model training method, such as Figure 1-2 As shown, the model training method includes: Step S1: Obtain a sketch containing automobile styling features and design elements, and construct an image database set.

[0021] In this embodiment, pictures containing new energy vehicle styling features and independent design elements, such as wheels and headlights, are collected as model training materials.

[0022] As an optional embodiment, the step of constructing the image database set in step S1 further includes: resizing all sketches in the image database set. Specifically, to facilitate model training, all sketches are uniformly cropped to 512×512 pixels to construct the image database set.

[0023] Step S2: semantically annotate the features of the sketch and construct a label database set.

[0024] As an optional embodiment, the step of semantically annotating the features of the sketch and constructing a label database set in step S2 includes: semantically annotating the image features of the sketch by manual labeling and expert review to construct a label database set; wherein the label database set includes at least one of the following: model call words, automobile styling elements, sensory image words, picture background, and picture composition.

[0025] Step S3: input the image database set and the label database set into the pre-trained Stable Diffusion model, and perform LORA model training on the Stable Diffusion model.

[0026] In this embodiment, traditional full parameter fine-tuning requires updating all parameters of the training model, that is, , get the new weight Direct training There are problems with high computing resource consumption and storage costs. The LORA technology achieves efficient parameter adaptation by introducing a trainable low-rank matrix instead of adjusting the entire weight matrix, which significantly reduces the computational complexity and storage requirements of the fine-tuning process.

[0027] As an optional embodiment, the step of performing LORA model training on the Stable Diffusion model in step S3 includes: Insert the LORA adaptation layer into the Stable Diffusion model and constrain the parameter update amount through low-rank matrix decomposition Update the parameters and update the amount The low-rank decomposition is the product of two small matrices, the original weight matrix Keep frozen and only train low-rank matrices A and B. Specifically, the core idea of ​​LORA technology is a technology for efficiently fine-tuning large models by decomposing the constraint parameter update amount with low-rank matrices. , the specific steps are as follows: Low-rank decomposition: update the Decompose into the product of two small matrices: ; Among them, assuming The shape of is d×k, the shape of A is r×k, and the shape of B is d×r. ; For example: If It is a 1000×1000 matrix. If the rank r=8, then A is 8×1000 and B is 1000×8, and the number of parameters is reduced from 1M to 16K.

[0028] Step S4: Adjust the training rounds and learning rate of the Stable Diffusion model in model training, and save the intermediate model corresponding to the training round.

[0029] As an optional embodiment, step S4 further includes: setting the number of training rounds to a maximum number of training rounds, wherein the intermediate model corresponding to each training round is saved every 1-2 training rounds; and the learning rate is automatically adjusted based on the training rounds. The maximum number of training rounds and the learning rate for model training are adjusted to prevent underfitting and overfitting of the model.

[0030] Step S5: Record the loss value of the Stable Diffusion model during model training through the loss function and draw a loss value change chart.

[0031] In this example, a loss function is used to plot the loss value (loss value) during the model training process. The change in loss value over the number of model training rounds is observed. Training can be stopped when the loss value gradually decreases and stabilizes. The loss value is an important indicator for quantifying the difference between the model's predicted output and the actual output. If the fluctuation of the loss value gradually stabilizes and no longer decreases significantly, the model is considered to have converged to a good state.

[0032] Step S6: Test and select the intermediate model according to the loss value change chart to obtain the optimal car styling generation model.

[0033] As an optional embodiment, Figure 2 As shown, the step S6 of testing and screening the intermediate model according to the loss value change chart to obtain the optimal car styling generation model also includes: Step S61: Based on the loss value change chart, select several intermediate models when the loss value change tends to be stable for testing; Step S62: inputting the characteristic semantic words that meet the design objectives into several intermediate models respectively, testing them in combination with ControlNet technology, and generating several automobile modeling drawings; Step S63: comparing several car styling drawings, selecting an intermediate model corresponding to the car styling drawing that best meets the design goal, and obtaining a final car styling generation model; In this embodiment, the car styling generation model takes sketches and semantic words as input and outputs a styling design solution, wherein the characteristic semantic words include positive prompt words and negative prompt words.

[0034] This embodiment provides a model training method, which includes obtaining a sketch containing automobile styling features and design elements to construct an image database; semantically annotating the features of the sketch to construct a label database; inputting the image database and label database into a pre-trained Stable Diffusion model to perform LoRa model training; adjusting the number of training rounds and learning rate during model training and saving the intermediate models corresponding to the training rounds; recording the loss value of the Stable Diffusion model during model training using a loss function and plotting the loss value change chart; and testing and screening the intermediate models based on the loss value change chart to obtain the optimal automobile styling generation model. Specifically, by performing LoRa training on automobile styling within the framework of Stable Diffusion, the number of samples and computing power required during model training fine-tuning are significantly reduced, thereby improving the model's learning efficiency. Further refinement of details is achieved through ControlNet technology, allowing the autonomous selection of automobile styling images that are more image-oriented as model training elements to generate automobile styling designs that are more consistent with the target imagery and target design.

[0035] Example 2 This embodiment provides a model training device, such as Figure 3 As shown, the model training device 10 includes: a first acquisition module 11, a second acquisition module 12, a model training module 13, a model adjustment module 14, a value recording module 15 and a test screening module 16; The first acquisition module 11 is used to acquire a sketch containing automobile styling features and design elements and construct an image database set.

[0036] In this embodiment, pictures containing new energy vehicle styling features and independent design elements, such as wheels and headlights, are collected as model training materials.

[0037] As an optional embodiment, the step of constructing the image database set in the first acquisition module 11 further includes: the first acquisition module 11 performs a resizing process on all sketches in the image database set. Specifically, to facilitate model training, the first acquisition module 11 crops all sketches to 512×512 pixels to construct the image database set.

[0038] The second acquisition module 12 is used to semantically annotate features of the sketch and construct a label database set.

[0039] As an optional embodiment, the step of semantically annotating the features of the sketch and constructing a label database set in the second acquisition module 12 includes: the second acquisition module 12 semantically annotates the image features of the sketch by manual labeling and expert review to construct a label database set; wherein the label database set includes at least one of the following: model call words, automobile styling elements, sensory image words, picture background, and picture composition.

[0040] The model training module 13 is used to input the image database set and the label database set into the pre-trained Stable Diffusion model, and perform LORA model training on the Stable Diffusion model.

[0041] In this embodiment, traditional full parameter fine-tuning requires updating and training all parameters of the model, that is, , get the new weight Direct training There are problems with high computing resource consumption and storage costs. The LORA technology achieves efficient parameter adaptation by introducing a trainable low-rank matrix instead of adjusting the entire weight matrix, which significantly reduces the computational complexity and storage requirements of the fine-tuning process.

[0042] As an optional embodiment, the step of performing LORA model training on the Stable Diffusion model in the model training module 13 includes: Insert the LORA adaptation layer into the Stable Diffusion model and constrain the parameter update amount through low-rank matrix decomposition Update the parameters and update the amount The low-rank decomposition is the product of two small matrices, the original weight matrix Keep frozen and only train low-rank matrices A and B. Specifically, the core idea of ​​LORA technology is a technology for efficiently fine-tuning large models by decomposing the constraint parameter update amount with low-rank matrices. , the specific steps are as follows: Low-rank decomposition: update the Decompose into the product of two small matrices: ; Among them, assuming The shape of is d×k, the shape of A is r×k, and the shape of B is d×r. ; For example: If It is a 1000×1000 matrix. If the rank r=8, then A is 8×1000 and B is 1000×8, and the number of parameters is reduced from 1M to 16K.

[0043] The model adjustment module 14 is used to adjust the training rounds and learning rate of the Stable Diffusion model in model training, and save the intermediate models corresponding to the training rounds.

[0044] As an optional embodiment, the model adjustment module 14 further includes: setting the number of training rounds to a maximum number of training rounds, wherein the intermediate model corresponding to each training round is saved every one to two training rounds; and the learning rate is automatically adjusted based on the training rounds. The maximum number of training rounds and the learning rate for model training are adjusted to prevent underfitting and overfitting of the model.

[0045] The numerical recording module 15 is used to record the loss value of the Stable Diffusion model during model training through the loss function and draw a loss value change chart.

[0046] In this example, a loss function is used to plot the loss value (loss value) during the model training process. The change in loss value over the number of model training rounds is observed. Training can be stopped when the loss value gradually decreases and stabilizes. The loss value is an important indicator for quantifying the difference between the model's predicted output and the actual output. If the fluctuation of the loss value gradually stabilizes and no longer decreases significantly, the model is considered to have converged to a good state.

[0047] The test screening module 16 is used to test and screen the intermediate model according to the loss value change chart to obtain the optimal automobile styling generation model; wherein the automobile styling generation model takes the sketch and semantic words as input and the design scheme rendering as output.

[0048] This embodiment provides a model training device. This model training device is based on Example 1. By performing LoRa training on vehicle styling within the Stable Diffusion framework, this model training device significantly reduces the number of samples and computing power required during model training and fine-tuning, thereby improving model learning efficiency. Further refinement of the details using ControlNet technology allows for the autonomous selection of more image-oriented vehicle styling images as model training elements, thereby generating vehicle styling designs that better align with the target imagery and design.

[0049] Example 3 This embodiment provides a method for automatically generating a car model design. Figure 4 As shown, the automatic generation method of the automobile styling design includes: Step A1: Obtain a sketch and semantic words of the automobile design to be generated.

[0050] Step A2: Input the sketch and semantic words into the car styling generation model to generate a large number of styling design solutions.

[0051] In this embodiment, the automobile styling generation model is obtained by the model training method of the above-mentioned embodiment 1.

[0052] Step A3: Select the optimal design solution based on the preset screening criteria and design objectives.

[0053] In this embodiment, the preset screening criteria are authenticity, innovation, structural rationality, and consistency with the design target image of the design scheme as evaluation indicators to select the optimal design scheme.

[0054] Step A4: input the optimal design solution into the automobile styling generation model again, and use ControlNet technology to regenerate and filter the details to obtain the automobile styling design solution rendering that meets the design goals.

[0055] In this embodiment, if Figure 6-7 As shown in the figure, the details of the optimal design scheme are improved, that is, the design elements of the new energy vehicle such as the wheels and headlights that are less clear and have low detail perfection in the optimal design scheme are cut out and imported into the trained automobile styling generation model. Text instructions that meet the design goals are input, and ControlNet technology is introduced to import the design sketches, and a large number of wheel and headlight design schemes are regenerated again. Then, they are screened, selected, and spliced ​​to output the renderings of the new energy vehicle styling design schemes.

[0056] This embodiment provides a method for automatically generating automotive styling designs. This method inputs a sketch and semantic terms of the automotive styling design to be generated into an automotive styling generation model, outputting a large number of design proposals. The proposals are screened and then optimized for details to produce the optimal design rendering. This embodiment's method uses the sketch and semantic terms input to enable the automotive styling generation model to more accurately understand image features, improving the accuracy of generated automotive styling images and enhancing user satisfaction.

[0057] Example 4 This embodiment provides an automatic generation device for automobile styling design, such as Figure 5 As shown, the automatic generation device 20 of the automobile styling design includes: a third acquisition module 21, a design generation module 22, a solution screening module 23 and an optimal generation module 24; The third acquisition module 21 is used to acquire a sketch and semantic words of the automobile design to be generated.

[0058] The design generation module 22 is used to input the sketch and semantic words into the automobile styling generation model to generate a design scheme rendering of the automobile styling design.

[0059] In this embodiment, the automobile styling generation model is obtained by the model training device of the above-mentioned embodiment 2.

[0060] The scheme screening module 23 is used to select the optimal design scheme according to preset screening criteria and design objectives.

[0061] In this embodiment, the preset screening criteria in the design generation module 22 are the authenticity, innovation, structural rationality, and consistency with the design target image of the modeling design scheme as evaluation indicators to select the optimal design scheme.

[0062] The optimal generation module 24 is used to input the optimal design solution into the automobile styling generation model again, and use ControlNet technology to regenerate and filter the details to obtain the optimal design solution that meets the design goals.

[0063] In this embodiment, if Figure 6-7 As shown, the optimal generation module 24 improves the details of the optimal design solution, that is, the optimal generation module 24 cuts out the design elements of the new energy vehicle such as the wheels and headlights that are less clear and have low detail perfection in the optimal design solution, imports them into the trained automobile styling generation model, inputs text instructions that meet the design goals, introduces ControlNet technology, imports the design sketches, and regenerates a large number of wheel and headlight design solutions, and then selects them through screening and splicing to output the new energy vehicle styling design solution renderings.

[0064] This embodiment provides an automatic generation device for automobile styling designs. This automatic generation device for automobile styling designs is based on the automatic generation method for automobile styling designs in Example 3. The automatic generation device inputs a sketch and semantic words of the automobile styling design to be generated into an automobile styling generation model, outputting a large number of design solutions. The solutions are screened and then, through detailed optimization, the optimal design solution rendering is obtained. The automatic generation device for automobile styling designs in this embodiment uses the input of sketches and semantic words to enable the automobile styling generation model to more accurately understand the characteristics of the image, thereby improving the accuracy of the generated automobile styling images and enhancing user satisfaction.

[0065] Example 5 This embodiment relates to a computer-readable storage medium storing a computer program installed in a kotatsu. When the computer program is executed by a processor, the computer program implements the model training method of the first embodiment or the method for automatically generating a car styling design of the third embodiment.

[0066] That is, those skilled in the art will understand that all or part of the steps in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a program. The program is stored in a storage medium and includes a number of instructions for causing a device (which may be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes: a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc., various media that can store program code.

[0067] With the above-described preferred embodiments of the present invention as inspiration, and with reference to the above description, relevant personnel may make various changes and modifications without departing from the scope of the present invention. The technical scope of this invention is not limited to the contents of the specification, but must be determined according to the scope of the claims.

Claims

1. A model training method, characterized in that: The model training method includes: Obtain sketches containing car styling features and design elements and build an image database set; semantically annotating features of the sketch and constructing a label database set; Inputting the image database set and the label database set into a pre-trained Stable Diffusion model, and performing LORA model training on the Stable Diffusion model; Adjust the training rounds and learning rate of the Stable Diffusion model in model training, and save the intermediate model corresponding to the training rounds; Record the loss value of the Stable Diffusion model during model training through a loss function and draw a loss value change chart; Testing and screening the intermediate model according to the loss value change chart to obtain an optimal automobile styling generation model; The automobile styling generation model takes the sketch and semantic words as input and outputs a styling design solution.

2. The model training method according to claim 1, characterized in that The steps of adjusting the training rounds and learning rate of the StableDiffusion model in the model training and saving the intermediate model corresponding to the training rounds include: Setting the training rounds to the maximum training rounds, wherein the intermediate model corresponding to the training rounds is saved every 1 to 2 training rounds; The learning rate is automatically adjusted based on the training rounds.

3. The model training method according to claim 1, characterized in that The step of performing LORA model training on the Stable Diffusion model includes: Insert the LORA adaptation layer into the Stable Diffusion model and constrain the parameter update amount through low-rank matrix decomposition Update the parameters, specifically: The update amount The low-rank decomposition is the product of two small matrices: ; in, The shape of is d×k, the shape of A is r×k, and the shape of B is d×r. ; The original weight matrix W0 is kept frozen and only the low-rank matrices A and B are trained.

4. The model training method according to claim 1, characterized in that The step of testing and screening the intermediate model according to the loss value change chart to obtain the optimal automobile styling generation model further includes: Based on the loss value change chart, select several intermediate models when the loss value change tends to be stable for testing; Inputting characteristic semantic words that meet the design objectives into several intermediate models respectively, testing them in combination with ControlNet technology, and generating several automobile styling drawings; Comparing a plurality of the automobile styling drawings, selecting the intermediate model corresponding to the automobile styling drawing that best meets the design goal, and obtaining a final automobile styling generation model; The characteristic semantic words include positive prompt words and negative prompt words.

5. The model training method according to claim 4, characterized in that The step of constructing the image database set also includes: All the sketches in the image database are resized.

6. The model training method according to claim 1, characterized in that The step of semantically annotating the features of the sketch and constructing a label database set includes: Semantically annotating the image features of the sketches by manual labeling and expert review to construct a label database set; The tag database set includes at least one of the following: model calling words, automobile styling elements, sensory image words, picture background, and picture composition.

7. A model training device, characterized in that: The model training device comprises: The first acquisition module is used to obtain sketches containing automobile styling features and design elements and build an image database set; A second acquisition module is used to semantically annotate features of the sketch and construct a label database set; A model training module, configured to input the image database set and the label database set into a pre-trained Stable Diffusion model, and perform LORA model training on the Stable Diffusion model; A model adjustment module is used to adjust the training rounds and learning rate of the Stable Diffusion model in model training and save the intermediate models corresponding to the training rounds; A numerical recording module is used to record the loss value of the Stable Diffusion model during model training through a loss function and draw a loss value change chart; A testing and screening module, configured to test and screen the intermediate model according to the loss value variation chart to obtain an optimal vehicle styling generation model; The automobile styling generation model outputs the sketch, semantic words, and design scheme renderings.

8. A method for automatically generating automobile styling design, characterized in that: The automatic generation method comprises: Obtain a sketch of the car design to be generated and semantic words; Inputting the sketch and the semantic words into a car styling generation model to generate a large number of styling design solutions; Select the best design solution based on preset screening criteria and design goals; The optimal design solution is inputted into the automobile styling generation model again, and the details are generated and screened again using ControlNet technology to obtain the design solution rendering that meets the design goal; Wherein, the automobile styling generation model is obtained by the model training method described in any one of claims 1-6.

9. An automatic generation device for automobile styling design, characterized in that: The automatic generation device comprises: The third acquisition module is used to obtain the sketch and semantic words of the car design to be generated; A design generation module, configured to input the sketch and the semantic words into a car styling generation model to generate a design scheme rendering of the car styling design; The scheme screening module is used to select the optimal design scheme based on the preset screening criteria and design goals; An optimal solution generation module is used to input the optimal design solution into the automobile styling generation model again, and regenerate and filter the details using ControlNet technology to obtain the design solution rendering that meets the design goal; Wherein, the automobile styling generation model is obtained through the model training device described in claim 7.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the model training method according to any one of claims 1 to 6 or the automatic generation method of automobile styling design according to claim 8 is implemented.