Intelligent fault diagnosis method for crude oil pretreatment system
Through the improved sparrow search algorithm, the SVM parameters are optimized and the strong classifier model is built, which solves the problem of difficult to quickly locate the faults of crude oil pretreatment systems in refining and chemical enterprises, and improves the accuracy and stability of fault diagnosis.
Patent Information
- Application Number
- CN202411970183.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-29
AI Technical Summary
The failure of crude oil pretreatment system of refining and chemical enterprises has caused the accuracy of near-infrared spectral detection to be reduced, and it is difficult for the existing technology to quickly and accurately locate the cause of the failure, affecting production efficiency.
Design an intelligent fault diagnosis method for crude oil pretreatment systems based on near-infrared spectroscopy, optimize support vector machine (SVM) parameters through the improved sparrow search algorithm, build a strong classifier model, and realize fault diagnosis.
It improves the classification accuracy and iterative performance of SVM, enhances the model's adaptability to complex fault modes and diagnostic stability, and ensures the accuracy of fault diagnosis of crude oil pretreatment system.
Smart Images

Figure CN119903404A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of near-infrared rapid analysis of crude oil in a refinery, and in particular to an intelligent fault diagnosis method for a crude oil pretreatment system based on near-infrared spectroscopy. Background Art
[0002] The crude oil pretreatment system is a key equipment for rapid analysis and evaluation of crude oil properties in refining enterprises. It is used to ensure that crude oil samples meet the requirements of near-infrared (NIR) spectroscopy detection. The reliability of crude oil NIR spectrum is an important basis for subsequent process optimization and production decision-making. Once the pretreatment system fails, it will directly affect the accuracy of the spectrum, resulting in loss of benefits. Due to the complex internal processes and numerous links of the pretreatment system, the rapid location and tracing of the cause of the failure has become a difficult problem in production, and an efficient and reliable diagnostic method is urgently needed to solve it.
[0003] At present, the fault diagnosis of refining and chemical equipment still mainly relies on the experience and expert knowledge of operators, which can be applied to simple production scenarios, but in complex refining and chemical equipment, its reliability is low and its efficiency is low, which makes it difficult to meet the needs of modern production. With the popularization of distributed control systems, a large amount of process data available for analysis can be stored, which makes data-driven fault diagnosis technology a research focus in the field of refining and chemical industry.
[0004] In recent years, spectral technology has been widely used in the field of oil property analysis and production control due to its rich information, non-invasiveness and rapid detection. However, there is little research on spectral technology in fault diagnosis, especially in locating the cause of pretreatment system faults. It is difficult to accurately locate the faults through manual analysis and the locating time is long, which affects production continuity. Therefore, how to use crude oil near-infrared spectroscopy to perform property analysis while realizing pretreatment system fault diagnosis and ensuring its high accuracy and reliability has become an important issue that refining companies need to solve. Summary of the invention
[0005] In view of the problems existing in the background technology, the present invention discloses an intelligent fault diagnosis method for crude oil pretreatment system, designs an improved sparrow search algorithm to optimize the parameters of a support vector machine (SVM), designs a strong classifier, and establishes a crude oil near infrared spectrum fault diagnosis model. The method has the following steps:
[0006] 1) Collect crude oil samples under R different faults in the crude oil pretreatment system and measure the near infrared spectra of the samples. The spectral wave number range is 4000~4800cm -1 ;
[0007] 2) The Savitzky-Golay 3-point 17-order convolution smoothing algorithm is used to smooth and denoise the spectral data samples, and then the kernel principal component analysis (KPCA) is used to extract the smoothed spectral fault features to obtain the spectral data after smoothing, denoising and feature extraction;
[0008] 3) Use the holdout method to divide the spectral data samples into training set D according to the ratio of 7:3 train and the test set D test , the number of training set samples is N;
[0009] 4) Improve the sparrow search algorithm to optimize the optimization process of SVM penalty factor and kernel parameters and construct the base classifier, as follows:
[0010] a. Use the Tent chaotic sequence to initialize the sparrow population, and perturb the initial position X′ of the individual sparrows in the population to obtain the perturbed position X n ' ew :
[0011] X n ' ew =(X′+(X min +(X max -X min )H)) / 2
[0012] Where X min and X max is the minimum and maximum value of the value range of X′, H is the chaos vector;
[0013] b. Using training set D train The cross-validation error rate is used as the individual fitness of the sparrow, and the individual position of the sparrow is updated using the sparrow search algorithm;
[0014] c. Compare the individual fitness of the sparrows with the average fitness. If it is less than the average, use the Tent chaos perturbation in step a to perturb the sparrow position. Otherwise, use Gaussian mutation N(0,1) to perturb the sparrow position:
[0015] X n ' ew =X′(1+N(0,1))
[0016] d. Update the fitness and optimal position, and determine whether the maximum number of iterations has been reached. If so, output the optimal SVM parameters, otherwise return to step b;
[0017] 5) Design an adaptive weighting method to combine M base classifiers to obtain a strong fault diagnosis classifier. The training process of the M base classifiers is as follows: first, all training samples are given the same weight, and the M base classifiers are iteratively trained in turn. During the iteration process, the weight v of the mth base classifier is calculated. m And update the next iteration sample weight Wm+1 :
[0018]
[0019] In the formula is the classification error rate, I(h m (x i )≠y i ) in h m (x i )≠y i 1 when ω is 1, otherwise 0. mi is the weight of the i-th sample of the m-th base classifier, y i and h m (x i ) are the actual output and predicted output of the base classifier, is the normalization factor;
[0020] 6) Use training set D train For R different preprocessing system failures, R binary strong classifier models M1, M2, ..., M are established. R , combined into a crude oil pretreatment system fault diagnosis model M OVR , according to the test set D test Verify the accuracy and generalization ability of the model;
[0021] 7) Online collection of crude oil near infrared spectra of pretreatment system failures, with a wave number range of 4000-4800 cm -1 :
[0022] 8) Smoothing and feature extraction of the spectral samples collected online are used as models M1, M2, ..., M R Input;
[0023] 9) Use the model to perform preprocessing system fault diagnosis and obtain intermediate diagnosis results r1, r2, …, r R , and the result with the highest score exceeding the threshold is taken as the fault diagnosis result r=max{r1,r2,…,r R}, if all diagnostic scores do not exceed the threshold, it is considered a normal sample.
[0024] Beneficial effects:
[0025] The present invention discloses an intelligent fault diagnosis method for crude oil pretreatment system, which optimizes the SVM penalty factor and kernel parameter by designing an improved sparrow search algorithm, performs weighted combination as a base classifier, and constructs a fault diagnosis strong classifier model to diagnose common faults in the pretreatment system. The method can improve the classification accuracy and iteration performance of SVM, and by dynamically adjusting the weights of samples and base classifiers, effectively enhance the model's adaptability to complex fault modes and diagnostic stability, so as to ensure that the fault diagnosis accuracy of the crude oil pretreatment system meets the application requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 The flow chart of establishing a base classifier for optimizing SVM parameters for improving the sparrow search algorithm of the present invention;
[0027] Figure 2 The adaptive weighted strong classifier model framework of the present invention;
[0028] Figure 3 It is a curve diagram of the accuracy of the iterative process of the strong classifier in the embodiment of the present invention;
[0029] Figure 4 This is a diagram showing the fault diagnosis results of the crude oil pretreatment system in an embodiment of the present invention. DETAILED DESCRIPTION
[0030] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments. The implementation effect of the method in diagnosing the fault of the crude oil pretreatment system is described by a specific operation process. This implementation case is implemented on the premise of the technical solution of the present invention, but the protection scope of the present invention is not limited to the following embodiments.
[0031] The present invention takes a certain refinery enterprise as an example to illustrate the effectiveness and implementation process of the present method. The normal state and common fault types of the crude oil pretreatment device of the enterprise are: oil sample contains water (1), oil sample contains impurities (2), oil sample overheating (3), measurement noise (4), baseline drift (5), normal state (6). The fault type labels and sample distribution are shown in Table 1.
[0032] Table 1 Fault type labels and sample distribution
[0033]
[0034]
[0035] The specific process of the method of the present invention is as follows:
[0036] 1) The crude oil samples at the feed of the atmospheric and vacuum unit of the refinery were sampled and sent to the spectrometer through the pretreatment device. R = 6 crude oil samples under different pretreatment system conditions were collected, a total of 310 groups, and the near-infrared spectra of the samples were measured. The spectral wavenumber range was 4000-4800cm -1 ;
[0037] 2) Each group of spectral data samples is smoothed and denoised using the Savitzky-Golay 3-point 17-order convolution smoothing algorithm, and then the kernel principal component analysis is used to extract the smoothed spectral fault features to obtain the spectral data after smoothing, denoising and feature extraction;
[0038] 3) Use the holdout method to divide the spectral data samples into training set D according to the ratio of 7:3 train and the test set D test , the number of training set samples N = 217;
[0039] 4) Improve the sparrow search algorithm to optimize the optimization process of SVM penalty factor and kernel parameters, set the number of sparrow population to 50, the maximum number of iterations to 20, and construct the base classifier process as follows Figure 1 As shown, the details are as follows:
[0040] a. Use the Tent chaotic sequence to initialize the sparrow population, and perturb the initial position X′ of the individual sparrows in the population to obtain the perturbed position X n ' ew :
[0041] X n ' ew =(X′+(X min +(X max -X min )H)) / 2
[0042] Where X min and X max is the minimum and maximum value of the value range of X′, H is the chaos vector;
[0043] b. Using training set D train The cross-validation error rate is used as the individual fitness of the sparrow, and the individual position of the sparrow is updated using the sparrow search algorithm;
[0044] c. Compare the individual fitness of the sparrows with the average fitness. If it is less than the average, use the Tent chaos perturbation in step a to perturb the sparrow position. Otherwise, use Gaussian mutation N(0,1) to perturb the sparrow position:
[0045] X n ' ew =X′(1+N(0,1))
[0046] d. Update the fitness and optimal position, and determine whether the maximum number of iterations has been reached. If so, output the optimal SVM parameters, otherwise repeat step b;
[0047] 5) Design an adaptive weighting method to combine M base classifiers to obtain a strong fault diagnosis classifier such as Figure 2 As shown in the figure, the training process of M base classifiers is as follows: first, all training samples are given the same weight, and the M base classifiers are iteratively trained in turn. During the iteration process, the weight v of the mth base classifier is calculated. m And update the next iteration sample weight W m+1 :
[0048]
[0049] In the formula is the classification error rate, I(h m (x i )≠y i ) in h m (x i )≠y i 1 when ω is 1, otherwise 0. mi is the weight of the i-th sample of the m-th base classifier, y i and h m (x i ) are the actual output and predicted output of the base classifier, is the normalization factor;
[0050] 6) Use training set D train For R different preprocessing system failures, R binary strong classifier models M1, M2, ..., M are established. R In this embodiment, the iterative training process of the strong classifier model is as follows: Figure 3 As shown in Figure 2, as the number of iterations increases, the accuracy of the integrated strong classifier continues to increase and tends to stabilize after the number of iterations reaches 8. Therefore, M=8 is taken, and R binary classification models M1, M2, …, M R Combined into preprocessing system fault diagnosis model M OVR , the accuracy and generalization ability of the model are verified based on the test set Dtest. The classification results of the test set are as follows Figure 4 As shown, the classification accuracy of the test set reaches 95.70%;
[0051] 7) Collect the near infrared spectrum of crude oil when the crude oil pretreatment system of the enterprise has an oil sample impurity fault, and take the wave number range of 4000~4800cm -1 Spectral data of
[0052] 8) Smoothing and feature extraction of fault spectrum samples input models M1, M2, ..., M R ;
[0053] 9) Use the trained model to diagnose the crude oil pretreatment system fault and obtain the intermediate diagnosis results r1, r2, …, r R The result with the highest score exceeding the threshold of 0.90 is taken as the fault diagnosis result r = max{r1, r2, ..., r R}, if all the diagnostic scores do not exceed the threshold, it is considered to be a normal sample. In this embodiment, the intermediate diagnostic results of the fault spectrum are r1=0.127, r2=0.973, r3=0.275, r4=0.091, r5=0.243, r6=0.082, among which r2 is the highest score and exceeds the threshold of 0.90, so r=r2, and the diagnosis is that the oil sample contains impurities. The diagnostic result is consistent with the actual fault.
[0054] From the above analysis, it can be seen that the present invention designs an improved sparrow search algorithm to optimize SVM, and designs a strong classifier to construct a fault diagnosis model to achieve accurate diagnosis of crude oil pretreatment system faults. This effectively improves the diagnostic accuracy of common faults in crude oil pretreatment systems, and enables rapid and accurate positioning of pretreatment system faults while using near-infrared spectroscopy to analyze crude oil properties, thereby ensuring the reliability of spectral data, facilitating subsequent process decision-making and process control, and ensuring production efficiency.
Claims
1. An intelligent fault diagnosis method for crude oil pretreatment system, characterized in that An improved sparrow search algorithm is designed to optimize the parameters of the support vector machine, and a strong classifier is designed to establish a crude oil near-infrared spectrum fault diagnosis model, which has the following steps: 1) Collect crude oil samples under R different faults in the crude oil pretreatment system and measure the near infrared spectra of the samples. The spectral wave number range is a1~a2cm -1 ; 2) Smoothing and denoising the spectral data samples, and extracting the smoothed spectral features to obtain smoothed denoising and feature-extracted spectral data; 3) Divide the spectral data samples into training set D train and the test set D test , the number of training set samples is N; 4) Improve the sparrow search algorithm to optimize the optimization process of the support vector machine SVM penalty factor and kernel parameters, and build a base classifier, as follows: a. Use the Tent chaotic sequence to initialize the sparrow population, and perturb the initial position X′ of the individual sparrows in the population to obtain the perturbed position X n ' ew : X n ′ ew =(X′+(X min +(X max -X min )H)) / 2 Where X min and X max is the minimum and maximum value of the value range of X′, H is the chaos vector; b. Using training set D train The cross-validation error rate is used as the individual fitness of the sparrow, and the individual position of the sparrow is updated using the sparrow search algorithm; c. Compare the individual fitness of the sparrows with the average fitness. If it is less than the average, use the Tent chaos perturbation in step a to perturb the sparrow position. Otherwise, use Gaussian mutation N(0,1) to perturb the sparrow position: X n ′ ew =X′(1+N(0,1)) d. Update the fitness and optimal position, and determine whether the maximum number of iterations has been reached. If so, output the optimal support vector machine parameters, otherwise return to step b; 5) Design an adaptive weighting method to combine M base classifiers to obtain a strong fault diagnosis classifier. The training process of the M base classifiers is as follows: first, all training samples are given the same weight, and the M base classifiers are iteratively trained in turn. Calculate the mth base classifier weight v in the iteration process m And update the next iteration sample weight W m+1 : In the formula is the classification error rate, I(h m (x i )≠y i ) in h m (x i )≠y i 1 if yes, 0 otherwise. ω mi is the weight of the i-th sample of the m-th base classifier, y i and h m (x i ) are the actual and predicted outputs of the base classifier, is the normalization factor; 6) Use training set D train For R different preprocessing system failures, R binary strong classifier models M1, M2, ..., M are established. R , combined into a crude oil pretreatment system fault diagnosis model M OVR , according to the test set D test Verify the accuracy and generalization ability of the model; 7) Online collection of crude oil near infrared spectra of pretreatment system failure, wave number range is a1~a2cm -1 : 8) Smoothing and feature extraction of the spectral samples collected online are used as models M1, M2, ..., M R Input; 9) Use the model to perform preprocessing system fault diagnosis and obtain intermediate diagnosis results r1, r2, …, r R , and the result with the highest score exceeding the threshold is taken as the fault diagnosis result r=max{r1,r2,…,r R }, if all diagnostic scores do not exceed the threshold, it is considered a normal sample.
2. The intelligent fault diagnosis method for crude oil pretreatment system according to claim 1 is characterized in that Determine the near infrared spectrum range a1~a2cm -1 4000~4800cm -1 .
3. The intelligent fault diagnosis method for crude oil pretreatment system according to claim 1 is characterized in that The Savitzky-Golay 3-point 17-order convolution smoothing algorithm is used to remove spectral noise, and kernel principal component analysis is used to extract spectral fault features.
4. The intelligent fault diagnosis method for crude oil pretreatment system according to claim 1 is characterized in that The holdout method is used to divide the data set into training set and test set, and the holdout ratio is 7:
3.
5. The intelligent fault diagnosis method for crude oil pretreatment system according to claim 1 is characterized in that The radial basis function is selected as the kernel function of the support vector machine (SVM).
6. The intelligent fault diagnosis method for crude oil pretreatment system according to claim 1 is characterized in that The number of sparrow populations in the sparrow search algorithm is set to 50, and the maximum number of iterations is set to 20.
7. The intelligent fault diagnosis method for crude oil pretreatment system according to claim 1 is characterized in that The diagnostic score threshold was 0.90.