Method for detecting copy number variation of hybrid whale optimization and BP neural network
By combining the improved whale optimization algorithm and BP neural network, the difficulty of copy number variation detection under low purity and low coverage data is solved, more efficient and accurate detection results are achieved, and the slow convergence speed and localization of BP neural network are avoided. Optimal problem.
Patent Information
- Application Number
- CN202410894101.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-04
- Publication Date
- 2024-10-29
AI Technical Summary
Existing copy number variation detection methods based on read depth have difficulties in analyzing data with low purity and low tumor coverage, especially due to the noise impact caused by sequencing errors and GC content deviation, and BP neural networks are not suitable for practical applications. The convergence speed is slow and it is easy to fall into local optimum.
Using a combination method of hybrid whale optimization algorithm (IWOA) and BP neural network, by improving the population initialization and position update strategy of the whale optimization algorithm, combined with the adaptive inertia weight and the selection and crossover strategy of the genetic algorithm, the weights of the BP neural network are optimized and thresholds for extracting features from NGS data and detecting copy number variations.
It improves the accuracy and efficiency of copy number variation detection in low-purity and low-coverage data, avoids the impact of errors in GC content bias correction, and avoids the algorithm falling into local optimality through the local search mechanism, significantly improving detection performance. .
Smart Images

Figure CN118866085A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of detection technology, and in particular to a copy number variation detection method of hybrid whale optimization and BP neural network. Background Art
[0002] Copy number variation (CNV) is an important manifestation of structural variation (SV). CNV is a variation caused by genome rearrangement. It generally refers to the amplification or deletion of the copy number of large genomic fragments with a length of more than 1kb. CNV is mainly manifested as amplification and deletion at the submicroscopic level, and the mutation rate of the site where copy number variation occurs is much higher than SNP. The source of individual CNV is on the one hand from the inheritance of the parents, and on the other hand, it is caused by the mispairing of two non-allelic homologous chromosomes during meiosis or mitosis. CNV is widely present in the human genome and is one of the important pathogenic factors of human diseases. For example, diseases such as Down syndrome, Alzheimer's disease and albinism are all caused by CNV. Therefore, studying CNVs in the human genome and analyzing copy number amplification or deletion are crucial for the treatment of human diseases and the development of targeted drugs for different diseases.
[0003] The rapid development of sequencing technology has provided unprecedented opportunities for the study of CNV detection. So far, sequencing technology has gone through three generations of development. However, due to the high error rate of the third-generation sequencing technology and the high performance and low consumption of the second-generation sequencing technology (Next-Generation Sequencing, NGS), NGS sequencing technology is more commonly used at present. Based on NGS technology, a large number of studies have been conducted on CNV detection: GenSeg is a CNV segmentation algorithm that accurately identifies gene breakpoints to solve the problem of complex processing caused by excessive NGS data; VS-CNV uses a double-blind method to set thresholds to determine the state of copy numbers in NGS data, and then uses hidden Markov models to perform CNV classification; icopyDAV is an integrated platform based on NGS data that uses segmentation algorithms to detect CNVs across the entire genome; ADM-CNV converts CNV detection into a quadratic optimization problem involving two constraints, and improves the accuracy of the signal extracted from NGS by imposing constraints of sparsity and smoothness. The problem of repeated genomic regions in the data extracted from NGS is solved by introducing a soft clustering strategy to improve the sensitivity of CNV detection.
[0004] There are four main strategies for detecting copy number variation using NGS technology: paired-end mapping (PEM), split-read (SR), sequence assembly (SA), and read depth (RD). In addition, CNV detection based on machine learning methods is also a hot topic. However, the detection method based on read depth strategy is still the most widely used and effective detection strategy. Although the current CNV detection methods based on RD have achieved good results, there are still many difficulties in analyzing data with low purity and low tumor coverage. (1) Due to sequencing errors and GC content deviations, the number of reads mapped to the reference genome will be unevenly distributed, which will eventually affect the actual RD signal distribution due to noise. (2) Backpropagation (BP) neural network has powerful nonlinear mapping and generalization capabilities, which can be used to solve the joint effects of multiple features in copy number variation detection. However, BP neural network still has many shortcomings in practical applications, such as slow convergence and easy to fall into local optimality. Based on the above considerations, this study proposed a CNV detection method combining BP neural network and improved WOA algorithm.
[0005] Methods for detecting copy number variation include detection methods based on paired mapping strategies, detection methods based on split reading strategies, detection methods based on sequence assembly strategies, detection methods based on reading depth strategies, and detection methods based on machine learning.
[0006] Since low magnification data usually contain less information, it is often challenging to analyze them. Currently, there is a lack of a method that combines RD and machine learning-based detection methods for CNV detection in low purity and low coverage data. Summary of the invention
[0007] The technical problem to be solved by the present invention is to provide a copy number variation detection method that mixes whale optimization and BP neural network to facilitate copy number variation detection.
[0008] The present invention adopts the following technical solutions to achieve the invention objectives:
[0009] A copy number variation detection method using a hybrid whale optimization and BP neural network, comprising the following steps:
[0010] S1: Data preprocessing: Use BWA software to align the sequencing sample files obtained from NGS with the reference sequences to obtain BAM files, and use SAMtools to extract the Read Count profile from the BAM files;
[0011] S2: Feature extraction, setting four eigenvalues (R i ,G i ,C i ,Q i ), extracted from the read segment information;
[0012] S3: Construction of BP neural network;
[0013] S4: Improve the whale optimization algorithm. Improve the performance of the whale optimization algorithm by designing two population initialization strategies and three position update strategies based on the change mechanism of adaptive inertia weight;
[0014] S41: population initialization;
[0015] S42: Location update;
[0016] S43: local search;
[0017] S5: Use IWOA algorithm to optimize BP neural network.
[0018] As a further limitation of the present technical solution, S2 comprises the following steps:
[0019] S21: The first eigenvalue R i , eigenvalue R i The value is RD, which is the average RC value of each bin;
[0020] S22: GC bias refers to the total content of guanine and cytosine being too high or too low due to contamination of normal cells during sequencing. The GC content score is used as the second eigenvalue. The calculation method of the GC content score is shown in formula 1:
[0021] G i =g i +c i (1)
[0022] Where: G i represents the GC content of the i-th bin;
[0023] g i and c i Respectively represent the number of guanine and cytosine in the i-th bin;
[0024] S23: The correlation between adjacent positions in the genome is a feature related to gene structural variation, which is used as the third eigenvalue C i , as shown in Formula 2:
[0025]
[0026] Where: Ci Represents the correlation between the bin at the i-th position and its neighboring positions in the surrounding area;
[0027] S l and S w Respectively represent the number of left bins and right bins adjacent to the i-th bin;
[0028] S24: Sequence alignment quality Q i Indicates the confidence of each read segment aligned to the reference genome. Its extraction method is similar to that of GC content. All eigenvalue data are converted into numbers between [0, 1] using normalization. The normalization process is shown in Formula 3:
[0029]
[0030] Where: y represents the normalized eigenvalue;
[0031] x max and x min They represent the maximum and minimum values of the features before normalization.
[0032] As a further limitation of the present technical solution, the specific steps of S3 are:
[0033] The BP neural network has three layers, of which the input layer has 4 neurons, the hidden layer has 9 neurons, and the output layer has 5 neurons. The normalized eigenvalues are grouped into four tuples (R i ,G i ,C i ,Q i ) as the four inputs of the neural network, and the five outputs represent the five states of the predicted copy number: normal, tandem amplification, interspersed repeat amplification, half deletion, and complete deletion. The sigmoid function is used as the activation function between the hidden layer and the input layer to increase the nonlinearity of the BP neural network model. The activation function is as follows
[0034] As shown in formula 4:
[0035]
[0036] a=wx+θ (5)
[0037] Among them: x represents the input vector of the current neuron, that is, a four-tuple composed of normalized eigenvalues;
[0038] w represents the weight of the neurons between the hidden layer and the output layer;
[0039] θ represents the bias of the corresponding neuron.
[0040] As a further limitation of the present technical solution, the S41 comprises the following steps:
[0041] A whale group is generated by random initialization, and its size is N. Each whale in the group represents an individual, and the position of each individual in the search space represents a solution. The absolute value of the error between the expected output and the actual predicted output is taken as the individual's fitness value F. The calculation method is shown in Formula 6:
[0042]
[0043] Where: k is the coefficient;
[0044] n represents the total number of output nodes of the BP neural network;
[0045] ap i and d i Respectively represent the actual predicted output and expected output of the i-th node of the BP neural network;
[0046] Pooling mechanism:
[0047] The first strategy for population initialization is to use a pooling mechanism to improve population diversity. We set a matrix Pool = (P1, P2, ..., P n ) to store all solutions. The size of the matrix is set to 1.5 times the initial population size. The members in the matrix Pool are represented by the matrix P = (P i1 ,P i2 ,...,P in ), generated and updated using Equation 7 at the end of each iteration;
[0048]
[0049] Where: t represents the current iteration number;
[0050] B is a binary random vector;
[0051] is the inverse vector of B;
[0052] X rand (t) is calculated by formula 10 and used to generate the optimal solution X best (t) Random position in the field;
[0053] X worst (t) represents the worst solution in the current iteration;
[0054] The second strategy for population initialization is the migration search strategy, which uses Equation 10 to randomly select a part P from the population to achieve discretization of the whale group, so that the positions that have not been visited in the search space can also be searched, further improving the diversity of the population and the search ability of the algorithm;
[0055] X(t+1)=X r (t)-X rand (t) (8)
[0056]
[0057] Where: X r (t) represents a random position in the entire search space;
[0058] rand represents a random number between (0, 1);
[0059] and represent the upper and lower limits of the independent variable respectively;
[0060] and Represent the optimal solution X best (t) upper and lower bounds;
[0061] X(t+1) represents the current position of the whale after iteration t+1.
[0062] As a further limitation of the present technical solution, the S42 comprises the following steps:
[0063] In the whale optimization algorithm, the position of the prey represents the current optimal solution to the optimization problem. An adaptive inertia weight is introduced in the position update so that the optimal solution can be more fully utilized. An adaptive variable inertia weight based on the cosine function is adopted, as shown in Formula 11:
[0064]
[0065] Where: ω represents the adaptive inertia weight of the prey position;
[0066] IT max Indicates the maximum number of iterations;
[0067] In order to improve the search efficiency of the prey search strategy in traditional WOA, the adaptive inertia weight is combined with three prey search strategies;
[0068] S421: Improved encirclement prey search strategy;
[0069] Whales exchange information with each other and walk randomly to search for the location of prey. Assuming that the target prey is the current optimal position, as the algorithm proceeds, other individuals in the whale group move to the current optimal position to shrink and surround the prey. The formula for updating the position of the whale is as follows:
[0070] X(t+1)=ω×X best (t)-A×D' (12)
[0071] C = 2 × rand (13)
[0072]
[0073] D'=|C×X best (t)-P rand1 (t)| (15)
[0074] Where: C is a coefficient vector;
[0075] A represents the encircling step length;
[0076] The value of x0 is set to 0.5;
[0077] The value of γ is set to 0.1;
[0078] D' represents the distance between the i-th whale and the current global optimal individual;
[0079] P rand1 (t) randomly selected from the matrix P;
[0080] rand represents a random number between (0, 1);
[0081] S422: In IWOA, individual whales will use spiral motion to approach prey and spit out different bubbles to prey. The specific position update model is shown in Equation 16:
[0082] X(t+1)=D'×e bl ×cos(2πl)+(1-ω)X best (t) (16)
[0083] Where: b is a constant that limits the logarithmic spiral state;
[0084] l is a random number from -1 to 1;
[0085] The random variable p with the same probability is selected to update the position by the shrinking and encircling mechanism and the spiral position update mechanism. The mathematical expression of the position update is shown in Formula 17:
[0086]
[0087] S423: Improved random selection search strategy;
[0088] A position is randomly selected from individuals in the population as the target direction for prey search. When |A|≥0.5, it means that the whale is swimming outside the shrinking encirclement. At this time, the whale individuals perform random searches based on each other's positions. The mathematical model of random search and update position is expressed as formula 18:
[0089] X(t+1)=ω×X(t)+A×(C×P rand2 (t)-P rand3 (t)) (18)
[0090] Where: P rand2 and P rand3 are randomly selected from the matrix P respectively.
[0091] As a further limitation of the present technical solution, the S43 comprises the following steps:
[0092] S431: randomly selecting one of the roulette selection method and the binary tournament selection method to perform a selection operation;
[0093] S432: using a two-point crossover method to randomly select two intersection points on the solution obtained through the above steps, and then exchanging the data at the intersection points to obtain a new solution, thereby forming a new solution space;
[0094] S433: Use the reception criteria of the simulated annealing algorithm to determine whether to receive a new solution. The probability of receiving a new solution is calculated as shown in Formula 19:
[0095]
[0096] Where: P' represents the probability of receiving a new solution;
[0097] e is the base of natural logarithms;
[0098] ΔE represents the difference in fitness between the new solution and the current solution, and T represents the current temperature parameter.
[0099] As a further limitation of the present technical solution, S5 comprises the following steps:
[0100] S51: Initialize the network. IP represents the neuron input vector, OP represents the neuron output vector. The input and output sequences can be quantized using Equation 20. The input layer, hidden layer, and output layer of the BP neural network each have an initialized number of nodes, represented by letters m, h, and n, respectively:
[0101]
[0102] S52: Calculate the output of the hidden layer. The output of the hidden layer is calculated according to the input variable IP, the weight between the input layer and the hidden layer, and the threshold of the hidden layer. The calculation method is shown in Formula 21:
[0103]
[0104] Where: H j Represents the output value of the hidden layer;
[0105] f(t) represents the activation function, which is calculated using Equation 4;
[0106] w ij represents the weight between the i-th node in the input layer and the j-th node in the hidden layer, and μ a represents the threshold of the hidden layer;
[0107] S53: Calculate the output of the output layer. The output of the output layer is calculated according to the output value of the hidden layer, the weight between the hidden layer and the output layer, and the threshold of the output layer. The calculation method is shown in Formula 22:
[0108]
[0109] Among them: OP k Represents the actual prediction output of the BP neural network;
[0110] w jk Represents the weight between the jth node in the hidden layer and the kth node in the output layer;
[0111] μ b represents the threshold of the output layer;
[0112] S54: Calculate the network prediction error, define the error between the actual prediction output and the expected output of the BP neural network as e, and set the maximum allowable error value to E. If max(e k )>E, indicating that there is an obvious deviation between the actual prediction output of the current BP neural network and the expected output, and the prediction result is not ideal. Therefore, the BP neural network parameters must be adjusted and retrained until all training data meet the error standard. The calculation method is expressed by formula 23:
[0113] e k =|O k -OP k | (23)
[0114] Among them: k Represents the expected output of the BP neural network;
[0115] S55: Update weights and thresholds. Update weights and thresholds according to e calculated in the above steps. The updating method is as follows:
[0116]
[0117] w jk =w jk +ηH j e k (25)
[0118]
[0119] μ b =μ b +e k (27)
[0120] Wherein, η represents the learning rate, which is used to control the convergence speed and stability of the BP neural network, and its range is set between (0, 1);
[0121] w ij Represents the weight between the i-th node in the input layer and the j-th node in the hidden layer;
[0122] μ a represents the threshold of the hidden layer;
[0123] w jk Represents the weight between the jth node in the hidden layer and the kth node in the output layer;
[0124] μ b represents the threshold of the output layer;
[0125] S56: Determine whether the algorithm iteration is finished. If not, return to step 2.
[0126] Compared with the prior art, the advantages and positive effects of the present invention are:
[0127] 1. This paper proposes a BP neural network based on hybrid whale optimization for detecting CNVs from NGS data. It combines machine learning methods and integrates multiple features related to CNVs, mainly detecting CNVs in low-purity and low-coverage data. First, IWOABP extracts four eigenvalues (R i ,G i ,C i ,Q i). Usually, the data preprocessing method will correct the GC content deviation in advance. In the present invention, there is no need to correct the GC content deviation, but it is used as the eigenvalue of the bin, so the influence caused by the error in the correction process can be avoided. Secondly, the four extracted eigenvalues are used as input, and the five states of CNV are used as output, and the three-layer BP neural network model is constructed using IWOABP. Then, IWOABP uses an improved whale optimization algorithm to optimize the weights and thresholds of the BP neural network. At the same time, an adaptive inertia weight change mechanism is added in the search stage to solve the problem of low search accuracy of the algorithm. In addition, IWOABP uses the selection and crossover strategy of the genetic algorithm for local search, and also uses the simulated annealing receiving mechanism to receive differential solutions with a certain probability to avoid the algorithm from falling into the local optimum. Finally, IWOABP is compared with existing methods through a large number of experiments, and the results show the effectiveness of IWOABP.
[0128] 2. In order to evaluate the performance of IWOABP, the present invention uses a large amount of simulation data and real data to verify it. A total of 6 comparison algorithms are used in two test scenarios. In the simulation experiment, the effectiveness of the algorithm is verified by comparing it with other methods in terms of sensitivity, accuracy, F1 score, ROC curve and boundary stability. In addition, three real samples are used to verify the feasibility of the algorithm, and the performance of IWOABP and other peer methods is quantified using the verified CNV obtained from DGV. The experimental results show that IWOABP is superior to other methods. BRIEF DESCRIPTION OF THE DRAWINGS
[0129] Figure 1 It is a schematic diagram of the workflow of the present invention.
[0130] Figure 2 It is a schematic diagram of the topological structure of the BP neural network of the present invention.
[0131] Figure 3 Schematic diagram of performance comparison of the six methods of the present invention on a simulated data set.
[0132] Figure 4 Schematic diagram of ROC curves of the IWOABP of the present invention and other detection methods.
[0133] Figure 5 Schematic diagram of boundary error comparison between IWOABP and MFCNV of the present invention.
[0134] Figure 6 This is a schematic diagram of the real data performance comparison of the IWOABP of the present invention and other algorithms. DETAILED DESCRIPTION
[0135] A specific implementation of the present invention is described in detail below in conjunction with the accompanying drawings, but it should be understood that the protection scope of the present invention is not limited by the specific implementation.
[0136] The present invention comprises the following steps:
[0137] S1: Data preprocessing: Use BWA software to align the sequencing sample files obtained from NGS with the reference sequence to obtain a BAM file, and use SAMtools to extract the Read Count (RC) profile from the BAM file; Usually, the normal human reference genome sequence is composed of four bases: "A", "T", "C", and "G. In addition, the bases at certain positions in the reference gene sequence are "N". This means that at this position, it is impossible to determine what the specific base is, which may be due to sequencing errors, low-quality sequencing data, or other technical limitations. In order to provide a more reasonable and meaningful read count profile for copy number variation (CNV) detection, such "N" positions are removed from the reference genome. In order to facilitate the calculation of RD files, the processed sequencing data are divided into continuous and non-repeated bins according to the complete RC file of the genome to be analyzed, and then the average RC in each genome interval is used as the RD value. In this article, the size of each bin is set to 1000bp.
[0138] S2: Feature extraction, setting four eigenvalues (R i ,G i ,C i ,Q i ), extracted from the read segment information.
[0139] There are many columns in the read information, each column can be regarded as a feature value, and the four extracted feature values are four of the columns.
[0140] The S2 comprises the following steps:
[0141] S21: The first eigenvalue R i , eigenvalue R i The value is RD, which is the average RC value of each bin;
[0142] S22: GC bias refers to the fact that the total content of guanine and cytosine is too high or too low due to contamination of normal cells during the sequencing process. The use of PCR amplification technology will cause GC content deviation, and the existence of GC content deviation will produce noise on the RD signal, making the RD value unable to reflect the true sequence information well, thus seriously affecting the accuracy of CNV detection. Usually, GC bias correction is performed in some existing technologies, but this method can only be applied to some specific situations. The GC content score is used as the second eigenvalue. The calculation method of the GC content score is shown in Formula 1:
[0143] G i =g i +c i (1)
[0144] Where: G i represents the GC content of the i-th bin;
[0145] g i and c i Respectively represent the number of guanine and cytosine in the i-th bin;
[0146] S23: The correlation between adjacent positions in the genome is a feature related to gene structural variation, which is used as the third eigenvalue C i , as shown in Formula 2:
[0147]
[0148] Where: C i Represents the correlation between the bin at the i-th position and its neighboring positions in the surrounding area;
[0149] S l and S w Respectively represent the number of left bins and right bins adjacent to the i-th bin;
[0150] S24: Sequence alignment quality Q i It is also a very important factor. It indicates the reliability of each read segment's alignment to the reference genome. A higher alignment quality usually means a more reliable alignment, while a lower alignment quality may indicate a certain degree of uncertainty. The alignment quality reflects the CNV status of the region to a certain extent, and the method of extracting the alignment quality is similar to extracting the GC deviation. Since the four eigenvalues have different representation standards, the detection results may have large errors. Use normalization to convert all eigenvalue data into numbers between [0, 1]. The normalization process is shown in Formula 3:
[0151]
[0152] Where: y represents the normalized eigenvalue;
[0153] x max and x min They represent the maximum and minimum values of the features before normalization.
[0154] S3: Construction of BP neural network; BP neural network is widely used in classification problems due to its excellent nonlinear mapping ability and simple and flexible topological structure. It operates through forward and backward propagation of signals and errors respectively. In forward propagation, the input signal is input from the input layer and processed by the hidden layer until it reaches the output layer. If the output layer does not get the expected output, it switches to back propagation, and then readjusts the weights and thresholds of the network according to the prediction error. BP neural network generally consists of input layer, hidden layer and output layer, and the number of hidden layers can be adjusted according to different user needs. The topological structure of BP neural network of IWOABP is as follows Figure 2 shown.
[0155] The specific steps of S3 are:
[0156] The BP neural network has three layers in total, with 4 neurons in the input layer, 9 neurons in the hidden layer, and 5 neurons in the output layer. Figure 2 The leftmost end of represents the four features extracted as described above. The normalized feature values are grouped into four tuples (R i ,G i ,C i ,Q i ) as the four inputs of the neural network, and the five outputs represent the five states of the predicted copy number: normal, tandem amplification, interspersed repeat amplification, semi-deletion, and complete deletion. Normal means the copy number has not mutated; tandem amplification means the duplication caused by the continuous arrangement of repeated sequences on the same chromosome; interspersed repeat amplification means the copy number on the same chromosome exists in an interspersed form; hemizygous deletion means the deletion of the copy number in a homologous chromosome, that is, the copy number in the fragment is 1; homologous deletion means the simultaneous deletion of the copy number of two homologous chromosomes, that is, the copy number in the fragment is 0. The sigmoid function is used as the activation function between the hidden layer and the input layer to increase the nonlinearity of the BP neural network model. The activation function is shown in Formula 4 below:
[0157]
[0158] a=wx+θ (5)
[0159] Among them: x represents the input vector of the current neuron, that is, a four-tuple composed of normalized eigenvalues;
[0160] w represents the weight of the neurons between the hidden layer and the output layer;
[0161] θ represents the bias of the corresponding neuron.
[0162] S4: Improved Whale Optimization Algorithm,The Whale Optimization Algorithm (WOA) is a group optimization algorithm inspired by the hunting behavior of humpback whales in nature. It searches for the optimal solution through three stages: surrounding prey, bubble net predation and random search. WOA also has the disadvantages of low population diversity and easy to fall into local optimality in the late iteration. Improve the Whale Optimization Algorithm. The performance of the Whale Optimization Algorithm is improved by designing two population initialization strategies and three position update strategies based on the change mechanism of adaptive inertia weight.
[0163] S41: Population initialization.
[0164] The S41 comprises the following steps:
[0165] A whale group is generated by random initialization, and its size is N. Each whale in the group represents an individual, and the position of each individual in the search space represents a solution. The absolute value of the error between the expected output and the actual predicted output is taken as the individual's fitness value F. The calculation method is shown in Formula 6:
[0166]
[0167] Where: k is the coefficient;
[0168] n represents the total number of output nodes of the BP neural network;
[0169] ap i and d i Respectively represent the actual predicted output and expected output of the i-th node of the BP neural network;
[0170] Pooling mechanism:
[0171] The first strategy for population initialization is to use a pooling mechanism to improve population diversity. We set a matrix Pool = (P1, P2, ..., P n ) to store all solutions. The size of the matrix is set to 1.5 times the initial population size. The members in the matrix Pool are represented by the matrix P = (P i1 ,P i2 ,...,P in ), generated and updated using Equation 7 at the end of each iteration.
[0172]
[0173] Where: t represents the current iteration number;
[0174] B is a binary random vector;
[0175] is the inverse vector of B;
[0176] X rand(t) is calculated by formula 10 and used to generate the optimal solution X best (t) Random position in the field;
[0177] X worst (t) represents the worst solution in the current iteration;
[0178] The second strategy for population initialization is the migration search strategy, which uses Equation 10 to randomly select a part P from the population to achieve the discretization of the whale group, so that the positions that have not been visited in the search space can also be searched, further improving the diversity of the population and the search ability of the algorithm.
[0179] X(t+1)=X r (t)-X rand (t) (8)
[0180]
[0181] Where: X r (t) represents a random position in the entire search space;
[0182] rand represents a random number between (0, 1);
[0183] and represent the upper and lower limits of the independent variable respectively;
[0184] and Represent the optimal solution X best (t) upper and lower bounds;
[0185] X(t+1) represents the current position of the whale after iteration t+1.
[0186] S42: Location update.
[0187] The S42 comprises the following steps:
[0188] In the whale optimization algorithm, the position of the prey represents the current optimal solution to the optimization problem. However, the position of the prey is not fully utilized in the position update of the traditional WOA. The adaptive inertia weight increases with the number of iterations. The weight is small in the early stage of the algorithm and has little effect on the position update. In the later stage of the algorithm, its value is larger. The larger weight can speed up the movement of the whale's position and guide the algorithm to quickly find the target solution, thereby improving the algorithm's optimization performance. Introducing adaptive inertia weight in position update so that the optimal solution can be more fully utilized and improve the local development ability of the algorithm, an adaptive variable inertia weight based on the cosine function is adopted, as shown in Formula 11:
[0189]
[0190] Where: ω represents the adaptive inertia weight of the prey position;
[0191] IT max Indicates the maximum number of iterations;
[0192] In order to improve the search efficiency of the prey search strategy in traditional WOA, the adaptive inertia weight is combined with three prey search strategies;
[0193] S421: Improved encirclement prey search strategy;
[0194] Whales exchange information with each other and walk randomly to search for the location of prey. Assuming that the target prey is the current optimal position, as the algorithm proceeds, other individuals in the whale group move to the current optimal position to shrink and surround the prey. The formula for updating the position of the whale is as follows:
[0195] X(t+1)=ω×X best (t)-A×D' (12)
[0196] C = 2 × rand (13)
[0197]
[0198] D'=|C×X best (t)-P rand1 (t)| (15)
[0199] Where: C is a coefficient vector;
[0200] A represents the encirclement step length. In order to improve the search ability of the search strategy, it is necessary to select a larger step length so that the whales are distributed in different areas of the search space to search for more prey. Therefore, this strategy uses the inverse cumulative distribution function of the Cauchy distribution to increase the probability of generating a larger step length to obtain a larger A value.
[0201] The value of x0 is set to 0.5;
[0202] The value of γ is set to 0.1;
[0203] D' represents the distance between the i-th whale and the current global optimal individual;
[0204] P rand1 (t) randomly selected from the matrix P;
[0205] rand represents a random number between (0, 1);
[0206] S422: In IWOA, individual whales will use spiral motion to approach prey and spit out different bubbles to prey. The specific position update model is shown in Equation 16:
[0207] X(t+1)=D'×e bl ×cos(2πl)+(1-ω)X best (t) (16)
[0208] Where: b is a constant that limits the logarithmic spiral state;
[0209] l is a random number from -1 to 1;
[0210] The value of b is set to 1;
[0211] The whales swim synchronously along the spiral path around the prey's contraction circle. This means that during the whale's predation behavior, the behaviors of surrounding the prey and attacking with the bubble net are carried out simultaneously. Therefore, the random variable p with the same probability is selected to update the position of the contraction and surrounding mechanism and the spiral position update mechanism. Here, the value of p is set to 0.5. The mathematical expression of the position update is shown in Equation 17:
[0212]
[0213] S423: Improved random selection search strategy;
[0214] In this stage, the population conducts a global search. In order to improve the global search capability, a position is randomly selected from the individuals in the population as the target direction of the prey search. When |A|≥0.5, it means that the whale is swimming outside the shrinking encirclement. At this time, the whale individuals conduct random searches based on each other's positions. The mathematical model of random search and update position is expressed as formula 18:
[0215] X(t+1)=ω×X(t)+A×(C×P rand2 (t)-P rand3 (t)) (18)
[0216] Where: P rand2 and P rand3 are randomly selected from the matrix P respectively.
[0217] S43: Local search.
[0218] The S43 comprises the following steps:
[0219] When using IWOA for BP neural network optimization, due to its global search characteristics, there is a certain probability of falling into the problem of local optimal solution. In order to balance the local search and global search capabilities of the algorithm, the selection and crossover strategies of the genetic algorithm are used. Two selection strategies and one crossover strategy are used for local search, and finally the acceptance criterion of the simulated annealing algorithm is selected to determine whether to accept the new solution.
[0220] S431: Randomly select one of the roulette selection method and the binary tournament selection method to perform a selection operation. The roulette selection method first calculates the fitness value of each solution in the solution space obtained by using IWOA, and determines the probability of being selected according to the ratio of their fitness values. The smaller the fitness value of the solution, the greater the probability of being selected. The binary tournament selection method randomly selects two solutions from the entire solution space and selects the one with the smaller fitness value;
[0221] S432: using a two-point crossover method to randomly select two intersection points on the solution obtained through the above steps, and then exchanging the data at the intersection points to obtain a new solution, thereby forming a new solution space;
[0222] S433: Use the reception criteria of the simulated annealing algorithm to determine whether to receive a new solution. If the fitness value of the new solution is smaller, the new solution is received. If the fitness value of the new solution is larger, the new solution is received with a certain probability. The calculation method of the probability of receiving a new solution is shown in Formula 19:
[0223]
[0224] Where: P' represents the probability of receiving a new solution;
[0225] e is the base of natural logarithms;
[0226] ΔE represents the difference in fitness between the new solution and the current solution, and T represents the current temperature parameter.
[0227] S5: Use IWOA algorithm to optimize BP neural network.
[0228] The S5 comprises the following steps:
[0229] Before using BP neural network to predict CNV, the network must be trained first. The training process of BP neural network using IWOA is shown in Algorithm 4. The initial weights and thresholds obtained by IWOA optimization are substituted into the BP neural network, and the training data is input to train the BP neural network. The fitness of individuals is tested by IWOA. Individuals that cannot meet the fitness standard are repeatedly searched and the BP neural network is retrained until the individual meets the fitness standard or meets the accuracy requirement.
[0230] S51: Initialize the network. IP represents the neuron input vector, OP represents the neuron output vector. The input and output sequences can be quantized using Equation 20. The input layer, hidden layer, and output layer of the BP neural network each have an initialized number of nodes, represented by letters m, h, and n, respectively:
[0231]
[0232] S52: Calculate the output of the hidden layer. The output of the hidden layer is calculated according to the input variable IP, the weight between the input layer and the hidden layer, and the threshold of the hidden layer. The calculation method is shown in Formula 21:
[0233]
[0234] Where: H j Represents the output value of the hidden layer;
[0235] f(t) represents the activation function, which is calculated using Equation 4;
[0236] w ij represents the weight between the i-th node in the input layer and the j-th node in the hidden layer, and μ a represents the threshold of the hidden layer;
[0237] S53: Calculate the output of the output layer. The output of the output layer is calculated according to the output value of the hidden layer, the weight between the hidden layer and the output layer, and the threshold of the output layer. The calculation method is shown in Formula 22:
[0238]
[0239] Among them: OP k Represents the actual prediction output of the BP neural network;
[0240] w jk Represents the weight between the jth node in the hidden layer and the kth node in the output layer;
[0241] μ b represents the threshold of the output layer;
[0242] S54: Calculate the network prediction error, define the error between the actual prediction output and the expected output of the BP neural network as e, and set the maximum allowable error value to E. If max(e k )>E, indicating that there is an obvious deviation between the actual prediction output of the current BP neural network and the expected output, and the prediction result is not ideal. Therefore, the BP neural network parameters must be adjusted and retrained until all training data meet the error standard. The calculation method is expressed by formula 23:
[0243] e k =|O k-OP k | (23)
[0244] Among them: k Represents the expected output of the BP neural network;
[0245] S55: Update weights and thresholds. Update weights and thresholds according to e calculated in the above steps. The updating method is as follows:
[0246]
[0247] w jk =w jk +ηH j e k (25)
[0248]
[0249] μ b =μ b +e k (27)
[0250] Wherein, η represents the learning rate, which is used to control the convergence speed and stability of the BP neural network, and its range is set between (0, 1);
[0251] w ij Represents the weight between the i-th node in the input layer and the j-th node in the hidden layer;
[0252] μ a represents the threshold of the hidden layer;
[0253] w jk Represents the weight between the jth node in the hidden layer and the kth node in the output layer;
[0254] μ b represents the threshold of the output layer;
[0255] S56: Determine whether the algorithm iteration is finished. If not, return to step 2.
[0256] After training the IWOA-based BP neural network (IWOABP), CNVs can be predicted for the test data set. In IWOABP, each input node represents a feature value and each output node represents a CNV state. For each bin in the gene, the output of the algorithm includes five values. These values range from 0 to 1, representing the probability that the copy number state of a bin belongs to normal, interspersed duplication amplification, tandem amplification, hemizygous deletion, or homologous deletion. For each bin, IWOABP outputs the probability values of the four copy number states. The maximum probability value is extracted and the state corresponding to it is selected as the copy number state of the current bin. For example, if the probability of hemizygous deletion is the largest among the five states, the bin is marked as hemizygous deletion. Finally, once all bins in the entire genome have been marked, adjacent bins with the same copy number state are merged into segments, and the copy number state of the segment (normal, interspersed duplication amplification, tandem amplification, hemizygous deletion, or homologous deletion) is output.
[0257] S6: Experimental Results
[0258] In order to verify the effectiveness of IWOABP, it was evaluated using simulated data and real data. First, simulated data with different purities and coverages were generated using IntSim, and IWOABP was compared with seven published methods (CNV_nator, FRREE, GROM_RD, CNV_IFTV, MFCNV, CNVABNN, Read Depth) for CNV detection methods with different purities and coverages. The evaluation performance indicators include sensitivity, accuracy, and F1 score. The algorithms of the compared methods were run using their default parameter settings to ensure the fairness of the comparison results. In addition, three groups of real samples (NA19238, NA19239, and NA19240) were used to compare the above methods to verify the practicality of IWOABP. The following is a detailed description of the experiment.
[0259] S61: Simulation data
[0260] IntSIM was used to generate sequencing data sets, with coverage depths set to 4x and 6x, and tumor purity set to 0.2, 0.3, and 0.4, to generate low-purity data sets of different configurations. A total of 6 simulation data with different combinations of configurations were generated in the present invention. A chromosome (Chr21) was selected from the standard reference genome as the reference sequence for IntSim input, and 50 samples were generated for each configuration. A total of 300 samples were generated in the simulation experiment. Based on these simulated data sets, IWOABP was compared with five existing methods in terms of sensitivity, accuracy, and F1-score. Sensitivity is defined as the ratio between the number of correctly detected CNVs and the total number of CNVs in the goundtruth file. Accuracy is defined as the ratio between the number of correctly detected CNVs and the total number of CNVs detected by the method. The F1-score is the harmonic mean of accuracy and sensitivity, with a maximum value of 1 and a minimum value of 0. The calculation method of the performance index is expressed as formulas 28-30:
[0261]
[0262] In equations 28-30, TP represents the number of correctly detected CNVs, TP+FN represents the total number of actual CNVs, and TP+FP represents the total number of CNVs detected using IWOABP. Figure 3 As shown in the figure, the horizontal axis represents the accuracy, the vertical axis represents the sensitivity, and the F1-score on each curve is equal.
[0263] Depend on Figure 3 It can be seen that with the increase of tumor purity, the detection performance of the six methods for CNV has improved. For example, when the coverage depth is 6x, when the tumor purity is 0.2, the sensitivity of FREEC is about 0.31, and when the tumor purity is 0.4, the sensitivity is about 0.58. Other algorithms also show good retrieval performance in some scenarios. When the tumor purity is 0.3 and the coverage depth is 6x, the accuracy of GROM_RD is slightly higher than that of IWOABP, but the sensitivity is only 0.29, and the F1-score is about 0.41, while the F1-score of IWOABP can reach 0.95. The other algorithms are similar. In terms of accuracy, GROM_RD obtains the highest value twice in the six categories of samples, CNVnator obtains the highest value once, and IWOABP obtains the highest value three times. From the perspective of sensitivity and F1-score, IWOABP obtains the highest value in all six categories of samples. Therefore, based on the previous analysis, it can be concluded that IWOABP has a good effect in CNV detection.
[0264] ROC curve is also an important tool for evaluating the effectiveness of classification methods, mainly by comparing the true positive rate (TPR) and false positive rate (FPR) of the evaluation method. TPR represents the proportion of correctly predicted CNVs to the total number of actual CNVs, and its calculation method is the same as sensitivity. In this study, TPR is equal to sensitivity. FPR represents the proportion of incorrectly predicted normal bins to the total number of normal bins. The calculation method is represented by equations 31 and 32:
[0265] TPR = sensitivity (31)
[0266]
[0267] In Equation 32, represents the number of normal bins that are incorrectly predicted, and represents the total number of normal bins. The ROC analysis curves of IWOABP and the other five classic methods are shown in Figure 4 As shown in the ROC curve, high TPR and low FPR indicate that the performance of the detection method is superior, that is, the closer Figure 4 The closer it is to the upper left corner, the better the performance of the method. On the contrary, the closer it is to the lower right corner, the worse the performance of the method. By analyzing the TPR and FPR of several methods under three tumor purities, it can be seen that IWOABP is closest to the upper left corner. First, the TPR of various algorithms under three tumor purities is analyzed. IWOABP has the highest TPR, and the TPR of MFCNV is slightly lower than that of IWOABP. The TPR of the remaining detection methods is generally low, and as the tumor purity continues to decrease, the TPR value also continues to decrease. Then analyze the FPR of different detection methods. IWOABP has the lowest FPR, followed by CNV_IFTV, and the worst performance is CNV_nator. However, the FPR value of IWOABP is not always the best among different detection methods. For example, the FPR of CNV_IFTV when the tumor purity is 0.3 is smaller than that of IWOABP. In general, IWOABP has good detection performance for low-purity tumor data.
[0268] The accuracy of detecting CNV boundaries is also one of the key indicators to measure the reliability of the algorithm. Boundary error usually refers to the distance or difference between the predicted CNV boundary position and the actual CNV boundary position. The existence of boundary error may lead to misjudgment of CNV or inaccurate boundary determination. The smaller the boundary deviation, the higher the accuracy of the detection method. MFCNV has achieved good results in boundary deviation. This paper compares IWOABP with it to verify the detection performance of IWOABP. Figure 5 The comparison results between IWOABP and MFCNV are shown. Figure 5It can be seen that the boundary error of IWOABP is smaller than that of MFCNV under six different configurations. This shows that IWOABP has better versatility and reliability than MFCNV when used to detect different types of CNV.
[0269] S62: Real Data
[0270] In order to verify that IWOABP also has a certain universality for real data, it was applied to three real sequencing samples obtained from the 1000 Genomes Project. These three samples are real sequencing samples on chromosome 21 from the CEU family, numbered NA19238, NA19239 and NA19240. Each group of samples contains more than 30,000 data. IWOABP and six other detection methods (CNVnator, FRREEC, GROM_RD, MFCNV, CNVABNN, Read Depth) were used on these samples, and based on the verified CNVs obtained from the Database of Genomic Variations (DGV), the sensitivity and accuracy of these methods were calculated and compared. The results of the comparison are shown in the figure below. Figure 6 shown.
[0271] from Figure 6 As can be seen in the figure, the point of IWOABP is located closest to the upper right corner. Therefore, IWOABP has the highest F1-score in all three samples. It is followed by CNVABNN and MFCNV, and then the other four methods. In terms of sensitivity, IWOABP obtained the highest value in all three samples, and all obtained a sensitivity of more than 0.9. The performance of CNVABNN is second only to IWOABP, and the sensitivity of the other methods is generally low, not exceeding 0.8. In terms of accuracy, IWOABP is not the best. MFCNV obtained a total of three highest values, especially in sample NA19239, where an accuracy of more than 0.99 was obtained. The accuracy of IWOABP is second only to MFCNV in the three samples. Overall, IWOABP has achieved the best balance between sensitivity and accuracy and is a relatively reliable tool for detecting CNV. IWOABP and six other methods were used to detect CNV on chr21 in three real samples, and the results are shown in Table 1. As can be seen from Table 1, IWOABP identified 295, 219, and 242 CNVs in these real samples. IWOABP detected the largest number of CNVs in all samples, indicating that it has a strong detection ability in real sample applications.
[0272] Table 1 Number of bins where CNV_IWOABP and other algorithms detected mutations
[0273]
[0274] The above disclosure is only a specific embodiment of the present invention, but the present invention is not limited thereto, and any changes that can be conceived by those skilled in the art should fall within the protection scope of the present invention.
Claims
1. A copy number variation detection method using hybrid whale optimization and BP neural network, characterized in that: The following steps are involved: S1: Data preprocessing: Use BWA software to align the sequencing sample files obtained from NGS with the reference sequences to obtain BAM files, and use SAMtools to extract the Read Count profile from the BAM files; S2: Feature extraction, setting four eigenvalues (R i ,G i ,C i ,Q i ), extracted from the read segment information, where S3: Construction of BP neural network; S4: Improve the whale optimization algorithm. The performance of the whale optimization algorithm is improved by designing two population initialization strategies and three position update strategies based on the change mechanism of adaptive inertia weight. S41: population initialization; S42: Location update; S43: local search; S5: Use IWOA algorithm to optimize BP neural network.
2. The copy number variation detection method of hybrid whale optimization and BP neural network according to claim 1, characterized in that: The S2 comprises the following steps: S21: The first eigenvalue R i , eigenvalue R i The value is RD, where RD is the average RC value of each bin, and bin refers to the continuous non-overlapping and equal-sized windows obtained by dividing the complete reference sequence; S22: GC bias refers to the total content of guanine and cytosine being too high or too low due to contamination of normal cells during sequencing. The GC content score is used as the second eigenvalue. The calculation method of the GC content score is shown in Formula 1: G i =g i +c i (1) Where: G i represents the GC content of the i-th bin; g i and c i Respectively represent the number of guanine and cytosine in the i-th bin; S23: The correlation between adjacent positions in the genome is a feature related to gene structural variation, which is used as the third eigenvalue C i , as shown in Formula 2: Where: C i Represents the correlation between the bin at the i-th position and its neighboring positions in the surrounding area; S l and S w Respectively represent the number of left bins and right bins adjacent to the i-th bin; S24: Sequence alignment quality Q i Indicates the confidence of each read segment aligned to the reference genome. Its extraction method is similar to that of GC content. All eigenvalue data are converted into numbers between [0, 1] using normalization. The normalization process is shown in Formula 3: Where: y represents the normalized eigenvalue; x max and x min They represent the maximum and minimum values of the features before normalization.
3. The copy number variation detection method of hybrid whale optimization and BP neural network according to claim 2, characterized in that: The specific steps of S3 are: The BP neural network has three layers, of which the input layer has 4 neurons, the hidden layer has 9 neurons, and the output layer has 5 neurons. The normalized eigenvalues are grouped into four tuples (R i ,G i ,C i ,Q i ) are used as the four inputs of the neural network, and the five outputs represent the five states of the predicted copy number: normal, tandem amplification, interspersed repeat amplification, half deletion, and complete deletion. The sigmoid function is used as the activation function between the hidden layer and the input layer to increase the nonlinearity of the BP neural network model. The activation function is shown in Formula 4 below: a=wx+θ (5) Among them: x represents the input vector of the current neuron, that is, a quaternion composed of normalized eigenvalues; w represents the weight of the neurons between the hidden layer and the output layer; θ represents the bias of the corresponding neuron.
4. The copy number variation detection method of hybrid whale optimization and BP neural network according to claim 3, characterized in that: The S41 comprises the following steps: A whale group is generated by random initialization, and its size is N. Each whale in the group represents an individual, and the position of each individual in the search space represents a solution. The absolute value of the error between the expected output and the actual predicted output is taken as the individual's fitness value F. The calculation method is shown in Formula 6: Where: k is the coefficient; n represents the total number of output nodes of the BP neural network; ap i and d i Respectively represent the actual predicted output and expected output of the i-th node of the BP neural network; Pooling mechanism: The first strategy for population initialization is to use a pooling mechanism to improve population diversity. We set a matrix Pool = (P1, P2, ..., P n ) to store all solutions. The size of the matrix is set to 1.5 times the initial population size. The members in the matrix Pool are represented by the matrix P = (P i1 ,P i2 ,...,P in ), generated and updated using Equation 7 at the end of each iteration; Where: t represents the current iteration number; B is a binary random vector; is the inverse vector of B; X rand (t) is calculated by formula 10 and used to generate the optimal solution X best (t) Random position in the field; X worst (t) represents the worst solution in the current iteration; The second strategy for population initialization is the migration search strategy, which uses Equation 10 to randomly select a part P from the population to achieve discretization of the whale group, so that the positions that have not been visited in the search space can also be searched, further improving the diversity of the population and the search ability of the algorithm; X(t+1)=X r (t)-X rand (t) (8) Where: X r (t) represents a random position in the entire search space; rand represents a random number between (0, 1); and represent the upper and lower limits of the independent variable respectively; and Represent the optimal solution X best (t) upper and lower bounds; X(t+1) represents the current position of the whale after iteration t+1.
5. The copy number variation detection method of hybrid whale optimization and BP neural network according to claim 4, characterized in that: The S42 comprises the following steps: In the whale optimization algorithm, the position of the prey represents the current optimal solution to the optimization problem. An adaptive inertia weight is introduced in the position update so that the optimal solution can be more fully utilized. An adaptive variable inertia weight based on the cosine function is adopted, as shown in Formula 11: Where: ω represents the adaptive inertia weight of the prey position; IT max Indicates the maximum number of iterations; In order to improve the search efficiency of the prey search strategy in traditional WOA, the adaptive inertia weight is combined with three prey search strategies; S421: Improved encirclement prey search strategy; Whales exchange information with each other and walk randomly to search for the location of prey. Assuming that the target prey is the current optimal position, as the algorithm proceeds, other individuals in the whale group move to the current optimal position to shrink and surround the prey. The formula for updating the position of the whale is as follows: X(t+1)=ω×X best (t)-A×D' (12) C = 2 × rand (13) D'=|C×X best (t)-P rand1 (t)| (15) Where: C is a coefficient vector; A represents the encircling step length; The value of x0 is set to 0.5; The value of γ is set to 0.1; D' represents the distance between the i-th whale and the current global optimal individual; P rand1 (t) randomly selected from the matrix P; rand represents a random number between (0, 1); S422: In IWOA, individual whales will use spiral motion to approach prey and spit out different bubbles to prey. The specific position update model is shown in Equation 16: X(t+1)=D'×e bl ×cos(2πl)+(1-ω)X best (t) (16) Where: b is a constant that limits the logarithmic spiral state; l is a random number from -1 to 1; The random variable p with the same probability is selected to update the position by the shrinking and encircling mechanism and the spiral position update mechanism. The mathematical expression of the position update is shown in Formula 17: S423: Improved random selection search strategy; A position is randomly selected from individuals in the population as the target direction for prey search. When |A|≥0.5, it means that the whale is swimming outside the shrinking encirclement. At this time, the whale individuals perform random searches based on each other's positions. The mathematical model of random search and update position is expressed as formula 18: X(t+1)=ω×X(t)+A×(C×P rand2 (t)-P rand3 (t)) (18) Where: P rand2 and P rand3 are randomly selected from the matrix P respectively.
6. The copy number variation detection method of hybrid whale optimization and BP neural network according to claim 4, characterized in that: The S43 comprises the following steps: S431: randomly selecting one of the roulette selection method and the binary tournament selection method to perform a selection operation; S432: using a two-point crossover method to randomly select two intersection points on the solution obtained through the above steps, and then exchanging the data at the intersection points to obtain a new solution, thereby forming a new solution space; S433: Use the reception criteria of the simulated annealing algorithm to determine whether to receive a new solution. The probability of receiving a new solution is calculated as shown in Formula 19: Where: P' represents the probability of receiving a new solution; e is the base of natural logarithms; ΔE represents the difference in fitness between the new solution and the current solution, and T represents the current temperature parameter.
7. The copy number variation detection method of hybrid whale optimization and BP neural network according to claim 4, characterized in that: The S5 comprises the following steps: S51: Initialize the network. IP represents the neuron input vector, OP represents the neuron output vector. The input and output sequences can be quantized using Equation 20. The input layer, hidden layer, and output layer of the BP neural network each have an initialized number of nodes, represented by letters m, h, and n, respectively: S52: Calculate the output of the hidden layer. The output of the hidden layer is calculated according to the input variable IP, the weight between the input layer and the hidden layer, and the threshold of the hidden layer. The calculation method is shown in Formula 21: Where: H j Represents the output value of the hidden layer; f(t) represents the activation function, which is calculated using Equation 4; w ij Represents the weight between the i-th node in the input layer and the j-th node in the hidden layer; μ a represents the threshold of the hidden layer; S53: Calculate the output of the output layer. The output of the output layer is calculated according to the output value of the hidden layer, the weight between the hidden layer and the output layer, and the threshold of the output layer. The calculation method is shown in Formula 22: Among them: OP k Represents the actual prediction output of the BP neural network; w jk Represents the weight between the jth node in the hidden layer and the kth node in the output layer; μ b represents the threshold of the output layer; S54: Calculate the network prediction error, define the error between the actual prediction output and the expected output of the BP neural network as e, and set the maximum allowable error value to E. If max(e k )>E, indicating that there is an obvious deviation between the actual prediction output of the current BP neural network and the expected output, and the prediction result is not ideal. Therefore, the BP neural network parameters must be adjusted and retrained until all training data meet the error standard. The calculation method is expressed by formula 23: and k =|O k -ON k | (23) Among them: k Represents the expected output of the BP neural network; S55: Update weights and thresholds. Update weights and thresholds according to e calculated in the above steps. The updating method is as follows: w jk =w jk +ηH j e k (25) m b =μ b +e k (27) Wherein, η represents the learning rate, which is used to control the convergence speed and stability of the BP neural network, and its range is set between (0, 1); w ij Represents the weight between the i-th node in the input layer and the j-th node in the hidden layer; μ a represents the threshold of the hidden layer; w jk Represents the weight between the jth node in the hidden layer and the kth node in the output layer; μ b represents the threshold of the output layer; S56: Determine whether the algorithm iteration is finished. If not, return to step 2.
