Method and system for detecting heavy metal pollution of common mussels based on CNN and femtosecond laser-induced breakdown spectroscopy

By combining the Fs-LA-LIBS spectral detection device and the CNN network model, the problems of sample destruction and quantitative grading in the detection of heavy metals in mussels have been solved, achieving high-precision, low-cost, and rapid pollution detection.

CN121997174APending Publication Date: 2026-05-08DONGGUAN UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
DONGGUAN UNIV OF TECH
Filing Date
2026-01-27
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

Existing technologies for heavy metal detection in mussels suffer from problems such as sample destruction, high cost, low timeliness, and inability to achieve non-destructive, high-precision quantitative detection. In particular, traditional methods result in the loss of sample information due to strong acid digestion, and the LIBS scheme cannot meet the requirements for quantitative grading due to its reliance on artificial features and poor noise sensitivity.

Method used

A detection method based on CNN and femtosecond laser-induced breakdown spectroscopy is adopted. The spectral acquisition and preprocessing are performed by an Fs-LA-LIBS spectral detection device, and the spectral features are automatically extracted by combining the CNN network model to achieve non-destructive detection and high-precision quantitative analysis.

Benefits of technology

It achieves non-destructive testing, reduces sample consumption by 90%, reduces testing costs by 80%, shortens testing time to 2 seconds, and achieves an accuracy rate of ≥97.6%, making it suitable for various application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121997174A_ABST
    Figure CN121997174A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of aquatic food safety detection, and particularly relates to a common mussel heavy metal pollution detection method and system based on CNN and femtosecond laser-induced breakdown spectroscopy, the method is realized based on an Fs-LA-LIBS spectrum detection device, and the method comprises the following steps: preparing common mussels to be detected into a sample, and placing the sample on a three-dimensional translation table of the Fs-LA-LIBS spectrum detection device; the method comprises the following steps: carrying out spectrum acquisition and pretreatment on a sample based on an Fs-LA-LIBS spectrum detection device to obtain statistical characteristics; based on a CNN network model, constructing a common mussel heavy metal pollution detection model; and based on the statistical characteristics and a common mussel heavy metal pollution detection model, obtaining a common mussel heavy metal pollution detection result. Through the CNN and femtosecond laser-induced breakdown spectroscopy embedded collaborative architecture, the three technical problems existing in common mussel heavy metal detection by a traditional method are solved, and non-destructive, high-precision and online quantitative detection is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of aquatic food safety testing technology, specifically involving a method and system for detecting heavy metal pollution in mussels based on CNN and femtosecond laser-induced breakdown spectroscopy. Background Technology

[0002] Mussels, as indicator organisms of nearshore pollution, are widely used in marine environmental monitoring due to their heavy metal accumulation characteristics. Current heavy metal detection technologies for mussels mainly include traditional laboratory methods and LIBS combined with machine learning, both of which have significant limitations. The following details the closest technical solutions and their shortcomings: 1. Traditional laboratory testing methods: Traditional laboratory testing methods mainly include atomic absorption spectrometry (AAS) or inductively coupled plasma mass spectrometry (ICP-MS). AAS is based on the absorption of light of a specific wavelength by ground-state atoms and the element concentration is quantified by absorbance. ICP-MS is based on the separation of elements by mass-to-charge ratio (m / z) after sample ionization and the element concentration is quantified by ion current intensity. Although both methods can detect the heavy metal content of mussels, they have the following defects: (1) Destroy the sample: AAS and ICP-MS both require strong acid to digest mussel samples, which completely destroys the biological structure, resulting in the permanent loss of information on the spatial distribution and chemical morphology of heavy metals, and it is impossible to retest the same live organism; (2) High cost: The sample mass required for a single test exceeds 50g and requires chemical reagents. The test time is about 2 hours, which is not timely.

[0003] 2. LIBS Combined with Machine Learning Approaches: Among LIBS-integrated machine learning approaches, Random Forest (RF), Support Vector Machine (SVM), and Partial Least Squares (PLS) are the mainstream methods. Random Forest improves classification robustness through multi-decision tree ensembles and feature importance ranking, but it relies on manual feature selection and struggles to adaptively decouple nonlinear interactions in high-dimensional spectra (such as Cd / Pb spectral line overlap). Support Vector Machine uses kernel function mapping to handle nonlinear classification, but it is sensitive to noise (classification boundaries fail when plasma flicker causes feature shifts) and cannot output concentration grading results. Partial Least Squares solves the collinearity problem through linear dimensionality reduction, but it cannot capture the complex response relationship between the organic matrix of mussels and heavy metals (such as the masking effect of Ca matrix on Cd signals). The common drawbacks of these three approaches are: feature engineering relies on experience, they have poor noise robustness, and they only support qualitative judgments, failing to meet the requirements for quantitative grading of heavy metals.

[0004] Therefore, there is an urgent need for a new method for detecting heavy metal pollution in mussels that can achieve non-destructive, high-precision, and online quantitative detection. Summary of the Invention

[0005] To address the problems existing in the prior art, this invention provides a method and system for detecting heavy metal pollution in mussels based on CNN and femtosecond laser-induced breakdown spectroscopy. The aim is to solve three major technical challenges in heavy metal detection in mussels: sample destruction and dynamic monitoring failure caused by strong acid digestion in traditional methods; misjudgment of trace element spectral lines (such as Cd-Ca overlap) caused by reliance on artificial features in existing LIBS intelligent solutions; and the inability to output pollution classification in real time. Ultimately, this invention achieves non-destructive, high-precision, online quantitative detection.

[0006] To achieve the above objectives, the present invention provides the following solution: A method for detecting heavy metal pollution in mussels based on CNN and femtosecond laser-induced breakdown spectroscopy, the method being implemented using an Fs-LA-LIBS spectroscopic detection device, the method comprising: The mussels to be tested were prepared into samples and placed on the three-dimensional translation stage of the Fs-LA-LIBS spectrometer. The sample was spectrally acquired and preprocessed using an Fs-LA-LIBS spectral detection device to obtain statistical characteristics. A heavy metal pollution detection model for mussels was constructed based on a CNN network model. Based on statistical characteristics and a heavy metal pollution detection model for mussels, the detection results of heavy metal pollution in mussels were obtained.

[0007] Preferably, the Fs-LA-LIBS spectral detection device includes: a femtosecond laser, a fiber optic spectrometer, a three-dimensional translation stage, and a DC high-voltage power supply; Femtosecond laser: A Ti-sapphire laser was used as the excitation source for the LIBS experiment, with a center wavelength of 800 nm, a pulse width of 50 fs, and a frequency of 1 kHz. Fiber optic spectrometer: wavelength range 200-550nm, resolution 0.07nm; 3D translation stage: driven by a stepper motor; DC high voltage power supply: voltage 10kV, current 0.2A.

[0008] Preferably, the method for obtaining statistical characteristics of samples by performing spectral acquisition and preprocessing based on the Fs-LA-LIBS spectral detection device includes: The spectral data of the sample was obtained by using a spatial multi-point sampling + time series averaging method. The spectral data is normalized to obtain preprocessed spectral data; An adaptive thresholding method was used to extract peak features from the preprocessed spectral data to obtain key indicators, including: number of peaks, mean peak intensity, and peak position deviation. The overall intensity mean and intensity standard deviation of the spectrum are calculated based on key indicators to obtain statistical characteristics, including: number of peaks, mean peak intensity, overall intensity mean, and intensity standard deviation.

[0009] Preferably, the method of acquiring spectral data by using spatial multi-point sampling + time series averaging includes: The sample stage is controlled to move along the X / Y axis by a three-dimensional translation stage. Five evenly distributed detection points are selected on the sample surface to form a 3×3 grid center and vertices. The spectrum is collected three times for each detection point to avoid the influence of single-point outliers. The duration of a single spectral acquisition is set to 100ms. Plasma scintillation noise is reduced by the built-in averaging algorithm of the fiber optic spectrometer. Five sets of spectral data are output for each sample, and each set contains the average value of three repeated acquisitions.

[0010] Preferred methods for obtaining heavy metal pollution detection results in mussels based on statistical characteristics and a heavy metal pollution detection model include: The convolutional feature extraction layer of the mussel heavy metal pollution detection model targets the 1D sequence characteristics of "wavelength-intensity" in spectral data and uses three stacked convolutional blocks to achieve feature extraction. Each convolutional block contains two 1D convolutional operations with a kernel size of 3, ReLU activation function, normalization and max pooling with a pooling kernel size of 2. Through the convolutional feature extraction layer, the shape, width and peak spacing information of heavy metal feature peaks are automatically identified to obtain 1024-dimensional output features. The feature fusion layer of the mussel heavy metal pollution detection model concatenates the 1024-dimensional output features from the convolutional feature extraction layer with the 4-dimensional statistical features by channel dimension to form a 1028-dimensional composite feature vector. The fully connected layer of the mussel heavy metal pollution detection model uses a 3-layer fully connected network to construct the classifier, and Dropout regularization is used to suppress model overfitting. The first two fully connected network layers gradually compress the 1028-dimensional composite features to 256-dimensional and 128-dimensional features, retaining the core discriminative information. The last fully connected network layer maps the 128-dimensional features to 3-dimensional output. The Softmax function is used to convert the 3-dimensional output into probability values ​​for each preset level. The level with the highest probability value is taken as the detection result of heavy metal pollution in mussels.

[0011] Preferably, the method further includes training a heavy metal pollution detection model for mussels: Data from four different concentrations of mussel samples were collected and divided into training, validation, and test sets according to a preset ratio. The heavy metal pollution detection model for mussels was trained based on the training, validation, and test sets. During training, PCA or t-SNE was used to reduce the dimensionality of the high-dimensional features of the heavy metal spectra of mussels for visualization. During training, an adaptive moment estimation optimizer combined with a cosine annealing learning rate scheduling strategy is used. During training, Gaussian noise with a signal-to-noise ratio of 20dB is injected into the test set to simulate noise interference present in actual testing.

[0012] This invention also provides a heavy metal pollution detection system for mussels based on CNN and femtosecond laser-induced breakdown spectroscopy. The system is used to implement the aforementioned method and includes: a sample preparation module, a spectral acquisition and processing module, a model building module, and a detection module. The sample preparation module is used to prepare the mussels to be tested into samples and place them on the three-dimensional translation stage of the Fs-LA-LIBS spectral detection device. The spectral acquisition and processing module is used to acquire and preprocess the spectra of samples based on the Fs-LA-LIBS spectral detection device to obtain statistical characteristics. The model building module is used to build a heavy metal pollution detection model for mussels based on a CNN network model. The detection module is used to obtain heavy metal pollution detection results for mussels based on statistical characteristics and a heavy metal pollution detection model for mussels.

[0013] The present invention also provides an electronic device, including 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 aforementioned method.

[0014] The present invention also provides a computer-readable storage medium storing a computer program that, when executed, implements the aforementioned method.

[0015] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. Non-destructive testing: Sample preparation using powder compression / live fixation + multi-point sampling preserves sample integrity and heavy metal distribution information, supports retesting, and reduces sample consumption by 90% (from 50g to less than 5g).

[0016] 2. No manual feature dependency: By leveraging CNN to automatically extract spectral features and perform feature fusion, the accuracy of handling spectral line overlap / matrix interference is increased by 20% and the efficiency is increased by 10 times, avoiding the manual dependency of traditional RF / SVM.

[0017] 3. Real-time quantitative grading: The CNN classifier maps to the national standard grade, and the embedded module realizes the full-process detection in 2 seconds (traditionally 2 hours), supports wireless cloud transmission, and meets the needs of on-site decision-making.

[0018] 4. Strong noise resistance: Hardware multi-point sampling averaging + CNN Dropout regularization, accuracy ≥97.6% at SNR=20dB, macro F1 ≥0.9759, noise resistance exceeds traditional LIBS by 30%.

[0019] 5. Low-cost integration: Femtosecond laser + fiber optic spectrometer replaces large equipment, saves chemical reagents, reduces the cost of a single test by 80%, reduces equipment size by 50%, and is suitable for multiple scenarios. Attached Figure Description

[0020] To more clearly illustrate the technical solution of the present invention, the drawings used in the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 This is a schematic diagram of the sample preparation process in an embodiment of the present invention; Figure 2 This is a schematic diagram of the Fs-LA-LIBS spectral detection device according to an embodiment of the present invention; Figure 3 This is a two-dimensional schematic diagram of PCA according to an embodiment of the present invention; Figure 4 This is a three-dimensional schematic diagram of PCA according to an embodiment of the present invention; Figure 5 This is a two-dimensional schematic diagram of t-SNE according to an embodiment of the present invention; Figure 6 This is a three-dimensional schematic diagram of t-SNE according to an embodiment of the present invention; Figure 7 This is a schematic diagram of the learning rate curve of the Adam optimizer combined with the cosine annealing strategy in an embodiment of the present invention; Figure 8 This is a schematic diagram of the training and validation loss and accuracy of the mussel heavy metal pollution detection model according to an embodiment of the present invention, wherein (a) is a schematic diagram of the training and validation loss; and (b) is a schematic diagram of the accuracy. Figure 9 This is a schematic diagram of the confusion matrix for the classification of mussels by the heavy metal pollution detection model of mussels in an embodiment of the present invention; Figure 10 This is a schematic bar chart illustrating the classification of mussels by heavy metal pollution detection model according to an embodiment of the present invention under SNR=20dB noise. Detailed Implementation

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

[0023] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0024] Example 1 This invention provides a method for detecting heavy metal pollution in mussels based on CNN and femtosecond laser-induced breakdown spectroscopy, implemented using an Fs-LA-LIBS spectral detection device. The method includes: The mussels to be tested were prepared into samples and placed on the three-dimensional translation stage of the Fs-LA-LIBS spectrometer. The sample was spectrally acquired and preprocessed using an Fs-LA-LIBS spectral detection device to obtain statistical characteristics. A heavy metal pollution detection model for mussels was constructed based on a CNN network model. Based on statistical characteristics and a heavy metal pollution detection model for mussels, the detection results of heavy metal pollution in mussels were obtained.

[0025] The specific implementation process of this invention is as follows: The mussels to be tested were prepared into samples and placed on the three-dimensional translation stage of the Fs-LA-LIBS spectrometer, including: In the initial sample preparation stage of the femtosecond laser-induced breakdown spectroscopy experiment, considering that the data collection experiment does not require direct physical testing of the original mussel material, this invention employs a powder pressing method to process the sample. The specific sample preparation process is as follows: Figure 1 As shown.

[0026] First, the mussels were ground into powder using an 800C multi-functional pulverizer manufactured by Yongkang Hongtaiyang Electromechanical Co., Ltd. The grinding time was set to 2 minutes and the rotation speed to 35,000 rpm. Sieving the powder through a 200-mesh sieve further ensured the uniformity of the powder particles. Next, 5g of the sieved mussel powder was weighed and poured into a tablet pressing device, then placed in a press and compressed into a Ф40mm×3mm sheet at a pressure of 20MPa. This pressure and size setting ensured that the sample sheet had suitable density and strength, facilitating stable placement on the device, while also meeting the basic requirements for sample size in spectral acquisition. Finally, the sample sheet was placed on the three-dimensional translation stage of the assembled Fs-LA-LIBS spectral detection device for spectral acquisition experiments.

[0027] During sample preparation, as long as the original molecular structure of the sample is not damaged and the sample homogeneity is ensured to meet the requirements of the original spectral acquisition, it is acceptable.

[0028] Furthermore, the Fs-LA-LIBS spectral detection device includes: a femtosecond laser, a fiber optic spectrometer, a three-dimensional translation stage, and a DC high-voltage power supply, specifically: In laser-induced breakdown spectroscopy (LIBS), femtosecond lasers offer significant advantages over traditional nanosecond lasers as excitation sources, including more precise plasma generation, reduced continuous background radiation, smaller ablation pit size, and reduced sample spatter. Therefore, this invention uses a Ti-sapphire laser as the excitation source for LIBS experiments (center wavelength 800 nm, pulse width 50 fs, frequency 1 kHz). An optical path is then constructed to focus the femtosecond laser beam onto the surface of a mussel sample, inducing the generation of a plasma spectrum.

[0029] It consists of a fiber optic spectrometer (wavelength range 200-550nm, resolution 0.07nm), a quartz fiber (core diameter 200μm), a three-dimensional translation stage, and a DC high-voltage power supply.

[0030] The three-dimensional translation stage directly fixes the mussel sample and achieves precise movement in the X, Y, and Z dimensions (positioning accuracy ±0.01mm) through stepper motor drive. It can sequentially transport different detection areas on the sample surface to the focal point of the femtosecond laser, meeting the needs of multi-area automatic sampling.

[0031] One end of the quartz fiber (receiving end) needs to be aligned with the plasma emission region induced by the femtosecond laser on the sample surface through optical path calibration, while the other end (output end) is directly connected to the signal input end of the fiber optic spectrometer, responsible for transmitting the optical signal radiated by the plasma to the fiber optic spectrometer without loss.

[0032] The fiber optic spectrometer receives the optical signal transmitted through the quartz fiber and uses its detection wavelength range of 200-550 nm (covering the characteristic spectral lines of most metallic or non-metallic elements in mussels, such as calcium, magnesium, and iron) and high resolution of 0.07 nm (which can distinguish overlapping spectral lines of adjacent elements and ensure detection accuracy) to convert the optical signal into an analyzable digital spectral signal, providing a data basis for subsequent elemental composition identification of mussel samples.

[0033] The DC high-voltage power supply, as the core component for spectral signal enhancement, outputs a 10kV high voltage and a 0.2A current to create a controllable spark discharge in the plasma region induced by the femtosecond laser. On one hand, the discharge energy reheats the plasma, extending its lifetime and increasing the number of excited-state particles; on the other hand, the high-voltage electric field accelerates collisions of charged particles, further enhancing the intensity of characteristic spectral lines, especially improving the signal identification of low-abundance elements. The accompanying RC filter circuit effectively suppresses power output ripple, smoothing voltage fluctuations with a capacitor and limiting current surges with a resistor, ensuring stable and controllable discharge energy and preventing signal fluctuations from affecting detection repeatability. The specific structure of the Fs-LA-LIBS spectral detection device is as follows: Figure 2 As shown.

[0034] Furthermore, methods for obtaining statistical characteristics of samples through spectral acquisition and preprocessing based on the Fs-LA-LIBS spectral detection device include: To overcome the spectral fluctuations caused by surface inhomogeneities in mussel samples (such as differences in shell texture and soft tissue distribution), this invention employs a spatial multi-point sampling + time-series averaging scheme, namely: The sample is controlled to move along the X / Y axis in a step (0.5 mm) using a three-dimensional translation stage. Five evenly distributed detection points are selected on the sample surface to form a 3×3 grid with a center and vertices. The spectrum is collected three times for each detection point to avoid the influence of single-point outliers. The duration of a single spectrum acquisition is set to 100 ms (corresponding to 100 laser pulses). The plasma scintillation noise (such as intensity jumps caused by laser energy fluctuations) is reduced by the built-in averaging algorithm of the spectrometer. Finally, five sets of spectral data are output for each sample, and each set contains the average value of three repeated acquisitions.

[0035] The raw spectral data contains problems such as noise interference and feature blurring. Therefore, the collected spectral data needs to be further preprocessed to extract key features and standardize them to adapt to the input of deep learning models. The specific process is as follows: (1) Normalization process: Map the wavelength-intensity of all samples to the [0,1] interval, using the following formula: ; in, It is a normalized value. x It is the raw data. It is the minimum value in the dataset. This is the maximum value in the dataset. By normalizing, the differences in spectral scale between different samples and different detection points are eliminated, ensuring that the model focuses on the relative changes of feature peaks rather than their absolute magnitudes.

[0036] (2) Peak feature extraction: The adaptive thresholding method is as follows: First, the spectral data is preprocessed with baseline correction and noise filtering. Then, 0.3 times the maximum intensity of the sample spectrum is taken as the peak identification threshold (the threshold is dynamically adjusted with the maximum intensity of the sample, rather than a fixed value). Then, the spectrum is traversed. When the intensity of three consecutive wavelength points is greater than or equal to the peak identification threshold and the middle point is the maximum value of the continuous segment, it is determined as a candidate feature peak. Then, three key indicators are extracted: peak quantity (the total number of effective feature peaks, such as feature peaks of target elements like Cd, Pb, and Hg), mean peak intensity (the average intensity of all target element feature peaks is calculated to reflect the overall enrichment level of heavy metals), and peak position deviation (the deviation between the measured peak position and the theoretical peak position is recorded to correct for spectral shifts caused by matrix effects).

[0037] (3) Calculation of statistical characteristics: Calculate the overall intensity mean and intensity standard deviation of the spectrum to obtain statistical characteristics, including: number of peaks, mean peak intensity, overall intensity mean, and intensity standard deviation.

[0038] Furthermore, based on a CNN network model, a heavy metal pollution detection model for mussels is constructed. Based on statistical characteristics and the mussel heavy metal pollution detection model, the methods for obtaining heavy metal pollution detection results for mussels include: To accurately determine the heavy metal pollution level of mussels, this invention introduces CNN as the core intelligent inference module. Through "automatic learning of spectral features + multi-dimensional information fusion," it overcomes the limitations of traditional machine learning, which relies on manual features and has weak anti-interference capabilities. The preprocessed spectral data is transformed into pollution level (preset level) results that conform to national standards. The specific implementation is as follows: This invention constructs a heavy metal pollution detection model for mussels based on a CNN network model. The model is logically constructed around the steps of "extracting effective features - integrating multi-source information - outputting classification results" and consists of three parts: a convolutional feature extraction layer, a feature fusion layer, and a fully connected layer.

[0039] Fs-LA-LIBS provides high-quality data for CNNs. It preserves sample integrity through non-destructive sample preparation and multi-point sampling, and is paired with a femtosecond laser (800nm ​​wavelength, 50fs pulse) and a high-resolution spectrometer (200-550nm wavelength, 0.07nm resolution) to precisely excite heavy metal characteristic peaks. After preprocessing, it outputs a "1D spectral sequence + 4D statistical features" to meet the input requirements of CNNs. Then, the CNN's convolutional layers automatically extract details such as peak shape and peak spacing from the Fs-LA-LIBS spectrum, the fusion layer integrates spectral and statistical features, and the fully connected layer maps the features to pollution levels, achieving intelligent transformation from data to results.

[0040] This invention overcomes the following technical difficulties by combining Fs-LA-LIBS with CNN: 1. Solves the sample destruction problem of traditional methods: Fs-LA-LIBS non-destructive sampling + CNN supports retesting of the same sample, replaces strong acid digestion, and reduces sample consumption by 90%.

[0041] 2. Avoids spectral line misjudgment: Fs-LA-LIBS enhances the characteristic peak signal, and CNN automatically decouples overlapping spectral lines (such as Cd-Ca overlap), eliminating the need for manual feature selection and increasing accuracy by 20%.

[0042] 3. Real-time quantitative grading is achieved: Fs-LA-LIBS completes sampling within 2 seconds, and CNN quickly outputs the contamination level, replacing the traditional 2-hour detection and meeting online requirements.

[0043] First, spectral data is acquired using an Fs-LA-LIBS device. Then, baseline correction, noise filtering, and normalization (mapping wavelength-intensity to the [0,1] interval) are performed on the data. Simultaneously, statistical features such as the number of peaks are extracted using an adaptive thresholding method. Next, only the preprocessed spectral data conforming to the 1D wavelength-intensity sequence characteristics (not the original data) is input into the convolutional feature extraction layer. Feature extraction is achieved through three stacked convolutional blocks, which are then fused with statistical features to form the composite features input to the model. Each convolutional block contains two 1D convolutional operations (kernel size 3, ensuring coverage of adjacent wavelengths to capture peak features), a ReLU activation function (introducing nonlinearity to enhance feature expressiveness), normalization (accelerating model training convergence and avoiding gradient vanishing), and max pooling (kernel size 2, compressing data dimensions while retaining key features). Through the convolutional feature extraction layer, the model can automatically identify core information such as the shape, width, and peak spacing of heavy metal feature peaks (e.g., feature peaks of Cd at 228.8nm and Pb at 405.8nm), obtaining 1024-dimensional output features. This eliminates the need for manual feature selection and solves the problem of "feature engineering relying on experience" in traditional LIBS schemes.

[0044] The feature fusion layer concatenates the 1024-dimensional output features (reflecting local spectral details) from the convolutional feature extraction layer with 4-dimensional statistical features (reflecting global spectral patterns) along the channel dimension, forming a 1028-dimensional composite feature vector. This feature fusion layer can simultaneously utilize original spectral peak shape details (such as peak position shifts and peak height differences) and global statistical patterns (such as the positive correlation between overall intensity and pollution concentration), avoiding misjudgments caused by incomplete information from a single feature dimension. Especially in complex scenarios such as Cd-Ca spectral line overlap, feature fusion can significantly improve recognition accuracy.

[0045] The fully connected layer employs a 3-layer fully connected network to construct the classifier, coupled with Dropout regularization (dropout rates of 0.3, 0.2, and 0.1 for each layer) to suppress model overfitting. The first two fully connected layers progressively compress the 1028-dimensional composite features to 256 and 128 dimensions, respectively, retaining core discriminative information. The final fully connected layer maps the 128-dimensional features to a 3-dimensional output, and uses the Softmax function to convert the 3-dimensional output into probability values ​​for each level. The level with the highest probability value is taken as the detection result for heavy metal pollution in mussels.

[0046] Furthermore, the method also includes training a heavy metal pollution detection model for mussels: Before model training, the original dataset needs to be classified. A total of 800 mussel samples with four different concentrations were collected and labeled with 0 to 3. Each label has 200 data points. The samples were divided into a training set (for model parameter learning), a validation set (for hyperparameter tuning), and a test set (for independent performance verification) according to a preset ratio (7:2:1). The heavy metal pollution detection model for mussels was trained based on the training set, validation set, and test set.

[0047] Specifically, during the training process, PCA or t-SNE is used to reduce the dimensionality of the high-dimensional spectral features of heavy metals in the mussel and visualize them: Principal component analysis (PCA) was used to visualize the high-dimensional spectral features of heavy metals in the mussel. Figure 3 , Figure 4 The results show two-dimensional and three-dimensional PCA plots. In the two-dimensional PCA plot, the first principal component (PC1) contributes 52.17% of the variance, and the second principal component (PC2) contributes 11.60% of the variance. The three-dimensional PCA plot introduces a third principal component (PC3) on top of PC1 and PC2. Data points from *Mussels* with different heavy metal pollution levels exhibit a distinguishable distribution pattern in both the two-dimensional plane (e.g., some safe-level samples are concentrated in the negative interval of PC1 and the low-to-medium interval of PC2) and three-dimensional space, effectively achieving low-dimensional characterization of high-dimensional spectral features and differentiation of pollution levels.

[0048] The high-dimensional features of heavy metal spectra in *Mussela purpurea* were visualized by dimensionality reduction using t-distributed random neighborhood embedding (t-SNE, with perplexity set to 30). Figure 5 , Figure 6These are two-dimensional and three-dimensional t-SNE plots. In the two-dimensional t-SNE plot, the data points are on the plane formed by t-SNE1 and t-SNE2, and the clustering of different pollution levels (safe level, slightly polluted level, and severely polluted level) is clear. In the three-dimensional t-SNE plot, the data points are distributed more three-dimensionally in the space formed by t-SNE1, t-SNE2, and t-SNE3.

[0049] Both types of images further verify the low-dimensional separability of the spectral features of the mussel, providing support for the effectiveness of the features in subsequent classification.

[0050] Specifically, during training, an adaptive moment estimation optimizer combined with a cosine annealing learning rate scheduling strategy is used: To ensure stable model training and convergence to the optimal state, an adaptive moment estimation (Adam) optimizer combined with a cosine annealing learning rate scheduling strategy is adopted (as shown in Figure 7). The initial learning rate is set to 0.0001, a value suitable for high-parameter models—it allows for rapid exploration of the parameter space and promotes model convergence in the early stages of training, while avoiding skipping optimal parameters due to excessively large step sizes. The learning rate decays according to a cosine curve with each training epoch (0-200 epochs), asymptotically approaching the minimum value at the 200th epoch. This strategy simulates the periodicity of trigonometric functions to achieve "efficient exploration in the early stage and fine optimization in the later stage," effectively avoiding local minima traps and balancing convergence speed and optimization accuracy.

[0051] The training loss and validation loss (as shown in Figure 8(a)) and the training accuracy and validation accuracy (as shown in Figure 8(b)) both showed a stable convergence trend. In the initial period, due to the random initialization of parameters, both the training loss and validation loss were at a relatively high level; as training progressed, both curves decreased rapidly, and the rate of decrease tended to stabilize after about 125 periods, eventually converging to a minimum value with negligible fluctuations, confirming that the model fits the training set and validation set consistently, with no obvious overfitting or underfitting.

[0052] The accuracy rate surged rapidly in the early training stage, reflecting that the model quickly mastered the pollution level classification rules through convolutional feature extraction and feature fusion. The validation accuracy improved simultaneously, indicating that the model has a preliminary generalization ability to the unseen mussel spectrum. The accuracy of the subsequent two classes stabilized at a level close to 100% (1.0), validating that the model can accurately learn the training data pattern and reliably generalize to new validation samples, ensuring the robustness of pollution level determination.

[0053] Figure 9 shows the confusion matrix of the model on the independent test set, where row labels represent the true pollution level of the samples and column labels represent the predicted level of the model. The off-diagonal elements of the confusion matrix represent the number of misclassified samples. When all off-diagonal elements are zero, the model achieves "zero error" classification. The confusion matrix analysis of the test set shows that all off-diagonal elements are zero, confirming that the model can accurately delineate the boundaries between different pollution levels without cross-class confusion. Technically, this is due to the model's ability to capture feature peak details through convolutional layers and integrate global statistical information through fusion layers, effectively suppressing the masking interference of the mussel organic matrix (such as Ca) on heavy metal feature peaks, achieving theoretically optimal classification performance under standard spectral acquisition conditions.

[0054] Specifically, during training, Gaussian noise with a signal-to-noise ratio of 20dB is injected into the test set to simulate noise interference present in actual testing. To simulate potential noise interference in actual testing (such as plasma scintillation and ambient light interference), this invention injects Gaussian noise with a signal-to-noise ratio (SNR) of 20 dB into the test set data, and then analyzes the noise through a histogram (such as...). Figure 10 The model's robustness to interference is quantified using key indicators. Figure 10 shows the sample size on the vertical axis, the mussel sample categories (0-3) on the horizontal axis, and the relative error on the upper axis. Blue bars represent the predicted sample size, and yellow bars represent the actual sample size. The results show that the model exhibits excellent resilience in the noise interference test set, with minimal deviation between the predicted and actual sample sizes for each pollution level, and a relative error of 0.05.

[0055] In summary, this invention provides a method for detecting heavy metal pollution in mussels based on CNN and femtosecond laser-induced breakdown spectroscopy: Mussels to be tested are prepared as samples and placed on a three-dimensional translation stage of an Fs-LA-LIBS spectral detection device integrating spark discharge function; based on this device, plasma is induced by focusing a femtosecond laser onto the sample surface, while simultaneously activating the device's built-in DC high-voltage power supply (10kV, 0.2A) to achieve spark discharge, reheating the plasma to enhance the characteristic spectral signals of heavy metals; then, the sample undergoes spectral acquisition and preprocessing to obtain statistical characteristics; a heavy metal pollution detection model for mussels is constructed based on a CNN network model; and based on the statistical characteristics and the heavy metal pollution detection model, the heavy metal pollution detection results for mussels are obtained. By using an embedded collaborative architecture of CNN and femtosecond laser-induced breakdown spectroscopy with spark discharge, this study solves three major technical challenges in the detection of heavy metals in mussels: sample destruction and dynamic monitoring failure caused by strong acid digestion in traditional methods; misjudgment of trace element spectral lines caused by reliance on artificial features in existing LIBS intelligent solutions; and the inability to output pollution classification in real time. This results in non-destructive, high-precision, and online quantitative detection.

[0056] This invention preserves sample integrity and supports retesting through non-destructive sample preparation and multi-point sampling, reducing sample consumption by 90%. A CNN-based model for heavy metal pollution detection in mussels automatically extracts features, eliminating reliance on manual methods and increasing spectral overlap processing accuracy by 20%. It outputs national standard pollution levels in real time, reducing detection time to 2 seconds. The combination of hardware noise reduction and algorithmic anti-interference achieves an accuracy of ≥97.6% even under 20dB noise. The integrated equipment design reduces single-test cost by 80% and is adaptable to various scenarios.

[0057] Example 2 Based on the same inventive concept, the present invention also provides a heavy metal pollution detection system for mussels based on CNN and femtosecond laser-induced breakdown spectroscopy, for implementing the method described in the foregoing embodiments. The system includes: a sample preparation module, a spectral acquisition and processing module, a model building module, and a detection module. The sample preparation module is used to prepare the mussels to be tested into samples and place them on the three-dimensional translation stage of the Fs-LA-LIBS spectral detection device. The spectral acquisition and processing module is used to acquire and preprocess the spectra of samples based on the Fs-LA-LIBS spectral detection device to obtain statistical characteristics. The model building module is used to build a heavy metal pollution detection model for mussels based on a CNN network model. The detection module is used to obtain heavy metal pollution detection results for mussels based on statistical characteristics and a heavy metal pollution detection model for mussels.

[0058] Example 3 Based on the same inventive concept, the present invention also provides an electronic device, including 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 methods described in the foregoing embodiments.

[0059] Example 4 Based on the same inventive concept, the present invention also provides a computer-readable storage medium storing a computer program that, when executed, implements the methods described in the foregoing embodiments.

[0060] The embodiments described above are merely preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Various modifications and improvements made to the technical solutions of the present invention by those skilled in the art without departing from the spirit of the present invention should fall within the protection scope defined by the claims of the present invention.

Claims

1. A method for detecting heavy metal pollution in mussels based on CNN and femtosecond laser-induced breakdown spectroscopy, characterized in that, The method is based on an Fs-LA-LIBS spectral detection device, and the method includes: The mussels to be tested were prepared into samples and placed on the three-dimensional translation stage of the Fs-LA-LIBS spectrometer. The sample was spectrally acquired and preprocessed using an Fs-LA-LIBS spectral detection device to obtain statistical characteristics. A heavy metal pollution detection model for mussels was constructed based on a CNN network model. Based on statistical characteristics and a heavy metal pollution detection model for mussels, the detection results of heavy metal pollution in mussels were obtained.

2. The method according to claim 1, characterized in that, The Fs-LA-LIBS spectral detection device includes: a femtosecond laser, a fiber optic spectrometer, a three-dimensional translation stage, and a DC high-voltage power supply; Femtosecond laser: A Ti-sapphire laser was used as the excitation source for the LIBS experiment, with a center wavelength of 800 nm, a pulse width of 50 fs, and a frequency of 1 kHz. Fiber optic spectrometer: wavelength range 200-550nm, resolution 0.07nm; 3D translation stage: driven by a stepper motor; DC high voltage power supply: voltage 10kV, current 0.2A.

3. The method according to claim 1, characterized in that, Methods for obtaining statistical characteristics of samples through spectral acquisition and preprocessing using an Fs-LA-LIBS spectrometer include: The spectral data of the sample was obtained by using a spatial multi-point sampling + time series averaging method. The spectral data is normalized to obtain preprocessed spectral data; An adaptive thresholding method was used to extract peak features from the preprocessed spectral data to obtain key indicators, including: number of peaks, mean peak intensity, and peak position deviation. The overall intensity mean and intensity standard deviation of the spectrum are calculated based on key indicators to obtain statistical characteristics, including: number of peaks, mean peak intensity, overall intensity mean, and intensity standard deviation.

4. The method according to claim 3, characterized in that, Methods for acquiring spectral data by using spatial multi-point sampling combined with time-series averaging include: The sample stage is controlled to move along the X / Y axis by a three-dimensional translation stage. Five evenly distributed detection points are selected on the sample surface to form a 3×3 grid center and vertices. The spectrum is collected three times for each detection point to avoid the influence of single-point outliers. The duration of a single spectral acquisition is set to 100ms. Plasma scintillation noise is reduced by the built-in averaging algorithm of the fiber optic spectrometer. Five sets of spectral data are output for each sample, and each set contains the average value of three repeated acquisitions.

5. The method according to claim 1, characterized in that, Methods for obtaining heavy metal pollution detection results in mussels based on statistical characteristics and heavy metal pollution detection models include: The convolutional feature extraction layer of the mussel heavy metal pollution detection model targets the 1D sequence characteristics of "wavelength-intensity" in spectral data and uses three stacked convolutional blocks to achieve feature extraction. Each convolutional block contains two 1D convolutional operations with a kernel size of 3, ReLU activation function, normalization and max pooling with a pooling kernel size of 2. Through the convolutional feature extraction layer, the shape, width and peak spacing information of heavy metal feature peaks are automatically identified to obtain 1024-dimensional output features. The feature fusion layer of the mussel heavy metal pollution detection model concatenates the 1024-dimensional output features from the convolutional feature extraction layer with the 4-dimensional statistical features by channel dimension to form a 1028-dimensional composite feature vector. The fully connected layer of the mussel heavy metal pollution detection model uses a 3-layer fully connected network to construct the classifier, and Dropout regularization is used to suppress model overfitting. The first two fully connected network layers gradually compress the 1028-dimensional composite features to 256-dimensional and 128-dimensional features, retaining the core discriminative information. The last fully connected network layer maps the 128-dimensional features to 3-dimensional output. The Softmax function is used to convert the 3-dimensional output into probability values ​​for each preset level. The level with the highest probability value is taken as the detection result of heavy metal pollution in mussels.

6. The method according to claim 1, characterized in that, The method also includes training a heavy metal pollution detection model for mussels: Data from four different concentrations of mussel samples were collected and divided into training, validation, and test sets according to a preset ratio. The heavy metal pollution detection model for mussels was trained based on the training, validation, and test sets. During training, PCA or t-SNE was used to reduce the dimensionality of the high-dimensional features of the heavy metal spectra of mussels for visualization. During training, an adaptive moment estimation optimizer combined with a cosine annealing learning rate scheduling strategy is used. During training, Gaussian noise with a signal-to-noise ratio of 20dB is injected into the test set to simulate noise interference present in actual testing.

7. A heavy metal pollution detection system for mussels based on CNN and femtosecond laser-induced breakdown spectroscopy, the system being used to implement the method described in any one of claims 1-6, characterized in that, The system includes: a sample preparation module, a spectral acquisition and processing module, a model building module, and a detection module; The sample preparation module is used to prepare the mussels to be tested into samples and place them on the three-dimensional translation stage of the Fs-LA-LIBS spectral detection device. The spectral acquisition and processing module is used to acquire and preprocess the spectra of samples based on the Fs-LA-LIBS spectral detection device to obtain statistical characteristics. The model building module is used to build a heavy metal pollution detection model for mussels based on a CNN network model. The detection module is used to obtain heavy metal pollution detection results for mussels based on statistical characteristics and a heavy metal pollution detection model for mussels.

8. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the method according to any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed, implements the method of any one of claims 1-6.