A drilling waste composition identification and flocculation state detection method based on hyperspectral imaging

By simultaneously analyzing the composition and flocculation state of drilling waste using hyperspectral imaging technology and a multi-task deep learning model, the problems of low detection efficiency and insufficient real-time performance in existing technologies have been solved, realizing intelligent and real-time monitoring of drilling waste treatment.

CN121113897BActive Publication Date: 2026-05-12HEFEI GENERAL MACHINERY RES INST +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HEFEI GENERAL MACHINERY RES INST
Filing Date
2025-08-29
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing technologies cannot achieve simultaneous, rapid, and accurate detection of drilling waste composition and flocculation state. Traditional methods suffer from detection limitations, low efficiency, insufficient real-time performance, and data fragmentation. They also lack effective correlation analysis methods, making it difficult to meet the needs of real-time monitoring and optimization of flocculation processes.

Method used

A hyperspectral imaging-based approach is adopted, which acquires spectral image data through a polarization hyperspectral imaging system and combines it with a multi-task deep learning model to simultaneously analyze the composition and flocculation state, including preprocessing, feature extraction, and result output, and recommends processing parameters.

Benefits of technology

It achieves efficient and accurate detection of drilling waste composition and flocculation state, outputs composition identification results and flocculation state detection results, and recommends process parameters, significantly improving the intelligence level and real-time monitoring capability of drilling waste treatment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121113897B_ABST
    Figure CN121113897B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of oil component detection, and particularly relates to a drilling waste component identification and flocculation state detection method based on hyperspectral imaging. In the present application, data is first acquired through a polarization hyperspectral imaging system, which can effectively suppress specular reflection noise and improve detection accuracy. Secondly, a multi-task deep learning model is used to simultaneously analyze the component and the flocculation state, achieving efficient and accurate multi-parameter detection. Finally, the detection results are output and processing process parameters are recommended, providing a closed-loop solution for practical applications and significantly improving the intelligent level of drilling waste treatment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of petroleum composition detection technology, specifically a method for identifying the composition and flocculation state of drilling waste based on hyperspectral imaging. This method integrates optical detection, signal processing, and machine learning theories to achieve efficient detection and accurate processing of drilling waste. Background Technology

[0002] In oil drilling operations, drilling fluid plays a crucial role as the "blood of drilling." Offshore drilling platforms such as those in the Bohai Oilfield primarily use water-based drilling fluids, but the drilling process generates large amounts of drilling waste containing oil contaminants, heavy metals, and other harmful substances. This waste must undergo flocculation and filtration treatment, with the liquid phase reused and the solid phase transported off-site for secondary use. However, current treatment processes face the following technical bottlenecks:

[0003] Limitations of component detection: Traditional chemical analysis methods (such as atomic absorption spectroscopy, gas chromatography, etc.) can only detect single components and cannot obtain information on multiple components at the same time. Moreover, the detection process is time-consuming and labor-intensive, requires complex sample pretreatment, and is destructive.

[0004] Insufficient assessment of flocculation state: Existing technologies mainly rely on manual microscopic observation or sedimentation experiments to assess flocculation effect. This method is highly subjective, inefficient, and cannot achieve quantitative characterization of flocculation state, making it difficult to meet the needs of real-time monitoring.

[0005] Data fragmentation problem: Component detection and flocculation state assessment usually need to be carried out separately. There is a lack of effective correlation analysis methods, making it difficult to establish a correspondence model between components and flocculation state, and thus failing to provide a scientific basis for flocculant selection and dosage optimization.

[0006] Insufficient real-time performance: Traditional detection methods often take several hours or even longer from sampling to obtaining results, which cannot meet the real-time monitoring and rapid control requirements of modern drilling operations for waste treatment.

[0007] Although hyperspectral imaging technology has been applied in fields such as soil composition analysis, it still has significant shortcomings in the detection of drilling waste: existing technologies lack methods to suppress specular reflection noise; they fail to effectively integrate spectral features with floc texture features; and, particularly, reliable quantitative indicators and detection methods have not yet been established for characterizing flocculation states. Furthermore, existing image processing techniques are mostly based on RGB images, lacking support from spectral dimension compositional information, making it difficult to achieve simultaneous detection of composition and physical state.

[0008] Therefore, developing a new method that can simultaneously, rapidly, and accurately detect the composition and flocculation state of drilling waste is of great significance for improving the efficiency of drilling waste treatment, optimizing the flocculation process, and reducing treatment costs. This is also the key technical problem that this invention aims to solve, and therefore urgently needs to be addressed. Summary of the Invention

[0009] To avoid and overcome the technical problems existing in the prior art, this invention provides a method for identifying the composition and detecting the flocculation state of drilling waste based on hyperspectral imaging. This invention can effectively detect the flocculation state.

[0010] To achieve the above objectives, the present invention provides the following technical solution:

[0011] A method for identifying the composition and detecting the flocculation state of drilling waste based on hyperspectral imaging includes the following steps:

[0012] S1. After pre-processing the drilling waste samples, the spectral image data of the samples are acquired through a polarization hyperspectral imaging system.

[0013] S2. Preprocess and extract features from the spectral image data to obtain spectral features and texture features;

[0014] S3. Input the spectral features and texture features into the trained multi-task deep learning model to simultaneously analyze the composition and flocculation state of drilling waste;

[0015] S4. Output component identification results and flocculation state detection results, and recommend process parameters for drilling waste treatment based on the results.

[0016] As a further aspect of the present invention, the sub-steps of step S1 are as follows:

[0017] S11. Inject drilling waste samples into a transparent observation tube;

[0018] S12. Turn on the linearly polarized light source and adjust the rotating polarizer to the optimal extinction position.

[0019] S13. Use a hyperspectral camera to acquire the corresponding spectral image data.

[0020] As a further aspect of the present invention: the pretreatment of drilling waste samples in step S1 includes: uniformly mixing the samples by means of stirring and ultrasonic treatment; the acquisition of spectral image data of the samples includes: injecting the pretreated samples into a transparent observation channel, controlling the sample injection flow rate to 0.5-2 m / s to avoid the generation of bubbles and sample stratification.

[0021] As a further aspect of the present invention: the operating parameters of the polarization hyperspectral imaging system in step S1 include: using a linearly polarized light source, adjusting the polarizer to the optimal extinction position by rotating the polarizer, wherein the optimal extinction position is the angle of the polarizer when the reflected light intensity drops to less than 5% of the incident light intensity; using a visible light-shortwave infrared hyperspectral camera with a spectral range of 400-2500nm and an image acquisition frequency ≥25 frames / second.

[0022] As a further aspect of the present invention: the preprocessing of the spectral image data in step S2 includes:

[0023] S21. Spectral denoising is performed by combining Savitzky-Golay filtering with an adaptive noise filtering algorithm, wherein Savitzky-Golay filtering uses a 7-point window and a second-order polynomial.

[0024] S22. Perform multivariate scattering correction, calculate the average standard deviation reduction rate Rsd for each band, and retain bands with Rsd ≥ 40%.

[0025] S23. The flocculation region is segmented by thresholding and noise is removed by morphological opening operation.

[0026] As a further aspect of the present invention: the processing of the adaptive noise filtering algorithm in step S2 includes: identifying the noise type through fast Fourier transform; using the db4 wavelet basis for periodic noise, dynamically adjusting the number of 2-5 decomposition layers according to frequency, and removing noise with a soft threshold; using the sym8 wavelet basis for impulse noise, fixing the 3-layer decomposition, and suppressing isolated peaks with an adaptive threshold.

[0027] As a further aspect of the present invention: step S2, extracting spectral features, includes the following steps:

[0028] First, the variance contribution rate and Fisher discrimination ratio of each band are calculated, and the band score S is obtained by fusing the weighting coefficients α and β. j ;

[0029] Next, a threshold ξ is set according to the priority of the detection target, and the score S is retained. j For the band >ξ, ξ is taken at the 80%-90th percentile when component identification is prioritized, and at the 70%-80th percentile when flocculation state analysis is prioritized.

[0030] Finally, a continuous projection algorithm is used to remove redundancy from the retained bands, selecting the band with the largest residual each time until the training requirements are met.

[0031] As a further aspect of the present invention: step S2, extracting texture features, includes the following steps:

[0032] First, using a 15×15 window and a 1-pixel step size, the average values ​​are taken in eight directions, including 0°, 45°, 90°, and 135°, to calculate the contrast, entropy, and second moment of the gray-level co-occurrence matrix.

[0033] Then, based on the Mie scattering theory, assuming that the flocs are spherical particles, the refractive index of the flocs np and the refractive index of the medium nm are taken. By measuring the scattering intensity I(λ) at different wavelengths λ, the characteristic peak positions of the scattering spectrum at 600nm, 1000nm and 2000nm are fitted, and the particle size distribution of the flocs is inverted in Gaussian distribution.

[0034] As a further aspect of the present invention: the multi-task deep learning model in step S3 is a dual-branch CNN model, comprising:

[0035] Composition Branch: The spectral features are processed using a 3-layer 3DCNN to output the composition categories of oil-based rock cuttings and heavy metal-containing sludge;

[0036] Flocculation branch: Uses 2 layers of LSTM to process texture features and outputs the state levels of unflocculated, partially flocculated, and fully flocculated.

[0037] Feature fusion layer: Features are dynamically fused using a cross-attention mechanism, and fused features are generated through formulas.

[0038] As a further aspect of the present invention: the output results in step S4 include a pseudo-color map of component distribution and a thermogram of flocculation state; the recommended process parameters include flocculant type and dosage; the total time from data acquisition to process parameter feedback is <100ms, and the detection data and analysis results are stored to support historical backtracking and subsequent optimization.

[0039] Compared with the prior art, the beneficial effects of the present invention are:

[0040] 1. In this invention, data is first acquired through a polarization hyperspectral imaging system, which can effectively suppress specular reflection noise and improve detection accuracy. Secondly, a multi-task deep learning model is used to simultaneously analyze components and flocculation state, achieving efficient and accurate multi-parameter detection. Finally, by outputting detection results and recommending processing parameters, a closed-loop solution is provided for practical applications, significantly improving the level of intelligence in drilling waste treatment.

[0041] 2. By injecting the sample into the transparent observation channel and adjusting the polarization conditions, the stability and consistency of data acquisition were ensured. The use of a hyperspectral camera can comprehensively capture multi-band spectral information of the sample, providing a rich data foundation for subsequent analysis, while ensuring the efficiency and reliability of the detection process.

[0042] 3. By employing Savitzky-Golay filtering and multivariate scattering correction, noise and scattering interference in the spectral data were effectively removed, improving the signal-to-noise ratio. The steps of segmenting the flocculation region and performing morphological denoising further optimized the image quality, laying a solid foundation for subsequent feature extraction.

[0043] 4. By calculating the variance contribution rate and Fisher's discrimination ratio, characteristic bands were selected, ensuring the representativeness and discriminative power of the spectral features. Texture feature extraction combined gray-level co-occurrence matrix and Mie scattering theory, achieving high-precision inversion of floc particle size distribution and providing a reliable basis for the quantitative analysis of flocculation state.

[0044] 5. The dual-branch CNN model design can process spectral and texture features separately. The introduction of the cross-attention mechanism enables dynamic feature fusion, significantly improving the model's adaptability and accuracy. The early stopping mechanism optimizes training efficiency and avoids overfitting.

[0045] 6. By generating visual charts and building predictive models, the system intuitively displays the test results and provides a scientific basis for practical applications. The function of storing test data supports historical review and further analysis, enhancing the system's practicality and scalability. The closed-loop design of the overall process ensures timely feedback and application of test results. Attached Figure Description

[0046] Figure 1 This is a flowchart of the method of the present invention.

[0047] Figure 2 This is a schematic diagram of the device in this invention.

[0048] In the image: 1. Computer; 2. Hyperspectral camera; 3. Transparent imaging pipe; 4. Waste drilling fluid inlet; 5. Rotating polarizer; 6. Polarizing light source; 7. Waste drilling fluid outlet. Detailed Implementation

[0049] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0050] Please see Figure 1 and Figure 2In this embodiment of the invention, a detection device comprises a polarized light source, a hyperspectral camera 2, a transparent imaging pipe 3, and a data processing terminal (computer 1). The polarized light source includes a linearly polarized light source 6 and a rotating polarizer 5, used to suppress specular reflection noise. The hyperspectral camera 2 is used to capture spectral images of wastewater-based drilling waste. The transparent imaging pipe 3 is made of transparent material to facilitate imaging by the hyperspectral camera.

[0051] In operation, drilling waste, after stirring and ultrasonic pretreatment, is first injected into the transparent imaging pipe 3 through the inlet 4. Simultaneously, the linearly polarized light source 6 is turned on and the rotating polarizer 5 is adjusted to the optimal extinction position. The hyperspectral camera 2 captures the spectral image of the sample inside the pipe in real time, and the data is transmitted to the computer 1 for processing via a gigabit network cable. The treated waste is finally discharged from the outlet 7. Throughout the process, the polarization component effectively suppresses specular reflection noise, the hyperspectral camera 2 ensures the acquisition of high-quality spectral data, and the computer 1 performs rapid analysis, achieving simultaneous detection of components and flocculation status.

[0052] Data preprocessing includes two parts: spectral noise reduction and extraction. Noise reduction first uses Savitzky-Golay filtering to smooth the spectral curve through local polynomial fitting, preserving the effective signal while suppressing random noise to achieve spectral noise reduction. For the spectral sequence y... i (i = 1, 2…n), window width 2m+1, the filtered output formula for polynomial order k. C j Here, represents the polynomial fitting coefficients, and W is the normalization factor, obtained by least squares fitting based on specific values. The window width is 2m+1, meaning there are a total of 2m+1 values ​​from -m to m, where j represents the j-th value. Wavelet transform filtering is then applied, automatically adjusting the wavelet basis function and decomposition level based on the frequency characteristics of the noise to remove periodic and impulse noise.

[0053] Then, multivariate scattering correction (MSC) is used to eliminate differences caused by varying scattering levels during spectral measurements, enhancing the correlation between the spectrum and the data. First, the average spectrum is calculated. Then perform linear regression fitting on each spectrum. Each spectrum is estimated independently using the least squares method. i and b i a i It is the spectral shift coefficient, b i This involves the translation and offset of each spectrum; finally, the spectrum is corrected. The standard deviation comparison method is used for verification. First, the standard deviation (SD) of each wavelength before and after correction is calculated:

[0054]

[0055] Where, μj It is the mean of the j-th band, then the rate of decrease in the mean standard deviation is calculated. M represents the band number. Based on industry experience, when R... sd When the scattering interference is less than 40%, it will still dominate the spectral variation, therefore only R is selected. sd Spectra of ≥40% or more.

[0056] Based on the variance contribution rate, the Fisher criterion is used to screen characteristic bands. First, the variance contribution rate of each band is determined:

[0057]

[0058] Where, x ij It is the j-th band of the i-th spectrum. μ j This is the mean of band j; a larger variance contribution rate indicates richer overall information content in that band. Fisher's method is used to measure the band's ability to distinguish target categories.

[0059]

[0060] Where, μ j1 and μ j2 Let σ be the mean spectral reflectance of oil and heavy metal in the j-th band, respectively. j1 2 and σ j2 2 Let F represent the variances of the spectral reflectance of oils and heavy metals in the j-th band, respectively. j The larger the value, the better the band can distinguish between oil and heavy metals; the smaller the value, the worse the distinguishing ability. When the value is close to 0, it means that the band does not contribute to the classification.

[0061] Then score it, S j =αVar j +βF j Where α and β are weighting coefficients, satisfying α + β = 1, and are adjusted according to actual data and requirements. Simultaneously, a threshold ξ is set according to actual needs, retaining only S. j For bands with a value greater than ξ, if there are only two weighting coefficients, the sum of these two values ​​is 1; if there are three values, the sum of the three values ​​is 1; and if there are n values, the sum of the n values ​​is 1. The paper adds the logic for determining the values ​​of α and β, and the method for setting ξ. This balances information content with classification performance, ensuring that the selected bands contain rich information and are effective for the target task—that is, selecting high-value bands while reducing computational complexity; it also enhances robustness and avoids misselection due to bias in a single indicator.

[0062] Determining ξ: ξ is determined based on the band score quantile. To balance information content and classification performance, ξ ensures that the selected bands contain rich information and are effective for the target task, i.e., selecting high-value bands while reducing computational complexity. Therefore, the highest-scoring bands (15%–25%) are typically selected. When the detection data focuses on Fisher bands, the ξ quantile can be appropriately increased (e.g., 85%) to rigorously select high-discrimination bands; when focusing on Spatial Bands (SPA), the ξ quantile can be decreased (e.g., 75%) to retain more independent bands and enrich texture features.

[0063] First, clarify the priority of the detection target. If the detection task focuses on component identification (such as distinguishing between oils and heavy metals), the Fisher discriminant ratio should be emphasized (prioritizing the ability of bands to distinguish different components). In this case, the ξ quantile should be 80%–90% (e.g., 85%), retaining only the top 20%–10% of high-discrimination bands and strictly eliminating bands with poor discrimination. If the detection task focuses more on flocculation state analysis (relying on rich texture features), then the focus should be on using the continuous projection algorithm (SPA) to screen independent bands. In this case, the ξ quantile should be 70%–80% (e.g., 75%), retaining the top 30%–20% of bands to incorporate more low-correlation independent information and enrich the texture feature dimensions. Meanwhile, the specific quantile value can be dynamically fine-tuned according to the characteristics of the sample set: when the composition of the sample differs significantly (such as a mixture of high-concentration oil and heavy metals), the ξ quantile can be further increased to 90% to enhance discriminative power; when the flocculation state of the sample is complex (such as the coexistence of multi-stage flocculation), it can be reduced to 70% to retain more texture-related bands. This rule not only ensures the matching of quantile values ​​with the detection target, but also adapts to different sample scenarios through dynamic fine-tuning, solving the problem of insufficient applicability caused by parameter fixation in existing technologies.

[0064] Set α∈(0.1~0.9), β=1-α, forming 9 combinations. Divide the sufficient samples into a training set of 70% and a validation set of 30%. Train and validate each combination, and finally select the combination with the highest classification accuracy.

[0065] The weights α and β are adjusted according to requirements, making it suitable for various scenarios. SPA (Continuous Projection Algorithm) is used to remove redundant bands highly correlated with the selected bands through orthogonal projection. Candidate band x j Projected onto the selected band matrix X k Zhang Cheng's subspace yields the residual r. j The larger the value, the lower the information overlap between this band and the selected bands. The residual r is selected each time. j The largest band; once the number of selected bands reaches the training requirement, proceed to the next step.

[0066] Feature extraction and fusion were performed to extract the spectral absorption peaks of oils and heavy metals. Texture parameters were calculated using the Gray-Level Co-occurrence Matrix (GLCM), and the size distribution of flocs was analyzed in conjunction with scattering spectroscopy. It was determined that correlation was not useful for identifying the degree of flocculation. Correlation reflects the directionality and regularity of the texture, while in the identification process, the liquid phase is flowing, and the texture must be oriented towards the outlet. Contrast, entropy, and angular second moment (ASM) were selected as extracted features. A higher contrast value indicates a more pronounced difference in brightness in the image. For example, fully solidified waste has a more uniform texture and lower contrast, while unflocculated particles are more dispersed and have higher contrast. A higher entropy value indicates a more complex and disordered texture. During flocculation, small particles aggregate into larger flocs, and the entropy value gradually decreases. The angular second moment (ASM), also known as "energy," reflects the uniformity of gray-level distribution and the regularity of texture. A higher value indicates uniform floc size and a compact structure, while a lower value indicates large differences in floc size and strong dispersion. In other words, the degree of flocculation is positively correlated with the value of the angular second moment.

[0067] Contrast calculation formula Entropy calculation formula Formula for calculating the second moment of an angle i and j are the row and column indices in GLCM, representing the gray values ​​of adjacent pixel pairs. P(i,j) is the normalized gray-level co-occurrence matrix probability value, representing the probability of pixel pairs with gray values ​​i and j appearing.

[0068] The corresponding floc state can be obtained by combining these three parameters. High contrast + high entropy + low ASM corresponds to dispersed particles, small size, disordered distribution, significant grayscale differences and poor uniformity, indicating no flocculation. Medium contrast + medium entropy + medium ASM corresponds to particles starting to aggregate, uneven size, and complex texture, indicating partial flocculation. Low contrast + low entropy + high ASM corresponds to large and uniform flocs, compact structure, and strong regularity of texture, indicating a high degree of flocculation.

[0069] Then, based on Mie scattering theory, the floc size distribution is inverted:

[0070]

[0071] Where D is the floc particle size, λ is the incident light wavelength, and n p n m The refractive indices of the flocs and the medium are determined by measuring the scattering intensity I(λ) at different wavelengths λ and fitting the distribution of D using a Gaussian distribution. The refractive index np of the flocs is determined based on the optical properties of the main components in the drilling waste. If the flocs are mainly composed of oil contaminants, np is usually taken as 1.50–1.60; if the flocs are mainly composed of heavy metal compounds, np can be taken as 1.70–1.90. The refractive index nm of the medium is determined based on the medium. Water-based drilling waste is mainly water-based, and the medium is usually an aqueous solution, so nm is generally taken as 1.33–1.34.

[0072] Gaussian distribution fitting, the floc particle size distribution function is:

[0073]

[0074] Statistical analysis was performed on the particle size samples, and the mean was calculated. and standard deviation Feature fusion is performed using a dual-branch CNN algorithm attention fusion module to dynamically adjust the contribution weights of spectral and texture features to the task, as shown in the formula h = α·f. s +(1-α)·f t α is generated by an attention mechanism, with α calculated independently for each sample, achieving adaptive feature weighting. The spectral features f are then... s and texture features f t spliced ​​into f st =[f s ;f t ], Sigmoid function α=σ(W a f st +b a ), where W a b a For learnable parameters, the output weights of σ ∈ [0,1] represent the importance of spectral features, 1-α represents the importance of texture features, and finally, a loss function L is introduced. total =λ1L 成分 +λ2L 絮凝 , Where y i,c p represents the true label of sample i. i,c This represents the probability that the model predicts sample i belongs to category c. Where, q i,k p represents the true value of the flocculation level. i,k This represents the predicted flocculation level. λ1 and λ2 are parameters obtained using the dynamic weighting method, where... σ1 and σ2 are learnable parameters that reflect the noise level of each task.

[0075] Algorithm training process:

[0076] 1. Data preparation: Prepare a sufficient number of samples. Each sample needs to be labeled with both the component category and the flocculation state. Then, enhance the sample data. For spectral enhancement, add Gaussian noise and random band occlusion. For image enhancement, use rotation and translation to generate diverse effects.

[0077] 2. Training process: Forward propagation: extract features using shared layers, then use attention fusion mechanism to output results from branches; Loss calculation: calculate component loss and flocculation loss separately, and obtain the total loss after weighting; Backpropagation: update shared layer and branch parameters through gradient descent, while optimizing λ1 and λ2.

[0078] 3. Key hyperparameter settings: Learning rate η, based on experience, is initially set to 0.001, and a cosine annealing strategy is used for optimization. η max =0.001, η min =0.00001, T is the number of cycles, periodically adjusting the learning rate to help the algorithm escape local minima; batch size is set to 32 to balance memory usage and convergence stability; the dropout rate is set to 0.5 according to empirical rules to balance regularization strength and information retention, preventing overfitting; early stopping mechanism, Patience is set to 10 iterations, the minimum improvement threshold is set to 0.0001, the validation set loss is calculated for each iteration, and if the loss does not reach the threshold for 10 consecutive iterations, training is terminated and the patching is restored to the optimal parameters.

[0079] Example:

[0080] 1. Hyperspectral Imaging System: A visible-shortwave infrared (400-2500nm) hyperspectral camera is used, combined with a polarized light source to suppress specular reflection, to collect spectral and spatial information of waste surface; the hyperspectral camera collects spectral and spatial image data of waste surface at a frequency of ≥25 frames / second.

[0081] 2. Spectral Correction: Ambient light interference was corrected based on a standard reflector. Simultaneously, the angle of the rotating polarizer was adjusted. When the reflected light intensity dropped to less than 5% of the incident light, the rotating polarizer was locked. Savitzky-Golay filtering and multivariate scattering correction were performed simultaneously using a 7-point window and a second-order polynomial. The standard deviation (SD) of the spectral data before and after correction was calculated. The results showed that the average SD reduction rate of each band after correction was 52%. The band dominated by clay particle scattering (1300-1500nm) showed the most significant improvement, with the SD value decreasing from 0.08 to 0.03. This ensured that the spectral characteristics mainly reflected the differences in composition rather than physical scattering. The total time for this stage was no more than 10ms.

[0082] 3. Image segmentation: The flocculated region is segmented from the non-flocculated background using a thresholding method; the total time is no more than 10ms.

[0083] 4. Component characteristics: Calculate the variance contribution rate of each band (selecting the top 30% of high-contribution bands) and the Fisher discriminant ratio (screening F-values). jFor bands with wavelengths >1.5, the characteristic bands are finally selected from the original bands through a fusion scoring process using weighted coefficients α and β. These bands cover the characteristic absorption peaks of oil (1650-1750nm), heavy metals (2200-2300nm), and clay minerals (1900-2000nm), with a total processing time of no more than 15ms.

[0084] 5. Flocculation Characteristics: Texture parameters were calculated using the Gray-Level Co-occurrence Matrix (GLCM) with a 15×15 window and a 1-pixel step size. The mean values ​​were taken in eight directions (0°, 45°, 90°, 135°, etc.) to obtain three parameters: contrast (range 0-200), entropy (range 0-5), and second moment of angle (range 0-0.3). The values ​​of these three characteristics in the flocculated and non-flocculated states were determined experimentally. When retrieving particle size distribution based on Mie scattering theory, spherical particles were assumed, with a refractive index of 1.55 for flocs, 1.80 for heavy metal flocs, and 1.33 for the medium (water). The particle size distribution was retrieved by fitting the three characteristic peaks of the scattering spectrum (600nm, 1000nm, 2000nm) and compared with the results of laser particle size analyzer measurements. The correlation coefficient was calculated, with a total processing time not exceeding 25ms.

[0085] 6. Multi-task classification model: A two-branch convolutional neural network (CNN) is constructed to output the component category (oil-based rock cuttings, heavy metal-containing sludge) and the flocculation state level (unflocculated, partially flocculated, fully flocculated). An attention mechanism is introduced to dynamically weight spectral and texture features; the total processing time does not exceed 10ms.

[0086] 7. Results Output: Generates a thermogram relating components to flocculation state, and recommends the optimal treatment process (such as flocculant type and dosage).

[0087] The total time from data acquisition to process feedback is less than 100ms, meeting the requirements for real-time monitoring and control. When the model convergence speed decreases, parameter optimization is automatically triggered to avoid invalid calculations. At the same time, the batch size is adjusted according to hardware conditions and real-time data volume to balance memory usage and processing speed.

[0088] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. A method for identifying the composition and detecting the flocculation state of drilling waste based on hyperspectral imaging, characterized in that, Includes the following steps: S1. After pre-processing the drilling waste samples, the spectral image data of the samples are acquired through a polarization hyperspectral imaging system. S2. Preprocess and extract features from the spectral image data to obtain spectral features and texture features; S3. Input the spectral features and texture features into the trained multi-task deep learning model to simultaneously analyze the composition and flocculation state of drilling waste; The multi-task deep learning model in step S3 is a two-branch CNN model, including: Composition Branch: The spectral features are processed using a 3-layer 3DCNN to output the composition categories of oil-based rock cuttings and heavy metal-containing sludge; Flocculation branch: Uses 2 layers of LSTM to process texture features and outputs the state levels of unflocculated, partially flocculated, and fully flocculated. Feature fusion layer: Employs a cross-attention mechanism to dynamically fuse features, generating fused features through formulas; S4. Output component identification results and flocculation state detection results, and recommend process parameters for drilling waste treatment based on the results; The output of step S4 includes a pseudo-color map of component distribution and a thermogram of flocculation state; recommended process parameters include flocculant type and dosage.

2. The method for identifying the composition and detecting the flocculation state of drilling waste based on hyperspectral imaging according to claim 1, characterized in that, The sub-steps of step S1 are as follows: S11. Inject drilling waste samples into a transparent observation tube; S12. Turn on the linearly polarized light source and adjust the rotating polarizer to the optimal extinction position. S13. Use a hyperspectral camera to acquire the corresponding spectral image data.

3. The method for identifying the composition and detecting the flocculation state of drilling waste based on hyperspectral imaging according to claim 2, characterized in that, The pretreatment of drilling waste samples in step S1 includes: uniformly mixing the samples by stirring and ultrasonic treatment; obtaining the spectral image data of the samples includes: injecting the pretreated samples into a transparent observation channel, controlling the sample injection flow rate to be 0.5-2 m / s to avoid generating bubbles and sample stratification.

4. The method for identifying the composition and detecting the flocculation state of drilling waste based on hyperspectral imaging according to claim 3, characterized in that, The operating parameters of the polarization hyperspectral imaging system in step S1 include: using a linearly polarized light source, adjusting the polarizer to the optimal extinction position by rotating the polarizer, wherein the optimal extinction position is the angle of the polarizer when the reflected light intensity drops to less than 5% of the incident light intensity; using a visible light-shortwave infrared hyperspectral camera with a spectral range of 400-2500nm and an image acquisition frequency of ≥25 frames / second.

5. The method for identifying the composition and detecting the flocculation state of drilling waste based on hyperspectral imaging according to claim 4, characterized in that, Step S2, which involves preprocessing the spectral image data, includes: S21. Spectral denoising is performed by combining Savitzky-Golay filtering with an adaptive noise filtering algorithm, wherein Savitzky-Golay filtering uses a 7-point window and a second-order polynomial. S22. Perform multivariate scattering correction, calculate the average standard deviation reduction rate Rsd for each band, and retain bands with Rsd ≥ 40%. S23. The flocculation region is segmented by thresholding and noise is removed by morphological opening operation.

6. The method for identifying the composition and detecting the flocculation state of drilling waste based on hyperspectral imaging according to claim 5, characterized in that, The processing steps of the adaptive noise filtering algorithm in step S2 include: identifying the noise type through fast Fourier transform; using the db4 wavelet basis for periodic noise, dynamically adjusting the number of 2-5 decomposition layers according to frequency, and removing noise with a soft threshold; and using the sym8 wavelet basis for impulse noise, fixing the 3-layer decomposition, and suppressing isolated peaks with an adaptive threshold.

7. The method for identifying the composition and detecting the flocculation state of drilling waste based on hyperspectral imaging according to claim 6, characterized in that, Step S2, which involves extracting spectral features, includes the following steps: First, the variance contribution rate and Fisher discrimination ratio of each band are calculated, and the band score S is obtained by fusing the weighting coefficients α and β. j ; Next, a threshold ξ is set according to the priority of the detection target, and the score S is retained. j For the band >ξ, ξ is taken at the 80%-90th percentile when component identification is prioritized, and at the 70%-80th percentile when flocculation state analysis is prioritized. Finally, a continuous projection algorithm is used to remove redundancy from the retained bands, selecting the band with the largest residual each time until the training requirements are met.

8. The method for identifying the composition and detecting the flocculation state of drilling waste based on hyperspectral imaging according to claim 7, characterized in that, Extract texture features in step S2 Includes the following steps: First, using a 15×15 window and a 1-pixel step size, the average values ​​are taken in eight directions, including 0°, 45°, 90°, and 135°, to calculate the contrast, entropy, and second moment of the gray-level co-occurrence matrix. Then, based on the Mie scattering theory, assuming that the flocs are spherical particles, the refractive index of the flocs np and the refractive index of the medium nm are taken. By measuring the scattering intensity I(λ) at different wavelengths λ, the characteristic peak positions of the scattering spectrum at 600nm, 1000nm and 2000nm are fitted, and the particle size distribution of the flocs is inverted in Gaussian distribution.

9. The method for identifying the composition and detecting the flocculation state of drilling waste based on hyperspectral imaging according to claim 8, characterized in that, In step S4, the total time from data acquisition to process parameter feedback is less than 100ms, and the detection data and analysis results are stored to support historical backtracking and subsequent optimization.