A method, apparatus, device and medium for decomposing spectral overlapping peaks
By combining APU-PSO and EM algorithms, the problems of initial parameter sensitivity and local optima in X-ray fluorescence spectroscopy overlapping peak decomposition are solved, achieving high-precision overlapping peak decomposition and improving the accuracy and reliability of the analysis results.
Patent Information
- Application Number
- CN202511488346.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-17
- Publication Date
- 2025-12-23
- Estimated Expiration
- 2045-10-17
AI Technical Summary
In existing X-ray fluorescence spectroscopy analysis, overlapping peak decomposition methods are easily affected by initial parameter sensitivity and local optima, resulting in insufficient decomposition accuracy and difficulty in accurately obtaining characteristic peak information of elements.
The particle swarm optimization algorithm with an adaptive parameter update strategy (APU-PSO) is used to perform a global search to obtain the initial parameters of the Gaussian mixture model (GMM), and then combined with the expectation-maximization algorithm (EM) for iterative optimization to optimize the parameters of each Gaussian characteristic peak.
It significantly improves the accuracy and reliability of overlapping peak decomposition, and can accurately extract the peak position, variance and weight of each Gaussian characteristic peak, providing high-quality data support and laying the foundation for qualitative and quantitative analysis of elements.
Smart Images

Figure CN120971470B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of X-ray fluorescence spectrum analysis, and in particular to a spectral overlapping peak decomposition method, device, equipment and medium. BACKGROUND
[0002] In X-ray fluorescence spectrum analysis, accurately obtaining characteristic peak information of elements is the key to realizing qualitative and quantitative analysis of the composition of a substance. However, due to the complex composition of mineral samples, the matrix effect between elements, and the resolution limitation of the instrument itself and random noise interference in the measurement process, the collected X-ray fluorescence spectrum often has a serious characteristic peak overlapping phenomenon. This overlapping can cause the key information such as the peak position and intensity of the characteristic peak to be concealed, directly affecting the identification of the element type and the accurate calculation of the content, and bringing great challenges to the practical application in the fields of geological exploration and material analysis. Therefore, effectively decomposing the overlapping peaks in the X-ray fluorescence spectrum and extracting the accurate parameters of each characteristic peak become the core link to improve the accuracy of spectrum analysis.
[0003] At present, the methods for decomposing spectral overlapping peaks mainly include curve fitting, derivative method and meta-heuristic algorithm. The curve fitting method fits the overlapping peaks by presetting a function model, but it is sensitive to the initial parameter setting and is easily affected by the degree of overlapping; the derivative method can enhance the peak position recognition ability, but it can amplify noise interference; the traditional meta-heuristic algorithm such as particle swarm optimization algorithm is prone to premature convergence when dealing with complex overlapping peaks, resulting in insufficient decomposition accuracy. At the same time, the method of combining the expectation maximization (EM) algorithm with the Gaussian mixture model (GMM) has advantages in probability modeling, but the EM algorithm is strongly dependent on the initial parameters, and if the initial value is not properly selected, it is easy to fall into local optimum, which makes it difficult to meet the decomposition requirements of serious overlapping peaks. Therefore, developing an overlapping peak decomposition method that can effectively overcome the sensitivity of initial parameters and improve the global optimization ability has become a problem to be solved in the current field. SUMMARY
[0004] Therefore, the embodiments of the present application provide a spectral overlapping peak decomposition method, device, equipment and medium, which can optimize the initial parameters of GMM through APU-PSO and combine with the EM algorithm for iterative optimization, effectively improving the accuracy and reliability of X-ray fluorescence spectrum overlapping peak decomposition, and being suitable for the decomposition of various serious overlapping spectral peaks.
[0005] The technical scheme of the embodiments of the present application is as follows:
[0006] In a first aspect, the embodiments of the present application provide a spectral overlapping peak decomposition method, which comprises:
[0007] The initial parameters are used to perform iterative optimization processing on parameters of the Gaussian mixture model by using an expectation maximization algorithm (EM) to obtain optimal parameters of the Gaussian characteristic peaks.
[0008] The optimal parameters of the Gaussian characteristic peaks are used to determine an optimal parameter set.
[0009] The optimal parameter set includes peak positions, variances, and weights of sub-peaks in total peak area of the Gaussian characteristic peaks.
[0010] In a second aspect, an embodiment of the present application further provides a spectrum overlapping peak decomposition device, and the device includes:
[0011] The initial parameters are used to perform iterative optimization processing on parameters of the Gaussian mixture model by using an expectation maximization algorithm (EM) to obtain optimal parameters of the Gaussian characteristic peaks.
[0012] The optimal parameters of the Gaussian characteristic peaks are used to determine an optimal parameter set.
[0013] The optimal parameter set includes peak positions, variances, and weights of sub-peaks in total peak area of the Gaussian characteristic peaks.
[0014] In a third aspect, an embodiment of the present application further provides an electronic device, which includes a processor, a storage medium, and a bus. The storage medium stores machine readable instructions executable by the processor. When the electronic device is running, the processor communicates with the storage medium through the bus. The processor executes the machine readable instructions to perform the spectrum overlapping peak decomposition method in any one of the first aspect.
[0015] In a fourth aspect, the embodiments of the present application further provide a computer readable storage medium, which stores a computer program. The computer program is run by a processor to execute the spectral overlapping peak decomposition method according to any one of the first aspect.
[0016] The embodiments of the present application have the following beneficial effects:
[0017] The APU-PSO algorithm is used for global search on the X-ray fluorescence spectrum overlapping peak to obtain the initial parameters of the GMM, which solves the problem that the EM algorithm is sensitive to the initial parameters and is prone to local optimization. In combination with the iterative optimization of the GMM parameters by the EM algorithm, the peak position, variance and weight of each high-frequency characteristic peak can be accurately extracted, and the precision and reliability of the overlapping peak decomposition are significantly improved. The method can be effectively applied to the decomposition of the serious overlapping peak in the X-ray fluorescence spectrum, and provides high-quality data support for subsequent element qualitative and quantitative analysis. BRIEF DESCRIPTION OF DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.
[0019] Figure 1 is a flowchart of steps S101-S103 provided by the embodiments of the present application;
[0020] Figure 2 is a flowchart of steps S201-S205 provided by the embodiments of the present application;
[0021] Figure 3 is a structural schematic diagram of the spectral overlapping peak decomposition device provided by the embodiments of the present application;
[0022] Figure 4 is a structural schematic diagram of the electronic device provided by the embodiments of the present application. DETAILED DESCRIPTION
[0023] In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. It should be understood that the drawings in the present application are only used for the purpose of description and illustration, and do not limit the scope of the present application. In addition, it should be understood that the schematic drawings are not drawn according to the actual proportions. The flowcharts used in the present application show the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowcharts can not be implemented in sequence, and the steps without logical context relationship can be reversed in sequence or implemented simultaneously. In addition, one or more other operations can be added to the flowcharts or one or more operations can be removed from the flowcharts under the guidance of the content of the present application.
[0024] In the following description, "some embodiments" are related to a subset of all possible embodiments, but it can be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments, and can be combined with each other without conflict.
[0025] In addition, the described embodiments are only some of the embodiments of the present application, not all. The components of the embodiments of the present application described and shown in the drawings herein can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the claimed present application, but only represents selected embodiments of the present application. All other embodiments obtained by those skilled in the art based on the embodiments of the present application without creative labor are within the scope of protection of the present application.
[0026] In the following description, the term "first\second\third" is only to distinguish similar objects, and does not represent a specific order of the objects. It can be understood that "first\second\third" can be interchanged in a specific order or sequence as allowed, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0027] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the presence of the features declared thereafter, but does not exclude the addition of other features.
[0028] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs. The terms used herein are for the purpose of describing the embodiments of the present application, not for limiting the present application.
[0029] Reference is made to Figure 1 , Figure 1is a flowchart of steps S101-S103 of the spectrum overlapping peak decomposition method provided by the embodiment of the present application, which will be described in combination with Figure 1 The steps S101-S103 shown will be described.
[0030] In step S101, for the X-ray fluorescence spectrum, the initial parameters of the Gaussian mixture model (GMM) are obtained by global search through the particle swarm optimization algorithm with adaptive parameter update strategy (APU-PSO). The initial parameters represent the global optimal position obtained by global search, and include the peak position, variance of each Gaussian characteristic peak in the overlapping peak, and the weight of each sub-peak in the total peak area. The Gaussian characteristic peak represents a characteristic peak in the X-ray fluorescence spectrum, and the Gaussian mixture model is used to model the overlapping peak in the X-ray fluorescence spectrum as the superposition of multiple Gaussian characteristic peaks.
[0031] The X-ray fluorescence spectrum is a spectrum formed by characteristic X-rays emitted when outer layer electrons jump to fill vacancies generated by inner layer electrons excited by X-rays. In actual measurement, the characteristic peaks in the spectrum often overlap each other due to the above interference factors. The Gaussian mixture model (GMM) is used in the embodiment of the present application to model such overlapping peaks. Because a single characteristic peak in the X-ray fluorescence spectrum can be approximated as a Gaussian peak, the overlapping peak can be regarded as the superposition of multiple Gaussian characteristic peaks. For example, for a sample containing iron and cobalt elements, the characteristic peaks of iron and cobalt elements in the X-ray fluorescence spectrum of the sample may be partially overlapped, and the overlapping peak can be represented as the superposition of the Gaussian characteristic peak of iron element and the Gaussian characteristic peak of cobalt element through GMM.
[0032] The particle swarm optimization algorithm (PSO) is a kind of optimization algorithm based on swarm intelligence, which simulates the foraging behavior of bird swarm. The traditional PSO algorithm is prone to fall into local optimum in the search process, while the APU-PSO algorithm used in the present application solves this problem by introducing an adaptive parameter update strategy.
[0033] In the decomposition of overlapping peaks for X-ray fluorescence spectroscopy, the APU-PSO algorithm first randomly initializes a group of particles, each of which represents a set of initial parameter guesses of the GMM, including the peak positions of each Gaussian feature peak in the overlapping peaks (i.e. the energy position of the characteristic peak in the spectrum, corresponding to the characteristic energy of the element), the variance (reflecting the width of the peak, related to factors such as instrument resolution), and the weight of each sub-peak in the total peak area (which has some correlation with the element content). Then, the particles search in the solution space by constantly adjusting their speed and position. During the search process, the APU-PSO algorithm adaptively adjusts parameters such as inertia weight and learning factor according to the fitness of the particles. For example, when the fitness values of the particle group tend to concentrate, indicating that it may fall into a local optimum, the inertia weight is increased, allowing the particles to have a greater chance of jumping out of the local area and enhancing the global search ability; when the particle group is more dispersed, the inertia weight is reduced, accelerating the convergence speed. At the same time, the individual learning factor decreases with the number of iterations, prompting the particles to explore the global space more; the social learning factor increases with the number of iterations, strengthening the tendency of the particles to move towards the optimal position of the group, and improving the local search accuracy. When the iteration reaches the maximum number, the global optimal position searched corresponds to the initial parameters of the GMM.
[0034] In step S102, based on the initial parameters, the parameters of the Gaussian mixture model are iteratively optimized by the expectation maximization algorithm EM, to obtain the optimal parameters of each Gaussian feature peak.
[0035] After obtaining the initial parameters of the GMM, the maximum likelihood algorithm (EM) is used for further optimization. The EM algorithm is an iterative algorithm suitable for parameter estimation of probability models containing hidden variables. In the decomposition of overlapping peaks, it is unknown which Gaussian feature peak each data point belongs to, which is the hidden variable.
[0036] The EM algorithm is divided into E step (expectation step) and M step (maximization step). In the E step, hidden variables are introduced to represent the probability of the i-th data point belonging to the k-th Gaussian peak, and the posterior probability of these hidden variables is calculated based on the current GMM parameters, i.e. the likelihood of each data point belonging to each Gaussian peak based on the existing parameter estimation. In the M step, the posterior probability obtained in the E step is weighted, and the parameters of the GMM are updated by maximizing the log-likelihood function, including recalculating the peak position of each Gaussian feature peak (obtaining a more accurate peak position estimate by weighted averaging of data points), the variance (updating based on the deviation of the weighted average data point from the peak position), and the weight (adjusting according to the proportion of the sum of the posterior probability corresponding to the Gaussian peak). Repeat the E step and the M step until the maximum number of iterations is reached, and the parameters obtained at this time are the optimal parameters of each Gaussian feature peak.
[0037] In step S103, the optimal parameter set is determined based on the optimal parameters of each high-strength characteristic peak; wherein the optimal parameter set includes the peak position, variance and weight of each sub-peak in the total peak area of each high-strength characteristic peak.
[0038] After obtaining the initial parameters by the APU-PSO algorithm and optimizing by the EM algorithm, the optimal parameters of each high-strength characteristic peak finally obtained form the optimal parameter set. The optimal parameter set includes the accurate peak position, variance and weight of each sub-peak in the total peak area of each high-strength characteristic peak. These parameters are crucial for accurate decomposition of overlapping peaks, for example, the peak position can determine the position of each element characteristic peak, the variance can reflect the peak broadening, and the weight can be used for subsequent quantitative analysis to calculate the relative content of elements.
[0039] The above method can accurately decompose complex overlapping peaks into individual high-strength characteristic peaks, providing reliable data basis for subsequent qualitative and quantitative analysis of X-ray fluorescence spectrum, greatly improving the accuracy and reliability of the analysis results, and having wide application prospects in many fields relying on X-ray fluorescence spectrum analysis such as material analysis, environmental monitoring and geological exploration.
[0040] In some embodiments, the parameter settings of the particle swarm optimization algorithm APU-PSO include: particle population size P = 50, the particle search space dimension corresponds to the parameters of the overlapping peak , the peak position of each high-strength characteristic peak in the overlapping peak is represented by , the variance is represented by , the weight of each sub-peak in the total peak area is represented by , the position of each particle represents the peak position, variance and weight of each sub-peak in the total peak area of the characteristic peak; the maximum iteration number Max_iter = 50; the maximum inertia weight w max = 0.9, the minimum inertia weight w min = 0.4; the maximum individual learning factor and the maximum social learning factor are set to 2; the minimum individual learning factor and the minimum social learning factor are set to 0.5; the maximum particle speed V max is 5, the minimum speed V min is -5.
[0041] The population size P = 50, and the population size represents the number of particles participating in the search. Setting to 50 is the result of considering the search efficiency and the diversity of solutions. Too few may result in limited search range, making it difficult to find the global optimal solution; too many will increase the amount of calculation and reduce the efficiency of the algorithm. 50 particles can ensure a certain search range and cover more possible parameter combinations, and can complete iteration within an acceptable calculation time.
[0042] The dimension is consistent with the parameter dimension of Gaussian Mixture Model (GMM), and the position of each particle corresponds to a set of GMM parameters, including the peak position, variance of each Gaussian feature peak, and the weight of each sub-peak in the total peak area, so that the search of the particle is directly aimed at the key parameters required for the decomposition of the overlapping peak, ensuring that the search target is clear.
[0043] Maximum iteration number Max_iter = 50, the iteration number determines the search depth of the algorithm. Setting it to 50 times is a balance between calculation cost under the premise of ensuring search effect. Too few iteration numbers may cause the algorithm to stop searching before finding a better solution, and too many iteration numbers will waste computing resources. 50 iterations can allow the particle to fully explore the search space and gradually approach the globally optimal initial parameters.
[0044] Maximum inertia weight w max = 0.9, minimum inertia weight w min = 0.4, the inertia weight is used to balance the global exploration and local development capabilities of the particle. A larger inertia weight (such as 0.9) makes the particle more inclined to maintain the previous speed, which is beneficial to expanding the search range, exploring new areas, and avoiding falling into local optimization. A smaller inertia weight (such as 0.4) makes the particle more susceptible to group information, speeding up the convergence to the optimal solution. By adaptively adjusting within the range of 0.4-0.9, the APU-PSO algorithm can flexibly switch between exploration and development modes according to the search state.
[0045] The maximum individual learning factor and the maximum social learning factor are 2, and the minimum individual learning factor and the minimum social learning factor are 0.5. The individual learning factor reflects the learning ability of the particle to its own historical experience, and the social learning factor reflects the learning ability of the particle to the optimal experience of the group. Setting their range to 0.5-2 allows the individual learning factor to be larger at the beginning of the search, enabling the particle to rely more on its own exploration of unknown areas. As the iteration progresses, the social learning factor increases, allowing the particle to better utilize group information for local fine search, thereby improving the efficiency and accuracy of the search.
[0046] The maximum particle speed is V max 5, and the minimum speed is V min -5, the speed limit is used to prevent the particle from rushing out of the valuable search area due to excessive speed or falling into local stagnation due to insufficient speed during the search process. A speed range of ±5 can ensure that the particle has sufficient mobility to explore different parameter combinations, while avoiding unstable search caused by excessive jumping, ensuring efficient search within a reasonable range.
[0047] In some embodiments, referring to Figure 2 , Figure 2 is a flowchart of steps S201-S205 provided by the embodiments of the present application, and the steps S201-S205 are used to obtain initial parameters of a Gaussian mixture model (GMM) through a particle swarm optimization algorithm with an adaptive parameter updating strategy (APU-PSO). The steps S201-S205 will be described in combination with each step.
[0048] In step S201, particle positions and particle velocities are randomly initialized, the fitness value of each particle is calculated based on a log-likelihood function, and the initial particle position is set as the individual historical optimal value P best After the particles are sorted according to the fitness values, the particle position corresponding to the maximum fitness value is selected as the initial global optimal position g best ;
[0049] Here, the random initialization of the particle positions and velocities is the starting point of the APU-PSO algorithm. The particle position corresponds to a set of parameters (peak position, variance, weight) of the GMM, and the velocity represents the moving trend of the particle in the parameter space. The initialization process ensures that the particles are uniformly distributed in the search space, laying a foundation for global search.
[0050] The fitness value of each particle is calculated based on a log-likelihood function, which quantifies the fitting degree of the current parameter combination to the spectral data. The greater the fitness value, the more accurately the parameter combination describes the distribution characteristics of the overlapping peaks. For example, when the Gaussian mixture model corresponding to a certain particle is highly consistent with the measured overlapping peak data, the log-likelihood value of the particle will be significantly higher than that of other particles.
[0051] The initial particle position is set as the individual historical optimal value (P0) P best , which means that each particle initially considers its own position as the current optimal solution; after the fitness values of all particles are sorted, the particle position corresponding to the maximum fitness value is selected as the initial global optimal position (P0 g best ), which determines the optimal search direction of the entire particle swarm in the initial stage, providing a reference for subsequent iterations.
[0052] In step S202, the inertia weight is adaptively adjusted according to a specific formula w When the fitness values of the particle swarm tend to be consistent, the inertia weight is increased to jump out of the local optimum, and when the particle swarm is dispersed, the inertia weight is reduced to speed up the optimization speed;
[0053] The inertia weight (w) w) is the core parameter of balancing the global exploration and local exploitation ability of particles. When the fitness value of the particle group tends to be consistent, it indicates that the algorithm may fall into local optimum, at this time, increasing the inertia weight makes the particle retain more previous motion trend, so as to have a greater probability to jump out of the local optimal area and explore new parameter space; when the particle group is dispersed, reducing the inertia weight makes the particle more susceptible to the guidance of the individual optimal and global optimal position, and speeds up the convergence to the optimal solution. This dynamic adjustment mechanism enables the APU-PSO algorithm to flexibly switch strategies according to the search state, avoiding the low efficiency caused by blind exploration, and preventing the solution precision caused by premature convergence.
[0054] In step S203, the individual learning factor c 1 and the social learning factor c 2 are adaptively updated to realize the dynamic change of the factors with the iteration process;
[0055] The adaptive update of the individual learning factor c 1 and the social learning factor c 2 realizes the dynamic change of the factors with the iteration process. The individual learning factor reflects the degree of attention of the particle to its own historical experience, and the social learning factor reflects the learning ability of the particle to the optimal experience of the group. In the early iteration, the individual learning factor is larger and the social learning factor is smaller, and the particle is more inclined to independent exploration and expands the search range; as the iteration proceeds, the individual learning factor gradually decreases and the social learning factor gradually increases, and the particle is more inclined to the optimal position of the group and performs local fine search. This change rule enables the algorithm to efficiently cover the potential optimal area in the early search stage, and accurately optimize the parameters in the later stage, thereby significantly improving the search efficiency and the quality of the final solution.
[0056] In step S204, the speed and position of the particle are updated, and the fitness value of each particle after updating is calculated, and the individual optimal position P best and the global optimal position g best are updated based on the fitness value of each particle after updating.
[0057] The speed and position of the particle are updated based on the current speed, the individual optimal position P best and the global optimal position g best . The speed update integrates the inertial motion of the particle, the learning to the individual optimal position, and the learning to the global optimal position, and the position update is determined by the current position and the new speed. This process enables the particle group to continuously adjust the motion trajectory in the parameter space and gradually approach the global optimal solution. After each update, the fitness value of each particle is recalculated, and the individual optimal position P best) and global optimal position ( g best If a particle's current fitness value is better than its historical best, then update. P best If the maximum fitness value among all particles is better than the current fitness value... g best Then update g best This "survival of the fittest" mechanism ensures that the particle swarm always evolves in a better direction.
[0058] In step S205, when the number of iterations reaches the set maximum number of iterations, the global optimal position is output. g best Global optimal position g best The peak position, variance, and weight of each sub-peak in the overlapping peaks of the corresponding X-ray fluorescence spectrum are determined.
[0059] When the number of iterations reaches the set maximum number of iterations, the algorithm stops searching and outputs the current global optimum position. g best The parameters corresponding to this position are the peak position, variance, and weight of each sub-peak in the overlapping peaks of the X-ray fluorescence spectrum, which are the initial parameters of the GMM. These parameters are globally optimized by the APU-PSO algorithm, effectively avoiding the local optimum trap that may be caused by traditional random initialization, providing a reliable starting point for the subsequent fine optimization of parameters in the EM algorithm, and are a key prerequisite for ensuring the accuracy of overlapping peak decomposition.
[0060] In some embodiments, the log-likelihood function of the complete data is:
[0061] ;
[0062] in, Y This refers to the complete data, which is the training output sample set. N This indicates the number of samples in the training set. The likelihood function representing the complete data , Z im Indicates the first i Spectral data points belong to the first m The probability of a Gaussian characteristic peak, each data point originating from... k The sum of the probabilities of the Gaussian characteristic peaks is 1, that is... .
[0063] In some embodiments, the inertia weight is adaptively adjusted. w :
[0064] ;
[0065] in, f This represents the current particle's fitness value. f avg This represents the average fitness value of the particle swarm. f min This represents the minimum fitness value of the particle swarm.
[0066] In some embodiments, individual learning factors c 1. Social learning factor c 2. Perform adaptive updates in the following ways:
[0067] ;
[0068]
[0069] in, c 1max Represents the maximum individual learning factor. c 1min Represents the smallest individual learning factor. c 2max Represents the maximum social learning factor. c 2min Represents the minimum social learning factor. iter Indicates the number of iterations.
[0070] In some embodiments, the velocity and position of the particles are updated in the following manner:
[0071] ;
[0072] .
[0073] in, For the first i The particle in the first iter The speed is increased by 1 iteration; For the first i The particle in the first iter The speed of the number of iterations; For the first i The particle in the first iter Position with +1 iteration count; For the first i The particle in the first iter The position of the next iteration number; For the first i The particle to the first iter The optimal position of the individual found up to the nth iteration; For the first i The particle to the firstiter The globally optimal position found up to the nth iteration; r 1 and r 2 is a random number in [0,1].
[0074] In some embodiments, the step of iteratively optimizing the parameters of the Gaussian mixture model using the expectation-maximization (EM) algorithm based on the initial parameters to obtain the optimal parameters for each Gaussian characteristic peak includes:
[0075] The initial parameters are used as the starting point for iteration, and latent variables are introduced. Z Latent variables Z Used to indicate overlapping peak data x N Which Gaussian characteristic peak does it belong to?
[0076] ;
[0077] in, , Indicates the first i The spectral data point belongs to the _th _th m The probability of a Gaussian characteristic peak, each data point originating from... k The sum of the probabilities of the Gaussian characteristic peaks is 1, that is... .
[0078] The complete data is represented as [ x N , Z The likelihood function of the complete data is expressed as:
[0079] ;
[0080] The log-likelihood function for the complete data is:
[0081] ;
[0082] In the E-step, the objective cost function is expressed as:
[0083] ;
[0084] in, Indicates the first t The parameter set estimated in each iteration, wherein the objective cost function is based on the posterior probabilities of the latent variables. get;
[0085] Under the parameters of the previous iteration, each sample data point x i Belongs to the m The posterior probability of a Gaussian characteristic peak r imis expressed as:
[0086] ;
[0087] In the M-step, the process of updating the GMM parameters to maximize the objective cost function is defined as:
[0088] ;
[0089] The partial derivative of the cost function with respect to the GMM parameters is taken and set to zero to obtain the new iteration values of each parameter, thereby completing the M step; wherein the iterative estimation formula of the peak position , variance and weight of each high-strength peak to the total peak area is respectively expressed as:
[0090] ;
[0091] ;
[0092] ;
[0093] When the number of iterations reaches the set maximum number of iterations, the optimal parameters of each high-strength peak are output.
[0094] In summary, the embodiments of the present application have the following beneficial effects:
[0095] (1) Improve the accuracy and reliability of parameter analysis.
[0096] The traditional EM algorithm is sensitive to initial parameters. If the initial value is not properly selected, it is easy to fall into local optimum, resulting in that the decomposition result of overlapping peaks deviates from the true characteristics. The embodiments of the present application introduce APU-PSO algorithm for global search to provide high-quality initial parameters for the EM algorithm. APU-PSO adjusts the inertia weight, individual learning factor and social learning factor adaptively, which can increase the inertia weight to jump out of the local optimum when the fitness of the particle swarm tends to be the same, and can reduce the inertia weight to accelerate convergence when the particles are dispersed, and balances the global exploration and local development ability through the dynamic change of the learning factor. This optimization mechanism ensures that the initial parameters searched are closer to the global optimal solution, lays a foundation for accurate iteration of the EM algorithm, and finally significantly improves the accuracy and reliability of the analysis of overlapping peak parameters (peak position, variance, weight). Even for severely overlapping peaks with very small energy difference, accurate separation can be achieved.
[0097] (2) Overcome the defects of traditional optimization algorithms and enhance stability and efficiency.
[0098] The standard particle swarm optimization algorithm (PSO) often has premature convergence when dealing with complex optimization problems due to fixed parameters, which leads to search into local optimum and cannot find the global optimum solution. The APU-PSO algorithm proposed in the embodiments of the present application overcomes this defect by using a parameter adaptive updating strategy to dynamically adjust the inertia weight and the learning factor. In the search process, the particle swarm can not only maintain sufficient diversity to explore a wider solution space, but also quickly converge when approaching the optimal solution, greatly improving the stability and search efficiency of the algorithm. Compared with PSO, APU-PSO can find better initial parameters faster under the same number of iterations, reducing invalid calculations and saving time and cost for subsequent parameter optimization of the EM algorithm.
[0099] (3) Strong universality, suitable for multi-scenario spectral analysis.
[0100] The embodiments of the present application combine the probability modeling capability of GMM with the optimization capability of APU-PSO and EM algorithm to form a general overlapping peak decomposition framework. It is not only suitable for X-ray fluorescence spectrum, but also for other spectral analysis scenarios (such as Raman spectrum, fluorescence spectrum, etc.) that have peak overlap problems. By adjusting the parameter dimension and range of the Gaussian mixture model according to the specific spectral characteristics, effective decomposition can be achieved. In practical applications, whether it is mineral composition analysis in mine resource exploration, pollutant detection in environmental monitoring, or material quality control in industrial production, this method can accurately extract the feature information in the overlapping peaks, providing reliable data support for qualitative and quantitative analysis of material composition, and showing strong universality and scalability.
[0101] Based on the same inventive concept, the embodiments of the present application also provide a spectral overlapping peak decomposition device corresponding to the spectral overlapping peak decomposition method in the first embodiment. Since the principle of solving problems in the device is similar to the above-mentioned spectral overlapping peak decomposition method, the implementation of the device can be referred to the implementation of the method, and the repeated parts will not be described again.
[0102] As shown in Figure 3 , the structure schematic diagram of the spectral overlapping peak decomposition device 300 provided by the embodiments of the present application is shown in Figure 3 . The spectral overlapping peak decomposition device 300 includes:
[0103] The acquisition module 301 is used to perform a global search on the X-ray fluorescence spectrum using a particle swarm optimization algorithm (APU-PSO) with an adaptive parameter update strategy to obtain the initial parameters of a Gaussian mixture model (GMM). The initial parameters represent the globally optimal position obtained through the global search, and include the peak position, variance, and weight of each sub-peak relative to the total peak area of the overlapping peaks. The Gaussian characteristic peaks represent the characteristic peaks in the X-ray fluorescence spectrum, and the Gaussian mixture model is used to model the overlapping peaks in the X-ray fluorescence spectrum as a superposition of multiple Gaussian characteristic peaks.
[0104] The iteration module 302 is used to iteratively optimize the parameters of the Gaussian mixture model based on the initial parameters using the expectation-maximization algorithm (EM) to obtain the optimal parameters of each Gaussian characteristic peak.
[0105] The determination module 303 is used to determine the optimal parameter set based on the optimal parameters of each Gaussian characteristic peak; wherein, the optimal parameter set includes the peak position, variance and weight of each sub-peak in the total peak area of each Gaussian characteristic peak.
[0106] Those skilled in the art should understand that Figure 3 The functions of each unit in the spectral overlapping peak decomposition device 300 shown can be understood by referring to the relevant description of the aforementioned spectral overlapping peak decomposition method. Figure 3 The functions of each unit in the spectral overlap peak decomposition device 300 shown can be implemented by a program running on a processor or by specific logic circuits.
[0107] In one possible implementation, the parameter settings of the particle swarm optimization algorithm APU-PSO include: particle population size P=50, and the particle search space dimension corresponding to the overlapping peak parameter. The peak positions of each Gaussian characteristic peak in the overlapping peaks are based on In other words, variance is expressed as... This indicates that the weight of each sub-peak in the total peak area is... This indicates that the position of each particle represents the peak position, variance, and weight of each sub-peak relative to the total peak area; the maximum number of iterations. Max_iter =50; Maximum inertia weight w max =0.9, minimum inertia weight w min =0.4; the maximum individual learning factor and maximum social learning factor are set to 2; the minimum individual learning factor and minimum social learning factor are set to 0.5; the maximum particle velocity is V max The value is 5, and the minimum speed is V min It is -5.
[0108] In a possible implementation, the acquisition module 301 performs global search by using a particle swarm optimization algorithm with an adaptive parameter update strategy (APU-PSO) to acquire initial parameters of a Gaussian mixture model (GMM), including:
[0109] Randomly initializing to generate particle positions and particle velocities, calculating fitness values of each particle based on a log-likelihood function, and setting initial particle positions as individual historical optimal values P best After sorting the particle fitness values, selecting a particle position corresponding to a maximum fitness value as an initial global optimal position g best ;
[0110] Adaptive adjustment of an inertia weight according to a specific formula w When the particle swarm fitness values tend to be consistent, the inertia weight is increased to jump out of a local optimum, and when the particle swarm is dispersed, the inertia weight is reduced to accelerate the optimization speed
[0111] Adaptive update of an individual learning factor c 1 and a social learning factor c 2 to achieve dynamic changes of the factors with an iteration process
[0112] Updating the particle velocities and positions, calculating fitness values of the updated particles, and updating individual optimal positions based on the fitness values of the updated particles P best and a global optimal position g best ;
[0113] When the number of iterations reaches a set maximum number of iterations, outputting the global optimal position g best the global optimal position g best The peak position, variance, and weight of each high-strength peak in the X-ray fluorescence spectrum overlapping peak.
[0114] In a possible implementation, the log-likelihood function of the complete data is:
[0115] ;
[0116] wherein, Y represents the complete data, and the complete data is a training output sample set, N represents the number of training set samples, represents a likelihood function of the complete data , Z im represents the m-th i spectral data point belongs to the i-thm The probability of each data point being the source of the highest feature peak is summed to 1, i.e. k . .
[0117] In one possible implementation, the inertia weight w :
[0118] ;
[0119] wherein, f denotes the fitness value of the current particle, f avg denotes the average fitness value of the particle swarm, f min denotes the minimum fitness value of the particle swarm.
[0120] In one possible implementation, the individual learning factor c 1 and the social learning factor c 2 are adaptively updated by:
[0121] ;
[0122]
[0123] wherein, c 1max denotes the maximum individual learning factor, c 1min denotes the minimum individual learning factor, c 2max denotes the maximum social learning factor, c 2min denotes the minimum social learning factor, iter denotes the number of iterations.
[0124] In one possible implementation, the velocity and position of the particle are updated by:
[0125] ;
[0126] .
[0127] wherein, is the velocity of the i-th particle at the j-th iteration number; i is the velocity of the i-th particle at the j-th iteration number; iter is the velocity of the i-th particle at the j-th iteration number; is the velocity of the i-th particle at the j-th iteration number; i is the velocity of the i-th particle at the j-th iteration number; iter is the velocity of the i-th particle at the j-th iteration number; is the velocity of the i-th particle at the j-th iteration number; i is the velocity of the i-th particle at the j-th iteration number; iterPosition with +1 iteration count; For the first i The particle in the first iter The position of the next iteration number; For the first i The particle to the first iter The optimal position of the individual found up to the nth iteration; For the first i The particle to the first iter The globally optimal position found up to the nth iteration; r 1 and r 2 is a random number in [0,1].
[0128] In one possible implementation, the iteration module 302, based on the initial parameters, iteratively optimizes the parameters of the Gaussian mixture model using the expectation-maximization (EM) algorithm to obtain the optimal parameters for each Gaussian characteristic peak, including:
[0129] The initial parameters are used as the starting point for iteration, and latent variables are introduced. Z Latent variables Z Used to indicate overlapping peak data x N Which Gaussian characteristic peak does it belong to?
[0130] ;
[0131] in, , Indicates the first i The spectral data point belongs to the _th _th m The probability of a Gaussian characteristic peak, each data point originating from... k The sum of the probabilities of the Gaussian characteristic peaks is 1, that is... .
[0132] The complete data is represented as [ x N , Z The likelihood function of the complete data is expressed as:
[0133] ;
[0134] The log-likelihood function for the complete data is:
[0135] ;
[0136] In the E-step, the objective cost function is expressed as:
[0137] ;
[0138] in, Indicates the firstt a parameter set estimated in the last iteration, the target cost function is based on calculating the posterior probability of the latent variable obtained;
[0139] each sample data point under the parameters in the last iteration x i the posterior probability of the i-th Gaussian characteristic peak m r im is expressed as:
[0140]
[0141] In the M-step, the process of maximizing the target cost function to update the GMM parameters is defined as:
[0142]
[0143] The partial derivative of the cost function with respect to the GMM parameters is taken and set to 0 to obtain a new round of iteration values of each parameter, thereby completing the M step; wherein the iteration estimation formula of the peak position of each Gaussian characteristic peak , the variance and the weight of the Gaussian characteristic peak in the total peak area are respectively expressed as:
[0144]
[0145]
[0146]
[0147] When the number of iterations reaches the set maximum number of iterations, the optimal parameters of each Gaussian characteristic peak are output.
[0148] The above spectral overlapping peak decomposition device has the following beneficial effects:
[0149] (1) Improve the parameter analysis accuracy and reliability.
[0150] Traditional EM algorithms are highly sensitive to initial parameters. Inappropriate initial values can easily lead to local optima, causing the decomposition results of overlapping peaks to deviate from the true characteristics. This application introduces the APU-PSO algorithm for global search, providing high-quality initial parameters for the EM algorithm. APU-PSO adaptively adjusts inertia weights, individual learning factors, and social learning factors. This allows it to increase inertia weights to escape local optima when particle swarm fitness converges, and decrease inertia weights to accelerate convergence when particles disperse. Simultaneously, the dynamic change of the learning factors balances global exploration and local exploitation capabilities. This optimization mechanism ensures that the searched initial parameters are closer to the global optimum, laying the foundation for accurate iteration of the EM algorithm. Ultimately, it significantly improves the accuracy and reliability of overlapping peak parameter (peak position, variance, weight) analysis, achieving accurate separation even for severely overlapping peaks with minimal energy differences.
[0151] (2) Overcome the defects of traditional optimization algorithms and enhance stability and efficiency.
[0152] Standard Particle Swarm Optimization (PSO) algorithms often suffer from premature convergence when dealing with complex optimization problems due to fixed parameters, leading to local optima and preventing the search from finding the global optimum. The APU-PSO algorithm proposed in this application overcomes this deficiency by dynamically adjusting the inertia weights and learning factors through an adaptive parameter update strategy. During the search process, the particle swarm maintains sufficient diversity to explore a wider solution space while converging quickly near the optimal solution, significantly improving the algorithm's stability and search efficiency. Compared to PSO, APU-PSO can find better initial parameters faster with the same number of iterations, reducing unnecessary computations and saving time for subsequent parameter optimization in the EM algorithm.
[0153] (3) It has strong universality and is applicable to spectral analysis in multiple scenarios.
[0154] This application combines the probabilistic modeling capabilities of Gaussian Mixture Models (GMMs) with the optimization capabilities of APU-PSO and EM algorithms to form a universal framework for decomposing overlapping peaks. It is applicable not only to X-ray fluorescence spectroscopy but also to other spectral analysis scenarios with peak overlap problems (such as Raman spectroscopy and fluorescence spectroscopy). Effective decomposition can be achieved simply by adjusting the parameter dimensions and range of the Gaussian mixture model according to the specific spectral characteristics. In practical applications, whether it's mineral composition analysis in mining resource exploration, pollutant detection in environmental monitoring, or material quality control in industrial production, this method can accurately extract characteristic information from overlapping peaks, providing reliable data support for qualitative and quantitative analysis of material composition, demonstrating strong versatility and scalability.
[0155] like Figure 4 As shown, Figure 4A constituent structure schematic diagram of an electronic device 400 provided by an embodiment of the present application is provided, and the electronic device 400 comprises:
[0156] A processor 401, a storage medium 402, and a bus 403, the storage medium 402 stores machine readable instructions executable by the processor 401, when the electronic device 400 is running, the processor 401 and the storage medium 402 communicate through the bus 403, and the processor 401 executes the machine readable instructions to perform the steps of the spectrum overlapping peak decomposition method described in the embodiment of the present application.
[0157] In actual application, each component in the electronic device 400 is coupled together through the bus 403. It can be understood that the bus 403 is used to realize the connection and communication between the components. The bus 403 includes not only a data bus, but also a power bus, a control bus, and a state signal bus. However, in order to clearly illustrate, all kinds of buses are marked as the bus 403 in the Figure 4 .
[0158] The above electronic device has the following beneficial effects:
[0159] (1) Improve the parameter analysis accuracy and reliability.
[0160] The traditional EM algorithm is sensitive to the initial parameters. If the initial value is not properly selected, it is easy to fall into local optimum, which leads to the deviation of the overlapping peak decomposition result from the true characteristics. The APU-PSO algorithm is introduced in the embodiment of the present application to perform global search and provide high-quality initial parameters for the EM algorithm. The APU-PSO algorithm adjusts the inertia weight, individual learning factor and social learning factor adaptively, which can increase the inertia weight to jump out of the local optimum when the particle swarm fitness tends to increase, and can reduce the inertia weight to accelerate the convergence when the particles are scattered. At the same time, the dynamic change of the learning factor balances the global exploration and local development ability. This optimization mechanism ensures that the initial parameters searched are closer to the global optimal solution, lays a foundation for accurate iteration of the EM algorithm, and finally significantly improves the accuracy and reliability of the overlapping peak parameter (peak position, variance, weight) analysis. Even for the severely overlapping peaks with very small energy difference, accurate separation can also be achieved.
[0161] (2) Overcome the defects of traditional optimization algorithm, enhance stability and efficiency.
[0162] The standard particle swarm optimization algorithm (PSO) often appears premature convergence due to fixed parameters when dealing with complex optimization problems, which leads to search into local optimum and cannot find the global optimum solution. The APU-PSO algorithm proposed in the embodiments of the present application effectively overcomes this defect through the parameter adaptive updating strategy to dynamically adjust the inertia weight and the learning factor. In the search process, the particle swarm can not only maintain sufficient diversity to explore a wider solution space, but also quickly converge when approaching the optimal solution, greatly improving the stability and search efficiency of the algorithm. Compared with PSO, APU-PSO can find better initial parameters faster under the same number of iterations, reduces invalid calculations, and saves time cost for subsequent parameter optimization of the EM algorithm.
[0163] (3) Strong universality, suitable for multi-scenario spectral analysis.
[0164] The embodiments of the present application combine the probability modeling capability of GMM with the optimization capability of APU-PSO and EM algorithm to form a general overlapping peak decomposition framework. Not only suitable for X-ray fluorescence spectrum, but also for other spectral analysis scenarios (such as Raman spectrum, fluorescence spectrum, etc.) that have peak overlapping problems, as long as the parameter dimension and range of the Gaussian mixture model are adjusted according to the specific spectral characteristics, effective decomposition can be realized. In practical applications, whether it is mineral composition analysis in mine resource exploration, pollutant detection in environmental monitoring, or material quality control in industrial production, this method can accurately extract the feature information in the overlapping peaks, providing reliable data support for qualitative and quantitative analysis of material composition, and showing strong universality and scalability.
[0165] The embodiments of the present application also provide a computer readable storage medium, which stores executable instructions, when the executable instructions are executed by at least one processor 401, the spectral overlapping peak decomposition method described in the embodiments of the present application is realized.
[0166] In some embodiments, the storage medium can be a ferromagnetic random access memory (FRAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a flash memory, a magnetic surface memory, an optical disc, a compact disc read-only memory (CD-ROM), or the like; or can be various devices including one or any combination of the above memories.
[0167] In some embodiments, the executable instructions can take the form of a program, software, software modules, scripts, or code, written in any form of programming language, including compiled or interpreted languages, or declarative or procedural languages, and can be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
[0168] By way of example, the executable instructions can, but need not, correspond to a file in a file system, can be stored in a part of a file that holds other programs or data, for example, one or more scripts stored in a hypertext markup language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files, for example, files that store one or more modules, sub programs, or portions of code.
[0169] By way of example, the executable instructions can be deployed to be executed on one computer, or on multiple computers that are located at one site, or that are distributed across multiple sites and that are interconnected by a communication network.
[0170] The computer-readable storage medium described above has the following beneficial effects:
[0171] (1) Improving the parameter analysis accuracy and reliability.
[0172] The traditional EM algorithm is sensitive to initial parameters. If the initial value is not properly selected, it is easy to fall into local optimization, resulting in that the decomposition result of overlapping peaks deviates from the true characteristics. Embodiments of the present application introduce APU-PSO algorithm for global search, and provide high-quality initial parameters for the EM algorithm. APU-PSO can increase the inertia weight to jump out of the local optimum when the fitness of the particle swarm tends to increase, and can reduce the inertia weight to accelerate convergence when the particles are dispersed. At the same time, the dynamic change of the learning factor balances the global exploration and local development ability. This optimization mechanism ensures that the initial parameters searched are closer to the global optimal solution, lays a foundation for accurate iteration of the EM algorithm, and finally significantly improves the accuracy and reliability of the analysis of overlapping peak parameters (peak position, variance, weight). Even for severely overlapping peaks with very small energy difference, accurate separation can be achieved.
[0173] (2) Overcome the defects of traditional optimization algorithms, enhance stability and efficiency.
[0174] The standard particle swarm optimization algorithm (PSO) often appears premature convergence when dealing with complex optimization problems due to fixed parameters, which leads to search into local optimum and cannot find the global optimal solution. The APU-PSO algorithm proposed in embodiments of the present application dynamically adjusts the inertia weight and learning factor through parameter adaptive updating strategy, effectively overcoming this defect. In the search process, the particle swarm can not only maintain sufficient diversity to explore a wider solution space, but also quickly converge when approaching the optimal solution, greatly improving the stability and search efficiency of the algorithm. Compared with PSO, APU-PSO can find better initial parameters faster under the same number of iterations, reducing invalid calculations and saving time and cost for subsequent parameter optimization of the EM algorithm.
[0175] (3) Strong universality, suitable for multiple scene spectral analysis.
[0176] Embodiments of the present application combine the probability modeling ability of GMM with the optimization ability of APU-PSO and EM algorithm, forming a general overlapping peak decomposition framework. It is not only suitable for X-ray fluorescence spectrum, but also for other spectral analysis scenes (such as Raman spectrum, fluorescence spectrum, etc.) that have peak overlapping problems. By adjusting the parameter dimension and range of the Gaussian mixture model according to the specific spectral characteristics, effective decomposition can be achieved. In practical applications, whether it is mineral composition analysis in mine resource exploration, pollutant detection in environmental monitoring, or material quality control in industrial production, this method can accurately extract the characteristic information in overlapping peaks, providing reliable data support for qualitative and quantitative analysis of material composition, and showing strong universality and scalability.
[0177] In several embodiments provided in the present application, it should be understood that the disclosed method and electronic device can be implemented by other manners. The above-described device embodiments are merely illustrative, for example, the division of the units is merely a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed components can be through some interfaces, indirect coupling or communication connection of the devices or units, which can be electrical, mechanical or other forms.
[0178] The modules described as separate components can or can not be physically separate, and the components shown as modules can or can not be physical units, i.e., can be located in one place or distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the present embodiment.
[0179] In addition, the functional units in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit.
[0180] The functions, if realized in the form of software function units and sold or used as independent products, can be stored in a non-volatile computer readable storage medium executable by a processor. Based on this understanding, the technical solutions of the present application essentially or the part of the prior art or the part of the technical solutions of the present application can be embodied in the form of software products, and the computer software product is stored in a storage medium, including a plurality of instructions for making a computer device (which can be a personal computer, a platform server, or a network device, etc.) execute all or part of the steps of the method described in each embodiment of the present application. The foregoing storage medium includes: U disk, mobile hard disk, ROM, RAM, magnetic disk or optical disk and various program code storage media.
[0181] The above is merely a specific embodiment of the present application, but the protection scope of the present application is not limited thereto, any person skilled in the art can easily think of changes or replacements within the technical scope disclosed in the present application, which should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A method of spectral overlapping peak decomposition, characterized by, The method comprises: For X-ray fluorescence spectrum, initial parameters of a Gaussian mixture model GMM are obtained through global search by a particle swarm optimization algorithm APU-PSO with an adaptive parameter updating strategy, wherein the initial parameters represent a global optimal position obtained through global search, and the initial parameters comprise peak positions, variances of each Gaussian characteristic peak in an overlapping peak, and weights of each sub-peak in a total peak area, the Gaussian characteristic peak represents a characteristic peak in the X-ray fluorescence spectrum, and the Gaussian mixture model is used for modeling the overlapping peak in the X-ray fluorescence spectrum as superposition of multiple Gaussian characteristic peaks; Based on the initial parameters, optimal parameters of each Gaussian characteristic peak are obtained through iterative optimization processing of parameters of the Gaussian mixture model by an expectation maximization algorithm EM; An optimal parameter set is determined based on the optimal parameters of each Gaussian characteristic peak, wherein the optimal parameter set comprises the peak positions, the variances of each Gaussian characteristic peak, and the weights of each sub-peak in the total peak area; The parameter setting of the particle swarm optimization algorithm APU-PSO includes: particle population size P=50, the particle search space dimension corresponds to the parameters of the overlapping peak , the peak position of each high characteristic peak in the overlapping peak is represented by , the variance is represented by , the weight of each sub-peak in the total peak area is represented by , the position of each particle represents the peak position, variance and weight of each sub-peak in the total peak area; the maximum iteration number Max_iter=50; the maximum inertia weight w max =0.9, the minimum inertia weight w min =0.4; the maximum individual learning factor and the maximum social learning factor are set to 2; the minimum individual learning factor and the minimum social learning factor are set to 0.5; the maximum particle speed V max is 5, and the minimum speed V min is -5; The global search by the particle swarm optimization algorithm APU-PSO with the adaptive parameter updating strategy to obtain the initial parameters of the Gaussian mixture model GMM comprises: Randomly initialize to generate particle position and particle velocity, calculate the fitness value of each particle based on the log-likelihood function, set the initial particle position as the individual historical optimal value P best After sorting the particle fitness value, select the particle position corresponding to the maximum fitness value as the initial global optimal position g best ; Adaptive adjustment of inertia weight according to specific formula w Increasing the inertia weight when the particle swarm fitness value tends to be consistent to jump out of local optimum, and decreasing the inertia weight when the particle swarm is dispersed to accelerate the optimization speed Adaptive updating of individual learning factors c 1 and social learning factors c 2 to enable dynamic changes of the factors over the iteration process; updating the velocity and position of the particles and calculating the fitness value of each particle after the updating, and updating the individual optimal position based on the fitness value of each particle after the updating P best and the global optimal position g best ; output the global optimal position when the number of iterations reaches the set maximum number of iterations g best the global optimal position g best the peak position, variance and weight of each high-order characteristic peak in the X-ray fluorescence spectrum overlapping peak The log-likelihood function of complete data is: ; in, Y This refers to the complete data, which is the training output sample set. N This indicates the number of samples in the training set. The likelihood function representing the complete data , Z im Indicates the first i Spectral data points belong to the first m The probability of a Gaussian characteristic peak, each data point originating from... k The sum of the probabilities of the Gaussian characteristic peaks is 1, that is... ; the inertial weight w : ; wherein, f denotes the fitness value of the current particle, f avg denotes the average fitness value of the swarm of particles, f min denotes the minimum fitness value of the swarm of particles; said individual learning factor c 1 and social learning factor c 2 is adaptively updated by ; wherein, c 1max denotes a maximum individual learning factor, c 1min denotes a minimum individual learning factor, c 2max denotes a maximum social learning factor, c 2min denotes a minimum social learning factor, iter denotes the number of iterations; The velocity and position of the particle are updated in the following manner: ; ; in, For the first i The particle in the first iter The speed is increased by 1 iteration; For the first i The particle in the first iter The speed of the number of iterations; For the first i The particle in the first iter Position with +1 iteration count; For the first i The particle in the first iter The position of the next iteration number; For the first i The particle to the first iter The optimal position of the individual found up to the nth iteration; For the first i The particle to the first iter The globally optimal position found up to the nth iteration; r 1 and r 2 is a random number in [0,1].
2. The method of claim 1, wherein, The optimal parameters of each Gaussian characteristic peak are obtained through the iterative optimization processing of the parameters of the Gaussian mixture model by the expectation maximization algorithm EM based on the initial parameters, which comprises: using the initial parameters as a starting point for iteration and introducing a latent variable Z , the latent variable Z for indicating overlapping peak data x N which high resolution peak belongs to; ; wherein, , denotes the probability that the i th spectral data point belongs to the m th Gaussian peak, the sum of the probabilities of each data point originating from k th Gaussian peak is 1, i.e. ; The complete data is denoted as x N , Z The likelihood function of the complete data is denoted as: ; The log-likelihood function of complete data is: ; In the E-step, the target cost function is represented as: ; wherein, denotes the parameter set of the t l-th iteration, the target cost function is based on the computation of the posterior probability of the latent variables ; Under the parameters of the previous iteration, each sample data point x i Belongs to the m The posterior probability of a Gaussian characteristic peak r im Represented as: ; In the M-step, the process of updating the GMM parameters by maximizing the target cost function is defined as: ; The partial derivative of the cost function with respect to the GMM parameters is taken and set to zero to obtain a new iteration value of each parameter, thereby completing the M step; wherein the iteration estimation formula of the peak position , variance and weight of the high-strength characteristic peak in the total peak area of each high-strength characteristic peak is respectively represented as: ; ; ; When the number of iterations reaches a set maximum number of iterations, the optimal parameters of each Gaussian characteristic peak are output.
3. A spectral overlap peak decomposition apparatus, characterized by, The device comprises: An acquisition module is configured to, for X-ray fluorescence spectrum, obtain initial parameters of a Gaussian mixture model GMM through global search by a particle swarm optimization algorithm APU-PSO with an adaptive parameter updating strategy, wherein the initial parameters represent a global optimal position obtained through global search, and the initial parameters comprise peak positions, variances of each Gaussian characteristic peak in an overlapping peak, and weights of each sub-peak in a total peak area, the Gaussian characteristic peak represents a characteristic peak in the X-ray fluorescence spectrum, and the Gaussian mixture model is used for modeling the overlapping peak in the X-ray fluorescence spectrum as superposition of multiple Gaussian characteristic peaks; The parameter setting of the particle swarm optimization algorithm APU-PSO includes: particle population size P=50, the particle search space dimension corresponds to the parameters of the overlapping peak , the peak position of each high characteristic peak in the overlapping peak is represented by , the variance is represented by , the weight of each sub-peak in the total peak area is represented by , the position of each particle represents the peak position of the characteristic peak, the variance, and the weight of each sub-peak in the total peak area; the maximum iteration number Max_iter=50; the maximum inertia weight w max =0.9, the minimum inertia weight w min =0.4; the maximum individual learning factor and the maximum social learning factor are set to 2; the minimum individual learning factor and the minimum social learning factor are set to 0.5; the maximum particle speed V max is 5, and the minimum speed V min is -5; The global search by the particle swarm optimization algorithm APU-PSO with the adaptive parameter updating strategy to obtain the initial parameters of the Gaussian mixture model GMM comprises: Randomly initialize to generate particle position and particle velocity, calculate the fitness value of each particle based on the log-likelihood function, set the initial particle position as the individual historical optimal value P best After sorting the particle fitness value, select the particle position corresponding to the maximum fitness value as the initial global optimal position g best ; Adaptive adjustment of inertia weight according to specific formula w Increasing the inertia weight when the particle swarm fitness values tend to be consistent to jump out of local optimum, and decreasing the inertia weight when the particle swarm is dispersed to accelerate the optimization speed Adaptive updating of individual learning factors c 1 and social learning factors c 2 to enable dynamic changes of the factors over the iteration process; updating the velocity and position of the particles and calculating the fitness value of each particle after the updating, and updating the individual optimal position based on the fitness value of each particle after the updating P best and the global optimal position g best ; output the global optimal position when the number of iterations reaches the set maximum number of iterations g best the global optimal position g best the peak position, variance and weight of each high-order characteristic peak in the X-ray fluorescence spectrum overlapping peak The log-likelihood function of complete data is: ; wherein, Y represents the complete data, the complete data being a training output sample set, N represents the number of training set samples, represents a likelihood function of the complete data , Z im represents the th i probability that a spectral data point belongs to the th m Gaussian feature peak, each data point being derived from k the sum of the probabilities that a data point belongs to the th Gaussian feature peak is 1, i.e. the inertial weight w : ; wherein, f denotes the fitness value of the current particle, f avg denotes the average fitness value of the particle swarm, f min denotes the minimum fitness value of the particle swarm; said individual learning factor c 1 and social learning factor c 2 is adaptively updated by ; wherein, c 1max represents the maximum individual learning factor, c 1min represents the minimum individual learning factor, c 2max represents the maximum social learning factor, c 2min represents the minimum social learning factor, iter represents the number of iterations; The velocity and position of the particle are updated in the following manner: ; ; in, For the first i The particle in the first iter The speed is increased by 1 iteration; For the first i The particle in the first iter The speed of the number of iterations; For the first i The particle in the first iter Position with +1 iteration count; For the first i The particle in the first iter The position of the next iteration number; For the first i The particle to the first iter The optimal position of the individual found up to the nth iteration; For the first i The particle to the first iter The globally optimal position found up to the nth iteration; r 1 and r 2 is a random number in the range [0,1]. An iteration module is configured to, based on the initial parameters, obtain optimal parameters of each Gaussian characteristic peak through iterative optimization processing of parameters of the Gaussian mixture model by an expectation maximization algorithm EM. The determining module is configured to determine an optimal parameter set based on the optimal parameters of the high characteristic peaks, wherein the optimal parameter set comprises peak positions, variances of the high characteristic peaks, and weights of sub-peaks in total peak areas.
4. An electronic device, comprising: The method comprises the following steps: A processor, a storage medium, and a bus, wherein the storage medium stores machine readable instructions executable by the processor, the processor and the storage medium communicate through the bus when the electronic device is running, and the processor executes the machine readable instructions to perform the spectral overlapping peak decomposition method according to any one of claims 1 to 2.
Citation Information
Patent Citations
Particle swarm optimization based spectral overlapping peak decomposition method
CN107871155A
Grey wolf optimization algorithm based on clustering multi-strategy ensemble learning
CN117808033A