Nickel-based alloy element spectrum library construction method based on neural network, equipment and medium
Through the neural network-based nickel-based alloy element spectrum library construction method, the experimental energy spectrum and simulated energy spectrum are used to train the neural network model to solve the high-precision problem of online detection of nickel-based alloys in aviation materials, realize the accurate spectrum library construction of the full element range, and improve the detection accuracy and reliability.
Patent Information
- Application Number
- CN202510718904.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2025-09-16
AI Technical Summary
In the online detection of nickel-based alloys in the field of aviation materials, traditional spectral library construction methods are limited by small sample mass, weak γ signal, and low signal-to-noise ratio, making it difficult to achieve high-precision detection.
A neural network-based nickel-based alloy element spectrum library construction method is adopted. The neural network model is trained by obtaining the experimental energy spectrum, the first simulated energy spectrum, the second simulated energy spectrum to be corrected and the corresponding element content data of the nickel-based alloy. The training set is expanded using the data enhancement algorithm, and the neural network model is trained in stages. Finally, the second simulated energy spectrum is corrected to construct a complete and accurate spectrum library.
The accuracy and reliability of neutron composition detection have been improved, a complete and accurate spectral library covering the entire element range has been built, and the problem of constructing a spectral library for nickel-based alloys under low signal-to-noise ratio has been solved.
Smart Images

Figure CN120656601A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of material composition, and specifically provides a method, device and medium for constructing a nickel-based alloy element spectrum library based on a neural network. Background Art
[0002] Prompt gamma-ray neutron activation analysis (PGNAA) has important applications in industrial online material composition detection. The least squares method based on the spectral library is one of its core analysis methods, and the accuracy of the spectral library directly determines the accuracy of the detection results. At present, the construction of spectral libraries for bulk materials such as cement and coal relies on experimental measurements or Monte Carlo simulations. Thanks to the characteristics of large sample volume and strong effective signal, its accuracy can meet industrial needs. However, in the online detection of nickel-based alloys in the field of aviation materials, due to the limitations of small sample mass (less than 200 grams), weak gamma signal, low signal-to-interference ratio and other problems, traditional spectral library construction methods are difficult to achieve high-precision detection, and targeted solutions are urgently needed.
[0003] Accordingly, the art needs a new solution for constructing an elemental spectral library of nickel-based alloys to solve the above problems. Summary of the Invention
[0004] In order to overcome the above-mentioned defects, the present application is proposed to provide a solution or at least partially solve the technical problem of insufficient accuracy of the nickel-based alloy element spectrum library constructed by the existing method.
[0005] In a first aspect, the present application provides a method for constructing a nickel-based alloy element spectrum library based on a neural network, the method comprising: obtaining an experimental energy spectrum, a first simulated energy spectrum, a second simulated energy spectrum to be corrected, and corresponding element content data of the nickel-based alloy; using the experimental energy spectrum, the first simulated energy spectrum, and the corresponding element content data to train a pre-constructed neural network model to obtain a trained neural network model; inputting the second simulated energy spectrum to be corrected and the corresponding element content data into the trained neural network model to obtain a corrected second simulated energy spectrum; and constructing an element spectrum library of the nickel-based alloy based on the experimental energy spectrum and the corrected second simulated energy spectrum.
[0006] In a technical solution of the above-mentioned method for constructing a nickel-based alloy element spectrum library based on a neural network, the use of the experimental energy spectrum, the first simulated energy spectrum and the corresponding element content data to train a pre-constructed neural network model to obtain a trained neural network model includes: determining a training set and a validation set based on the experimental energy spectrum, the first simulated energy spectrum and the corresponding element content data; using a preset data enhancement algorithm to expand the training set data; and using the expanded training set and the validation set to perform staged training on the pre-constructed neural network model to obtain a trained neural network model.
[0007] In a technical solution of the above-mentioned method for constructing a nickel-based alloy element spectrum library based on a neural network, the training set and the validation set are determined based on the experimental energy spectrum, the first simulated energy spectrum and the corresponding element content data, including: preprocessing the experimental energy spectrum and the first simulated energy spectrum, the preprocessing including logarithmic normalization and alignment of the experimental energy spectrum and the first simulated energy spectrum based on a dynamic time warping algorithm; dividing the preprocessed experimental energy spectrum and the first simulated energy spectrum according to a preset ratio to obtain a training set and a validation set.
[0008] In one technical solution of the above-mentioned method for constructing a nickel-based alloy element spectrum library based on a neural network, the training set includes multiple groups of training samples, each group of training samples includes an experimental energy spectrum, a first simulated energy spectrum and the corresponding element content; the preset data enhancement algorithm is used to expand the data of the training set, including: adding at least one interference of element content fluctuation, physical noise injection, elastic deformation enhancement and intensity perturbation to each group of training samples in the training set, and expanding the number of training samples in the training set to the target number.
[0009] In a technical solution of the above-mentioned method for constructing a nickel-based alloy element spectrum library based on a neural network, the neural network model adopts a dual-branch heterogeneous fusion architecture, including a spectral feature extraction branch, an element composition encoding branch and a physical constraint fusion module; the pre-constructed neural network model is trained in stages using the expanded training set and the verification set, including: the first stage: using training samples with physical noise injection, freezing the element composition encoding branch, and optimizing the spectral feature extraction branch; the second stage: using training samples with physical noise injection, elastic deformation enhancement and intensity perturbation, unfreezing the element composition encoding branch, weighted control of the characteristic peak area count according to the element content, and reducing the learning rate; the third stage: using training samples with added element content fluctuations, physical noise injection, elastic deformation enhancement and intensity perturbation, using mixed precision training and gradient clipping; monitoring the changes in the verification set loss, and obtaining a trained neural network model when the verification set loss meets the preset conditions.
[0010] In a technical solution of the above-mentioned method for constructing a nickel-based alloy element spectrum library based on a neural network, the second simulated energy spectrum to be corrected and the corresponding element content data are input into a trained neural network model to obtain a corrected second simulated energy spectrum, including: preprocessing the second simulated energy spectrum to be corrected and the corresponding element content data; inputting the preprocessed second simulated energy spectrum to be corrected and the corresponding element content data into a trained neural network model to obtain an output result; post-processing the output result of the neural network model to obtain a corrected second simulated energy spectrum, wherein the post-processing includes inverse logarithmic transformation, inverse normalization, inverse dynamic time warping transformation and non-negative correction processing.
[0011] In a technical solution of the above-mentioned method for constructing a nickel-based alloy element spectrum library based on a neural network, before determining the training set and the validation set based on the experimental energy spectrum, the first simulated energy spectrum and the corresponding element content data, the method also includes: performing Gaussian broadening correction on the first simulated energy spectrum.
[0012] In one technical solution of the above-mentioned method for constructing a nickel-based alloy element spectrum library based on a neural network, the obtaining of the experimental energy spectrum, the first simulated energy spectrum, the second simulated energy spectrum to be corrected, and the corresponding element content data of the nickel-based alloy includes: obtaining nickel-based alloy materials with different component ratios to prepare nickel-based alloy samples; setting experimental conditions, performing gamma energy spectrum measurement on the nickel-based alloy samples, and obtaining the experimental energy spectrum of the nickel-based alloy; using preset simulation software, according to the parameters of the nickel-based alloy sample, performing a simulation experiment on the nickel-based alloy sample to obtain a first simulated energy spectrum corresponding to the experimental energy spectrum; using preset simulation software, according to the parameters of the nickel-based alloy sample, performing a simulation experiment on the nickel-based alloy sample to obtain a second simulated energy spectrum to be corrected.
[0013] In a second aspect, an electronic device is provided, comprising a processor and a memory, wherein the memory is suitable for storing a plurality of program codes, and the program codes are suitable for being loaded and run by the processor to execute the method for constructing a nickel-based alloy element spectrum library based on a neural network as described in any one of the technical solutions of the above-mentioned technical solution of the method for constructing a nickel-based alloy element spectrum library based on a neural network.
[0014] In a third aspect, a computer-readable storage medium is provided, which stores a plurality of program codes, wherein the program codes are suitable for being loaded and run by a processor to execute the method for constructing a nickel-based alloy element spectrum library based on a neural network as described in any one of the technical solutions of the above-mentioned technical solution of the method for constructing a nickel-based alloy element spectrum library based on a neural network.
[0015] The above one or more technical solutions of this application have at least one or more of the following beneficial effects:
[0016] The present invention discloses a method for constructing a nickel-based alloy element spectrum library based on a neural network, comprising: obtaining an experimental energy spectrum, a first simulated energy spectrum, a second simulated energy spectrum to be corrected, and corresponding element content data of the nickel-based alloy; using the experimental energy spectrum, the first simulated energy spectrum, and the corresponding element content data to train a pre-constructed neural network model to obtain a trained neural network model; inputting the second simulated energy spectrum to be corrected and the corresponding element content data into the trained neural network model to obtain a corrected second simulated energy spectrum; and constructing an element spectrum library of the nickel-based alloy based on the experimental energy spectrum and the corrected second simulated energy spectrum. The present invention trains a neural network model through a limited experimental energy spectrum in combination with the first simulated energy spectrum, and corrects the second simulated energy spectrum based on the trained neural network model, and constructs a complete and accurate spectrum library covering the entire element range based on the experimental energy spectrum and the corrected second simulated energy spectrum, and uses the corrected second simulated energy spectrum to fill in the missing parts of the experimental data, thereby improving the accuracy and reliability of neutron component detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The disclosure of this application will be more easily understood with reference to the accompanying drawings. Those skilled in the art will readily appreciate that these drawings are for illustrative purposes only and are not intended to limit the scope of protection of this application. Furthermore, similar numbers in the figures represent similar components, where:
[0018] Figure 1 This is a flow chart of the main steps of a method for constructing a nickel-based alloy elemental library based on a neural network according to one embodiment of the present application;
[0019] Figure 2 1 is a data allocation diagram of a method for constructing a nickel-based alloy elemental library based on a neural network according to an embodiment of the present application;
[0020] Figure 3 It is a schematic diagram of the main structure block diagram of an electronic device according to an embodiment of the present application.
[0021] List of reference numerals:
[0022] 11: Memory; 12: Processor. DETAILED DESCRIPTION
[0023] Some embodiments of the present application are described below with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are only used to explain the technical principles of the present application and are not intended to limit the scope of protection of the present application.
[0024] In the description of this application, "module" and "processor" may include hardware, software, or a combination of both. A module may include hardware circuitry, various suitable sensors, communication ports, and memory. It may also include software components, such as program code, or a combination of software and hardware. A processor may be a central processing unit, a microprocessor, an image processor, a digital signal processor, or any other suitable processor. A processor has data and / or signal processing capabilities. A processor may be implemented in software, hardware, or a combination of both. Non-transitory computer-readable storage media include any suitable medium capable of storing program code, such as magnetic disks, hard disks, optical disks, flash memory, read-only memory, random access memory, etc. The term "A and / or B" refers to all possible combinations of A and B, such as only A, only B, or both A and B. The terms "at least one of A or B" or "at least one of A and B" have similar meanings to "A and / or B" and may include only A, only B, or both A and B. The singular forms "a" and "the" may also include the plural forms.
[0025] Currently, spectral library construction for bulk materials like cement and coal relies on experimental measurements or Monte Carlo simulations. These methods, thanks to their large sample size and strong effective signal, meet industrial requirements for accuracy. However, in the online testing of nickel-based alloys in the aviation industry, traditional library construction methods struggle to achieve high-precision detection due to limitations such as small sample mass (less than 200 grams), weak gamma signals, and low signal-to-noise ratios. Targeted solutions are urgently needed.
[0026] To this end, the present application provides a method for constructing a nickel-based alloy element spectrum library based on a neural network, comprising: obtaining an experimental energy spectrum, a first simulated energy spectrum, a second simulated energy spectrum to be corrected, and corresponding element content data of the nickel-based alloy; using the experimental energy spectrum, the first simulated energy spectrum, and the corresponding element content data to train a pre-constructed neural network model to obtain a trained neural network model; inputting the second simulated energy spectrum to be corrected and the corresponding element content data into the trained neural network model to obtain a corrected second simulated energy spectrum; and constructing an element spectrum library of the nickel-based alloy based on the experimental energy spectrum and the corrected second simulated energy spectrum. The present application trains a neural network model through a limited experimental energy spectrum in combination with the first simulated energy spectrum, and corrects the second simulated energy spectrum based on the trained neural network model, and uses the corrected second simulated energy spectrum to fill in the missing parts of the experimental data, thereby realizing the construction of a complete and accurate spectrum library covering the entire element range, thereby improving the accuracy and reliability of neutron composition detection.
[0027] See attached Figure 1 , Figure 1 This is a flow chart of the main steps of the method for constructing a nickel-based alloy elemental library based on a neural network according to an embodiment of the present application. Figure 1As shown, the method for constructing a nickel-based alloy elemental library based on a neural network in the embodiment of the present application mainly includes the following steps S101 to S104.
[0028] Step S101: obtaining an experimental energy spectrum, a first simulated energy spectrum, a second simulated energy spectrum to be corrected, and corresponding element content data of a nickel-based alloy.
[0029] In this example, a nickel-based alloy sample was prepared and an experimental gamma ray spectrum measurement of the nickel-based alloy sample was performed on a pre-assembled PGNAA activation analysis platform to obtain an experimental spectrum. Using Monte Carlo simulation software (e.g., MCNP), an accurate physical model was established based on parameters such as the material composition and sample size of the nickel-based alloy sample, as well as the experimental neutron source and detector configuration. The gamma ray spectrum produced by the nickel-based alloy under neutron bombardment was simulated to obtain a first simulated spectrum and a second simulated spectrum, wherein the first simulated spectrum corresponds to the experimental spectrum.
[0030] Step S102: using the experimental energy spectrum, the first simulated energy spectrum and the corresponding element content data to train a pre-built neural network model to obtain a trained neural network model.
[0031] Step S103: inputting the second simulated energy spectrum to be corrected and the corresponding element content data into the trained neural network model to obtain a corrected second simulated energy spectrum.
[0032] Step S104: constructing an element spectrum library of the nickel-based alloy based on the experimental energy spectrum and the corrected second simulated energy spectrum.
[0033] Based on the above steps S101 to S104, the present application first obtains the experimental energy spectrum and the first simulated energy spectrum of the nickel-based alloy sample, and uses the limited experimental energy spectrum in combination with the first simulated energy spectrum to train the pre-constructed neural network model, and corrects the second simulated energy spectrum based on the trained neural network model, and then uses the corrected second simulated energy spectrum to fill the missing experimental energy spectrum data, thereby building a complete and accurate spectrum library covering the entire element range, thereby improving the accuracy and reliability of neutron composition detection.
[0034] The above steps S101 to S104 are further explained below.
[0035] With respect to step S101, in one embodiment, the obtaining of the experimental energy spectrum, the first simulated energy spectrum, the second simulated energy spectrum to be corrected, and the corresponding element content data of the nickel-based alloy includes: obtaining nickel-based alloy materials with different component ratios to prepare nickel-based alloy samples; setting experimental conditions, performing gamma energy spectrum measurement on the nickel-based alloy samples, and obtaining the experimental energy spectrum of the nickel-based alloy; using preset simulation software, performing a simulation experiment on the nickel-based alloy sample according to the parameters of the nickel-based alloy sample, and obtaining a first simulated energy spectrum corresponding to the experimental energy spectrum; using preset simulation software, performing a simulation experiment on the nickel-based alloy sample according to the parameters of the nickel-based alloy sample, and obtaining a second simulated energy spectrum to be corrected.
[0036] Specifically, nickel-based alloy samples refer to nickel-based alloy materials with different composition ratios, and are made according to standard preparation processes with a preset mass of less than 200 grams. The prepared nickel-based alloy samples are placed on the completed PGNAA activation analysis platform, and experimental conditions such as neutron source parameters and detector parameters are set. The experimental gamma ray spectrum of the nickel-based alloy samples is measured, and the experimental spectrum of each sample is recorded.
[0037] Using Monte Carlo simulation software, such as MCNP (Monte Carlo N-Particle Transport Code System), an accurate physical model is established based on parameter samples of nickel-based alloys, such as material composition, sample size, neutron source and detector layout in the experiment, to simulate the gamma energy spectrum produced by the nickel-based alloy under neutron bombardment. A first simulated energy spectrum corresponding to the experimental energy spectrum is obtained, and the same method is used to obtain a second simulated energy spectrum to be corrected.
[0038] For step S102, in one embodiment, the use of the experimental energy spectrum, the first simulated energy spectrum and the corresponding element content data to train a pre-constructed neural network model to obtain a trained neural network model includes: determining a training set and a validation set based on the experimental energy spectrum, the first simulated energy spectrum and the corresponding element content data; using a preset data enhancement algorithm to perform data expansion on the training set; and using the expanded training set and the validation set to perform stage-by-stage training on the pre-constructed neural network model to obtain a trained neural network model.
[0039] Specifically, based on the experimental energy spectrum, the first simulated energy spectrum, and the corresponding elemental content data, a training set and a validation set were determined. Pre-set data augmentation algorithms, such as adding Gaussian noise, performing elastic deformation, and frequency shift perturbations, were then used to augment the training set. This data augmentation generated more training samples and increased the amount of training data for the model. The pre-built neural network model was then trained in stages using the augmented training and validation sets to obtain a trained neural network model.
[0040] In one embodiment, before determining the training set and the validation set based on the experimental energy spectrum, the first simulated energy spectrum and the corresponding element content data, the method further includes: performing Gaussian broadening correction on the first simulated energy spectrum.
[0041] Specifically, since parameters such as the energy resolution of the simulated energy spectrum are different from those of the experimental detector, it is necessary to perform Gaussian broadening correction on the first simulated energy spectrum. An optimization algorithm (such as the least squares method, the Levenberg-Marquardt algorithm, the genetic algorithm, etc.) can be used to automatically fit the experimental spectrum, and the parameters of the Gaussian function can be adjusted to perform Gaussian broadening correction on the first simulated energy spectrum, so that the corrected first simulated energy spectrum matches the experimental energy spectrum in terms of energy resolution, peak shape, etc.
[0042] In one embodiment, the training set and the validation set are determined based on the experimental energy spectrum, the first simulated energy spectrum and the corresponding element content data, including: preprocessing the experimental energy spectrum and the first simulated energy spectrum, the preprocessing including logarithmic normalization and alignment of the experimental energy spectrum and the first simulated energy spectrum based on a dynamic time warping algorithm; dividing the preprocessed experimental energy spectrum and the first simulated energy spectrum according to a preset ratio to obtain a training set and a validation set.
[0043] Specifically, first normalize the counts of each energy spectrum (2048*1 matrix), that is, divide the counts of each channel by the total counts. The following formula can be used for count normalization:
[0044] Where Spec[i] is the original count of the energy spectrum, which is a 2048*1 matrix, newSpec[i] is the new count of the energy spectrum, and k is the number of iterations.
[0045] Then, we take the logarithm of the normalized data to reduce the numerical differences and the degree of difference between each data. The range of the logarithmic transformation is set to [1, 1e8].
[0046] Subsequently, the Dynamic Time Warping (DTW) algorithm was used to align the positions of characteristic peaks in the experimental spectrum with those in the first simulated spectrum, ensuring that identical elements have identical coordinates in the spectrum matrix. This corrects any misalignment of the time or energy axes caused by factors such as instrument response differences. During this process, the Dynamic Time Warping algorithm may generate NaNs (i.e., meaningless data) at some locations, which must be replaced with 0s to prevent interference with subsequent calculations.
[0047] For example, in the experimental energy spectrum (a 2048*1 matrix) and the first simulated energy spectrum (a 2048*1 matrix), the characteristic peak of an element was originally at the 400th position in the experimental energy spectrum and at the 410th position in the first simulated spectrum. After processing based on the dynamic time warping algorithm, the element was calibrated to the 404th position in both the experimental energy spectrum and the first simulated energy spectrum.
[0048] Finally, the preprocessed experimental energy spectrum and the first simulation energy spectrum are divided according to the preset ratio to obtain the training set and the validation set.
[0049] like Figure 2 As shown, in a specific embodiment, 37 sets of experimental energy spectra, 37 sets of first simulated energy spectra corresponding to the experimental spectra, a total of 37 sets of sample contents, and the characteristic peak ranges of 9 elements to be measured are included. After data partitioning, 37 sets of energy spectrum pairs are obtained. Each energy spectrum pair includes the experimental energy spectrum, the corresponding first simulated energy spectrum, and the sample element content at the time of the energy spectrum measurement. These 37 pairs are divided into training and validation sets according to a preset ratio, where the training set includes 32 pairs and the validation set includes 5 pairs.
[0050] In one embodiment, the training set includes multiple groups of training samples, each group of training samples includes an experimental energy spectrum, a first simulated energy spectrum and corresponding element content; the preset data enhancement algorithm is used to expand the data of the training set, including: adding at least one interference of element content fluctuation, physical noise injection, elastic deformation enhancement and intensity perturbation to each group of training samples in the training set, and expanding the number of training samples in the training set to the target number.
[0051] Specifically, at least one of the interferences selected from element content fluctuation, physical noise injection, elastic deformation enhancement and intensity perturbation is added to each group of training samples in the training set. Each training sample includes an experimental energy spectrum, a first simulated energy spectrum and a corresponding element content. During expansion, at least one of the interferences selected from element content fluctuation, physical noise injection, elastic deformation enhancement or intensity perturbation can be added to the experimental energy spectrum and the first simulated energy spectrum in each training sample respectively, and small fluctuations are added to the element content to generate more diverse training samples, thereby expanding the number of training samples and increasing the richness of the training set.
[0052] In a specific embodiment, the training set includes 32 groups of training samples, all of which are composed of an experimental energy spectrum, a first simulated energy spectrum, and corresponding element contents. During expansion, element content fluctuation increases and slight disturbances (physical noise injection, elastic deformation enhancement, or intensity disturbance) are added to the experimental energy spectrum, and element content fluctuation increases and slight disturbances (physical noise injection, elastic deformation enhancement, or intensity disturbance) are added to the first simulated energy spectrum. Small fluctuations are added to the corresponding element contents to obtain a new group of training samples. By adding interference, each group of original training samples generates 8 times new samples, and the total number of training samples is expanded to 256 groups.
[0053] Take a training sample (X exp , X sim , C x ) as an example, where X exp is the experimental energy spectrum, X sim is the first simulated energy spectrum, C x It is a 1×9 element content matrix, which is used to represent the content of 9 elements in the energy spectrum. Then a small perturbation δ can be generated by random numbers, and the element content is updated to Cx+δ as the element content of the new sample, where δ is a very small 1*9 random number matrix.
[0054] Based on the known element characteristic peak range and the value of δ, Gaussian distribution count fluctuations are added to the characteristic peak region. For example, if the random result of δ is a Ni content of -1% and a Co content of 0.2% (along with some other perturbations), then for the new energy spectrum, the counts in the area near the Ni characteristic peak will be subtracted by a Gaussian distribution, representing a reduction in Ni counts (and the reduction value is proportional to 1%). The Gaussian distribution value will be added to the Co characteristic peak region, representing an increase in Co counts. For this set of counts, the first simulated energy spectrum and the experimental energy spectrum are both corrected for the corresponding element content peak regions.
[0055] In one embodiment, the neural network model adopts a dual-branch heterogeneous fusion architecture, including a spectral feature extraction branch, an element composition encoding branch and a physical constraint fusion module; the expanded training set and the validation set are used to train the pre-built neural network model in stages, including: the first stage: using training samples with physical noise injection, freezing the element composition encoding branch, and optimizing the spectral feature extraction branch; the second stage: using training samples with physical noise injection, elastic deformation enhancement and intensity perturbation, unfreezing the element composition encoding branch, weighted control of the characteristic peak area count according to the element content, and reducing the learning rate; the third stage: using training samples with added element content fluctuations, physical noise injection, elastic deformation enhancement and intensity perturbation, using mixed precision training and gradient clipping; monitoring the changes in the validation set loss, and obtaining a trained neural network model when the validation set loss meets the preset conditions.
[0056] Specifically, a dual-branch heterogeneous fusion architecture was constructed in MATLAB to learn the energy spectrum similarity metric. The dual-branch architecture of the neural network model processes the energy spectrum data and element content information separately, improving prediction accuracy through heterogeneous feature fusion while introducing physical constraints to ensure output rationality. The core components of the neural network model are as follows:
[0057] The spectral feature extraction branch is the input layer, which inputs a 2048-dimensional normalized energy spectrum vector, and the convolution module is a two-level 1D-CNN structure;
[0058] The element composition encoding branch is the input layer, which inputs a 9-dimensional element content vector (Al, Co, Cr, Mo, Nb, Ta, Ti, W, Ni), and the feature map is a 16-dimensional fully connected layer;
[0059] The physical constraint fusion module is used to fuse the spectral features output by the spectral feature extraction branch and the elemental features extracted by the elemental composition encoding branch, and then generate the final correction result through a fully connected layer and a custom attention mechanism (such as PeakAttention).
[0060] The neural network model also defines some auxiliary functions for dynamically adding layers, checking the matching of input and output dimensions when connecting layers (to avoid dimension incompatibility errors), and ensuring that the model topology (such as layer order and connection method) meets the design through structural verification.
[0061] The neural network model of this application uses a heterogeneous dual-branch design, physical constraint fusion and attention mechanism to compare the distance of input training samples in the metric space, learn the similarity measurement of energy spectra, and achieve coordinated correction of energy spectrum data and element content.
[0062] The neural network model is trained using a phased training scheme. During the training process, the neural network model continuously adjusts its own parameters to make the corrected simulated energy spectrum as close to the experimental energy spectrum as possible, so as to minimize the difference between the corrected result and the experimental energy spectrum.
[0063] In a specific embodiment, the training is divided into three stages (a total of 1500 rounds), and the intermediate state of the model is saved every 1000 rounds. The maximum number of saved intermediate state files is 5.
[0064] Phase 1 (1-450 rounds): Basic training phase, using only training samples injected with physical noise, freezing the elemental composition encoding branch, and optimizing only the spectral feature extraction branch. A higher learning rate can be used in the first phase to allow the model to learn basic energy spectrum features.
[0065] The second stage (451-900 rounds): Joint tuning stage, using physical noise injection, elastic deformation enhancement and intensity perturbation training samples, to start the correction of elemental composition coding branch parameters. According to the element content of each group of training samples and the characteristic peak area range of each element, the counts within this range are controlled according to the weight of the sample element content. The learning rate in this stage can be decayed to 1e-4.
[0066] The third stage (901-1500 rounds): The fine-tuning stage uses training samples with added element content fluctuations, physical noise injection, elastic deformation enhancement, and intensity perturbations to further reduce the model learning rate. Mixed precision training is used, gradient clipping is introduced, and the model is fine-tuned to improve its accuracy.
[0067] During the model operation process, the FP16 format is used to accelerate the calculation, the accuracy gradient is maintained through loss scaling, and the changes in the validation set loss are monitored at the same time. When there is no decrease after 5 consecutive rounds, the training is terminated and the best model is retained, thereby improving the computational efficiency while ensuring accuracy.
[0068] For step S103, in one embodiment, the second simulated energy spectrum to be corrected and the corresponding element content data are input into a trained neural network model to obtain a corrected second simulated energy spectrum, including: preprocessing the second simulated energy spectrum to be corrected and the corresponding element content data; inputting the preprocessed second simulated energy spectrum to be corrected and the corresponding element content data into a trained neural network model to obtain an output result; post-processing the output result of the neural network model to obtain a corrected second simulated energy spectrum, wherein the post-processing includes inverse logarithmic transformation, inverse normalization, inverse dynamic time warping transformation and non-negative correction processing.
[0069] Specifically, the second simulated energy spectrum to be corrected and the corresponding element contents are preprocessed so that their format is consistent with the input data during model training. The preprocessing method is consistent with that during training and will not be repeated here.
[0070] The preprocessed data is input into the trained neural network model. For each second simulated energy spectrum, the neural network model calculates its relationship with the experimental energy spectrum in the metric space, and corrects the second simulated energy spectrum according to the learned mapping relationship, so that the corrected second simulated energy spectrum is closer to the experimental energy spectrum in terms of spectral shape, peak position, peak intensity, etc.
[0071] Furthermore, the corrected data output by the neural network model needs to undergo an inverse transformation opposite to the pre-processing to display the shape of the gamma energy spectrum, thereby obtaining the corrected second simulated energy spectrum. Post-processing of the corrected results includes inverse logarithmic transformation, inverse normalization, inverse dynamic time warping transformation, and non-negative correction processing. Specifically, the corrected data is subjected to an inverse dynamic time warping (DTW) transformation, reversely mapped according to the alignment path, and the original channel address is restored; the corrected data is inverse normalized to convert it to the original numerical range; the corrected data is inverse logarithmically transformed to convert the data from the logarithmic domain back to the original domain; inverse logarithmic transformation or inverse normalization may produce negative values, so the converted data is subjected to non-negative correction processing (forcing non-negative values) to ensure that the values of all data points are non-negative.
[0072] With respect to step S104 , an element spectrum library of the nickel-based alloy is constructed based on the experimental energy spectrum and the corrected second simulated energy spectrum.
[0073] Specifically, the experimental energy spectrum and the corrected second simulated energy spectrum are integrated, classified and organized according to element types and content ranges to form an element spectrum library of nickel-based alloys covering the entire element range.
[0074] This application uses a limited experimental energy spectrum and a first simulated energy spectrum, adopts a data enhancement method to expand the training data, obtains a large number of simulated energy spectra, and trains a neural network model with the expanded training data, and then uses the trained neural network model to correct the second simulated energy spectrum. The corrected second simulated energy spectrum is used to fill the missing parts of the experimental energy spectrum data, and a complete and accurate spectrum library covering the entire element range is constructed, which effectively solves the problem of constructing a nickel-based alloy spectrum library under low signal-to-noise ratio and significantly improves the accuracy and reliability of neutron composition detection.
[0075] It should be pointed out that although the various steps in the above embodiments are described in a specific order, those skilled in the art will understand that in order to achieve the effect of the present application, different steps do not have to be performed in such an order. They can be performed simultaneously (in parallel) or in other orders. These changes are within the scope of protection of the present application.
[0076] It will be understood by those skilled in the art that all or part of the processes in the method for implementing the above embodiment of the present application can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, it can implement the steps of each of the above method embodiments. The computer program includes computer program code, which can be in source code form, object code form, executable file or some intermediate form. The computer-readable storage medium can include: any entity or device, medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory, random access memory, electric carrier signal, telecommunication signal and software distribution medium that can carry the computer program code. It should be noted that the content contained in the computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable storage media do not include electric carrier signals and telecommunication signals.
[0077] Furthermore, the present application also provides an electronic device. In an electronic device embodiment according to the present application, the electronic device includes a processor and a memory, the memory can be configured to store a program for executing the method for constructing a nickel-based alloy element spectrum library based on a neural network according to the above method embodiment, and the processor can be configured to execute the program in the memory, which includes but is not limited to a program for executing the method for constructing a nickel-based alloy element spectrum library based on a neural network according to the above method embodiment. For ease of explanation, only the parts related to the embodiment of the present application are shown. For specific technical details not disclosed, please refer to the method part of the embodiment of the present application. The electronic device can be an electronic device formed by various electronic devices.
[0078] Furthermore, the present application also provides a computer-readable storage medium. In a computer-readable storage medium embodiment according to the present application, the computer-readable storage medium can be configured to store a program for executing the method for constructing a nickel-based alloy element spectrum library based on a neural network according to the above-mentioned method embodiment, and the program can be loaded and run by a processor to implement the above-mentioned method for constructing a nickel-based alloy element spectrum library based on a neural network. For ease of explanation, only the parts related to the embodiment of the present application are shown. For specific technical details not disclosed, please refer to the method part of the embodiment of the present application. The computer-readable storage medium can be a storage device formed by various electronic devices. Optionally, the computer-readable storage medium in the embodiment of the present application is a non-temporary computer-readable storage medium.
[0079] Furthermore, it should be understood that since the configuration of each module is merely for the purpose of illustrating the functional units of the apparatus of the present application, the physical devices corresponding to these modules may be the processor itself, or a portion of the software in the processor, a portion of the hardware, or a combination of software and hardware. Therefore, the number of modules in the figure is merely illustrative.
[0080] Those skilled in the art will appreciate that the various modules in the device can be adaptively split or merged. Such splitting or merging of specific modules will not cause the technical solution to deviate from the principles of this application. Therefore, the technical solutions after splitting or merging will fall within the scope of protection of this application.
[0081] Thus far, the technical solutions of the present application have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is readily understood by those skilled in the art that the scope of protection of the present application is obviously not limited to these specific embodiments. Without departing from the principles of the present application, those skilled in the art may make equivalent changes or substitutions to the relevant technical features, and the technical solutions after such changes or substitutions will fall within the scope of protection of the present application.
Claims
1. A method for constructing a nickel-based alloy element spectral library based on a neural network, characterized in that: The method comprises: Obtaining an experimental energy spectrum, a first simulated energy spectrum, a second simulated energy spectrum to be corrected, and corresponding element content data of the nickel-based alloy; Using the experimental energy spectrum, the first simulated energy spectrum and corresponding element content data to train a pre-built neural network model to obtain a trained neural network model; Inputting the second simulated energy spectrum to be corrected and the corresponding element content data into the trained neural network model to obtain a corrected second simulated energy spectrum; An element spectrum library of the nickel-based alloy is constructed based on the experimental energy spectrum and the corrected second simulated energy spectrum.
2. The method for constructing a nickel-based alloy element library based on a neural network according to claim 1, characterized in that: The method of training a pre-built neural network model using the experimental energy spectrum, the first simulated energy spectrum, and corresponding element content data to obtain a trained neural network model includes: Determining a training set and a validation set based on the experimental energy spectrum, the first simulated energy spectrum, and corresponding element content data; Use the preset data enhancement algorithm to expand the training set data; The pre-built neural network model is trained in stages using the expanded training set and the verification set to obtain a trained neural network model.
3. The method for constructing a nickel-based alloy element library based on a neural network according to claim 2, characterized in that: The determining of a training set and a validation set based on the experimental energy spectrum, the first simulated energy spectrum, and corresponding element content data includes: Preprocessing the experimental energy spectrum and the first simulated energy spectrum, wherein the preprocessing includes logarithmic normalization processing and alignment of the experimental energy spectrum and the first simulated energy spectrum based on a dynamic time warping algorithm; The preprocessed experimental energy spectrum and the first simulated energy spectrum are divided according to a preset ratio to obtain a training set and a validation set.
4. The method for constructing a nickel-based alloy element library based on a neural network according to claim 2, characterized in that: The training set includes multiple groups of training samples, each group of training samples includes an experimental energy spectrum, a first simulated energy spectrum and corresponding element contents; the data of the training set is expanded using a preset data enhancement algorithm, including: At least one of the following interferences, element content fluctuation, physical noise injection, elastic deformation enhancement and intensity perturbation, is added to each group of training samples in the training set to expand the number of training samples in the training set to the target number.
5. The method for constructing a nickel-based alloy element library based on a neural network according to claim 4, characterized in that: The neural network model adopts a dual-branch heterogeneous fusion architecture, including a spectral feature extraction branch, an element composition encoding branch, and a physical constraint fusion module; The method of using the expanded training set and the validation set to train the pre-built neural network model in stages includes: Phase 1: Using physical noise injected training samples, freezing the element composition encoding branch and optimizing the spectral feature extraction branch; The second stage: using training samples with physical noise injection, elastic deformation enhancement, and intensity perturbation, unfreeze the elemental composition encoding branch, perform weighted control on the feature peak area counts based on the element content, and reduce the learning rate; The third stage: using training samples with added element content fluctuations, physical noise injection, elastic deformation enhancement, and intensity perturbations, using mixed precision training and gradient clipping; Monitor the changes in validation set loss, and obtain the trained neural network model when the validation set loss meets the preset conditions.
6. The method for constructing a nickel-based alloy element library based on a neural network according to claim 2, characterized in that: The step of inputting the second simulated energy spectrum to be corrected and the corresponding element content data into a trained neural network model to obtain a corrected second simulated energy spectrum includes: Preprocessing the second simulated energy spectrum to be corrected and the corresponding element content data; Inputting the pre-processed second simulated energy spectrum to be corrected and the corresponding element content data into the trained neural network model to obtain an output result; The output result of the neural network model is post-processed to obtain a corrected second simulated energy spectrum, wherein the post-processing includes inverse logarithmic transformation, inverse normalization, dynamic time warping inverse transformation and non-negative correction processing.
7. The method for constructing a nickel-based alloy element library based on a neural network according to claim 2, characterized in that: Before determining a training set and a validation set based on the experimental energy spectrum, the first simulated energy spectrum, and the corresponding element content data, the method further includes: Perform Gaussian broadening correction on the first simulated energy spectrum.
8. The method for constructing a nickel-based alloy element library based on a neural network according to claim 1, characterized in that: The step of obtaining the experimental energy spectrum, the first simulated energy spectrum, the second simulated energy spectrum to be corrected, and the corresponding element content data of the nickel-based alloy includes: Obtain nickel-based alloy materials with different composition ratios and prepare nickel-based alloy samples; Setting experimental conditions, performing gamma ray spectrum measurement on the nickel-based alloy sample, and obtaining an experimental spectrum of the nickel-based alloy; Using preset simulation software, according to the parameters of the nickel-based alloy sample, a simulation experiment is performed on the nickel-based alloy sample to obtain a first simulated energy spectrum corresponding to the experimental energy spectrum; Using preset simulation software, a simulation experiment is performed on the nickel-based alloy sample according to the parameters of the nickel-based alloy sample to obtain a second simulated energy spectrum to be corrected.
9. An electronic device comprising a processor and a memory, wherein the memory is adapted to store a plurality of program codes, wherein: The program code is suitable for being loaded and run by the processor to execute the method for constructing a nickel-based alloy element spectrum library based on a neural network according to any one of claims 1 to 8.
10. A computer-readable storage medium storing a plurality of program codes, characterized in that: The program code is suitable for being loaded and run by a processor to execute the method for constructing a nickel-based alloy element spectrum library based on a neural network according to any one of claims 1 to 8.
Citation Information
Patent Citations
An electrically controllable neutron gamma-ray energy spectrum analysis method of a characteristic frequency spectrum library
CN109740279A
Self-supervised hyperspectral image classification method based on redundancy elimination
CN117876760A
Nickel-based alloy element spectrum library construction method, device, equipment and medium
CN119479878A
LSTM-based lanthanum bromide detector gamma energy spectrum correction method
CN119720816A