Conductivity change detection method under blue light irradiation
Through the improved Transformer network structure, the conductivity changes of materials under blue light irradiation are preprocessed and predicted, and the problem of the inability to monitor and predict the conductivity changes of materials under blue light irradiation in the prior art is solved, and efficient and real-time detection effects are achieved.
Patent Information
- Application Number
- CN202411985709.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-29
AI Technical Summary
The existing conductivity detection methods cannot dynamically evaluate the electrical behavior of materials under blue light irradiation in real time, and cannot effectively predict the changes in material conductivity under blue light irradiation, resulting in insufficiency of detection.
The improved Transformer network structure is used to preprocess and predict the conductivity change related data collected under blue light irradiation, so as to realize real-time monitoring and prediction of the dynamic changes in the material's conductivity.
Real-time monitoring and prediction of the dynamic changes in the material conductivity under blue light irradiation is realized, detection efficiency is improved, step-by-step detection process is avoided, and time and energy is saved.
Smart Images

Figure CN119903484A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of photoelectric functional material detection, and in particular to a method for detecting conductivity changes under blue light irradiation. Background Art
[0002] In recent years, optoelectronic functional materials have been increasingly used in the fields of photodetectors, solar cells, light-emitting diodes, etc. In these materials, the influence of light (especially light of a specific wavelength) on the electrical properties of the materials is crucial, such as the generation, recombination, and migration of photogenerated carriers. These phenomena are directly related to the change in the conductivity of the material under light conditions.
[0003] Existing conductivity detection methods are mostly based on dark conditions and cannot dynamically evaluate the electrical behavior of materials under light, especially the impact on specific wavelengths of light (such as blue light, with a wavelength range of approximately 450-490nm). Blue light has special significance in detection and application because of its high energy and obvious response to optoelectronic materials. For example, blue light can significantly affect the conductivity properties of perovskite materials and organic semiconductor materials, and may even cause photodegradation effects.
[0004] The current detection methods for conductivity changes under blue light irradiation have the following problems:
[0005] 1. Insufficient real-time performance: It is impossible to realize real-time detection of material conductivity during blue light irradiation;
[0006] 2. It is impossible to predict the conductivity of materials during blue light irradiation. If the test is carried out step by step, it often takes a lot of time and effort.
[0007] Therefore, there is an urgent need for a method that can efficiently and real-time detect changes in the conductivity of materials under blue light irradiation to provide more accurate technical support for the research and application of optoelectronic functional materials. Summary of the invention
[0008] In order to overcome the shortcomings of the prior art, the purpose of the present invention is to provide a method for detecting conductivity changes under blue light irradiation, which can realize the prediction of dynamic changes in material conductivity under blue light irradiation, without the need for step-by-step detection, easy to use and save time and effort.
[0009] To achieve the above object, the present invention provides the following solutions:
[0010] A method for detecting conductivity changes under blue light irradiation, comprising:
[0011] Collect data related to conductivity changes under blue light irradiation;
[0012] Preprocess the collected relevant data;
[0013] Based on the improved Transformer network structure, the conductivity changes of the preprocessed related data are predicted.
[0014] Preferably, collecting data related to conductivity changes under blue light irradiation includes:
[0015] Set the sample to be tested and the blue light source configuration, perform real-time detection of conductivity, and obtain the conductivity change sequence;
[0016] Obtain blue light source configuration information and obtain blue light irradiation parameters;
[0017] Collect surrounding environmental factors.
[0018] Preferably, the sample to be tested and the blue light source configuration are set to perform real-time detection of conductivity to obtain a conductivity change sequence, specifically:
[0019] Select a material to be tested, prepare a test sample, and arrange electrodes at both ends of the test sample to form an ohmic contact or a Schottky contact;
[0020] Select a blue light source with a wavelength of 450-490nm and set its light intensity range to 1-100mW / cm 2 , equipped with optical fiber or collimating lens to make the blue light shine evenly on the test sample;
[0021] The pulse frequency or light intensity of the blue light source is adjusted to provide different irradiation conditions for the test samples. At the same time, the conductivity test of the test samples is carried out through the high-precision digital conductivity tester in combination with electrodes to obtain a conductivity change sequence based on a time series.
[0022] Preferably, the blue light source configuration information is obtained to obtain the blue light irradiation parameters, specifically:
[0023] The blue light source pulse frequency sequence and light intensity sequence based on the time series are obtained and used as blue light irradiation parameters.
[0024] Preferably, the surrounding environmental factors are collected, specifically:
[0025] Based on the preset temperature sensor and humidity sensor, the temperature sequence and humidity sequence based on the time series are collected and taken as the surrounding environment factors.
[0026] Preferably, the collected relevant data is preprocessed, specifically:
[0027] Identify and remove outliers in conductivity change series, temperature series and humidity series.
[0028] Preferably, the conductivity change of the preprocessed relevant data is predicted based on the improved Transformer network structure, specifically:
[0029] A conductivity change prediction model is constructed based on the improved Transformer network structure;
[0030] Based on the type of the sample to be tested, the blue light irradiation parameters, and the conductivity change sequence, temperature sequence, and humidity sequence after pretreatment, a data set is generated, wherein the type of the sample to be tested, the blue light irradiation parameters, and the temperature sequence and humidity sequence after pretreatment are input values of the model, and the conductivity change sequence in the prediction time period is the output value of the model, and the conductivity change prediction model is trained based on the data set;
[0031] The type of the sample to be tested, the blue light irradiation parameters, and the temperature sequence and humidity sequence after pretreatment are input into the trained conductivity change prediction model to obtain the conductivity change sequence of the prediction time period.
[0032] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:
[0033] The present invention provides a method for detecting conductivity changes under blue light irradiation, comprising: collecting conductivity change related data under blue light irradiation, preprocessing the collected related data, and predicting conductivity changes of the preprocessed related data based on an improved Transformer network structure. The present invention can predict the dynamic changes of material conductivity under blue light irradiation without the need for step-by-step detection, is easy to use, and saves time and effort. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0035] Figure 1 A flow chart of a method provided by an embodiment of the present invention;
[0036] Figure 2 This is a schematic diagram of the process of removing outliers using the combined method;
[0037] Figure 3 It is a flowchart of Lowess local weighted regression outlier elimination algorithm based on template sliding window;
[0038] Figure 4 This is a schematic diagram of the SP_Attent ion process. DETAILED DESCRIPTION
[0039] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0040] The purpose of the present invention is to provide a method for detecting conductivity changes under blue light irradiation, which can realize the prediction of dynamic changes in material conductivity under blue light irradiation, does not require step-by-step detection, is easy to use, and saves time and effort.
[0041] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0042] Figure 1 A flow chart of a method provided by an embodiment of the present invention, such as Figure 1 As shown, the present invention provides a method for detecting conductivity changes under blue light irradiation, comprising:
[0043] Step 100: Collecting data related to conductivity changes under blue light irradiation;
[0044] Step 200: pre-processing the collected relevant data;
[0045] Step 300: Predicting conductivity changes of the preprocessed related data based on the improved Transformer network structure.
[0046] In step 100, data related to conductivity changes under blue light irradiation are collected, including:
[0047] Step 101: setting the sample to be tested and the blue light source configuration, performing real-time detection of conductivity, and obtaining a conductivity change sequence;
[0048] Step 102: Obtain blue light source configuration information to obtain blue light irradiation parameters;
[0049] Step 103: Collect surrounding environmental factors.
[0050] In step 101, the sample to be tested and the blue light source configuration are set to perform real-time detection of conductivity to obtain a conductivity change sequence, specifically:
[0051] Select the material to be tested (such as semiconductor film, organic optoelectronic material, etc.), prepare the test sample, arrange electrodes at both ends of the test sample to form ohmic contact or Schottky contact to ensure that the conductivity signal can be accurately collected. The electrodes are made of highly conductive metal materials (such as gold, silver or platinum) and deposited by evaporation, electroplating or screen printing;
[0052] Select a blue light source with a wavelength of 450-490nm (such as a blue LED array, laser, etc.) and set its light intensity range to 1-100mW / cm 2 , equipped with optical fiber or collimating lens to make the blue light shine evenly on the test sample;
[0053] Adjust the pulse frequency or light intensity of the blue light source to provide different irradiation conditions for the test samples. At the same time, the conductivity test of the test samples is carried out through the high-precision digital conductivity tester in combination with the electrodes to obtain the conductivity change sequence based on the time series.
[0054] Among them, the conductivity measurement formula is:
[0055]
[0056] In the formula, σ is the conductivity, R is the resistance value, L is the length of the sample, and A is the cross-sectional area of the sample;
[0057] Use the four-probe method or the two-probe method to reduce the influence of contact resistance on the measurement results.
[0058] In step 102, the blue light source configuration information is obtained to obtain the blue light irradiation parameters, specifically:
[0059] The blue light source pulse frequency sequence and light intensity sequence based on the time series are obtained and used as blue light irradiation parameters, wherein the light source pulse frequency and light intensity are independent variables, which can be directly derived from the blue light source without preprocessing operations.
[0060] Step 103, collecting surrounding environmental factors, specifically:
[0061] Based on the preset temperature sensor and humidity sensor, the temperature sequence and humidity sequence based on the time series are collected and taken as the surrounding environment factors.
[0062] In step 200, the collected relevant data is preprocessed, specifically:
[0063] Identify and remove outliers in conductivity change series, temperature series and humidity series;
[0064] The present invention provides three outlier identification and removal methods:
[0065] 1. Joint outlier elimination algorithm based on least squares trend term modeling and first-order difference restoration
[0066] For data containing outliers, a joint outlier elimination algorithm based on least squares trend term modeling and first-order difference restoration is used. The specific process of this method is as follows:
[0067] Step 1: First, the data trend item is modeled according to the least squares principle, and the detrended item data is obtained;
[0068] Step2: Perform first-order difference processing on the detrended data;
[0069] Step 3: Since the number of sampling points is sufficient and satisfies the normal distribution, the Chauvigne criterion can be used to test and eliminate outliers;
[0070] Step 4: Integrate and restore the first-order difference result after removing outliers;
[0071] Step 5: Add the restored data to the trend item to obtain the restored measurement data;
[0072] Step 6: Perform skewness analysis on the recovered data to detect whether there are still outliers in the data. If so, repeat the above steps. If not, stop and obtain the final data after removing outliers.
[0073] The process of the above steps is as follows Figure 2 As shown;
[0074] Introduce the relevant algorithms:
[0075] (1) Least Squares Detrending Term Modeling
[0076] There are many ways to eliminate trend terms, which are determined by the mathematical model of the object being measured. For simple trend terms of low-order polynomials or complex trend terms of high-order polynomials, a single form of function is generally used for fitting, such as the least squares algorithm, which has a good ability to predict data trends and is a commonly used method in actual engineering applications. The steps for least squares detrending term modeling are:
[0077] Step 1: Assuming the trend term polynomial, apply the least squares principle to obtain the trend term curve of the measured data;
[0078] Step 2: Subtract the trend term from the measured data to obtain the detrended data;
[0079] (2) Chauvigne Criteria
[0080] The Chauvenet criterion is a technical method proposed by Chauvenet et al. to evaluate whether there are outliers in the measured data. The basic idea is: under normal distribution conditions, according to the difference between the suspicious data and the average value, the probability of the point being an outlier is determined by consulting the coefficient table. If the result is greater than the threshold, it is considered an outlier. Assume that a set of discrete time series y i (t)(i=0,1,…,n-1), then the residual sequence is:
[0081]
[0082] In the formula, is the arithmetic mean, if the absolute value |v i |Satisfy|v i |>kσ, then the point is regarded as an outlier (k is the Chauvigne criterion coefficient, σ is the standard deviation of the measured data), and the outlier is corrected;
[0083]
[0084] The Chauvigne criterion coefficient k is generally determined by the length of the measurement data. Here, the high-end fitting formula of the coefficient is used, namely:
[0085] k=0.2688ln(n-20)+1.63
[0086] (3) Skewness analysis
[0087] Skewness is a measure of the degree and direction of the skewness of a statistical data distribution. It is used to determine the symmetry of the data distribution. In layman's terms, skewness is the degree of deviation between the peak and the mean, and determines whether it is symmetrical, left-skewed, or right-skewed.
[0088] 1) When skewness = 0, it means that the data is relatively evenly distributed on both sides of the mean;
[0089] 2) When the skewness is <0, it is called negative skewness, and most of the data is distributed to the left of the mean;
[0090] 3) When skewness > 0, it is called positive skewness, and most of the data is distributed to the right of the mean;
[0091] In fact, the physical meaning of skewness reflects the situation that the estimated value of the variance is biased towards the real data when there are outliers in the sequence. Therefore, when an outlier appears in a set of data, the outlier will cause the data distribution to be skewed to the left or right. In this way, it is possible to analyze whether there are outliers in the data. Based on this fact, when the absolute value of the skewness is greater than a certain threshold (here the threshold is 1), it means that there are outliers in the time series, otherwise the outlier check process ends.
[0092] 2. Lowess local weighted regression outlier elimination algorithm based on template sliding window
[0093] Introduce the basic principles of Lowess algorithm:
[0094] When the target model is a nonlinear model, the local weighted regression algorithm has a better fitting effect than the linear regression and polynomial regression algorithms, because the key to the algorithm is to set the window width and perform local regression on the points in the sliding window instead of regressing all the sampling points at once, so the fitting accuracy is improved;
[0095] Assume that the pulse radar performs n+1 measurements on the target within a certain time period [a, b], and divide the time interval into a=t0 according to the sampling time. <t1<t2<…<t n =b, the corresponding data coordinates are y0(t), y1(t), ..., y n (t), and any two t i The values of are different. When defining the loss function, we should give priority to reducing the error between the sampling points near the point to be fitted and the fitting curve, and make the points near the point to be fitted have higher weights. The weights decrease as the distance increases, so as to achieve better prediction results. In fact, it is consistent with the idea of weighted least squares algorithm, and its objective function is:
[0096]
[0097] Where J(θ) is the loss function, (t i ,y i ) is a sampling point in the window, θ is the optimal regression coefficient;
[0098] Then, the partial derivative of the weighted loss function J(θ) is calculated, and the optimal regression coefficient can be obtained by using the least squares principle: Right now, Substituting it into the weighted regression function, we can get the regression curve:
[0099]
[0100] In the formula, θ=(θ0(t),θ1(t),…,θ p (t)) T ,Y=(y0,y1,…,y n ) T , W t =diag(w i (t)),
[0101]
[0102] Where P is the polynomial order;
[0103] The above mainly describes the calculation principle of Lowess weighted regression for a sampling point (t, y) in any time window. The following is a specific introduction to the algorithm process:
[0104] Step 1: Determine a window of length frac with t as the center;
[0105] Step 2: Determine the weights of all sampling points in the window, which determines the influence of the point on the fitting point t. iThe weight of depends on the distance from the point to the center point t. The weight is inversely proportional to the distance and is determined by the weight function W(u):
[0106]
[0107] Sampling point t i The weight w relative to the point t to be fitted i (t) is expressed as:
[0108]
[0109] In the formula, t is the time of the point to be fitted, t i is the time of a sampling point in the window, △(t) is the distance between the farthest sampling point and the point to be fitted, w i (t) is the weight of the point relative to the point to be fitted. It should be noted that the meaning of this formula is:
[0110] First, determine the distance from the sampling point in the window to the point to be fitted. This distance refers to the distance of the horizontal axis. Then find the maximum distance in the window and normalize the distance. i The influence on the fitting curve depends on the weight of the point;
[0111] Step2: Utilize The formula performs weighted least squares nonlinear regression on point t and fits a smooth curve;
[0112] Step 4: Use the fitting curve obtained in the third step to obtain the fitting value at the center point t;
[0113] Through the above four steps, the Lowess smoothing value of the window center point (t, y) can be obtained. The weight calculation of all points in the window can be determined by the horizontal coordinate distance between each sampling point in the window and the point to be fitted. The general idea of selecting the weight function is: first, the weight function is symmetrical, and at the same time, the weight W(t) decreases with the increase of distance, but it must be greater than or equal to 0, and the scope is [-1, 1]. The value in the middle (0) is the largest, and the value on both sides of the endpoints (-1\1) is the smallest. In other words, the weight in the middle is the highest, and the influence on weighted regression is the greatest, and then gradually decreases to both sides. Therefore, for the selection of weights, quadratic weight function or cubic weight function is generally used, and their expressions are:
[0114]
[0115] The difference between the quadratic and cubic weight functions is that the value of the cubic weight function decreases faster than that of the quadratic weight function. Therefore, when Lowess smoothing is used, the cubic weight function is applied in the first iteration, and the quadratic weight function is applied in subsequent iterations.
[0116] Here is a description of the general idea of the local weighted regression Lowess algorithm for all sampling points: take a window of length frac as the center at a certain time t, apply Lowess weighted nonlinear regression to fit the sampling points in the window, and record y as the fitting value at time t. As the position of the sampling point changes, the sliding window moves backward continuously, and n regression curves can be fitted for all n sampling points. Connect the center values of each regression curve to obtain the Lowess weighted regression curve of all sampling points. The adjustable parameters in this algorithm are:
[0117] 1) Window length frac, determines how long the data segment is to be intercepted for local weighted fitting;
[0118] 2) Weight function w, what kind of weight function is suitable?
[0119] 3) Iteration number it, after performing a local weighted regression, decide whether it is necessary to iterate the fitting again;
[0120] The basic process of outlier removal algorithm is as follows:
[0121] The Lowess local regression analysis algorithm based on the template sliding window, the key of this method is to set the window width, so a window is set in advance, the size of the window is set according to the actual situation of the data to be processed, and then the local weighted regression algorithm is used to smooth the data, find the outlier position and make a rough correction on them, and then make a secondary correction on the roughly corrected data to reduce the error. The specific steps are as follows:
[0122] Step 1: Cut N segments of observation data from the measured data of the outlier to be identified, use the spline fitting residual method to estimate the standard deviation of each segment of observation data, and then take the average value as the standard deviation estimate of the entire segment of data, record
[0123] Step 2: Pre-set a sliding window, and the window size is set according to the actual situation of data processing;
[0124] Step 3: The coefficient of the sliding window template is obtained according to the principle of Lowess algorithm. Weighted nonlinear regression is performed on the data segment, and the center value of the regression line is taken as the fitting value.
[0125] Step 4: Compare the estimated value with the actual measured data. If the absolute value of their difference satisfies The corresponding sampling point (t, y) is identified as an outlier, and the outlier position is recorded and used as the estimated value to amend it;
[0126] Step 5: Move the sliding window backward by one position, and repeat step 3 and step 4 until the sliding window moves to the end of the data. At this point, the identified outlier points have been roughly trimmed.
[0127] Step 6: According to the Lowess algorithm, each outlier point after rough trimming is used as the center point of the sliding window for another weighted regression fitting. At this time, the window width can be appropriately adjusted according to the number of outlier points, thereby reducing the fitting error;
[0128] Step 7: The data after the second Lowess weighted regression is used as the final result after outlier correction.
[0129] The process of Lowess local weighted regression outlier elimination algorithm based on template sliding window is as follows Figure 3 shown.
[0130] In step 300, the conductivity change of the preprocessed related data is predicted based on the improved Transformer network structure, specifically:
[0131] A conductivity change prediction model is constructed based on the improved Transformer network structure;
[0132] Based on the type of the sample to be tested, the blue light irradiation parameters, and the conductivity change sequence, temperature sequence, and humidity sequence after pretreatment, a data set is generated, wherein the type of the sample to be tested, the blue light irradiation parameters, and the temperature sequence and humidity sequence after pretreatment are input values of the model, and the conductivity change sequence in the prediction time period is the output value of the model, and the conductivity change prediction model is trained based on the data set;
[0133] Input the type of the sample to be tested, the blue light irradiation parameters, and the temperature sequence and humidity sequence after pretreatment into the trained conductivity change prediction model to obtain the conductivity change sequence of the prediction time period;
[0134] The improved Transformer network structure is introduced in detail:
[0135] The present invention provides two Transformer improvement strategies. One is to use a sparse attention module named SP_Attention, and the other is to change the decoder structure of Transformer into a more convenient linear output. The present invention names the improved model SP_TS. SP_TS has improved the extraction of time features, the attention of the model, the enhancement of key information, and the long-term prediction effect of the model to varying degrees. The improvement of the present invention is mainly used to solve the problems of computational complexity and large prediction error of the traditional model, and the global attention in the attention mechanism of the model is changed to sparse attention. At the same time, the purpose of reducing the operation time is achieved by modifying the structure of the decoder.
[0136] A detailed introduction to the model improvement strategy:
[0137] Transformer is an encoder-decoder model for natural language processing. Its most prominent feature is that it uses the attention mechanism to handle the similarity between data and can effectively process time series. Data passes through the encoder-decoder structure of Transformer, and the computational complexity is 0(N 2 ), in which each element calculates the dot product similarity with other elements to obtain a global attention matrix, which is further connected with the query matrix to obtain the output result of the module. The present invention uses a sparse attention pattern SPAttention, and performs matrix operations by selecting relevant factors with high activity to maintain high information utilization. The improved SPAttention of the present invention aims to establish a concise model that can maintain prediction accuracy.
[0138] The contributions of the improved model of the present invention are as follows:
[0139] 1. The SP_TS used in the present invention can reduce the attention of the attention mechanism while maintaining the prediction ability of the model, reduce the use of model memory and reduce the calculation time, verifying the effectiveness of the Transformer framework in time series prediction tasks. SP_TS can effectively extract feature information and related information of long sequences;
[0140] 2. The present invention uses a linear decoder structure, which effectively replaces the self-attention mechanism in the decoder, simplifies the parameters of the model and makes the Transformer model more suitable for time series;
[0141] Introduce the design of sparse attention SP-Attention algorithm:
[0142] Through research, it is found that in the traditional self-attention mechanism, the similarity matrix of the global attention mechanism is not all highly correlated. Generally, an input point will only have a high correlation with a few points, rather than a global correlation. This can be described by sparsity, that is, only a few active factors participate in the matrix operation and dominate the distribution of softmax. Many scholars believe that the dot product correlation value of the attention mechanism is a long-tail distribution, that is, a certain element is only related to some, but has a low correlation with most of the elements;
[0143] In the self-attention module, after calculating the dot product correlation matrix between each Q vector and K vector, the matrix activity obtained through softmax is different. In the final analysis, the distribution forms obtained are different. If the distribution of the dot product calculation of global attention is approximately regarded as a uniform distribution, it means that the correlation between the q vector and each k is the same, that is, 1 / N;
[0144] When the input length is larger, the value of I / N will be small, which is not very helpful for the calculation of the Q matrix and cannot achieve the purpose of calculating activity. On the contrary, if the distribution of the calculated dot product matrix is far from the uniform distribution, it is a point with a high degree of correlation in the calculation, and its contribution to the attention matrix is greater. Selecting relatively active elements is the significance of studying the sparse attention mechanism.
[0145] Informer uses KL divergence to consider the distribution of the dot product matrix and uses q i represents the qth query vector, the probability calculated by multiplying the i-th query with the dot product of the softmax is p(K|q i ), the active elements required in subsequent operations are those with a distribution that is significantly different from the uniform distribution, because the dot product value obtained by the uniform distribution is That is, the product of Q and the dot product matrix is a very small value, which is not very helpful for the calculation of the model;
[0146] In order to filter out the dot product values far from the uniform distribution, Informer calculates the uniform distribution P and the actual data distribution P through KL divergence. u The similarity between the above distributions is given by the KL divergence formula for the distribution of the i-th query.
[0147]
[0148] Where N is the length of the input data, the first term is the sum of the logarithms of the dot product pairs of all elements, and the second term represents the arithmetic mean of all values. If the calculated KL divergence value is large, its impact on the attention matrix is also greater. In the long-tail distribution, the elements corresponding to the larger KL divergence values stand out in the attention matrix. According to the stability of the calculation of the exponential sum and the logarithmic function, KL divergence is a suitable way to find active points. By reasoning and proving the above formula, we can get M(q i , the upper and lower boundaries of K), M(q i , the upper and lower boundaries of K) are shown in the following formula:
[0149]
[0150] In summary, the maximum average value M(q, K) of KL divergence is calculated as follows:
[0151]
[0152] During the research process, it was noted that KL divergence does not satisfy symmetry, but distance metrics cannot measure the distance between discrete distribution and continuous distribution. Under the Wasserstein metric, the metric can be made reasonable. In traditional metrics, most of them ignore the set characteristics between probability distributions: the distributions have commonalities and are calculated using data dot product, but the set characteristics are not taken into account. The W distance can reasonably calculate the distance between discrete distribution and continuous distribution while maintaining the data's original form. The formula for the W distance is as follows:
[0153]
[0154] Among them, (P r , P f ) refers to all marginal distributions P r and P f The joint probability distribution of
[0155] The calculation process of sparse attention mechanism SPAttention is:
[0156] The structure diagram of the sparse attention mechanism SPAttention obtained by W distance is as follows Figure 4 As shown in the figure, after position encoding and embedding, SPAttention linearly transforms the input raw data X into query, key and value matrices (i.e., Q, K, V matrices). The input matrix is the data after position encoding of X, which is E∈R (N*d) , N represents the length of the input sequence, and d represents the dimension of the data, and the X matrix can be represented by [e1, e2, ..., e n ] to indicate;
[0157] The calculated QKV matrix can be expressed as:
[0158] Q=[q1,q2,…,q N ]
[0159] K=[k1,k2,…,k N ]
[0160] V=[v1,v2,…v N ]
[0161] The improved self-attention mechanism of the present invention can be expressed as follows:
[0162]
[0163] in, is a sparse matrix with the same dimension as the Q vector, which only contains the first u queries under the sparsity measure M(q, K). Finally, the calculated sparse matrix needs to be combined with each v vector;
[0164] The principle and details of the sparse self-attention mechanism introduced in this invention are to find query vectors with higher activity, thereby improving the calculation efficiency of the score matrix, improving the operation performance of the model and the prediction accuracy of the model. However, traversing all query vectors to calculate the dot product similarity and then calculating M(q i , K), the computational complexity is 0(N 2 ), according to the long-tail distribution hypothesis, we only need to calculate the active U values through the W distance to achieve the goal of reducing the attention range, and the calculation method of u is controlled by the constant sampling factor c, setting u = c * lnN, which means that each calculation only searches for the first NogN dot product pairs, and the layer memory usage remains O(NInN). Under the multi-head self-attention mechanism, each attention head will focus on different active information, which retains most of the useful information of the input. The SP Attention algorithm process is as follows Figure 4 As shown;
[0165] Improvements to the linear decoder structure:
[0166] For the self-attention mechanism in the decoder structure, the present invention uses a linear fully connected module. In the decoder module, position coding is first embedded. The purpose of position coding embedding is to convert time series data into vector guidance, so as to better extract the correlation between data. Directly using linear full connection instead of self-attention mechanism can simplify the data output process. The input process of the decoder is set as follows:
[0167] Decoder input: X de ={X 起始 , X0}, where X 起始 is the start symbol of the prediction, and X0 is the placeholder for the prediction data;
[0168] Decoder position encoding: E dc =embadding(X d )
[0169] Through linear connection: V de =Linear(E de )
[0170] The model evaluation index of the present invention adopts mean square error (MSE) and mean absolute error (MAE), and the specific calculation formula is as follows:
[0171]
[0172] Among them, the calculation method of MSE is convenient and concise. It is a commonly used model evaluation indicator in deep learning. It is an indicator composed of the sum of squares of errors between the true value and the predicted value, which can be obtained directly through the model. MAE is the average of the absolute values of the errors between the predicted value and the actual input data, which can avoid the problem of errors offsetting each other. When the measurement indicators MSE and MAE values are smaller, it means that the predicted value is closer to the real input data, which means that the model has a higher prediction accuracy.
[0173] The beneficial effects of the present invention are as follows:
[0174] 1. Strong real-time performance: This method can monitor the dynamic changes of material conductivity under blue light irradiation in real time;
[0175] 2. High sensitivity: By optimizing the electrode design and measurement method, the sensitivity of conductivity detection is significantly improved;
[0176] 3. Wide applicability: This method is applicable to various material systems such as inorganic semiconductors, organic optoelectronic materials, especially materials sensitive to blue light;
[0177] 4. It can predict the dynamic changes of material conductivity under blue light irradiation without the need for step-by-step testing. It is easy to use and saves time and effort.
[0178] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0179] The present invention uses specific examples to illustrate the principles and implementation methods of the present invention. The above examples are only used to help understand the method and core ideas of the present invention. At the same time, for those skilled in the art, according to the ideas of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A method for detecting conductivity changes under blue light irradiation, characterized in that: include: Collect data related to conductivity changes under blue light irradiation; Preprocess the collected relevant data; Based on the improved Transformer network structure, the conductivity changes of the preprocessed related data are predicted.
2. The method for detecting conductivity changes under blue light irradiation according to claim 1, characterized in that: Collect data related to conductivity changes under blue light irradiation, including: Set the sample to be tested and the blue light source configuration, perform real-time detection of conductivity, and obtain the conductivity change sequence; Obtain blue light source configuration information and obtain blue light irradiation parameters; Collect surrounding environmental factors.
3. The method for detecting conductivity changes under blue light irradiation according to claim 2, characterized in that: Set the sample to be tested and the blue light source configuration, perform real-time detection of conductivity, and obtain the conductivity change sequence, specifically: Select a material to be tested, prepare a test sample, and arrange electrodes at both ends of the test sample to form an ohmic contact or a Schottky contact; Select a blue light source with a wavelength of 450-490nm and set its light intensity range to 1-100mW / cm 2 , equipped with optical fiber or collimating lens to make the blue light shine evenly on the test sample; The pulse frequency or light intensity of the blue light source is adjusted to provide different irradiation conditions for the test samples. At the same time, the conductivity test of the test samples is carried out through the high-precision digital conductivity tester in combination with electrodes to obtain a conductivity change sequence based on a time series.
4. The method for detecting conductivity change under blue light irradiation according to claim 3, characterized in that: Obtain the blue light source configuration information and obtain the blue light irradiation parameters, specifically: The blue light source pulse frequency sequence and light intensity sequence based on the time series are obtained and used as blue light irradiation parameters.
5. The method for detecting conductivity changes under blue light irradiation according to claim 4, characterized in that: Collect surrounding environmental factors, specifically: Based on the preset temperature sensor and humidity sensor, the temperature sequence and humidity sequence based on the time series are collected and taken as the surrounding environment factors.
6. The method for detecting conductivity change under blue light irradiation according to claim 5, characterized in that: Preprocess the collected relevant data, specifically: Identify and remove outliers in conductivity change series, temperature series and humidity series.
7. The method for detecting conductivity changes under blue light irradiation according to claim 6, characterized in that: Based on the improved Transformer network structure, the conductivity change of the preprocessed related data is predicted, specifically: A conductivity change prediction model is constructed based on the improved Transformer network structure; Based on the type of the sample to be tested, the blue light irradiation parameters, and the conductivity change sequence, temperature sequence, and humidity sequence after pretreatment, a data set is generated, wherein the type of the sample to be tested, the blue light irradiation parameters, and the temperature sequence and humidity sequence after pretreatment are input values of the model, and the conductivity change sequence in the prediction time period is the output value of the model, and the conductivity change prediction model is trained based on the data set; The type of the sample to be tested, the blue light irradiation parameters, and the temperature sequence and humidity sequence after pretreatment are input into the trained conductivity change prediction model to obtain the conductivity change sequence of the prediction time period.