CN113866817A - Neutron diffraction peak position prediction method, device and medium based on neural network - Google Patents

Neutron diffraction peak position prediction method, device and medium based on neural network Download PDF

Info

Publication number
CN113866817A
CN113866817A CN202111139848.9A CN202111139848A CN113866817A CN 113866817 A CN113866817 A CN 113866817A CN 202111139848 A CN202111139848 A CN 202111139848A CN 113866817 A CN113866817 A CN 113866817A
Authority
CN
China
Prior art keywords
diffraction
data
neutron
intensity
angle
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
CN202111139848.9A
Other languages
Chinese (zh)
Inventor
杨柳
张俊宇
陈庭轩
胡志刚
钟掘
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Central South University
Original Assignee
Central South University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Central South University filed Critical Central South University
Priority to CN202111139848.9A priority Critical patent/CN113866817A/en
Publication of CN113866817A publication Critical patent/CN113866817A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01TMEASUREMENT OF NUCLEAR OR X-RADIATION
    • G01T3/00Measuring neutron radiation
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01TMEASUREMENT OF NUCLEAR OR X-RADIATION
    • G01T7/00Details of radiation-measuring instruments
    • G01T7/005Details of radiation-measuring instruments calibration techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/20Design optimisation, verification or simulation
    • G06F30/27Design optimisation, verification or simulation using machine learning, e.g. artificial intelligence, neural networks, support vector machines [SVM] or training a model
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/044Recurrent networks, e.g. Hopfield networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2111/00Details relating to CAD techniques
    • G06F2111/10Numerical modelling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2119/00Details relating to the type or aim of the analysis or the optimisation
    • G06F2119/14Force analysis or force optimisation, e.g. static or dynamic forces

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Molecular Biology (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computing Systems (AREA)
  • High Energy & Nuclear Physics (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • Mathematical Physics (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • General Health & Medical Sciences (AREA)
  • Spectroscopy & Molecular Physics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Medical Informatics (AREA)
  • Computer Hardware Design (AREA)
  • Geometry (AREA)
  • Analysing Materials By The Use Of Radiation (AREA)

Abstract

The invention discloses a neutron diffraction peak position prediction method, equipment and a medium based on a neural network, wherein the method comprises the following steps: adjusting an included angle between the detector and the incident neutron beam, diffracting the detected material by using the neutron beam, and collecting neutrons generated by the diffraction of the detected material by the detector; converting the channel position of the detector into a diffraction angle, and counting the diffraction intensity and intensity error of each channel according to the neutron number collected by the detector; building a neural network framework of a neutron diffraction peak position prediction model, taking the diffraction angle and intensity of each channel as input and output, introducing an intensity error into a loss function as weight, and training the neural network, namely obtaining a functional relation between the angle and the diffraction intensity by the obtained neutron diffraction peak position prediction model; and the angle corresponding to the maximum value of the diffraction intensity is the neutron diffraction peak position of the detected material. The method can accurately fit neutron diffraction data in real time, accurately obtain neutron diffraction peak positions, realize accurate measurement of the residual stress of the measured material, and reflect the real stress field of the deep part of the material.

Description

Neutron diffraction peak position prediction method, device and medium based on neural network
Technical Field
The invention relates to the field of neutron scattering-material residual stress calculation, in particular to a neutron diffraction peak position prediction method, equipment and medium based on a neural network.
Background
At present, the domestic top manufacturing industry has a huge gap with developed countries such as the United states, Germany and the like, and the countries deeply implement intelligent manufacturing in order to fill short boards such as new material design, aeroengine manufacturing, integrated circuit chip development and the like. Therefore, in order to promote the optimization and upgrade of the manufacturing industry, the research and development verification of high-end new materials, advanced aeroengines, gas turbines and other technologies is accelerated, the research on the problems of large-bypass-ratio turbofan aeroengines, F-grade and G/H-grade heavy gas turbines and the like is promoted, and in order to fully research the generation mechanism of the internal Stress of the materials and promote the development level of the ultra-precision machining technology in China, a Neutron Stress Spectrometer (Neutron Stress Spectrometer) is developed by the national institute of atomic energy science. The development of the neutron stress spectrometer aims to detect the deep residual stress and the macroscopic stress field of a material/member, serve the precise evaluation of the precise design, manufacture and service performance of an engineering member and the engineering requirements of material-member integration and the safe operation of major equipment, explore the scientific laws of the internal stress interaction and change between the composition phases of multi-phase materials, the damage formation mechanism and evolution of the material/member under the action of cyclic stress and the like, meet the precise evaluation of the precise design, manufacture and service performance of the engineering member and the engineering requirements of the material-member integration and the safe operation of the major equipment, and finally provide an effective basis for the regulation and control of the material manufacturing process based on the residual stress.
The neutron stress spectrometer is used for calculating the residual stress of a material part based on a neutron diffraction method, firstly, a neutron beam generated by a Chinese Advanced Research Reactor (CARR) located in the Chinese atomic energy science Research institute under nuclear reaction is used for diffracting a material to be detected, a neutron detector is used for collecting neutron diffraction data generated during diffraction, and a data analysis model is used for fitting the neutron diffraction data to obtain a neutron diffraction peak position; calculating three-dimensional strain by using the neutron diffraction peak position and the crystal face spacing of the material to be measured in the stress-free state, and combining the Poisson's ratio and the elastic modulus of the material to complete calculation of the residual stress of the material based on Hooke's law after obtaining the three-dimensional strain. The calculation of the residual stress of the material has extremely high requirement on the precision of the neutron diffraction peak position, and the diffraction peak position result of the algorithm fitting at the present stage is not enough to support the peak position precision required by the stress calculation. Therefore, a model capable of accurately fitting neutron diffraction data needs to be established, so that a high-precision diffraction peak position is obtained, and the calculation precision of the residual stress of the material is improved. Finally, the purposes of providing effective basis for the regulation and control of the material manufacturing process based on the residual stress, improving the stability of the material and prolonging the service life are achieved.
Disclosure of Invention
The invention provides a neutron diffraction peak position prediction method, equipment and medium based on a neural network, which can accurately fit neutron diffraction data of a measured material, thereby accurately obtaining the neutron diffraction peak position of the material and realizing accurate measurement of residual stress.
In order to achieve the technical purpose, the invention adopts the following technical scheme:
a neutron diffraction peak position prediction method based on a neural network comprises the following steps:
system presetting: measuring and calibrating an included angle between the right middle position of the detector and an incident neutron beam to be a preset angle 2 theta, diffracting the detected material by using the neutron beam, and collecting neutrons generated during the diffraction of the detected material by using the neutron detector;
acquiring neutron diffraction data: converting the position of each channel of the neutron detector into a channel deviation angle delta theta, and obtaining the angle of each channel of the neutron detector according to a preset angle 2 theta and the channel deviation angle delta theta; counting the diffraction intensity and intensity error of each channel of the neutron detector according to the number of neutrons collected by each pixel block of the neutron detector;
building a model architecture: constructing a neural network architecture of a neutron diffraction peak position prediction model, wherein the neural network architecture comprises the number of hidden layers, the number of neurons of each hidden layer, an input layer and an output layer;
taking the angle of each channel of the neutron detector as input and the diffraction intensity as output, introducing an intensity error into a loss function, training the built neural network, namely fitting the functional relation between the angle and the diffraction intensity, and obtaining a neutron diffraction peak position prediction model which is the functional relation between the angle and the diffraction intensity;
and finding the angle corresponding to the maximum value of the diffraction intensity according to the functional relation between the angle and the diffraction intensity obtained by fitting, wherein the angle is the neutron diffraction peak position of the material to be detected.
Further, the diffraction intensity of each channel refers to the cumulative sum of the numbers of neutrons received by all pixel blocks on the channel.
Further, the method for counting the diffraction intensity and the intensity error of each channel of the neutron detector comprises the following steps:
(1) calculating the neutron collection efficiency of each pixel block of the neutron detector: uniformly printing neutrons with the same quantity on each pixel block which is vertical to the two-dimensional surface detection of the neutron detector, then counting the number of actually acquired neutrons of each pixel block, and calculating the neutron acquisition efficiency of each pixel block:
Figure BDA0003283357560000021
Figure BDA0003283357560000022
in the formula, i represents the ith row in the two-dimensional surface exploration, j represents the jth column of the two-dimensional surface exploration, and NijRepresenting the number of neutrons obtained by the ith row and jth column of pixel blocks, N representing the number of pixel blocks of one dimension in a two-dimensional planar exploration, and NavgFactor represents the average neutron number per pixel blockijRepresenting the neutron collection efficiency of the ith row and the jth column of pixel blocks;
(2) according to the neutron collection efficiency of the pixel block, the number of neutrons collected by the pixel block is calibrated to obtain the diffraction intensity and the intensity error of the pixel block:
Figure BDA0003283357560000023
Figure BDA0003283357560000024
in the formula (I), the compound is shown in the specification,
Figure BDA0003283357560000031
the number of neutrons collected for the ith row and jth column of pixel blocks,
Figure BDA0003283357560000032
the data after calibration is the diffraction intensity of the ith row and the jth column of pixel blocks;
Figure BDA0003283357560000033
representing the intensity error of the ith row and jth column pixel block in the two-dimensional surface detection of the neutron detector;
(3) and respectively accumulating the diffraction intensity and the intensity error of all pixel blocks on each channel, namely each column of the detector, along the channel distribution direction of the neutron detector to obtain the diffraction intensity and the intensity error of the channel.
Further, after the neutron diffraction data are obtained, preprocessing is performed on the data, including background data cropping and noise data clearing processing, and then the neural network is trained by using the neutron diffraction data obtained through preprocessing.
Further, the method for cropping background data in the neutron diffraction data comprises the following steps: analyzing the neutron diffraction data to determine the corresponding diffraction peak shape of the detected material; initializing parameters of the diffraction peak shape, including peak value, half-width height and peak position, according to the determined diffraction peak shape; based on the angle corresponding to the initialized peak value, referring to the initialized half-width height, cutting and clearing the background data in the neutron diffraction data by adopting a Levenberg-Marquardt algorithm, wherein the specific cutting method comprises the following steps:
(a1) sorting the neutron diffraction data after the efficiency calibration according to the neutron diffraction angle from small to large; wherein, neutron diffraction data corresponding to each channel is represented as point-to-point data (x, y, z), and x, y, z respectively represent diffraction angle, diffraction intensity and intensity error;
(a2) taking the 5 point pairs with the largest diffraction angle, and calculating the average value of the diffraction angles and the average value of the diffraction intensities to be used as an average value point; similarly, taking 5 point pairs with the minimum diffraction angle, calculating the average value of the diffraction angles and the average value of the diffraction intensities, and taking the calculated average values as another average value point; obtaining a straight line based on the two mean values, wherein the straight line is the background of the diffraction data;
(a3) background data is deducted from neutron diffraction data after efficiency calibration, and a diffraction angle corresponding to the current maximum diffraction intensity is determined as the current diffraction peak position;
(a4) determining the average value of the diffraction intensities of the left point and the right point of the point pair where the current maximum diffraction intensity is located as the current diffraction peak value;
(a5) outputting diffraction angles corresponding to 1/2 peak values from the diffraction peak position to two sides, wherein the absolute value of the difference value of the two diffraction angles is the full width at half maximum;
(a6) after the full width at half maximum is obtained, neutron diffraction data are clipped according to the multiple of the full width at half maximum. Further, after trimming and removing background data in the neutron diffraction data, removing noise therein, wherein the noise removing method comprises the following steps:
(a1) cutting the cleaned neutron diffraction data of the background data, and sequencing the neutron diffraction data from small to large according to the neutron diffraction angle; wherein, neutron diffraction data corresponding to each channel is represented as point-to-point data (x, y, z), and x, y, z respectively represent diffraction angle, diffraction intensity and intensity error; in the neutron diffraction point pair data sequence, selecting L point pair data from the leftmost end of the sequence by using a window with the length of L;
(a2) calculating the Euclidean distance between every two point pairs of data in the current window:
Figure BDA0003283357560000034
in the formula (d)12For Euclidean distance, x, between two different point pairs of data1,x2Diffraction angle, y, for data at two different points1,y2Diffraction intensities for the data for two different points;
(a3) for each point pair data in the current window, taking the minimum Euclidean distance d between the point pair data and other point pair data in the windowminCalculating the mean value d of Euclidean distances between the point pair data and all other point pair dataavg(ii) a If d ismin>3*davgIf the point pair data is noise data, discarding the point pair data; otherwise, the point pair data is reserved;
(a4) the window is shifted rightward by 1 dot pair data, and the procedure returns to step (a2) until the above judgment processing is performed on all the neutron diffraction dot pair data.
Further, the loss function adopted for training the built neural network is as follows:
Figure BDA0003283357560000041
where p denotes all weights and bias parameters in the neural network that need to be updated, yexpFor training the point pairs of the neural network the diffraction intensity, y, in the datapreThe predicted diffraction intensity for the neural network, ε is the intensity error in the point pair data for the trained neural network.
Further, in the process of training the built neural network, parallel computing optimization is carried out by adopting multiple GPUs based on a TensorFlow framework.
An electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor implements the neural network-based neutron diffraction peak position prediction method according to any one of the above technical solutions.
A computer-readable storage medium, on which a computer program is stored, wherein the computer program, when executed by a processor, implements the neural network-based neutron diffraction peak position prediction method according to any one of the above aspects.
Has the advantages that: this patent establishes the neutron diffraction peak position prediction model that can accurate output neutron diffraction data based on neural network model, through the reconstruction loss function at the in-process of constructing the model, introduces the error that neutron diffraction intensity corresponds as the weight of loss function to this reduces the error that factors such as experimental environment and detecting instrument sensitivity lead to. And preprocessing the diffraction data is completed based on a background data cropping algorithm and a noise data removing algorithm, and the interference of the noise data on model training is basically removed. And continuously training the model by using a Levenberg-Marquardt algorithm, obtaining an accurate functional relation between the neutron diffraction angle and the neutron diffraction intensity along with the end of model training, and finally outputting a high-precision neutron diffraction peak position.
Drawings
FIG. 1 is a flow chart of a design of a sub-diffraction peak position prediction model according to an embodiment of the present application;
FIG. 2 is a schematic view of the angle conversion of the detector;
FIG. 3 shows a two-dimensional surface view simulation of a neutron detector;
FIG. 4 shows a two-dimensional area detection efficiency interval of the neutron detector;
FIG. 5 channel versus intensity;
FIG. 6 background data and noise data distribution;
FIG. 7 is a flow chart of a background data cropping algorithm;
FIG. 8 is a graph of the noise-cleaning algorithm cleaning data;
FIG. 9 shows an overall structure of a neutron diffraction peak prediction model;
FIG. 10 Single neuron structures;
FIG. 11 is a process of training a neutron diffraction peak prediction model;
FIG. 12 shows a parallel optimization architecture of a neutron diffraction peak prediction model GPU;
FIG. 13 is a scatter plot of neutron diffraction data for six groups;
FIG. 14[5-5] nonlinear regression plots of neutron diffraction peak position prediction models;
FIG. 15[7-6] nonlinear regression plots of neutron diffraction peak position prediction models;
FIG. 16[8-7] nonlinear regression plots of neutron diffraction peak position prediction models;
FIG. 17[100-100] is a nonlinear regression graph of a neutron diffraction peak position prediction model;
FIG. 18 is a multimodal scatter plot of neutron diffraction data;
FIG. 19[8-7] fitting of a model for predicting the position of a double neutron diffraction peak;
FIG. 20[20-15] fitting of a model for predicting the position of a double neutron diffraction peak.
Detailed Description
The following describes embodiments of the present invention in detail, which are developed based on the technical solutions of the present invention, and give detailed implementation manners and specific operation procedures to further explain the technical solutions of the present invention.
The invention discloses a neutron diffraction peak position prediction method based on a neural network, which is shown by referring to fig. 1 and comprises the following processes:
system presetting: measuring and calibrating an included angle between the right middle position of the detector and an incident neutron beam to be a preset angle 2 theta, diffracting the detected material by using the neutron beam, and collecting neutrons generated during the diffraction of the detected material by using the neutron detector;
acquiring neutron diffraction data: converting the position of each channel of the neutron detector into a channel deviation angle delta theta, and obtaining the angle of each channel of the neutron detector according to a preset angle 2 theta and the channel deviation angle delta theta; counting the diffraction intensity and intensity error of each channel of the neutron detector according to the number of neutrons collected by each pixel block of the neutron detector;
and (3) building a framework: constructing a neural network architecture of a neutron diffraction peak position prediction model, wherein the neural network architecture comprises the number of hidden layers, the number of neurons of each hidden layer, an input layer and an output layer;
taking the angle of each channel of the neutron detector as input and the diffraction intensity as output, introducing an intensity error into a loss function, training the built neural network, namely fitting the functional relation between the angle and the diffraction intensity, and obtaining a neutron diffraction peak position prediction model which is the functional relation between the angle and the diffraction intensity;
and finding the angle corresponding to the maximum value of the diffraction intensity according to the functional relation between the angle and the diffraction intensity obtained by fitting, wherein the angle is the neutron diffraction peak position of the material to be detected.
Each process is explained below separately.
1. System preset
Referring to fig. 2, an included angle between the center of the detector and the incident neutron beam is measured and calibrated to be a preset angle 2 θ, the neutron beam diffracts the detected material, each pixel block of the neutron detector collects neutrons generated by the diffraction of the detected material, the diffraction intensity of each pixel block is reflected by counting the number of the neutrons, and the diffraction intensity of each channel of the neutron detector is obtained.
2. Obtaining neutron diffraction data
The two-dimensional surface detector of the neutron detector is a square matrix consisting of small squares, such as a two-dimensional surface detector simulation diagram shown in fig. 3, wherein the small blue square in the diagram is called a pixel block, namely a pixel.
(1) Calculating neutron acquisition efficiency
In a neutron spectrometer system, two-dimensional surface probes of detectors are used, one of which is a two-dimensional surface probe comprising 1024 × 1024 pixel blocks, and the other of which is a two-dimensional surface probe composed of 512 × 512 pixel blocks. Each pixel block will acquire an unequal number of neutrons, so the efficiency of neutron acquisition for each pixel block needs to be calculated. The efficiency calculation is an early-stage test of the two-dimensional surface detection of the neutron detector so as to calibrate the number of neutrons actually acquired by the neutron detector and improve the accuracy of data. The main process is as follows: and uniformly beating the same number of neutrons on each pixel block perpendicular to the two-dimensional surface detector, and analyzing the number of actually collected neutrons, so that the efficiency of any pixel block in the two-dimensional surface detector can be obtained after calculation through the efficiency calculation formulas shown in the formula (1) and the formula (2).
Figure BDA0003283357560000061
Figure BDA0003283357560000062
Referring to FIG. 3, i represents the ith row in the two-dimensional surface search, j represents the jth column of the two-dimensional surface search, and NijRepresenting the number of neutrons obtained by the ith row and jth column of pixel blocks, N representing the number of pixel blocks of one dimension in a two-dimensional planar exploration, and NavgFactor represents the average neutron number per pixel blockijShowing the neutron collection efficiency of the ith row and jth column pixel block.
N in equation (1) can vary depending on the number of normal pixel blocks in the efficiency interval, as selected by the block shown in fig. 4. The neutron beams hit the two-dimensional area probe uniformly, but because of the angular deviation, the number of neutrons received by the pixel blocks in the middle area fluctuates around a fixed value, which is 40000 in fig. 4. However, in the detector edge region with a large angle deviation, the number of received neutrons may deviate from a fixed value, and therefore, the counting content of the pixel blocks is discarded.
(2) Calibrating the number of neutrons collected using neutron collection efficiency to obtain the diffraction intensity and intensity error of the channel
After the efficiency calculation of the two-dimensional surface exploration is completed in the early stage, in the experimental process of measuring the residual stress of a neutron stress spectrometer system, the number of the collected neutrons needs to be subjected to error calibration. Through the calculation of the process, the calibrated diffraction intensity of each pixel block and the intensity error integrated with the diffraction intensity in each pixel block can be obtained, and the calculation mode is as shown in formula (3) and formula (4):
Figure BDA0003283357560000071
Figure BDA0003283357560000072
wherein
Figure BDA0003283357560000073
The number of neutrons collected for the ith row and jth column of pixel blocks,
Figure BDA0003283357560000074
the data after calibration is the diffraction intensity of the ith row and the jth column of pixel blocks;
Figure BDA0003283357560000075
and the intensity error of the ith row and jth column pixel block in the two-dimensional surface detection of the neutron detector is represented.
And (3) reserving the x direction for the intensity and the intensity error of the pixel block in each normal interval calculated in the error calibration step, and accumulating the diffraction intensities of all the pixel blocks in each column along the y direction to obtain the intensity integration corresponding to the x position. And then continuing to accumulate errors corresponding to the diffraction intensities in all the pixel blocks in each column along the y direction, thereby obtaining errors corresponding to the intensity integration. Wherein, the x direction is the channel direction, each column of pixel blocks corresponds to one channel, each detector has N total channels, so that the diffraction intensity and the intensity error of each channel can be obtained, and the relationship between the channel and the diffraction intensity is shown in fig. 5.
(3) Calculating diffraction angles of channels
Besides the above-mentioned diffraction intensity and intensity error, it is also necessary to convert the diffraction angle of each channel of the detector.
As shown in fig. 2, the angle of the central position, i.e. the included angle between the middle position of the detector and the incident neutron beam, has been measured and calibrated to a preset angle 2 θ when the system is preset, so that at this time, only the channel deviation angle Δ θ of each channel with respect to the central position needs to be obtained.
Referring to fig. 2, L is a distance from the detector to a position to be detected of the material to be detected, Δ L is a length of each pixel block, a distance from each channel to a position deviated from a center of the detector is Δ L — k × Δ L, and k is the number of the pixel blocks of the pixel block where the channel is located from the center of the detector. Since the distance L from the material being measured to the probe is known, as is the Δ L for each channel deviation, the angular value Δ θ for each channel deviation can be calculated from the inverse trigonometric function, i.e., equation (5). Then, the right middle position of the detector is taken as a zero point, the angle value is 2 theta, the diffraction angle of the channel in the positive direction of the detector is 2 theta + delta theta, and the diffraction angle of the channel in the positive direction of the detector is 2 theta-delta theta. Therefore, the angle of each channel of the neutron detector is calculated, and the data of the point pair form (angle, intensity and intensity error) is finally obtained by combining the intensity and the intensity error obtained by accumulation before, namely the neutron diffraction data.
The channel deviation angle calculation formula is as follows:
Figure BDA0003283357560000081
(4) background data cropping
The neutron beams received by the neutron detector are not uniform, so that the diffraction data contain background data, and the background data and the noise data are accompanied with the diffraction data after the efficiency calculation, the calibration error calculation and the angle conversion calculation. The existence of background data can greatly influence the precision of finding neutron diffraction peak positions, if the fitting error of the neutron diffraction peak positions is too large due to the fact that diffraction data are directly fitted, the error is also large when three-way strain is calculated, and finally the residual stress of the measured material is inaccurately calculated. Neutron diffraction data, with background data and noise data as shown in fig. 6, were obtained according to the above procedure.
Therefore, background data needs to be cleared before neutron diffraction data fitting, so that data fitting errors are reduced, and accuracy of neutron diffraction peak position prediction is improved. After the background data is additionally cleaned up, some data sets are found to contain significant noise points if the scatter data continues to be shown with images. The isolation of noisy points from other data generally interferes with the fitting of diffraction data, and noisy points need to be removed to avoid such interference. This implementation will therefore perform background data clipping and noise data cleaning on the neutron diffraction data obtained as described above.
Trimming and clearing of background data are performed first.
Background data of neutron diffraction data is not a certain data range, and background data areas of diffraction data obtained by measuring different materials or even different positions of the materials are likely to have large differences, so that if the data are cut according to a fixed data range, the effective range of the diffraction data can be mistakenly cut. Therefore, an adaptive algorithm needs to be designed for trimming the background data according to the characteristics of the neutron diffraction data, and by combining the traditional data fitting mode in the stress analysis, the embodiment designs a background data trimming algorithm based on the Levenberg-Marquardt algorithm to realize efficient trimming of the diffraction data, and the algorithm flow is shown in fig. 7.
In the algorithmic flow chart of fig. 7, the first step is to input diffraction data and the second step is to estimate gaussian parameters. The step needs to be designed because the Levenberg-Marquardt algorithm needs to use different scheme initial iteration parameters according to different selected peak shape functions when fitting different peak shapes, so diffraction data need to be analyzed before the process starts to distinguish the specific types of diffraction peak shapes corresponding to materials, currently, although more than 90% of data use gaussian peak shapes, other peak shapes need to be distinguished, and finally, the initialization scheme corresponding to the parameters is designed according to the difference of the selected peak shapes.
In order to facilitate the understanding of parameter initialization, and because of the ratio of the gaussian peak shape, the present embodiment provides initialization steps of three parameters, namely, the peak value, the full width at half maximum, and the peak position, for the gaussian function:
sequencing original neutron diffraction data from small to large according to diffraction angles;
obtaining background data parameters by diffraction intensity average values corresponding to the minimum and maximum five diffraction angles, namely, averagely calculating point pair data of the minimum five diffraction angles to obtain a diffraction angle and a diffraction intensity value, averagely calculating point pair data of the maximum five diffraction angles to obtain a diffraction angle and a diffraction intensity value, and calculating a straight line based on the two points, wherein the straight line is the background of the diffraction data;
subtracting background data of the linear function by using the original data, wherein the diffraction peak position of the initial estimation is determined by the maximum intensity value in all diffraction data;
the peak value is the average value of the intensity of five points around the diffraction peak position obtained previously;
the diffraction angle corresponding to 1/2 peak values from the diffraction peak position to both sides is outputted, and the absolute value of the difference between the two diffraction angles is the full width at half maximum.
After obtaining the estimated values of the peak value, the peak position and the full width at half maximum, based on the neutron diffraction peak position, the diffraction data is clipped according to the multiple range of the full width at half maximum, generally, the data is clipped according to 3 times of the full width at half maximum, namely, the ranges of 1.5 times of the full width at half maximum are respectively reserved from the diffraction peak position to the left and to the right, and the rest data are discarded. Combining the above analysis, the design and implementation concept of the background data cropping algorithm is shown as the following algorithm 1.
Algorithm 1 background data clipping algorithm based on Levenberg-Marquardt algorithm
Figure BDA0003283357560000091
Figure BDA0003283357560000101
After background data is cleared, the noisy data is cleared.
After background data is cleared, some noise data still exists in part of diffraction data, as shown in fig. 8, in order to reduce the influence of these noise points on the model training result, this subsection designs a neutron diffraction noise data clearing algorithm based on KNN, and the pseudo code algorithm 2 of the algorithm is shown.
Algorithm 2 noise data clean-up algorithm
Figure BDA0003283357560000102
The steps in filtering isolated point data using the neutron diffraction noise data clean-up algorithm according to the algorithm described in algorithm 2 are as follows:
(ii) neutron diffraction data ordering
And cutting the cleaned neutron diffraction data of the background data, and sequencing the neutron diffraction data from small to large according to the neutron diffraction angle. Wherein, neutron diffraction data corresponding to each channel is represented as point-to-point data (x, y, z), and x, y, z respectively represent diffraction angle, diffraction intensity and intensity error; in the neutron diffraction point pair data sequence, L pieces of point pair data are selected from the leftmost end of the sequence by using a window with the length of L. This is to ensure that the 5 point pairs taken by the algorithm are absolutely adjacent positions, otherwise, a great error occurs, and it is highly possible that valid point pairs are deleted by mistake.
Calculating the Euclidean distance between every two point pairs of data in the current window:
Figure BDA0003283357560000111
in the formula (6), d12For Euclidean distance, x, between two different point pairs of data1,x2Diffraction angle, y, for data at two different points1,y2The diffraction intensities for the data for two different points.
Judging whether the point position is reserved: for each point pair data in the current window, taking the minimum Euclidean distance d between the point pair data and other point pair data in the windowminCalculating the mean value d of Euclidean distances between the point pair data and all other point pair dataa is to(ii) a If d ismin>3*davgIf the point pair data is noise data, discarding the point pair data; otherwise, the point pair data is reserved;
and fourthly, shifting the window by 1 point pair data to the right, and returning to the step (a2) until all the neutron diffraction point pair data are judged and processed.
After the noise data of the neutron diffraction data is cleaned through the algorithm, a scatter diagram shown in fig. 8 is obtained, and compared with the noise points shown in fig. 6, the noise points which exist before and are obvious do not exist in fig. 8.
After neutron diffraction data are preprocessed by the background data and noise data clearing method, the residual neutron diffraction data can be used as training sample data of the neural network.
3. Model architecture building and model training: constructing a neural network architecture of a neutron diffraction peak position prediction model, wherein the neural network architecture comprises the number of hidden layers, the number of neurons of each hidden layer, an input layer and an output layer; and then, the diffraction angle and the diffraction intensity in the neutron diffraction data are respectively used as input and output, and the intensity error is introduced into a loss function to train the neural network.
3.1 construction of neutron diffraction peak position prediction model
Conclusion by the universal approximation theorem: neural networks can be approximately mapped from any finite scattering space to another function because of their nonlinear ability. It follows that a finite number of neurons can achieve a non-linear fit to the scatter data. The neutron diffraction peak shape prediction model comprising two hidden layers and an output layer is constructed based on the structural characteristics of a neural network model under the guarantee of the universal approximate theorem theory so as to realize the nonlinear regression of neutron diffraction data, and the structure of the model is shown in FIG. 9.
The input layer of the model architecture is the neutron diffraction angle, and the output layer is fixed with only one neuron for outputting the predicted neutron diffraction intensity value. The input data of the input layer in the neutron diffraction peak position prediction model in fig. 9 is a diffraction angle vector V ═ V1,v2,...,vN]The first column of diffraction angles in the data, consisting of sets of neutron diffraction point pairs, is typically input in vector form in the neural network model. The output of the output layer is the predicted diffraction intensity value
Figure BDA0003283357560000121
ypreThe diffraction intensity values predicted for the model.
FIG. 9 shows each neuron of the neutron diffraction peak position prediction model constructed as FIG. 10, which includes the input of the neuron, the bias of the neuron itself biAnd an activation function. The set of outputs of the neurons of the previous layer constitutes the input V ═ V of the neurons of the current neural layer1,v2,...,vN]The weights W ═ ω corresponding to these neurons1,ω2,...,ωN]The product of these two factors is then added to the corresponding bias b of the neuron in FIG. 10iThe input of the neuron activation function is calculated, but if the previous layer of the neuron is the input layer of the model, the input vector is the diffraction angle of the neutron diffraction data, and the calculation process is shown in formula (7).
Figure BDA0003283357560000122
After the input vector is obtained, due to the nonlinear characteristics of neutron diffraction data, in order to increase the nonlinear regression capability of the neutron diffraction peak position prediction model, the input vector is nonlinearly activated in the neuron by using an Activation Function (Activation Function), and the Activation functions of the neutron diffraction peak position prediction model are all hyperbolic tangent Activation functions, as shown in formula (8):
Figure BDA0003283357560000123
the result a obtained after the nonlinear activation of the input vector by the formula (8) is the output of the neuron, and similarly, other neurons of the neural network layer where the neuron is located will also obtain the same output. The input of the layer of neurons is integrated with the weight and bias of the next layer of neurons, that is, the input of the next layer of neurons, and if the input layer is the output layer, then a is the output of the neural network, otherwise, the input layer continues to propagate forward to the output layer of the model. The final output result of the neutron diffraction peak position prediction model is shown in formula (9).
Figure BDA0003283357560000124
A in formula (9)3The output value of the whole neutron diffraction peak position prediction model, namely the final intensity prediction value. N is the number of diffraction data input, the first hidden layer of the model has S neurons, M is the number of neurons in the second hidden layer, vjRepresenting the jth input, and if v in the input layerjThen the input neutron diffraction angle is represented. f. of1,f2And f and3respectively representing the activation functions of the first hidden layer, the second hidden layer and the output layer of the neutron diffraction peak position prediction model.
Figure BDA0003283357560000125
And
Figure BDA0003283357560000126
respectively representing the corresponding offset of the mth neuron in the first hidden layer and the second hidden layer of the neutron diffraction peak position prediction model, b3The bias of the output layer is indicated.
Figure BDA0003283357560000131
To connect the ith neuron in the first hidden layer with the weight value of the jth input layer,
Figure BDA0003283357560000132
the weight value of the ith neuron connected with the first hidden layer of the neutron diffraction peak position prediction model and the mth neuron corresponding to the second hidden layer of the neutron diffraction peak position prediction model is shown,
Figure BDA0003283357560000133
representing the weights connecting the mth neuron in the second hidden layer with the neurons of the output layer. Each iteration that the process of data forward propagation goes through in the modelInstead, the difference between the predicted diffraction intensity value and the experimental measurement intensity value needs to be calculated to determine the quality of the model, and the loss function is needed for the performance determination of the neural network model.
3.2 neutron diffraction peak position prediction model loss function reconstruction
In general, in the early stage of model training, the predicted neutron diffraction intensity value has a large difference from the neutron diffraction point to the diffraction intensity value in the data, so a loss function needs to be designed to calculate the error between the predicted intensity value and the experimental intensity value, and the loss function is also used to propagate back the parameter set for updating the model. The loss function is a reflection of the model on the degree of closeness of the curve and the data, and the value of the loss function is larger as the closer effect is. It is generally used to optimize the parameters of the model: firstly, the model matches the predicted diffraction intensity value with the experimentally measured diffraction intensity value, then the error of the model at the iteration can be calculated by using a loss function, and the error of the neural network is reduced to the maximum extent by optimizing parameters (weight and bias) of the neural network by using a corresponding algorithm based on the error, which is also a basic training process of the neural network. Due to the characteristic of neutron diffraction data, when the diffraction data is acquired by using the two-dimensional surface detector, the sensitivity problem of a pixel block in the two-dimensional surface detector exists, and finally, the diffraction intensity value obtained by conversion corresponds to a corresponding error.
Therefore, in order to train the neutron diffraction peak position prediction model better, so as to reconstruct the loss function, an error value corresponding to the diffraction intensity is introduced into the loss function, that is, the loss function is weighted, as shown in formula (10):
Figure BDA0003283357560000134
where p denotes all weights and bias parameters in the neural network that need to be updated, yexpFor training the point pairs of the neural network the diffraction intensity, y, in the datapreThe predicted diffraction intensity for the neural network, ε is the intensity error in the point pair data for the trained neural network.
The loss function minimizes the weighted square sum of the difference value between the predicted value and the experimental value of the model so as to train the neural network, and the nonlinear capability of the neutron diffraction peak position prediction model obtained by training can be improved.
3.3 Peak position prediction model training convergence decision
Training of the neutron diffraction peak position prediction model can carry out loop iteration in the forward calculation and back propagation processes, but the program can not be enabled to run endlessly, and the calculation is required to be stopped by a relevant condition, but the condition is required to meet the relevant standard of nonlinear regression, namely, the condition is theoretically converged to the local minimum position of neutron diffraction data. Of course, if the training effect is not achieved after the training is performed for many times, the training process of the model needs to be stopped, because resources are consumed to enter a dead loop after the continuous iterative training. Therefore, the following four termination conditions are designed to stop the model training, including gradient convergence, parameter convergence, error convergence and forced termination.
The process of constructing and training the neutron diffraction peak position prediction model can be simplified as shown in fig. 11. Before the model construction is started, neutron diffraction data are firstly obtained from a detector, and the neutron diffraction data are filtered. The forward calculation of the model is followed, and the weight matrix and the bias vector are updated by back propagation of errors by using a Levenberg-Marquardt algorithm so as to adjust the fitting capability of the model. And in the training process of forward flowing calculation and error back propagation of each round of diffraction data, judging whether the model meets the four corresponding termination conditions, and if so, stopping training iteration to obtain the final model in the training stage. From the above analysis, it is known that the stopping of the training iteration of the model requires multiple iterations, which inevitably requires a large amount of time overhead.
3.4 optimization model training based on parallel principles
A large number of matrix operations are involved in the neural network model training, and the model needs to undergo iteration for several times when being used for searching a local optimal value, so that the time overhead of the neutron diffraction peak position prediction model in the training stage is extremely large. Therefore, in order to improve the training efficiency of the neutron diffraction peak position prediction model, the computational power resources of the GPUs are fully utilized, a parallel optimization framework composed of three GPUs is constructed based on a Tensorflow framework parallel computation synchronization mode, and the framework is shown in fig. 12.
The parallel optimization architecture uses only three GPUs for three reasons: the first is because the increase in model efficiency does not linearly reduce the model training time with the increase in GPUs, because the communication between GPUs takes time. Second, due to the limitation of front-side bus bandwidth, the latency of different GPUs is different, which results in a long single-step runtime. And thirdly, the performance of the CPU required by the multiple GPUs in parallel is extremely high, and the resource overhead is very high, so that the requirement on the overall performance of the server is very high. In conclusion, the theoretical technology and the actual cost are considered, and three GPUs are finally selected to construct a parallel optimization training architecture. The principle of the parallel optimization architecture is as follows:
(1) the construction of a parallel optimization model is completed by building a structure consisting of three groups of GPUs on one machine, and then a training set in neutron diffraction data is distributed to the three groups of GPUs for training. Each time a set of forward calculation and backward propagation processes is completed, the difference between the neutron prediction intensity and the experimental intensity, that is, the loss value, is calculated.
(2) Based on a Levenberg-Marquardt back propagation algorithm, weights and bias parameters of neutron diffraction peak position prediction models trained by three groups of GPUs are respectively calculated by using a loss function, and then the average values of the three groups of weights and bias parameters are synchronously calculated. The reason why the calculation is synchronous is that the three groups of GPUs take different training set data, so that the local optimal positions of different data are mostly different, and therefore, it is likely that the training time costs are different due to different iteration times, and it is necessary to wait for the three groups of GPUs to complete the training of the same batch. And finally, updating the parameter group of the neutron diffraction peak position prediction model by using the average weights and the bias parameters, repeating the steps, and entering next training iteration until the neutron diffraction peak position prediction model meets the training termination condition.
From the principle analysis, the parallel optimization architecture is known to realize the updating of neutron diffraction peak position prediction model parameters by simultaneously training different data through multiple GPUs, and the architecture makes full use of the performance of the GPUs, so that the training efficiency of the model can be greatly improved.
4. Predicting neutron diffraction peak position of tested material
The neutron diffraction point is used for training data to obtain a neutron diffraction peak position prediction model, which is equivalent to fitting the functional relation between the angle and the diffraction intensity, so that the functional relation between the angle and the diffraction intensity is obtained. Furthermore, the angle corresponding to the maximum value of the diffraction intensity can be found according to the functional relationship between the angle and the diffraction intensity obtained by fitting, namely the neutron diffraction peak position of the measured material.
The training results of the neutron diffraction peak position prediction model in this embodiment will be shown below, including determination of model parameters, display of double diffraction peaks, and corresponding evaluation of the model. Six sets of diffraction data were randomly extracted from the multiple sets of diffraction data: the scatter data format of fig. 13-a to 13-f (i.e., all neutron diffraction point pairs data) is shown in fig. 13.
1. Model parameter determination
For convenience of representation, the framework of the neutron diffraction peak position prediction model is represented by using a-b, wherein the first letter a represents the number of neurons of the first hidden layer of the model, the second letter b represents the number of neurons of the second hidden layer, namely, the neutron diffraction peak position prediction model in the form of [4-3] represents that the first hidden layer of the model contains four neurons, and the second hidden layer of the model contains three neurons. Then, six sets of diffraction data in FIG. 13 are trained by using neutron diffraction peak position prediction models of the four architectures [5-5], [7-6], [8-7], [100- ], and a curve effect graph is shown.
(1) The fitting result of the [5-5] structure formed when the number of neurons in both hidden layers is 5 in the neutron diffraction peak position prediction model is shown in fig. 14. From this fact, it is obvious that the convergence effect of the data in fig. 14-a, 14-b, 14-c and 14-f in six groups of data is very undesirable and is basically in an under-fitting state, and fig. 14-d and 14-e barely meet the fitting standard. In fact, most of the other data not shown have poor convergence, so the number of neurons is increased to increase the nonlinear capability of the model before the next training of the model begins.
(2) The fitting results of the [7-6] structure formed when the number of neurons in the two hidden layers of the neutron diffraction peak position prediction model is 7 and 6 respectively are shown in fig. 15. And (3) according to a training result obtained by using a [5-5] neutron diffraction peak position prediction model in the first experiment, adjusting and using a [7-6] neutron diffraction peak position prediction model to train the data of the whole neutron diffraction training set in the experiment. In fig. 15, the effects of fig. 15-b, 15c and 15-f are obviously improved compared with those of fig. 14, 14-b, 14-c and 14-f, although the effect of fig. 15-d still does not reach the standard, the effect of the data of fig. 15-e is good, but the curve of fig. 15-a is still in an under-fit state. Overall, the [7-6] model has a general effect on most data, and a small part of data has an excellent effect, but the curve fitting effect of the small part of data is still poor. This is clearly not in line with the high standard required for stress calculation, so the magnitude of the neurons in the model hidden layer will be adjusted again.
(3) The fitting results of the [8-7] structure formed when the number of neurons in the two hidden layers of the neutron diffraction peak position prediction model is 8 and 7 respectively are shown in fig. 16. From the six sets of neutron diffraction data shown in the figure, the fitting effect of the model is obviously improved compared with that of the previous models [5-5] and [7-6 ]. Comparing the fitting results of the model in the six groups of data before, the [8-7] model has excellent fitting effect. The same is true for the majority of the diffraction data not shown in the other sets, and the curve fitting effect is also very close to the scatter data.
(4) The fitting result of the [100-100] structure formed when the number of neurons in both hidden layers is 100 in the neutron diffraction peak position prediction model is shown in FIG. 17. Multiple experiments prove that the fitting effect is not obviously improved along with the continuous increase of the number of neurons, even the model has poor performance in verifying a data set and testing the data set due to overfitting, and then the number of neurons in two hidden layers of the model is respectively improved to 100 in order to test the nonlinear processing capacity of the number of neurons on the model, and the fitting effect is shown in figure 17.
As can be seen from the curve fitting effect graph shown in fig. 20, the over-fitting phenomenon occurs in the training results of the neutron diffraction data of the six groups, the scattered points are connected by the curve trained by the model, and the same problem occurs in other groups of data. The overfitting phenomenon occurring in the training set also inevitably occurs in the neutron diffraction data fitting process of the verification set and the test set, and therefore the fact that the effect of the neural network model does not become good along with the increase of the number of neurons is proved. And because of the over-fitting phenomenon, the consumption of a computer is increased, and the training time of the model is prolonged. This is an obstacle to rapidly processing a large amount of neutron diffraction data, and therefore the number of neurons needs to be controlled in a good range to fit the diffraction data with high efficiency and high accuracy and output the diffraction peak position. Therefore, the number of neurons in the final neutron diffraction peak position prediction model is determined as follows: the first hidden layer and the second hidden layer are respectively built by 8 neurons and 7 neurons, and the number of neurons in the output layer is one.
2. Double diffraction peak display
The process of training neutron diffraction data in the experiment determines the final framework of the neutron diffraction peak position prediction model fitting the single peak. However, since there is a case where a very small portion of the neutron diffraction data is a double diffraction peak, in order to deal with this case, a new model architecture designed for fitting double diffraction peak data will be presented in the next subsection, and the fitting result will be analyzed and presented in detail.
In the scattergram of neutron diffraction data, there is a very small number of double diffraction peaks, and as shown in fig. 18, the first diffraction peak is located at approximately 47.5 ° in the diffraction angle, and the second diffraction peak is located at approximately 55.5 ° in the diffraction angle. Currently, 10000 sets of data collected only contain less than 20 sets of bimodal data, but in order to analyze neutron diffraction data with various different attributes in an all-round manner, a model of a single diffraction peak is firstly used in this section to fit the data. Then, the framework of the neutron double diffraction peak position prediction model is redesigned, and the result is analyzed.
For processing doublet diffraction peaks, the doublet diffraction data will be first fitted using the previously determined [8-7] neutron diffraction peak position prediction model, again for transverse to longitudinal comparisons, here two sets of doublet diffraction data plots will be presented, with the curve fitting effect plot shown in FIG. 19.
In fig. 19, the group of fig. 19-a fits well to the small peak around 55.5 °, but the main peak around 47.5 ° is generally effective, while the group of fig. 19-b [8-7] model fits well to the main peak around 47.5 °, but the small peak around 55.5 ° and the data around are under-fitted. Overall, the [8-7] model is not ideal for fitting bimodal diffraction data, and therefore the number of neurons in the hidden layer needs to be adjusted. In the model parameter adjustment process, after the number of neurons is adjusted for multiple times, a [20-15] model is determined to fit the double diffraction peaks, and the experimental result is shown in fig. 20.
It is obvious from fig. 20 that the fitting effect is greatly improved compared with the [8-7] neutron diffraction peak position prediction model, and the fitting effect of the curves of two peak positions and scattered point data is very close to a perfect ground step, and the fitting effect of other dozens of groups of double-peak data which are not shown is also very perfect. The general algorithm is not able to fit bimodal data, so the [20-15] bimodal model has a great advantage over other algorithms.
3. Neutron diffraction peak position prediction model evaluation
In order to scientifically and quantitatively evaluate the effect of fitting diffraction data of a neutron diffraction peak position prediction model, two classical model evaluation parameters in machine learning are introduced: one is Root Mean Square Error (RMSE); another parameter is Goodness of Fit (Fit), i.e., R2
TABLE 1 RMSE value comparison of different numbers of neurons in hidden layer
Figure BDA0003283357560000171
The comparison of the RMSE values of different numbers of neurons in the hidden layer shown in table 1 shows that, when the numbers of neurons in the hidden layer of the neutron diffraction peak prediction model are 8 and 7, respectively, on the neutron diffraction data validation set, the root mean square error value is mostly in a better interval range, because most of the data is between 1.0 and 2.0, and the RMSE value of few of the data exceeds 3.0, which proves that the model has a very good performance in the validation data set. In addition, before that, the fitting effect of the model gradually becomes better along with the gradual increase of the number of the neurons of the two hidden layers, for example, from [5-5]]Model to [7-6]Model go to [8-7]]Model, there is a significant improvement in RMSE values, with most data having RMSE values approaching 1.0. However, as the number of hidden layer neurons increases, the RMSE value is further improved, for example, at [100-]In the model, the value of RMSE does not rise or fall inversely because although the model performs well in the training dataset, it is actually already over-fitted to the training dataset, and the previously fitted curve images also clearly show this phenomenon, and therefore do not perform well on the validation set. To further validate [8-7]]The advantage of the model is that R of different number of neurons in the hidden layer will be analyzed2Comparison of values, as shown in Table 2.
TABLE 2R of different numbers of neurons in hidden layer2Value comparison
Figure BDA0003283357560000172
Figure BDA0003283357560000181
Hiding R of different numbers of neurons in layers from tables 3-52Value comparison can be obtained from [5-5]]Model to [7-6]Model go to [8-7]]The neural network model of the model has more and more groups of neutron diffraction data along with the gradual increase of the number of hidden layer neurons in the modelCorresponding R2The value is close to 1.0. From the front face R2It can be concluded that these models work better on the test set. In these four comparisons of results, R for most of the diffraction data2The value is in the range of 0.985-1.0, the data of a very small part is below 0.975, R2The behavior of the values is a very good evaluation for the fitting of the curve. At [100-]In model, R2The value is not obviously increased, but a small downward slip exists, but the correlation calculation of the model is definitely exponentially increased, which greatly increases the time overhead of the model in processing data, so that the number of neurons should be reduced as much as possible to improve the operating efficiency of the model. Incorporating various R2Comparison between values, [8-7]]The neutron diffraction peak position prediction model has excellent advantage on the parameter.
In summary, the neutron diffraction peak position prediction model is finally determined as follows: the neuron unit quantities of the first hidden layer and the second hidden layer are respectively 8 and 7, and the output layer only has 1 neuron because the neutron diffraction peak position prediction model only has one output. To verify the superiority of the model in fitting neutron diffraction data.
In order to verify the fitting performance of the neutron diffraction peak position prediction model to neutron diffraction data, some general data fitting algorithms, such as a Levenberg-Marquardt algorithm, a random forest, a least square algorithm and a gradient descent algorithm, are introduced, then the algorithms are used for fitting neutron diffraction data with the same group number, and the experimental results of the algorithms are compared on the premise of ensuring the consistency of a hardware environment and a software environment. The contrast parameters include RMSE and R used in the previous subsection2Since massive neutron diffraction data need to be processed in the experimental process, a Time overhead parameter (Time) is introduced at the same Time, and the comparison result between each set of algorithms is shown in table 3.
TABLE 3 Performance comparison of neutron diffraction data processed by different algorithms
Figure BDA0003283357560000182
(1) As can be seen from Table 3, use of [8-7]]RMSE and R obtained after training each group of diffraction data by neutron diffraction peak position prediction model2The effect achieved by respectively averaging is optimal compared with other algorithms, and the accuracy achieved by neutron diffraction peak position prediction models of the other algorithms on the two parameters is far from being achieved by the other algorithms, so that the fitting effect of the models on diffraction data is excellent.
(2) Compared with a gradient descent method, a least square and random forest, the neutron diffraction peak position prediction model is in RMSE and R2And is also comprehensive in time overhead, so the comparison with the three algorithms will not be described. Compared with the common Levenberg-Marquardt algorithm, the RMSE value is reduced by a plurality of times and is close to 1.0, and R2The value is improved by 110%, and is close to 1.0, but the Levenberg-Marquardt algorithm has a great advantage in time overhead.
(3) The Levenberg-Marquardt algorithm has the advantage of time overhead because the Levenberg-Marquardt algorithm is obtained by combining a gradient descent method and a Gauss-Newton method, namely, a Gauss-Newton iteration step is used when the gain is larger, and a gradient descent step is used when the gain is smaller, so that the efficiency of the Levenberg-Marquardt algorithm is greatly improved by the mode, and a local optimization position can be quickly found by a model.
(4) The conclusion of the advantage of the Levenberg-Marquardt algorithm in terms of time overhead also directly demonstrates why the Levenberg-Marquardt algorithm is based on the background data cropping, because the Levenberg-Marquardt algorithm is extremely efficient in operation and the time overhead of the pre-processing is within a reasonable range. In order to calculate the residual stress of the material with higher precision, the neutron diffraction peak position prediction model studied in this chapter has an excellent processing effect on diffraction data.
The above embodiments are preferred embodiments of the present application, and those skilled in the art can make various changes or modifications without departing from the general concept of the present application, and such changes or modifications should fall within the scope of the claims of the present application.

Claims (10)

1. A neutron diffraction peak position prediction method based on a neural network is characterized by comprising the following steps:
system presetting: measuring and calibrating an included angle between the right middle position of the detector and an incident neutron beam to be a preset angle 2 theta, diffracting the detected material by using the neutron beam, and collecting neutrons generated during the diffraction of the detected material by using the neutron detector;
acquiring neutron diffraction data: converting the position of each channel of the neutron detector into a channel deviation angle delta theta, and obtaining the angle of each channel of the neutron detector according to a preset angle 2 theta and the channel deviation angle delta theta; counting the diffraction intensity and intensity error of each channel of the neutron detector according to the number of neutrons collected by each pixel block of the neutron detector;
building a model architecture: constructing a neural network architecture of a neutron diffraction peak position prediction model, wherein the neural network architecture comprises the number of hidden layers, the number of neurons of each hidden layer, an input layer and an output layer;
taking the angle of each channel of the neutron detector as input and the diffraction intensity as output, introducing the intensity error into a loss function, training the built neural network, namely fitting the functional relation between the angle and the diffraction intensity, and obtaining a neutron diffraction peak position prediction model which is the functional relation between the angle and the diffraction intensity;
and finding the angle corresponding to the maximum value of the diffraction intensity according to the functional relation between the angle and the diffraction intensity obtained by fitting, wherein the angle is the neutron diffraction peak position of the material to be detected.
2. The method of claim 1, wherein the diffraction intensity of each channel is the cumulative sum of the number of neutrons received by all pixel blocks on the channel.
3. The method of claim 1, wherein the method for counting the diffraction intensity and intensity error of each channel of the neutron detector comprises:
(1) calculating the neutron collection efficiency of each pixel block of the neutron detector: uniformly printing neutrons with the same quantity on each pixel block which is vertical to the two-dimensional surface detection of the neutron detector, then counting the number of actually acquired neutrons of each pixel block, and calculating the neutron acquisition efficiency of each pixel block:
Figure FDA0003283357550000011
Figure FDA0003283357550000012
in the formula, i represents the ith row in the two-dimensional surface exploration, j represents the jth column of the two-dimensional surface exploration, and NijRepresenting the number of neutrons obtained by the ith row and jth column of pixel blocks, N representing the number of pixel blocks of one dimension in a two-dimensional planar exploration, and NavgFactor represents the average neutron number per pixel blockijRepresenting the neutron collection efficiency of the ith row and the jth column of pixel blocks;
(2) according to the neutron collection efficiency of the pixel block, the number of neutrons collected by the pixel block is calibrated to obtain the diffraction intensity and the intensity error of the pixel block:
Figure FDA0003283357550000013
Figure FDA0003283357550000021
in the formula (I), the compound is shown in the specification,
Figure FDA0003283357550000022
the number of neutrons collected for the ith row and jth column of pixel blocks,
Figure FDA0003283357550000023
the data after calibration is the diffraction intensity of the ith row and the jth column of pixel blocks;
Figure FDA0003283357550000024
representing the intensity error of the ith row and jth column pixel block in the two-dimensional surface detection of the neutron detector;
(3) and respectively accumulating the diffraction intensity and the intensity error of all pixel blocks on each channel along the channel distribution direction of the neutron detector to obtain the diffraction intensity and the intensity error of the channel.
4. The method of claim 1, wherein after neutron diffraction data is acquired, the data is pre-processed, including background data cropping and noise data clean-up, and the neural network is trained using the pre-processed neutron diffraction data.
5. The method of claim 4, wherein the cropping of background data in the neutron diffraction data is performed by: analyzing the neutron diffraction data to determine the corresponding diffraction peak shape of the detected material; initializing parameters of the diffraction peak shape, including peak value, half-width height and peak position, according to the determined diffraction peak shape; based on the angle corresponding to the initialization peak value, cutting and clearing the background data in the neutron diffraction data by adopting a Levenberg-Marquardt algorithm according to the initialized half-width height; the specific cutting method comprises the following steps:
(a1) sorting the neutron diffraction data after the efficiency calibration according to the neutron diffraction angle from small to large; wherein, neutron diffraction data corresponding to each channel is represented as point-to-point data (x, y, z), and x, y, z respectively represent diffraction angle, diffraction intensity and intensity error;
(a2) taking the 5 point pairs with the largest diffraction angle, and calculating the average value of the diffraction angles and the average value of the diffraction intensities to be used as an average value point; similarly, taking 5 point pairs with the minimum diffraction angle, calculating the average value of the diffraction angles and the average value of the diffraction intensities, and taking the calculated average values as another average value point; obtaining a straight line based on the two mean values, wherein the straight line is the background of the diffraction data;
(a3) background data is deducted from neutron diffraction data after efficiency calibration, and a diffraction angle corresponding to the current maximum diffraction intensity is determined as the current diffraction peak position;
(a4) determining the average value of the diffraction intensities of the left point and the right point of the point pair where the current maximum diffraction intensity is located as the current diffraction peak value;
(a5) outputting diffraction angles corresponding to 1/2 peak values from the diffraction peak position to two sides, wherein the absolute value of the difference value of the two diffraction angles is the full width at half maximum;
(a6) after the full width at half maximum is obtained, neutron diffraction data are clipped according to the multiple of the full width at half maximum.
6. The method of claim 4, wherein after trimming and removing background data in the neutron diffraction data, removing noise therein, the noise removing method comprises:
(a1) cutting the cleaned neutron diffraction data of the background data, and sequencing the neutron diffraction data from small to large according to the neutron diffraction angle; wherein, neutron diffraction data corresponding to each channel is represented as point-to-point data (x, y, z), and x, y, z respectively represent diffraction angle, diffraction intensity and intensity error; in the neutron diffraction point pair data sequence, selecting L point pair data from the leftmost end of the sequence by using a window with the length of L;
(a2) calculating the Euclidean distance between every two point pairs of data in the current window:
Figure FDA0003283357550000031
in the formula (d)12For Euclidean distance, x, between two different point pairs of data1,x2Diffraction angle, y, for data at two different points1,y2Diffraction intensities for the data for two different points;
(a3) for each point pair data in the current window, taking the minimum Euclidean distance d between the point pair data and other point pair data in the windowminCalculating the mean value d of Euclidean distances between the point pair data and all other point pair dataavg(ii) a If d ismin>3*davgIf the point pair data is noise data, discarding the point pair data; otherwise, the point pair data is reserved;
(a4) the window is shifted rightward by 1 dot pair data, and the procedure returns to step (a2) until the above judgment processing is performed on all the neutron diffraction dot pair data.
7. The method of claim 1, wherein the constructed neural network is trained using a loss function of:
Figure FDA0003283357550000032
where p denotes all weights and bias parameters in the neural network that need to be updated, yexpFor training the point pairs of the neural network the diffraction intensity, y, in the datapreThe predicted diffraction intensity for the neural network, ε is the intensity error in the point pair data for the trained neural network.
8. The method according to claim 1, characterized in that the built neural network is trained by parallel computing optimization based on Tensorflow framework using multiple GPUs.
9. An electronic device comprising a memory and a processor, the memory having stored therein a computer program, wherein the computer program, when executed by the processor, causes the processor to implement the method of any of claims 1-8.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1 to 8.
CN202111139848.9A 2021-09-28 2021-09-28 Neutron diffraction peak position prediction method, device and medium based on neural network Withdrawn CN113866817A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111139848.9A CN113866817A (en) 2021-09-28 2021-09-28 Neutron diffraction peak position prediction method, device and medium based on neural network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111139848.9A CN113866817A (en) 2021-09-28 2021-09-28 Neutron diffraction peak position prediction method, device and medium based on neural network

Publications (1)

Publication Number Publication Date
CN113866817A true CN113866817A (en) 2021-12-31

Family

ID=78991475

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111139848.9A Withdrawn CN113866817A (en) 2021-09-28 2021-09-28 Neutron diffraction peak position prediction method, device and medium based on neural network

Country Status (1)

Country Link
CN (1) CN113866817A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115079995A (en) * 2022-07-22 2022-09-20 中南大学 Method and system for sequencing measured sample measuring points of neutron spectrometer

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA3131254A1 (en) * 2019-03-29 2020-10-08 Daniel SERIE Automated detection of boundaries in mass spectrometry data
CN112614550A (en) * 2020-12-17 2021-04-06 华东理工大学 Prediction method of molecular sieve X-ray diffraction pattern peak position based on neural network

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA3131254A1 (en) * 2019-03-29 2020-10-08 Daniel SERIE Automated detection of boundaries in mass spectrometry data
CN112614550A (en) * 2020-12-17 2021-04-06 华东理工大学 Prediction method of molecular sieve X-ray diffraction pattern peak position based on neural network

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
LIU YANG等: ""Predicting residual stress by finding peak shape using artificial neural networks"", 《2020 IEEE INTL CONF ON PARALLEL & DISTRIBUTED PROCESSING WITH APPLICATIONS, BIG DATA & CLOUD COMPUTING, SUSTAINABLE COMPUTING & COMMUNICATIONS, SOCIAL COMPUTING & NETWORKING (ISPA/BDCLOUD/SOCIALCOM/SUSTAINCOM)》, pages 633 - 640 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115079995A (en) * 2022-07-22 2022-09-20 中南大学 Method and system for sequencing measured sample measuring points of neutron spectrometer
CN115079995B (en) * 2022-07-22 2022-11-11 中南大学 Method and system for sequencing measured sample measuring points of neutron spectrometer

Similar Documents

Publication Publication Date Title
Garcin Estimation of time-dependent Hurst exponents with variational smoothing and application to forecasting foreign exchange rates
Eiermann et al. Computational aspects of the stochastic finite element method
CN106815643A (en) Infrared spectrum Model Transfer method based on random forest transfer learning
CN103047959B (en) A kind of flat form error detection method based on entropy theory towards Fine Boring
CN107885928A (en) Consider the stepstress acceleration Degradation Reliability analysis method of measurement error
CN104614714B (en) Double calibration treatment method based on minimum weighted mean square error
CN1659574A (en) Selection of wavelengths for integrated circuit optical metrology
Zheng et al. A deep learning approach for high speed machining tool wear monitoring
CN113866817A (en) Neutron diffraction peak position prediction method, device and medium based on neural network
Glazov Machine learning as an instrument for data unfolding
Guo et al. Aerodynamic evaluation of cascade flow with actual geometric uncertainties using an adaptive sparse arbitrary polynomial chaos expansion
CN114611582A (en) Method and system for analyzing substance concentration based on near infrared spectrum technology
Li et al. Efficient neutrino oscillation parameter inference using Gaussian processes
CN113607546A (en) Crack measuring method
CN116502119A (en) Sensor fault detection method and device of structural health monitoring system
CN105824785A (en) Rapid abnormal point detection method based on penalized regression
Ferrandino Measuring spatial aggregation in binary epidemics: correlative analysis and the advantage of fractal-based sampling
CN112818762A (en) Large-size composite material and rapid nondestructive testing method for sandwich structure thereof
Li et al. A revised stochastic Nelder-Mead algorithm for numerical optimization
Rabinowit et al. The approximate distribution of the maximum of a smoothed Poisson random field
CN108197824B (en) High dam service safety space alert domain diagnosis method
CN113343492A (en) Theoretical spectral data optimization method and system and optical measurement method
JP2003502622A (en) How to determine the true spectrum from the measured spectrum
Олійник et al. Automated system for identification of data distribution laws by analysis of histogram proximity with sample reduction
CN116070533B (en) Neutron energy spectrum determination method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication

Application publication date: 20211231

WW01 Invention patent application withdrawn after publication