Method for detecting total nitrogen content of pit mud based on hyperspectral technology combined with mixing algorithm

By combining hyperspectral technology with a hybrid algorithm and employing black-and-white correction and characteristic wavelength extraction strategies, a two-layer structure model was constructed, which solved the problems of rapid, non-destructive, and accurate detection of total nitrogen content in pit mud, thus achieving rapid, non-destructive, and accurate detection of total nitrogen content in pit mud.

CN121096471BActive Publication Date: 2026-02-13SICHUAN UNIVERSITY OF SCIENCE AND ENGINEERING
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511639660.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-11
Publication Date
2026-02-13
Estimated Expiration
2045-11-11

AI Technical Summary

Technical Problem

Existing methods for detecting total nitrogen content in pit mud are time-consuming and not accurate enough, making it difficult to achieve rapid and non-destructive testing. In particular, moisture interference is severe in semi-solid materials, affecting the accuracy of the test.

Method used

Using hyperspectral technology combined with a hybrid algorithm, a three-step strategy of black-and-white correction, continuous projection algorithm, genetic algorithm and competitive adaptive reweighting method was adopted to extract the characteristic wavelengths related to the total nitrogen content of pit mud. A two-layer structure model of hybrid crowned porcupine optimization algorithm and support vector regression was constructed for prediction.

Benefits of technology

It enables rapid, non-destructive, and accurate detection of total nitrogen content in pit mud, reducing the detection time from 4-6 minutes to 30 seconds and improving the accuracy to 0.9958 (RMSEP=0.0073 g/100g). It effectively reduces the influence of interfering substances such as moisture and improves the robustness and prediction accuracy of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121096471B_ABST
    Figure CN121096471B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of pit mud nitrogen content detection, and specifically discloses a pit mud total nitrogen content detection method based on hyperspectral technology combined with a hybrid algorithm, which comprises the following steps: performing black and white correction on hyperspectral image data of pit mud samples in the near-infrared spectral region; selecting a region of interest (ROI), extracting spectral data of all pixel points in the ROI, and calculating average spectral reflectance data at each wavelength; preprocessing the data, adopting a three-step combined strategy of a successive projection algorithm combined with a genetic algorithm and a competitive adaptive reweighted sampling method, extracting characteristic wavelength data related to pit mud total nitrogen content in the spectral range from the preprocessed data; and predicting the pit mud total nitrogen content based on the characteristic wavelength data and by using a pit mud total nitrogen content prediction model constructed in advance; wherein the pit mud total nitrogen content prediction model is a combination of a hybrid crow optimization algorithm and a support vector regression. The application can realize rapid, non-destructive and accurate detection of total nitrogen content.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of detection of nitrogen content in pit mud, and more particularly relates to a detection method for total nitrogen content in pit mud based on hyperspectral technology combined with a hybrid algorithm. BACKGROUND

[0002] In the solid-state fermentation process, the evaluation of pit mud quality is crucial, including the growth and reproduction of microbial flora, the composition of flavoring substances, and the physicochemical properties of pit mud, etc. Among them, the total nitrogen content is an important indicator for evaluating the quality of pit mud. The fermentation of liquor dregs in the pit depends on the quality of pit mud, and pit mud is rich in various microorganisms and physicochemical components. Among them, nitrogen is an important element in the structure of pit mud microbial community, and is crucial for the growth and reproduction of functional bacteria in pit mud. Therefore, it is necessary to detect the content change in real time and accurately, and to maintain the quality of pit mud in different pits in a timely manner.

[0003] At present, the detection of total nitrogen content in pit mud mainly relies on chemical analysis method, non-destructive detection method and hyperspectral imaging technology. The chemical analysis method is time-consuming, has a lagging nature, and is a destructive detection method, which is not conducive to the timely maintenance of pit mud. The near-infrared spectroscopy technology commonly used in non-destructive detection can only realize single-point detection, and it is difficult to eliminate the influence of local differences of samples on the detection accuracy, resulting in that the evaluation results are not comprehensive and reliable.

[0004] Hyperspectral imaging technology can simultaneously obtain image information and spectral information of samples, overcoming the limitations of single-point detection, and providing a possibility for non-destructive detection of total nitrogen content in pit mud. However, as a kind of semi-solid substance, the spectral information of pit mud is easily disturbed by factors such as water, and the total nitrogen content accounts for a low proportion, so that the extraction and modeling of characteristic spectrum face the challenges of low efficiency and insufficient precision.

[0005] Therefore, how to realize the rapid, non-destructive and accurate detection of total nitrogen content in pit mud is a problem to be solved at present. SUMMARY

[0006] In view of the defects of the prior art, the purpose of the present application is to provide a detection method for total nitrogen content in pit mud based on hyperspectral technology combined with a hybrid algorithm, which can realize rapid, non-destructive and accurate detection of total nitrogen content.

[0007] To achieve the above-mentioned purpose, in a first aspect, the present application provides a detection method for total nitrogen content in pit mud based on hyperspectral technology combined with a hybrid algorithm, comprising the following steps:

[0008] S10, collecting hyperspectral image data of a pit mud sample to be detected in the near-infrared spectral region, and performing black and white correction on the hyperspectral image data;

[0009] S20, selecting a region of interest (ROI) from the corrected hyperspectral image data, extracting spectral data of all pixel points in the ROI, and calculating average spectral reflectance data at each wavelength;

[0010] S30, preprocessing the average spectral reflectance data, and then extracting characteristic wavelengths from the preprocessed spectral reflectance feature data by using a three-step combined strategy of a successive projection algorithm combined with a genetic algorithm and a competitive adaptive reweighted sampling method, to obtain characteristic wavelength data related to the total nitrogen content of the pit mud in the spectral range;

[0011] S40, predicting the total nitrogen content of the pit mud based on the characteristic wavelength data by using a pre-constructed total nitrogen content prediction model of the pit mud; wherein the total nitrogen content prediction model of the pit mud is a combination of a hybrid Crown-Hoare optimization algorithm and a support vector regression.

[0012] The pit mud total nitrogen content detection method based on hyperspectral technology combined with a hybrid algorithm provided in the application has the following effects: image information and spectral information of the sample can be obtained by using hyperspectral imaging technology, which can overcome the limitations of near-infrared single-point detection; noise interference in the imaging system can be effectively eliminated by using black and white correction; a multi-step combined characteristic wavelength extraction strategy can accurately screen out characteristic variables highly related to the total nitrogen content from high-dimensional spectral data, significantly reducing the spectral influence of interfering substances such as water and the model complexity; and the prediction model constructed by combining the hybrid optimization algorithm can adapt to the spectral characteristic differences of the pit mud samples through its double-layer structure and dynamic parameter optimization mechanism, effectively improving the prediction accuracy of low-content components and the model robustness, thereby realizing rapid, non-destructive and accurate detection of the total nitrogen content of the pit mud.

[0013] As a further preferred, in step S10, the step of black and white correction is specifically: shooting a full-white correction image with a standard white board placed in the shooting area; shooting a full-black correction image with a lens cover; correcting the hyperspectral image by full-white and full-black correction, and calculating using a specific formula, wherein the specific formula is:

[0014]

[0015] In the formula, R is the corrected reflectance image data; I is the original hyperspectral image data; W is the standard white board image data; D is the standard black board image data.

[0016] As a further preferred, in step S30, the preprocessing includes at least one of the following three methods: standard normal variable transformation, multivariate scatter correction and convolution smoothing.

[0017] As a further preferred, in step S30, the step of extracting characteristic wavelengths is performed using a three-step combined strategy, specifically:

[0018] S31, using a continuous projection algorithm to pre-process the full wavelength of the spectral reflectance characteristic data, and obtaining a first set of characteristic wavelength data; wherein the continuous projection algorithm selects different characteristic wavelength numbers according to the trend graph of RMSE, and when the RMSE value reaches the minimum value, the selected wavelength combination is the characteristic wavelength;

[0019] S32, using genetic algorithm to extract the first set of characteristic wavelength data twice, setting the related control parameters of genetic algorithm, including initial population, crossover probability, mutation probability and iteration number, after iteration termination, the wavelength variables are added to the partial least squares regression model in order of frequency, and the best wavelength variable combination is determined by the RMSE value, to obtain the twice extracted characteristic wavelength data;

[0020] S33, using a competitive adaptive reweighted method to further screen the twice extracted characteristic wavelength data, calculating the weight of each wavelength point according to the absolute value of the regression coefficient, using the reweighted sampling method to determine the wavelength to be iterated, and retaining the wavelength with high weight, to finally obtain the optimal characteristic wavelength combination.

[0021] As a further preferred, in step S40, the combination of the hybrid Crown-Hoare porcupine optimization algorithm CCPO and the support vector regression SVR is specifically:

[0022] A CCPO-SVR hybrid optimization model with a double-layer structure is constructed, wherein the inner layer performs regression prediction based on support vector regression SVR, and the outer layer is based on the hybrid Crown-Hoare porcupine optimization algorithm CCPO, which automatically searches for the optimal combination of SVR superparameters by minimizing the prediction error of SVR; the superparameters include penalty coefficient c, kernel parameter g and insensitive loss parameter ε.

[0023] As a further preferred, in step S40, the prediction performance correction determination coefficient , correction root mean square error RMSEC, prediction determination coefficient and prediction root mean square error RMSEP of the pit mud total nitrogen content prediction model are comprehensively evaluated.

[0024] As a further preferred, , RMSEC, and RMSEP parameter calculation formula is as follows:

[0025]

[0026]

[0027]

[0028]

[0029] wherein Y i ∧ and Y i are the predicted and true values of total nitrogen content in the ith pit mud sample, respectively, Y C and Y P are the average contents of total nitrogen of pit mud samples in the calibration set and the prediction set, respectively, n C and n P are the numbers of samples in the calibration set and the prediction set, respectively.

[0030] As further preferred, it further comprises:

[0031] S50, generating a pseudo-color image of total nitrogen content distribution of the to-be-tested pit mud sample by using a visualization method, the pseudo-color image being represented by a linear color scale, and different color scales being matched with different total nitrogen contents of pit mud.

[0032] As further preferred, in step S50, the step of generating the pseudo-color image of total nitrogen content distribution specifically comprises:

[0033] dividing the ROI region by using a morphological method in image processing technology, and extracting spectral reflectance data of each pixel point in the ROI region;

[0034] inputting the spectral reflectance data of each pixel point into the pit mud total nitrogen content prediction model to calculate total nitrogen content values of each pixel point;

[0035] mapping the total nitrogen content values of each pixel point to a gray scale interval of 0-255 to generate a gray scale image;

[0036] performing pseudo-color processing on the gray scale image to obtain a visualization image of pit mud total nitrogen content; wherein different colors represent different total nitrogen content values, a dark red region represents a higher total nitrogen content value, and a dark blue region represents a lower total nitrogen content value.

[0037] In a second aspect, the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the pit mud total nitrogen content detection method based on hyperspectral technology combined with a hybrid algorithm according to any one of the above aspects.

[0038] It can be understood that the beneficial effects of the above-mentioned second aspect can be referred to the related description in the above-mentioned first aspect, which will not be repeated here. BRIEF DESCRIPTION OF DRAWINGS

[0039] Figure 1is a flow chart of the pit mud total nitrogen content detection method provided by the present application combining hyperspectral technology and a hybrid algorithm;

[0040] Figure 2 is a flow chart of the pit mud total nitrogen content rapid non-destructive detection method provided by the present application combining hyperspectral technology (HSI) and a hybrid algorithm;

[0041] Figure 3 is a first step spectral data curve provided by the present application;

[0042] Figure 4 is near-infrared region pretreated spectral data full wavelength PLSR model performance provided by the present application;

[0043] Figure 5 is a combination feature extraction process diagram of the SPA-GA-CARS multi-step combined strategy algorithm of the fifth step provided by the present application;

[0044] Figure 6 is a fitting result of the SPA-GA-CARS+CCPO-SVR model training set and test set of the seventh step provided by the present application;

[0045] Figure 7 is a visualization distribution diagram of different pit mud total nitrogen contents provided by the present application; wherein (a) is a pit cap mud of No. 1 pit, (b) is a pit mud of a yellow water line of No. 1 pit, (c) is a pit bottom mud of No. 1 pit, (d) is a pit cap mud of No. 2 pit, (e) is a pit mud of a yellow water line of No. 2 pit, and (f) is a pit bottom mud of No. 2 pit. DETAILED DESCRIPTION

[0046] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below in combination with the drawings and examples. It should be understood that the specific examples described herein are only used to explain the present application and do not limit the present application.

[0047] As shown in Figure 1 , the present application provides a pit mud total nitrogen content detection method based on hyperspectral technology combining a hybrid algorithm, including steps S10 to S40, which are described in detail as follows:

[0048] Step S10, collect hyperspectral image data of the pit mud sample to be measured in the near-infrared light (900-1700nm) spectral region, and perform black and white correction on the hyperspectral image data.

[0049] In step S10, the black and white correction can be specifically performed by shooting a standard white board image and a standard black board image, and calculating by using the formula to eliminate the influence of camera noise and uneven light source intensity distribution.

[0050] Step S20, selecting a region of interest (ROI) from the corrected hyperspectral image data, extracting the spectral data of all pixel points in the ROI, and calculating the average spectral reflectance data at each wavelength.

[0051] Step S30, preprocessing the average spectral reflectance data, and then using a three-step combined strategy of the successive projections algorithm combined with the genetic algorithm and the competitive adaptive reweighted sampling method to extract the characteristic wavelengths from the preprocessed spectral reflectance feature data, to obtain characteristic wavelength data related to the total nitrogen content of the pit mud in the spectral range.

[0052] In step S30, the preprocessing can use at least one of the standard normal variable transformation, the multivariate scatter correction and the convolution smoothing, wherein the standard normal variable transformation is significantly effective in eliminating spectral errors caused by uneven sample surface and uneven illumination.

[0053] The characteristic wavelength extraction can include: using the successive projections algorithm to preliminarily select all wavelengths to eliminate collinear wavelengths; then using the genetic algorithm for secondary extraction to optimize the combination of characteristic wavelengths through its global search capability; finally applying the competitive adaptive reweighted sampling method for three times of screening to retain key wavelengths according to the absolute value weight of the regression coefficient, thereby significantly reducing the data dimension and improving the feature representation.

[0054] Specifically, first, the successive projections algorithm is used to preliminarily select all wavelengths of the preprocessed spectral reflectance feature data, to obtain a first set of characteristic wavelength data; wherein, the successive projections algorithm selects different characteristic wavelength numbers according to the change trend graph of RMSE, and when the RMSE value reaches the minimum value, the selected wavelength combination is the characteristic wavelength; then, the genetic algorithm is used to extract the first set of characteristic wavelength data, and the related control parameters of the genetic algorithm are set, including the initial population, the crossover probability, the mutation probability and the iteration number, after the iteration is terminated, the wavelength variables are added to the partial least squares regression model one by one in the order of high and low frequency, the best wavelength variable combination is determined by the RMSE value, to obtain the characteristic wavelength data extracted twice; finally, the competitive adaptive reweighted sampling method is used to further screen the characteristic wavelength data extracted twice, the weight of each wavelength point is calculated according to the absolute value of the regression coefficient, the reweighted sampling method is used to determine the wavelength to be iterated, the wavelength with high weight is retained, and finally the optimal characteristic wavelength combination is obtained.

[0055] Step S40, based on the characteristic wavelength data, using the pre-constructed total nitrogen content prediction model of pit mud to predict the total nitrogen content of pit mud; wherein, the total nitrogen content prediction model of pit mud is a combination of the hybrid crow optimizers algorithm and the support vector regression.

[0056] In step S40, the prediction model is specifically constructed as a hybrid optimization model with a double-layer structure, the inner layer of which performs regression prediction by support vector regression, and the outer layer of which dynamically and adaptively optimizes the hyperparameters of support vector regression, including the penalty coefficient c, the kernel parameter g and the insensitive loss parameter epsilon, by minimizing the prediction error through the hybrid crow search optimization algorithm, so as to automatically obtain the optimal parameter combination.

[0057] The detection method for total nitrogen content of pit mud based on hyperspectral technology combined with a hybrid algorithm provided in the application has the following effects: image information and spectral information of the sample are obtained through hyperspectral imaging technology, which can overcome the limitations of near-infrared single-point detection; the noise interference in the imaging system can be effectively eliminated by black and white correction; the characteristic wavelength extraction strategy of multi-step combination can accurately select the characteristic variables highly related to the total nitrogen content from high-dimensional spectral data, significantly reduce the spectral influence of interfering substances such as water and the model complexity; the prediction model constructed by combining the hybrid optimization algorithm can adapt to the spectral characteristic differences of pit mud samples through its double-layer structure and dynamic parameter optimization mechanism, effectively improve the prediction accuracy and model robustness for low-content components, and thus realize the rapid, non-destructive and accurate detection of the total nitrogen content of pit mud.

[0058] In one embodiment, the technical solution described above can be specifically implemented as follows: in order to solve the problems of difficulty in detecting low-content components in semi-solid substances and interference of water spectral information, the present embodiment provides a rapid and non-destructive detection method for total nitrogen content of pit mud based on hyperspectral technology (HSI) combined with a hybrid algorithm. The method realizes rapid, non-destructive and accurate detection of total nitrogen content by in-depth research on spectral extraction and modeling methods for total nitrogen content of pit mud.

[0059] The technical scheme adopted by the embodiment is: collecting hyperspectral image data of cellar mud samples in the near-infrared (900-1700 nm) spectral region, selecting an ROI region for each cellar mud sample and extracting spectral data; using SNV, MSC and SG three pretreatment methods to process the spectral data, and determining the best pretreatment method by analyzing the model performance; in order to reduce the model calculation complexity and the influence of spectral information such as moisture of semi-solid samples, a multi-step combined strategy algorithm of Successive Projections Algorithm (SPA)-Genetic Algorithm (GA)-Competitive Adaptive Reweighted Sampling (CARS) is used to accurately extract the characteristic wavelength of total nitrogen of cellar mud samples; in order to solve the problem that the detection accuracy of low content needs to be improved, the embodiment establishes a mixed Chaotic Crested Porcupine Optimizer-CCPO-Support Vector Regression (SVR) optimization model based on the extracted spectral data of the characteristic wavelength to predict the total nitrogen content of cellar mud, and visualizes cellar mud with different total nitrogen contents, realizing accurate detection and visualization of the total nitrogen content of cellar mud.

[0060] The embodiment innovatively proposes the SPA-GA-CARS multi-step linkage feature extraction technology and the mixed optimization algorithm CCPO-SVR, realizes the rapid and accurate detection of the total nitrogen content of cellar mud based on the hyperspectral imaging technology (HSI). By combining the successive projection algorithm (SPA) with the genetic algorithm (GA) to select the characteristic wavelength, and by using the adaptive reweighting method (CARS) sampling technology, the wavelength points with the largest contribution to the model are further selected. Based on the extracted characteristic wavelength, the mixed Chaotic Crested Porcupine Optimization Algorithm (CCPO) is used to further optimize the Support Vector Machine Regression Algorithm (SVR) to establish a detection model of the total nitrogen content.

[0061] The results show that GA significantly improves the SPA, and further uses CARS to improve the spectral feature extraction effect, which can reduce the number of wavelengths while improving the model accuracy. In addition, CCPO is used to optimize SVR to obtain the best parameter combination, which reduces the instability of manual parameter searching and improves the model performance and accuracy. HSI combined with multi-step linkage feature extraction and mixed optimization modeling algorithm can realize the rapid and non-destructive detection of the total nitrogen content of cellar mud, and provides a new method for the rapid detection of the total nitrogen content of cellar mud.

[0062] Specifically, as shown in Figure 2 The hyperspectral technology combined with the mixed algorithm for rapid and non-destructive detection of the total nitrogen content of cellar mud provided by the embodiment includes the following steps:

[0063] (1) Collect 120 hyperspectral image data of cellar mud samples in the near-infrared (900-1700 nm) spectral region, select the ROI region for each cellar mud sample and extract the spectral data, and then perform black and white correction on the original hyperspectral image data to eliminate the noise caused by the dark current in the camera and the uneven distribution of light source intensity at each wavelength;

[0064] (2) After the hyperspectral image of the cellar mud sample is collected, the total nitrogen content of the cellar mud sample is determined synchronously according to GB / T609-2018 "General method for determination of total nitrogen content of chemical reagents";

[0065] (3) After the hyperspectral image of the cellar mud sample is corrected, in order to reduce the influence of uneven distribution of chemical information in the cellar mud sample on modeling, the ROI is manually selected in the center of the sample. The ROI region in the sample image is separated from the background, the spectral data of all pixel points in the ROI is extracted, and the average value at each wavelength is taken as the spectral reflectivity data of each sample;

[0066] (4) For the hyperspectral data of step (3), SNV, MSC and SG three kinds of pretreatment methods are used to process the spectral data respectively, and the best pretreatment method is determined by analyzing the model performance;

[0067] (5) In view of the problems of high dimension, collinearity and redundancy of hyperspectral image, the embodiment proposes a three-step combined strategy based on continuous projection method combined with genetic algorithm and competitive adaptive reweighted method to extract the characteristic wavelengths related to total nitrogen in cellar mud in the spectral range, which overcomes the problems of low operation efficiency and low precision caused by large feature quantity and redundancy of hyperspectral data.

[0068] The SPA-GA-CARS multi-step combination strategy feature wavelength extraction method is based on the feature wavelength extracted by the successive projection algorithm (SPA), and then uses the genetic algorithm (GA) for secondary extraction and the competitive adaptive reweighted sampling (CARS) algorithm for tertiary extraction. The global search capability of the GA optimizes the initial conditions of the SPA, and the GA-SPA linkage treats the selection of the initial wavelength as an optimization problem and solves it by the GA. This overcomes the shortcomings of the SPA, such as sensitivity to the initial wavelength and easy falling into local optimum. The GA can search for the optimal initial point in a large range, realizes the automation optimization of the feature wavelength extraction process and the global optimization of the feature wavelength, and can quickly obtain a feature wavelength combination with higher prediction accuracy than the standard SPA. On this basis, the CARS is used for further accurate extraction of relevant features, which can effectively filter out a small number of key variables from high-dimensional data, extract wavelengths related to the total nitrogen chemical group absorption of pit mud, further reduce the model complexity, remove irrelevant and noise variables, improve the prediction ability and robustness of the model, and improve the model accuracy. By reducing the number of variables, the risk of overfitting is reduced. The feature wavelength extracted by the SPA-GA-CARS algorithm establishes a pit mud total nitrogen content detection model with higher efficiency and obvious improvement in accuracy.

[0069] (6) In this embodiment, the hybrid crown hyrax optimization and improvement algorithm (CCPO) is combined with the support vector regression (SVR) model to construct a hybrid optimization prediction model. The SVR is responsible for performing the core regression prediction task, and the improved CCPO algorithm is responsible for optimizing the key hyperparameters (penalty coefficient c, kernel parameter g and insensitive loss parameter ε) in the SVR model. The improved hybrid model adopts a dynamic adaptive hybrid strategy, which not only overcomes the shortcomings of the traditional grid search method, such as time-consuming and easy to fall into local optimum, but also has the ability to adapt to the differences in spectral characteristics of pit mud samples. Based on the feature wavelength of spectral data, the CCPO-SVR model for predicting the total nitrogen content of pit mud is established. The combination of CCPO and SVR uses the powerful global optimization capability of CCPO to automatically and efficiently explore the parameter space to automatically find the best combination and optimization of the most critical hyperparameters in the SVR model, and obtains the optimal result, thereby improving the prediction performance of the model.

[0070] (7) The performance of the model is evaluated by the determination coefficients of calibration ), the root mean square error aof calibration (RMSEC), the determination coefficients of prediction ), root mean square error of prediction (RMSEP) were used to evaluate the CCPO-SVR model. , RMSEC, and RMSEP parameters calculation formula as follows:

[0071]

[0072]

[0073]

[0074]

[0075] In the formula, Y i ∧ and Y i are the predicted value and true value of total nitrogen content in the i th pit mud sample, Y C and Y P are the average content of total nitrogen in the calibration set and the prediction set, n C and n P are the number of samples in the calibration set and the prediction set.

[0076] (8) The optimal prediction model is used to visualize the pit mud with different total nitrogen contents. Visualizing the total nitrogen content in the ROI of the pit mud sample helps researchers intuitively understand the distribution of the total nitrogen content of the pit mud in different layers of the pit, facilitating timely adjustment of the solid-state fermentation process of the liquor. Using the visualization method, a pseudo-color map of the total nitrogen content distribution of the pit mud can be obtained. The pseudo-color image is represented by a linear color scale, and different color scales match different total nitrogen contents of the pit mud. This matching relationship can be used to analyze the changes in the total nitrogen content of the pit mud.

[0077] In this embodiment, in step (1), the near-infrared spectral range is 900-1700 nm.

[0078] In this embodiment, in step (1), first, a full-white calibration image with a whiteboard in the shooting area is taken, with a reflectivity close to 100%, which can calibrate the influence of camera noise; then, a full-black calibration image with a lens cover is taken, with a reflectivity of about 0. By performing full-white and full-black correction on the hyperspectral image and using a specific formula to calculate, the camera noise and light source non-uniformity can be effectively eliminated, thereby obtaining a relatively stable spectral reflectivity. Black and white correction can be calculated by the following formula:

[0079]

[0080] Wherein: R is the corrected reflectance image of the pit mud sample; I is the original hyperspectral image of the pit mud sample; W is the standard white plate image; D is the standard black plate image.

[0081] In this embodiment, in step (2), the total nitrogen content of each pit mud sample is determined by using the GB / T609-2018 national standard method for determination of total nitrogen content of chemical reagents general method, and the total nitrogen content of the pit mud sample is calculated according to the following formula:

[0082]

[0083] In the formula: X is the total nitrogen content of the pit mud sample (g / 100g); The volume of the standard solution of the consumed acid in the pit mud sample (mL); The volume of the reagent blank acid standard solution (mL); N is the equivalent concentration of the hydrochloric acid or sulfuric acid standard solution (mol / L); 0.014, 1.0 mL is the mass of nitrogen consumed by the sulfuric acid or hydrochloric acid standard titration solution (g); m is the mass of the pit mud sample (g)

[0084] In this embodiment, in step (5), the SPA-GA-CARS multi-step linkage strategy algorithm extracts the distribution characteristics. First, the SPA algorithm is used for preliminary selection of full wavelength to remove redundant information wavelength, and then the GA algorithm is used for secondary extraction of the preliminary selected characteristic wavelength. The global search ability of GA is used to optimize the initial vector and iteration process of SPA, and SPA is embedded into the fitness function of GA, so that a more optimal characteristic wavelength combination is found. According to the change trend of RMSE when the SPA algorithm selects different characteristic wavelength numbers, the change curve of RMSE first presents a trend from large to small to minimum and then gradually increases. The minimum value of RMSE (RMSE = 0.0137) indicates that the model accuracy is the highest at this time, and the number of wavelengths at this time is the characteristic wavelength that needs to be extracted. Compared with full wavelength, the number of wavelengths is reduced by about 40% after using the SPA algorithm to extract the characteristic wavelength.

[0085] Before using the GA algorithm for secondary characteristic wavelength extraction, the related control parameters of the GA algorithm are set: initial population 30, crossover probability 0.8, mutation probability 0.01, iteration number 200, and after iteration termination, the wavelength variables are added to the partial least squares regression model (PLS model) one by one in the order of frequency, and the best wavelength variable combination is determined by the RMSE value. Because the selection of the initial population of the algorithm has randomness, it will affect the result, so it is necessary to perform GA-PLS operation multiple times. In this embodiment, the operation is repeated 5 times, and the wavelength combination selected by the best model among them is selected as the best characteristic wavelength.

[0086] Further feature wavelengths were extracted using CARS algorithm. The weight of each wavelength was calculated according to the absolute value of the regression coefficient. According to the calculated weight, the method of "re-weighted sampling" was used to determine the wavelength to be iterated, and the wavelength with high weight was retained. A PLS model was established for the new wavelength subset obtained after each sampling run, and the root mean square error (RMSE) of the model was calculated using the part of the samples that were not sampled (such as 20%) or through cross-validation. Multiple GA-PLS-CARS operations were required, and the wavelength subset corresponding to the smallest RMSE value was selected as the optimal feature wavelength combination. Compared with full wavelength, the number of wavelengths was reduced by about 87%.

[0087] In step (6) of the present embodiment, the hybrid strategy mechanism of the CPO algorithm is innovatively improved, and the original fixed parameter hybrid strategy is improved into a dynamic adaptive hybrid strategy. A CCPO-SVR hybrid optimization model with a double-layer structure is constructed for the special needs of pit mud total nitrogen content prediction: the improved CCPO algorithm is used for dynamic parameter selection in the upper layer, and high-precision regression prediction is realized through SVR in the lower layer, so as to obtain more accurate prediction results. Specifically: the inner layer (core prediction model) is based on SVR with structure risk minimization, and its performance is controlled by (c, g and ); the outer layer (parameter optimizer) is based on the improved CCPO algorithm, and the optimal combination of (c, g and ) is automatically and dynamically searched by minimizing the prediction error (such as MSE) of SVR.

[0088] For the total nitrogen content of pit mud, the best model is the CCPO-SVR model established by using the SPA-GA-CARS combined strategy method to extract the characteristic spectrum ( =0.9958, RMSEP=0.0073 g / 100 g). The interaction of the crown guinea pigs in the CCPO optimization algorithm and the exploration of the exploration space make it have strong global search ability, which shows that the CCPO-SVR model has better performance. Compared with the traditional optimization algorithm, CCPO can better explore the search space and find better SVR model parameters to improve the model precision. At the same time, the improved dynamic adaptive hybrid strategy can adapt to the spectral feature differences of pit mud samples, significantly improving the generalization ability and robustness of SVR in processing hyperspectral data.

[0089] In this embodiment, in step (8), the optimal model SNV+SPA-GA-CARS+CCPO-SVR determined above accurately predicts the total nitrogen content of the pit mud, and the visualization of the total nitrogen content of the pit mud can help the analyst to intuitively judge the change of the total nitrogen content. The specific steps are as follows: first, the ROI region is divided by using the morphological method in the image processing technology, and the spectral reflectance data of each pixel point in the sample ROI region is extracted; then the spectral reflectance data of the pixel points are taken as the input of the optimal model, the total nitrogen content values of each pixel point are calculated, the values are mapped to the gray interval of 0~255 to obtain a gray image; finally, the pseudo-color processing is performed on the gray image to obtain the visualization image of the total nitrogen content of the pit mud. Different colors represent different total nitrogen content values, and dark red area represents higher total nitrogen content value, and dark blue area represents lower total nitrogen content value.

[0090] It can be known from the visualization image of the total nitrogen content of the pit mud that the total nitrogen content distribution of the pit mud cap, yellow water line and pit mud bottom of the same pit has no obvious rule, and the total nitrogen content of the pit mud of different pits shows a downward trend as the pit age increases, which may be due to the long-term succession of microbial community as the pit time accumulates, resulting in a large amount of nutrients accumulated in the pit, thereby affecting the total nitrogen content of the pit mud, and the timely maintenance of the pit is realized through regular rapid detection.

[0091] The technical key points of this embodiment are:

[0092] (1) The embodiment provides a pit mud total nitrogen content rapid nondestructive detection method combining hyperspectral technology and mixed algorithm, and realizes accurate prediction of the total nitrogen content of the pit mud. By comparing PLSR models established by different pretreatment methods, it is found that the SNV has the best promotion effect (R2=0.8818, RMSEP=0.0386 g / 100 g), and the suitable pretreatment algorithm is selected for the total nitrogen content.

[0093] (2) In this embodiment, the SPA-GA-CARS multi-step linkage feature extraction method combining SPA, GA and CARS is proposed when selecting the characteristic wavelength, which can effectively reduce the complexity of the model, solve the problems such as interference of water and other substances in the semi-solid state spectrum, and obviously improve the promotion effect of the model, thereby effectively improving the prediction accuracy of the total nitrogen content of the pit mud.

[0094] (3) In this embodiment, the CCPO-SVR mixed optimization algorithm is used to establish the prediction model of the total nitrogen content based on the extracted characteristic wavelength, which solves the problem of difficult extraction of low content spectrum and can effectively improve the performance of the model in prediction. The optimal model SPA-GA-CARS+CCPO-SVR is obtained (R2=0.9958, RMSEP=0.0073 g / 100 g). ​​

[0095] (4) This embodiment uses the optimal model to visualize the total nitrogen content of the pit mud sample ROI region, and intuitively reflects the change of the total nitrogen content of the pit mud at different pit layer positions.

[0096] The overall research results show that the hyperspectral technology combined with the optimization algorithm can effectively detect the total nitrogen content in the pit mud, and the new method provides a new means for real-time monitoring in the solid-state fermentation process of liquor, and has important application value in the field of solid-state fermentation of liquor.

[0097] The beneficial effects of this embodiment are: this embodiment realizes the rapid nondestructive detection of the total nitrogen content of pit mud by combining hyperspectral imaging technology with the innovative SPA-GA-CARS multi-step linkage feature extraction algorithm and the CCPO-SVR hybrid optimization modeling method, the detection time is shortened from 4-6min of the traditional method to within 30s, the precision is improved to =0.9958 (RMSEP=0.0073g / 100g), the number of characteristic wavelengths is reduced by 86.2% to 31 key bands. At the same time, the total nitrogen content in the ROI of the pit mud sample is visualized, which helps researchers to intuitively understand the distribution of the total nitrogen content of the pit mud at different layers of the pit, and facilitates timely adjustment of the solid-state fermentation process of liquor. This method has broken through the problems of water interference and difficulty in low-content feature extraction in the detection of semi-solid substances, and provides reliable technical support for real-time quality monitoring in the liquor brewing process.

[0098] The following is a specific implementation case of the present application:

[0099] The specific steps of the pit mud total nitrogen content rapid nondestructive detection method based on hyperspectral imaging technology combined with a hybrid algorithm provided by the present embodiment are as follows:

[0100] Step 1, pit mud sample preparation

[0101] The pit mud samples used in this embodiment are from a liquor factory in Yibin, Sichuan, China. After the fermentation of the liquor is completed, the distiller's grains in the pit are removed, and pit mud samples are collected at the top, middle and bottom positions of different pits. Samples are taken from 40 pits, and 1 sample is collected from each pit layer, a total of 120 pit mud samples (3x1x40=120).

[0102] Step 2, hyperspectral image acquisition, correction and extraction of pit mud samples

[0103] 1) Equipment Configuration: The hyperspectral imaging system consists of a hyperspectral camera (Finnish FX17 series), a halogen lamp (OSRAM, German), an electronically controlled moving platform, data acquisition software (LUMO-scanner), a computer, and a calibration whiteboard. The hyperspectral camera uses a near-infrared camera (NIR: 900 - 1700 nm), with a band spacing of 3.5 nm, dividing the spectrum into 224 bands.

[0104] 2) Equipment parameter settings: When using the NIR camera, adjust the white board calibration peak value to 3616, set the exposure frequency and exposure time to 50Hz and 4.02ms respectively, and set the moving platform scanning speed to 16.57mm / s. After setting the acquisition parameters, spread the pit mud sample evenly in a 150mm diameter petri dish, and then place it on the electrically controlled moving platform for data acquisition;

[0105] 3) Black and White Correction: The original hyperspectral image data is corrected using hyperspectral image data from both a black correction plate and a white correction plate to obtain the spectral reflectance of the sample. During acquisition, the dark current of the camera and the uneven illumination intensity of the halogen lamp source can affect the hyperspectral image data. Therefore, to eliminate the interference from these factors, it is necessary to perform black and white correction on the acquired hyperspectral image data. The correction formula is as follows:

[0106]

[0107] Where: R is the corrected reflectance image of the pit mud sample; I is the original hyperspectral image of the pit mud sample; W is the standard whiteboard image; and D is the standard blackboard image.

[0108] 4) After hyperspectral image correction of the pit mud samples, to reduce the impact of uneven chemical information distribution on modeling, a Region of Interest (ROI) was manually selected at the center of the sample. The ROI was separated from the background in the RGB image of the sample, and the spectral data of all pixels within the ROI were extracted. The average value at each wavelength was taken as the spectral reflectance data of each sample. Spectral reflectance data for 120 pit mud samples were obtained in different spectral regions.

[0109] 5) From Figure 3 It can be seen that the spectral reflectance curves in the near-infrared region reflect the vibrations of molecular bonds in different compounds. The spectral reflectance curves of the pit mud in the near-infrared region have three obvious absorption peaks. The absorption peak near 1180 nm is the second overtone absorption band of the stretching vibration of the CH bond in saturated alkanes, and also the combination absorption band of the OH bond; the absorption peak near 1370 nm may be related to the vibration of the NH bond in the molecular structure of the pit mud; and the absorption peak near 1680 nm may be related to the first and second overtones of the CH bond.

[0110] Thirdly, after the hyperspectral image acquisition of the pit mud sample was completed, the total nitrogen content of each pit mud sample was determined synchronously using GB / T609-2018 “General method for determination of total nitrogen content of chemical reagents”. The total nitrogen content statistical results of the pit mud samples are shown in Table 1. In order to improve the prediction accuracy and generalization performance of the model, the Kennard-Stone (KS) algorithm was used to divide the 120 pit mud samples into a calibration set at a ratio of 4:1. As can be seen from Table 1, the mean and standard deviation values of the two are not much different, indicating that the division using the KS algorithm is reasonable and is conducive to the establishment of the subsequent total nitrogen content prediction model.

[0111] Table 1 Statistical results of total nitrogen determination in pit mud samples

[0112]

[0113] Fourthly, spectral data preprocessing

[0114] In this embodiment, three methods of standard normal variate transformation (SNV), multivariate scatter correction (MSC) and convolution smoothing (SG) were used to preprocess the spectral data of the pit mud samples. The PLSR model was established using the original and preprocessed spectral data to predict the total nitrogen content of the pit mud. The performance of the model in predicting the total nitrogen content is shown in Table 2. Figure 4 Compared with the PLSR model established using the original spectrum (Raw), the accuracy of the PLSR model established using the preprocessed spectral data was improved, indicating that the preprocessing method can effectively eliminate or reduce the noise in the spectral data. Among them, the PLSR model established using the SNV preprocessed spectral data has the highest prediction accuracy of total nitrogen content (R2=0.9082, RMSEC=0.0348g / 100g, RMSEP=0.0386g / 100g), which may be due to the uneven distribution of light on the surface of the pit mud sample during the acquisition process, resulting in a large amount of noise, and the SNV method is better at eliminating sample scattering or sample spectral errors caused by optical path. According to the above analysis results, the SNV preprocessed spectral data was selected for subsequent research. =0.9082, RMSEC=0.0348g / 100g,

[0115] Fifthly, feature extraction

[0116] ​The SPA-GA-CARS multi-step linkage algorithm is used to extract the characteristic wavelengths. The SPA-GA-CARS algorithm is based on the characteristic wavelengths extracted by the SPA algorithm, and uses the GA and CARS algorithms for the second and third extraction. The root mean square error (RMSE) is used to evaluate the characteristic wavelength combination, and the best wavelength combination is determined by the smallest RMSE value. A multiple regression model is established for the characteristic wavelength combination, which improves the model accuracy and uses the characteristic wavelengths extracted by the SPA-GA-CARS algorithm to establish a simpler pit mud total nitrogen content detection model. The characteristic extraction results are shown in Figure 5 .

[0117] 1) The continuous projection algorithm (SPA) is based on the recombination of the original wavelengths. The characteristic wavelengths extracted by the SPA algorithm eliminate the collinear wavelengths, and a set of characteristic wavelength combinations arranged in the order of the maximum projection value is obtained through continuous iteration:

[0118] The initial wavelength index k(0) is obtained by decoding;

[0119] Starting from k(0), the standard SPA algorithm is run for N iterations (N is the preset number of characteristic wavelengths), and a set of characteristic wavelength indexes K = {k(0), k(1),..., k(N-1)} is finally obtained;

[0120] The spectral data X K and the corresponding measured values y under the set of wavelengths K are used to establish a prediction model;

[0121] The root mean square error of cross-validation (RMSECV) and the prediction correlation coefficient R 2 are used to calculate the prediction performance of the model. The quantitative value of the model performance is the minimum error (RMSECV) or the maximum R 2 , and the mathematical expression is Fitness(c) = -RMSECV(Model(X K(c) , y)).

[0122] 2) On the basis of the characteristic wavelengths extracted by the SPA algorithm, the genetic algorithm GA is used to further screen a smaller number of wavelengths to improve the modeling accuracy and efficiency. The GA algorithm uses genetic mechanisms and natural selection to retain variables with better target function values and eliminate variables with poor performance through selection, crossover, and mutation operators, so as to achieve the optimal result. A number of different numbers of characteristic wavelengths are selected for combination, and the characteristic wavelength combination with the highest prediction response accuracy contribution rate is selected as the best characteristic wavelength combination, and a set of characteristic wavelengths with better prediction performance is finally obtained: K final =SPA ( ).

[0123] 3) CARS forms a spectral data matrix from the characteristic spectra extracted from SPA-GA. (n samples, p wavelength variables), adaptive reweighting assigns weights based on the absolute value of the regression coefficient of each variable, and performs k=1, 2, ..., N sampling runs, retaining the number of variables in each run. Variables are forced to be selected by the power decay function (EDF): Adaptive reweighted sampling (ARS) is based on the weights of each variable. : Characteristic spectral extraction based on SPA-GA extraction is achieved through exponential decay and importance-dependent selection.

[0124] Step 6: CCPO-SVR model prediction

[0125] 1) The goal of SVR is to find a regression function. f(x) This ensures that the maximum deviation of all training sample points from this function does not exceed ε, while also guaranteeing that the function is as "flat" as possible (i.e., with the lowest complexity). Given a training dataset {(x1, y1),(x2, y2), ..., (x... i , y i )}, where: x i R n , y i R;

[0126] 2) The task of the improved CCPO is to find an optimal set of hyperparameters for SVR within a specified parameter space. = (c, g, ε) This minimizes the prediction error (corrected root mean square error RMSEC) and prediction root mean square error (RMSEP) of the SVR model.

[0127] 3) Mathematical process of the CCPO-SVR model:

[0128] Initialization: Set the parameters for CCPO: number of hogs, number of iterations, speed range, c 1 、c 2 、w Wait. Set the search range for SVR parameters: c [c min , c max ], g [g min , g max ], ε [εmin ,ε max [The positions of all crowned porcupine numbers are initialized using a mapped chaotic sequence]. x i = (c i , g i ,ε i ).

[0129] Iterative optimization: A dynamic hybrid strategy is adopted to coordinate global exploration and local development behaviors, using the parameter combination (c) corresponding to the current position of the crowned porcupine population. i , g i ,ε i Construct an SVR model. Train the SVR model using K-fold cross-validation on the training set, and calculate its performance metrics (MSE, etc.) as its fitness value to update the speed and position of the crested porcupine, as well as the individual optimal and global optimal. Generate new solutions through dynamic chaotic perturbation and evaluate their quality, outputting the global optimal solution. = ( , , ).

[0130] Final prediction: using optimal hyperparameters Retrain a final SVR model on the entire training set and test it on new test samples. x new Make a prediction: .

[0131] 4) The interaction between individual porcupines and the exploration of the search space in the CCPO optimization algorithm give it strong global search capabilities. Compared with traditional optimization algorithms, CCPO can better explore the search space, thereby obtaining a better SVR hyperparameter configuration and improving model accuracy;

[0132] 5) CCPO adaptively and dynamically adjusts parameters based on problem characteristics. It can adjust parameters according to problem features and search stages, and further improve algorithm efficiency and robustness by relying on population size and number of iterations. This example is based on the CCPO-SVR model with characteristic wavelengths, and its fitting effects on the calibration and prediction sets are as follows: Figure 6 As shown. The optimal model for the total nitrogen content of the pit mud is the CPO-SVR model established by extracting characteristic spectra using the SPA-GA-CARS method. =0.9958, RMSEP=0.0073g / 100 g), indicating that the CCPO-SVR model has better performance. The optimal model is SNV+SPA-GA-CARS+CPO-SVR, as shown in Table 2.

[0133] Table 2. Modeling results of CCPO-SVR models with different wavelength selection methods

[0134]

[0135] Seventh step, visualization of pit mud samples

[0136] In this example, two pit mud samples from different layers of 40 pits were selected as visualization objects. The specific steps are as follows:

[0137] 1) The ROI region was divided by using the morphological method in image processing technology, and the spectral reflectance data of each pixel point in the sample ROI region was extracted;

[0138] 2) The spectral reflectance data of the pixel points were taken as the input of the optimal model, the total nitrogen content value of each pixel point was calculated, the value was mapped to the gray interval of 0 ~ 255, and the gray image was obtained;

[0139] 3) The pseudo-color processing was performed on the gray image to obtain the visualization image of the total nitrogen content of the pit mud. The visualization of the pit mud samples from different layers of different pits is shown in Figure 7 , wherein different colors represent different total nitrogen content values, the dark red area represents a higher total nitrogen content value, and the dark blue area represents a lower total nitrogen content value.

[0140] Those skilled in the art will readily understand that the above description is only a preferred embodiment of the present application, and is not intended to limit the present application. Any modification, equivalent replacement and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for detecting total nitrogen content in pit mud based on hyperspectral technology combined with a hybrid algorithm, characterized in that, Includes the following steps: S10, Collect hyperspectral image data of the pit mud sample to be tested in the near-infrared spectral region, and perform black and white correction on the hyperspectral image data; S20: Select the region of interest (ROI) from the corrected hyperspectral image data, extract the spectral data of all pixels within the ROI, and calculate the average spectral reflectance data at each wavelength. S30. The average spectral reflectance data is preprocessed. Then, a three-step strategy combining the continuous projection algorithm, the genetic algorithm, and the competitive adaptive reweighting method is used to extract the characteristic wavelengths from the preprocessed spectral reflectance data, thereby obtaining the characteristic wavelength data related to the total nitrogen content of the pit mud within the spectral range. S40, Based on the characteristic wavelength data, the total nitrogen content of the pit mud is predicted using a pre-constructed prediction model; wherein, the prediction model for the total nitrogen content of the pit mud is a combination of hybrid crowned porcupine optimization algorithm and support vector regression; In step S30, the three-step strategy for feature wavelength extraction is as follows: S31, The continuous projection algorithm is used to initially select the full wavelength of the preprocessed spectral reflectance characteristic data to obtain the first set of characteristic wavelength data; wherein, when the continuous projection algorithm selects different numbers of characteristic wavelengths, it is based on the trend graph of RMSE change. When the RMSE value reaches the minimum value, the selected wavelength combination is the characteristic wavelength. S32, use a genetic algorithm to perform secondary extraction on the first group of feature wavelength data, set the relevant control parameters of the genetic algorithm, including the initial population, crossover probability, mutation probability and number of iterations, and after the iteration terminates, add the wavelength variables one by one into the partial least squares regression model in order of frequency, and determine the best combination of wavelength variables with the RMSE value to obtain the secondary extracted feature wavelength data. S33, The competitive adaptive reweighting method is used to further filter the feature wavelength data extracted in the second step. The weight of each wavelength point is calculated based on the absolute value of the regression coefficient. The reweighting sampling method is used to determine the wavelengths to be iterated, and the wavelengths with high weights are retained. Finally, the optimal combination of feature wavelengths is obtained. In step S40, the combination of the hybrid crowned porcupine optimization algorithm CCPO and support vector regression SVR is specifically as follows: A two-layer CCPO-SVR hybrid optimization model is constructed, in which the inner layer performs regression prediction based on support vector regression (SVR), and the outer layer is based on the hybrid crown porcupine optimization algorithm (CCPO). The optimal hyperparameter combination of SVR is automatically searched by minimizing the prediction error of SVR. The hyperparameters include the penalty coefficient c, the kernel parameter g, and the insensitive loss parameter ε.

2. The method for detecting total nitrogen content in pit mud based on hyperspectral technology combined with a hybrid algorithm as described in claim 1, characterized in that, In step S10, the black-and-white correction process specifically involves: capturing a fully white calibrated image with a standard white board placed in the shooting area; capturing a fully black calibrated image with the lens cap on; and performing full white and full black corrections on the hyperspectral image, using a specific formula for calculation. The specific formula is: In the formula, R It is the corrected reflectance image data; I It is the raw hyperspectral image data; W It is standard whiteboard image data; D It is standard blackboard image data.

3. The method for detecting total nitrogen content in pit mud based on hyperspectral technology combined with a hybrid algorithm as described in claim 1, characterized in that, In step S30, the preprocessing includes at least one of three methods: standard normal variable transformation, multivariate scattering correction, and convolution smoothing.

4. The method for detecting total nitrogen content in pit mud based on hyperspectral technology combined with a hybrid algorithm as described in claim 1, characterized in that, In step S40, the prediction performance correction determination coefficient of the total nitrogen content prediction model of the pit mud is determined. Corrected root mean square error (RMSEC) and prediction coefficient of determination A comprehensive evaluation is conducted using the root mean square error (RMSEP) of the prediction.

5. The method for detecting total nitrogen content in pit mud based on hyperspectral technology combined with a hybrid algorithm as described in claim 4, characterized in that, RMSEC The formula for calculating the RMSEP parameter is as follows: In the formula, Y i ∧ and Y i Y represents the predicted and actual values ​​of the total nitrogen content in the i-th mud sample, respectively. C and Y P The average total nitrogen content of the sludge samples in the calibration set and prediction set are respectively, n C and n P These represent the number of samples in the calibration set and the prediction set, respectively.

6. The method for detecting total nitrogen content in pit mud based on hyperspectral technology combined with a hybrid algorithm as described in claim 1, characterized in that, Also includes: S50, using a visualization method, a pseudo-color image of the total nitrogen content distribution of the pit mud sample to be tested is generated. The pseudo-color image is represented by linear color levels, and different color levels are matched with different total nitrogen contents of pit mud.

7. The method for detecting total nitrogen content in pit mud based on hyperspectral technology combined with a hybrid algorithm as described in claim 6, characterized in that, In step S50, the step of generating a pseudo-color map of the total nitrogen content distribution specifically includes: The ROI region is divided using morphological methods in image processing techniques, and the spectral reflectance data of each pixel within the ROI region is extracted. The spectral reflectance data of each pixel is input into the total nitrogen content prediction model of the pit mud to calculate the total nitrogen content value of each pixel. The total nitrogen content value of each pixel is mapped to a grayscale range of 0 to 255 to generate a grayscale image; The grayscale image is processed with pseudo-color to obtain a visualization image of the total nitrogen content of the pit mud; where different colors represent different total nitrogen content values, dark red areas indicate higher total nitrogen content values, and dark blue areas indicate lower total nitrogen content values.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method for detecting the total nitrogen content of pit mud based on hyperspectral technology combined with a hybrid algorithm as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Saffron crocus classification method based on hyperspectral image technology

    CN110849828A

  • Potato disease and pest classification method, system and equipment and storage medium

    CN119478678A