A linear accelerator beam tuning method and related device
By processing the beam energy parameters of the linear accelerator through a preset auto-encoding model, the target beam tuning parameters are generated, and the magnetic induction intensity is automatically adjusted, which solves the problem of low beam tuning efficiency and achieves efficient and accurate beam tuning.
Patent Information
- Application Number
- CN202411076219.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-07
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2044-08-07
AI Technical Summary
Linac beam tuning efficiency is low and relies on the professional physics knowledge and experience of technicians, resulting in complex and inefficient operations.
The preset autoencoding model is used to decode the beam energy parameters, generate target beam tuning parameters, and adjust the magnetic induction intensity of the linear accelerator to achieve beam tuning. The autoencoding model is trained through a collection of training samples and is independent of the technician's physical knowledge and experience.
The efficiency of beam tuning is improved, the error rate of manual participation is reduced, and the beam tuning process of the linear accelerator is automated and accurate.
Smart Images

Figure CN118632428B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of control, and in particular to a linear accelerator beam tuning method and related devices. Background Art
[0002] A linear accelerator (linac) is a device that uses high-frequency electromagnetic waves to accelerate charged particles such as electrons to high energies through an accelerating tube.
[0003] The linear accelerator contains a large number of magnets. Multiple power supplies provide excitation current to the magnets to change the magnetic field strength in the magnets, thereby focusing and deflecting the beam composed of charged particles. For example, as many charged particles as possible are controlled to pass through the end of the track in the accelerator device to achieve beam tuning of the accelerator.
[0004] Since the tuning process requires the technicians to have professional physical knowledge and certain experience, the tuning efficiency is relatively low. Summary of the invention
[0005] The first aspect of the present application provides a linear accelerator beam tuning method, comprising:
[0006] Obtain the beam energy parameters of the linear accelerator;
[0007] Processing the beam energy parameters through a decoder of a preset autoencoder model to obtain target beam modulation parameters;
[0008] Adjusting the parameters of the linear accelerator according to the target beam tuning parameters to adjust the magnetic induction intensity in the linear accelerator and achieve beam tuning of the linear accelerator;
[0009] The preset autoencoder model is pre-trained according to the following process:
[0010] Obtaining a training sample set, the training sample set comprising a number of training sample pairs consisting of sample beam energy parameters and sample beam modulation parameters;
[0011] An initial autoencoder model is trained according to the training sample set to obtain a trained preset autoencoder model, wherein the preset autoencoder model is determined based on the loss value of the preset autoencoder model and the initial loss value, and the initial loss value is the loss value when the initial autoencoder model is trained for the first time.
[0012] In a possible implementation, the step of processing the beam energy parameter by using a preset autoencoder model to obtain a target beam modulation parameter includes:
[0013] Normalizing the beam energy parameters to obtain beam energy parameters that meet the input requirements of a preset autoencoder model;
[0014] The beam energy parameter is decoded by a decoder in the preset autoencoder model to obtain a target beam modulation parameter.
[0015] In a possible implementation, adjusting the parameters of the linear accelerator according to the target beam adjustment parameters includes:
[0016] generating a control instruction according to the target beam adjustment parameter;
[0017] The control instruction is sent to a power supply control device of the linear accelerator to control the power supply to output a current matching the target beam modulation parameter.
[0018] In a possible implementation, training the initial autoencoder model according to the training sample set to obtain a preset autoencoder model includes:
[0019] Inputting the sample beam energy parameters and sample beam modulation parameters in the training sample set into the initial autoencoder model to obtain the predicted initial beam modulation parameters;
[0020] Determining an initial loss value of the initial autoencoder model based at least on the predicted initial beam tuning parameter and the sample beam tuning parameter;
[0021] Adjust the initial autoencoder model based on the initial loss value to obtain an adjusted autoencoder model;
[0022] Inputting the sample beam energy parameters and the sample beam modulation parameters in the training sample set into the adjusted autoencoder model to obtain predicted beam modulation parameters;
[0023] determining a loss value of the adjusted autoencoder model based at least on the predicted beam modulation parameter and the sample beam modulation parameter;
[0024] Based on the loss value satisfying the training continuation condition, the adjusted autoencoder model is adjusted according to the loss value to obtain a new adjusted autoencoder model, and the step of inputting the sample beam energy parameters and the sample beam modulation parameters in the training sample set into the adjusted autoencoder model to obtain predicted beam modulation parameters is returned to execute, until the loss value of the adjusted autoencoder model does not satisfy the training continuation condition, and a preset autoencoder model is obtained, and the training continuation condition is determined based on the initial loss value.
[0025] In a possible implementation, obtaining a training sample set includes:
[0026] Obtaining an original data set, wherein the original data set includes a plurality of beam energy values and corresponding beam modulation parameters;
[0027] Based on the preset beam modulation range of the linear accelerator, each beam energy value is normalized to obtain a corresponding sample beam energy parameter;
[0028] Based on the controllable setting range of the magnetic field of the linear accelerator, each beam modulation parameter is normalized to obtain a corresponding sample beam modulation parameter;
[0029] Sample pairs are formed based on sample beam energy parameters and corresponding sample beam modulation parameters to obtain a training sample set.
[0030] In a possible implementation, before training the initial autoencoder model according to the training sample set to obtain a trained preset autoencoder model, the method further includes:
[0031] Analyze each training sample pair in the training sample set to determine the number of parameters in the sample beam tuning parameters;
[0032] Based on the number of parameters in the sample beam tuning parameters, the number of network layers and the number of neurons in the input layer in the initial autoencoder model are determined.
[0033] A second aspect of the present application provides a linear accelerator beam tuning device, comprising:
[0034] An acquisition module, used to obtain beam energy parameters of a linear accelerator;
[0035] A processing module, used for processing the beam energy parameter through a decoder of a preset autoencoder model to obtain a target beam modulation parameter;
[0036] An adjustment module, used for adjusting the parameters of the linear accelerator according to the target beam adjustment parameters, so as to adjust the magnetic induction intensity in the linear accelerator and realize beam current tuning of the linear accelerator;
[0037] A training module is used to pre-train a preset autoencoder model;
[0038] Wherein, the training module includes:
[0039] An obtaining unit, used for obtaining a training sample set, wherein the training sample set includes a training sample pair consisting of a number of sample beam energy parameters and sample beam modulation parameters;
[0040] A training unit is used to train an initial autoencoder model based on the training sample set to obtain a trained preset autoencoder model, wherein the preset autoencoder model is determined based on a loss value of the preset autoencoder model and an initial loss value, and the initial loss value is the loss value when the initial autoencoder model is trained for the first time.
[0041] A third aspect of the present application provides a computer program product, comprising computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements the linear accelerator beam tuning method of the first aspect or any implementation of the first aspect.
[0042] A fourth aspect of the present application provides an electronic device, comprising at least one processor and a memory connected to the processor, wherein:
[0043] The memory is used to store computer programs;
[0044] The processor is used to execute the computer program so that the electronic device can implement the linear accelerator beam tuning method of the first aspect or any implementation manner of the first aspect.
[0045] A fifth aspect of the present application provides a computer storage medium, which carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement the linear accelerator beam tuning method of the above-mentioned first aspect or any implementation of the first aspect.
[0046] Beneficial effect: In a linear accelerator beam tuning method and related devices provided by the present application, beam energy parameters of the linear accelerator are obtained; the beam energy parameters are processed by a preset autoencoder model to obtain target beam tuning parameters; the parameters of the linear accelerator are adjusted according to the target beam tuning parameters to adjust the magnetic induction intensity in the linear accelerator to achieve beam tuning of the linear accelerator, wherein the preset autoencoder model is obtained by training an initial autoencoder model according to a training sample set, the training sample set includes a number of training sample pairs consisting of sample beam energy parameters and sample beam tuning parameters, and the initial loss value is the loss value of the first training of the initial autoencoder model; in this scheme, the target beam tuning parameters are determined according to the beam energy parameters through the pre-trained preset autoencoder model, and the parameters of the linear accelerator can be adjusted based on the target beam tuning parameters to achieve the purpose of beam tuning, which is not limited to the physical knowledge and experience of the technicians and improves the beam tuning efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0048] Figure 1 It is a flow chart of a linear accelerator beam tuning method provided in an embodiment of the present application;
[0049] Figure 2It is a flow chart of obtaining target beam modulation parameters by processing the beam energy parameters through a preset autoencoder model provided in an embodiment of the present application;
[0050] Figure 3 is a schematic diagram of a flow chart of adjusting the parameters of the linear accelerator according to the target beam adjustment parameters provided in an embodiment of the present application;
[0051] Figure 4 It is a flowchart of training a preset autoencoder model provided in an embodiment of the present application;
[0052] Figure 5 Schematic diagram of the neural network structure of the autoencoder model provided in the embodiment of the present application;
[0053] Figure 6 It is a flowchart of training an initial autoencoder model according to the training sample set to obtain a preset autoencoder model provided by an embodiment of the present application;
[0054] Figure 7 is a schematic diagram of a process for obtaining a training sample set provided in an embodiment of the present application;
[0055] Figure 8 It is a schematic diagram of a process for determining an initial autoencoder model structure based on training sample pairs provided in an embodiment of the present application;
[0056] Fig. 9 It is a flowchart of selecting a preset autoencoder model during training provided by an embodiment of the present application;
[0057] Fig.10 It is a structural schematic diagram of a linear accelerator beam tuning device provided in an embodiment of the present application;
[0058] Fig.11 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0059] The following describes the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation method section of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application.
[0060] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0061] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0062] Figure 1 It is a flow chart of a linear accelerator beam tuning method provided in an embodiment of the present application, which may include steps S101 to S103. These steps are described in detail below.
[0063] S101, obtaining beam energy parameters of a linear accelerator;
[0064] Among them, particles with different energies have corresponding optimal beam confinement magnetic fields that are different.
[0065] As an example, when a 20Mev (million electron volt) particle is confined by four magnets, the optimal magnetic induction intensity is [2000, -2100, 1400, -1300 ], then the optimal magnetic induction intensity corresponding to 21Mev may be [2010, -2109, 1411, -1312], and the optimal magnetic induction intensity corresponding to 30Mev may be [3000, -2600, 2200, -2056].
[0066] Wherein, the beam current of the linear accelerator is tuned based on the particle energy used in the linear accelerator.
[0067] The beam energy parameter in the linear accelerator represents the particle energy used by the linear accelerator, so that the beam modulation parameter is determined based on the particle energy of the linear accelerator.
[0068] In a possible implementation, the linear accelerator beam tuning method in the present application is applied to an electronic device in the linear accelerator control system.
[0069] Among them, the control system of the linear accelerator can adopt the EPICS (Experimental Physics and Industrial Control System) framework, which is a distributed system. All control devices and detection devices on the linear accelerator are bound to the system through PV (Process variable) objects, and the EPICS framework can realize device communication within the system.
[0070] The straight beam energy parameter is obtained by detecting the linear accelerator detection device through the EPICS framework and sent to the device executing the linear accelerator beam tuning method in the present application, and the final target tuning parameter is sent to the control device.
[0071] S102, processing the beam energy parameter through a decoder of a preset autoencoder model to obtain a target beam modulation parameter;
[0072] The preset autoencoder model is a neural network model, and the preset autoencoder model can output target beam modulation parameters according to input beam energy parameters.
[0073] The preset autoencoder model is pre-trained according to the following process: obtaining a training sample set, the training sample set including a training sample pair consisting of a number of sample beam energy parameters and sample beam modulation parameters; training an initial autoencoder model according to the training sample set to obtain a trained preset autoencoder model, the preset autoencoder model is determined based on a loss value of the preset autoencoder model and an initial loss value, the initial loss value is the loss value when the initial autoencoder model is first trained, and subsequently Figure 4 The process of training a preset autoencoder model that has been trained is described in detail.
[0074] The target beam adjustment parameter may be a current value of an excitation power supply or a magnetic induction intensity value of a magnet.
[0075] The target beam adjustment parameter is a parameter determined by the preset autoencoder model for the beam energy parameter, and can adjust the beam of the linear accelerator to an optimal effect.
[0076] In a possible implementation, the output of the preset autoencoder model can be selected according to actual conditions, and can be the current value of the excitation power supply or the magnetic induction intensity value of the magnet.
[0077] Among them, the autoencoder model can be trained according to actual conditions to determine whether the type of the output target beam tuning parameter is the current value of the excitation power supply or the magnetic induction intensity value of the magnet.
[0078] In a possible implementation, the preset autoencoder model includes an encoder and a decoder. The preset autoencoder model processes the beam energy parameters to obtain the target beam modulation parameters, which is processed by the decoder. Figure 2 Detailed description is given in .
[0079] In one possible implementation, the autoencoder model can be trained in advance based on the training samples, and the training process is then Figure 4 Detailed description in.
[0080] S103, adjusting the parameters of the linear accelerator according to the target beam tuning parameters to adjust the magnetic induction intensity in the linear accelerator to achieve beam tuning of the linear accelerator.
[0081] The parameters of the linear accelerator are adjusted according to the target beam modulation parameters obtained by the preset autoencoder model.
[0082] When the target beam adjustment parameter is a current value of an excitation power supply, the current of the excitation power supply of the linear accelerator can be adjusted according to the current value.
[0083] When the target beam adjustment parameter is the magnetic flux density value of the magnet, the magnetic flux density value of each magnet in the linear accelerator can be adjusted according to the magnetic flux density value.
[0084] Among them, by adjusting the parameters in the linear accelerator, the magnetic induction intensity therein is adjusted, and then the focusing, deflection, etc. of the beam composed of charged particles in the linear accelerator are adjusted, so that as many charged particles as possible pass through the end of the track in the accelerator device to achieve beam tuning of the accelerator.
[0085] Among them, for different adjustments of beam focusing and deflection, the autoencoder model can be trained in advance for different adjustment purposes to obtain a preset autoencoder model with corresponding parameter determination capabilities, thereby achieving rapid tuning of the linear accelerator.
[0086] In a possible implementation, the target beam adjustment parameter is the current value of the excitation power supply in the linear accelerator. The current value of the excitation current can be adjusted. Figure 3 The adjustment process is described in detail in .
[0087] In this embodiment, the beam energy parameters of the linear accelerator are obtained; the beam energy parameters are processed by a preset autoencoder model to obtain target beam tuning parameters; the parameters of the linear accelerator are adjusted according to the target beam tuning parameters to adjust the magnetic induction intensity in the linear accelerator to achieve beam tuning of the linear accelerator, wherein the preset autoencoder model is obtained by training an initial autoencoder model according to a training sample set, the training sample set includes a number of training sample pairs consisting of sample beam energy parameters and sample beam tuning parameters, and the initial loss value is the loss value of the first training of the initial autoencoder model. The target beam tuning parameters can be determined according to the beam energy parameters by using the preset autoencoder model that has been trained in advance, and the parameters of the linear accelerator can be adjusted based on the target beam tuning parameters to achieve the purpose of beam tuning, which is not limited to the physical knowledge and experience of the technicians and improves the beam tuning efficiency.
[0088] Figure 2 The embodiment of the present application provides a flowchart of obtaining target beam modulation parameters by processing the beam energy parameter through a decoder of a preset autoencoder model, which may include steps S201 to S202. These steps are described in detail below.
[0089] S201, normalizing the beam energy parameter to obtain a beam energy parameter that meets the input requirements of a preset autoencoder model;
[0090] The numerical fluctuation range of the beam energy parameter may be very large. A beam energy parameter with a large difference will affect the accuracy of the autoencoder model. Therefore, the obtained beam energy parameter is normalized so that the beam energy parameter input into the preset autoencoder model can meet its input requirements.
[0091] The input requirement may be an energy value between 0-1 Mev.
[0092] As an example, the energy range of the obtained beam energy parameter is mainly 30-60 Mev. The normalization method can divide the energy value of the beam energy parameter by 100 to obtain an energy value between 0-1 Mev.
[0093] S202: Decode the beam energy parameter by using a decoder in the preset autoencoder model to obtain a target beam modulation parameter.
[0094] Among them, the preset autoencoding model includes two parts: an encoder and a decoder.
[0095] In the process of processing the beam energy parameters to obtain the target beam modulation parameters, only the decoder in the preset autoencoder model is used.
[0096] The target adjustment parameter corresponds to the beam energy parameter, and can adjust the beam of the linear accelerator to achieve the target effect.
[0097] In a possible implementation, the initial autoencoder model may be pre-trained to obtain a trained preset autoencoder model. When processing the beam energy parameters according to the preset autoencoder model, only the decoder part is used to decode the beam energy parameters through the decoder to obtain corresponding target beam modulation parameters.
[0098] After the autoencoder model is trained, the input and output will become closer and closer. If the encoder part is removed and only a random number vector and energy parameter are input to the front end of the decoder, the decoder can output a set of vectors. The generated vectors have the same distribution as the data when the autoencoder model was trained.
[0099] The encoder is responsible for encoding its input vector to achieve compression, and the decoder is responsible for decoding and restoring its input data.
[0100] Among them, the process of the preset autoencoder model processing the beam energy parameters to obtain the target beam modulation parameters only requires the decoder to execute the process. The neural network in the model is forward propagated and the processing process is fast.
[0101] In this embodiment, the beam energy parameters are first normalized to obtain beam energy parameters that meet the input requirements of a preset autoencoder model; the beam energy parameters are decoded by a decoder in the preset autoencoder model to obtain target beam tuning parameters, thereby processing the beam energy parameters by the autoencoder model to obtain the target beam tuning parameters. No human intervention is required in this process, which reduces the error rate of manual adjustment and improves the efficiency of beam tuning.
[0102] Figure 3 It is a schematic diagram of a flow chart of adjusting the parameters of the linear accelerator according to the target beam adjustment parameters provided in an embodiment of the present application, which may include steps S301 to S302, and these steps are described in detail below.
[0103] S301, generating a control instruction according to the target beam adjustment parameter;
[0104] After the target beam adjustment parameters are obtained, corresponding control instructions may be generated according to the target beam adjustment parameters.
[0105] The DC accelerator adjusts the electromagnetic intensity of the magnetic field by adjusting the current value of the excitation power supply, and the control instruction is an instruction for controlling the current of the excitation power supply.
[0106] S302: Send the control instruction to a power supply control device of the linear accelerator to control the power supply to output a current that matches the target beam modulation parameter.
[0107] The current control of the power supply of the linear accelerator is performed by a power supply control device, and the control instruction is sent to the power supply control device so that the power supply control device controls the current output by the power supply to match the target beam modulation parameter.
[0108] The power supply control device controls and adjusts the power supply output current, and the adjusted current changes the magnetic field strength of the magnet, so that the beam in the linear accelerator can be better focused, thereby achieving beam tuning.
[0109] In this embodiment, a control instruction is generated according to the target beam tuning parameters; the control instruction is sent to the power supply control device of the linear accelerator to control the power supply to output a current that matches the target beam tuning parameters, thereby realizing a process of automatically tuning the beam current of the linear accelerator according to the target beam tuning parameters.
[0110] Figure 4 It is a flowchart of training a preset autoencoder model provided in an embodiment of the present application, which may include steps S401 to S402. These steps are described in detail below.
[0111] S401, obtaining a training sample set, where the training sample set includes a training sample pair consisting of a number of sample beam energy parameters and sample beam modulation parameters;
[0112] The training sample set includes a number of training sample pairs, and each training sample pair includes a sample beam energy parameter and a sample beam modulation parameter.
[0113] The purpose of training is to enable the trained autoencoder model to process each set of input beam energy parameters to obtain target beam tuning parameters that can optimize the beam of the linear accelerator. Therefore, each training sample in the training sample set can achieve the effect of optimizing the beam of the linear accelerator.
[0114] In a possible implementation, the obtained beam energy parameters and corresponding beam tuning parameters may be screened, and beam energy parameters and corresponding beam tuning parameters that can achieve expected tuning effects may be selected as training sample pairs.
[0115] The training sample set may be selected based on demand to use the magnetic field strength parameter or the current strength parameter of the magnet power supply as the sample beam adjustment parameter.
[0116] When training the autoencoder model, the same type of sample beam modulation parameters are used, for example, only magnetic field intensity parameters are used as sample beam modulation parameters, or only current intensity parameters are used as sample beam modulation parameters.
[0117] In a possible implementation, the original data can be normalized to obtain a training sample set, and then Figure 8 The process of obtaining the training sample set is described in detail.
[0118] In a possible implementation, the beam energy value in the original data is converted to a value between 0 and 1; and the current intensity is normalized according to the maximum controllable range of the magnetic field intensity in the linear accelerator to ensure that the current intensity is between 0 and 1.
[0119] S402, training an autoencoder model according to the training sample set to obtain a trained preset autoencoder model, wherein the preset autoencoder model is determined based on a loss value of the preset autoencoder model and an initial loss value, wherein the initial loss value is a loss value when the initial autoencoder model is first trained.
[0120] The initial autoencoder model is trained according to the training samples in the training sample set, and after multiple iterations and updates, a trained preset autoencoder model is obtained.
[0121] During the training process, the autoencoder model is trained as a whole, specifically the encoder and decoder therein are trained.
[0122] The autoencoder model includes an encoder and a decoder. The encoder in the autoencoder model is responsible for encoding the input vector (training sample) to achieve compression, and the decoder is responsible for decoding and restoring the input data (data output by the encoder). An important loss value of the autoencoder model is the "reconstruction loss value", which is to compare the output vector with the input vector to measure the difference between them. After the autoencoder model is trained, the input and output will become closer and closer.
[0123] Since in the existing autoencoder model, the input random number vector and the random number vector output by the encoder learned when training the autoencoder model are not identically distributed, in this embodiment, the variance and mean are introduced at the encoder output in the autoencoder module, and they are compared with the normal distribution and optimized as a loss, so that the random vector output by the encoder learned by the autoencoder model satisfies the normal distribution.
[0124] Among them, the autoencoder model is a kind of neural network, and neural networks are prone to overfitting problems during the training process. Simply pursuing the lowest loss value will lead to reduced model performance. Therefore, in order to prevent the problem of overfitting, the performance of the autoencoder model trained this time can be determined based on the difference between the loss value of the autoencoder model during training and the loss value during the first training. Whether it is optimal.
[0125] Among them, the loss function of the autoencoder model is composed of the sum of three parts, and the loss function can be expressed by the following formula:
[0126] all_loss= recon_loss + kl_divergence + class_loss (1)
[0127] Among them, recon_loss is the reconstruction loss function, class_loss is the energy loss function, and kl_divergence is the KL divergence (Kullback–Leibler divergence, maximum inter-class divergence) loss about the sampling mean and variance.
[0128] Among them, the recon_loss is the difference between the training sample input to the autoencoder model and the output of the autoencoder model, which is used to measure the ability of the model to restore the input sample.
[0129] The class_loss is the difference between the energy label of the training sample and the energy label output by the autoencoder model, which is used to distinguish outputs of different energies.
[0130] Among them, the kl_divergence measures the difference between the distribution of random numbers generated by the encoder in the autoencoder model and the normal distribution random numbers, and is used to make the random numbers generated by the encoder conform to the specified distribution.
[0131] Among them, the reconstruction loss and energy loss are both calculated by the mean square error function.
[0132] As an example, during the training process, when the loss value of a certain autoencoder model is between 1 / 20 and 1 / 100 of the initial loss value, the autoencoder model is selected as the preset autoencoder model for training completion.
[0133] In one possible implementation, the structure of the initial autoencoder model can be determined based on the information contained in the training sample pair. Figure 8 Detailed description is given in .
[0134] Figure 5It is a schematic diagram of the neural network structure of the autoencoding model provided in an embodiment of the present application, and the autoencoding model includes an encoder 501 and a decoder 502, wherein the encoder is a neural network including five layers of nodes, and the five layers of the encoder respectively include nodes of [5, 64, 32, 16, 1], and the decoder is a neural network including four layers of nodes, and the nodes of the decoder are [17, 64, 16, 4] respectively. Among them, the penultimate layer 5011 of the encoder derives a mean vector and a variance vector for sampling random numbers and calculating loss values. Information is transmitted between nodes of each layer in the autoencoding model in a fully connected manner. The mean vector and variance vector derived from the penultimate layer 5011 of the encoder are then connected to the penultimate layer 5012, and the output of this layer is specifically calculated using the sigmoid function. In this schematic diagram, 4 groups of power supplies are used as an example for explanation.
[0135] In this embodiment, a training sample set is obtained, and the training sample set includes training sample pairs consisting of a number of sample beam energy parameters and sample beam modulation parameters; the initial autoencoder model is trained according to the training sample set to obtain a trained preset autoencoder model, and the preset autoencoder model is determined based on the loss value and the initial loss value of the preset autoencoder model, and the initial loss value is the loss value when the initial autoencoder model is trained for the first time. The initial autoencoder model can be trained by the training sample pairs consisting of the sample beam energy parameters and the sample beam modulation parameters to obtain the trained preset autoencoder model, and the training process is easy to implement.
[0136] Figure 6 It is a flowchart of training an initial autoencoder model according to the training sample set to obtain a trained preset autoencoder model provided by an embodiment of the present application, which may include steps S601 to S606, and these steps are described in detail below.
[0137] S601, inputting sample beam energy parameters and sample beam modulation parameters in the training sample set into an initial autoencoder model to obtain predicted initial beam modulation parameters;
[0138] The autoencoder model adopts a conditional variational autoencoder (cVAE), which includes an encoder and a decoder. The encoder encodes the input sample beam modulation parameters and outputs the encoding result; the decoder input includes the encoding result output by the encoder and the sample beam energy parameter corresponding to the sample beam modulation parameter as an external condition, so as to realize the decoding of the decoder under given conditions.
[0139] Moreover, during the training process, the sample beam energy parameter is combined with the encoding result as an external variable to increase the data dimension input to the decoder. Specifically, the sample beam energy parameter is packaged together with the encoding result and input into the decoder.
[0140] The sample beam energy parameters and the sample beam modulation parameters are input into the initial autoencoder model, and the initial autoencoder model outputs the predicted initial beam modulation parameters.
[0141] Among them, the preset autoencoder model adopts a conditional variational autoencoder model. During the processing of input information by the preset autoencoder model, the random numbers in the encoding results output by the encoder should conform to the normal distribution law. The process of training the autoencoder model is to train the random numbers output by the encoding results of the encoder to conform to the normal distribution.
[0142] The random number output by the encoder is 16-dimensional, which serves as the input of the subsequent decoder.
[0143] The input of the decoder includes sample beam energy parameters and a 16-dimensional random function. The output of the decoder is the beam modulation parameter at a given energy. In the trained autoencoder model, the beam modulation parameter corresponds to the optimal magnetic induction intensity value / optimal excitation current of the device.
[0144] In order to ensure that the encoding result of the encoder conforms to the normal distribution, the variance and mean are derived from the encoder, compared with the normal distribution, and the difference is used as a loss, such as kl_divergence, as a basis for adjusting the parameters of the autoencoder model and determining the preset autoencoder model.
[0145] S602, determining an initial loss value of the initial autoencoder model based at least on the predicted initial beam tuning parameter and the sample beam tuning parameter;
[0146] Among them, for the first training, the initial loss value of the autoencoder model is determined.
[0147] The loss value can be composed of a reconstruction loss function, an energy loss function, and a KL divergence loss. The calculation method can refer to the aforementioned formula (1), which will not be described here.
[0148] S603, adjusting the initial autoencoder model based on the initial loss value to obtain an adjusted autoencoder model;
[0149] Among them, the training process of the autoencoder model is to adjust the parameters of the model based on its corresponding loss value to obtain the adjusted autoencoder model.
[0150] Among them, the adjustment process can be set according to actual conditions and is not limited in this application.
[0151] S604, inputting the sample beam energy parameters and sample beam modulation parameters in the training sample set into the adjusted autoencoder model to obtain predicted beam modulation parameters;
[0152] The adjusted autoencoder model is trained based on the training sample pairs in the training sample set.
[0153] The sample beam modulation parameter is input into the encoder in the adjusted autoencoder model, the encoding result of the encoder and the sample beam energy parameter are input into the decoder in the adjusted autoencoder model, and the corresponding predicted beam modulation parameter is output.
[0154] S605, determining a loss value of the adjusted autoencoder model based at least on the predicted beam modulation parameter and the sample beam modulation parameter;
[0155] Wherein, each time the autoencoder model is adjusted after an iterative training, the loss value of the adjusted autoencoder model is determined, and then whether to continue the training process is determined based on the loss value.
[0156] The loss value can be composed of a reconstruction loss function, an energy loss function, and a KL divergence loss. The calculation method can refer to the aforementioned formula (1), which will not be described here.
[0157] S606, based on the loss value satisfying the training continuation condition, adjusting the adjusted autoencoder model according to the loss value to obtain a new adjusted autoencoder model, returning to execute the step of inputting the sample beam energy parameters and the sample beam modulation parameters in the training sample set into the adjusted autoencoder model to obtain predicted beam modulation parameters, until the loss value of the adjusted autoencoder model does not satisfy the training continuation condition, and obtaining a preset autoencoder model, the training continuation condition being determined based on the initial loss value.
[0158] The training continuation condition may be that the loss value belongs to a loss threshold range determined based on the initial loss value.
[0159] As an example, the condition for continuing training is that the loss value is greater than 1 / 20 or less than 1 / 100 of the initial loss value.
[0160] Among them, each time an adjusted autoencoder model is obtained, it is determined whether the loss value of the autoencoder model meets the training continuation condition. If it meets the condition, the adjusted autoencoder model is adjusted according to the loss value to obtain a new adjusted autoencoder model, and then training is continued based on the new adjusted autoencoder model, and the iterative cycle is repeated.
[0161] Among them, when the loss value of a certain adjusted autoencoder model does not meet the training continuation condition, the training process is stopped, the training process of the autoencoder model is completed, and the adjusted autoencoder model is used as the preset autoencoder model.
[0162] Among them, this embodiment is to illustrate the process of iterative training of the autoencoder model. The end of the iterative training process is determined based on whether the difference between the loss value of the autoencoder model trained in a certain step and the initial loss value meets the preset conditions.
[0163] Correspondingly, after executing step S602, a loss threshold range can be determined based on the initial loss value. Each time the loss value is determined according to the adjusted autoencoder model, the loss value is compared with the loss threshold range. If the loss value does not fall within the loss threshold range and does not meet the conditions for continuing training, the training is stopped. If the loss value falls within the loss threshold range and meets the conditions for continuing training, the next iterative training process continues.
[0164] In a possible implementation, during the training of the autoencoder model, in order to prevent overfitting, multiple autoencoder models obtained during the training process are recorded, and a preferred autoencoder model is selected as a preset autoencoder model for training. Fig.10 The process of selecting a preset autoencoder model is described in detail in .
[0165] In this embodiment, an initial autoencoder model is first input based on a training sample set to obtain an initial loss value of the initial autoencoder model, a training continuation condition is determined based on the initial loss value, and then the autoencoder model is adjusted based on the loss value of the autoencoder model to obtain an adjusted autoencoder model. The adjusted autoencoder model is input based on a training sample set to determine the loss value of the adjusted autoencoder model. Based on the loss value satisfying the training continuation condition, iterative training is continued. If the loss value does not satisfy the training continuation condition, the adjusted autoencoder model is determined to be a preset autoencoder model that has completed training, and the training is terminated. In this process, the lowest loss value is not simply pursued, but based on the difference between the loss value of the autoencoder model trained this time and the initial loss value, it is determined whether the performance of the autoencoder model trained this time is optimal, thereby preventing overfitting problems and improving training efficiency.
[0166] Figure 7 It is a flowchart of obtaining a training sample set provided in an embodiment of the present application, which may include steps S701 to S704. These steps are described in detail below.
[0167] S701, obtaining an original data set, where the original data set includes a number of beam energy values and corresponding beam modulation parameters;
[0168] The original data set may be obtained from the historical beam tuning information, wherein the original data set includes the beam energy values and corresponding beam tuning parameters of the historical manual beam tuning of the DC accelerator.
[0169] In the historical manual beam adjustment process, there are cases where the beam adjustment is successful and cases where the beam adjustment fails. The beam adjustment results can be recorded in the historical beam adjustment information.
[0170] As an example, the historical beam adjustment information includes the current intensity of the magnet power supply, the beam energy value, and the beam adjustment result.
[0171] The data format of the historical beam modulation information may be: [energy, B1, B2, ..., Bn, result].
[0172] Here, result represents the result of the beam adjustment. A result of 1 indicates that the result of the beam adjustment is in line with expectations, indicating that the beam adjustment is successful; a result of 0 indicates that the result of the beam adjustment is lower than expectations, indicating that the beam adjustment fails.
[0173] Wherein, energy represents the beam energy value, and B1, B2, ..., Bn represent the current intensity of each power supply in the n power supply groups.
[0174] The historical beam adjustment information is screened, and the portion of the beam adjustment result that meets the expected tuning effect is retained to obtain the original data that can be used as a training sample.
[0175] The data format of the original data may be: [energy, B1, B2, …, Bn].
[0176] The original data set only includes historical beam adjustment information of successful beam adjustment.
[0177] It should be noted that the original data set required for the training can be simulated beam modulation data or real beam modulation data. As long as the amount of data is sufficient, the trained preset autoencoder model can give reliable beam modulation parameters.
[0178] S702, based on the preset beam modulation range of the linear accelerator, normalize each beam energy value to obtain a corresponding sample beam energy parameter;
[0179] The numerical fluctuation range of the beam energy parameter may be very large, and the obtained beam energy parameter is normalized so that the beam energy parameter in the obtained training sample can meet the input requirement of its autoencoder model.
[0180] The preset beam adjustment range may be an energy value between 0 and 1 MeV.
[0181] Among them, the original data can be normalized so that its beam modulation information and the current intensity of each power supply meet the input conditions of the self-encoding model. Moreover, the data features in each dimension of the normalized original information are uniform, which can accelerate the convergence of the model.
[0182] S703, based on the controllable setting range of the magnetic field of the linear accelerator, normalize each beam modulation parameter to obtain a corresponding sample beam modulation parameter;
[0183] The controllable setting range of the magnetic field of the linear accelerator is a range not greater than the maximum value of the magnetic induction intensity of the linear accelerator.
[0184] Since the magnetic induction intensity of a magnet is related to the magnitude of the excitation current of the power supply, the material surrounding the magnet, heat dissipation, etc., it cannot be infinite. The design of magnetic induction intensity in engineering is within a certain range. It is related to the energy of the particles, the type of magnet, and the designer's requirements for beam quality. Therefore, there is a maximum magnetic induction intensity Bmax.
[0185] In a possible implementation, when the beam adjustment parameter is the magnetic induction intensity, the magnetic induction intensity is divided by the aforementioned maximum magnetic induction intensity to obtain data between 0 and 1, thereby achieving normalization processing of the beam adjustment parameter.
[0186] Similar to the above, if the beam modulation parameter is the excitation current, the excitation current can also be normalized so that the data is between 0 and 1.
[0187] In a possible implementation, since there is a corresponding relationship between the excitation current value and the magnetic induction intensity, the excitation current value can be converted into a magnetic induction intensity value based on the corresponding relationship, and then the above-mentioned normalization processing of the magnetic induction intensity is performed, and then converted back to the excitation current value to achieve normalization processing of the excitation current.
[0188] In a possible implementation, the maximum excitation current intensity may be predetermined. When the beam modulation parameter is the excitation current, the excitation current may be divided by the maximum excitation current intensity to obtain data between 0 and 1, thereby achieving normalization of the beam modulation parameter.
[0189] Among them, normalization is a necessary operation to help the autoencoder model train correctly and accelerate training. The data features in each dimension of the normalized data are uniform, which can accelerate the convergence of the autoencoder model.
[0190] S704: Form training sample pairs based on sample beam energy parameters and corresponding sample beam modulation parameters to obtain a training sample set.
[0191] Among them, according to the corresponding relationship, each sample beam energy parameter and each sample beam modulation parameter are paired in sequence to obtain a number of training sample pairs.
[0192] The several training sample pairs obtain a training sample set.
[0193] In this embodiment, an original data set is obtained, which includes a plurality of beam energy values and corresponding beam modulation parameters; based on a preset beam modulation range of a linear accelerator, each beam energy value is normalized to obtain a corresponding sample beam energy parameter; based on a controllable setting range of a magnetic field of the linear accelerator, each beam modulation parameter is normalized to obtain a corresponding sample beam modulation parameter; based on sample beam energy parameters and corresponding sample beam modulation parameters, sample pairs are formed to obtain a training sample set, and the beam energy values and beam modulation parameters of the original data are normalized respectively to improve convergence in a subsequent autoencoder model training process and improve training efficiency.
[0194] Figure 8 It is a flowchart of determining the initial autoencoder model structure based on training sample pairs provided in an embodiment of the present application, which may include steps S801 to S802. These steps are described in detail below.
[0195] S801, analyzing each training sample pair in the training sample set to determine the number of parameters in the sample beam tuning parameters;
[0196] The training sample pairs in the training sample set have the same format, and the training sample pairs are analyzed to obtain the number of parameters in the sample beam tuning parameters.
[0197] As an example, the training sample pair is represented by the following data format: [energy, B1', B2', B3', B4'], indicating that the sample beam modulation parameters are composed of four parameters.
[0198] As an example, the training sample pair is represented by the following data format: [energy, B1', B2', ..., Bn'], indicating that the sample beam modulation parameters are composed of n parameters.
[0199] The parameter in the sample beam adjustment parameter may be the current intensity of the excitation power supply, and the number of the parameters corresponds to the number of power supplies.
[0200] S802: Determine the number of network layers and the number of neurons in the input layer in the initial autoencoder model based on the number of parameters in the sample beam tuning parameters.
[0201] Among them, the input layer of the encoder in the autoencoder model sets corresponding neurons for each input information. Correspondingly, the number of neurons in the input layer can be determined according to the number of data included in the information to be input.
[0202] refer to Figure 5 The neural network structure diagram of the autoencoder model is shown in , where the input layer of the encoding layer includes 5 nodes, and the 5 nodes respectively input 4 parameters of the sample beam modulation parameters and 1 sample beam energy parameter.
[0203] Among them, since the autoencoder model composed of neural networks has good scalability, it can increase the number of neurons in the hidden layer of the neural network according to the number of tuning parameters, or increase the number of network layers in the neural network to adapt to more complex tuning scenarios.
[0204] In this embodiment, each training sample pair in the training sample set is analyzed to determine the number of parameters in the sample beam adjustment parameters; based on the number of parameters in the sample beam adjustment parameters, the number of network layers in the initial autoencoder model and the number of neurons in the input layer are determined, and the structure of the autoencoder model can be adjusted based on the number of input parameters. The autoencoder model has good scalability.
[0205] Fig. 9 It is a flowchart of selecting a preset autoencoder model during a training process provided by an embodiment of the present application, which may include steps S901 to S903, and these steps are described in detail below.
[0206] S901, after adjusting the initial autoencoder model, start recording the number of training times;
[0207] The number of training times is the number of times the autoencoder model is adjusted, and is the number of iterations of the training of the autoencoder model.
[0208] The number of training times of first adjusting the initial autoencoder model may be recorded as 1, and subsequently, each time the adjusted autoencoder model is adjusted, the number of training times recorded is increased by 1.
[0209] S902, based on the number of training times satisfying a preset number of training times condition, saving the adjusted autoencoder model;
[0210] The preset training times condition may be to save an autoencoder model every specific training times.
[0211] As an example, save a tuned autoencoder model every 30 times.
[0212] Among them, since the neural network model may have overfitting problems during the training process, during the training process, an autoencoder model is saved every specific number of times until the training process no longer meets the training continuation conditions.
[0213] S903: Based on the loss value of the adjusted autoencoder model and the initial loss value, determine a preset autoencoder model that has been trained from at least two adjusted autoencoder models.
[0214] Among them, the difference between the loss value of the adjusted autoencoder model and the initial loss value is the improvement of the performance of the adjusted autoencoder model relative to the performance of the initial autoencoder model. Based on this improvement, an autoencoder model with the best performance can be selected from multiple saved autoencoder models as the preset autoencoder model.
[0215] As an example, a ratio value can be determined based on the loss value and the initial loss value, and the corresponding ratio values of each adjusted autoencoder model can be compared. According to the ratio value, the ratio value within a specific ratio range and the smallest is selected from the adjusted autoencoder models as the preset autoencoder model.
[0216] The specific ratio range may be between 1 / 20 and 1 / 100 of the initial loss value.
[0217] In this embodiment, after adjusting the initial autoencoder model, the number of training times is recorded; based on whether the number of training times meets the preset training number conditions, the adjusted autoencoder model is saved; based on the loss value of the adjusted autoencoder model and the initial loss value, the preset autoencoder model is determined from at least two adjusted autoencoder models, so that during the training stage, one autoencoder model with the best performance can be selected from the multiple autoencoder models obtained through training, thereby improving the accuracy of training.
[0218] A linear accelerator beam tuning method provided in an embodiment of the present application is introduced above, and a device for executing the linear accelerator beam tuning method will be introduced below.
[0219] Fig.10 1 is a schematic diagram of the structure of a linear accelerator beam tuning device provided in an embodiment of the present application. The linear accelerator beam tuning device 1000 includes: a training module 1001, an acquisition module 1002, a processing module 1003, and an adjustment module 1004;
[0220] The obtaining module 1002 is used to obtain the beam energy parameters of the linear accelerator;
[0221] The processing module 1003 is used to process the beam energy parameter through a decoder of a preset autoencoder model to obtain a target beam modulation parameter value;
[0222] The adjustment module 1004 is used to adjust the parameters of the linear accelerator according to the target beam adjustment parameters, so as to adjust the magnetic induction intensity in the linear accelerator and achieve beam current tuning of the linear accelerator;
[0223] The training module 1001 is used for pre-training to obtain a preset auto-encoding model;
[0224] The training module 1001 includes: an acquisition unit 10011 and a training unit 10012;
[0225] The obtaining unit 10011 is used to obtain a training sample set, wherein the training sample set includes a training sample pair consisting of a number of sample beam energy parameters and sample beam modulation parameters;
[0226] Among them, the training unit 10012 is used to train the initial autoencoder model based on the training sample set to obtain a trained preset autoencoder model, and the preset autoencoder model is determined based on the loss value and initial loss value of the preset autoencoder model, and the initial loss value is the loss value when the initial autoencoder model is trained for the first time.
[0227] In a possible implementation, the processing module includes:
[0228] A first processing unit is used to perform normalization processing on the beam energy parameter to obtain a beam energy parameter that meets the input requirements of a preset autoencoder model;
[0229] The decoding unit is used to decode the beam energy parameter through a decoder in the preset autoencoding model to obtain a target beam modulation parameter.
[0230] In a possible implementation, the adjustment module includes:
[0231] An instruction generating unit, used for generating a control instruction according to the target beam adjustment parameter;
[0232] The sending unit is used to send the control instruction to the power supply control device of the linear accelerator to control the power supply to output a current matching the target beam modulation parameter.
[0233] In a possible implementation, the training unit is specifically configured to:
[0234] Inputting the sample beam energy parameters and sample beam modulation parameters in the training sample set into the initial autoencoder model to obtain the predicted initial beam modulation parameters;
[0235] Determining an initial loss value of the initial autoencoder model based at least on the predicted initial beam tuning parameter and the sample beam tuning parameter;
[0236] Adjust the initial autoencoder model based on the initial loss value to obtain an adjusted autoencoder model;
[0237] Inputting the sample beam energy parameters and the sample beam modulation parameters in the training sample set into the adjusted autoencoder model to obtain the predicted beam modulation parameters;
[0238] Determining a loss value of the adjusted autoencoder model based at least on the predicted beam tuning parameter and the sample beam tuning parameter;
[0239] Based on the loss value satisfying the training continuation condition, the adjusted autoencoder model is adjusted according to the loss value to obtain a new adjusted autoencoder model, and the step of returning to execute the step of inputting the sample beam energy parameters and the sample beam modulation parameters in the training sample set into the adjusted autoencoder model to obtain the predicted beam modulation parameters is performed until the loss value of the adjusted autoencoder model does not satisfy the training continuation condition, and a preset autoencoder model whose training is completed is obtained, and the training continuation condition is determined based on the initial loss value.
[0240] In a possible implementation, the obtaining unit is specifically used for:
[0241] Obtaining an original data set, the original data set including a plurality of beam energy values and corresponding beam modulation parameters;
[0242] Based on the preset beam modulation range of the linear accelerator, each beam energy value is normalized to obtain a corresponding sample beam energy parameter;
[0243] Based on the controllable setting range of the magnetic field of the linear accelerator, each beam modulation parameter is normalized to obtain the corresponding sample beam modulation parameter;
[0244] Sample pairs are formed based on sample beam energy parameters and corresponding sample beam modulation parameters to obtain a training sample set.
[0245] In a possible implementation, the method further includes:
[0246] An analysis module, used for analyzing each training sample pair in the training sample set to determine the number of parameters in the sample beam tuning parameters;
[0247] A determination module is used to determine the number of network layers and the number of neurons in the input layer in the initial autoencoder model based on the number of parameters in the sample beam tuning parameters.
[0248] It should be noted that, for the functional explanation of each component in the linear accelerator beam tuning device provided in this embodiment, please refer to the explanation in the aforementioned method embodiment, and it will not be repeated in this embodiment.
[0249] In this embodiment, the beam energy parameters of the linear accelerator are obtained; the beam energy parameters are processed by a preset autoencoder model to obtain target beam tuning parameters; the parameters of the linear accelerator are adjusted according to the target beam tuning parameters to adjust the magnetic induction intensity in the linear accelerator to achieve beam tuning of the linear accelerator, wherein the preset autoencoder model is obtained by training an initial autoencoder model based on a training sample set, the training sample set includes several training sample pairs consisting of sample beam energy parameters and sample beam tuning parameters, and the initial loss value is the loss value of the first training of the initial autoencoder model. By using the pre-trained preset autoencoder model to determine the target beam tuning parameters based on the beam energy parameters, the parameters of the linear accelerator can be adjusted based on the target beam tuning parameters to achieve the purpose of beam tuning, which is not limited to the physical knowledge and experience of the technician and improves the beam tuning efficiency.
[0250] The present application also provides an electronic device in an embodiment. Fig.11 As shown, it shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiment of the present application. The electronic device in the embodiment of the present application may include but is not limited to fixed terminals such as mobile phones, laptops, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Fig.11 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0251] like Fig.11 As shown, the electronic device may include a processing device 1101, which can perform various appropriate actions and processes according to the program stored in the ROM 1102 or the program loaded from the storage device 1108 to the RAM 1103. When the electronic device is powered on, the RAM 1103 also stores various programs and data required for the operation of the electronic device. The processing device 1101, the ROM 1102, and the RAM 1103 are connected to each other via a bus 1104. The I / O interface 1105 is also connected to the bus 1104.
[0252] The processing device 1101 may be a central processing unit, a graphics processing unit, etc.; the ROM 1102 is a read-only memory, the RAM 1103 is a random access memory, and the I / O interface 1105 is an input / output interface.
[0253] Typically, the following devices may be connected to the I / O interface 1105: an input device 1106 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 1107 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 1108 including, for example, a memory card, a hard disk, etc.; and a communication device 1109. The communication device 1109 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although Fig.11 An electronic device having various devices is shown, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0254] An embodiment of the present application also provides a computer program product, including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements any linear accelerator beam tuning method provided in the embodiment of the present application.
[0255] A computer-readable storage medium is also provided in an embodiment of the present application. The storage medium carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any linear accelerator beam tuning method provided in an embodiment of the present application.
[0256] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.
[0257] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0258] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.
[0259] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a training device, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, training device, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
Claims
1. A linear accelerator beam tuning method, characterized in that: include: Obtain the beam energy parameters of the linear accelerator; Processing the beam energy parameters through a decoder of a preset autoencoder model to obtain target beam modulation parameters; Adjusting the parameters of the linear accelerator according to the target beam tuning parameters to adjust the magnetic induction intensity in the linear accelerator and achieve beam tuning of the linear accelerator; The preset autoencoder model is pre-trained according to the following process: Obtaining a training sample set, the training sample set comprising a number of training sample pairs consisting of sample beam energy parameters and sample beam modulation parameters; An initial autoencoder model is trained according to the training sample set to obtain a trained preset autoencoder model, wherein the preset autoencoder model is determined based on the loss value of the preset autoencoder model and the initial loss value, and the initial loss value is the loss value when the initial autoencoder model is trained for the first time.
2. The linear accelerator beam tuning method according to claim 1, characterized in that: The step of processing the beam energy parameter by a decoder of a preset autoencoder model to obtain a target beam modulation parameter includes: Normalizing the beam energy parameters to obtain beam energy parameters that meet the input requirements of a preset autoencoder model; The beam energy parameter is decoded by a decoder in the preset autoencoder model to obtain a target beam modulation parameter.
3. The linear accelerator beam tuning method according to claim 1, characterized in that: The step of adjusting the parameters of the linear accelerator according to the target beam adjustment parameters includes: generating a control instruction according to the target beam adjustment parameter; The control instruction is sent to a power supply control device of the linear accelerator to control the power supply to output a current matching the target beam modulation parameter.
4. The linear accelerator beam tuning method according to claim 1, characterized in that: The step of training the initial autoencoder model according to the training sample set to obtain a trained preset autoencoder model includes: Inputting the sample beam energy parameters and sample beam modulation parameters in the training sample set into the initial autoencoder model to obtain the predicted initial beam modulation parameters; Determining an initial loss value of the initial autoencoder model based at least on the predicted initial beam tuning parameter and the sample beam tuning parameter; Adjust the initial autoencoder model based on the initial loss value to obtain an adjusted autoencoder model; Inputting the sample beam energy parameters and the sample beam modulation parameters in the training sample set into the adjusted autoencoder model to obtain predicted beam modulation parameters; determining a loss value of the adjusted autoencoder model based at least on the predicted beam modulation parameter and the sample beam modulation parameter; Based on the loss value satisfying the training continuation condition, the adjusted autoencoder model is adjusted according to the loss value to obtain a new adjusted autoencoder model, and the step of inputting the sample beam energy parameters and the sample beam modulation parameters in the training sample set into the adjusted autoencoder model to obtain predicted beam modulation parameters is returned to execute, until the loss value of the adjusted autoencoder model does not satisfy the training continuation condition, and a preset autoencoder model whose training is completed is obtained, and the training continuation condition is determined based on the initial loss value.
5. The linear accelerator beam tuning method according to claim 1, characterized in that: The obtaining of the training sample set comprises: Obtaining an original data set, wherein the original data set includes a plurality of beam energy values and corresponding beam modulation parameters; Based on the preset beam modulation range of the linear accelerator, each beam energy value is normalized to obtain a corresponding sample beam energy parameter; Based on the controllable setting range of the magnetic field of the linear accelerator, each beam modulation parameter is normalized to obtain a corresponding sample beam modulation parameter; Sample pairs are formed based on sample beam energy parameters and corresponding sample beam modulation parameters to obtain a training sample set.
6. The linear accelerator beam tuning method according to claim 1, characterized in that: Before the initial autoencoder model is trained according to the training sample set to obtain a trained preset autoencoder model, the method further includes: Analyze each training sample pair in the training sample set to determine the number of parameters in the sample beam tuning parameters; Based on the number of parameters in the sample beam tuning parameters, the number of network layers and the number of neurons in the input layer in the initial autoencoder model are determined.
7. A linear accelerator beam tuning device, characterized in that: include: An acquisition module, used to obtain beam energy parameters of a linear accelerator; A processing module, used for processing the beam energy parameter through a decoder of a preset autoencoder model to obtain a target beam modulation parameter; An adjustment module, used for adjusting the parameters of the linear accelerator according to the target beam adjustment parameters, so as to adjust the magnetic induction intensity in the linear accelerator and realize beam current tuning of the linear accelerator; A training module is used to pre-train a preset autoencoder model; Wherein, the training module includes: An obtaining unit, used for obtaining a training sample set, wherein the training sample set includes a training sample pair consisting of a number of sample beam energy parameters and sample beam modulation parameters; A training unit is used to train an initial autoencoder model based on the training sample set to obtain a trained preset autoencoder model, wherein the preset autoencoder model is determined based on a loss value of the preset autoencoder model and an initial loss value, and the initial loss value is the loss value when the initial autoencoder model is trained for the first time.
8. A computer program product, characterized in that The method comprises computer-readable instructions, and when the computer-readable instructions are executed on an electronic device, the electronic device implements the linear accelerator beam tuning method according to any one of claims 1 to 6.
9. An electronic device, characterized in that: The method comprises at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program so that the electronic device can implement the linear accelerator beam tuning method as described in any one of claims 1 to 6.
10. A computer storage medium, characterized in that: The storage medium carries one or more computer programs, and when the one or more computer programs are executed by an electronic device, the electronic device can implement the linear accelerator beam tuning method as described in any one of claims 1 to 6.
