BNCT digital twin model construction, dynamic optimization methods, equipment and media
Through the separated physical information neural network model (D-PINN) and data assimilation processing, the contradiction between multi-scale modeling and data assimilation in BNCT digital twin technology was resolved, high-precision accelerator and neutron beam simulation was achieved, and real-time response and reliability were ensured.
Patent Information
- Application Number
- CN202510983303.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-17
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2045-07-17
AI Technical Summary
There are multi-scale modeling contradictions and data assimilation contradictions in BNCT digital twin technology, which lead to increased computational complexity, difficulty in precision control, and difficulty in achieving real-time response.
A separated physical information neural network model (D-PINN), including the RFQ-PINN sub-model and the BSA-PINN sub-model, is used to simulate the electromagnetic field and neutron transport processes respectively. Equivalent measured data matching the historical measured data is generated through data assimilation processing. The sensor data is dynamically transmitted using the OPC-UA protocol to construct a BNCT digital twin model.
The calculation accuracy and real-time response capability of the model are improved, ensuring that the simulation of the accelerator and neutron beam is highly consistent with the actual physical process, and optimizing the reliability of accelerator adjustment and neutron beam control.
Smart Images

Figure CN120493769B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a BNCT digital twin model construction, dynamic optimization method, device and medium. Background Art
[0002] The challenges faced by BNCT digital twin technology include multi-scale modeling contradictions. The electromagnetic field and neutron transport processes have significant differences in time and space scales, which leads to increased model complexity, computational difficulty and difficulty in precision control. At the same time, there is a data assimilation contradiction between the idealization of simulation data and the noise and uncertainty of actual measurement data, which affects real-time performance and accuracy.
[0003] To this end, how to effectively integrate multi-scale modeling, data assimilation and real-time requirements in the BNCT digital twin system to improve computing accuracy, processing complexity and ensure real-time response is a technical problem that needs to be solved urgently. Summary of the Invention
[0004] The present application provides a BNCT digital twin model construction, dynamic optimization method, device and medium, which achieves the technical effect of improving the calculation accuracy and processing complexity of the BNCT digital twin system and ensuring real-time response.
[0005] In order to achieve the above objectives, the main technical solutions adopted in this application include:
[0006] In a first aspect, an embodiment of the present application provides a method for constructing a BNCT digital twin model, the method comprising:
[0007] Performing data assimilation processing on the acquired multi-physics simulation data to generate equivalent measured data that matches the physical characteristics of the historical measured data, and generating a data assimilation training set based on the historical measured data and the equivalent measured data; wherein the multi-physics simulation data represents simulation data of the accelerator and the beam shaping device in various physical processes;
[0008] Based on the data assimilation training set, respectively training a first sub-model for characterizing an accelerator physics process and a second sub-model for characterizing a neutron beam analysis process;
[0009] A BNCT digital twin model is constructed based on the first sub-model and the second sub-model obtained through training.
[0010] This embodiment provides a method for constructing a BNCT digital twin model. By data assimilation processing, multi-physics field simulation data is combined with historical measured data to generate a data assimilation training set. This process improves data quality, enhances the adaptability of the model, and reduces data deviation, thereby ensuring the accuracy and stability of the training data. Based on the training set, the first sub-model and the second sub-model are trained respectively to characterize the accelerator physical process and the neutron beam analysis process, respectively. These two models can provide more accurate predictions, ensuring that the performance of the accelerator and the neutron beam is highly consistent with the actual physical process. Finally, the two sub-models are combined to construct the BNCT digital twin model, realizing a full-scale simulation of the accelerator and the neutron beam. The digital twin model has a strong predictive capability, which can optimize the regulation of the accelerator and the control of the neutron beam in practical applications, thereby improving the reliability of the overall model.
[0011] In one embodiment, performing data assimilation processing on the acquired multi-physics field simulation data to generate equivalent measured data that matches the physical characteristics of the historical measured data includes:
[0012] The multi-physics field simulation data is input into a physical law transfer network to obtain equivalent measured data that is aligned with the historical measured data in terms of timestamp; wherein the physical law transfer network adopts a conditional generative adversarial network architecture.
[0013] This embodiment feeds multi-physics simulation data into a physical law transfer network and utilizes a conditional generative adversarial network architecture to generate equivalent measured data aligned with historical measured data in terms of timestamps. This process ensures that the generated data has a high degree of similarity to the real data and maintains consistency in the time series, thus avoiding the impact of time deviation on data analysis and application. Through this method, the generated data not only meets the laws of physics but also has a high degree of credibility, which can be used as high-quality simulation data for subsequent model training.
[0014] In one embodiment, the physical law transfer network is trained in the following manner:
[0015] Obtain simulated data samples and measured data samples aligned in time stamps;
[0016] Inputting the simulation data sample into the generator of the physical law transmission network to generate simulated measured data;
[0017] Comparing the simulated measured data with the measured data sample through the discriminator of the physical law transfer network to determine the true probability of the simulated measured data; wherein the true probability is used to measure the similarity between the simulated measured data and the measured data sample;
[0018] Based on the true probability, the parameters of the physical law transfer network are adjusted until the similarity between the simulated measured data generated based on the adjusted physical law transfer network and the measured data sample meets a preset condition.
[0019] This embodiment obtains simulated data samples and measured data samples aligned on timestamps, inputs the simulated data samples into the generator of the physical law transfer network, generates simulated measured data, and uses a discriminator to compare the simulated measured data and the measured data samples to determine the true probability of the simulated measured data. Based on the true probability, the parameters of the physical law transfer network are adjusted until the similarity between the generated simulated measured data and the measured data samples meets the preset conditions. This process, by combining the physical equation residuals and the true probability feedback, ensures that the generated data is both consistent with the physical laws and close to the real data, significantly improving the physical consistency and prediction accuracy of the model, and providing high-quality training data for the construction of the BNCT digital twin model.
[0020] In one embodiment, the similarity between the simulated measured data and the measured data sample is characterized by a loss function of the physical law transfer network, wherein the loss function includes a physical equation residual, and the physical equation residual is used to constrain the simulated measured data to conform to the physical characteristics of the measured data sample.
[0021] In one embodiment, training a first sub-model for characterizing an accelerator physical process includes:
[0022] Using the radio frequency angular frequency and the proton initial energy in the data assimilation training set as first input data of the first sub-model, generating first output data including predicted proton beam intensity through a preset first hard constraint condition; wherein the first hard constraint condition represents limiting the first output data to a physical range of an actual proton beam intensity;
[0023] Acquire first observation data in the data assimilation training set, where the first observation data includes observed proton beam intensity, and the first observation data corresponds to the first input data;
[0024] Adding a Maxwell equation residual term to the loss function of the first sub-model to generate a first soft constraint condition, and constructing a first composite loss function based on the first soft constraint condition, the first output data, and the first observation data;
[0025] The first sub-model is trained until the first composite loss function satisfies a preset convergence condition to obtain a first sub-model for characterizing the accelerator physical process.
[0026] This embodiment generates prediction data that conforms to physical constraints by assimilating the radio frequency angular frequency and proton initial energy from the training set, thereby ensuring the credibility and operability of the predicted proton beam intensity in practical applications. Secondly, by adding the Maxwell equation residual term to the loss function, the first sub-model's prediction results are ensured to be consistent with the physical laws of electromagnetic fields, thereby enhancing its reliability. Finally, by optimizing the first composite loss function, the first sub-model can simultaneously meet physical constraints and the accuracy of actual observation data, thereby improving prediction accuracy.
[0027] In one embodiment, the first composite loss function is constructed as follows:
[0028] determining a first mean square error term between the first output data and the first observation data;
[0029] Acquiring electromagnetic characteristic parameters from the first output data, the electromagnetic characteristic parameters being used to characterize at least one of electric field strength, magnetic field strength, magnetic permeability, dielectric constant, and proton beam current density, and constructing the residual term of the Maxwell equation based on the electromagnetic characteristic parameters;
[0030] The first mean square error term and the Maxwell equation residual term are combined to obtain the first composite loss function.
[0031] This embodiment ensures that the generated data conforms to the physical laws of the electromagnetic field by obtaining electromagnetic characteristic parameters from the first output data and constructing the Maxwell equation residual term based on these electromagnetic characteristic parameters. By determining the first mean square error term and combining the first mean square error term and the Maxwell equation residual term into a first composite loss function, it is ensured that the RFQ-PINN sub-model conforms to both the measured data and the physical laws during training. This dual constraint mechanism significantly improves the model's physical consistency and prediction accuracy, providing a solid foundation for the construction of the BNCT digital twin model.
[0032] In one embodiment, training a second sub-model for characterizing a neutron beam analysis process includes:
[0033] The proton beam intensity, moderator thickness, and target temperature in the data assimilation training set are used as second input data of the second sub-model, and second output data including predicted neutron flux and predicted energy spectrum entropy are generated through a preset second hard constraint condition; wherein the second hard constraint condition represents limiting the second output data to non-negativity of the neutron flux and zeroing of the flux outside the collimator;
[0034] Acquire second observation data in the data assimilation training set, where the second observation data includes neutron flux and corresponds to the second input data;
[0035] Adding a residual term of the steady-state diffusion equation to the loss function of the second sub-model to generate a second soft constraint, and constructing a second composite loss function based on the second soft constraint, the second output data, and the second observation data;
[0036] The second sub-model is trained until the second composite loss function satisfies a preset convergence condition, thereby obtaining a second sub-model for characterizing the neutron beam analysis process.
[0037] This embodiment ensures that the neutron flux is non-negative through the second hard constraint condition and is zeroed in the area outside the collimator, thereby ensuring that the output of the second sub-model conforms to the actual physical laws. Through the second soft constraint condition, the second sub-model can not only optimize the data fitting, but also ensure that its prediction results meet the physical constraints of the steady-state diffusion equation, avoiding the overfitting problem. In addition, the construction of the comprehensive second composite loss function further enhances the generalization ability and accuracy of the second sub-model. The second sub-model can gradually improve the prediction ability of neutron flux and energy spectrum entropy during the training process, while ensuring physical consistency, and ultimately obtain reliable and accurate prediction results.
[0038] In one embodiment, the second composite loss function is constructed as follows:
[0039] determining a second mean square error term between the second output data and the second observation data;
[0040] Acquiring a neutron transport parameter of the second output data, the neutron transport parameter being used to characterize at least one of a neutron diffusion coefficient, a neutron absorption cross section, and a neutron yield, and constructing a residual term of a steady-state diffusion equation based on the neutron transport parameter;
[0041] The second mean square error term and the steady-state diffusion equation residual term are combined to obtain the second composite loss function.
[0042] This embodiment calculates a second mean squared error term to assess the discrepancy between the second sub-model's predicted output and the actual observed data, thereby improving the second sub-model's prediction accuracy and optimizing its goodness of fit. Next, based on the principle of neutron diffusion, a residual term for the steady-state diffusion equation is constructed to ensure that the second sub-model's output conforms to actual physical laws and improve physical consistency. Finally, by combining the second mean squared error term with the residual term of the steady-state diffusion equation, a second composite loss function is constructed. This allows the second sub-model to balance data fit and physical consistency during the optimization process, thereby improving the model's generalization ability, avoiding overfitting, and enhancing the second sub-model's prediction accuracy.
[0043] In a second aspect, an embodiment of the present application provides a dynamic optimization method, the dynamic optimization method comprising:
[0044] Establish a streaming data processing channel and perform time-domain synchronous acquisition of sensor group signals from the accelerator and beam shaping device to obtain sensor data;
[0045] Performing physical constraint filtering on the sensor data to obtain optimized multi-physical parameter estimation data;
[0046] The BNCT digital twin model constructed according to the construction method described above is used to predict the optimized multi-physical parameter estimation data to obtain predicted data, and an incremental training set is constructed based on the optimized multi-physical parameter estimation data and the predicted data;
[0047] When the sensor data meets a preset critical sample size, the BNCT digital twin model is dynamically optimized using the incremental training set to obtain an optimized BNCT digital twin model.
[0048] In a third aspect, an embodiment of the present application provides a computer device, including:
[0049] A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the above-mentioned BNCT digital twin model construction method or the above-mentioned dynamic optimization method by executing the computer instructions.
[0050] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which computer instructions are stored, and the computer instructions are used to enable a computer to execute the above-mentioned BNCT digital twin model construction method or the above-mentioned dynamic optimization method. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the specific implementation methods of the present application or the technical solutions in the prior art, the following is a brief introduction to the drawings required for use in the specific implementation methods or the description of the prior art. Obviously, the drawings described below are some implementation methods of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0052] Figure 1 A flowchart of a BNCT digital twin model construction method provided in an embodiment of the present application;
[0053] Figure 2 Flowchart of step S1 provided in the embodiment of the present application;
[0054] Figure 3 A flowchart of a physical law transfer network training method provided in an embodiment of the present application;
[0055] Figure 4 A flowchart of a first sub-model training method for an accelerator physics process provided in an embodiment of the present application;
[0056] Figure 5 A flowchart of a first sub-model obtained by training provided in an embodiment of the present application for characterizing accelerator physics processes;
[0057] Figure 6 A flowchart of a method for constructing a first composite loss function provided in an embodiment of the present application;
[0058] Figure 7 A flowchart of a second sub-model training method for a neutron beam analysis process provided in an embodiment of the present application;
[0059] Figure 8 A flowchart of a second sub-model obtained through training provided in an embodiment of the present application for characterizing a neutron beam analysis process;
[0060] Figure 9 A flowchart of a method for constructing a second composite loss function provided in an embodiment of the present application;
[0061] Figure 10 A flow chart of a dynamic optimization method provided in an embodiment of the present application;
[0062] Figure 11 A block diagram of a BNCT digital twin model construction device provided in an embodiment of the present application;
[0063] Figure 12 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0064] To make the purpose, technical solutions, and advantages of the embodiments of the present application more clear, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative efforts shall fall within the scope of protection of this application.
[0065] Existing digital twin technology for BNCT (boron neutron capture therapy) faces a multiscale modeling contradiction. Specifically, the physical processes involved in a BNCT digital twin system exhibit significant differences in temporal and spatial scales. Electromagnetic field changes are typically rapid, occurring at speeds of milliseconds or even microseconds, while neutron transport processes are much slower, requiring seconds or minutes for propagation and capture. Therefore, simultaneously addressing these two different timescales within the same model significantly increases model complexity, posing significant computational challenges and challenges in precision control. Furthermore, there is a data assimilation contradiction: the discrepancy between the ideality of simulated data and the noisiness of measured data. In BNCT digital twin systems, simulated data is typically calculated based on theoretical models and exhibits certain idealized properties. However, actual measured data is often affected by factors such as noise and measurement accuracy limitations, potentially resulting in errors and uncertainties.
[0066] To this end, how to effectively integrate multi-scale modeling, data assimilation and real-time requirements in the BNCT digital twin system to improve computing accuracy, processing complexity and ensure real-time response is a technical problem that needs to be solved urgently.
[0067] To address the aforementioned technical issues, the present invention constructs a BNCT digital twin model, a decoupled physical information neural network model (D-PINN). This model is a physical information-integrated neural network model composed of multiple sub-models, each of which embeds physical knowledge of specific physical processes. Unlike traditional data-driven neural networks, PINN utilizes physical laws to guide the model during learning, thereby improving model generalization capabilities, especially in situations with limited data or high noise. The D-PINN model incorporates the electromagnetic field physics knowledge of the radio frequency quad accelerator (RFQ) into the first sub-model (RFQ-PINN). This sub-model is used to simulate and predict electromagnetic field behavior in the RFQ and output proton beam intensity and energy divergence. The second sub-model (BSA-PINN) incorporates the neutron transport physics knowledge of the target and beam shaper (BSA). This sub-model is used to simulate and predict neutron transport behavior in the BSA and output neutron flux and energy spectrum entropy. In actual operation, the OPC-UA protocol data subscription-publishing mechanism is used to dynamically transmit parameters such as proton beam intensity and energy divergence, ensuring that the model can receive and process the latest sensor data in real time.
[0068] According to an embodiment of the present application, an embodiment of a BNCT digital twin model construction method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0069] In this embodiment, a method for constructing a BNCT digital twin model is provided. Figure 1 A flowchart of a BNCT digital twin model construction method provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the process includes the following steps:
[0070] Step S1, performing data assimilation processing on the acquired multi-physics field simulation data to generate equivalent measured data that matches the physical characteristics of the historical measured data, and generating a data assimilation training set based on the historical measured data and the equivalent measured data; wherein the multi-physics field simulation data represents the simulation data of the accelerator and beam shaping device in various physical processes.
[0071] Multi-physics simulation data refers to the simulation data of accelerators and beam shaping devices in various physical processes obtained through simulation software. Specifically, the simulation data for accelerators in various physical processes include three-dimensional magnetic field strength (H), three-dimensional electric field strength (E), dielectric constant (ε), magnetic permeability (μ), radio frequency angular frequency (ω), proton initial energy (p0), cavity geometry, proton beam current density (J), proton beam intensity (I beam ), energy divergence (ΔE / E); simulation data for the beam shaping device in various physical processes include moderator density, moderator thickness, target geometry, target temperature, neutron yield (S), proton beam intensity, neutron flux ( ), epithermal neutron fraction, and energy spectrum entropy. When using simulation software to simulate the transient electromagnetic field of an accelerator, the time step must be set to 1 microsecond (Δt=1μs) to ensure that the accuracy of the simulation data matches the historical measured data. When simulating neutron transport in a beam shaping device, the time step must be set to 1 millisecond (Δt=1ms) to ensure that the timestamp format aligns with the historical measured data. By adjusting the time step and timestamp format of the simulation data, strict temporal alignment of multiphysics simulation data with historical measured data is ensured.
[0072] Historical measured data refers to data collected by a precision sensor group that reflects the physical state of the accelerator and beam shaping device during actual operation. It includes the three-dimensional magnetic field strength (H), three-dimensional electric field strength (E), dielectric constant (ε), magnetic permeability (μ), radio frequency angular frequency (ω), proton initial energy (p0), cavity geometry, proton beam current density (J), proton beam intensity (I beam ), energy divergence (ΔE / E); and moderator density, moderator thickness, target geometry, target temperature, neutron yield (S), proton beam intensity, neutron flux ( ), epithermal neutron ratio, and energy spectrum entropy (calculated by an energy spectrometer). Here, the dynamic parameters in the historical measured data (such as magnetic field distribution, neutron flux, etc.) need to be timestamped using the ISO 8601 extended format with an accuracy of microseconds, and multi-sensor clock synchronization is achieved through the IEEE 1588 Precision Time Protocol (PTP) with an error of no more than 1 microsecond. Dynamic parameters usually change rapidly over time, so high-precision timestamp marking and synchronization mechanisms are required to ensure data accuracy and consistency. Since sensor data may contain outliers caused by noise or faults, these outliers will affect the data quality and the training effect of the model. Therefore, it is also necessary to remove outliers caused by sensor noise or faults based on the 3σ criterion (three times the standard deviation) to reduce the impact of abnormal data on model training and improve the robustness and prediction accuracy of the model.
[0073] Steady-state parameters in historical measured data (such as target geometry and chamber dimensions) are labeled SteadyState@Version1. This version number is associated with the operating configuration file. Steady-state parameters typically do not change over time, but their versions and configurations need to be clearly documented for traceability and verification under different operating conditions.
[0074] Data assimilation involves correcting errors in multi-physics simulation data through physical constraints and statistical methods, bringing it closer to historical measured data. This ensures that the generated equivalent measured data is strictly aligned with the historical measured data at the timestamp, allowing it to be directly used for model training. Finally, all historical measured data and equivalent measured data are blended to form a data assimilation training set. By increasing the amount and diversity of data, the model's generalization and prediction accuracy are improved.
[0075] Step S3: Based on the data assimilation training set, a first sub-model for characterizing the accelerator physics process and a second sub-model for characterizing the neutron beam analysis process are trained respectively.
[0076] Specifically, the process of training the first sub-model based on the data assimilation training set utilizes a combination of hard and soft constraints to ensure that the proton beam intensity and energy divergence output by the first sub-model conform to both physical laws and are highly consistent with the measured data. Hard constraints ensure the physical rationality of the output values through activation functions, while soft constraints further ensure that the generated data satisfies the physical laws of the electromagnetic field by adding Maxwell equation residual terms to the loss function. By minimizing the composite loss function containing the mean square error and Maxwell equation residuals, the first sub-model is continuously optimized during the training process until the preset convergence conditions are met, thereby obtaining the trained first sub-model, which provides a solid prediction foundation for the construction of the BNCT digital twin model.
[0077] Similarly, the process of training the second sub-model based on the data assimilation training set generates neutron flux and energy spectrum entropy prediction results that are both in line with physical laws and highly consistent with the measured data. During the training process, hard constraints are used to ensure the non-negativity of the neutron flux, and the flux outside the collimator is reset to zero through geometric boundary constraints, thereby ensuring the physical rationality of the output. At the same time, by adding the residual term of the steady-state diffusion equation as a soft constraint in the loss function, it is further ensured that the generated data meets the physical laws of neutron transport. By minimizing the composite loss function containing the mean square error and the residual term of the steady-state diffusion equation, the second sub-model is continuously optimized during the training process until the preset convergence conditions are met, and finally the trained second sub-model is obtained, which provides accurate prediction capabilities for the neutron beam analysis of the BNCT digital twin model.
[0078] Step S5: construct a BNCT digital twin model based on the first sub-model and the second sub-model obtained through training.
[0079] Specifically, the process of combining the trained first and second sub-models to construct the complete BNCT digital twin model integrates the two specialized sub-models into a unified system model, enabling comprehensive simulation and prediction of the entire BNCT system. The first sub-model simulates the electromagnetic field behavior in the accelerator and predicts the proton beam intensity and energy divergence. The second sub-model simulates the transport and diffusion of the neutron beam and predicts the neutron flux and energy spectrum entropy. During the actual operation of the BNCT digital twin model, the output of the first sub-model (proton beam intensity) serves as one of the inputs of the second sub-model, ensuring data consistency between the two sub-models. This process not only ensures data consistency with physics but also improves prediction accuracy and robustness.
[0080] This embodiment provides a method for constructing a BNCT digital twin model. By data assimilation processing, multi-physics field simulation data is combined with historical measured data to generate a data assimilation training set. This process improves data quality, enhances the adaptability of the model, and reduces data deviation, thereby ensuring the accuracy and stability of the training data. Based on the training set, the first sub-model and the second sub-model are trained respectively to characterize the accelerator physical process and the neutron beam analysis process, respectively. These two models can provide more accurate predictions, ensuring that the performance of the accelerator and the neutron beam is highly consistent with the actual physical process. Finally, the two sub-models are combined to construct the BNCT digital twin model, realizing a full-scale simulation of the accelerator and the neutron beam. The digital twin model has a strong predictive capability, which can optimize the regulation of the accelerator and the control of the neutron beam in practical applications, thereby improving the reliability of the overall model.
[0081] Figure 2 The flowchart of step S1 provided in the embodiment of the present application may include the following steps:
[0082] In step S11, the multi-physics field simulation data is input into the physical law transfer network to obtain equivalent measured data aligned with the historical measured data in terms of timestamps; wherein the physical law transfer network adopts a conditional generative adversarial network architecture.
[0083] Specifically, the Physics-Consistent Transfer Network (PCTN) utilizes a Conditional Generative Adversarial Network (CGAN) architecture, taking multi-physics simulation data as input and generating equivalent measured data that is strictly timestamped with historical measured data. The key to this process lies in leveraging the adversarial training mechanism of the CGAN generator and discriminator to ensure that the generated data is not only temporally aligned with the measured data but also physically consistent. Specifically, the generator generates equivalent measured data based on the input multi-physics simulation data and its timestamps, while the discriminator evaluates the similarity between the generated data and the real data. A feedback mechanism continuously optimizes the generator's output, ultimately generating high-quality equivalent measured data that conforms to physical laws and is time-aligned with historical measured data, providing a reliable data foundation for subsequent model training and analysis.
[0084] This embodiment feeds multi-physics simulation data into a physical law transfer network and utilizes a conditional generative adversarial network architecture to generate equivalent measured data aligned with historical measured data in terms of timestamps. This process ensures that the generated data has a high degree of similarity to the real data and maintains consistency in the time series, thus avoiding the impact of time deviation on data analysis and application. Through this method, the generated data not only meets the laws of physics but also has a high degree of credibility, which can be used as high-quality simulation data for subsequent model training.
[0085] Figure 3 A flowchart of a physical law transfer network training method provided in an embodiment of the present application may include the following steps:
[0086] Step S111 : Acquire simulation data samples and measured data samples aligned in time stamps.
[0087] Specifically, in order to ensure that the input of the generator and the comparison benchmark of the discriminator are strictly aligned in time and provide a consistent data basis for subsequent training, it is necessary to obtain simulated data samples and measured data samples that are aligned in timestamps.
[0088] Step S113: input the simulation data sample into the generator of the physical law transmission network to generate simulated measured data.
[0089] To address the distribution discrepancies between multi-physics simulation data and historical measured data and expand the training sample size, the physical law transfer network here uses a conditional generative adversarial network (GAN) architecture, combined with physical equations, to generate equivalent measured data that is physically consistent with historical measured data. The conditional GAN architecture consists of a generator and a discriminator, each receiving not only the raw noisy data but also additional conditional information. This conditional information is typically a label, timestamp, category tag, or any other external variable that can influence the generated data.
[0090] Specifically, the simulation data samples are input into the generator of the physical law transmission network to generate simulated measured data that is as close as possible to the real historical measured data.
[0091] Step S115 , comparing the simulated measured data and the measured data samples through the discriminator of the physical law transfer network to determine the true probability of the simulated measured data; wherein the true probability is used to measure the similarity between the simulated measured data and the measured data samples.
[0092] Specifically, the discriminator compares simulated and measured data with actual data samples to determine the true probability of the simulated and measured data. The true probability measures the similarity between the simulated and measured data samples. The closer the value is to 1, the closer the generated data is to the real data. Through feedback from the discriminator, the generator can continuously optimize its parameters to generate simulated and measured data that is closer to the real data.
[0093] In a preferred embodiment, the similarity between the simulated measured data and the measured data samples is characterized by the loss function of the physical law transfer network, and the loss function includes the physical equation residual, which is used to constrain the simulated measured data to conform to the physical characteristics of the measured data samples.
[0094] Specifically, the physical equation residual is added to the loss function to ensure that the generated data conforms to the physical characteristics of the measured data. Specifically, the loss function is defined as follows: L1=α×L 1adv +β×L 1MSE +γ×L 1physics , where α, β and γ are coefficients; L 1adv To combat losses; L 1MSE is the mean square error between the simulated measured data and the measured data samples; L 1physics is the residual of the physical equation.
[0095] When the generated simulated measured data is the accelerator parameter, the physical equation residual L 1physicsUsing Maxwell's equations: ,in, is the gradient operator, E is the three-dimensional electric field intensity in the simulated measured data, j is the imaginary unit, ω is the radio frequency angular frequency in the simulated measured data, μ is the magnetic permeability in the simulated measured data, H is the three-dimensional magnetic field intensity in the simulated measured data, ε is the dielectric constant in the simulated measured data, and J is the proton beam current density in the simulated measured data. By introducing this residual in the physical equation, we ensure that the generated simulated measured data conforms to the actual physical laws in terms of the electromagnetic field distribution.
[0096] When the generated simulated measured data are the target material and beam shaping device parameters, the physical equation residual L 1physics Using the steady-state diffusion equation: ;in, is the gradient operator, D is the neutron diffusion coefficient in the simulated measured data, is the neutron flux in the simulated measured data, ∑ a is the fraction of epithermal neutrons in the simulated measured data, and S is the neutron yield in the simulated measured data. This ensures that the generated simulated measured data conforms to physical laws in the neutron diffusion and propagation process.
[0097] Step S117: Based on the true probability, the parameters of the physical law transfer network are adjusted until the similarity between the simulated measured data generated based on the adjusted physical law transfer network and the measured data sample meets the preset conditions.
[0098] Specifically, a gradient penalty mechanism is used to adjust the parameters of the physical law transfer network, ensuring that the generated data (i.e., simulated measured data) not only resembles the statistical distribution of the measured data samples but also conforms to the actual physical laws at the physical level. The gradient penalty helps prevent overfitting and enables the physical law transfer network to better handle complex physical constraints. During training, the parameters of the physical law transfer network are optimized based on a loss function. Specifically, the generator continuously adjusts the network parameters by minimizing the loss function (including adversarial loss, mean squared error, and physical equation residuals) until the generated simulated measured data conforms to the target physical law, bringing the true probability close to 1.
[0099] This embodiment obtains simulated data samples and measured data samples aligned on timestamps, inputs the simulated data samples into the generator of the physical law transfer network, generates simulated measured data, and uses a discriminator to compare the simulated measured data and the measured data samples to determine the true probability of the simulated measured data. Based on the true probability, the parameters of the physical law transfer network are adjusted until the similarity between the generated simulated measured data and the measured data samples meets the preset conditions. This process, by combining the physical equation residuals and the true probability feedback, ensures that the generated data is both consistent with the physical laws and close to the real data, significantly improving the physical consistency and prediction accuracy of the model, and providing high-quality training data for the construction of the BNCT digital twin model.
[0100] Figure 4 A flowchart of a first sub-model training method for an accelerator physics process provided in an embodiment of the present application may include the following steps:
[0101] Step S501: Perform data assimilation processing on the acquired multi-physics field simulation data to generate equivalent measured data that matches the physical characteristics of the historical measured data, and generate a data assimilation training set based on the historical measured data and the equivalent measured data; wherein the multi-physics field simulation data represents the simulation data of the accelerator in various physical processes.
[0102] Step S503 , extracting first input data and first observation data from the data assimilation training set, where the first observation data corresponds to the first input data; wherein the first input data is used to characterize the accelerator initial conditions, and the first observation data is used to characterize the beam characteristics.
[0103] Step S505 , generating first output data corresponding to the first input data through a preset first hard constraint condition; wherein the first hard constraint condition represents limiting the first output data to a physical range of an actual proton beam intensity.
[0104] Step S507: Train the first sub-model using a first composite loss function comprising a first soft constraint, first output data, and first observation data until the first composite loss function satisfies a preset convergence condition, thereby obtaining a first sub-model for characterizing the accelerator's physical processes. The first soft constraint is used to characterize the consistency between the first sub-model's prediction results and the electromagnetic field's physics. This embodiment performs data assimilation on multi-physics field simulation data to generate equivalent measured data that matches historical measured data, thereby constructing a data assimilation training set. This data assimilation training set, comprising both historical measured data and equivalent measured data, can more accurately reflect the accelerator's behavior in various physical processes. Based on this, the first input data and first observation data from the data assimilation training set are extracted and used to characterize the accelerator's initial conditions and beam characteristics, respectively. By setting the first hard constraint, the generated first output data is ensured to be within the physical range of the actual proton beam intensity, guaranteeing the rationality of the physical process. Subsequently, the first sub-model is trained using a first composite loss function containing a first soft constraint, combined with the first output data and the first observation data, until the first composite loss function meets the preset convergence condition. This ultimately results in a first sub-model that accurately characterizes the accelerator's physical processes. The first soft constraint ensures that the model's predictions are consistent with electromagnetic field physics, thereby improving the accuracy and practicality of the simulation model.
[0105] Figure 5 The flowchart of the first sub-model for characterizing the accelerator physical process obtained through training provided in the embodiment of the present application may include the following steps:
[0106] Step S311: Using the radio frequency angular frequency and proton initial energy in the data assimilation training set as first input data of the first sub-model, first output data including predicted proton beam intensity is generated through a preset first hard constraint condition; wherein the first hard constraint condition represents limiting the first output data to a physical range of an actual proton beam intensity.
[0107] Specifically, the data assimilation training set, which is a mixture of historical measured data and equivalent measured data generated by the physical law transmission network, enriches the data samples for model training. The first sub-model (RFQ-PINN) is used to characterize the accelerator physical process and can predict the proton beam intensity and energy divergence based on the input RF angular frequency and proton initial energy. The first hard constraint condition refers to directly forcing the output value to meet the physical constraint condition through the activation function, ensuring that the predicted proton beam intensity and predicted electric field intensity output by the first sub-model are within a physically reasonable range, avoiding the generation of non-physical values. Specifically, the Sigmoid activation function is used to compress the output value of the last layer of the neural network in the first sub-model to the interval [0,1]. Map the normalized value to the actual physical range. For the proton beam intensity Ibeam , the mapping formula is: I beam =I min +I norm (I max -I min ), I norm is the output value of the Sigmoid function, ranging from [0,1]; I max and I min are the minimum and maximum values of the practical physical range of proton beam intensity.
[0108] Step S313 : acquiring first observation data in the data assimilation training set, where the first observation data includes observed proton beam intensity, and the first observation data corresponds to the first input data.
[0109] Specifically, the first observation data in the data assimilation training set, especially the observed proton beam intensity, are obtained. These first observation data will serve as a benchmark for comparison with the first output data predicted by the model.
[0110] Step S315: Add the Maxwell equation residual term to the loss function of the first sub-model to generate a first soft constraint condition, and construct a first composite loss function based on the first soft constraint condition, the first output data and the first observation data.
[0111] Specifically, to ensure that the output of the first sub-model conforms not only to the data but also to the physical laws of the electromagnetic field, the first composite loss function of the first sub-model incorporates a Maxwell equation residual term, which serves as the first soft constraint. Maxwell's equations describe the behavior of the electromagnetic field, and the residual term measures the difference between the prediction of the first composite loss function and the Maxwell equations. This term ensures that the first composite loss function is optimized not only by training with data but also by the laws of physics.
[0112] The residual term of Maxwell's equation is defined as: ,in, is the gradient operator, E is the three-dimensional electric field intensity in the first output data, j is the imaginary unit, ω is the radio frequency angular frequency in the first output data, μ is the magnetic permeability in the first output data, H is the three-dimensional magnetic field intensity in the first output data, ε is the dielectric constant in the first output data, and J is the proton beam current density in the first output data.
[0113] The first composite loss function L RFQ =ξMSE(I pred ,I obs ) + τR m , where ξ and τ are weight coefficients; I pred is the first output data of the first sub-model; obsis the first observation data; MSE (I pred ,I obs ) is the mean square error between the first output data and the first observation data.
[0114] Step S317 , training the first sub-model until the first composite loss function satisfies a preset convergence condition, so as to obtain the first sub-model for characterizing the accelerator physical process.
[0115] Specifically, a threshold of the first composite loss function is set during the training process. When the value of the first composite loss function is lower than the threshold, the training of the first sub-model is considered completed.
[0116] This embodiment generates prediction data that conforms to physical constraints by assimilating the radio frequency angular frequency and proton initial energy from the training set, thereby ensuring the credibility and operability of the predicted proton beam intensity in practical applications. Secondly, by adding the Maxwell equation residual term to the loss function, the first sub-model's prediction results are ensured to be consistent with the physical laws of electromagnetic fields, thereby enhancing its reliability. Finally, by optimizing the first composite loss function, the first sub-model can simultaneously meet physical constraints and the accuracy of actual observation data, thereby improving prediction accuracy.
[0117] Figure 6 This is a flowchart of a method for constructing a first composite loss function provided in an embodiment of the present application. The process may include the following steps:
[0118] Step S3151, determine a first mean square error term between the first output data and the first observation data.
[0119] Specifically, the first mean square error term is used to measure the difference between the predicted first output data and the actually measured first observation data, and is used as part of the first composite loss function to optimize the first sub-model parameters and improve the prediction accuracy.
[0120] Step S3153: Acquire electromagnetic characteristic parameters in the first output data, where the electromagnetic characteristic parameters are used to characterize at least one of electric field strength, magnetic field strength, magnetic permeability, dielectric constant, and proton beam current density, and construct a residual term of the Maxwell equation based on the electromagnetic characteristic parameters.
[0121] Specifically, electromagnetic characteristic parameters are extracted from the output of the first submodel, including electric field intensity E, magnetic field intensity H, magnetic permeability μ, dielectric constant ε, and proton beam current density J. The residual term of the Maxwell equation is defined as: ,in, is the gradient operator, E is the three-dimensional electric field intensity in the first output data, j is the imaginary unit, ω is the radio frequency angular frequency in the first output data, μ is the magnetic permeability in the first output data, H is the three-dimensional magnetic field intensity in the first output data, ε is the dielectric constant in the first output data, and J is the proton beam current density in the first output data. By minimizing the residual term of Maxwell's equations, the output of the first submodel is ensured to comply with the physical constraints of electromagnetics.
[0122] Step S3155: Combine the first mean square error term and the Maxwell equation residual term to obtain a first composite loss function.
[0123] Specifically, the first composite loss function L RFQ =ξMSE(I pred ,I obs ) + τR m , where ξ and τ are weight coefficients; I pred is the first output data of the first sub-model; obs is the first observation data; MSE (I pred ,I obs ) is the first mean square error term between the first output data and the first observation data. The goal of the first mean square error term is to minimize this value so that the predicted first output data of the first sub-model is closer to the actually observed first observation data.
[0124] This embodiment ensures that the generated data conforms to the physical laws of the electromagnetic field by obtaining electromagnetic characteristic parameters from the first output data and constructing the Maxwell equation residual term based on these electromagnetic characteristic parameters. By determining the first mean square error term and combining the first mean square error term and the Maxwell equation residual term into a first composite loss function, it is ensured that the RFQ-PINN sub-model conforms to both the measured data and the physical laws during training. This dual constraint mechanism significantly improves the model's physical consistency and prediction accuracy, providing a solid foundation for the construction of the BNCT digital twin model.
[0125] Figure 7 A flowchart of a second sub-model training method for a neutron beam analysis process provided in an embodiment of the present application may include the following steps:
[0126] Step S701: Perform data assimilation processing on the acquired multi-physics field simulation data to generate equivalent measured data that matches the physical characteristics of the historical measured data, and generate a data assimilation training set based on the historical measured data and the equivalent measured data; wherein the multi-physics field simulation data represents the simulation data of the beam shaping device in various physical processes.
[0127] Step S703: extracting second input data and second observation data from the data assimilation training set, where the second observation data corresponds to the second input data; wherein the second input data is used to characterize the operating conditions of the beam shaping device, and the second observation data is used to characterize the radiation characteristics.
[0128] Step S705 , generating second output data corresponding to the second input data through a preset second hard constraint condition; wherein the second hard constraint condition represents limiting the second output data to the non-negativity of the neutron flux and the zeroing of the flux outside the collimator.
[0129] Step S707, training the second sub-model through a second composite loss function including a second soft constraint, second output data, and second observation data until the second composite loss function satisfies a preset convergence condition, so as to obtain a second sub-model for characterizing the neutron beam analysis process; wherein the second soft constraint is used to characterize the consistency between the prediction results of the second sub-model and the neutron diffusion.
[0130] This embodiment performs data assimilation on the acquired multi-physics simulation data to generate equivalent measured data that matches historical measured data. A data assimilation training set is then constructed based on this data. This data assimilation training set combines historical measured data and equivalent measured data, enabling more accurate simulation of the behavior of the beam shaping device in various physical processes. Next, second input data and second observation data are extracted from the data assimilation training set to characterize the operating conditions and radiation characteristics of the beam shaping device, respectively. Using a preset second hard constraint, the generated second output data is constrained to meet the requirements of neutron flux non-negativity and zero flux outside the collimator, thereby ensuring the rationality of the physical constraints. Subsequently, a second sub-model is trained using a second composite loss function that includes a second soft constraint until the second composite loss function meets the preset convergence criteria, resulting in a second sub-model that accurately characterizes the neutron beam analysis process. This second soft constraint ensures consistency between the model's predictions and the neutron diffusion process, improving the accuracy and reliability of the simulation model.
[0131] Figure 8 The flowchart of the second sub-model obtained through training provided in the embodiment of the present application for characterizing the neutron beam analysis process may include the following steps:
[0132] Step S331: The proton beam intensity, moderator thickness, and target temperature in the data assimilation training set are used as second input data of the second sub-model, and second output data including predicted neutron flux and predicted energy spectrum entropy are generated through a preset second hard constraint condition; wherein the second hard constraint condition characterizes limiting the second output data to the non-negativity of the neutron flux and the zeroing of the flux outside the collimator.
[0133] Specifically, the second sub-model (BSA-PINN) is used to characterize the neutron beam analysis process and can predict the neutron flux and energy spectrum entropy based on the input proton beam intensity, moderator thickness and target temperature. The second hard constraint refers to directly forcing the output value to meet the physical constraint through the activation function, ensuring that the output value of the neutron flux output by the second sub-model is non-negative and returns to zero outside the collimator. Specifically, the second hard constraint includes the non-negativity constraint of the neutron flux and the geometric boundary constraint that the flux outside the collimator returns to zero. The non-negativity constraint of the neutron flux uses the ReLU activation function to force the output value of the neutron flux to be non-negative: , This is the original output of the second sub-model, and ReLU forces negative values to zero.
[0134] The geometric boundary constraint of the collimator's outer flux zeroing is calculated based on the input coordinates (x, y) and the radial distance , generate a binary mask mask(r): , where r0 is the radial distance inside the collimator. The region inside the collimator refers to the region where the radial distance r is less than a certain threshold r0. In this region, the neutron flux can be non-zero. The region outside the collimator refers to the region where the radial distance r is greater than the threshold r0. In this region, the neutron flux is usually forced to zero to simulate the shielding effect of the collimator. The final neutron flux output is obtained by multiplying the mask with the ReLU function output value one by one: , which ensures that the neutron flux outside the collimator automatically returns to zero without the need for indirect optimization through the loss function. It should be noted that in neutron transport, the neutron flux is a spatial distribution function that typically depends on the position coordinates (x,y). These coordinates are used to calculate the neutron flux at different locations. The radial distance r describes the distribution of the neutron flux at different radial positions and is used to define the region inside and outside the collimator.
[0135] Step S333: Acquire second observation data in the data assimilation training set, where the second observation data includes neutron flux, and the second observation data corresponds to the second input data.
[0136] Specifically, the second observation data in the data assimilation training set, especially the observed neutron flux, are obtained. These second observation data will serve as a benchmark for comparison with the second output data predicted by the model.
[0137] Step S335: Add the residual term of the steady-state diffusion equation to the loss function of the second sub-model to generate a second soft constraint condition, and construct a second composite loss function based on the second soft constraint condition, the second output data, and the second observation data.
[0138] Specifically, to ensure that the output of the second sub-model conforms not only to the data but also to the physical laws of neutron transport, the second composite loss function of the second sub-model incorporates a residual term from the steady-state diffusion equation. This term serves as a second soft constraint. The steady-state diffusion equation describes the behavior of neutron diffusion, and the residual term measures the difference between the prediction of the second composite loss function and the steady-state diffusion equation. This term ensures that the second composite loss function is optimized not only by training with data but also by the laws of physics.
[0139] The residual term of the steady-state diffusion equation is defined as: ;in, is the gradient operator, D is the neutron diffusion coefficient in the second output data, is the neutron flux in the second output data, ∑ a is the proportion of epithermal neutrons in the second output data, and S is the neutron yield in the second output data.
[0140] The second composite loss function , where ξ and τ are weight coefficients; is the second output data of the second sub-model; is the second observation data; is the mean square error between the second output data and the second observation data.
[0141] Step S337 : training the second sub-model until the second composite loss function satisfies a preset convergence condition, thereby obtaining a second sub-model for characterizing the neutron beam analysis process.
[0142] Specifically, a threshold of the second composite loss function is set during the training process. When the value of the second composite loss function is lower than the threshold, the training of the second sub-model is considered completed.
[0143] This embodiment ensures that the neutron flux is non-negative through the second hard constraint condition and is zeroed in the area outside the collimator, thereby ensuring that the output of the second sub-model conforms to the actual physical laws. Through the second soft constraint condition, the second sub-model can not only optimize the data fitting, but also ensure that its prediction results meet the physical constraints of the steady-state diffusion equation, avoiding the overfitting problem. In addition, the construction of the comprehensive second composite loss function further enhances the generalization ability and accuracy of the second sub-model. The second sub-model can gradually improve the prediction ability of neutron flux and energy spectrum entropy during the training process, while ensuring physical consistency, and ultimately obtain reliable and accurate prediction results.
[0144] Figure 9 A flowchart of a method for constructing a second composite loss function provided in an embodiment of the present application, which may include the following steps:
[0145] Step S3351, determine the second mean square error term between the second output data and the second observation data.
[0146] Specifically, the second mean square error term is used to measure the difference between the predicted second output data and the actually measured second observation data, and is used as part of the second composite loss function to optimize the second sub-model parameters and improve the prediction accuracy.
[0147] Step S3353: Acquire neutron transport parameters of the second output data, where the neutron transport parameters are used to characterize at least one of the neutron diffusion coefficient, the neutron absorption cross section, and the neutron yield, and construct a residual term of the steady-state diffusion equation based on the neutron transport parameters.
[0148] Specifically, neutron transport parameters are extracted from the output of the second sub-model. These neutron transport parameters include the neutron diffusion coefficient D, the neutron absorption cross section ∑ a and neutron yield S. The residual term of the steady-state diffusion equation is defined as: ;in, is the gradient operator, D is the neutron diffusion coefficient in the second output data, is the neutron flux in the second output data, ∑ a is the fraction of epithermal neutrons in the second output data, and S is the neutron yield in the second output data. The residual term of the steady-state diffusion equation is used to ensure that the predictions of the second sub-model not only conform to the actual observed data but also follow the laws of physics, thus avoiding overfitting.
[0149] Step S3355: Combine the second mean square error term and the residual term of the steady-state diffusion equation to obtain a second composite loss function.
[0150] Specifically, the second composite loss function , where ξ and τ are weight coefficients; is the second output data of the second sub-model; is the second observation data; is the mean squared error between the second output data and the second observation data. Through the weighted combination of these two loss terms, the second sub-model is able to optimize its output so that it can both accurately predict the data and follow the neutron propagation rules in physics.
[0151] This embodiment calculates a second mean squared error term to assess the discrepancy between the second sub-model's predicted output and the actual observed data, thereby improving the second sub-model's prediction accuracy and optimizing its goodness of fit. Next, based on the principle of neutron diffusion, a residual term for the steady-state diffusion equation is constructed to ensure that the second sub-model's output conforms to actual physical laws and improve physical consistency. Finally, by combining the second mean squared error term with the residual term of the steady-state diffusion equation, a second composite loss function is constructed. This allows the second sub-model to balance data fit and physical consistency during the optimization process, thereby improving the model's generalization ability, avoiding overfitting, and enhancing the second sub-model's prediction accuracy.
[0152] The application of BNCT digital twin systems requires real-time control and adjustment of system parameters. This requires the system to provide extremely high computational accuracy while completing data processing and decision-making within milliseconds. However, high-precision computational models often generate a large computational load, resulting in extended calculation times and making it difficult to meet the requirements of real-time control. Optimizing computational efficiency and ensuring real-time performance while maintaining accuracy remains a key challenge in this technology.
[0153] In order to solve the above technical problems, Figure 10 A flow chart of a dynamic optimization method provided in an embodiment of the present application is shown in FIG. Figure 10 As shown, the process includes the following steps:
[0154] Step S2: establishing a streaming data processing channel and performing time-domain synchronous acquisition of sensor group signals of the accelerator and beam shaping device to obtain sensor data.
[0155] The streaming data processing channel continuously collects and processes data from the sensor group, ensuring real-time and synchronous data, and providing high-quality data for subsequent data assimilation and model training. Specifically, the streaming data processing channel is established through the OPC-UA protocol framework to synchronously collect the sensor group signals from the RFQ accelerator and beam shaping device (BSA) in the time domain, with a sampling frequency of at least 1 MHz to ensure that high-frequency dynamic changes can be captured.
[0156] Step S4: Perform physical constraint filtering on the sensor data to obtain optimized multi-physical parameter estimation data.
[0157] Specifically, a sliding window mechanism is used to perform physical constraint filtering on sensor data, which is specifically implemented as follows: , where X raw is the sensor data of the unprocessed sensor group; For sensor data X raw The multi-physics parameter estimation data after physical constraint optimization, X is the multi-physics parameter assumption value to be optimized, the multi-physics parameter assumption value is {E, H, J, ω, ε, μ} of the accelerator and { , D, ∑a, S}, R physics is combined with Maxwell's equation R m and the steady-state diffusion equation R n The composite residual term constructed is , and is a weight parameter (which needs to be adjusted based on the coupling strength between the accelerator and the beam shaping device, as well as differences in data scale) used to ensure that the data conforms to physical laws. λ is an adaptive regularization coefficient used to balance data fidelity and physical consistency. By solving this optimization problem, noise suppression and enhanced physical consistency are achieved.
[0158] Step S6: The BNCT digital twin model constructed according to the construction method of steps S1 to S7 above is used to predict the optimized multi-physical parameter estimation data to obtain predicted data, and an incremental training set is constructed based on the optimized multi-physical parameter estimation data and the predicted data.
[0159] Specifically, a lightweight BNCT digital twin model is deployed on edge computing nodes to achieve millisecond-level beam current prediction for optimized multi-physics parameter estimation data, generating predicted data. The optimized multi-physics parameter estimation data and predicted data are combined to form an incremental training set. This incremental training set is a real-time extension of the data assimilation training set. By combining the latest multi-physics parameter estimation data and predicted data, data assimilation and dynamic optimization are achieved. This real-time update mechanism enables the BNCT digital twin model to promptly adapt to changes in the BNCT digital twin system state, improving the model's dynamic adaptability and prediction accuracy, and providing reliable technical support for the efficient operation of the BNCT digital twin system.
[0160] Step S8: When the sensor data meets the preset critical sample size, the BNCT digital twin model is dynamically optimized using the incremental training set to obtain the optimized BNCT digital twin model.
[0161] Specifically, a dual-buffer architecture is constructed, including two independent buffers for processing real-time data and incremental training data respectively. Through the real-time data cache with a time window of 5ms, abnormal data can be quickly detected and processed to ensure the real-time and accuracy of the data. Through the sliding window mechanism and physical constraint filtering, the impact of noise can be effectively reduced and the data quality can be improved. The long-term data storage area with a time window of 60s is used to store accumulated data for incremental training of the BNCT digital twin model. Among them, in the 5ms real-time data cache, temperature anomalies are detected in real time to ensure the accuracy and reliability of the data. When the sensor data accumulated in the real-time data cache reaches the critical sample size (60 seconds), online fine-tuning is triggered. A physically guided gradient descent algorithm is used, combined with the mean square error (MSE) and the expected value of the physical residual , dynamically adjust the BNCT digital twin model parameters.
[0162] The parameter update formula is as follows:
[0163]
[0164] in: is the updated model parameter vector at time step t+1, is the parameter vector of the model at time step t, which contains all the parameters that need to be trained in the model, such as the weights and biases of the neural network. η is the dynamic learning rate, which is automatically adjusted by the second-order optimizer. L MSE is the mean squared error loss, which measures the difference between the model predictions and the actual observations. is the expected value of the physical residual, which is used to ensure that the model satisfies the physical equations. Mean square error loss function L MSE The gradient vector of the model parameter θ indicates the direction in which the loss function changes fastest in the parameter space. To include Maxwell equations R m and the steady-state diffusion equation R n The statistical expectation value of is the gradient vector of the expected physical residual with respect to the parameter θ, κ is the physical residual weight, which is adaptively adjusted based on the confidence level of the real-time data, and β is the physical residual weight, which is adaptively adjusted based on the confidence level of the real-time data. When the sensor fault detection module is triggered, the β value is automatically increased to the preset maximum threshold.
[0165] The present embodiment provides a dynamic optimization method that can ensure the accuracy and consistency of real-time data by establishing a streaming data processing channel and synchronously collecting sensor signals from the accelerator and beam shaping device. A sliding window mechanism is used in combination with physical constraint filtering to effectively remove noise and improve the stability and accuracy of multi-physical parameter estimation data. Based on these optimized data, a BNCT digital twin model is constructed for prediction, and the model is continuously optimized through incremental training. The dynamic optimization process uses a gradient descent algorithm to enable the model to gradually converge as new data is added, thereby improving prediction accuracy and adaptability. Ultimately, efficient real-time data processing, accurate multi-physical parameter modeling and optimization are achieved, providing more stable and reliable prediction support for the BNCT array twin model.
[0166] Accordingly, please refer to Figure 11 A block diagram of a BNCT digital twin model construction device provided in an embodiment of the present application, the device comprising:
[0167] The data assimilation processing unit 101 is used to perform data assimilation processing on the acquired multi-physics field simulation data to generate equivalent measured data that matches the physical characteristics of the historical measured data, and to generate a data assimilation training set based on the historical measured data and the equivalent measured data; wherein the multi-physics field simulation data represents simulation data of the accelerator and beam shaping device in various physical processes;
[0168] A first sub-model training unit 103 is configured to train a first sub-model for characterizing accelerator physical processes based on a data assimilation training set;
[0169] A second sub-model training unit 105 is configured to train a second sub-model for characterizing a neutron beam analysis process based on a data assimilation training set;
[0170] The twin model construction unit 107 is used to construct a BNCT digital twin model based on the first sub-model and the second sub-model obtained through training.
[0171] In some optional implementations, the data assimilation processing unit 101 includes:
[0172] The multi-physics field simulation data is input into the physical law transfer network to obtain equivalent measured data that is aligned with the historical measured data in terms of timestamp; among them, the physical law transfer network adopts a conditional generative adversarial network architecture.
[0173] In some optional implementations, the physical law transfer network is trained in the following manner:
[0174] Obtain simulated data samples and measured data samples aligned in time stamps;
[0175] Input the simulation data samples into the generator of the physical law transmission network to generate simulated measured data;
[0176] The discriminator of the physical law transfer network compares the simulated measured data with the measured data samples to determine the true probability of the simulated measured data; wherein the true probability is used to measure the similarity between the simulated measured data and the measured data samples;
[0177] Based on the true probability, the parameters of the physical law transfer network are adjusted until the similarity between the simulated measured data generated based on the adjusted physical law transfer network and the measured data samples meets the preset conditions.
[0178] In some optional embodiments, the similarity between the simulated measured data and the measured data samples is characterized by a loss function of a physical law transfer network, where the loss function includes physical equation residuals, which are used to constrain the simulated measured data to conform to the physical characteristics of the measured data samples.
[0179] In some optional implementations, the first sub-model training unit 103 includes:
[0180] The radio frequency angular frequency and the proton initial energy in the data assimilation training set are used as first input data of the first sub-model, and first output data including predicted proton beam intensity is generated through a preset first hard constraint condition; wherein the first hard constraint condition represents limiting the first output data to a physical range of an actual proton beam intensity;
[0181] Acquire first observation data in a data assimilation training set, where the first observation data includes an observed proton beam intensity, and the first observation data corresponds to the first input data;
[0182] Adding a Maxwell equation residual term to the loss function of the first sub-model to generate a first soft constraint condition, and constructing a first composite loss function based on the first soft constraint condition, the first output data, and the first observation data;
[0183] The first sub-model is trained until the first composite loss function satisfies a preset convergence condition to obtain the first sub-model for characterizing the accelerator physical process.
[0184] In some optional implementations, the first composite loss function is constructed as follows:
[0185] determining a first mean square error term between the first output data and the first observation data;
[0186] Acquire electromagnetic characteristic parameters in the first output data, where the electromagnetic characteristic parameters are used to characterize at least one of electric field strength, magnetic field strength, magnetic permeability, dielectric constant, and proton beam current density, and construct a residual term of the Maxwell equation based on the electromagnetic characteristic parameters;
[0187] The first mean square error term and the Maxwell equation residual term are combined to obtain the first composite loss function.
[0188] In some optional implementations, the second sub-model training unit 105 includes:
[0189] The proton beam intensity, moderator thickness, and target temperature in the data assimilation training set are used as second input data of the second sub-model, and second output data including predicted neutron flux and predicted energy spectrum entropy are generated through a preset second hard constraint condition; wherein the second hard constraint condition restricts the second output data to the non-negativity of the neutron flux and the zeroing of the flux outside the collimator;
[0190] Acquire second observation data in the data assimilation training set, the second observation data including neutron flux, and the second observation data corresponding to the second input data;
[0191] Adding a residual term of the steady-state diffusion equation to the loss function of the second sub-model to generate a second soft constraint, and constructing a second composite loss function based on the second soft constraint, the second output data, and the second observation data;
[0192] The second sub-model is trained until the second composite loss function satisfies a preset convergence condition, thereby obtaining a second sub-model for characterizing the neutron beam analysis process.
[0193] In some optional implementations, the second composite loss function is constructed as follows:
[0194] determining a second mean square error term between the second output data and the second observation data;
[0195] obtaining a neutron transport parameter of the second output data, the neutron transport parameter being used to characterize at least one of a neutron diffusion coefficient, a neutron absorption cross section, and a neutron yield, and constructing a residual term of a steady-state diffusion equation based on the neutron transport parameter;
[0196] The second mean square error term is combined with the residual term of the steady-state diffusion equation to obtain the second composite loss function.
[0197] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0198] In this embodiment, a BNCT digital twin model construction device is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0199] See also Figure 12 , Figure 12 A schematic diagram of the structure of a computer device provided in an embodiment of the present application is shown in FIG. Figure 12As shown, the computer device includes: one or more processors 10, memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components utilize different buses to communicate with each other and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in the memory or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Equally, multiple computer devices can be connected, and each device provides part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 12 A processor 10 is taken as an example.
[0200] The processor 10 may be a central processing unit, a network processor, or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic, or any combination thereof.
[0201] The memory 20 stores instructions that can be executed by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0202] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and application programs required for at least one function; the data storage area may store data created based on the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0203] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid-state drive; the memory 20 may also include a combination of the above types of memory.
[0204] The computer device further includes a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0205] The embodiments of the present application also provide a computer-readable storage medium. The above-mentioned method according to the embodiment of the present application can be implemented in hardware, firmware, or implemented as a computer code that can be recorded in a storage medium, or implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and downloaded through a network and will be stored in a local storage medium, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor or hardware, the method shown in the above embodiment is implemented.
[0206] The systems, devices, modules, or units described in the above embodiments may be implemented by computer chips or entities, or by products having certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0207] For the convenience of description, the above devices are described as being divided into various units according to their functions. Of course, when implementing this application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0208] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods or apparatuses. Therefore, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0209] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices, and apparatus according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0210] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0211] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0212] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0213] The various embodiments in this specification are described in a progressive manner. Similar parts between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences from other embodiments. In particular, the device embodiments are generally similar to the method embodiments, so the description is relatively simple. For relevant parts, refer to the description of the method embodiments.
[0214] The foregoing is merely an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.
[0215] Although the embodiments of the present application have been described with reference to the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present application, and such modifications and variations shall fall within the scope defined by the appended claims.
Claims
1. A BNCT digital twin model construction method, characterized in that: The construction method comprises: Performing data assimilation processing on the acquired multi-physics simulation data to generate equivalent measured data that matches the physical characteristics of the historical measured data, and generating a data assimilation training set based on the historical measured data and the equivalent measured data; wherein the multi-physics simulation data represents simulation data of the accelerator and the beam shaping device in various physical processes; Based on the data assimilation training set, respectively training a first sub-model for characterizing an accelerator physics process and a second sub-model for characterizing a neutron beam analysis process; A BNCT digital twin model is constructed based on the first sub-model and the second sub-model obtained through training.
2. The construction method according to claim 1, characterized in that Perform data assimilation on the acquired multi-physics simulation data to generate equivalent measured data that matches the physical characteristics of the historical measured data, including: The multi-physics field simulation data is input into a physical law transfer network to obtain equivalent measured data that is aligned with the historical measured data in terms of timestamp; wherein the physical law transfer network adopts a conditional generative adversarial network architecture.
3. The construction method according to claim 2, characterized in that The physical law transfer network is trained in the following way: Obtain simulated data samples and measured data samples aligned in time stamps; Inputting the simulation data sample into the generator of the physical law transmission network to generate simulated measured data; Comparing the simulated measured data with the measured data sample through the discriminator of the physical law transfer network to determine the true probability of the simulated measured data; wherein the true probability is used to measure the similarity between the simulated measured data and the measured data sample; Based on the true probability, the parameters of the physical law transfer network are adjusted until the similarity between the simulated measured data generated based on the adjusted physical law transfer network and the measured data sample meets a preset condition.
4. The construction method according to claim 3, characterized in that The similarity between the simulated measured data and the measured data sample is characterized by the loss function of the physical law transfer network, and the loss function includes the physical equation residual, and the physical equation residual is used to constrain the simulated measured data to conform to the physical characteristics of the measured data sample.
5. The construction method according to claim 1, characterized in that The first sub-model trained to characterize the accelerator physics process includes: Using the radio frequency angular frequency and the proton initial energy in the data assimilation training set as first input data of the first sub-model, generating first output data including predicted proton beam intensity through a preset first hard constraint condition; wherein the first hard constraint condition represents limiting the first output data to a physical range of an actual proton beam intensity; Acquire first observation data in the data assimilation training set, where the first observation data includes observed proton beam intensity, and the first observation data corresponds to the first input data; Adding a Maxwell equation residual term to the loss function of the first sub-model to generate a first soft constraint condition, and constructing a first composite loss function based on the first soft constraint condition, the first output data, and the first observation data; The first sub-model is trained until the first composite loss function satisfies a preset convergence condition to obtain a first sub-model for characterizing the accelerator physical process.
6. The construction method according to claim 5, characterized in that: The first composite loss function is constructed as follows: determining a first mean square error term between the first output data and the first observation data; Acquiring electromagnetic characteristic parameters from the first output data, the electromagnetic characteristic parameters being used to characterize at least one of electric field strength, magnetic field strength, magnetic permeability, dielectric constant, and proton beam current density, and constructing the residual term of the Maxwell equation based on the electromagnetic characteristic parameters; The first mean square error term and the Maxwell equation residual term are combined to obtain the first composite loss function.
7. The construction method according to claim 1, characterized in that The second sub-model trained to characterize the neutron beam analysis process includes: The proton beam intensity, moderator thickness, and target temperature in the data assimilation training set are used as second input data of the second sub-model, and second output data including predicted neutron flux and predicted energy spectrum entropy are generated through a preset second hard constraint condition; wherein the second hard constraint condition represents limiting the second output data to non-negativity of the neutron flux and zeroing of the flux outside the collimator; Acquire second observation data in the data assimilation training set, where the second observation data includes neutron flux and corresponds to the second input data; Adding a residual term of the steady-state diffusion equation to the loss function of the second sub-model to generate a second soft constraint, and constructing a second composite loss function based on the second soft constraint, the second output data, and the second observation data; The second sub-model is trained until the second composite loss function satisfies a preset convergence condition, thereby obtaining a second sub-model for characterizing the neutron beam analysis process.
8. The construction method according to claim 7, characterized in that: The second composite loss function is constructed as follows: determining a second mean square error term between the second output data and the second observation data; Acquiring a neutron transport parameter of the second output data, the neutron transport parameter being used to characterize at least one of a neutron diffusion coefficient, a neutron absorption cross section, and a neutron yield, and constructing a residual term of a steady-state diffusion equation based on the neutron transport parameter; The second mean square error term and the steady-state diffusion equation residual term are combined to obtain the second composite loss function.
9. A dynamic optimization method, characterized in that: The dynamic optimization method comprises: Establish a streaming data processing channel and perform time-domain synchronous acquisition of sensor group signals from the accelerator and beam shaping device to obtain sensor data; Performing physical constraint filtering on the sensor data to obtain optimized multi-physical parameter estimation data; According to the BNCT digital twin model constructed by the construction method according to any one of claims 1 to 8, predicting the optimized multi-physical parameter estimation data to obtain predicted data, and constructing an incremental training set based on the optimized multi-physical parameter estimation data and the predicted data; When the sensor data meets a preset critical sample size, the BNCT digital twin model is dynamically optimized using the incremental training set to obtain an optimized BNCT digital twin model.
10. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the BNCT digital twin model construction method according to any one of claims 1 to 8 or the dynamic optimization method according to claim 9 by executing the computer instructions.
11. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, which are used to enable a computer to execute the BNCT digital twin model construction method described in any one of claims 1 to 8 or the dynamic optimization method described in claim 9.
Citation Information
Patent Citations
Rolling bearing modeling and model updating method and system based on digital twinning
CN113221280A
Method for enhancing digital twinborn model data of power system in low measurement environment
CN119203792A