Tensorflow-based generative ai motor parameter generation system and method

CN122286970APending Publication Date: 2026-06-26CHONGQING TSINGSHAN IND
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202610096728.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-23
Publication Date
2026-06-26

Smart Images

  • Figure CN122286970A_ABST
    Figure CN122286970A_ABST
Patent Text Reader

Abstract

This invention relates to the interdisciplinary field of motor design and artificial intelligence, specifically a method and system for designing core motor parameters based on the TensorFlow deep learning architecture. The system comprises seven modules, including data acquisition, preprocessing, and model building. It collects seven types of scenario-based user requirements parameters (body weight, gradeability, etc.) and motor target parameter samples. After cleaning and normalization, a WGAN-GP generative adversarial network is constructed based on TensorFlow. The generator and discriminator are trained alternately, and the model is optimized using MAE as the metric. After user input requirements are validated for legality, the optimal model generates the core motor parameters, which are then denormalized and validated against engineering specifications before outputting the results. This invention automates the entire design process, solving the problems of long design cycles, limited accuracy, and poor adaptability in traditional design methods. The parameter-to-requirement matching degree is ≥95%, it supports distributed training and edge deployment, and can quickly respond to personalized requirement changes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of interdisciplinary technology of motor design and artificial intelligence. Specifically, it relates to a method and system based on the TensorFlow deep learning architecture, which automatically generates core motor parameters (winding turns, wire diameter, winding type, core material, core lamination thickness, stator slot type / number of slots, air gap width, permanent magnet material, permanent magnet magnetization direction, rotor slot type, etc.) that meet the constraints based on multi-dimensional requirement parameters input by the user. Background Technology

[0002] In the field of motor design (especially drive motors for new energy vehicles and industrial drive motors), the determination of motor parameters (such as the number of winding turns, wire diameter, winding type, core material, core lamination thickness, stator slot type / number of slots, air gap width, permanent magnet material, permanent magnet magnetization direction, and rotor slot type) needs to comprehensively match the multi-dimensional requirements put forward by users, including curb weight (for vehicle motors), frontal area, drag coefficient, transmission efficiency, maximum gradeability, 0-100km / h acceleration, and motor installation dimensions.

[0003] Traditional motor parameter design relies on engineers' accumulated experience and requires iterative optimization through repeated simulations and physical experiments, which presents the following core problems:

[0004] (1) Long design cycle: There are coupling relationships between multiple demand parameters (such as "0-100km / h acceleration" needs to be matched with "maximum power" and "curb weight"), and manual balancing of constraints requires multiple trials and errors, with the average design cycle reaching several weeks or even months;

[0005] (2) Limited accuracy: Experience-driven design may overlook the implicit correlation of some required parameters (such as the indirect impact of "drag coefficient" on motor power requirements), resulting in the final parameters not fully meeting the actual working conditions.

[0006] (3) Poor adaptability: When user requirements change (such as adjusting the maximum ramp rate), the entire design process needs to be restarted, and it cannot quickly respond to personalized needs.

[0007] Initially, most people skilled in the art attempted to solve the core problems of traditional motor parameter design by using AI-assisted motor design techniques based on discriminative models (such as regression analysis and CNN classification models). However, in subsequent practical applications, it was found that this approach, which can only "filter and match" existing motor parameter libraries, is highly dependent on training data, has weak generalization ability, and cannot actively generate new parameter combinations that meet multiple constraints. It also suffers from many shortcomings, such as poor dynamic adjustment capability under multiple constraints and insufficient flexibility.

[0008] Therefore, those skilled in the art have turned their attention to the research direction of "how to use generative models to assist motor design". In the process of these studies, many intractable technical problems have arisen. For example, the patent application "Motor Reverse Design Method and System Based on Generative Artificial Intelligence Model" (publication date: December 26, 2025, publication number: CN121211812A), filed on September 11, 2025, attempts to solve the problems of repetitive work, long development time, and high cost in the traditional motor parameter design process based on generative artificial intelligence models. Although this technical solution has certain improvements compared to traditional motor parameter design (including AI-assisted motor design technology based on discriminative models), it still has many shortcomings:

[0009] 1. Limited input dimensions, detached from the user's actual design starting point.

[0010] The input of CN121211812A is only "motor performance parameters" (such as torque, efficiency, inner and outer diameter), which does not cover the multi-dimensional needs of users in actual scenarios (such as vehicle curb weight, gradeability, installation dimensions, etc.).

[0011] Specifically, the core starting point for users designing motors is "application scenario requirements" (such as the acceleration performance of new energy vehicles and the installation constraints of industrial equipment), rather than "existing performance indicators of the motor." CN121211812A requires users to first convert actual needs into motor performance parameters, which increases the usage threshold and cannot directly respond to personalized changes in requirements across different scenarios.

[0012] 2. The model architecture is prone to pattern collapse, and the diversity of generated parameters is insufficient.

[0013] CN121211812A adopts a "CVAE (Conditional Variational Autoencoder) + Traditional GAN" architecture. The generator relies on the latent variables of CVAE to achieve diversity, but CN121211812A does not design a solution to address the core shortcomings of GAN:

[0014] Specifically, traditional GANs lack gradient constraint mechanisms, which can easily lead to convergence of generated parameters (pattern collapse). CN121211812A only uses the "reciprocal of the variance of the generated results" as a loss function term to quantify diversity, without addressing the root cause at the architectural level. This may result in structural parameters that appear diverse but are actually homogeneous, and the engineering practicality of diversity has not been verified.

[0015] 3. Weak engineering adaptability and limited deployment scenarios.

[0016] 3.1 Framework limitations: CN121211812A is built on PyTorch and does not mention distributed training or edge deployment solutions. It cannot adapt to enterprise-level large-scale training (such as multi-GPU parallelism) or mobile fast query requirements, and its engineering implementation capabilities are insufficient.

[0017] 3.2 Hardware Dependency: In CN121211812A, the training process relies on the proxy model to generate data. Although this reduces some computing costs, it does not optimize the resource consumption after model deployment and does not consider the lightweight requirements of edge devices (such as workshop field terminals).

[0018] 4. The training optimization mechanism is imperfect, prone to overfitting, and has limited parameter tuning efficiency.

[0019] 4.1 No early stopping mechanism: CN121211812A uses Bayesian optimization (Optuna library) for parameter tuning and does not set early stopping trigger conditions for model performance. This may lead to overfitting due to excessive iteration, affecting generalization ability.

[0020] 4.2 Single loss function: The loss function of CN121211812A only combines KL divergence (difference between the recognition network and the prior distribution), KPI error (difference between the generated and target performance) and variance term (diversity). It does not design an optimization objective for "the matching degree between the generated parameters and the engineering specifications". The accuracy depends on the quality of the training set and has poor adaptability to abnormal scenarios.

[0021] 5. Lack of engineering specification verification means that the generated parameters may be "theoretically feasible but practically unusable."

[0022] CN121211812A only uses OOD detection (principal component analysis) to screen results that are "consistent with the training set distribution," without verifying against motor engineering design specifications (such as wire diameter range, winding turn limits, permanent magnet material compatibility, and physical constraints on air gap width).

[0023] In other words, OOD detection only guarantees the consistency between the generated results and the training set distribution, but cannot ensure that the parameters meet the actual production requirements. This may result in invalid solutions that are "reasonable in terms of data but cannot be processed in engineering," and there is no regeneration mechanism to correct this problem.

[0024] In summary, how to correctly utilize generative models to assist motor design, thereby avoiding the aforementioned problems and maximizing the optimization of existing motor design technology, has always been a problem that needs to be solved by those skilled in the art. Summary of the Invention

[0025] The purpose of this invention is to address the shortcomings of existing technologies by providing a method and system based on the TensorFlow deep learning architecture. This system uses a generative AI model to automatically generate core motor parameters (winding turns, wire diameter, winding type, core material, core lamination thickness, stator slot type / number of slots, air gap width, permanent magnet material, permanent magnet magnetization direction, rotor slot type, etc.) that meet the constraints based on multi-dimensional user input requirements. The system includes seven modules, including data acquisition, preprocessing, and model building. It collects seven types of scenario-based user requirements parameters (runaway weight, gradeability, etc.) and motor target parameter samples. After cleaning and normalization, it constructs a WGAN-GP generative adversarial network based on TensorFlow, alternately trains the generator and discriminator, and optimizes the model using MAE as the metric. After the user input requirements are validated for legality, the optimal model generates the core parameters of the motor. The output results are then verified by inverse normalization and engineering specifications. This enables full automation of the design process, solving the problems of long design cycles, limited accuracy, and poor adaptability in traditional design. The parameter matching degree with requirements is ≥95%, and it supports distributed training and edge deployment, enabling rapid response to personalized requirement changes.

[0026] The objective of this invention is achieved through the following approach:

[0027] A generative AI motor parameter generation system based on TensorFlow, comprising:

[0028] The data acquisition module is used to collect motor design sample data, which includes user requirement parameters and motor target parameters.

[0029] The data preprocessing module is used to clean and normalize the sample data, and to divide it into training, validation and test sets.

[0030] The model building module is used to build generative AI models using the TensorFlow architecture. The generative AI models include generators and discriminators.

[0031] The model training and optimization module is used to train generative AI models, evaluate model performance, and save the optimal model.

[0032] The user requirement input module is used to receive user input requirements parameters and verify the validity of the parameters;

[0033] The parameter generation module is used to input the preprocessed user requirement parameters into the optimal model to generate the target parameters of the motor;

[0034] The results output module is used to perform inverse normalization and rationality verification on the generated motor target parameters and output the final results.

[0035] The method for designing motor parameters using the above system includes the following steps:

[0036] 1) The data acquisition module uses user requirement parameters and motor target parameters from historical data in the field of motor design as sample data and sends them to the data preprocessing module;

[0037] 2) The data preprocessing module cleans and normalizes the sample data, and divides it into training set, validation set, and test set;

[0038] 3) The model building module utilizes the TensorFlow architecture to construct generative AI models;

[0039] 4) The model training and optimization module performs performance evaluation and iterative training on the generative AI model built in step 3) until the generative AI model has the best performance, and then saves the generative AI model in the model training and optimization module.

[0040] 5) The user requirement input module receives the user's input requirement parameters through a visual interface and automatically verifies the validity of the parameters. If the parameters are valid, the user's input requirement parameters are sent to the parameter generation module.

[0041] 6) The parameter generation module sends the user-inputted requirements parameters to the data preprocessing module for normalization, and then sends them to the model training and optimization module. The parameters are then input into the best-performing generative AI model to obtain the normalized target parameters of the motor.

[0042] 7) The result output module performs inverse normalization and rationality verification on the normalized motor target parameters and outputs the final result.

[0043] Preferably, in step 1), the historical data in the field of motor design comes from motor design databases, industry standard libraries, or actual engineering cases of enterprises;

[0044] The user requirement parameters in the historical data of the motor design field include curb weight, frontal area, drag coefficient, transmission efficiency, maximum gradeability, 0-100km / h acceleration, and motor installation dimensions.

[0045] The target parameters of the motor in the historical data of the motor design field include the number of winding turns, wire diameter, winding type, core material, core lamination thickness, stator slot type / number of slots, air gap width, permanent magnet material, permanent magnet magnetization direction, and rotor slot type.

[0046] Preferably, in step 2), the data cleaning includes removing outliers and filling in missing values;

[0047] Among them, outlier values ​​are parameter values ​​that exceed the range of the motor engineering specifications, and the missing values ​​are filled by K-nearest neighbor interpolation or mean filling method.

[0048] Preferably, in step 3), the generative AI model is a generative adversarial network, including a generator and a discriminator, and is constructed as follows:

[0049] The generator is built based on TensorFlow's tf.keras.layers. The input layer is used to receive a 7-dimensional user requirement parameter vector. The hidden layer includes 3-5 fully connected layers, a batch normalization layer, and a ReLU activation function. The output layer is used to output an N-dimensional motor target parameter vector (N is the number of motor target parameters).

[0050] The discriminator is built based on TensorFlow's tf.keras.layers. The input layer is used to receive a concatenated vector of "user requirement parameters + real / generated motor target parameters". The hidden layer includes 3-5 fully connected layers and the LeakyReLU activation function. The output layer is used to output the discrimination score.

[0051] During model compilation, the Adam optimizer is configured, the discriminator loss function is the WGAN-GP gradient penalty loss, and the generator loss function is the discrimination score of the generated samples.

[0052] Preferably, in step 4), the iterative training is based on TensorFlow's tf.GradientTape to implement a custom training loop, alternately optimizing the discriminator and the generator: first fix the generator and optimize the discriminator, then fix the discriminator and optimize the generator;

[0053] The performance evaluation uses the mean absolute error (MAE) as the core indicator to determine the model performance.

[0054] Preferably, in step 5), the visual interface is a web-based or desktop interactive interface;

[0055] The parameter validity check includes verifying that the parameter data type is numeric and that the parameter value is within the preset project range. If the parameter is invalid, a pop-up window will display the specific error and require the user to re-enter it.

[0056] Preferably, in step 6), the normalization process reuses the mean μ and standard deviation σ of the user demand parameters calculated in step 2) to ensure that the normalization rules are consistent;

[0057] The method for obtaining the normalized motor target parameters specifically includes: the parameter generation module calls the best-performing generative AI model stored in the model training and optimization module, inputs the normalized user requirement parameters into the generator in tensor form, and the generator outputs the normalized motor target parameters.

[0058] Preferably, in step 7), the inverse normalization calculation formula is as follows:

[0059] x_actual = x_norm × σ + μ

[0060] In the formula, x_actual is the actual engineering value after denormalization, x_norm is the normalized target parameter of the motor, σ is the mean of the target parameter of the motor recorded in step 2), and μ is the standard deviation of the target parameter of the motor recorded in step 2).

[0061] The rationality verification includes determining whether the motor target parameters after denormalization are within the preset engineering range. If they exceed the range, the parameter generation module is triggered to regenerate them, and the number of regenerations does not exceed the preset regeneration threshold.

[0062] The beneficial effects of this invention are as follows:

[0063] A generative AI motor parameter generation system based on TensorFlow, comprising:

[0064] The data acquisition module is used to collect motor design sample data, which includes user requirement parameters and motor target parameters.

[0065] The data preprocessing module is used to clean and normalize the sample data, and to divide it into training, validation and test sets.

[0066] The model building module is used to build generative AI models using the TensorFlow architecture. The generative AI models include generators and discriminators.

[0067] The model training and optimization module is used to train generative AI models, evaluate model performance, and save the optimal model.

[0068] The user requirement input module is used to receive user input requirements parameters and verify the validity of the parameters;

[0069] The parameter generation module is used to input the preprocessed user requirement parameters into the optimal model to generate the target parameters of the motor;

[0070] The results output module is used to perform inverse normalization and rationality verification on the generated motor target parameters and output the final results.

[0071] The generative AI motor parameter generation system based on TensorFlow in this invention achieves full-process automation of "user requirement input → parameter generation → result output" through the collaborative design of the above 7 modules. It eliminates the need for manual participation in iterative simulation or parameter selection, greatly reducing the dependence of motor design on engineers' professional experience. At the same time, it supports distributed training and edge deployment, adapts to enterprise-level large-scale design and rapid on-site query in multiple scenarios, and significantly improves the ability to be implemented in engineering.

[0072] The method for designing motor parameters using the above system includes the following steps:

[0073] 1) The data acquisition module uses user requirement parameters and motor target parameters from historical data in the field of motor design as sample data and sends them to the data preprocessing module;

[0074] 2) The data preprocessing module cleans and normalizes the sample data, and divides it into training set, validation set, and test set;

[0075] 3) The model building module utilizes the TensorFlow architecture to construct generative AI models;

[0076] 4) The model training and optimization module performs performance evaluation and iterative training on the generative AI model built in step 3) until the generative AI model has the best performance, and then saves the generative AI model in the model training and optimization module.

[0077] 5) The user requirement input module receives the user's input requirement parameters through a visual interface and automatically verifies the validity of the parameters. If the parameters are valid, the user's input requirement parameters are sent to the parameter generation module.

[0078] 6) The parameter generation module sends the user-inputted requirements parameters to the data preprocessing module for normalization, and then sends them to the model training and optimization module. The parameters are then input into the best-performing generative AI model to obtain the normalized target parameters of the motor.

[0079] 7) The result output module performs inverse normalization and rationality verification on the normalized motor target parameters and outputs the final result.

[0080] This invention utilizes a TensorFlow-based generative AI motor parameter generation system to ensure the standardization and efficiency of motor parameter generation through a standardized closed-loop process (data acquisition → preprocessing → model training → parameter generation → verification output). This not only shortens the design cycle of motor parameters to the greatest extent, but also enables the process to be quickly re-executed to generate new parameters when requirements change, thus completely solving the pain points of "poor adaptability and slow response" in the motor parameter design process.

[0081] Preferably, in step 1), the historical data in the field of motor design comes from motor design databases, industry standard libraries, or actual engineering cases of enterprises;

[0082] The user requirement parameters in the historical data of the motor design field include curb weight, frontal area, drag coefficient, transmission efficiency, maximum gradeability, 0-100km / h acceleration, and motor installation dimensions.

[0083] The target parameters of the motor in the historical data of the motor design field include the number of winding turns, wire diameter, winding type, core material, core lamination thickness, stator slot type / number of slots, air gap width, permanent magnet material, permanent magnet magnetization direction, and rotor slot type.

[0084] In this way, the present invention thoroughly clarifies the source of sample data and parameter dimensions (7 types of user requirement parameters + N types of motor target parameters), ensuring the comprehensiveness and relevance of training data. This enables the model to fully learn the explicit correlation and implicit coupling relationship between "scenario requirements → motor parameters". The final generated parameters match user requirements with a degree of ≥95%, which is better than the accuracy of manual design, and is suitable for various types of motor design scenarios such as automotive and industrial applications.

[0085] Preferably, in step 2), the data cleaning includes removing outliers and filling in missing values;

[0086] Among them, outlier values ​​are parameter values ​​that exceed the range of the motor engineering specifications, and the missing values ​​are filled by K-nearest neighbor interpolation or mean filling method.

[0087] This invention effectively improves the purity and completeness of training data by cleaning operations such as removing outliers and filling in missing values, avoiding interference from outliers in model training. At the same time, it uses K-nearest neighbor interpolation or mean imputation to ensure data continuity, providing a high-quality data foundation for subsequent model training, reducing model noise, and enhancing the model's generalization ability to complex demand scenarios.

[0088] Preferably, in step 3), the generative AI model is a generative adversarial network, including a generator and a discriminator, and is constructed as follows:

[0089] The generator is built based on TensorFlow's tf.keras.layers. The input layer is used to receive a 7-dimensional user requirement parameter vector. The hidden layer includes 3-5 fully connected layers, a batch normalization layer, and a ReLU activation function. The output layer is used to output an N-dimensional motor target parameter vector (N is the number of motor target parameters).

[0090] The discriminator is built based on TensorFlow's tf.keras.layers. The input layer is used to receive a concatenated vector of "user requirement parameters + real / generated motor target parameters". The hidden layer includes 3-5 fully connected layers and the LeakyReLU activation function. The output layer is used to output the discrimination score.

[0091] During model compilation, the Adam optimizer is configured, the discriminator loss function is the WGAN-GP gradient penalty loss, and the generator loss function is the discrimination score of the generated samples.

[0092] Obviously, the generator and discriminator in this invention have a targeted structural design (fully connected layer + batch normalization layer + specific activation function), and are equipped with WGAN-GP gradient penalty loss and Adam optimizer. This avoids the mode collapse problem of traditional GANs from the architectural level, ensuring that the generated parameters are both diverse and stable. At the same time, the model compilation configuration adapts to the core requirements of motor parameter generation, improving the efficiency of parameter generation and engineering adaptability.

[0093] Preferably, in step 4), the iterative training is based on TensorFlow's tf.GradientTape to implement a custom training loop, alternately optimizing the discriminator and the generator: first fix the generator and optimize the discriminator, then fix the discriminator and optimize the generator;

[0094] The performance evaluation uses the mean absolute error (MAE) as the core indicator to determine the model performance.

[0095] This invention implements alternating optimization of the generator and discriminator based on a custom training loop using tf.GradientTape. Combined with the core MAE evaluation metrics and iterative training logic, it ensures that the model can quickly converge to the optimal state. Simultaneously, the performance evaluation criteria of this invention can avoid overfitting caused by excessive iteration, improving the model's generalization ability and ensuring high reliability of the generated motor parameters under different application scenarios.

[0096] Preferably, in step 5), the visual interface is a web-based or desktop interactive interface;

[0097] The parameter validity check includes verifying that the parameter data type is numeric and that the parameter value is within the preset project range. If the parameter is invalid, a pop-up window will display the specific error and require the user to re-enter it.

[0098] First, the visual interactive interface of this invention lowers the barrier to entry for users, allowing them to input their needs without requiring a professional technical background.

[0099] Secondly, the parameter validity verification (data type + project scope verification) and pop-up error prompts of this invention can avoid generation failures caused by invalid input in advance, reduce invalid calculation overhead, and at the same time ensure that the input parameters meet the actual working conditions, laying the foundation for the accuracy of subsequent parameter generation.

[0100] Preferably, in step 6), the normalization process reuses the mean μ and standard deviation σ of the user demand parameters calculated in step 2) to ensure that the normalization rules are consistent;

[0101] The method for obtaining the normalized motor target parameters specifically includes: the parameter generation module calls the best-performing generative AI model stored in the model training and optimization module, inputs the normalized user requirement parameters into the generator in tensor form, and the generator outputs the normalized motor target parameters.

[0102] This invention reuses the mean μ and standard deviation σ from the data preprocessing stage, which can ensure the consistency of the normalization rules and avoid parameter generation errors caused by differences in processing rules.

[0103] In addition, this invention adapts to the computational characteristics of the TensorFlow architecture by inputting the model in tensor form, which improves the efficiency of parameter generation and ensures the standardization of the generation process, further guaranteeing the accuracy of the output parameters.

[0104] Preferably, in step 7), the inverse normalization calculation formula is as follows:

[0105] x_actual = x_norm × σ + μ

[0106] In the formula, x_actual is the actual engineering value after denormalization, x_norm is the normalized target parameter of the motor, σ is the mean of the target parameter of the motor recorded in step 2), and μ is the standard deviation of the target parameter of the motor recorded in step 2).

[0107] The rationality verification includes determining whether the motor target parameters after denormalization are within the preset engineering range. If they exceed the range, the parameter generation module is triggered to regenerate them, and the number of regenerations does not exceed the preset regeneration threshold.

[0108] This invention ensures the accuracy of the conversion of normalized parameters to actual engineering values ​​through an inverse normalization formula, and sets up a rationality verification and regeneration mechanism to effectively eliminate parameter combinations that are "theoretically feasible but not practically usable," ensuring that the final output parameters comply with electrical engineering specifications, reducing the ineffective costs of subsequent physical experiments, and significantly improving the feasibility of parameter implementation.

[0109] The advantages of this invention are as follows:

[0110] ① Multi-dimensional requirement input, tailored to the user's actual design process

[0111] The input parameters of this invention directly cover "user scenario-based requirement parameters" (7 core requirements such as curb weight, frontal area, gradeability, etc.), upgrading the reverse mapping of "motor performance → structure" in CN121211812A to a direct mapping of "user requirements → motor parameters".

[0112] In this way, the present invention can directly respond to cross-scenario requirements (such as vehicle-mounted and industrial motors) without requiring users to manually convert their requirements into motor performance indicators.

[0113] Most importantly, when using this invention to design motor parameters, if the requirements change, the parameters can be quickly regenerated, lowering the barrier to entry for use.

[0114] ② The WGAN-GP architecture, combined with gradient penalty, fundamentally solves the problem of GAN mode collapse.

[0115] This invention selects "WGAN-GP" (an improved version of GAN) to solve the core defects of traditional GAN ​​and existing generative motor design schemes, ensuring the stability, diversity and engineering adaptability of motor parameter generation, and providing reliable model support for the accurate mapping of "multiple demand constraints → core motor parameters".

[0116] Furthermore, this invention also adds a "gradient penalty term" to the loss function to force the discriminator to satisfy the Lipschitz constraint, thus avoiding mode collapse at the architectural level;

[0117] Finally, this invention also combines Z-Score normalization with the Adam optimizer to ensure that the generated parameters are both diverse and stable, making up for the superficial problem of CN121211812A's "relying solely on variance to quantify diversity". It even further guarantees the practicality of diversity through engineering specification verification.

[0118] ③ TensorFlow architecture empowers and improves engineering adaptability

[0119] This invention is a system built on the TensorFlow architecture, which supports distributed training (tf.distribute) and edge deployment (TensorFlow Lite), adapts to the lightweight requirements of enterprise-level large-scale training and mobile / field terminals, and completely solves the technical defect of CN121211812A "limited deployment scenarios of PyTorch framework".

[0120] Most importantly, this invention also reduces the computational power consumption after deployment by optimizing TensorFlow's tf.data prefetch and lightweighting the model, so as to adapt to edge device usage scenarios.

[0121] ④ The early stopping mechanism, combined with a precise loss function, optimizes training efficiency and generalization ability.

[0122] This invention triggers early stopping by validating set MAE (target ≤ 5%). Training stops when there is no performance improvement for 5 consecutive epochs, thus completely solving the technical defect of CN121211812A, which is prone to overfitting due to lack of early stopping.

[0123] In particular, the discriminator loss of this invention introduces "gradient penalty", and the generator loss is based on "discriminator misjudgment probability". At the same time, it combines engineering specification verification results for reverse optimization, improving the matching degree between parameters and actual needs (≥95%), and completely making up for the shortcomings of CN121211812A in "single loss function and weak generalization ability".

[0124] ⑤ Engineering specification verification combined with a regeneration mechanism ensures the practicality of parameters.

[0125] This invention sets up a regeneration mechanism and performs engineering specification verification on the parameters after denormalization (such as wire diameter, number of winding turns, and air gap width must meet the industry standard range), which completely solves the defect of CN121211812A that "generated parameters may be unusable in engineering". Through verification and regeneration, it ensures that the output parameters not only meet the data distribution consistency, but also meet the actual production and processing requirements, thus avoiding invalid solutions.

[0126] Glossary

[0127] A generative AI motor parameter generation system based on TensorFlow: In this invention, the system is an intelligent design system that relies on the TensorFlow deep learning architecture and uses a generative artificial intelligence model to receive multi-dimensional user requirements parameters (such as curb weight, gradeability, installation dimensions, etc.), automatically generate core motor parameters (such as number of winding turns, wire diameter, permanent magnet material, etc.) that meet engineering specifications and performance requirements, and has the ability to verify rationality and adapt to multiple scenarios.

[0128] Here, "generative" refers to the core AI model of the system having the ability to "actively create entirely new results," which is different from "discriminative" models (which only filter existing data). "AI" stands for Artificial Intelligence, and in this system, it specifically refers to the application of deep learning models. Attached Figure Description

[0129] Figure 1 This is a schematic diagram of the structure of the generative AI motor parameter generation system based on TensorFlow in this invention;

[0130] Figure 2 This is a schematic diagram of the generative AI motor parameter generation method based on TensorFlow in an embodiment of the present invention. Detailed Implementation

[0131] like Figure 1 As shown, a generative AI motor parameter generation system based on TensorFlow includes:

[0132] The data acquisition module is used to collect motor design sample data, which includes user requirement parameters and motor target parameters.

[0133] The data preprocessing module is used to clean and normalize the sample data, and to divide it into training, validation and test sets.

[0134] The model building module is used to build generative AI models using the TensorFlow architecture. The generative AI models include generators and discriminators.

[0135] The model training and optimization module is used to train generative AI models, evaluate model performance, and save the optimal model.

[0136] The user requirement input module is used to receive user input requirements parameters and verify the validity of the parameters;

[0137] The parameter generation module is used to input the preprocessed user requirement parameters into the optimal model to generate the target parameters of the motor;

[0138] The results output module is used to perform inverse normalization and rationality verification on the generated motor target parameters and output the final results.

[0139] The method for designing motor parameters using the above system includes the following steps:

[0140] 1) The data acquisition module uses user requirement parameters and motor target parameters from historical data in the field of motor design as sample data and sends them to the data preprocessing module;

[0141] In step 1), the historical data in the field of motor design comes from motor design databases, industry standard libraries, or actual engineering cases of enterprises;

[0142] The user requirement parameters in the historical data of the motor design field include curb weight, frontal area, drag coefficient, transmission efficiency, maximum gradeability, 0-100km / h acceleration, and motor installation dimensions.

[0143] The target parameters of the motors in the historical data of the motor design field include the number of winding turns, wire diameter, winding type, core material, core lamination thickness, stator slot type / number of slots, air gap width, permanent magnet material, permanent magnet magnetization direction, and rotor slot type. The sample data of a single type of motor is no less than 5,000 sets.

[0144] 2) The data preprocessing module cleans and normalizes the sample data, and divides it into training set, validation set, and test set;

[0145] In step 2), the data cleaning includes removing outliers and filling in missing values;

[0146] Among them, outlier values ​​are parameter values ​​that exceed the range of the motor engineering specifications, and the missing values ​​are filled by K-nearest neighbor interpolation or mean filling method.

[0147] 3) The model building module utilizes the TensorFlow architecture to construct generative AI models;

[0148] In step 3), the generative AI model is a generative adversarial network, which includes a generator and a discriminator. The specific construction method is as follows:

[0149] The generator is built based on TensorFlow's tf.keras.layers. The input layer is used to receive a 7-dimensional user requirement parameter vector. The hidden layer includes 3-5 fully connected layers, a batch normalization layer, and a ReLU activation function. The output layer is used to output an N-dimensional motor target parameter vector (N is the number of motor target parameters) and uses the Tanh activation function.

[0150] The discriminator is built based on TensorFlow's tf.keras.layers. The input layer is used to receive a concatenated vector of "user requirement parameters + real / generated motor target parameters". The hidden layer includes 3-5 fully connected layers and the LeakyReLU activation function. The output layer is used to output a 1-dimensional discriminant score and uses a linear activation function.

[0151] When compiling the model, configure the Adam optimizer, for example, with a learning rate of 0.0002, β1=0.5, β2=0.999, the discriminator loss function is WGAN-GP gradient penalty loss, and the generator loss function is the discrimination score of the generated samples.

[0152] 4) The model training and optimization module performs performance evaluation and iterative training on the generative AI model built in step 3) until the generative AI model has the best performance, and then saves the generative AI model in the model training and optimization module.

[0153] In step 4), the iterative training is based on TensorFlow's tf.GradientTape to implement a custom training loop, alternately optimizing the discriminator and generator: first fix the generator and optimize the discriminator, then fix the discriminator and optimize the generator.

[0154] The performance evaluation uses the mean absolute error (MAE) as the core indicator to determine the model performance.

[0155] The highest-performing generative AI model is saved in TensorFlow's SavedModel format, which supports subsequent loading and invocation.

[0156] 5) The user requirement input module receives the user's input requirement parameters through a visual interface and automatically verifies the validity of the parameters. If the parameters are valid, the user's input requirement parameters are sent to the parameter generation module.

[0157] In step 5), the visual interface is a web-based or desktop interactive interface;

[0158] The parameter validity verification includes verifying that the parameter data type is numerical and that the parameter value is within a preset engineering range. For example, the curb weight verification range is 500-3000 kg, and the 0-100 km / h acceleration verification range is 3-20 s. If the parameter is invalid, a pop-up window will display the specific error and require the user to re-enter it.

[0159] 6) The parameter generation module sends the user-inputted requirements parameters to the data preprocessing module for normalization, and then sends them to the model training and optimization module. The parameters are then input into the best-performing generative AI model to obtain the normalized target parameters of the motor.

[0160] In step 6), the normalization process reuses the mean μ and standard deviation σ of the user demand parameters calculated in step 2) to ensure that the normalization rules are consistent.

[0161] The method for obtaining the normalized motor target parameters specifically includes: the parameter generation module calls the best-performing generative AI model stored in the model training and optimization module, inputs the normalized user requirement parameters into the generator in tensor form, and the generator outputs the normalized motor target parameters.

[0162] 7) The result output module performs inverse normalization and rationality verification on the normalized motor target parameters and outputs the final result.

[0163] In step 7), the inverse normalization calculation formula is as follows:

[0164] x_actual = x_norm × σ + μ

[0165] In the formula, x_actual is the actual engineering value after denormalization, x_norm is the normalized target parameter of the motor (i.e., the dimensionless intermediate value), σ is the mean value of the target parameter of the motor recorded in step 2), and μ is the standard deviation of the target parameter of the motor recorded in step 2).

[0166] The rationality verification includes determining whether the motor target parameters after denormalization are within the preset engineering range. If they exceed the range, the parameter generation module is triggered to regenerate them. The number of regenerations does not exceed the preset regeneration threshold (e.g., 3 times). The final result is output in table, PDF, or Excel format, along with an analysis of the matching degree between the parameters and user requirements.

[0167] like Figure 2 As shown, the following is an example based on the above content:

[0168] Example 1: Building a Generative AI Motor Parameter Generation System Based on TensorFlow

[0169] 1) Collection of multi-dimensional datasets

[0170] Historical sample data in the field of motor design was collected, and the sample dimensions included two categories:

[0171] 1-1) User requirement parameters (input characteristics): curb weight (kg), frontal area (m²), drag coefficient (dimensionless), transmission efficiency (%), maximum gradeability (%), 0-100km / h acceleration (s), motor installation dimensions (length × width × height, mm);

[0172] 1-2) Motor target parameters (output labels): number of winding turns, wire diameter, winding type, core material, core lamination thickness, stator slot type / number of slots, air gap width, permanent magnet material, permanent magnet magnetization direction, rotor slot type, etc.

[0173] 2) Data preprocessing: The TensorFlow-based data processing tools (tf.data.Dataset, tf.keras.preprocessing) perform the following operations:

[0174] 2-1) Data cleaning: Remove outliers (such as samples with negative power or speed exceeding the engineering range) and fill in missing values ​​(using K-nearest neighbor interpolation or mean filling).

[0175] 2-2) Feature normalization: Normalize the input features and output labels (using Z-Score normalization: x_norm=(x-μ) / σ, where μ is the mean and σ is the standard deviation), and map the parameter range to [-1,1] to avoid the model training being affected by the difference in parameter magnitude;

[0176] 2-3) Dataset partitioning: The dataset is divided into a training set (for model training), a validation set (for hyperparameter tuning), and a test set (for model generalization evaluation) in an 8:1:1 ratio. A batch data iterator is built using tf.data, which supports prefetch optimization (prefetch()).

[0177] 3) Building generative AI models based on TensorFlow

[0178] WGAN-GP is used as the generative core model to improve the stability of the generated parameters. The model structure is built based on TensorFlow's tf.keras.layers, specifically including:

[0179] 3-1) Generator:

[0180] 3-1-1) Input layer: Receives the normalized user requirement parameter vector (dimension = number of input features, such as 7 dimensions);

[0181] 3-1-2) Hidden layers: 3-5 fully connected (Dense) layers, with the number of neurons being 256, 128, and 64 respectively. Each layer is followed by a batch normalization layer and a ReLU activation function (to avoid gradient vanishing).

[0182] 3-1-3) Output layer: N neurons (corresponding to key parameters such as "number of turns of winding, wire diameter, winding type, core material, core lamination thickness, stator slot type / number of slots, air gap width, permanent magnet material, permanent magnet magnetization direction, rotor slot type, etc."), using the Tanh activation function (matching the normalized label range).

[0183] 3-2) Discriminator:

[0184] 3-2-1) Input layer: Receives a concatenated vector of "user requirement parameters + actual / generated motor target parameters" (dimension = 7 + 2 = 9 dimensions);

[0185] 3-2-2) Hidden layers: 3-5 fully connected layers with 256, 128 and 64 neurons respectively. Each layer is followed by a LeakyReLU activation function (slope = 0.2, to enhance gradient flow).

[0186] 3-2-3) Output layer: 1 neuron, using a linear activation function (used to output the discrimination score of "real / generated sample", adapted to the loss calculation of WGAN-GP).

[0187] 3-3) Model compilation:

[0188] 3-3-1) Optimizer: Adam optimizer was used (learning rate = 0.0002, β1 = 0.5, β2 = 0.999).

[0189] 3-3-2) Loss function: The generator loss is the "probability of the discriminator misclassifying the generated sample", and the discriminator loss is the "gradient penalty loss of WGAN-GP" (to avoid mode collapse and improve the diversity of generation parameters).

[0190] 4) Model training and optimization

[0191] 4-1) Training process: Implement a custom training loop based on TensorFlow's tf.GradientTape:

[0192] 4-1-1) Iterative training: The generator and discriminator are trained alternately. In each round of training, the generator is fixed first and the discriminator is optimized (minimizing "true sample discrimination rate - generated sample discrimination rate + gradient penalty term"). Then the discriminator is fixed and the generator is optimized (maximizing "generated sample discrimination rate").

[0193] 4-1-2) Validation and Early Stopping: The model performance is evaluated using a validation set every 10 epochs (iteration cycles). The mean absolute error (MAE) is used as the metric (MAE = |generated parameters - true parameters| / true parameters, target ≤ 5%). When the MAE does not decrease for 5 consecutive epochs, early stopping is triggered to avoid overfitting.

[0194] 4-1-3) Model saving: Save the best trained model (the model corresponding to the minimum validation MAE) as TensorFlow SavedModel format, which can be used for subsequent deployment.

[0195] 5) User requirement input: Receive user input parameters through a visual interface (such as Web or desktop) and automatically verify the validity of the parameters (e.g., the curb weight must be within the range of 500-3000kg).

[0196] 6) Input preprocessing: Perform normalization processing on the valid user requirement parameters in the same way as the data preprocessing described above, and input the normalized input vector into the trained generator model to obtain the normalized motor target parameters;

[0197] 7) Post-processing and verification:

[0198] 7-1) Inverse normalization: By using the mean (μ) and standard deviation (σ) recorded during data preprocessing, the generated normalization parameters are restored to the actual engineering values ​​(x_actual=x_norm×σ+μ).

[0199] 7-2) Reasonableness check: Determine whether the parameters after denormalization conform to the electrical engineering specifications. If they exceed the range, trigger the model to be regenerated (up to 3 times).

[0200] Output results: The final motor parameters that meet the requirements (such as: number of winding turns, wire diameter, winding type, core material, core lamination thickness, stator slot type / number of slots, air gap width, permanent magnet material, permanent magnet magnetization direction, rotor slot type and other key parameters) will be output in the form of tables and documents (PDF / Excel), along with an analysis of the matching degree between the parameters and the requirements.

[0201] The functional modules of the system constructed in the above manner are shown in Table 1:

[0202] Table 1

[0203]

[0204] Example 2 uses the system established in Example 1 to design motor parameters.

[0205] This embodiment uses "generating drive motor parameters for pure electric vehicles" as an example to explain in detail the working principle of the present invention:

[0206] S1) Data Collection and Preprocessing

[0207] S1-1) Data source: Design data of pure electric vehicle drive motors from a certain automaker over the past 5 years, totaling 10,000 valid samples, including:

[0208] S1-2) Input characteristics (user requirements): Curb weight (1200-2000kg), frontal area (2.0-2.8m²) 2 ), drag coefficient (0.25-0.32), transmission efficiency (88%-95%), maximum gradeability (25%-35%), 0-100km / h acceleration (6-12s), motor installation dimensions (280×180×140-320×220×160mm);

[0209] S1-3) Output labels (motor parameters): key parameters such as number of winding turns, wire diameter, winding type, core material, core lamination thickness, stator slot type / number of slots, air gap width, permanent magnet material, permanent magnet magnetization direction, rotor slot type, etc.

[0210] S1-4) Preprocessing operations:

[0211] S1-4-1) All parameters were normalized using Z-Score, and the mean μ=[1600,2.4,0.28,91.5,30,9,300×200×150] and standard deviation σ=[200,0.2,0.02,2.5,3,1.5,10×10×5] of the input features were calculated.

[0212] S1-4-2) Divide the training set (8000 sets), validation set (1000 sets), and test set (1000 sets) into an 8:1:1 ratio, and use tf.data.Dataset.from_tensor_slices() to build a batch iterator (batch_size=64, prefetch=1).

[0213] S2) Model Construction

[0214] WGAN-GP was used as the generative model, built on TensorFlow 2.15:

[0215] S2-1) Generator: Input dimension = 7, hidden layer is Dense(256, ReLU) → BatchNormalization → Dense(128, ReLU) → BatchNormalization → Dense(64, ReLU) → output layer Dense(2, Tanh);

[0216] S2-2) Discriminator: Input dimension = 9 (7+2), hidden layer is Dense(256, LeakyReLU(0.2)) → Dense(128, LeakyReLU(0.2)) → Dense(64, LeakyReLU(0.2)) → output layer Dense(1, linear);

[0217] S2-3) Optimizer: Adam (lr=0.0002, β1=0.5), gradient penalty coefficient λ=10.

[0218] S3) Model Training

[0219] S3-1) Training environment: GPU (NVIDIA A100), TensorFlow distributed training (2 cards in parallel).

[0220] S3-2) Training process: Iterate for 1000 epochs. On the 800th epoch, the validation set MAE drops to 4.2% and does not decrease for 5 consecutive epochs, triggering early stopping;

[0221] S3-3) Model saving: Save the optimal model as ev_motor_gan_model.h5, with a test set MAE of 4.5%, which meets the engineering requirements.

[0222] S4) Parameter Generation Example

[0223] S4-1) User requirements input: curb weight 1500kg, windward area 2.2m², drag coefficient 0.27, transmission efficiency 92%, maximum gradeability 32%, 0-100km / h acceleration 8.5s, motor size 300×200×150mm;

[0224] S4-2) Input preprocessing: The normalized input vector is [(-50) / 200,(2.2-2.4) / 0.2,(0.27-0.28) / 0.02,(92-91.5) / 2.5,(32-30) / 3,(8.5-9) / 1.5,0] → [-0.25,-1.0,-0.5,0.2,0.67,-0.33,0];

[0225] S4-3) Parameter generation: Input the generator to obtain the normalized output [-0.1, 0.2];

[0226] S4-4) Post-processing:

[0227] S4-4-1) Inverse normalization: Air gap width = (-0.1)×(2.5-0.8) / 2+(2.5+0.8) / 2=1.580mm (approximately 1.6mm in engineering).

[0228] S4-4-2) Number of turns in winding = 0.2 × (180 - 80) / 2 + (180 + 80) / 2 = 130;

[0229] S4-4-3) Verification: 1.6mm∈[0.8, 2.5], 130∈[80, 180], conforms to the specification;

[0230] S4-5) Output: Generate a "Motor Parameter Report" which shows "Air gap width 1.6mm, maximum power 130kW, matching degree with user requirements 97%".

[0231] Experiments have shown that the generative AI model constructed in this invention can not only learn the implicit correlation between user needs and motor parameters (such as "drag coefficient ↑ → maximum power demand ↑"), with a parameter-to-demand matching degree of ≥95%, but also expand the model's input / output dimensions by adding new sample data (such as adding demand parameters such as "motor temperature rise" and "noise"), thus adapting to more types of motors (such as industrial motors and marine motors).

[0232] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications made to the present invention by those skilled in the art without departing from the spirit of the present invention shall fall within the protection scope of the present invention.

Claims

1. A generative AI motor parameter generation system based on TensorFlow, characterized in that, include: The data acquisition module is used to collect motor design sample data, which includes user requirement parameters and motor target parameters. The data preprocessing module is used to clean and normalize the sample data, and to divide it into training, validation and test sets. The model building module is used to build generative AI models using the TensorFlow architecture. The generative AI models include generators and discriminators. The model training and optimization module is used to train generative AI models, evaluate model performance, and save the optimal model. The user requirement input module is used to receive user input requirements parameters and verify the validity of the parameters; The parameter generation module is used to input the preprocessed user requirement parameters into the optimal model to generate the target parameters of the motor; The results output module is used to perform inverse normalization and rationality verification on the generated motor target parameters and output the final results.

2. A method for designing motor parameters using the system described in claim 1, characterized in that, Includes the following steps: 1) The data acquisition module uses user requirement parameters and motor target parameters from historical data in the field of motor design as sample data and sends them to the data preprocessing module; 2) The data preprocessing module cleans and normalizes the sample data, and divides it into training set, validation set, and test set; 3) The model building module utilizes the TensorFlow architecture to construct generative AI models; 4) The model training and optimization module performs performance evaluation and iterative training on the generative AI model built in step 3) until the generative AI model has the best performance, and then saves the generative AI model in the model training and optimization module. 5) The user requirement input module receives the user's input requirement parameters through a visual interface and automatically verifies the validity of the parameters. If the parameters are valid, the user's input requirement parameters are sent to the parameter generation module. 6) The parameter generation module sends the user-inputted requirements parameters to the data preprocessing module for normalization, and then sends them to the model training and optimization module. The parameters are then input into the best-performing generative AI model to obtain the normalized target parameters of the motor. 7) The result output module performs inverse normalization and rationality verification on the normalized motor target parameters and outputs the final result.

3. The method according to claim 1, characterized in that, In step 1), the historical data in the field of motor design comes from motor design databases, industry standard libraries, or actual engineering cases of enterprises; The user requirement parameters in the historical data of the motor design field include curb weight, frontal area, drag coefficient, transmission efficiency, maximum gradeability, 0-100km / h acceleration, and motor installation dimensions. The target parameters of the motor in the historical data of the motor design field include the number of winding turns, wire diameter, winding type, core material, core lamination thickness, stator slot type / number of slots, air gap width, permanent magnet material, permanent magnet magnetization direction, and rotor slot type.

4. The method according to claim 1, characterized in that, In step 2), the data cleaning includes removing outliers and filling in missing values; Among them, outlier values ​​are parameter values ​​that exceed the range of the motor engineering specifications, and the missing values ​​are filled by K-nearest neighbor interpolation or mean filling method.

5. The method according to claim 1, characterized in that, In step 3), the generative AI model is a generative adversarial network, which includes a generator and a discriminator. The specific construction method is as follows: The generator is built based on TensorFlow's tf.keras.layers. The input layer is used to receive a 7-dimensional user requirement parameter vector. The hidden layer includes 3-5 fully connected layers, a batch normalization layer, and a ReLU activation function. The output layer is used to output an N-dimensional motor target parameter vector (N is the number of motor target parameters). The discriminator is built based on TensorFlow's tf.keras.layers. The input layer is used to receive a concatenated vector of "user requirement parameters + real / generated motor target parameters". The hidden layer includes 3-5 fully connected layers and the LeakyReLU activation function. The output layer is used to output the discrimination score. During model compilation, the Adam optimizer is configured, the discriminator loss function is the WGAN-GP gradient penalty loss, and the generator loss function is the discrimination score of the generated samples.

6. The method according to claim 1, characterized in that, In step 4), the iterative training is based on TensorFlow's tf.GradientTape to implement a custom training loop, alternately optimizing the discriminator and generator: first fix the generator and optimize the discriminator, then fix the discriminator and optimize the generator. The performance evaluation uses the mean absolute error (MAE) as the core indicator to determine the model performance.

7. The method according to claim 1, characterized in that, In step 5), the visual interface is a web-based or desktop interactive interface; The parameter validity check includes verifying that the parameter data type is numeric and that the parameter value is within the preset project range. If the parameter is invalid, a pop-up window will display the specific error and require the user to re-enter it.

8. The method according to claim 1, characterized in that, In step 6), the normalization process reuses the mean μ and standard deviation σ of the user demand parameters calculated in step 2) to ensure that the normalization rules are consistent. The method for obtaining the normalized motor target parameters specifically includes: the parameter generation module calls the best-performing generative AI model stored in the model training and optimization module, inputs the normalized user requirement parameters into the generator in tensor form, and the generator outputs the normalized motor target parameters.

9. The method according to claim 1, characterized in that, In step 7), the inverse normalization calculation formula is as follows: x_actual = x_norm × σ + μ In the formula, x_actual is the actual engineering value after denormalization, x_norm is the normalized target parameter of the motor, σ is the mean of the target parameter of the motor recorded in step 2), and μ is the standard deviation of the target parameter of the motor recorded in step 2). The rationality verification includes determining whether the motor target parameters after denormalization are within the preset engineering range. If they exceed the range, the parameter generation module is triggered to regenerate them, and the number of regenerations does not exceed the preset regeneration threshold.

Citation Information

Patent Citations

  • Motor reverse design method and system based on generative artificial intelligence model

    CN121211812A