CAD modeling method and system based on target-guided Bayesian flow network

Through the method of target-guided Bayesian stream network, the problem of modal inconsistency and uncontrollable geometric attributes in CAD generation is solved, and unified modeling of discrete commands and continuous parameters and real-time geometric target response is realized, which improves the generation quality and controllability, and is suitable for manufacturing, construction and industrial design fields.

CN120509069APending Publication Date: 2025-08-19SICHUAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510714206.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-30
Publication Date
2025-08-19

AI Technical Summary

Technical Problem

The existing CAD generation methods are difficult to uniformly process discrete geometric instructions and continuous parameter information, resulting in unstable generation quality, lack of quantitative control capabilities for clear geometric properties, and are difficult to meet the numerical constraint goals.

Method used

The method of target-based boot Bayesian stream network is adopted, and the backbone Bayesian stream network and conditional boot network is built to achieve unified modeling of discrete commands and continuous parameters, and a boot Bayesian mechanism is introduced to perform real-time geometric target responses, and a modular training system is used to support multi-task deployment.

Benefits of technology

It realizes stable control of the CAD generation process, improves generation quality and geometric controllability, supports flexible deployment in multi-task scenarios, and is suitable for high-end manufacturing and intelligent design.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120509069A_ABST
    Figure CN120509069A_ABST
Patent Text Reader

Abstract

The invention discloses a CAD modeling method and system based on a target-guided Bayesian flow network, and the method achieves the integrated representation of discrete commands and continuous parameters in a CAD structure through the construction of a unified parameter space, and breaks the problems of training fracture and low reasoning efficiency caused by modal separation in a conventional model. A guide Bayesian mechanism (GBF) is innovatively introduced, and real-time response to geometric target (such as volume, surface area and thickness) conditions in the generation process is realized; a modular training system is adopted, a generation trunk and a guide module are decoupled, flexible replacement and expansion are supported, and the deployment capability and maintenance convenience of the model under multiple tasks and multiple scenes are improved. Through the technical means provided by the invention, the CAD generation quality is expected to be obviously improved, the geometric controllability is improved, the experience design is promoted to the target-driven design, and a new generation of intelligent design infrastructure is provided for multiple fields of manufacturing, building, industrial design and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of CAD modeling, and in particular to a CAD modeling method and system based on a target-guided Bayesian flow network. Background Art

[0002] In the industrial product design process, CAD (Computer-Aided Design) models serve as a core information carrier, widely used to express product structures and deliver manufacturing results. With the growing demand for product personalization and customization, design tasks are becoming increasingly complex. Automatically generating high-quality CAD models while meeting geometric property constraints (such as size and shape) has become a key challenge.

[0003] Parametric CAD modeling, a modeling approach that expresses 3D models as structured sequences of instructions and continuous parameter combinations, has rapidly developed in recent years with the release of large-scale CAD datasets. Research in this field can be broadly divided into two categories: unconditional generation methods, which aim to generate diverse, high-quality 3D structures; and conditional generation methods, which emphasize transforming input geometric constraints into effective CAD modeling operations. Existing methods for conditional generation tasks widely use point clouds, voxel grids, boundary representations, images, or text as input. However, these conditions are mostly fuzzy "qualitative descriptions" that make it difficult to achieve precise control of structural details. While existing work has made some progress in semantic alignment and modal conversion, systematic research on "quantitative control" of explicit numerical targets (such as volume, area, and size) remains lacking. Therefore, developing parametric modeling mechanisms that support geometric attribute-driven modeling has become a key direction for improving the controllability and practicality of CAD generation.

[0004] Existing CAD generation methods fall into two main categories: those based on autoregressive models and those based on diffusion models. Autoregressive models (such as the Transformer architecture) treat the CAD sequence as an ordered sequence of symbols and gradually predict each CAD instruction and its parameters. The advantage of this type of method lies in its strong contextual modeling capabilities during the generation process, which allows it to preserve structural dependencies even in long instruction sequences. Consequently, it performs well in terms of semantic continuity and local geometric consistency. For example, works such as DeepCAD and AutoCADFormer employ this strategy, where the training side gradually fits the conditional probability distribution through maximum likelihood estimation. However, autoregressive models rely on the output of the previous step as the current input. Therefore, any early generation errors can lead to continuous deviations in subsequent predictions, ultimately generating structurally incorrect CAD sequences and compromising geometric feasibility. Diffusion models (such as D3PM and CADiffusion) draw on successful experience in image generation by first mapping the sequence data into a Gaussian noise space and then gradually reconstructing the original data through an inverse denoising process. However, the diffusion model is naturally based on continuous spatial distribution and is difficult to directly process mixed-modal data in CAD sequences (i.e., discrete operation types and continuous parameter values). Even if the discrete part is specifically processed (such as using classification embedding), its processing of the continuous part is still likely to cause parameter deviation, resulting in a lack of geometric controllability and stability in the output results.

[0005] In summary, the current mainstream CAD generation methods generally have the following problems: On the one hand, parametric CAD sequences are highly multimodal, containing both discrete geometric instructions (such as stretching, cutting, and rotating) and continuous parameter information (such as size, angle, and position). Traditional neural network models struggle to uniformly process both types of information, resulting in unstable generation quality and incomplete semantic structures.

[0006] On the other hand, although a large number of conditional CAD generation methods have been proposed in recent years, capable of controlling structures based on multiple modalities such as point clouds, boundary images, and text descriptions, these methods generally rely on vague "qualitative conditions" and lack the ability to model and control explicit geometric properties such as volume, surface area, and size. Existing generation processes often struggle to directly meet numerical constraints and typically rely on indirect adjustments through a posteriori screening or resampling strategies, resulting in limited control accuracy and low generation efficiency. Therefore, constructing generation mechanisms that support "quantitative condition-driven" generation is a key direction for achieving controllable CAD modeling.

[0007] Therefore, there is an urgent need for a new CAD modeling method with multimodal unified modeling capabilities and controllable generation capabilities of quantitative geometric properties. Summary of the Invention

[0008] The present invention provides a CAD modeling method and system based on a target-guided Bayesian flow network to solve technical problems existing in existing CAD generation methods, such as inconsistent modes, serious error accumulation, and poor structural controllability.

[0009] According to a first aspect, an embodiment provides a CAD modeling method based on a target-guided Bayesian flow network, the method comprising: Constructing and training a backbone Bayesian stream network, and using the backbone Bayesian stream network to perform Bayesian updates according to the probability distribution parameter update results obtained in the previous iteration in each iteration according to the Bayesian inference rule; Constructing and training a conditional guidance network, and using the conditional guidance network to output a conditional distribution estimate of the target attribute based on the input target attribute or geometric condition and the probability distribution parameter results obtained by Bayesian update at each iteration; A CAD generation model based on a backbone Bayesian flow network and a conditional guidance network is established. Preset target attributes or geometric conditions are input into the CAD generation model, and a CAD sequence that meets the target attributes or geometric conditions is output. The conditional distribution estimate of the target attribute output by the target guidance network is used as a conditional guidance item to correct the probability distribution parameter results obtained by Bayesian updating. The corrected probability distribution parameter results will serve as the final update result of this iteration and participate in the next iterative update.

[0010] Furthermore, we build and train a backbone Bayesian flow network, which includes: Constructing a CAD sequence sample set for training the backbone Bayesian flow network, where each sample is a set of parameterized CAD sequences; The training samples are input into the backbone Bayesian flow network, and finally a trained backbone Bayesian flow network is obtained which can generate a large number of effective parameterized CAD sequences.

[0011] Furthermore, the backbone Bayesian flow network is constructed and trained, which specifically includes: During training, KL divergence is used as the unsupervised training target to align the sender distribution with the receiver distribution.

[0012] Furthermore, the backbone Bayesian stream network is used to perform Bayesian updating according to the Bayesian inference rule in each iteration based on the probability distribution parameter update result obtained in the previous iteration, specifically including: An unbiased Bayesian inference mechanism is introduced into the backbone Bayesian flow network, including the use of multi-path parallel sampling and average fusion strategies. At each Bayesian update step, multiple independent sampling paths are executed in parallel, and the average of the results of multiple sampling paths is taken as the new probability distribution parameter update result. The update formula is:

[0013] in, is the probability distribution parameter result obtained according to Bayesian update at the i-th iteration, is the final probability distribution parameter update result obtained in the i-1th iteration, m is the number of parallel sampling paths, j is the sampling path index, and the receiver distribution sampling is: , is a normal distribution, K is the size of the CAD sequence dictionary, is the precision parameter, is the identity matrix, is the predicted CAD sequence sampled from the output distribution, It will Each token in Mapped to one-hot encoding , is a one-hot vector of length K, The first position is 1 and the rest are 0.

[0014] Furthermore, a conditional guidance network is constructed and trained, and the conditional guidance network is used to output a conditional distribution estimate of the target attribute based on the input target attribute or geometric condition and the probability distribution parameter result obtained by Bayesian update at each iteration, specifically including: Conditional Guidance Network The input includes target attributes or geometric conditions , the probability distribution parameter of Bayesian update at the i-th iteration , precision parameters and the current time step t, the output is the conditional distribution estimate of the target attribute , which includes moment estimators of the mean and variance :

[0015] Where Z is the normalization constant, represents the sender distribution, which is obtained by adding noise to the original CAD sequence data x, α is the accuracy parameter, represents the entire dataset, It is the target attribute or geometric condition label of the CAD sequence x.

[0016] Furthermore, a conditional guidance network is constructed and trained, which specifically includes: Gradient update training is performed according to the KL divergence loss function.

[0017] Furthermore, the conditional distribution estimate of the target attribute output by the target guidance network is used as a conditional guidance item to correct the probability distribution parameter result obtained by Bayesian update. The corrected probability distribution parameter result will be used as the final update result of this iteration and participate in the next iterative update, specifically including: Modify the probability distribution parameters by combining the conditional guidance term:

[0018] in, is the final probability distribution parameter update result obtained in the i-th iteration, is the probability distribution parameter result obtained according to Bayesian update at the i-th iteration, Conditional Bootstrap Network Based on the input target attributes or geometric conditions , the probability distribution parameter of Bayesian update at the i-th iteration And the accuracy parameters The output probability distribution estimate.

[0019] According to a second aspect, an embodiment provides a CAD modeling method based on a target-guided Bayesian flow network, the method comprising: A Bayesian stream network training module is used to construct and train a backbone Bayesian stream network, and use the backbone Bayesian stream network to perform Bayesian updates according to the probability distribution parameter update results obtained in the previous iteration in each iteration according to the Bayesian inference rule; A conditional guidance network training module is used to construct and train a conditional guidance network, which uses the conditional guidance network to output a conditional distribution estimate of the target attribute based on the input target attribute or geometric condition and the probability distribution parameter results obtained by Bayesian update at each iteration; The CAD sequence generation module is used to establish a CAD generation model based on a backbone Bayesian flow network and a conditional guidance network, input preset target attributes or geometric conditions into the CAD generation model, and output a CAD sequence that meets the target attributes or geometric conditions. The conditional distribution estimate of the target attribute output by the target guidance network is used as a conditional guidance item to correct the probability distribution parameter results obtained by Bayesian updating. The corrected probability distribution parameter results will serve as the final update result of this iteration and participate in the next iterative update.

[0020] According to a third aspect, an embodiment provides an electronic device, the device comprising: a processor and a memory; The memory is used to store one or more program instructions; The processor is used to run one or more program instructions to execute the steps of a CAD modeling method based on a target-guided Bayesian flow network as described in any one of the above items.

[0021] According to the fourth aspect, an embodiment provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of a CAD modeling method based on a target-guided Bayesian flow network as described in any one of the above items are implemented.

[0022] The present invention provides a CAD modeling method and system based on a goal-guided Bayesian flow network. This method addresses key issues in traditional CAD structure generation, such as structural modal separation, severe error accumulation, and uncontrollable geometric properties. It provides a systematic solution that combines unified modeling, goal guidance, distribution calibration, and modular training. This method has brought significant technological advancements and practical results in theoretical models, engineering applications, and industrial practice. It has the following beneficial effects: (1) From the perspective of structural modeling, this paper achieves an integrated representation of "discrete commands + continuous parameters" in CAD structures by constructing a unified parameter space, breaking the problems of training discontinuity and low reasoning efficiency caused by modal separation in traditional models. The introduction of structured belief states enables the model to express complex sequence structures and supports end-to-end optimization under gradient propagation, significantly improving the generated structural integrity and spatial consistency. Experiments on multiple synthetic and real industrial CAD datasets have shown that the model outperforms traditional methods in both structural fidelity and compliance indicators and has high versatility.

[0023] (2) In terms of attribute controllability, the present invention innovatively introduces a guided Bayesian mechanism (GBF), which enables the generation process to respond in real time to geometric target conditions (such as volume, surface area, thickness, etc.). Compared with existing methods that rely on posterior screening, the present invention can dynamically adjust the sampling distribution through the guidance module during the generation phase, so that the generation path gradually approaches the set target, truly realizing the positive control capability of "reverse deducing the structure from the target". This mechanism makes the system highly industrially adaptable and can be widely used in high-end manufacturing application scenarios such as goal-driven design, constraint satisfaction optimization, and manufacturability assessment.

[0024] (3) Finally, this invention adopts a modular training system, decoupling the generation backbone from the guidance module, supporting flexible replacement and expansion, and improving the model's deployment capabilities and maintenance convenience in multiple tasks and scenarios. It has good engineering adaptability in applications such as model migration, iterative optimization, and new attribute-guided expansion, making it particularly suitable for embedding into industrial enterprises' existing CAD design platforms, intelligent manufacturing systems, and cloud-based generation services.

[0025] In summary, this invention not only theoretically proposes a CAD generation paradigm with strong versatility, rational structure, and stable reasoning, but also possesses significant practical application value in engineering practice. By integrating the Bayesian modeling framework with the target control mechanism, it achieves a technological leap from "human experience-driven" to "geometric target-driven," providing a solid technical foundation for the automated generation of high-precision, intelligent, and controllable CAD structures. This approach holds broad prospects for industrial adoption and enormous economic and social value. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 A flowchart of a CAD modeling method based on a target-guided Bayesian flow network provided by one embodiment of the present invention; Figure 2 An overall technical framework diagram of a CAD modeling method based on a target-guided Bayesian flow network provided by one embodiment of the present invention. DETAILED DESCRIPTION

[0027] The present invention will be further described in detail below by means of specific embodiments in conjunction with the accompanying drawings. Similar elements in different embodiments are numbered with associated similar elements. In the following embodiments, many detailed descriptions are provided to enable the present invention to be better understood. However, those skilled in the art will readily appreciate that some of the features may be omitted under different circumstances, or may be replaced by other elements, materials, or methods. In some cases, some operations related to the present invention are not shown or described in the specification. This is to avoid the core of the present invention being overwhelmed by excessive descriptions, and for those skilled in the art, it is not necessary to describe these related operations in detail. They can fully understand the related operations based on the description in the specification and the general technical knowledge in the art.

[0028] In addition, the features, operations, or characteristics described in the specification may be combined in any appropriate manner to form various embodiments. Furthermore, the steps or actions in the method description may be reordered or adjusted in a manner readily apparent to those skilled in the art. Therefore, the various sequences in the specification and drawings are provided solely for the purpose of clearly describing a particular embodiment and are not intended to be mandatory, unless otherwise specified.

[0029] Based on the industry's pain points, this paper proposes a goal-guided Bayesian flow network generation framework, dedicated to solving the following key problems: (1) Unified modeling of discrete and continuous mixed structures, constructing a continuous differentiable distribution space, and integrating CAD instruction types and parameter information; (2) Reduce the error accumulation in the sampling path and achieve multi-path update and stable output through an unbiased sampling mechanism; (3) Improve the scalability and stability of the generation system, decouple the conditional guidance module from the backbone network, and improve the adaptability of the model in multi-target scenarios.

[0030] 1. Unified modeling mechanism and Bayesian generation framework: As industrial product design demands ever-increasing precision, customization, and complex geometric structures, traditional CAD generation technology is increasingly facing bottlenecks such as inconsistent modalities, severe error accumulation, and poor structural controllability. The goal-guided Bayesian flow network method proposed in this paper aims to address these key difficulties and enable automatic CAD generation with geometric constraint control capabilities. Its core lies in constructing a Bayesian reasoning framework for unified parameter space modeling, achieving a controllable generation path from structure to target, a stable process, and accurate results.

[0031] First, the present invention solves the modal inconsistency problem existing in CAD instructions by unifying the modeling space. Traditional CAD generation methods usually adopt the autoregressive language modeling paradigm to convert the entire CAD program sequence into a sequence prediction task of discrete tokens. In order to achieve a unified modeling modality, such methods generally discretize continuous geometric parameters (such as coordinates, angles, radii, etc.) and convert them into a finite set of symbols, thereby forming a unified discrete input space together with the operation type. Although this discretization strategy facilitates unified model processing, there is a significant loss in expression accuracy, parameter controllability and structural continuity. Especially in industrial design scenarios that require high-precision geometric modeling, it is often difficult to meet the needs of detailed structural control and numerical alignment.

[0032] To this end, the present invention abstracts the entire CAD generation process into a series of Bayesian evolution processes of parameter states representing data distribution. Specifically, the system uses a unified distribution parameter representation space to unify the probability information of discrete command types (such as Line, Arc, Circle, etc.) and their corresponding continuous parameters (such as position, radius, angle, etc.) through the distribution parameter tensor. To express. Among them, represents the distribution parameter of the i-th step, D is the sequence length, and K is the number of categories. In this way, the statistical characteristics of the command type and its parameters of each step of the CAD sequence are determined by the distribution parameter In the subsequent Bayesian inference and update process, It will continue to evolve with the changes in observation data and prior knowledge, gradually approaching the real data distribution, thereby achieving efficient modeling and generation of CAD sequences.

[0033] In a specific embodiment, the entire CAD sequence is generated as a distribution parameter The sequence evolution process is:

[0034] To achieve the above solution, the present invention makes targeted improvements to the traditional Bayesian flow network. Unlike directly modeling the observed data step by step, the input of the Bayesian flow network is not a specific sample, but a distribution parameter that reflects the overall distribution information of the data. The network first sets a prior distribution that represents the structure of the original data. This prior distribution usually assumes that all variables are independent and identically distributed. Subsequently, during the training process, the model dynamically updates the distribution parameters based on the Bayesian inference method and the observed samples, so that the prior distribution gradually converges to a posterior distribution that accurately reflects the actual data structure.

[0035] During the training phase, the core denoising network and conditional feature extraction modules (such as the Multilayer Perceptron (MLP)) are optimized by minimizing the KL divergence between the sender and receiver distributions to ensure that the generated distribution accurately represents the target attributes. During the inference phase, target-based sampling generation is automatically performed by simply inputting the quantitative constraints of the target. This mechanism enables precise control over the properties of the generated CAD sequence, ensuring that the output not only meets the a priori structural rationality but also strictly complies with the numerical requirements set by the user.

[0036] 2. Attribute guidance mechanism In order to meet the constraints of structural quantitative targets (such as volume, area, etc.) in manufacturing design, the present invention further introduces a target guidance mechanism to achieve real-time control of the generation path. This mechanism uses an attribute prediction network to calculate the current distribution parameter state. and control accuracy parameters As input, the output target attribute conditional distribution estimation During the Bayesian sampling process, this guide distribution is multiplied into the original update formula, dynamically adjusting the sampling direction at each step so that the model gradually approaches the geometric target set by the user during the generation process, forming a control path of "inferring the structure from the target". Compared with traditional posterior screening methods, this method not only improves the target achievement rate, but also significantly improves the generation efficiency. That is:

[0037] Among them, the standard update term is the distribution parameter state of the Bayesian update, and only one more conditional guidance term network needs to be trained.

[0038] The technical means provided by this invention are expected to significantly improve the quality of CAD generation, enhance geometric controllability, promote the transition from "empirical design" to "goal-driven design", and provide a new generation of intelligent design infrastructure for multiple fields such as manufacturing, architecture, and industrial design.

[0039] The first embodiment of the present invention provides a CAD modeling method based on a target-guided Bayesian flow network. Figure 1 and Figure 2 Provide detailed explanation.

[0040] The present invention mainly includes two independent and separately trained core modules: the skeleton Bayesian flow network and the conditional guidance network. The specific implementation process is as follows: like Figure 1 As shown, in step S100, a backbone Bayesian stream network is constructed and trained, and the backbone Bayesian stream network is used to perform Bayesian update according to the probability distribution parameter update result obtained in the previous iteration in each iteration according to the Bayesian inference rule.

[0041] The above steps specifically include: A CAD sequence sample set is constructed for training a backbone Bayesian stream network, where each sample is a set of parameterized CAD sequences. The training samples are input into the backbone Bayesian stream network, and the KL divergence is used as the unsupervised training objective during training to align the sender distribution with the receiver distribution. Finally, a well-trained backbone Bayesian stream network is obtained that can generate a large number of valid parameterized CAD sequences.

[0042] Bayesian stream networks are inspired by the transmission and reception of signals over noisy channels. A sender holds the original data signal and transmits it to a receiver through a channel. Noise is inevitable in the channel, representing information loss and uncertainty during data transmission. The receiver initially has no knowledge of the signal distribution and can only assume that all components are independent and uniformly distributed (i.e., the prior distribution). A neural network maps this prior into an output distribution, which it then uses to reconstruct the original signal as closely as possible. To improve decoding accuracy, the receiver adds noise to all potential signals in the output distribution and then performs a probability-weighted estimate to form its own "receiver distribution," which it then uses to decode the observed signal in the channel. During each signal transmission and reception, the receiver continuously refines its estimated signal distribution through Bayesian inference and observations, gradually approximating it to the true signal distribution. During the inference process, the KL divergence between the sender and receiver distributions represents the loss in the communication process and reflects the effectiveness of information transmission. By minimizing this loss, Bayesian stream networks can efficiently and accurately transmit and reconstruct target signals over noisy channels, enabling effective modeling and generation of complex data structures.

[0043] The present invention abstracts the entire CAD generation process into a series of Bayesian evolution processes of parameter states representing data distribution. The system uses a unified distribution parameter representation space to unify the probability information of discrete command types (such as Line, Arc, Circle, etc.) and their corresponding continuous parameters (such as position, radius, angle, etc.) through the distribution parameter tensor. To express. Among them, represents the distribution parameter of the i-th step, D is the sequence length, and K is the number of categories. In this way, the statistical characteristics of the command type and its parameters of each step of the CAD sequence are determined by the distribution parameter Provide a systematic description.

[0044] Skeleton Bayesian flow network training mainly includes: (1) Input: CAD sequence sample set , each sample is a set of parameterized CAD sequences.

[0045] (2) Processing: a. For the input sequence , generate the sender distribution by adding noise:

[0046] where the noise intensity is determined by the hyperparameter precision control.

[0047] b. The network accepts the distribution parameters at each moment As input, output predicted distribution behind the real data .

[0048] Where n is the total number of sampling steps. is from its corresponding logits Independently sampled, but these logits are distributed across the Through the network Joint generation implicitly introduces dependencies between dimensions.

[0049] c. The receiver adds noise to all potential signals in the output distribution and performs a probability weighted estimate to form the receiver distribution:

[0050] d. Construct a training objective function to minimize the KL divergence between the sender distribution and the receiver distribution:

[0051] (3) Output: A trained skeleton network that can generate a large number of valid parameterized CAD sequences.

[0052] In addition, in the existing Bayesian flow network implementation, the Bayesian update process usually adopts a single-path sampling mechanism, and the iterative update formula of its distribution parameters is:

[0053] in, Sampling the receiver distribution, is the one-hot distribution embedding of the input data x, is a hyperparameter, indicating the degree of noise addition. After perturbation, sample from the constructed receiver distribution , to achieve Bayesian update of distribution parameters. However, since sampling is based on a single path each time, sampling noise will continue to accumulate as iterations proceed, resulting in exposure bias, which seriously affects the accuracy and stability of inference.

[0054] In this embodiment, to eliminate the above-mentioned exposure bias, the present invention proposes a multi-sample parallel Bayesian update mechanism. Specifically, an unbiased Bayesian inference mechanism is introduced into the backbone Bayesian flow network, including the use of multi-path parallel sampling and average fusion strategies. At each Bayesian update step, multiple independent sampling paths are executed in parallel, and the average of the results of the multiple sampling paths is taken as the new probability distribution parameter update result. The update formula is:

[0055] in, is the probability distribution parameter result obtained according to Bayesian update at the i-th iteration, is the final probability distribution parameter update result obtained in the i-1th iteration, m is the number of parallel sampling paths, j is the sampling path index, and the receiver distribution sampling is: , is a normal distribution, K is the size of the CAD sequence dictionary, is the precision parameter, is the identity matrix, is the predicted CAD sequence sampled from the output distribution, It will Each token in Mapped to one-hot encoding , is a one-hot vector of length K, The first position is 1 and the rest are 0.

[0056] like Figure 1 As shown, in step S100, a conditional guidance network is constructed and trained, and the conditional guidance network is used to output a conditional distribution estimate of the target attribute based on the input target attribute or geometric condition and the probability distribution parameter result obtained by Bayesian update at each iteration.

[0057] The above steps specifically include: Conditional Guidance Network The input includes target attributes or geometric conditions , the probability distribution parameter of Bayesian update at the i-th iteration , precision parameters and the current time step t, the output is the conditional distribution estimate of the target attribute , which includes moment estimators of the mean and variance ; Gradient update training is performed according to the KL divergence loss function.

[0058] The training of the conditional guidance network mainly includes: (1) Input: with target geometric attributes CAD sequence sample set (such as area, perimeter, number of features, etc.) .

[0059] To model the conditional bootstrap distribution, we assume it follows a Gaussian distribution and use a neural network to predict:

[0060] in and are the predicted mean and covariance respectively. Note that the network input is the distribution parameter Rather than a specific CAD sample Since the true mean and variance of the distribution parameters cannot be directly observed, moment estimates are obtained using statistics:

[0061] Where Z is the normalization constant, represents the sender distribution, which is obtained by adding noise to the original CAD sequence data x, α is the accuracy parameter, represents the entire dataset, It is the target attribute or geometric condition label of the CAD sequence x.

[0062] (2) Processing: a. First construct the data pair ,in is the parameter of the data distribution after noise addition in step i, For this distribution The attribute values are approximated based on the above statistical results.

[0063] a. Build a training network whose input is a distribution state and the current time step i, the output is the mean variance of the target attribute , and perform gradient update training through the KL loss function:

[0064] (3) Output: An intermediate product of the Bayesian flow network - distribution parameters The network that predicts properties can guide the sampling results of Bayesian updates to be more biased towards input attributes.

[0065] like Figure 1 As shown, in step S100, a CAD generation model based on a backbone Bayesian flow network and a conditional guidance network is established, preset target attributes or geometric conditions are input into the CAD generation model, and a CAD sequence that meets the target attributes or geometric conditions is output, wherein the conditional distribution estimate of the target attribute output by the target guidance network is used as a conditional guidance item to correct the probability distribution parameter result obtained by Bayesian update, and the corrected probability distribution parameter result will be used as the final update result of this iteration and participate in the next iterative update.

[0066] The above steps specifically include: Modify the probability distribution parameters by combining the conditional guidance term:

[0067] in, is the final probability distribution parameter update result obtained in the i-th iteration, is the probability distribution parameter result obtained according to Bayesian update at the i-th iteration, Conditional Bootstrap Network Based on the input target attributes or geometric conditions , the probability distribution parameter of Bayesian update at the i-th iteration And the accuracy parameters The output probability distribution estimate.

[0068] Based on the above formula, during the Bayesian sampling process, by multiplying the conditional guidance term by the probability distribution parameter result of the Bayesian update, the sampling direction of each step is dynamically adjusted, so that the model gradually approaches the geometric target set by the user during the generation process, forming a control path of "reverse deducing the structure from the target".

[0069] In the application process of the present invention, according to the target attributes or geometric conditions set by the user (denoted as ), using the trained conditional guidance network and the Bayesian flow sampling mechanism to achieve conditional generation of parametric CAD sequences. After the system is deployed, the user only needs to input the desired target attributes or geometric conditions ( ), the system can automatically complete the subsequent generation and optimization work.

[0070] The specific process of conditional guided Bayesian stream sampling is as follows: (1) Input and output enter: Target attribute or condition ; Initial accuracy ; Sampling steps ; CAD sequence dictionary size ; Trained conditional guidance network .

[0071] Output: CAD sequences that meet the requirements .

[0072] (2) Calculation a. Initialize distribution parameters: ; b. Iterate from i=1 to n. In each iteration: Current time step ; Sample observations from the output distribution: ; Calculate the current step accuracy parameter ; Compute the receiver distribution sampling from the observations: ; Bayesian update distribution parameters: ; Modify the distribution parameters by combining conditional bootstrapping: ; c. Final sampling to obtain the CAD sequence ; d. Return .

[0073] Corresponding to the above-disclosed CAD modeling method based on a target-guided Bayesian flow network, an embodiment of the present invention further discloses a CAD modeling system based on a target-guided Bayesian flow network, which specifically includes: A Bayesian stream network training module is used to construct and train a backbone Bayesian stream network, and use the backbone Bayesian stream network to perform Bayesian updates according to the probability distribution parameter update results obtained in the previous iteration in each iteration according to the Bayesian inference rule; A conditional guidance network training module is used to construct and train a conditional guidance network, which uses the conditional guidance network to output a conditional distribution estimate of the target attribute based on the input target attribute or geometric condition and the probability distribution parameter results obtained by Bayesian update at each iteration; The CAD sequence generation module is used to establish a CAD generation model based on a backbone Bayesian flow network and a conditional guidance network, input preset target attributes or geometric conditions into the CAD generation model, and output a CAD sequence that meets the target attributes or geometric conditions. The conditional distribution estimate of the target attribute output by the target guidance network is used as a conditional guidance item to correct the probability distribution parameter results obtained by Bayesian updating. The corrected probability distribution parameter results will serve as the final update result of this iteration and participate in the next iterative update.

[0074] It should be noted that for a detailed description of a CAD modeling system based on a target-guided Bayesian flow network provided in an embodiment of the present invention, reference can be made to the relevant description of a CAD modeling method based on a target-guided Bayesian flow network provided in an embodiment of the present invention, which will not be repeated here.

[0075] In addition, an embodiment of the present invention also provides an electronic device, which includes: a processor and a memory; the memory is used to store one or more program instructions; the processor is used to run one or more program instructions to execute the steps of a CAD modeling method based on a target-guided Bayesian flow network as described in any of the above items.

[0076] It should be noted that, for a detailed description of an electronic device provided in an embodiment of the present invention, reference can be made to the relevant description of a CAD modeling method based on a target-guided Bayesian flow network provided in an embodiment of the present application, which will not be repeated here.

[0077] In addition, an embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of a CAD modeling method based on a target-guided Bayesian flow network as described in any of the above items are implemented.

[0078] It should be noted that, for a detailed description of a computer-readable storage medium provided in an embodiment of the present invention, reference can be made to the relevant description of a CAD modeling method based on a target-guided Bayesian flow network provided in an embodiment of the present application, which will not be repeated here.

[0079] Those skilled in the art will appreciate that all or part of the functions of the various methods in the above embodiments can be implemented by hardware or by computer program. When all or part of the functions in the above embodiments are implemented by computer program, the program can be stored in a computer-readable storage medium, and the storage medium can include: read-only memory, random access memory, disk, optical disk, hard disk, etc., and the program is executed by a computer to implement the above functions. For example, the program is stored in the memory of the device, and when the program in the memory is executed by the processor, all or part of the above functions can be implemented. In addition, when all or part of the functions in the above embodiments are implemented by computer program, the program can also be stored in a storage medium such as a server, another computer, disk, optical disk, flash disk or mobile hard disk, and saved in the memory of the local device by downloading or copying, or the system of the local device is updated. When the program in the memory is executed by the processor, all or part of the functions in the above embodiments can be implemented. The above examples are used to illustrate the present invention, which are only used to help understand the present invention and are not intended to limit the present invention. Those skilled in the art can make several simple deductions, modifications or substitutions based on the concept of the present invention.

Claims

1. A CAD modeling method based on a target-guided Bayesian flow network, characterized in that: The method comprises: Constructing and training a backbone Bayesian stream network, and using the backbone Bayesian stream network to perform Bayesian updates according to the probability distribution parameter update results obtained in the previous iteration in each iteration according to the Bayesian inference rule; Constructing and training a conditional guidance network, and using the conditional guidance network to output a conditional distribution estimate of the target attribute based on the input target attribute or geometric condition and the probability distribution parameter results obtained by Bayesian update at each iteration; A CAD generation model based on a backbone Bayesian flow network and a conditional guidance network is established. Preset target attributes or geometric conditions are input into the CAD generation model, and a CAD sequence that meets the target attributes or geometric conditions is output. The conditional distribution estimate of the target attribute output by the target guidance network is used as a conditional guidance item to correct the probability distribution parameter results obtained by Bayesian updating. The corrected probability distribution parameter results will serve as the final update result of this iteration and participate in the next iterative update.

2. A CAD modeling method based on a target-guided Bayesian flow network according to claim 1, characterized in that: Build and train the backbone Bayesian stream network, including: Constructing a CAD sequence sample set for training the backbone Bayesian flow network, where each sample is a set of parameterized CAD sequences; The training samples are input into the backbone Bayesian flow network, and finally a trained backbone Bayesian flow network is obtained which can generate a large number of effective parameterized CAD sequences.

3. A CAD modeling method based on a target-guided Bayesian flow network as claimed in claim 2, characterized in that: Build and train the backbone Bayesian stream network, which also includes: During training, KL divergence is used as the unsupervised training target to align the sender distribution with the receiver distribution.

4. The CAD modeling method based on a target-guided Bayesian flow network according to claim 1, wherein: The backbone Bayesian flow network is used to perform Bayesian updating according to the Bayesian inference rule in each iteration based on the probability distribution parameter update result obtained in the previous iteration, specifically including: An unbiased Bayesian inference mechanism is introduced into the backbone Bayesian flow network, including the use of multi-path parallel sampling and average fusion strategies. At each Bayesian update step, multiple independent sampling paths are executed in parallel, and the average of the results of multiple sampling paths is taken as the new probability distribution parameter update result. The update formula is: in, is the probability distribution parameter result obtained according to Bayesian update at the i-th iteration, is the final probability distribution parameter update result obtained in the i-1th iteration, m is the number of parallel sampling paths, j is the sampling path index, and the receiver distribution sampling is: , is a normal distribution, K is the size of the CAD sequence dictionary, is the precision parameter, is the identity matrix, is the predicted CAD sequence sampled from the output distribution, It will Each token in Mapped to one-hot encoding , is a one-hot vector of length K, The first position is 1 and the rest are 0.

5. The CAD modeling method based on a target-guided Bayesian flow network according to claim 1, wherein: Construct and train a conditional guidance network, and use the conditional guidance network to output a conditional distribution estimate of the target attribute based on the input target attribute or geometric condition and the probability distribution parameter results obtained by Bayesian update at each iteration, specifically including: Conditional Guidance Network The input includes target attributes or geometric conditions , the probability distribution parameter of Bayesian update at the i-th iteration , precision parameters and the current time step t, the output is the conditional distribution estimate of the target attribute , which includes moment estimators of the mean and variance : Where Z is the normalization constant, represents the sender distribution, which is obtained by adding noise to the original CAD sequence data x, α is the accuracy parameter, represents the entire dataset, It is the target attribute or geometric condition label of the CAD sequence x.

6. The CAD modeling method based on a target-guided Bayesian flow network according to claim 1, characterized in that: Build and train a conditional guidance network, which also includes: Gradient update training is performed according to the KL divergence loss function.

7. The CAD modeling method based on a target-guided Bayesian flow network according to claim 1, characterized in that: The conditional distribution estimate of the target attribute output by the target guidance network is used as a conditional guidance item to correct the probability distribution parameter result obtained by Bayesian update. The corrected probability distribution parameter result will be used as the final update result of this iteration and participate in the next iterative update, specifically including: Modify the probability distribution parameters by combining the conditional guidance term: in, is the final probability distribution parameter update result obtained in the i-th iteration, is the probability distribution parameter result obtained according to Bayesian update at the i-th iteration, Conditional Bootstrap Network Based on the input target attributes or geometric conditions , the probability distribution parameter of Bayesian update at the i-th iteration And the accuracy parameters The output probability distribution estimate.

8. A CAD modeling method based on a target-guided Bayesian flow network, characterized in that: The method comprises: A Bayesian stream network training module is used to construct and train a backbone Bayesian stream network, and use the backbone Bayesian stream network to perform Bayesian updates according to the probability distribution parameter update results obtained in the previous iteration in each iteration according to the Bayesian inference rule; A conditional guidance network training module is used to construct and train a conditional guidance network, which uses the conditional guidance network to output a conditional distribution estimate of the target attribute based on the input target attribute or geometric condition and the probability distribution parameter results obtained by Bayesian update at each iteration; The CAD sequence generation module is used to establish a CAD generation model based on a backbone Bayesian flow network and a conditional guidance network, input preset target attributes or geometric conditions into the CAD generation model, and output a CAD sequence that meets the target attributes or geometric conditions. The conditional distribution estimate of the target attribute output by the target guidance network is used as a conditional guidance item to correct the probability distribution parameter results obtained by Bayesian updating. The corrected probability distribution parameter results will serve as the final update result of this iteration and participate in the next iterative update.

9. An electronic device, characterized in that: The device includes: a processor and a memory; The memory is used to store one or more program instructions; The processor is used to run one or more program instructions to execute the steps of the CAD modeling method based on the target-guided Bayesian flow network as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of a CAD modeling method based on a target-guided Bayesian flow network as described in any one of claims 1 to 7.