Accelerator beam parameter optimization method and system
By acquiring real-time data and beam profile images of the accelerator beam, and utilizing computer vision technology and reinforcement learning models, the problem of multi-parameter coupling in accelerator beam parameter optimization is solved, and automatic intelligent control and optimization of the beam quality is achieved.
Patent Information
- Application Number
- CN202511270525.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-08
- Publication Date
- 2025-10-10
AI Technical Summary
Traditional accelerator beam parameter optimization methods cannot effectively handle the multi-parameter coupling relationship, resulting in a decrease in beam quality. They also lack full utilization of beam profile image information and are difficult to achieve automatic adjustment.
By acquiring real-time data and beam profile images of the accelerator beam, using computer vision technology to extract the beam envelope and beam spot shape characteristics, and combining the reinforcement learning model to adjust the control variables, comprehensive evaluation and automatic intelligent control of the beam state can be achieved.
It realizes comprehensive evaluation and automatic intelligent control of accelerator beam quality, optimizes multi-parameter coupling problems, and improves the adjustment efficiency and accuracy of beam parameters.
Smart Images

Figure CN120769413A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of parameter optimization, and in particular to an accelerator beam parameter optimization method and system. Background Art
[0002] Accelerators are essential equipment for modern scientific research and industrial applications, and their beam quality directly impacts experimental results and application outcomes. During accelerator operation, beam parameters such as energy, flux, emittance, and energy dispersion can fluctuate due to a variety of factors, leading to a decrease in beam quality. Especially during long-term operation, factors such as equipment aging, environmental changes, and power supply fluctuations can cause beam parameters to deviate from their optimal operating point. Furthermore, different experiments and applications have varying requirements for beam parameters, necessitating precise adjustment based on specific needs. Traditional manual adjustment methods, which rely on operator experience, are not only inefficient but also difficult to achieve automatic adjustment, especially in complex systems with coupled multi-parameters.
[0003] Traditional parameter optimization methods often use single parameter adjustment or simple scanning methods, which cannot effectively handle the complex coupling relationship between multiple parameters, resulting in limited optimization effects. In addition, most traditional methods lack the full utilization of beam profile image information. The beam profile image contains rich beam state information and is an important basis for evaluating beam quality.
[0004] To this end, the present invention proposes a method and system for optimizing accelerator beam parameters. Summary of the Invention
[0005] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, the present invention proposes an accelerator beam parameter optimization method and system, which solves the technical problem of multi-parameter coupled optimization and realizes comprehensive evaluation and automatic intelligent control of beam quality.
[0006] To achieve the above objectives, a method for optimizing accelerator beam parameters is proposed, comprising the following steps:
[0007] Step 1: Acquire real-time data of beam parameters and control variables of the accelerator beam, wherein the beam parameters include beam energy, beam current intensity, emittance, energy spread, beam profile image, and time structure, and the control variables include magnetic field intensity, high-frequency cavity phase, and high-frequency cavity amplitude;
[0008] Step 2: Obtain a beam profile image of the accelerator beam, and extract beam envelope features and beam spot shape features of the beam profile image using computer vision technology;
[0009] Step 3: Combining the beam parameters with the beam envelope characteristics and beam spot shape characteristics, constructing a comprehensive evaluation index for evaluating the beam state, and calculating the state deviation between the current beam and a preset target state;
[0010] Step 4: judging whether the current beam current meets a preset threshold value based on the state deviation; if so, no processing is performed; if not, proceeding to step 5;
[0011] Step 5: Based on the comprehensive evaluation index, the control variables are adjusted through the reinforcement learning model to generate a new control variable combination;
[0012] The beam parameters of the accelerator beam are collected in the following manner:
[0013] Using a distributed data acquisition system to collect the beam parameters, the distributed data acquisition system includes a beam diagnostic instrument array;
[0014] The control variables of the accelerator beam are collected in the following manner:
[0015] The control variable data are obtained through the EPICS channel accessor of the accelerator control system, including the magnetic field strength of the focusing magnet and the phase and amplitude of the high-frequency cavity.
[0016] Extracting the beam envelope features of the beam profile image using computer vision technology includes the following steps:
[0017] Step 211: Preprocessing the beam profile image captured by the fluorescent screen and the high-speed CCD camera, including noise filtering, background correction, and contrast enhancement;
[0018] Step 212: performing edge detection and contour extraction on the pre-processed beam profile image to identify the outer boundary of the beam;
[0019] Step 213: Based on the extracted outer boundary, calculate the geometric characteristic parameters of the beam envelope, including envelope area, perimeter, major-minor axis ratio, and direction angle;
[0020] Step 214: constructing a mathematical model of the beam envelope and fitting a spatial distribution model of the beam; generating beam envelope characteristics based on the fitted spatial distribution and the geometric characteristic parameters;
[0021] The calculation of the beam spot shape characteristics includes the following steps:
[0022] Step 221: performing intensity distribution analysis on the pre-processed beam profile image to extract spatial distribution characteristics of the beam intensity;
[0023] Step 222: constructing a mathematical model of the beam spot shape based on the spatial distribution characteristics of the beam intensity to fit the intensity profile of the beam;
[0024] Step 223: extracting characteristic parameters of the beam spot shape, including symmetry, sharpness, smoothness, and irregularity;
[0025] Step 224: Analyze the internal structural characteristics of the beam spot to identify the internal inhomogeneity and microstructure of the beam;
[0026] Step 225: Combining the spatial distribution characteristics of the beam intensity, the characteristic parameters of the beam spot shape, and the internal structure characteristics, a complete beam spot shape characteristic is constructed;
[0027] Calculating the state deviation between the current beam current and the preset target state includes the following steps:
[0028] Step 31: Combining the beam parameters, the beam envelope characteristics, and the beam spot shape characteristics, constructing a multidimensional feature vector as a digital representation of the beam state;
[0029] Step 32: Based on the multi-dimensional feature vector, construct a comprehensive evaluation index for evaluating the beam state through a weighted fusion algorithm;
[0030] Step 33: Pre-establish a beam target state library to store target beam state parameters under different application scenarios;
[0031] Step 34: Calculate the state deviation between the current beam and the preset target state based on the comprehensive evaluation index and the target beam state parameters;
[0032] The method of judging whether the current beam current meets the preset threshold according to the state deviation is:
[0033] A preset state deviation threshold, if the state deviation is greater than the preset state deviation threshold, it is determined that the preset threshold is not met; otherwise, it is determined that the preset threshold is met;
[0034] Adjusting the control variables by using the reinforcement learning model to generate a new control variable combination includes the following steps:
[0035] Step 51: Construct a reinforcement learning model based on deep deterministic policy gradient by defining the state space, action space, and reward function;
[0036] The reinforcement learning model adopts a dual-network architecture, including a policy network and a value network; the policy network is responsible for generating adjustment strategies for control variables, and the value network is responsible for evaluating the value of state-action pairs.
[0037] The state space is composed of multi-dimensional feature vectors, and the action space is defined as the adjustment amount of the control variables, including the magnetic field intensity adjustment amount, the high-frequency cavity phase and amplitude adjustment amount;
[0038] The reward function is designed based on a comprehensive evaluation index and is defined as: r = 1-Δ, where r is the reward value and Δ is the state deviation, which indicates the degree of difference between the current beam state and the target state.
[0039] Step 52: Designing a neural network structure of a policy network and a value network for the reinforcement learning model to achieve mapping from state to action and evaluation of state-action pair values;
[0040] The policy network uses a fully connected neural network structure with three hidden layers. The input layer receives a 32-dimensional state vector. The first hidden layer contains 128 neurons, the second hidden layer contains 64 neurons, and the third hidden layer contains 32 neurons. The output layer contains 10 neurons, corresponding to a 10-dimensional action vector. The hidden layers use the ReLU activation function, and the output layer uses the tanh activation function to ensure that the output action values are within the range [-1, 1].
[0041] The value network also uses a fully connected neural network architecture, consisting of three hidden layers. The input layer receives the concatenation of a 32-dimensional state vector and a 10-dimensional action vector. The first hidden layer contains 128 neurons, the second hidden layer contains 64 neurons, and the third hidden layer contains 32 neurons. The output layer consists of a single neuron, representing the Q-value of each state-action pair. The hidden layers use the ReLU activation function, while the output layer does not use an activation function and directly outputs the Q-value estimate.
[0042] Step 53: Construct an experience replay buffer for the reinforcement learning model to store historical experiences of the agent interacting with the environment;
[0043] Step 54: Optimize the policy network and value network based on the network parameter update algorithm of temporal difference learning, and train the reinforcement learning model;
[0044] Step 55: Based on the trained reinforcement learning model, generate an adjustment strategy for the control variables and convert it into a new control variable combination.
[0045] An accelerator beam parameter optimization system is proposed, which includes a real-time data collection module, an image feature extraction module, a state deviation calculation module, and a control variable update module. The modules are electrically connected to each other.
[0046] A real-time data collection module obtains real-time data of the beam parameters and control variables of the accelerator beam, and sends the real-time data to the image feature extraction module and the state deviation calculation module;
[0047] an image feature extraction module, which obtains a beam profile image of the accelerator beam, extracts beam envelope features and beam spot shape features from the beam profile image using computer vision technology, and sends the beam envelope features and beam spot shape features to a state deviation calculation module;
[0048] a state deviation calculation module, which combines the beam parameters with the beam envelope characteristics and beam spot shape characteristics to construct a comprehensive evaluation index for evaluating the beam state, calculates the state deviation between the current beam and a preset target state, and sends the state deviation and the comprehensive evaluation index to the control variable update module;
[0049] The control variable updating module determines whether the current beam current meets a preset threshold according to the state deviation; if not, the control variable is adjusted through a reinforcement learning model based on the comprehensive evaluation index to generate a new control variable combination.
[0050] Compared with the prior art, the present invention has the following beneficial effects:
[0051] The present invention acquires real-time data on various accelerator beam parameters and control variables, then obtains a beam profile image. This image is processed and analyzed using computer vision technology to extract beam envelope characteristics and beam spot shape features. The beam parameters are then combined with the beam envelope and beam spot shape features to construct a comprehensive evaluation index for comprehensively evaluating the current beam state. This index reflects the degree of deviation between the beam and a preset target state. Based on the calculated state deviation, it is then determined whether the current beam meets the preset threshold requirements. If it does not, a reinforcement learning model is used to intelligently adjust the control variables based on the constructed comprehensive evaluation index to generate a new control variable combination. By continuously trying different control variable combinations, the reinforcement learning model learns the mapping relationship between the control variables and the beam state, gradually optimizing the control strategy to bring the beam parameters closer to the target state. This solves the technical problem of multi-parameter coupled optimization during accelerator operation and enables comprehensive assessment and automatic intelligent control of beam quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 This is a flow chart of a method for optimizing accelerator beam parameters in Example 1 of the present invention;
[0053] Figure 2 This is a model structure diagram of the policy network in the reinforcement learning model in Example 1 of the present invention;
[0054] Figure 3 This is a model structure diagram of the value network in the reinforcement learning model in Example 1 of the present invention;
[0055] Figure 4 This is a module connection diagram of the accelerator beam parameter optimization system in Example 2 of the present invention. DETAILED DESCRIPTION
[0056] The technical solutions of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0057] Example 1
[0058] like Figure 1 As shown, a method for optimizing accelerator beam parameters includes the following steps:
[0059] Step 1: Acquire real-time data of beam parameters and control variables of the accelerator beam, wherein the beam parameters include beam energy, beam current intensity, emittance, energy spread, beam profile image, and time structure, and the control variables include magnetic field intensity, high-frequency cavity phase, and high-frequency cavity amplitude;
[0060] Step 2: Obtain a beam profile image of the accelerator beam, and extract beam envelope features and beam spot shape features of the beam profile image using computer vision technology;
[0061] Step 3: Combining the beam parameters with the beam envelope characteristics and beam spot shape characteristics, constructing a comprehensive evaluation index for evaluating the beam state, and calculating the state deviation between the current beam and a preset target state;
[0062] Step 4: judging whether the current beam current meets a preset threshold value based on the state deviation; if so, no processing is performed; if not, proceeding to step 5;
[0063] Step 5: Based on the comprehensive evaluation index, the control variables are adjusted through the reinforcement learning model to generate a new control variable combination;
[0064] In an embodiment of the present invention, the beam parameters of the accelerator beam are collected in the following manner:
[0065] Using a distributed data acquisition system to collect the beam parameters, the distributed data acquisition system includes a beam diagnostic instrument array;
[0066] Specifically, the beam diagnostic instrument array is composed of a beam current transformer, a fluorescent screen, a high-speed CCD camera, a streak camera, a quadrupole matrix, an energy analysis magnet and other equipment;
[0067] The beam current transformer measures beam current intensity using the principle of inductive current and converts it into a digital signal via an analog-to-digital converter. Beam current intensity represents the number of particles passing through a specific cross-section of the accelerator per unit time. As a fundamental parameter for measuring accelerator output capacity, it directly impacts the statistical accuracy and irradiation dose of the experiment.
[0068] The fluorescent screen is combined with a high-speed CCD camera to capture a beam cross-sectional distribution image, i.e., a beam profile image;
[0069] The streak camera uses photoelectric conversion technology to measure the longitudinal time structure of the beam; the longitudinal time structure of the beam describes the distribution of particles in the propagation direction, including characteristics such as bunch length, interval and shape.
[0070] The quadrupole array measures beam emittance using a quadrupole scanning method. Beam emittance is a physical quantity that describes the distribution range of the beam in phase space and reflects the correlation between the beam's transverse momentum and position. Emittance is an important indicator of beam quality; lower emittance means better coherence and higher brightness.
[0071] The energy analysis magnet, combined with a position-sensitive detector, measures beam energy and energy spread. Beam energy represents the kinetic energy of the accelerated particles, while energy spread reflects the width of the energy distribution of particles in the beam. Beam energy and energy spread have a decisive influence on determining the beam's penetration ability, how it interacts with matter, and the energy resolution of the experiment.
[0072] In a preferred embodiment of the present invention, all beam parameters carry timestamp information, data synchronization is achieved through a synchronization protocol, and outlier detection and filtering are performed by a data preprocessing module. The data is finally output in the form of a structured data packet, which includes the parameter name, value, unit, timestamp and quality flag.
[0073] Furthermore, the control variables of the accelerator beam are collected in the following manner:
[0074] The control variable data are obtained through the EPICS channel accessor of the accelerator control system, including the magnetic field strength of the focusing magnet and the phase and amplitude of the high-frequency cavity.
[0075] The magnetic field strength of the focusing magnet determines the beam's focusing degree and transmission characteristics. Adjusting the magnetic field strength controls the beam's lateral size and divergence, ultimately controlling the beam envelope. The high-frequency cavity phase determines when particles acquire energy, influencing the beam's longitudinal distribution and energy dispersion. The high-frequency cavity amplitude determines the magnitude of the acceleration gradient, directly influencing the beam's ultimate energy.
[0076] Similarly, each of the control variables undergoes the same data synchronization, outlier detection, and filtering as the beam parameters to achieve preprocessing operations on the beam parameters and control variables;
[0077] Furthermore, extracting the beam envelope features of the beam profile image using computer vision technology includes the following steps:
[0078] Step 211: Preprocessing the beam profile image captured by the fluorescent screen and the high-speed CCD camera, including noise filtering, background correction, and contrast enhancement;
[0079] Specifically, the noise filtering uses an adaptive Gaussian filtering algorithm, dynamically adjusting the filter kernel parameters based on the signal-to-noise ratio of a local image region. The filter kernel size adaptively varies between 3×3 and 7×7. For example, a larger filter kernel is used for areas with a higher signal-to-noise ratio, thereby preserving beam edge details while suppressing random noise.
[0080] The background correction stage uses a dynamic threshold segmentation method to identify non-beam areas and calculates the average grayscale value of the non-beam areas as a background reference. By subtracting the background reference and performing normalization processing, the effects of ambient lighting and phosphor screen non-uniformity on the image are eliminated.
[0081] The contrast enhancement stage applies histogram equalization to expand the image's dynamic range and enhance the grayscale difference between the beam's edges and center. The enhancement process employs a local adaptive histogram equalization algorithm, which divides the image into multiple subregions for separate processing. This avoids information loss caused by over-enhancement while maintaining the relative relationship between the beam intensity distributions.
[0082] Step 212: performing edge detection and contour extraction on the pre-processed beam profile image to identify the outer boundary of the beam;
[0083] Specifically, edge detection uses a multi-scale Canny algorithm, generating edge response maps using three Gaussian filters at different scales to capture edge information at different scales. The low threshold is set at 0.5 times the image's average gradient, and the high threshold is set at 1.5 times the average gradient. This dual-threshold method suppresses false edges while preserving true beam boundaries.
[0084] The contour extraction process uses a contour tracking algorithm to connect and close the edge detection results to generate a complete beam contour. Contour tracking employs a modified Moore neighborhood tracking method, starting from the first edge point in the upper left corner and searching for adjacent edge points in a clockwise direction until the point returns to the starting position, forming a closed contour. Any existing contour breaks are connected using the minimum distance principle to ensure contour integrity.
[0085] In the specific implementation of the present invention, the extracted contour point set may be further simplified by the Douglas-Peucker algorithm to reduce redundant points while retaining key features of the contour.
[0086] Step 213: Based on the extracted outer boundary, calculate the geometric characteristic parameters of the beam envelope, including envelope area, perimeter, major-minor axis ratio, and direction angle;
[0087] Specifically, the beam envelope area is calculated using Green's formula to calculate the area of the area enclosed by the outline. The formula is: , where A is the envelope area enclosed by the contour, i is the number of the contour point, ( , ) is the coordinate of the i-th contour point on the contour. The envelope perimeter is calculated by accumulating the Euclidean distance between adjacent contour points. The calculation formula is:
[0088] ,in, is the envelope perimeter.
[0089] The beam envelope's major-to-minor axis ratio and direction angle are obtained by calculating the covariance matrix of the contour point set and its eigenvalues and eigenvectors. The covariance matrix C = [[σx²,σxy],[σxy,σy²]], where σx² and σy² are the variances of the x and y coordinates, respectively, and σxy is the covariance of x and y. The eigenvalues λ1 and λ2 (λ1 ≥ λ2) of the matrix C correspond to the squares of the major and minor axis lengths of the envelope, and the major-to-minor axis ratio R = The direction angle θ is the angle between the eigenvector corresponding to the long axis and the x-axis, and the calculation formula is θ=arctan( ), where (vx,vy) is the eigenvector corresponding to the maximum eigenvalue.
[0090] Step 214: constructing a mathematical model of the beam envelope and fitting a spatial distribution model of the beam; generating beam envelope characteristics based on the fitted spatial distribution and the geometric characteristic parameters;
[0091] Specifically, the mathematical model of the spatial distribution model of the beam envelope adopts a method that combines two-dimensional Gaussian distribution with ellipse fitting. First, the extracted contour points are fitted to the standard ellipse equation through the least squares method.
[0092] Based on the ellipse fitting, a two-dimensional Gaussian distribution model is constructed to describe the beam intensity distribution, and the probability density function is: ,in, is the normalization coefficient, σx and σy are the standard deviations in the x and y directions, respectively, and are related to the ellipse parameters. , , where a is the major semi-axis of the ellipse, b is the minor semi-axis of the ellipse, k is a constant, usually 2 or 3, and (x0, y0) are the coordinates of the center point of the ellipse corresponding to the fitted ellipse equation;
[0093] The beam envelope characteristics thus include the following parameters: the coordinates of the ellipse center (x0, y0), the major and minor axes a and b, the azimuth angle θ, the ratio of the major and minor axes R, the envelope area A, the envelope perimeter P, and the standard deviations σx and σy of the Gaussian distribution. These parameters fully describe the spatial distribution of the beam envelope and can be used for subsequent beam state assessment and control optimization.
[0094] Furthermore, the calculation of the beam spot shape characteristics includes the following steps:
[0095] Step 221: performing intensity distribution analysis on the pre-processed beam profile image to extract spatial distribution characteristics of the beam intensity;
[0096] Specifically, intensity distribution analysis first calculates the grayscale histogram of the beam profile image and counts the number of pixels at different grayscale levels. The histogram is quantized using 256 grayscale levels. By analyzing the histogram's shape characteristics, such as peak position, width, and skewness, a preliminary assessment of the concentration and symmetry of the beam intensity distribution is made.
[0097] First, the moment characteristics of the beam profile image are calculated. The zero-order moment M00 represents the total beam intensity, while the first-order moments M10 / M00 and M01 / M00 determine the beam's center of mass (xc, yc). The second-order central moments μ20, μ02, and μ11 construct the covariance matrix, describing the spatial discreteness of the beam intensity distribution.
[0098] Based on the second-order central moment, the main axis direction and anisotropy of the beam intensity distribution are calculated to form the spatial distribution characteristics of the beam intensity. Indicates the main direction of beam intensity distribution, anisotropy index It reflects the degree of ellipticity of the intensity distribution. A larger e value indicates a more uneven distribution.
[0099] Step 222: constructing a mathematical model of the beam spot shape based on the spatial distribution characteristics of the beam intensity to fit the intensity profile of the beam;
[0100] Specifically, the mathematical model of the beam spot shape adopts a multi-Gaussian component mixture model to adapt to different types of beam intensity distributions. The model expression is I(x,y)= , where I(x,y) represents the beam spot shape, j represents the number of the Gaussian component, Aj is the amplitude coefficient, (xj,yj) is the center coordinate, σxj and σyj are the standard deviations in the x and y directions.
[0101] The parameters of the multi-Gaussian component mixture model are iteratively optimized using the expectation-maximization (EM) algorithm. During the initialization phase, the K-means clustering algorithm is used to determine the initial parameters of the Gaussian components. The E-step calculates the posterior probability that each pixel belongs to each Gaussian component. The M-step updates the parameters of each Gaussian component to maximize the likelihood function for the observed data. This iterative process continues until the parameter change is less than a preset threshold or the maximum number of iterations is reached, typically 100.
[0102] Goodness of fit is assessed by calculating the mean squared error (MSE) between the model's predicted and actual intensity values and the structural similarity index (SSIM). MSE reflects overall fit accuracy, while SSIM focuses on the degree of preservation of structural information. Based on the goodness of fit, the number of Gaussian components is adaptively adjusted to ensure fit accuracy while avoiding overfitting.
[0103] Step 223: extracting characteristic parameters of the beam spot shape, including symmetry, sharpness, smoothness, and irregularity;
[0104] Specifically, the beam spot symmetry is quantified by calculating the skewness and kurtosis of the intensity distribution with respect to the principal axis. , used to reflect the degree of asymmetry of the distribution, μ30 is the third-order central moment; kurtosis , which is used to measure the sharpness of the distribution, and μ40 is the fourth-order central moment. The ideal Gaussian distribution has a skewness of 0 and a kurtosis of 0.
[0105] The beam spot sharpness is characterized by calculating the statistical characteristics of the intensity gradient. First, the gradient amplitude of the image is calculated. , where Gx and Gy are the gradients in the x and y directions, respectively. The sharpness index is defined as the ratio of the mean value to the standard deviation of the gradient amplitude, reflecting the clarity of the beam edge.
[0106] Beam spot smoothness is measured using the statistical properties of local second-order derivatives, quantified by calculating the mean and variance of the Laplace operator response. The smoothness index is defined as the inverse of the absolute value of the Laplace response, with larger values indicating a smoother beam spot.
[0107] Beam spot irregularity is characterized by the complexity of the profile using a Fourier descriptor. The beam profile points are represented as a complex sequence z(kt)=x(kt)+jy(kt). Spectral coefficients are obtained through discrete Fourier transform, where kt represents the discrete time index, x(kt) is the real signal, and jy(kt) is the imaginary signal. The irregularity index is defined as the ratio of the high-frequency component energy to the total energy, reflecting the complexity of the profile.
[0108] Step 224: Analyze the internal structural characteristics of the beam spot to identify the internal inhomogeneity and microstructure of the beam;
[0109] Specifically, the internal structure analysis of the beam spot first uses an adaptive threshold to segment the beam region into multiple intensity levels, forming iso-intensity contours. The nesting relationship and spacing distribution of the iso-intensity contours reflect the intensity variation from the center to the edge of the beam.
[0110] Internal inhomogeneities are quantified by calculating the local intensity variance field. The image is divided into overlapping 5×5 subregions, and the intensity variance of each subregion is calculated to generate a two-dimensional variance distribution map. Variance peaks correspond to inhomogeneous structures within the beam, and the spatial distribution of the variance field reflects the spatial pattern of the inhomogeneity.
[0111] Microstructure identification utilizes wavelet transform technology to extract detailed beam features through multi-scale decomposition. Haar wavelets are used for three-level decomposition, analyzing the energy distribution of horizontal, vertical, and diagonal detail subbands. The microstructure feature vector, composed of the energy ratio and spatial distribution characteristics of each subband, can capture subtle structural variations in the beam.
[0112] Step 225: Combining the spatial distribution characteristics of the beam intensity, the characteristic parameters of the beam spot shape, and the internal structure characteristics, a complete beam spot shape characteristic is constructed;
[0113] Specifically, the beam spot shape characteristics adopt a hierarchical structure, which includes three levels: macroscopic shape characteristics, intensity distribution characteristics and microscopic structure characteristics.
[0114] Macroscopic shape characteristics include the geometric parameters of the beam spot: centroid coordinates (xc, yc), major axis lengths a and b, direction angle θ, envelope area A, envelope perimeter P, and shape factor These parameters describe the overall morphological characteristics of the beam spot.
[0115] The intensity distribution features include the parameters of the Gaussian mixture model: the amplitude Ai of each Gaussian component, the center coordinates (xi,yi), the standard deviations σxi and σyi, and the mixing weights wi. Furthermore, they include intensity moment features, symmetry indices, and sharpness and smoothness parameters to describe the spatial distribution of the beam intensity.
[0116] Microstructural features include intensity profile features such as internal inhomogeneity indices and wavelet coefficient statistics, which capture the subtle structure and local variations within the beam.
[0117] The beam spot shape feature is the integration of the above three levels of features into a unified feature vector to characterize the morphological characteristics of the beam.
[0118] Furthermore, the calculation of the state deviation between the current beam current and the preset target state includes the following steps:
[0119] Step 31: Combining the beam parameters, the beam envelope characteristics, and the beam spot shape characteristics, constructing a multidimensional feature vector as a digital representation of the beam state;
[0120] Specifically, the multidimensional feature vector includes three main parts: basic beam parameter features, beam envelope geometric features and beam spot shape features.
[0121] Among them, the basic beam parameter characteristics include beam energy, beam intensity, emittance, energy dispersion and time structure parameters; the beam envelope geometric characteristics include envelope area, perimeter, major-minor axis ratio and direction angle; the beam spot shape characteristics include symmetry, sharpness, smoothness and irregularity.
[0122] More specifically, during the construction of the multidimensional feature vector, the beam energy is first normalized and mapped to a relative value within a preset energy range. The beam intensity is expressed as a ratio to the design intensity, reflecting the current intensity level. The emittance characteristic, consisting of normalized values in both the horizontal and vertical directions, collectively characterizes the phase space distribution of the beam. The energy spread characteristic, obtained by calculating the relative width of the energy distribution, reflects the concentration of the beam energy distribution. The temporal structure parameters, including the normalized values of the bunch length and bunch spacing, describe the longitudinal distribution of the beam.
[0123] The beam envelope geometry integrates spatial distribution information extracted from beam profile images using computer vision techniques. The envelope area characterizes the beam's cross-sectional coverage, the perimeter reflects the complexity of its boundary, the major-minor axis ratio describes the beam's elliptical shape, and the azimuth angle indicates the spatial orientation of the major axis. Together, these geometric features provide a complete description of the beam's lateral distribution.
[0124] The beam spot shape characteristics include a symmetry index, quantified by calculating the skewness of the intensity distribution relative to the principal axis; a sharpness index, which reflects the clarity of the beam edge; a smoothness index, which characterizes the uniformity of the beam intensity distribution; and an irregularity index, which describes the complexity of the beam spot profile. These shape characteristics, including sharpness, smoothness, and irregularity, comprehensively characterize the microstructural properties of the beam.
[0125] The multidimensional feature vector finally constructed thus contains all the feature parameters of the above three parts, forming a complete digital representation of the beam state, and providing basic data support for subsequent state evaluation and optimization.
[0126] Step 32: Based on the multi-dimensional feature vector, construct a comprehensive evaluation index for evaluating the beam state through a weighted fusion algorithm;
[0127] Specifically, in the specific implementation process of the present invention, the weighted fusion algorithm adopts a hierarchical structure to calculate the basic beam parameter sub-indicator, beam envelope sub-indicator and beam spot shape sub-indicator respectively, and then obtains the final comprehensive evaluation index through weighted summation.
[0128] For example, in the calculation of the basic beam parameter sub-indicators, five aspects are first scored: energy deviation, flux stability, emittance matching, energy dispersion control, and temporal structure consistency. The energy deviation score is mapped using a Gaussian function. When the energy is close to the target value, the score is close to 1, and the greater the deviation, the lower the score. The flux stability score is determined by calculating the relative fluctuation amplitude of the flux intensity. When the fluctuation amplitude is less than 1%, the score is 1, and when it is greater than 5%, the score is 0. The intermediate region is linearly interpolated. The emittance matching score is based on the ratio of the actual emittance to the designed emittance. The highest score is obtained when the ratio is between 0.9 and 1.1. The energy dispersion control score is calculated by the ratio of the energy dispersion to the target energy dispersion. The closer the ratio is to 1, the higher the score. The temporal structure consistency score is determined based on the degree of match between the bunch length and spacing and the designed values.
[0129] In the calculation of the beam envelope sub-metric, the degree of match between the envelope's geometric characteristics and the target state is evaluated. The envelope area match is determined by the ratio of the actual area to the target area, with a ratio between 0.95 and 1.05 receiving the highest score. The major-minor axis ratio score reflects the circularity of the beam, with smaller deviations from the target major-minor axis ratio resulting in higher scores. The azimuth consistency score is based on the angle between the actual and target azimuth angles, with a score of 1 for angles less than 5 degrees and 0 for angles greater than 30 degrees. The envelope perimeter regularity score, calculated as the ratio of the perimeter to the equivalent circle circumference, reflects the smoothness of the boundary.
[0130] The beam spot shape sub-metric evaluates the quality of the beam's microstructure. Symmetry is scored based on the absolute value of skewness; smaller values give higher scores. Sharpness is based on the statistical properties of edge gradients; steeper gradients give higher scores. Smoothness is scored based on the local variance of the intensity distribution; smaller variances give higher scores. Irregularity is scored based on the energy distribution of the Fourier descriptor; lower proportions of high-frequency energy give higher scores.
[0131] The final comprehensive evaluation index is calculated by weighted summation: , where q1, q2, and q3 represent the basic beam parameter sub-indicator, beam envelope sub-indicator, and beam spot shape sub-indicator, respectively. w1, w2, and w3 are the corresponding weighting coefficients, which are dynamically adjusted based on different application scenarios. For example, for high-precision experiments, the weight of the beam spot shape sub-indicator can be increased; for high-intensity applications, the weight of the basic beam parameter sub-indicator can be increased. The comprehensive evaluation index ranges from 0 to 1, with values closer to 1 indicating a closer-to-ideal beam state.
[0132] Step 33: Pre-establish a beam target state library to store target beam state parameters under different application scenarios;
[0133] Specifically, the beam target state library adopts a hierarchical structure design, which includes three levels: basic target layer, application scenario layer and user-defined layer.
[0134] The basic target layer stores the standard beam parameters defined in the accelerator design specifications, including nominal energy, design flux, standard emittance, energy dispersion limit, and ideal temporal structure. These parameters serve as a reference for evaluating basic beam performance and are applicable to routine accelerator operation and commissioning. The parameters of the basic target layer are determined by the accelerator design documentation. For example, the nominal energy is set to 100 MeV, the design flux is 100 mA, the standard emittance is 10π mm·mrad, the energy dispersion limit is 0.1%, and the ideal bunch length is 10 ps.
[0135] The application scenario layer customizes specific beam target states for different scientific research and industrial applications. For example, for high-energy physics experiments, the focus is on optimizing beam energy stability and energy spread, with a target energy spread set at 0.05%. For free-electron laser applications, the focus is on optimizing beam emittance and temporal structure, with a target emittance of 5πmm·mrad and a target bunch length of 5ps. For medical applications, the focus is on optimizing beam spatial distribution uniformity, with a target aspect ratio close to 1 and a symmetry index greater than 0.95. The parameters of the application scenario layer are determined based on specific application requirements and historical operational experience and can be dynamically updated as the application evolves.
[0136] The user-defined layer setting allows operators to temporarily set target states based on specific experimental requirements. Users can adjust the target values and weights of various parameters through the control interface to automatically generate the corresponding target state configuration. User-defined target states can be saved as templates for subsequent reuse. For example, a user can define a "high-precision irradiation mode" with a beam spot symmetry greater than 0.98 and an irregularity less than 0.05, with high weights for these shape parameters.
[0137] Each record in the target state library contains a complete set of target parameters, corresponding to each dimension of the multidimensional feature vector, along with the parameter's tolerance and optimization weight. Based on the current operating mode and user selections, the system loads the corresponding target state parameters from the library as a reference for evaluating beam state.
[0138] Step 34: Calculate the state deviation between the current beam and the preset target state based on the comprehensive evaluation index and the target beam state parameters;
[0139] Specifically, in the specific implementation process of the present invention, the state deviation calculation adopts a multi-index comprehensive evaluation method to quantify the difference between the current beam and the target state from three dimensions: parameter deviation, geometric deviation and shape deviation.
[0140] Parameter deviation calculations are based on the difference between the measured and target values of basic beam parameters. For example, for energy deviation, the relative error is calculated. , where E is the measured energy and E0 is the target energy. The flux deviation is calculated by the relative error Calculation, I is the measured flux intensity, I0 is the target flux intensity. The emittance deviation is normalized difference denoted by , where h is the measured emittance and h0 is the target emittance. The energy dispersion deviation and temporal structure deviation are calculated using a similar method to the above and will not be further described. The total parameter deviation ΔP is obtained by weighted summation of the deviations of each parameter.
[0141] Similarly, the geometric deviation is calculated based on the difference between the beam envelope characteristics and the target envelope characteristics. For example, the area deviation is calculated by the relative error Calculation, A is the measured envelope area, A0 is the target area. The absolute difference is expressed as , R is the measured length-to-short axis ratio, and R0 is the target length-to-short axis ratio. By calculating the angle difference, , θ is the measured direction angle, θ0 is the target direction angle. The circumference deviation is calculated by relative error. Denotes, P0 is the target perimeter. The total geometric deviation ΔG is obtained by weighted summation of various geometric deviations.
[0142] The shape deviation is calculated based on the difference between the beam spot shape characteristics and the target shape characteristics. The symmetry deviation δS is calculated by the absolute difference, δS=| c-S0|, c is the measured symmetry, and S0 is the target symmetry. Sharpness deviation, smoothness deviation, and irregularity deviation are calculated using similar methods and will not be described in detail here. The total shape deviation ΔF is obtained by weighted summation of each shape deviation.
[0143] Thus, the final state deviation is calculated by a weighted combination of the three-dimensional deviations: , where α, β, and γ are weight coefficients for the three dimensions, and α + β + γ = 1. The weight coefficients for each dimension are dynamically adjusted based on the needs of the current application scenario. For example, for applications requiring precise energy, the weight of parameter deviation is increased; for applications requiring uniform irradiation, the weight of shape deviation is increased.
[0144] The state deviation Δ ranges from 0 to 1, with values closer to 0 indicating the current beam state is closer to the target state. The system compares the calculated state deviation with a preset threshold to determine whether the current beam meets the application requirements and, based on this, decides whether parameter optimization is necessary.
[0145] Furthermore, the method of judging whether the current beam current meets the preset threshold according to the state deviation is:
[0146] A preset state deviation threshold, if the state deviation is greater than the preset state deviation threshold, it is determined that the preset threshold is not met; otherwise, it is determined that the preset threshold is met;
[0147] Furthermore, adjusting the control variables through the reinforcement learning model to generate a new control variable combination includes the following steps:
[0148] Step 51: Construct a reinforcement learning model based on deep deterministic policy gradient by defining the state space, action space, and reward function;
[0149] Specifically, the reinforcement learning model adopts a dual-network architecture, comprising a policy network and a value network. The policy network is responsible for generating adjustment strategies for control variables, while the value network is responsible for evaluating the value of state-action pairs.
[0150] The state space is composed of a multidimensional feature vector, which contains the aforementioned beam parameters, beam envelope characteristics, and beam spot shape characteristics. For example, beam parameters include beam energy, beam intensity, emittance, energy spread, and temporal structure parameters; beam envelope characteristics include envelope area, perimeter, major-minor axis ratio, azimuth angle, ellipse center coordinates, and major and minor semi-axis lengths; and beam spot shape characteristics include symmetry, sharpness, smoothness, irregularity, Gaussian mixture model parameters, and temperature distribution statistics.
[0151] The action space is defined as the adjustment amount of the control variables, including the magnetic field intensity adjustment amount, high-frequency cavity phase and amplitude adjustment amount.
[0152] In the specific implementation process of the present invention, the dimension of the action vector is set to 10, corresponding to the adjustment parameters of 10 key control points. Among them, the magnetic field strength adjustment amount includes the magnetic field strength change value of 4 focusing magnets; the high-frequency cavity phase adjustment amount includes the phase change value of 3 high-frequency cavities; the high-frequency cavity amplitude adjustment amount includes the amplitude change value of 3 high-frequency cavities. The action space is normalized to the [-1,1] interval and converted into the actual control variable adjustment amount through a mapping function. There may be differences in the number of key control points in actual applications, but there is no difference in the overall solution, which is within the scope of protection of the present invention;
[0153] The reward function is designed based on a comprehensive evaluation metric and is defined as: r = 1 - Δ, where r is the reward value and Δ is the state deviation, which represents the degree of difference between the current beam state and the target state. The smaller the state deviation, the higher the reward value, encouraging the agent to adjust the control variables to bring the beam state closer to the target state.
[0154] Step 52: Designing a neural network structure of a policy network and a value network for the reinforcement learning model to achieve mapping from state to action and evaluation of state-action pair values;
[0155] Specifically, if Figure 2 and Figure 3 The network structure diagram of the policy network and value network shown in Figure 2 is shown. The policy network uses a fully connected neural network architecture with three hidden layers. The input layer receives a 32-dimensional state vector. The first hidden layer contains 128 neurons, the second hidden layer contains 64 neurons, and the third hidden layer contains 32 neurons. The output layer contains 10 neurons, corresponding to the 10-dimensional action vector. The hidden layers use the ReLU activation function, and the output layer uses the tanh activation function to ensure that the output action values are within the range [-1, 1].
[0156] The value network also uses a fully connected neural network architecture, consisting of three hidden layers. The input layer receives the concatenation of a 32-dimensional state vector and a 10-dimensional action vector. The first hidden layer contains 128 neurons, the second hidden layer contains 64 neurons, and the third hidden layer contains 32 neurons. The output layer consists of a single neuron, representing the Q-value of each state-action pair. The hidden layers use the ReLU activation function, while the output layer does not use an activation function and directly outputs the Q-value estimate.
[0157] In a further preferred embodiment, in order to improve the training stability of the reinforcement learning model, a target network is provided for each of the policy network and the value network. The target network has the same structure as the original network, and the parameters are gradually tracked by the original network parameters through soft updating: , represents the updated network parameters, are the original network parameters, where τ is the soft update coefficient, which is set to 0.001 to ensure smooth update of the target network parameters.
[0158] Step 53: Construct an experience replay buffer for the reinforcement learning model to store historical experiences of the agent interacting with the environment;
[0159] Specifically, in the specific implementation process of the present invention, the experience playback buffer adopts a circular queue structure with a capacity of 10,000 experiences. Each experience record contains a five-tuple (s, ,r,s',done), respectively representing the current state, the action executed, the reward obtained, the next state and whether it is the terminal state.
[0160] The experience replay buffer supports uniform random sampling, which randomly selects experience samples with equal probability from the buffer to form training batches. The batch size is set to 64, and each training session randomly samples 64 experiences from the buffer to update the network parameters.
[0161] Furthermore, to balance exploration and exploitation, an ε-greedy strategy is used for action selection. Initially, the ε value is set to 1.0, and the agent randomly selects actions with 100% probability. As training progresses, the ε value decays linearly to 0.1, and the agent gradually tends to select deterministic actions output by the policy network. In practical applications, the ε value is fixed at 0.05, retaining a small amount of exploration to adapt to environmental changes.
[0162] Step 54: Optimize the policy network and value network based on the network parameter update algorithm of temporal difference learning, and train the reinforcement learning model;
[0163] Specifically, the value network's parameters are updated using a temporal difference learning method. Batches of experience (batch size 64) are sampled from the experience replay buffer and the TD target value is calculated. The value network's loss function is defined as the mean squared error, and gradient descent is used to minimize this loss function and update the value network parameters.
[0164] The parameter update of the policy network is based on the deterministic policy gradient method. The intuitive understanding of the deterministic policy gradient method is that the policy network parameters are updated in the direction that increases the Q value, thereby generating actions that can obtain higher value.
[0165] The Adam optimizer was used to update network parameters, with a learning rate of 0.001. To improve training stability, gradient clipping was employed, limiting the gradient norm to no more than 1 to prevent gradient explosion. The target network parameters tracked the original network parameters through soft updates, with an update coefficient τ set to 0.001 to ensure smooth changes in the target value.
[0166] Furthermore, the process of training the reinforcement learning model includes at least the following steps: initializing network parameters, sampling environmental interactions, storing experience, updating network parameters, and evaluating strategies.
[0167] Initializing network parameters randomly initializes the policy and value network parameters, creates a corresponding target network, and sets the target network parameters to be the same as the original network. Initializing the experience replay buffer and setting training hyperparameters such as batch size, learning rate, discount factor, and soft update coefficient.
[0168] During the environment interaction process, the current strategy interacts with the accelerator environment to collect training data. Each interaction step includes: observing the current state s, selecting an action according to the ε-greedy strategy , perform actions and observe the reward r and next state s', and convert the experience (s, ,r,s',done) is stored in the experience replay buffer.
[0169] The network parameter update is performed by randomly sampling batches of experience from the experience replay buffer, calculating the TD target value and loss function, and updating the parameters of the value network and policy network through the backpropagation algorithm. After each parameter update, the parameters of the target network are updated through a soft update method.
[0170] The strategy evaluation periodically evaluates the performance of the current strategy, calculating the average reward and state deviation. If the performance exceeds a preset threshold or reaches the maximum number of training rounds, training is stopped; otherwise, the environment interaction and parameter update process continues.
[0171] During the training of the reinforcement learning model, the ε value is gradually reduced, the proportion of random exploration is reduced, and the proportion of policy network output actions is increased. After training is completed, the parameters of the policy network and value network are saved and used for actual control tasks.
[0172] Step 55: Based on the trained reinforcement learning model, generate an adjustment strategy for the control variables and convert it into a new control variable combination;
[0173] Specifically, the generation process of the control variable combination includes a state observation stage, an action generation stage and an action conversion stage.
[0174] In the state observation stage, the state information of the current beam is collected, including beam parameters, beam envelope characteristics and beam spot shape characteristics, to construct a multidimensional feature vector.
[0175] In the action generation phase, the multidimensional feature vector is input into the policy network to generate a normalized action vector. In the actual application of the reinforcement learning model, the ε-greedy strategy is no longer used, and the output of the policy network is directly used as the action.
[0176] In the action conversion stage, the normalized action vector is converted into the actual control variable adjustment. The conversion formula is: Δc= × , where Δc represents the actual control variable adjustment, is the action vector corresponding to the action output by the policy network, is a scaling factor vector, which is set according to the adjustment range of each control variable. For example, the scaling factor of magnetic field intensity is set to 0.05T, the scaling factor of high-frequency cavity phase is set to 2°, and the scaling factor of high-frequency cavity amplitude is set to 0.02MV / m.
[0177] The final control variable combination is obtained by adding the current value of each control variable and the corresponding control variable adjustment amount: ,in, represents the final combination of control variables, Indicates the value of the current control variable. To ensure that the control variable is within a reasonable range, the calculated new control variable can also be clipped to be limited between the preset minimum and maximum values.
[0178] Example 2
[0179] like Figure 4 As shown, an accelerator beam parameter optimization system includes a real-time data collection module, an image feature extraction module, a state deviation calculation module, and a control variable update module; wherein each module is electrically connected;
[0180] A real-time data collection module obtains real-time data of the beam parameters and control variables of the accelerator beam, and sends the real-time data to the image feature extraction module and the state deviation calculation module;
[0181] an image feature extraction module, which obtains a beam profile image of the accelerator beam, extracts beam envelope features and beam spot shape features from the beam profile image using computer vision technology, and sends the beam envelope features and beam spot shape features to a state deviation calculation module;
[0182] a state deviation calculation module, which combines the beam parameters with the beam envelope characteristics and beam spot shape characteristics to construct a comprehensive evaluation index for evaluating the beam state, calculates the state deviation between the current beam and a preset target state, and sends the state deviation and the comprehensive evaluation index to the control variable update module;
[0183] The control variable updating module determines whether the current beam current meets a preset threshold according to the state deviation; if not, the control variable is adjusted through a reinforcement learning model based on the comprehensive evaluation index to generate a new control variable combination.
[0184] In addition, the parts of the above technical solutions provided in the embodiments of the present application that are consistent with the implementation principles of the corresponding technical solutions in the prior art are not described in detail to avoid excessive redundancy.
[0185] The above-described specific embodiments further illustrate the objectives, technical solutions, and beneficial effects of the present invention. It should be understood that the above description is merely a specific embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention shall be included within the scope of protection of the present invention.
[0186] The preset parameters or preset thresholds are set by those skilled in the art according to actual conditions or obtained by a large amount of data simulation.
[0187] The above embodiments are only used to illustrate the technical method of the present application but not limit the present application. Although the present application is described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical method of the present application can be modified or equivalently replaced without departing from the spirit and scope of the technical method of the present application.
Claims
1. A method for optimizing accelerator beam parameters, characterized in that: include: Step 1: Obtain real-time data of the accelerator beam parameters and control variables; Step 2: Obtain a beam profile image of the accelerator beam, and extract beam envelope features and beam spot shape features of the beam profile image using computer vision technology; Step 3: Combining the beam parameters with the beam envelope characteristics and beam spot shape characteristics, constructing a comprehensive evaluation index for evaluating the beam state, and calculating the state deviation between the current beam and a preset target state; Step 4: judging whether the current beam current meets a preset threshold value based on the state deviation; if so, no processing is performed; if not, proceeding to step 5; Step 5: Based on the comprehensive evaluation index, the control variables are adjusted through the reinforcement learning model to generate a new control variable combination.
2. The accelerator beam parameter optimization method according to claim 1, characterized in that: The beam parameters of the accelerator beam are collected in the following manner: The beam parameters are collected using a distributed data acquisition system, which includes a beam diagnostic instrument array.
3. The accelerator beam parameter optimization method according to claim 2, characterized in that: The control variables of the accelerator beam are collected in the following manner: The control variable data are obtained through the EPICS channel accessor of the accelerator control system, including the magnetic field strength of the focusing magnet and the phase and amplitude of the high-frequency cavity.
4. The accelerator beam parameter optimization method according to claim 3, characterized in that: The extracting of the beam envelope features of the beam profile image by computer vision technology includes: Step 211: Preprocessing the beam profile image captured by the fluorescent screen and the high-speed CCD camera, including noise filtering, background correction, and contrast enhancement; Step 212: performing edge detection and contour extraction on the pre-processed beam profile image to identify the outer boundary of the beam; Step 213: Calculating geometric characteristic parameters of the beam envelope based on the extracted outer boundary; Step 214: constructing a mathematical model of the beam envelope, fitting the spatial distribution model of the beam; and generating beam envelope characteristics based on the fitted spatial distribution and the geometric characteristic parameters.
5. The accelerator beam parameter optimization method according to claim 4, characterized in that: The calculation of the beam spot shape characteristics includes the following steps: Step 221: performing intensity distribution analysis on the pre-processed beam profile image to extract spatial distribution characteristics of the beam intensity; Step 222: constructing a mathematical model of the beam spot shape based on the spatial distribution characteristics of the beam intensity to fit the intensity profile of the beam; Step 223: extracting characteristic parameters of the beam spot shape, including symmetry, sharpness, smoothness, and irregularity; Step 224: Analyze the internal structural characteristics of the beam spot to identify the internal inhomogeneity and microstructure of the beam; Step 225: Combining the spatial distribution characteristics of the beam intensity, the characteristic parameters of the beam spot shape, and the internal structure characteristics, a complete beam spot shape characteristic is constructed.
6. The accelerator beam parameter optimization method according to claim 5, characterized in that: Calculating the state deviation between the current beam current and the preset target state includes the following steps: Step 31: Combining the beam parameters, the beam envelope characteristics, and the beam spot shape characteristics, constructing a multidimensional feature vector as a digital representation of the beam state; Step 32: Based on the multi-dimensional feature vector, construct a comprehensive evaluation index for evaluating the beam state through a weighted fusion algorithm; Step 33: Pre-establish a beam target state library to store target beam state parameters under different application scenarios; Step 34: Based on the comprehensive evaluation index and the target beam state parameters, calculate the state deviation between the current beam and the preset target state.
7. The accelerator beam parameter optimization method according to claim 6, characterized in that: The method of judging whether the current beam current meets the preset threshold according to the state deviation is: A preset state deviation threshold is provided. If the state deviation is greater than the preset state deviation threshold, it is determined that the preset threshold is not met; otherwise, it is determined that the preset threshold is met.
8. The accelerator beam parameter optimization method according to claim 7, characterized in that: Adjusting the control variables by using the reinforcement learning model to generate a new control variable combination includes the following steps: Step 51: Construct a reinforcement learning model based on deep deterministic policy gradient by defining the state space, action space, and reward function; Step 52: Designing a neural network structure of a policy network and a value network for the reinforcement learning model to achieve mapping from state to action and evaluation of state-action pair values; Step 53: Construct an experience replay buffer for the reinforcement learning model to store historical experiences of the agent interacting with the environment; Step 54: Optimize the policy network and value network based on the network parameter update algorithm of temporal difference learning, and train the reinforcement learning model; Step 55: Based on the trained reinforcement learning model, generate an adjustment strategy for the control variables and convert it into a new control variable combination.
9. The accelerator beam parameter optimization method according to claim 8, characterized in that: The reinforcement learning model adopts a dual-network architecture, including a policy network and a value network. The policy network is responsible for generating adjustment strategies for control variables, while the value network is responsible for evaluating the value of state-action pairs. The state space is composed of multi-dimensional feature vectors, and the action space is defined as the adjustment amount of the control variables, including the magnetic field intensity adjustment amount, the high-frequency cavity phase and amplitude adjustment amount; The reward function is designed based on a comprehensive evaluation index and is defined as: r=1-Δ, where r is the reward value and Δ is the state deviation, which indicates the degree of difference between the current beam state and the target state.
10. The accelerator beam parameter optimization method according to claim 9, characterized in that: The policy network adopts a fully connected neural network structure, including 3 hidden layers; the input layer receives a 32-dimensional state vector, the first hidden layer contains 128 neurons, the second hidden layer contains 64 neurons, the third hidden layer contains 32 neurons, and the output layer contains 10 neurons, corresponding to a 10-dimensional action vector; the hidden layer uses the ReLU activation function, and the output layer uses the tanh activation function to ensure that the output action value is in the range of [-1, 1]; The value network also adopts a fully connected neural network structure, which includes 3 hidden layers; the input layer receives the concatenation of a 32-dimensional state vector and a 10-dimensional action vector, the first hidden layer contains 128 neurons, the second hidden layer contains 64 neurons, and the third hidden layer contains 32 neurons. The output layer is a single neuron, which represents the Q value of the state-action pair; the hidden layer uses the ReLU activation function, and the output layer does not use an activation function and directly outputs the Q value estimate.
11. An accelerator beam parameter optimization system, used to implement the accelerator beam parameter optimization method according to any one of claims 1 to 10, characterized in that: It includes a real-time data collection module, an image feature extraction module, a state deviation calculation module, and a control variable update module; wherein each module is electrically connected; A real-time data collection module obtains real-time data of the beam parameters and control variables of the accelerator beam, and sends the real-time data to the image feature extraction module and the state deviation calculation module; an image feature extraction module, which obtains a beam profile image of the accelerator beam, extracts beam envelope features and beam spot shape features from the beam profile image using computer vision technology, and sends the beam envelope features and beam spot shape features to a state deviation calculation module; a state deviation calculation module, which combines the beam parameters with the beam envelope characteristics and beam spot shape characteristics to construct a comprehensive evaluation index for evaluating the beam state, calculates the state deviation between the current beam and a preset target state, and sends the state deviation and the comprehensive evaluation index to the control variable update module; The control variable updating module determines whether the current beam current meets a preset threshold according to the state deviation; if not, the control variable is adjusted through a reinforcement learning model based on the comprehensive evaluation index to generate a new control variable combination.
Citation Information
Patent Citations
Accelerator beam track control method and system based on depth reinforcement learning
CN108051999A
Adjustment method of accelerator system, accelerator system, electronic equipment and storage medium
CN120676520A