Hyperspectral cerebrospinal fluid substance detection method and system fusing visual and spectral characteristics
Through hyperspectral imaging and Alexnet model, the complexity and accuracy of cerebrospinal fluid detection are solved, and efficient and accurate cerebrospinal fluid substance detection is achieved.
Patent Information
- Application Number
- CN202510542750.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-28
- Publication Date
- 2025-08-01
AI Technical Summary
The existing cerebrospinal fluid substance detection technology is complex, time-consuming and susceptible to environmental influences. The detection accuracy of traditional methods is limited. Hyperspectral imaging technology has not been effectively used in cerebrospinal fluid detection, making it difficult to extract and identify spectral features.
The hyperspectral image data was used to acquire cerebrospinal fluid image data, and key wavelengths were selected through a competitive adaptive reweighting algorithm, integrating visual and spectral features, and training and detection using the improved Alexnet convolutional neural network model.
It improves the accuracy and efficiency of cerebrospinal fluid substance detection, can identify subtle spectral differences, provides detailed information on cerebrospinal fluid composition, and supports rapid and accurate medical diagnosis.
Smart Images

Figure CN120404612A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of medical detection, and particularly relates to a hyperspectral cerebrospinal fluid substance detection method and system integrating visual and spectral characteristics. Background Technique
[0002] As an important part of the human nervous system, cerebrospinal fluid has complex components and is crucial for the normal function of the nervous system. In the medical field, the analysis of cerebrospinal fluid has always been a key link in the diagnosis, treatment, and monitoring of nervous system diseases. However, there are many deficiencies in existing cerebrospinal fluid substance detection technologies. First, traditional methods such as immunological detection and gene detection are complex to operate, require highly specialized equipment and operating skills, and the detection process takes a long time, which is not conducive to rapid diagnosis. Second, these methods are easily affected by various factors such as sample quality and detection environment, resulting in limited accuracy and reliability of the detection results. In addition, although methods such as biochemical analysis can provide some information on cerebrospinal fluid components, they can often only detect some substances, and the detection effect on certain trace substances is not good.
[0003] With the progress of technology, hyperspectral imaging technology has gradually emerged. Hyperspectral imaging technology can simultaneously obtain spectral information and spatial information of a sample at different wavelengths, and has advantages such as high resolution and large information volume. However, applying hyperspectral imaging technology to cerebrospinal fluid substance detection still faces many challenges. For example, how to effectively extract the hyperspectral features of cerebrospinal fluid, how to accurately identify the spectral characteristics of different substances, and how to construct an efficient detection model. Therefore, a hyperspectral cerebrospinal fluid substance detection method integrating visual and spectral characteristics is proposed to solve the above problems. Summary of the Invention
[0004] The purpose of the present invention is to provide a hyperspectral cerebrospinal fluid substance detection method and system integrating visual and spectral characteristics to solve the problems raised in the above background technique.
[0005] To achieve the above purpose, the present invention provides the following technical solution: A hyperspectral cerebrospinal fluid substance detection method integrating visual and spectral characteristics, characterized in that it includes the following steps:
[0006] S1: Use a hyperspectral imager to image cerebrospinal fluid and obtain its hyperspectral image data;
[0007] S2: Preprocess the collected hyperspectral image to obtain a cerebrospinal fluid hyperspectral image;
[0008] S3: Use the competitive adaptive reweighted sampling algorithm to perform feature band selection on the preprocessed hyperspectral image, and screen out key wavelengths that meet the preset correlation with the measurement index;
[0009] S4: Integrate visual features and spectral features;
[0010] S5: Construct a dual-channel three-level Alex2-3Dnet prediction model based on the Alexnet convolutional neural network, and input the preprocessed and feature-selected and fused hyperspectral image data into this model for training;
[0011] S6: Through the trained model, perform substance classification detection on the collected cerebrospinal fluid images.
[0012] Preferably, the steps of preprocessing the collected hyperspectral images to obtain cerebrospinal fluid hyperspectral images specifically include:
[0013] S21: Process the signals obtained by the hyperspectral imager to eliminate signal errors and obtain the corresponding image data;
[0014] S22: Process the obtained image signals to eliminate noise interference and errors, and obtain cerebrospinal fluid hyperspectral images available for analysis.
[0015] Preferably, after the step of performing substance classification detection on the collected cerebrospinal fluid images through the trained model, it includes:
[0016] S7: Verify and optimize the trained dual-channel three-level Alex2-3Dnet prediction model, using the formula:
[0017]
[0018] Calculate the verification error value and adjust the prediction accuracy;
[0019] where S val represents the verification error value, N represents the total number of verification data samples, P i represents the predicted value of the i-th sample, T i represents the actual value of the i-th sample, W j represents the weight of the j-th layer model, M represents the total number of model layers, represents the sum of all layer model weights, represents the square root operation, |P i -T i | 2 represents the squared error between the predicted value and the actual value.
[0020] Preferably, after the step of verifying and optimizing the trained dual-channel three-level Alex2-3Dnet prediction model, it includes:
[0021] S8: Use the verified model to perform substance detection on new cerebrospinal fluid samples, using the formula:
[0022]
[0023] Calculate the difference value and output the detection result;
[0024] Among them, R represents the difference value between the concentration of a specific substance in the sample and the reference concentration, C k represents the concentration of the substance in the kth sample, V k represents the weight coefficient of the sample concentration, which affects the contribution of the sample data to the final result. L represents the total number of samples detected, C ref represents the reference concentration of the substance, which is set according to past experience values or standard literature. represents the sum of the concentrations of all samples after weighting, and |·| represents taking the absolute value, which is used to calculate the absolute magnitude of the difference.
[0025] Preferably, in the S7, the verification and optimization include adopting cross-validation and grid search strategies to find the optimal model parameters and feature combinations.
[0026] Preferably, the detection result includes the types, concentrations or distributions of different substances in the cerebrospinal fluid, as well as the corresponding confidence or reliability indicators.
[0027] A hyperspectral cerebrospinal fluid substance detection system that fuses visual and spectral characteristics, used to perform the above detection method, is characterized by including:
[0028] A cerebrospinal fluid substance hyperspectral imaging image acquisition module, used to acquire the hyperspectral image of the cerebrospinal fluid through a hyperspectral imager.
[0029] A first processing module, used to process the signal obtained by the hyperspectral imager, eliminate signal errors, and obtain the corresponding image data;
[0030] A second processing module, used to process the obtained image signal, eliminate noise interference and errors, and obtain a hyperspectral image of the cerebrospinal fluid that can be used for analysis;
[0031] A feature extraction and fusion module, used to screen and extract the key wavelengths with strong correlation with the measurement indicators, eliminate weak information or non-informative wavelengths, and achieve feature selection and dimensionality reduction.
[0032] A classification detection module, used to train the collected cerebrospinal fluid data set in the selected model to achieve substance classification detection of the collected cerebrospinal fluid images.
[0033] Preferably, in the first processing module or the second processing module, standard normal transformation is used to preprocess the spectral information.
[0034] Preferably, it further includes a result output module, used to output the detection result
[0035] Preferably, in the feature extraction and fusion module, the competitive adaptive reweighted sampling algorithm is used to select the characteristic bands of the collected cerebrospinal fluid hyperspectral images, so as to screen out the key wavelengths with strong correlation with the measurement indexes.
[0036] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0037] (1) By using the SNV method to preprocess the hyperspectral image data of cerebrospinal fluid, the present invention can process each spectrum separately, effectively eliminate the scattering problem in the spectrum, as well as the interference caused by uneven sample particle size, surface scattering and optical path change. Through the steps of mean centering, standardization and normalization, the noise and signal offset in the spectral data are further eliminated, the spectral features are significantly enhanced, and the absorption peaks and wave peaks become more obvious, providing a more accurate and reliable data basis for subsequent analysis.
[0038] (2) By improving the Alexnet model, the present invention reduces the number of convolutional layers, reduces the computational complexity, and improves the generalization ability of the model at the same time. A 2D dual-channel convolutional layer is added after the first convolutional layer, which can extract the global features and local features of the image at the same time, providing richer feature information for the model. The introduction of the 3D convolutional layer further extracts the spectral features, channel features and spatial features of the image, makes full use of the spectral information in the hyperspectral image, and significantly improves the fitting ability of the model to the hyperspectral data. After the fusion processing of the last two convolutional layers, the analysis ability of the model to features is strengthened, and the spectral differences of tissues under different pathological conditions can be identified more accurately.
[0039] (3) Compared with the multispectral imaging, the hyperspectral imaging of the present invention has more spectral bands and higher spectral resolution, can capture the subtle spectral differences of tissues under different pathological conditions, and the improved Alexnet model can use the shape and spectral information at the same time to classify the MHSI data more accurately and reliably, which provides a more accurate and reliable basis for medical diagnosis and helps doctors make more accurate diagnosis and treatment decisions. Description of the Drawings
[0040] Figure 1 is the system block diagram of the present invention;
[0041] Figure 2 is the schematic diagram of the hyperspectral image acquisition device of the present invention. [[ID=2:4]]Detailed Embodiments
[0042] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0043] Please refer to Figure 1 - Figure 2 as shown, the present invention provides the following technical solutions:
[0044] Embodiment 1
[0045] As Figure 1 shown, Embodiment 1 of the present invention provides a hyperspectral cerebrospinal fluid substance detection method integrating visual and spectral characteristics, including a cerebrospinal fluid hyperspectral image acquisition module, a spectral image preprocessing module, a spectral image feature selection and fusion module, and a cerebrospinal fluid substance classification and detection module.
[0046] In this Embodiment 1, the cerebrospinal fluid hyperspectral image acquisition module is used to perform hyperspectral imaging on the collected cerebrospinal fluid based on a hyperspectral imaging platform, laying a foundation for spectral processing.
[0047] The spectral image preprocessing module is used to transmit the hyperspectral image obtained by the spectral acquisition module of the hyperspectral imaging platform to a computer, and use SNV-based spectral preprocessing software to preprocess the obtained data mainly through methods such as mean centering, standardization, and normalization, laying a foundation for feature selection and feature fusion.
[0048] The spectral image feature selection and fusion module is based on the image processed by the spectral image preprocessing module, and uses CARS-based spectral feature selection and fusion software to fuse the visual features and spectral features of the cerebrospinal fluid hyperspectral image.
[0049] The cerebrospinal fluid substance classification and detection module transmits the data obtained by computer processing to a two-channel three-level Alex2-3Dnet prediction model based on the Alexnet convolutional neural network, strengthening the ability to extract and analyze the characteristics of cerebrospinal fluid substances, and is used for the detection and research of cerebrospinal fluid substances.
[0050] As Figure 2As shown in the figure, in Example 1, the HSI used in the system mainly includes a CCD camera (DL-604M, Andor Technology Ltd., Ireland), a line-scanning spectrometer (V10E, Spectrum Imaging Ltd., Finland), with a spectral acquisition range of 200-1000 nm, an illumination system: an adjustable halogen light source box (3900E, Illumination Technologies Ltd., USA), which irradiates the sample through fiber optic extension, an electric control displacement platform driven by a stepper motor, a sample holder for fixing the sample, and a computer equipped with HSI system control software (Spectral Image-VNIR software, Isuzu Optics Corp., China), which can set parameters such as the camera exposure time, the moving speed of the electric control displacement platform, the spectral scanning range of the spectrometer, the image resolution, and the light source intensity. To avoid interference from ambient light, all instruments except the computer are installed in a dark box.
[0051] SNV preprocessing is a common method in spectral preprocessing. First, spectral correction is performed: Due to equipment and environmental factors, there may be deviations in cerebrospinal fluid spectral data. Wavelength correction, energy correction, and baseline correction (removing non-characteristic signals in the spectral data, such as solvent absorption, scattered light, etc., to more clearly observe the characteristic absorption peaks of cerebrospinal fluid samples) can be carried out for spectral correction to eliminate the influence. Spectral denoising: Hyperspectral data often contains noise, such as instrument noise, reading errors, etc. The spectral image is denoised multiple times through methods such as mean filtering, median filtering, wavelet denoising, and principal component analysis (PCA). Spectral endpoint detection: Identifying the starting and ending points of the spectral curve can help distinguish different substances in cerebrospinal fluid. The SNV preprocessing method can standardize the spectral data at each wavelength or wavenumber point to a standard normal distribution with a mean of 0 and a variance of 1. After the spectral data is standardized, it can eliminate interference factors such as noise and signal offset in the spectral data, enhance spectral features, and make the absorption peaks and wave peaks more obvious. CARS is selected as the band selection method for cerebrospinal fluid hyperspectral data. The specific process includes determining the laser wavelength. The CARS technique usually uses two consecutive laser wavelengths as the excitation wavelengths. These laser wavelengths need to be selected appropriately so that they resonate with the molecular vibration modes in the sample. Selecting the resonance wavelength: To enhance the CARS signal, one of the excitation laser wavelengths should match the resonance vibration mode of the molecule. This matching can be carried out by referring to the known molecular spectral characteristics or using a prediction model. Ensuring that the excitation light matches the specific vibration frequency of the molecule will greatly enhance the CARS signal intensity. Considering non-resonant contributions: In addition to resonant contributions, the influence of non-resonant CARS signals also needs to be considered. Non-resonant signals are usually caused by electronic polarization in the molecule, and their intensity is usually weaker than that of resonant signals. Therefore, when selecting bands, the laser wavelength needs to be adjusted appropriately to minimize the interference of non-resonant signals. Adjusting the spectral range and resolution: According to the molecular vibration modes of interest in the sample, an appropriate spectral range and resolution are selected. The spectral range should cover all molecular vibration frequencies of interest, and at the same time, the resolution should be high enough to clearly distinguish different vibration modes. Feature splicing: The spectral features and visual features of cerebrospinal fluid are connected in sequence into a longer feature vector. If the spectral features have n dimensions and the visual features have m dimensions, then the spliced feature vector will have n + m dimensions. Weighted average: After extracting the spectral features related to cerebrospinal fluid and the relevant features of visual data from the hyperspectral image, weights are set for the spectral features and visual features respectively according to specific requirements or the results obtained through training. The spectral features and visual features are multiplied by their corresponding weights respectively, and the results are added to obtain the final feature fusion vector.
[0052] In summary, in the first embodiment of the present invention, in the present system, the cerebrospinal fluid hyperspectral image acquisition module is used to acquire cerebrospinal fluid hyperspectral images, and the spectral image preprocessing module is used to process and convert them into electrical signals and send them to the computer data processing module, and jointly complete the spectral data preprocessing with the help of computer software, reduce the influence of interference signals on the hyperspectral signals, and transmit them to the feature selection and fusion module to prepare for the classification and detection of cerebrospinal fluid substances. Overcoming the limitations of existing cerebrospinal fluid substance detection technologies, the use of hyperspectral imaging technology can improve the efficiency of cerebrospinal fluid substance detection.
[0053] The advantages compared include:
[0054] It is possible to obtain the spectral information of each pixel point within a wide wavelength range. This high-precision spectral data can not only be used to identify the characteristics of cerebrospinal fluid substances, but also provide detailed information about the composition, structure, and state of cerebrospinal fluid substances; non-contact detection can enable the sample to be used multiple times; real-time and rapid detection can be achieved. After the hyperspectral imaging technology collects spectral data, it can quickly generate high-resolution images, and the analysis results are almost real-time.
[0055] Embodiment 2
[0056] The second embodiment of the present invention provides a system for detecting the substance composition of cerebrospinal fluid, including:
[0057] A cerebrospinal fluid hyperspectral acquisition module for acquiring cerebrospinal fluid hyperspectral images and obtaining the most original spectral data;
[0058] A spectral image preprocessing module for performing mean centering, standardization, and normalization on the collected cerebrospinal fluid hyperspectral images to eliminate signal errors and obtain corresponding electrical signals;
[0059] A spectral image feature selection and fusion module: performing feature selection and feature fusion on the cerebrospinal fluid hyperspectral images in the corresponding computer module to lay a foundation for the detection and classification of cerebrospinal fluid substances;
[0060] A cerebrospinal fluid substance classification and detection module
[0061] The steps of using the Alex2-3Dnet model to perform substance classification detection on cerebrospinal fluid hyperspectral images are as follows:
[0062] Model training
[0063] Using the collected cerebrospinal fluid data set to train the selected Alex2-3Dnet model. The training process includes:
[0064] Data loading: Loading the preprocessed image data into the training environment.
[0065] Dataset parameter settings: Build the Alex2-3Dnet model in deep learning frameworks such as PyTorch or TensorFlow,
[0066] Set the proportion for the training set, set the learning rate and Batch size, and use them to
[0067] perform predictive training on the neural network for classification detection.
[0068] Loss function selection: Select an appropriate loss function, and the cross-entropy loss function can be chosen.
[0069] Optimizer selection: Select the Adam optimizer to optimize the model parameters.
[0070] Training and validation: Divide the training set and the validation set, and monitor the generalization ability of the model through the validation set.
[0071] Model evaluation and tuning
[0072] After the training is completed, use the test set to evaluate the performance of the model. Evaluate the model through metrics such as accuracy, precision, recall, and F1 score. Adjust the model structure, hyperparameters, or data processing strategy according to the evaluation results to improve the accuracy and generalization ability of the model.
[0073] Model deployment and application
[0074] After completing the training and evaluation, the model can be deployed to actual applications for the substance classification detection of cerebrospinal fluid.
[0075] Example 3:
[0076] In Example 3, we further refined the processing flow of the spectral image preprocessing module and introduced a new feature selection and fusion strategy.
[0077] Spectral image preprocessing module:
[0078] Step refinement: First, perform dark current correction and bad pixel correction on the collected hyperspectral images to eliminate image errors caused by the instrument itself or environmental factors. Then, perform mean centering, that is, calculate the average value of each wavelength point and subtract this average value from the original spectrum to ensure that the average value of the spectral data is 0. Next, perform standardization processing, calculate the standard deviation of each wavelength point and divide by this standard deviation so that the data of each band has the same variance. Finally, perform normalization processing, considering the overall intensity of each sample, and eliminate the difference in intensity between samples by dividing by the square root of the total variance of the sample itself.
[0079] Feature selection and fusion module:
[0080] New Feature Selection Strategy: In addition to using the Competitive Adaptive Reweighted Sampling (CARS) algorithm for feature band selection, we also introduced a feature selection method based on Principal Component Analysis (PCA). The PCA method converts high-dimensional spectral data into a low-dimensional principal component space through dimensionality reduction techniques while retaining the main features of the data. By comparing the contributions of different principal components to the measurement index, the key wavelengths with the strongest correlation to the measurement index are selected.
[0081] Fusion Strategy Optimization: In the feature fusion stage, we adopted a deep learning-based method, such as the Autoencoder, to fuse spectral features and visual features. The Autoencoder can learn the low-dimensional representation of the data through the encoder and decoder structures while retaining the main features of the data. By training the Autoencoder, we can fuse spectral features and visual features into a low-dimensional feature vector for subsequent classification and detection tasks.
[0082] Example 4:
[0083] In Example 4, we focused on optimizing the training process of the Alex2-3Dnet prediction model and introduced a transfer learning strategy.
[0084] Model Training Optimization:
[0085] Transfer Learning: Since training the Alex2-3Dnet model from scratch requires a large amount of data and computing resources, we adopted a transfer learning strategy. First, the Alexnet model was pre-trained on a large dataset (such as ImageNet), and then its weights were transferred to our Alex2-3Dnet model, and only the last few layers were fine-tuned to adapt to our hyperspectral data. This method can significantly reduce the training time and the amount of data required.
[0086] Learning Rate Adjustment: During the training process, we adopted a learning rate decay strategy, that is, as the training progresses, the learning rate is gradually decreased to improve the convergence and stability of the model.
[0087] Early Stopping: To avoid model overfitting, we introduced early stopping. During the training process, if the loss of the validation set no longer decreases, the training is stopped and the current model is saved as the best model.
[0088] Model Evaluation and Tuning:
[0089] Cross-Validation: To more accurately evaluate the performance of the model, we adopted the k-fold cross-validation method. The dataset is divided into k subsets, and each time k - 1 subsets are used for training, and the remaining one subset is used for validation. Repeat k times, each time selecting a different subset as the validation set, and finally take the average of the k validation results as the performance evaluation index of the model.
[0090] Hyperparameter Tuning: By methods such as grid search or random search, tune the hyperparameters of the model (such as learning rate, Batchsize, convolution kernel size, etc.) to find the optimal model configuration.
[0091] Example 5:
[0092] In Example 5, we introduced a real-time detection module and optimized the user interface.
[0093] Real-time Detection Module:
[0094] Hardware Acceleration: To achieve real-time detection, we adopted high-performance GPUs and dedicated hyperspectral data processing hardware accelerators to improve the data processing speed.
[0095] Parallel Processing: Through parallel processing technology, simultaneously process the hyperspectral image data of multiple cerebrospinal fluid samples to further improve the detection efficiency.
[0096] User Interface Optimization:
[0097] Visualization Display: Provide rich visualization functions, such as two-dimensional images, three-dimensional stereograms, heat maps, etc., to intuitively display the detection results of different substances in cerebrospinal fluid.
[0098] Interactive Operation: Users can adjust the detection parameters in real time through controls such as buttons and sliders on the interface and view the detection results after adjustment in real time.
[0099] Report Generation: Automatically generate detection reports, including detailed information on detection results, confidence or reliability indicators, etc., for subsequent analysis and processing by users.
[0100] Example 6:
[0101] In Example 6, we further explored new applications of hyperspectral imaging technology in cerebrospinal fluid substance detection.
[0102] Multimodal Data Fusion:
[0103] In addition to hyperspectral data, we also introduced data of other modalities, such as magnetic resonance imaging (MRI), computed tomography (CT), etc., to provide more comprehensive cerebrospinal fluid information. Through multimodal data fusion technology, integrate and analyze data of different modalities to improve the accuracy and reliability of detection.
[0104] Deep Learning Model Extension:
[0105] In addition to the Alex2-3Dnet model, we also tried other deep learning models, such as Convolutional Long Short-Term Memory Network (ConvLSTM), Graph Convolutional Network (GCN), etc., to explore the performance differences of different models in cerebrospinal fluid substance detection. Through comparative experiments and performance evaluations, the optimal model was selected for practical applications.
[0106] Example 7: Optimization of Hyperspectral Image Enhancement and Denoising Module
[0107] In Example 7, we focused on the optimization of the hyperspectral image enhancement and denoising module to improve the image quality and detection accuracy.
[0108] Image Enhancement:
[0109] Contrast stretching: By stretching the contrast of the hyperspectral image, the detailed information in the image is enhanced, making the spectral differences between different substances more obvious.
[0110] Histogram equalization: Adjust the histogram distribution of the image to make the gray value distribution in the image more uniform, thereby improving the visual effect and detection performance of the image.
[0111] Denoising Processing:
[0112] Non-local mean denoising: Use the weighted average of similar pixels in the image to remove noise while preserving the edge and texture information of the image.
[0113] Wavelet transform denoising: Decompose the image into wavelet coefficients of different scales and directions, remove the noise coefficients through threshold processing, and then reconstruct the image to achieve the denoising effect.
[0114] Example 8: Design and Optimization of Classifier Based on Ensemble Learning
[0115] In Example 8, we explored the design of a classifier based on ensemble learning to improve the accuracy and robustness of cerebrospinal fluid substance detection.
[0116] Classifier Ensemble:
[0117] Bagging: Construct multiple training subsets through multiple random samplings, train a classifier on each subset, and finally obtain the final classification result through voting or averaging.
[0118] Boosting: Gradually construct multiple weak classifiers, each classifier classifies the errors of the previous classifier, and finally combine the results of all classifiers with weights to obtain the final strong classifier.
[0119] Classifier Optimization:
[0120] Feature weight adjustment: Different weights are assigned to different features according to their importance to improve the performance of the classifier.
[0121] Parameter tuning: The parameters of the classifier are tuned through methods such as cross-validation and grid search to find the optimal parameter combination.
[0122] Example 9: Cloud deployment and remote monitoring of the cerebrospinal fluid substance detection system
[0123] In Example 9, we considered the cloud deployment and remote monitoring of the cerebrospinal fluid substance detection system to achieve the sharing of detection resources and the application of telemedicine.
[0124] Cloud deployment:
[0125] Data upload and storage: The collected hyperspectral images and other relevant data are uploaded to the cloud server for storage and management.
[0126] Model deployment: The trained deep learning model is deployed to the cloud, and real-time cerebrospinal fluid substance detection is performed through cloud computing resources.
[0127] Remote monitoring:
[0128] Real-time data transmission: The real-time data during the detection process is transmitted to the remote monitoring end through the network for doctors or experts to conduct remote guidance and monitoring.
[0129] Abnormal alarm: When an abnormality or suspected lesion is detected, the system automatically triggers the alarm mechanism and sends the relevant information to the mobile phones of doctors and patients for timely measures.
[0130] Example 10: Multi-platform compatibility and scalability of the cerebrospinal fluid substance detection system
[0131] In Example 10, we focused on the multi-platform compatibility and scalability of the cerebrospinal fluid substance detection system to meet the needs of different devices and scenarios.
[0132] Multi-platform compatibility:
[0133] Cross-platform development: Cross-platform development frameworks and technologies are adopted so that the system can run on different operating systems and hardware devices.
[0134] Data format conversion: Support the import and export of multiple data formats to facilitate data exchange and sharing with other systems.
[0135] Scalability:
[0136] Modular design: The system is divided into multiple independent modules, and each module can be developed and upgraded independently to improve the scalability and flexibility of the system.
[0137] Plugin mechanism: Provide a plugin mechanism that allows users to add new functional modules or algorithms as needed to expand the system's functionality and performance.
[0138] Example 11: Real-time feedback and interactive guidance of cerebrospinal fluid substance detection system
[0139] In Example 11, we focused on the real-time feedback and interactive guidance functions of the cerebrospinal fluid substance detection system to improve the immediacy of detection and user engagement.
[0140] Real-time feedback:
[0141] Immediate display of detection results: The system can immediately display the processing results of hyperspectral images and the detection results of cerebrospinal fluid substances, enabling users to quickly understand the detection situation.
[0142] Highlighting of abnormal results: For detected abnormal or suspected lesion areas, the system will mark them with highlights or specific colors for users to quickly locate.
[0143] Interactive guidance:
[0144] User interface: Design an intuitive and easy-to-use user interface that provides detailed operation guides and interpretations of detection results to help users better understand the detection process and results.
[0145] Remote expert guidance: The system supports experts to provide real-time guidance and suggestions through the remote monitoring terminal, providing professional interpretations and consultations for users.
[0146] Example 12: Automatic calibration and verification of cerebrospinal fluid substance detection system
[0147] In Example 12, we explored the automatic calibration and verification functions of the cerebrospinal fluid substance detection system to ensure the accuracy and reliability of detection results.
[0148] Automatic calibration:
[0149] Regular calibration: The system can automatically perform calibration regularly to ensure the accuracy and stability of detection equipment.
[0150] Calibration data recording: The system can record the data and results of each calibration for subsequent analysis and verification.
[0151] Verification and testing:
[0152] Cross-verification: Cross-verify with other detection methods to evaluate the accuracy and reliability of the system.
[0153] Blind test: Conduct a blind test, that is, perform the detection without informing the system of the true results to verify the independent detection ability of the system.
[0154] Example 13: Data Visualization and Analysis of the Cerebrospinal Fluid Substance Detection System
[0155] In Example 13, we focus on the data visualization and analysis functions of the cerebrospinal fluid substance detection system to provide more intuitive and in-depth data interpretation and decision-making support.
[0156] Data Visualization:
[0157] Image visualization: Present the hyperspectral image and the detection results in an intuitive way, such as using color coding to represent the distribution and concentration of different substances.
[0158] Dynamic charts: Generate dynamic charts and reports to show the change trends and abnormal situations of the detection results.
[0159] Data Analysis:
[0160] Data mining: Utilize data mining techniques to extract useful information and patterns from a large amount of detection data.
[0161] Trend prediction: Based on historical detection data, use machine learning algorithms for trend prediction to provide guidance for future detections.
[0162] Example 14:
[0163] Verify and optimize the trained dual-channel three-level Alex2-3Dnet prediction model using the formula:
[0164]
[0165] Calculate the verification error value and adjust the prediction accuracy;
[0166] Where S val represents the verification error value, N represents the total number of verification data samples, P i represents the predicted value of the i-th sample, T i represents the actual value of the i-th sample, W j represents the weight of the j-th level model, M represents the total number of model levels, represents the sum of the weights of all level models, √ represents the square root operation, |P i -T i | 2 represents the squared error between the predicted value and the actual value.
[0167] Detailed Explanation of the Formula and the Derivation Process of the Formula Calculation:
[0168] This formula is used to calculate the verification error value Sval , which contains two main parts: the root mean square error (RMSE) and the average of the model layer weights. First, calculate the root mean square error between the predicted value and the actual value, and then multiply it by the average of the weights of each layer of the model to obtain the final validation error value.
[0169] The specific calculation methods of each parameter are as follows:
[0170] The total number of validation data samples N: Obtained through the data collection process. For example, the number of samples recorded using sensors or databases. Suppose 100 validation samples are collected from the experiment, then N = 100.
[0171] The predicted value P of the i-th sample i : Obtained from the prediction result of the model for the i-th validation sample. For example, for the first sample, the model predicted value is 0.8, then P1 = 0.8.
[0172] The actual value T of the i-th sample i : Obtain the true value of the i-th validation sample through actual measurement or annotation. For example, the actual measurement value of the first sample is 1.0, then T1 = 1.0.
[0173] The total number of model layers M: The number of layers of the model. Suppose the model contains 3 layers, then M = 3.
[0174] The weight W of the j-th layer model j : Set according to the performance indicators during the model training process or expert experience. For example, suppose the weight of the first layer is 0.9, the weight of the second layer is 0.8, and the weight of the third layer is 0.85, then W1 = 0.9, W2 = 0.8, W3 = 0.85. These weights can be adjusted according to the influence degree of each layer on the final prediction result, usually determined by methods such as cross-validation.
[0175] Substitute the above specific values into the formula, and the calculation process is as follows:
[0176] Calculate the root mean square error (RMSE):
[0177] Calculate the sum of the squared errors of each sample:
[0178]
[0179] For example, suppose the predicted values and actual values of the first five samples are as follows:
[0180] Sample 1: P1 = 0.8, T1 = 1.0;
[0181] Sample 2: P2 = 0.6, T2 = 0.5;
[0182] Sample 3: P3 = 0.9, T3 = 1.0;
[0183] Sample 4: P4 = 0.4, T4 = 0.3;
[0184] Sample 5: P5 = 0.7, T5 = 0.8;
[0185] The squared errors are respectively:
[0186] Sample 1: (0.8 - 1.0) 2 = 0.04;
[0187] Sample 2: (0.6 - 0.5) 2 = 0.01;
[0188] Sample 3: (0.9 - 1.0) 2 = 0.01;
[0189] Sample 4: (0.4 - 0.3) 2 = 0.01;
[0190] Sample 5: (0.7 - 0.8) 2 = 0.01;
[0191] Sum up the squared errors of all 100 samples. Assume the sum is 5.0.
[0192] Calculate the mean squared error (MSE):
[0193] Calculate the root mean squared error (RMSE):
[0194] Calculate the average value of the model - level weights:
[0195] Calculate the sum of weights:
[0196] Calculate the average value:
[0197] Calculate the validation error value S val : S val = 0.224×0.85 ≈ 0.1904;
[0198] This result indicates that the weighted root mean squared error of the model on the validation dataset is approximately 0.1904. This value is used to evaluate the prediction performance of the model. The smaller the value, the smaller the prediction error of the model on the validation set and the better the performance.
[0199] Example 15:
[0200] Use the validated model to detect substances in a new cerebrospinal fluid sample, using the formula:
[0201]
[0202] Calculate the difference value and output the detection result;
[0203] Among them, R represents the difference value between the concentration of a specific substance in the sample and the reference concentration, C k represents the concentration of the substance in the k-th sample, V k represents the weight coefficient of the sample concentration, which affects the contribution of the sample data to the final result. L represents the total number of samples detected, C ref represents the reference concentration of the substance, which is set according to past experience values or standard documents. represents the sum of the concentrations of all samples after weighting. |·| represents taking the absolute value, which is used to calculate the absolute magnitude of the difference.
[0204] Formula:
[0205]
[0206] Detailed explanation of the formula and the derivation process of the formula calculation:
[0207] This formula is used to calculate the difference value between the concentration of a certain substance in the detected sample and the reference concentration. The specific steps are as follows:
[0208] Parameter description and value source:
[0209] L represents the total number of samples detected, which is determined by the experimental design and sampling plan. For example, if a total of 6 samples are collected, then L = 6.
[0210] C k represents the concentration of the substance in the k-th sample, and the concentration value is obtained by detecting using high performance liquid chromatography. For example, assume that the detection results of the substance concentrations of 6 samples are 1.2, 1.5, 1.3, 1.4, 1.6, 1.7 mg / L respectively.
[0211] V k is the weight coefficient of the k-th sample, which is calculated from the sampling conditions and detection accuracy of the sample. Assume that the weights are set to 0.95, 1.0, 0.98, 1.02, 1.05, 1.1 according to the sample sampling conditions (such as dilution factor and equipment sensitivity).
[0212] C ref is the reference concentration, which is set according to historical data or standard documents. For example, the reference concentration is set to 1.4 mg / L.
[0213] Operation process:
[0214] Calculate the weighted concentration value of each sample:
[0215] The first sample: C1·V1 = 1.2·0.95 = 1.14;
[0216] The second sample: C2·V2 = 1.5·1.0 = 1.5;
[0217] The third sample: C3·V3 = 1.3·0.98 = 1.274;
[0218] The fourth sample: C4·V4 = 1.4·1.02 = 1.428;
[0219] The fifth sample: C5·V5 = 1.6·1.05 = 1.68;
[0220] The sixth sample: C6·V6 = 1.7·1.1 = 1.87;
[0221] Find the weighted concentration sum:
[0222] Calculate the average value of the weighted concentration of the samples:
[0223] Calculate the absolute difference between the weighted concentration average value and the reference concentration: R = |1.482 - 1.4| = 0.082;
[0224] The result shows that the difference between the weighted average concentration of the substance in the test sample and the reference concentration is 0.082 mg / L. This value is used to judge whether there is a significant deviation in the substance concentration. The smaller this difference value is, the closer the sample concentration is to the reference standard.
[0225] The innovation of the present invention lies in using the hyperspectral analysis technology that combines visual and spectral characteristics to detect and classify the substances in cerebrospinal fluid. It can effectively achieve non-destruction of the sample, obtain the spectral information of the sample at different wavelengths, effectively distinguish and analyze different components, and has high sensitivity, enabling the detection of trace substances. It innovatively uses the SNV preprocessing method to preprocess the collected cerebrospinal fluid hyperspectral images, making it easier to establish an accurate model, helping to improve the accuracy and stability of spectral analysis, and improving the prediction effect; it innovatively uses the Alex2-3Dnet model to detect and classify the substances in cerebrospinal fluid hyperspectral images, improving the efficiency of classification and detection.
[0226] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memory, CD-ROM, optical memory, etc.) that contain computer-usable program code.
[0227] In addition, to achieve the above object, an embodiment of the present invention also provides a computer-readable storage medium storing a computer program, which when executed by a processor implements the method and system for detecting hyperspectral cerebrospinal fluid substances by fusing visual and spectral characteristics in the embodiments of the present invention.
[0228] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the embodiments of the present invention can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the embodiments of the present invention can take the form of a computer program product implemented on one or more computer-usable vehicles (including but not limited to disk memory, CD-ROM, optical memory, etc.) that contain computer-usable program code.
[0229] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each flow and / or block in the flowchart and / or block diagram, and the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal devices generate a system for implementing the functions specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.
[0230] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal device to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including an instruction system that implements the functions specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.
[0231] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device, so that a series of operation steps are executed on the computer or other programmable terminal device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable terminal device provide for implementing the process Figure 1 in one process or multiple processes and / or blocks Figure 1 steps of the functions specified in one block or multiple blocks.
[0232] Finally, it should also be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. "And / or" means that either one of the two can be selected, or both can be selected. Moreover, the term "comprises", "comprising", "includes", "including" or any other variant thereof is intended to cover non-exclusively, so that a process, method, article or terminal device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or terminal device. Without further limitation, an element defined by the statement "comprises a..." does not exclude the presence of additional identical elements in the process, method, article or terminal device comprising the element.
[0233] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the embodiments of the present invention, and not to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention. Any changes or replacements that can be easily thought of by those skilled in the art within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention.
[0234] Although the embodiments of the present invention have been shown and described, those of ordinary skill in the art can understand that various changes, modifications, replacements and variations can be made to these embodiments without departing from the principles and spirit of the present invention. The scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A hyperspectral cerebrospinal fluid substance detection method that integrates visual and spectral characteristics, characterized in that: It includes the following steps: S1: Use a hyperspectral imager to image cerebrospinal fluid and obtain its hyperspectral image data; S2: Preprocess the collected hyperspectral images to obtain cerebrospinal fluid hyperspectral images; S3: Use the competitive adaptive reweighted sampling algorithm to perform feature band selection on the preprocessed hyperspectral images, and screen out the key wavelengths that meet the preset correlation with the measurement index; S4: Fuse visual features and spectral features; S5: Construct a dual-channel three-level Alex2-3Dnet prediction model based on the Alexnet convolutional neural network, and input the preprocessed, feature-selected, and fused hyperspectral image data into this model for training; S6: Use the trained model to perform substance classification detection on the collected cerebrospinal fluid images.
2. The hyperspectral cerebrospinal fluid substance detection method integrating visual and spectral characteristics according to claim 1, characterized in that: The step of preprocessing the collected hyperspectral images to obtain cerebrospinal fluid hyperspectral images specifically includes: S21: Process the signals obtained by the hyperspectral imager to eliminate signal errors and obtain the corresponding image data; S22: Process the obtained image signals to eliminate noise interference and errors, and obtain cerebrospinal fluid hyperspectral images that can be used for analysis.
3. The hyperspectral cerebrospinal fluid substance detection method integrating visual and spectral characteristics according to claim 1, characterized in that: After the step of using the trained model to perform substance classification detection on the collected cerebrospinal fluid images, it includes: S7: Verify and optimize the trained dual-channel three-level Alex2-3Dnet prediction model, using the formula: Calculate the verification error value and adjust the prediction accuracy; Among them, S val represents the verification error value, N represents the total number of verification data samples, P i represents the predicted value of the i-th sample, T i represents the actual value of the i-th sample, W j represents the weight of the j-th level model, M represents the total number of model levels, represents the sum of the weights of all level models, √ represents the square root operation, |P i -T i | 2 represents the squared error between the predicted value and the actual value.
4. The hyperspectral cerebrospinal fluid substance detection method integrating visual and spectral characteristics according to claim 3, characterized in that: After the step of verifying and optimizing the trained dual-channel three-level Alex2-3Dnet prediction model, it includes: S8: Use the verified model to perform substance detection on new cerebrospinal fluid samples, using the formula: Calculate the difference value and output the detection result; Among them, R represents the difference value between the concentration of a specific substance in the sample and the reference concentration, C k represents the concentration of the substance in the k-th sample, V k represents the weight coefficient of the sample concentration, which affects the contribution of the sample data to the final result. L represents the total number of samples detected, C ref represents the reference concentration of the substance, which is set according to past experience values or standard literature represents the sum of the concentrations of all samples after weighting, and |·| represents taking the absolute value, which is used to calculate the absolute magnitude of the difference.
5. The hyperspectral cerebrospinal fluid substance detection method integrating visual and spectral characteristics according to claim 3, characterized in that: In S7, the verification and optimization include using cross-validation and grid search strategies to find the optimal model parameters and feature combinations.
6. The hyperspectral cerebrospinal fluid substance detection method that integrates visual and spectral characteristics according to claim 5, characterized in that: The detection results include the types, concentrations, or distributions of different substances in cerebrospinal fluid, as well as the corresponding confidence or reliability indicators.
7. A hyperspectral cerebrospinal fluid substance detection system that integrates visual and spectral characteristics and is used to perform the detection method described in any one of claims 1-6, characterized in that It includes: A cerebrospinal fluid substance hyperspectral imaging image acquisition module, which is used to acquire the hyperspectral images of cerebrospinal fluid through a hyperspectral imager. A first processing module, which is used to process the signals obtained by the hyperspectral imager to eliminate signal errors and obtain the corresponding image data; A second processing module, which is used to process the obtained image signals to eliminate noise interference and errors, and obtain cerebrospinal fluid hyperspectral images that can be used for analysis; A feature extraction and fusion module, which is used to screen and extract the key wavelengths with strong correlation with the measurement index, eliminate weak information or non-informative wavelengths, and achieve feature selection and dimensionality reduction. A classification detection module, which is used to train the collected cerebrospinal fluid data set in the selected model to achieve substance classification detection of the collected cerebrospinal fluid images.
8. The hyperspectral cerebrospinal fluid substance detection system integrating visual and spectral characteristics according to claim 7, wherein: In the first processing module or the second processing module, the spectral information is preprocessed using standard normal transformation.
9. The hyperspectral cerebrospinal fluid substance detection method integrating visual and spectral characteristics according to claim 7 or 8, characterized in that: It also includes a result output module, which is used to output the detection results.
10. The hyperspectral cerebrospinal fluid substance detection system integrating visual and spectral characteristics according to claim 7 or 8, characterized in that: In the feature extraction and fusion module, the competitive adaptive reweighted sampling algorithm is used to perform feature band selection on the collected cerebrospinal fluid hyperspectral images to screen out the key wavelengths with strong correlation with the measurement index.
Citation Information
Patent Citations
Hyperspectral image classification method based on dual-channel sparse network
CN115471677A
Hyperspectral liquid medicine foreign matter detection method fusing vision and spectral significance
CN116129140A
Plant leaf nitrogen content hyperspectral modeling method based on map fusion
CN116310788A
Extraction method for spectral feature cross-correlation vector in hyperspectral image classification
WO2016091017A1