Method and device for identifying antibiotics in water by combining Raman spectrum data enhancement with multi-layer perceptron

By acquiring and enhancing Raman spectral data, and combining a multilayer perceptron model and the SHAP interpretation method, the problems of accuracy and efficiency in identifying antibiotics in water were solved, achieving high-precision identification of similar target substances and their mixtures and overcoming environmental matrix interference.

CN120948437APending Publication Date: 2025-11-14GUANGDONG INST OF ANALYSIS CHINA NAT ANALYTICAL CENT GUANGZHOU
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511056889.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-30
Publication Date
2025-11-14

AI Technical Summary

Technical Problem

Existing methods for detecting antibiotics in water using Raman spectroscopy combined with machine learning are insufficient in accurately identifying similar target substances and their mixtures, and are also affected by interference from environmental water matrix factors, resulting in insufficient identification accuracy and low efficiency.

Method used

By collecting raw Raman spectral data of dendritic silver nanoparticle Raman-enhanced substrates, performing data enhancement processing, constructing a multilayer perceptron model, simulating spectra at different matrix concentrations, and combining the SHAP interpretation method for feature selection and recognition.

Benefits of technology

It improves the accuracy and efficiency of antibiotic identification in water, effectively overcomes environmental matrix interference, and achieves high-precision antibiotic detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120948437A_ABST
    Figure CN120948437A_ABST
Patent Text Reader

Abstract

The invention relates to a method and device for recognizing antibiotics in water by combining Raman spectrum data enhancement with a multi-layer perceptron, and relates to the technical field of antibiotic detection and recognition, and the method comprises the following steps: collecting original Raman spectrums of different types of antibiotics and mixtures thereof by adopting a dendritic nano-silver Raman enhanced substrate; secondly, preprocessing an original Raman spectrum, expanding Raman spectrum data under different matrix conditions through a data enhancement method, generating an expanded spectrum data set, inputting the expanded spectrum data set into the constructed multi-layer perceptron model for model training, and forming sample key features through explanatory variables and feature selection of the SHAP processing model; and finally, inputting spectral data of to-be-identified antibiotics into the model, and identifying the antibiotics in combination with the key features of the sample. It can be seen that the sample data is expanded and enhanced through the data enhancement method, the multi-layer perceptron recognition model with high recognition precision is trained, and the method is used for recognizing antibiotics such as sulfonamide antibiotics in water and improving the recognition accuracy of antibiotic residues.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of antibiotic detection and identification technology, and in particular to a method and apparatus for identifying antibiotics in water using Raman spectroscopy data enhancement combined with a multilayer sensor. Background Technology

[0002] Raman spectroscopy is a non-destructive and rapid detection technique that can obtain the fingerprint information of target molecules. It has the characteristic of specific identification and has been applied in fields such as chemical analysis, biomedical detection and environmental monitoring.

[0003] Existing methods for detecting and identifying pollutants in water using Raman spectroscopy combined with machine learning typically only classify and identify single components or different types of targets and their mixtures, finding it difficult to classify and identify similar targets and their mixtures. Furthermore, for cases involving targets with high Raman spectral similarity, the algorithm training process overemphasizes detailed features of these similar data, neglecting the overall pattern and more discriminative features, leading to model overfitting and poor robustness. If the model training data does not adequately account for the interference of the environmental water matrix on the Raman spectra of the target targets, the accuracy of the model in practical applications will be significantly reduced.

[0004] Furthermore, building classification and detection models based on machine learning typically requires sufficient samples for model training to ensure recognition accuracy. Taking common water pollutants like ammonia nitrogen and phosphate as examples, these pollutants compete with the target analytes for adsorption on the detection substrate, thus reducing the Raman intensity of the target analytes. Simultaneously, ammonia nitrogen and phosphate themselves possess Raman activity, potentially generating Raman peaks that overlap with the target analyte's spectrum. Therefore, building a recognition algorithm model requires establishing a Raman spectrum dataset of target analytes containing varying concentrations of ammonia nitrogen and phosphate interference. However, preparing these solutions and collecting Raman spectra is extremely time-consuming and labor-intensive, and the limited number of Raman spectral samples results in low recognition accuracy for the trained model.

[0005] It is evident that existing Raman spectroscopy-based methods for detecting aquatic targets such as antibiotics are limited by the accuracy of model identification and environmental matrix interference factors, resulting in insufficient identification and detection precision and low efficiency. Summary of the Invention

[0006] This application provides a method and apparatus for identifying antibiotics in water using Raman spectroscopy data enhancement combined with multilayer perceptron (MLP). The method uses a data enhancement algorithm to augment and expand spectral data to train the MLP identification model, thereby improving the accuracy and efficiency of the model in identifying antibiotics in water. By expanding the spectral data, the method effectively simulates the spectra of the target substance under different matrix concentrations, increasing the diversity and representativeness of the sample data during model training. This overcomes the interference factors of the environmental matrix and solves the problems of insufficient accuracy and low efficiency in the existing technology for identifying antibiotics in water.

[0007] In a first aspect, this application provides a method for identifying antibiotics in water using Raman spectroscopy data enhancement combined with a multilayer sensor, comprising:

[0008] The original Raman spectra of the target antibiotics were collected from the prepared dendritic silver nanoparticle Raman-enhanced substrate. The target antibiotics included single-component antibiotics and corresponding mixtures. The single-component antibiotics included at least two types of sulfonamide antibiotics, and the mixtures were obtained by mixing at least two types of sulfonamide antibiotics.

[0009] The original Raman spectrum dataset is preprocessed, and then the preprocessed spectrum dataset is augmented using a data augmentation algorithm to obtain an expanded spectrum dataset.

[0010] Based on the expanded spectral dataset and the preprocessed spectral dataset, a sample dataset is constructed. The sample dataset is then input into the constructed multilayer perceptron model for iterative optimization training and loss function calculation until the optimal recognition model is determined and the output prediction results are obtained.

[0011] Based on the prediction results, the SHAP interpretation method is used to explain the explanatory variables and feature selection of the model, and to construct the key features of the samples.

[0012] Raman spectra of the antibiotics to be identified collected from the water body are input into the optimal identification model for feature extraction. The extracted features are then combined with key features of the sample to identify the antibiotics, and the antibiotic identification results are obtained.

[0013] Among them, the multilayer perceptron model is a perceptron recognition model constructed based on the multilayer perceptron algorithm of the neural network model, and the expanded spectral dataset includes spectra of antibiotics collected under simulated matrix concentrations.

[0014] Optionally, the original Raman spectral dataset is preprocessed, and then augmented using a data augmentation algorithm to obtain an augmented spectral dataset, including:

[0015] The original Raman spectral dataset was subjected to background subtraction, Raman shift clipping, baseline processing, smoothing filtering, and normalization in sequence to obtain the preprocessed spectral dataset.

[0016] The GKIM data augmentation algorithm is introduced to analyze the feature importance of each spectral data feature in the preprocessed spectral dataset and determine the number of samples for data augmentation.

[0017] Based on the preprocessed spectral dataset, an extended spectral dataset is generated by fitting the Raman spectra of the current category according to the number of samples.

[0018] Different categories of labels were assigned to the preprocessed spectral dataset and the augmented spectral dataset, respectively.

[0019] Optionally, the GKIM data augmentation algorithm is introduced to analyze the feature importance of each spectral data feature in the preprocessed spectral dataset and determine the number of samples for data augmentation, including:

[0020] Input the spectral data features of the preprocessed spectral dataset, calculate the Fisher score using the GKIM Gaussian kernel function, and determine the feature importance using the Fisher score;

[0021] The data augmentation process is then sorted according to feature importance, and based on the sorting results, the data augmentation process is focused on the specific features of the classification task, and the number of data augmentation samples is determined.

[0022] Optionally, based on the preprocessed spectral dataset, an extended spectral dataset is generated by fitting Raman spectra of the current category according to the number of samples, including:

[0023] Based on the number of samples and the data augmentation requirements of the analysis, a new sample dataset is generated by fitting the preprocessed Raman spectral data of the current category with a Gaussian kernel function. The new sample dataset contains augmented spectral data.

[0024] Based on the preprocessed spectral dataset, target augmented spectral data are selected from the new sample dataset to construct an augmented spectral dataset.

[0025] Optionally, based on the number of samples and the data augmentation requirements of the analysis, a new sample dataset can be generated by fitting the preprocessed Raman spectra of the current category's spectral dataset with a Gaussian kernel function, including:

[0026] The characteristics and requirements of different spectral data in the preprocessed spectral dataset are analyzed in order to adjust the bandwidth parameter of the Gaussian kernel function.

[0027] Based on the number of samples, the Raman spectra of each sample in the preprocessed spectral dataset of the current category are fitted with the bandwidth parameter to generate a new sample dataset.

[0028] Optionally, based on the preprocessed spectral dataset, target augmented spectral data are selected from the new sample dataset to construct an augmented spectral dataset, including:

[0029] By using the Euclidean distance formula, the distance between each augmented spectral data and each spectral data in the corresponding preprocessed spectral dataset is analyzed, and the distance analysis results between different categories of spectral data are obtained.

[0030] Based on the distance analysis results, a fuzzy nearest neighbor selection mechanism is adopted to select the top K nearest neighbor samples from each augmented spectral data.

[0031] Calculate the mean of the K nearest neighbor samples as the representative distance;

[0032] Based on the representative distance, target extended spectral data are selected from each extended spectral data to construct an extended spectral dataset.

[0033] Optionally, the sample dataset is input into the constructed multilayer perceptron model for iterative optimization training and loss function calculation until the optimal recognition model is determined, and the output prediction results are obtained, including:

[0034] When training the multilayer perceptron model using a sample dataset, iterative optimization is performed using a stochastic gradient descent method.

[0035] By using a dynamic learning rate to accelerate the convergence process of the loss function, the model is iteratively trained until the loss function no longer decreases, thus obtaining the best trained recognition model and acquiring the prediction results output by the model.

[0036] Optionally, after obtaining the augmented spectral dataset, the following may also be included:

[0037] Based on the preprocessed spectral dataset, dimensionality reduction was performed using principal component analysis, and a first analysis plot was plotted based on the dimensionality-reduced data before data augmentation. The first analysis plot was used to analyze the distribution of the original Raman spectral data.

[0038] Based on the augmented spectral dataset, dimensionality reduction was performed using principal component analysis, and a second analysis plot was plotted after data augmentation. The second analysis plot was used to analyze the distribution of the augmented Raman spectral data.

[0039] Based on the first and second analysis plots, the impact of different data augmentation parameters on the sample distribution is analyzed, and the data augmentation parameters are optimized during dataset augmentation processing.

[0040] Secondly, this application provides a device for identifying antibiotics in water using Raman spectroscopy data enhancement combined with a multilayer sensor, comprising:

[0041] The Raman spectroscopy data acquisition module is used to acquire the raw Raman spectral dataset of the target antibiotic from the prepared dendritic nanosilver Raman-enhanced substrate. The target antibiotic types include single-component antibiotics and corresponding mixtures. The single-component antibiotics include at least two types of sulfonamide antibiotics, and the mixtures are obtained by mixing at least two types of sulfonamide antibiotics.

[0042] The dataset augmentation module is used to preprocess the original Raman spectrum dataset and then use data augmentation algorithms to augment the preprocessed spectrum dataset to obtain an expanded spectrum dataset.

[0043] The model training and optimization module is used to construct a sample dataset based on the extended spectral dataset, input the sample dataset into the constructed multilayer perceptron model for iterative optimization training of the model and calculation of the loss function until the optimal recognition model is determined and the output prediction results are obtained.

[0044] The feature sample construction module is used to interpret the explanatory variables and feature selection of the model based on the prediction results using the SHAP interpretation method, and to construct key features of the samples.

[0045] The antibiotic identification module is used to input the Raman spectra of the collected antibiotics to be identified into the optimal identification model for feature extraction, and to combine the extracted features with the key features of the sample to identify the antibiotics and obtain the antibiotic identification results. Among them, the multilayer perceptron model is a perceptron identification model constructed based on the multilayer perceptron algorithm of the neural network model, and the expanded spectral dataset includes spectra of antibiotics collected under simulated matrix concentrations.

[0046] In summary, this application first uses a dendritic nanosilver Raman-enhanced substrate to collect raw Raman spectra of various monocular antibiotics and their mixtures. Then, the raw Raman spectra are preprocessed, and data augmentation methods are used to augment Raman spectral data under different matrix conditions, forming an augmented spectral dataset to simulate the spectra of antibiotics collected at different matrix concentrations. The augmented spectral dataset and the preprocessed spectral dataset are used as training samples and input into a constructed multilayer perceptron model for model training. The optimal recognition model is obtained through iterative optimization training and loss function calculation. SHAP is used to process the explanatory variables and feature selection of the model, forming key features of the samples. Finally, the spectral data of the antibiotic to be identified is input into the model, and antibiotic identification is performed in conjunction with the key features of the samples. It is evident that this application, by augmenting sample data through data augmentation methods, can, on the one hand, train a multilayer perceptron recognition model with high recognition accuracy; on the other hand, it can simulate spectra at different matrix concentrations, accurately reflecting the matrix conditions in the real environment, thereby avoiding interference from the environmental matrix when identifying antibiotics such as sulfonamides in water, thus improving the accuracy and efficiency of antibiotic residue identification. Attached Figure Description

[0047] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0048] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0049] Figure 1 A flowchart illustrating a method for identifying antibiotics in water using Raman spectroscopy data enhancement combined with a multilayer sensor, provided in this application embodiment;

[0050] Figure 2 This is a flowchart illustrating the steps of a method for identifying antibiotics in water using Raman spectroscopy data enhancement combined with a multilayer sensor, provided in an optional embodiment of this application.

[0051] Figure 3 This is a flowchart illustrating the establishment of a Raman spectroscopy identification model for sulfonamide antibiotics in water, as provided in this application.

[0052] Figure 4 This is a confusion matrix diagram of a neural network algorithm model of a multilayer perceptron provided in an example of this application;

[0053] Figure 5 This is a performance comparison chart of MLP models built on different datasets provided in this application;

[0054] Figure 6 This is an example of a SHAP explanation feature importance distribution diagram provided in this application;

[0055] Figure 7 This is a schematic diagram of the functional modules of a detection and identification software provided in an embodiment of this application. Detailed Implementation

[0056] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0057] To facilitate understanding of the embodiments of this application, further explanations and descriptions will be provided below in conjunction with the accompanying drawings and specific embodiments. These embodiments do not constitute a limitation on the embodiments of this application.

[0058] Figure 1 This is a schematic flowchart illustrating a method for identifying antibiotics in water using Raman spectroscopy data enhancement combined with a multilayer sensor, as provided in an embodiment of this application. Figure 1 As shown in the embodiments of this application, the method for identifying antibiotics in water using Raman spectroscopy data enhancement combined with multilayer sensor may specifically include the following steps:

[0059] Step 110: Collect the raw Raman spectra of the target antibiotic from the prepared dendritic silver nanoparticle Raman-enhanced substrate.

[0060] The target antibiotics include single-component antibiotics and corresponding mixtures. The single-component antibiotics include at least two types of sulfonamide antibiotics, and the mixtures are obtained by mixing at least two types of sulfonamide antibiotics.

[0061] In this embodiment, there are two main types of target substances: single-component antibiotics and mixtures composed of different (two or more) single-component antibiotics.

[0062] Taking sulfonamide antibiotics as an example, the target antibiotics mainly include five types: sulfadiazine (SD), sulfapyridine (SP), sulfamethoxazole (SMZ), sulfisoxazole (SIZ), and sulfathiazole (ST). At least two sulfonamide antibiotics can be randomly selected as single-component antibiotics; preferably, all five sulfonamide antibiotics can be selected as single-component antibiotics. Mixtures of the five sulfonamide antibiotics include binary mixtures (obtained by mixing two sulfonamide antibiotics), ternary mixtures, quaternary mixtures, and pentagonal mixtures. Therefore, sulfonamide antibiotics and their corresponding mixtures are used as target antibiotics.

[0063] Dendritic silver nanoparticle Raman-enhancing substrates are pre-prepared. Raw Raman spectral data of each class of sulfonamide antibiotics are collected using Raman spectroscopy acquisition equipment (such as a Raman spectrometer). Raw Raman spectral data of mixtures containing different classes of sulfonamide antibiotics are also collected using the substrate, ultimately forming a raw Raman spectral dataset of the target antibiotic.

[0064] Step 120: Preprocess the original Raman spectral dataset, and then perform data augmentation on the preprocessed spectral dataset using a data augmentation algorithm to obtain an expanded spectral dataset.

[0065] The expanded spectral dataset includes spectra of antibiotics collected at different matrix concentrations.

[0066] In this embodiment, each acquired raw Raman spectral data is first subjected to multiple preprocessing steps to obtain a preprocessed spectral dataset. This preprocessed spectral dataset contains preprocessed Raman spectral data from each raw Raman spectral data. Then, an enhancement algorithm is used to perform data enhancement processing on each preprocessed Raman spectral data to expand the data sample and simulate the spectra of antibiotics acquired at different matrix concentrations. This expanded spectral data serves as the final expanded spectral dataset.

[0067] In practical implementation, various types of data augmentation algorithms can be used to augment Raman spectral data. Preferably, this embodiment uses the GKIM data augmentation algorithm to augment the preprocessed Raman spectral data. Specifically, the preprocessed Raman spectral data is used as input data, and data augmentation is performed using the Gaussian kernel function in the GKIM data augmentation algorithm to increase the diversity of the spectral data and obtain an expanded spectral dataset.

[0068] Therefore, this application introduces a data augmentation algorithm to enrich the spectral dataset. By expanding the limited collected data through the data augmentation algorithm, Raman spectral data containing different concentrations of interfering matrices in a simulated real environment are generated. This eliminates the need for cumbersome data collection processes for various actual samples, thereby improving the efficiency of subsequent model training and antibiotic identification.

[0069] Step 130: Based on the expanded spectral dataset and the preprocessed spectral dataset, construct a sample dataset, input the sample dataset into the constructed multilayer perceptron model for iterative optimization training of the model and calculate the loss function until the optimal recognition model is determined and the output prediction results are obtained.

[0070] Among them, the multilayer perceptron model is a perceptron recognition model constructed based on the multilayer perceptron algorithm of the neural network model.

[0071] In this embodiment, the expanded spectral dataset and the preprocessed spectral dataset are first used as training samples. Specifically, the order of each spectral dataset is shuffled using a random permutation function (np.random.permutation), and the data is then divided into a training set, a validation set, and a test set to construct a sample dataset. The training and validation sets account for 80%, and the test set accounts for 20%. During training, 15% of the training set is selected as the validation set to verify the accuracy and loss rate of the model training process.

[0072] Then, a multilayer perceptron algorithm based on a neural network model is established to construct a multilayer perceptron (MLP) model (also known as a multilayer perceptron recognition model) for the identification of antibiotics in water bodies. When constructing the MLP model, the identification can be based on the type of antibiotic being identified, such as using the spectra of various sulfonamide antibiotics to build a multilayer perceptron recognition model for sulfonamide antibiotics. This model can identify multiple sulfonamide antibiotics.

[0073] Model training is performed using a sample dataset. Specifically, in the multilayer perceptron model, training is conducted based on the input training set. During training, the model is iteratively optimized, and the loss function and learning rate are calculated until training is complete. During training, the model's prediction results are validated using a validation set to determine accuracy and loss rate, thereby continuously optimizing model parameters. After training, the model is tested using a test set. Finally, the model with the highest validated recognition accuracy is determined as the optimal recognition model. The prediction results of the model's inputs are then obtained.

[0074] Step 140: Based on the prediction results, use the SHAP interpretation method to interpret the explanatory variables and feature selection of the model, and construct the key features of the sample.

[0075] In this embodiment, the prediction results include feature data obtained by feature extraction from different categories of input spectral data. Using the prediction results, the SHAP analytical model can be used to distinguish the selected features from different categories of spectral data, proving the model's rationality and constructing key sample features. These key sample features can then be used to assist in identifying the types of antibiotics in the water.

[0076] Step 150: Input the Raman spectrum of the antibiotic to be identified collected in the water into the optimal identification model for feature extraction, and combine the extracted features with the key features of the sample to identify the antibiotic, and obtain the antibiotic identification result.

[0077] In practice, Raman spectral data is collected from the water body under test using a Raman spectroscopy acquisition device. This Raman spectral data represents the Raman spectrum of the antibiotic to be identified. The Raman spectrum is then input into the optimal identification model, which extracts features from the input Raman spectrum and outputs a prediction result. Finally, the prediction result is compared with the key features of the sample to identify the specific antibiotic, thus obtaining the antibiotic identification result.

[0078] As can be seen, the embodiments of this application acquire sample data through a surface-enhanced Raman substrate and use the GKIM data enhancement method to enhance the data, thereby expanding the data and increasing the diversity of spectral data. Then, based on the enhanced data, a multilayer perceptron algorithm recognition model is established. By training the model and optimizing the hyperparameters, the optimal recognition model is obtained to achieve high-accuracy recognition of multiple antibiotics in water.

[0079] Reference Figure 2 This diagram illustrates a step-by-step flowchart of a method for identifying antibiotics in water using Raman spectroscopy data enhancement combined with a multilayer sensor, according to an optional embodiment of this application. Specifically, this method for identifying antibiotics in water using Raman spectroscopy data enhancement combined with a multilayer sensor may include the following steps:

[0080] Step 210: Collect the raw Raman spectra of the target antibiotic from the prepared dendritic silver nanoparticle Raman-enhanced substrate.

[0081] The target antibiotics include single-component antibiotics and corresponding mixtures. The single-component antibiotics include at least two types of sulfonamide antibiotics, and the mixtures are obtained by mixing at least two types of sulfonamide antibiotics.

[0082] Reference Figure 3 As an example, the identification of five sulfonamide antibiotics—sulfadiazine, sulfapyridine, sulfamethoxazole, sulfisoxazole, and sulfathiazole—is used for specific illustration. Raman spectroscopy data were acquired using a dendritic silver nanoparticle Raman-enhanced substrate and a 785 nm laser Raman spectrometer. Forty different points were randomly selected from each detection substrate to collect Raman spectral data, forming raw Raman spectral datasets for single-component targets and mixtures. The collected sample and data information are shown in Table 1 below.

[0083] Table 1. Sulfonamide Antibiotic Database

[0084]

[0085] Step 220: The original Raman spectral dataset is subjected to background subtraction, Raman shift clipping, baseline processing, smoothing filtering, and normalization in sequence to obtain the preprocessed spectral dataset.

[0086] In this specific implementation, each Raman spectral data undergoes background subtraction, shift clipping, Airpls baseline processing, Whittaker smoothing filtering, and normalization to establish a preprocessed spectral dataset.

[0087] Step 230: The GKIM data augmentation algorithm is introduced to analyze the feature importance of each spectral data feature in the preprocessed spectral dataset and determine the number of samples for data augmentation.

[0088] In this embodiment, the GKIM data augmentation algorithm is mainly used to augment the spectral data. First, the GKIM data augmentation function (GKIM_generate_samples) is defined. This function determines the number of samples to be augmented by analyzing the importance of each spectral data feature and sorting them.

[0089] Optionally, this embodiment introduces the GKIM data augmentation algorithm to analyze the feature importance of each spectral data feature in the preprocessed spectral dataset and determine the number of data augmentation samples. Specifically, it may include: taking each spectral data feature of the preprocessed spectral dataset as input, using the GKIM Gaussian kernel function to calculate the Fisher score, and determining the feature importance through the Fisher score; sorting according to feature importance, and based on the sorting result, focusing the data augmentation process on the specific features of the classification task, and determining the number of data augmentation samples.

[0090] In the implementation, the `generate_samples` function calculates Fisher scores, which then guide the ranking of data features. Features ranked higher have higher weights during data augmentation, prioritizing features that significantly contribute to classification. By dynamically adjusting feature importance, the data augmentation process focuses on features helpful for the classification task—i.e., specific features—resulting in new samples with greater diversity, realism, and representativeness. During model training, this effectively improves the model's generalization ability, predictive performance, and classification recognition capabilities.

[0091] Step 240: Using the preprocessed spectral dataset as a benchmark, fit the Raman spectra of the current category according to the number of samples to generate an extended spectral dataset.

[0092] Different categories of labels were assigned to the preprocessed spectral dataset and the augmented spectral dataset, respectively. The augmented spectral dataset included spectra of antibiotics collected at different matrix concentrations after data augmentation processing using spectral data augmentation techniques.

[0093] Reference Figure 3 In its implementation, GKIM fits the data for the current category and generates new samples to construct an augmented spectral dataset. When generating new samples, a Gaussian kernel function (KDE) is used to fit the data for the current category, and then the optimal sample is selected from the newly generated samples as the augmented spectral data.

[0094] In practical implementation, the path of the original Raman spectroscopy dataset and the path of the data augmentation output can also be specified, and labels can be assigned to different categories of data to distinguish different spectral data, which can be used as labels for subsequent model training and to facilitate subsequent dimensionality reduction comparison.

[0095] In related technologies, some technical solutions propose conventional data augmentation methods and the SMOTE method for data augmentation. As a comparison of different data augmentation methods, this embodiment compares and tests the conventional data augmentation method, the SMOTE method, and the GKIM data augmentation method under the same conditions.

[0096] For conventional data augmentation methods, new spectral data is generated by modifying the intensity of the original spectrum during data augmentation. Specifically, firstly, a random constant is introduced to change the spectral intensity. Then, a spectral shift is performed. Finally, Gaussian noise is added to the shifted spectrum to generate new spectral data. A recognition model is built using the new spectral data. The recognition results of this model for aquaculture wastewater are shown in Table 2. Experiments show that the model makes errors in recognizing the spectra of trivalent and quaternary antibiotic mixtures in aquaculture wastewater, with an overall accuracy of only 60%.

[0097] Table 2 Validating the accuracy of conventional data augmentation methods models

[0098]

[0099] For the SMOTE method, a sampling strategy is set to determine the number of new synthetic samples generated for each original sample. Synthetic samples are then generated, with a fixed random seed during data augmentation. The augmented data is used to build a recognition model under the same conditions. The recognition results of this model for lake water samples are shown in Table 3. Experiments show that the model makes errors in recognizing the spectra of tri- and quaternary antibiotic mixtures in aquaculture wastewater, with an overall accuracy of only 60%.

[0100] Table 3. Verification of the accuracy of conventional data augmentation methods models

[0101]

[0102] As can be seen from the data in Tables 2 and 3 above, existing data enhancement methods are difficult to generate Raman spectral data that closely resemble the real environment. They suffer from problems such as uneven data distribution, high randomness, and difficulty in accurately reflecting the matrix in the real environment.

[0103] To address the technical problems of existing spectral data augmentation methods, this embodiment proposes the GKIM method to effectively expand Raman spectral data. By calculating Fisher scores to rank features, features that significantly contribute to classification are prioritized during data generation, ensuring that key features are preserved during the data augmentation process, thereby improving the accuracy of the classification model. New samples dynamically generated using GKIM can more accurately reflect the true distribution of the data. By selecting multiple nearest-neighbor samples and calculating their mean as representatives of the new samples, not only is the local structural information of the original data preserved, but the diversity and representativeness of the new samples are also increased, effectively avoiding the problem of generated samples being too concentrated or deviating from the original data distribution. Furthermore, expanding the samples through data augmentation increases the number and diversity of samples, enabling the training of models with high recognition accuracy. The model's recognition accuracy for single targets or multiple mixed targets is above 90% (this embodiment will not elaborate on this aspect). On the other hand, the expanded samples can simulate spectra of different matrix concentrations, accurately reflecting the matrix conditions in the real environment. This eliminates the need for cumbersome solution concentration adjustments to obtain spectral samples of different matrix concentrations, reducing resource efficiency.

[0104] Optionally, the above process of using the preprocessed spectral dataset as a benchmark to fit the Raman spectra of the current category based on the number of samples to generate an expanded spectral dataset may include the following sub-steps:

[0105] Sub-step 2401: Based on the number of samples and the data augmentation requirements of the analysis, fit the Raman spectral data of each preprocessed spectral dataset of the current category with a Gaussian kernel function to generate a new sample dataset containing augmented spectral data.

[0106] Sub-step 2402: Based on the preprocessed spectral dataset, select target augmented spectral data from the new sample dataset to construct the augmented spectral dataset.

[0107] A unified description is provided for sub-steps 2401 and 2402:

[0108] In its implementation, GKIM data augmentation offers excellent flexibility and scalability. Augmentation requirements can be determined based on the characteristics and needs of different categories of spectral datasets (such as the need for identification analysis). Then, based on the number of samples and the augmentation requirements, the bandwidth of the Gaussian kernel function is determined. Within the corresponding bandwidth, the Gaussian kernel function is fitted to the spectral data of the current category to generate new samples. Each new sample is augmented spectral data, ultimately forming a new sample dataset.

[0109] Then, the distance between the new sample and the original sample is calculated using the Euclidean distance formula, that is, the distance between each preprocessed Raman spectral data and the corresponding expanded spectral data. Based on the distance, the top 5-20 nearest neighbor samples of each new sample are selected, and their mean is calculated as the representative of the new sample. Finally, the generated new samples and their labels are merged and returned to obtain the expanded spectral dataset.

[0110] Optionally, in this embodiment of the application, based on the number of samples and the analysis of dataset enhancement requirements, a new sample dataset is generated by fitting each Raman spectral data in the preprocessed spectral dataset of the current category with a Gaussian kernel function. Specifically, this may include: analyzing the characteristics and requirements of different spectral data in the preprocessed spectral dataset to adjust the bandwidth parameter of the Gaussian kernel function; and fitting each Raman spectral data in the preprocessed spectral dataset of the current category with the bandwidth parameter based on the number of samples to generate a new sample dataset.

[0111] In practical implementation, the bandwidth and other parameters of the Gaussian kernel can be flexibly adjusted according to the characteristics and requirements of different datasets, thereby flexibly controlling the degree and details of data augmentation to adapt to various complex data distributions. Preferably, this embodiment can perform Gaussian kernel function fitting with a bandwidth setting range of 5000-1000000.

[0112] It is evident that the GKIM data augmentation method can generate samples based on the distribution characteristics of the original data, effectively simulate the spectra of different matrix concentrations, and adaptively adjust the generation location and number of samples according to the local density and global distribution characteristics of the data, thereby generating new samples that are more consistent with the distribution of the original data, more diverse and representative, and effectively avoiding the over-concentration or deviation of the generated samples.

[0113] In one optional embodiment, using the preprocessed spectral dataset as a benchmark, target extended spectral data is selected from the new sample dataset to construct an extended spectral dataset. Specifically, this may include: analyzing the distance between each extended spectral data and each spectral data in the corresponding preprocessed spectral dataset using the Euclidean distance formula to obtain distance analysis results between different categories of spectral data; based on the distance analysis results, using a fuzzy nearest neighbor selection mechanism, selecting the top K nearest neighbor samples from each extended spectral data; calculating the mean of the K nearest neighbor samples as the representative distance; and based on the representative distance, selecting target extended spectral data from each extended spectral data to construct an extended spectral dataset.

[0114] In the specific implementation, after generating new samples using a Gaussian kernel function, a fuzzy nearest neighbor selection mechanism is employed. By calculating the Euclidean distance between the new sample and the original samples, the top K nearest neighbor samples of each new sample are selected (K is typically set to 5 to 20). Next, the mean of these K neighbor samples is calculated as a representative of the new sample, and the data distribution of the new sample is adjusted based on these representative samples, ultimately obtaining the expanded spectral dataset.

[0115] As can be seen, the GKIM data augmentation method in this embodiment introduces a fuzzy nearest neighbor selection mechanism. By calculating the mean of multiple nearest neighbor samples as a representative of the new sample, it not only preserves the local structural information of the original data, but also increases the diversity and representativeness of the new sample, further improving the sensitivity and reproducibility of the data.

[0116] Furthermore, this embodiment can also compare the augmented spectral data with the original spectral data to analyze the impact of the data augmentation algorithm on the sample distribution under different data augmentation parameters during spectral enhancement.

[0117] Optionally, after obtaining the expanded spectral dataset, the embodiments of this application may further include: performing dimensionality reduction using principal component analysis based on the preprocessed spectral dataset, and drawing a first analysis plot before data augmentation based on the dimensionality-reduced data, the first analysis plot being used to analyze the distribution of the original Raman spectral data; performing dimensionality reduction using principal component analysis based on the expanded spectral dataset, and drawing a second analysis plot after data augmentation, the second analysis plot being used to analyze the distribution of the augmented Raman spectral data; and analyzing the influence of different data augmentation parameters on the sample distribution based on the first and second analysis plots, and optimizing the data augmentation parameters during dataset augmentation processing.

[0118] Specifically, principal component analysis (PCA) was used to reduce the dimensionality of the corresponding raw Raman spectral data (preprocessed Raman spectral data was used since it had already been preprocessed) and the corresponding augmented spectral data, respectively, and PCA analysis plots were generated for visualization. Then, the two PCA analysis plots were compared, and the data augmentation parameters were optimized based on the comparison results.

[0119] Therefore, this application introduces a Gaussian kernel function for data augmentation. On the one hand, this data augmentation method can adaptively generate new synthetic samples based on the distribution characteristics of the data, enriching the diversity of the dataset and enhancing the model's ability to recognize different data patterns. On the other hand, this data augmentation method also has good flexibility and scalability. It can flexibly control the degree and details of data augmentation by adjusting data augmentation-related parameters such as the bandwidth of the Gaussian kernel according to the characteristics and needs of different datasets, so as to adapt to various complex data distributions. At the same time, this method also has advantages in computational efficiency. Its calculation process is relatively simple and easy to implement, and it can complete the data augmentation task of large-scale datasets in a short time, providing strong support for subsequent machine learning model training and improving data processing efficiency.

[0120] Finally, the augmented data generated by GKIM data augmentation has better diversity and realism. Using this data to train the model can effectively improve the model's generalization ability and prediction performance.

[0121] Step 250: Based on the expanded spectral dataset and the preprocessed spectral dataset, construct a sample dataset, input the sample dataset into the constructed multilayer perceptron model for iterative optimization of the model and training of the loss function until the optimal recognition model is determined, and obtain the output prediction results.

[0122] Among them, the multilayer perceptron model is a perceptron recognition model constructed based on the multilayer perceptron algorithm of the neural network model.

[0123] In this specific implementation, the sample dataset is input into the constructed multilayer perceptron model for iterative optimization and loss function training until the optimal recognition model is determined and the output prediction result is obtained. Specifically, it may include: when the multilayer perceptron model is trained using the sample dataset, iterative optimization is performed using a stochastic gradient descent device; the convergence process of the loss function is accelerated by using a dynamic learning rate; the model is iteratively trained until the loss function no longer decreases, thus obtaining the trained optimal recognition model and obtaining the prediction result output by the model.

[0124] Reference Figure 3 ,as well as, Figure 4 The model confusion matrix is ​​shown. First, the model structure of the multilayer perceptron model constructed in this embodiment will be explained:

[0125] In this embodiment, the multilayer perceptron model adopts a decreasing layer width MLP architecture. Its input layer has 1351 neurons, corresponding to the 1351 features of the processed spectrogram. The number of hidden layers and neurons is determined by a grid search procedure performed on the training and validation sets, resulting in a total of 6 layers. The number of neurons in each hidden layer is 1100, 900, 700, 500, 300, and 100, respectively. The activation function for all hidden layers is ReLU, with L2 regularization applied to their weights. The output layer has 31 neurons corresponding to the 31 categories, and its activation function is SOFTMAX.

[0126] The model uses a stochastic gradient descent (SGD) optimizer for iterative optimization. The SGD parameter settings select categorical cross-entropy as the loss function, and the learning rate employs an inverse time decay strategy with an initial learning rate of 0.01. Specifically, the decay rate (Decay_Rate) is set to 1, and the number of decay steps (Decay_Steps) is defined as Steps_Per_Epoch * 50. Steps_Per_Epoch is calculated by dividing the total number of training samples (x_train_tensor_list) by the batch size (Batch_size), which is fixed at 20. During training, the batch size is 20, and the total number of iterations (Epochs) is set between 200 and 500, preferably 200.

[0127] Furthermore, a 5-fold cross-validation mechanism is employed during training, involving multiple partitions of the original training set and independent training. After training, the model's performance is comprehensively evaluated using accuracy, precision, loss rate, ROC curve, and confusion matrix. During iteration, the optimized multilayer perceptron neural network algorithm model is obtained when the loss function no longer decreases. (Refer to...) Figure 4 The confusion matrix shown indicates that, in the 31-class classification task, the recognition accuracy of 31 classes reached 100%, and the classification effect can reach at least 94%.

[0128] Reference Figure 5 As shown, the model trained on the data augmented with data exhibits accuracy, precision, 5-fold cross-validation, F1 score, and AUC all exceeding 99%. This provides a direct comparison of the performance of MLP models built on different datasets.

[0129] Step 260: Based on the prediction results, use the SHAP interpretation method to explain the explanatory variables and feature selection of the model, and construct the key features of the sample.

[0130] In the specific implementation, SHAP was used to explain the explanatory variables and feature selection of the model. Figure 6 The SHAP beehive diagram shown illustrates the top 10 features contributing most to the target category and their respective contributions. The features extracted by the model match the characteristic peaks of the target analyte, demonstrating the reliability of the model's spectral identification of the target analyte. By interpreting the model's variables and feature selection, SHAP can construct key sample features for antibiotic identification and classification.

[0131] In practice, SHAP analysis reveals that the features selected by the model correspond to the feature peaks of the target category, indicating that the model can accurately capture the unique spectral features of different categories, further validating the rationality of the model's feature selection.

[0132] Finally, the model was applied to identify antibiotics in lake water, river water, and aquaculture wastewater, achieving a positive sample identification accuracy of 93%. The solution provided in this application enables accurate identification of similar antibiotics and their mixtures using Raman spectroscopy, broadening the application scenarios for Raman spectroscopy in antibiotic detection and identification. This application provides a new technical solution for Raman spectroscopy data enhancement and identification models to accurately identify multiple targets of the same type in complex matrix samples.

[0133] Step 270: Input the Raman spectrum of the antibiotic to be identified collected in the water into the optimal identification model for feature extraction, and combine the extracted features with the key features of the sample to identify the antibiotic and obtain the antibiotic identification result.

[0134] As a practical example, this embodiment selects 12 samples from actual river water, lake water, and aquaculture water. Six of these samples are designated as positive samples, and six target compounds—ST-SP-SMZ, SD-SP-SMZ, SD-ST, SMZ-SP-ST-SD, SMZ-ST, and SMZ-SP-ST-SD-SIZ—are added to each sample. The order of all samples is shuffled. Surface-enhanced Raman spectroscopy is used to acquire spectral data, and a model is used to identify the samples. LC-MS detection is then used to verify the model identification results. The model identification verification results are shown in Table 4 below.

[0135] Table 4. Verification of the accuracy of classification for different types of water bodies

[0136]

[0137] Based on the verification results in Table 4, it can be seen that the model trained in this embodiment can accurately identify the types of antibiotics in water using Raman spectroscopy. The model in this embodiment can identify one or more antibiotic residues, such as sulfadiazine, sulfapyridine, sulfathiazole, sulfamethoxazole, and sulfisoxazole, in actual water samples with an accuracy rate of 93%.

[0138] In summary, this application combines Raman spectroscopy data enhancement and a multilayer perceptron method for identifying antibiotics in water. First, regarding Raman spectroscopy data enhancement, the GKIM data augmentation algorithm is introduced. This algorithm prioritizes features that significantly contribute to classification during data generation, ensuring that key features are preserved during the data augmentation process, thereby improving the accuracy of the classification model. Dynamically generated new samples more accurately reflect the true distribution of the data. By selecting multiple nearest-neighbor samples and calculating their mean as representatives of the new samples, not only is the local structural information of the original data preserved, but the diversity and representativeness of the new samples are also increased, effectively avoiding the problem of generated samples being too concentrated or deviating from the original data distribution. Then, a multilayer perceptron model is introduced. The augmented data is used to train the model, improving its classification and recognition capabilities. SHAP is used to explain the explanatory variables and feature selection of the model. The SHAP beehive diagram shows the top 10 features that contribute the most to the target category and their contributions. The features selected by the model correspond to the feature peaks of the target category, indicating that the model can accurately capture the unique spectral features of different categories, further validating the rationality of the model's feature selection. Finally, the model was applied to the identification of spiked antibiotics in water, achieving an accuracy rate of 93%. It is evident that this embodiment enables the accurate identification of similar antibiotics and their mixtures using Raman spectroscopy, broadening the application scenarios for Raman spectroscopy in antibiotic detection and identification. This embodiment provides a new technical solution for Raman spectroscopy data enhancement and identification models to accurately identify multiple targets of the same type in complex matrix samples.

[0139] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of actions. However, those skilled in the art should know that the embodiments of this application are not limited to the described order of actions, because according to the embodiments of this application, some steps may be performed in other orders or simultaneously.

[0140] In a specific implementation, this application also provides a device for identifying antibiotics in water using Raman spectroscopy data enhancement combined with a multilayer sensor, comprising:

[0141] The Raman spectroscopy data acquisition module is used to acquire the raw Raman spectral dataset of the target antibiotic from the prepared dendritic nanosilver Raman-enhanced substrate. The target antibiotic types include single-component antibiotics and corresponding mixtures. The single-component antibiotics include at least two types of sulfonamide antibiotics, and the mixtures are obtained by mixing at least two types of sulfonamide antibiotics.

[0142] The dataset augmentation module is used to preprocess the original Raman spectrum dataset and then use data augmentation algorithms to augment the preprocessed spectrum dataset to obtain an expanded spectrum dataset.

[0143] The model training and optimization module is used to construct a sample dataset based on the extended spectral dataset, input the sample dataset into the constructed multilayer perceptron model for iterative optimization training of the model and calculation of the loss function until the optimal recognition model is determined and the output prediction results are obtained.

[0144] The feature sample construction module is used to interpret the explanatory variables and feature selection of the model based on the prediction results using the SHAP interpretation method, and to construct key features of the samples.

[0145] The antibiotic identification module is used to input the Raman spectra of the collected antibiotics to be identified into the optimal identification model for feature extraction, and to combine the extracted features with the key features of the sample to identify the antibiotics and obtain the antibiotic identification results. Among them, the multilayer perceptron model is a perceptron identification model constructed based on the multilayer perceptron algorithm of the neural network model, and the expanded spectral dataset includes spectra of antibiotics collected under simulated matrix concentrations.

[0146] It should be noted that the device for identifying antibiotics in water by combining Raman spectroscopy data enhancement with multilayer perceptron provided in the embodiments of this application can execute the method for identifying antibiotics in water by combining Raman spectroscopy data enhancement with multilayer perceptron provided in any embodiment of this application, and has the corresponding functions and beneficial effects of executing the method.

[0147] In practical implementation, the aforementioned method of Raman spectral data enhancement combined with multilayer perceptron (MPP) for identifying antibiotics in water can be integrated into the detection and identification software. This allows the software to directly acquire the raw Raman spectra of antibiotics in the water and perform data preprocessing. The processed data is then augmented using a Gaussian kernel density data enhancement method. An antibiotic identification model is established using a MPP algorithm, and antibiotic identification is performed, ultimately achieving accurate identification of the Raman spectra of similar antibiotics and their mixtures. This detection and identification software can consist of two or more modules, or it can consist of a single module, such as a Raman spectrometer control module, a data preprocessing module, a data enhancement module, and a machine learning model identification module. This application does not impose specific limitations on this aspect.

[0148] like Figure 7As shown in the figure, this application provides a detection and identification software, including a Raman spectrometer control module 111, a data preprocessing module 112, a data enhancement module 113, and a machine learning model identification module 114. The Raman spectrometer control module 111 is used to acquire spectral data; the data preprocessing module 112 is used to perform background subtraction, Raman shift clipping, baseline processing, smoothing filtering, and normalization on the data; the data enhancement module 113 is used to simulate the spectra of antibiotics acquired at different matrix concentrations; and the machine learning model identification module 114 is used to establish a spectral data identification model and identify unknown spectra, thus implementing the steps of the Raman spectral data enhancement combined with multilayer perceptron method for identifying antibiotics in water provided in any of the aforementioned method embodiments. For example, the method may include the following steps: acquiring a raw Raman spectral dataset of the target antibiotic from a prepared dendritic silver nanoparticle Raman-enhanced substrate, wherein the target antibiotic type includes single-component antibiotics and corresponding mixtures, the single-component antibiotics include at least two types of sulfonamide antibiotics, and the mixture is obtained by mixing at least two sulfonamide antibiotics; preprocessing the raw Raman spectral dataset, and performing data augmentation processing on the preprocessed spectral dataset using a data augmentation algorithm to obtain an expanded spectral dataset; constructing a sample dataset based on the expanded spectral dataset and the preprocessed spectral dataset, and inputting the sample dataset into the constructed multilayer perceptron. The model undergoes iterative optimization training and loss function calculation until the optimal recognition model is determined, and the output prediction results are obtained. Based on the prediction results, the SHAP interpretation method is used to interpret the explanatory variables and feature selection of the model, and key features of the samples are constructed. The Raman spectra of the antibiotics to be identified collected in the water are input into the optimal recognition model for feature extraction, and the extracted features are combined with the key features of the samples to identify antibiotics, thus obtaining the antibiotic identification results. Among them, the multilayer perceptron model is a perceptron recognition model constructed based on the multilayer perceptron algorithm of the neural network model, and the expanded spectral dataset includes spectra of antibiotics collected under simulated matrix concentrations.

[0149] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0150] The above description is merely a specific embodiment of this application, enabling those skilled in the art to understand or implement this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A method for identifying antibiotics in water using Raman spectroscopy data enhancement combined with a multilayer sensor, characterized in that, include: The original Raman spectra of the target antibiotics were collected from the prepared dendritic silver nanoparticle Raman-enhanced substrate. The target antibiotics included single-component antibiotics and corresponding mixtures. The single-component antibiotics included at least two types of sulfonamide antibiotics, and the mixtures were obtained by mixing at least two types of sulfonamide antibiotics. The original Raman spectrum dataset is preprocessed, and then the preprocessed spectrum dataset is augmented using a data augmentation algorithm to obtain an expanded spectrum dataset. Based on the expanded spectral dataset and the preprocessed spectral dataset, a sample dataset is constructed. The sample dataset is then input into the constructed multilayer perceptron model for iterative optimization training and loss function calculation until the optimal recognition model is determined and the output prediction results are obtained. Based on the prediction results, the SHAP interpretation method is used to explain the explanatory variables and feature selection of the model, and to construct the key features of the samples. Raman spectra of the antibiotics to be identified collected from the water body are input into the optimal identification model for feature extraction. The extracted features are then combined with key features of the sample to identify the antibiotics, and the antibiotic identification results are obtained. Among them, the multilayer perceptron model is a perceptron recognition model constructed based on the multilayer perceptron algorithm of the neural network model, and the expanded spectral dataset includes spectra of antibiotics collected under simulated matrix concentrations.

2. The method according to claim 1, characterized in that, The original Raman spectrum dataset was preprocessed, and then augmented using a data augmentation algorithm to obtain an augmented spectrum dataset, which includes: The original Raman spectral dataset was subjected to background subtraction, Raman shift clipping, baseline processing, smoothing filtering, and normalization in sequence to obtain the preprocessed spectral dataset. The GKIM data augmentation algorithm is introduced to analyze the feature importance of each spectral data feature in the preprocessed spectral dataset and determine the number of samples for data augmentation. Based on the preprocessed spectral dataset, an extended spectral dataset is generated by fitting the Raman spectra of the current category according to the number of samples. Different categories of labels were assigned to the preprocessed spectral dataset and the augmented spectral dataset, respectively.

3. The method according to claim 2, characterized in that, The GKIM data augmentation algorithm is introduced to analyze the feature importance of each spectral data feature in the preprocessed spectral dataset and determine the number of samples for data augmentation, including: Input the spectral data features of the preprocessed spectral dataset, calculate the Fisher score using the GKIM Gaussian kernel function, and determine the feature importance using the Fisher score; The data augmentation process is then sorted according to feature importance, and based on the sorting results, the data augmentation process is focused on the specific features of the classification task, and the number of data augmentation samples is determined.

4. The method according to claim 3, characterized in that, Based on the preprocessed spectral dataset, an extended spectral dataset is generated by fitting Raman spectra of the current category according to the number of samples, including: Based on the number of samples and the data augmentation requirements of the analysis, a new sample dataset is generated by fitting the preprocessed Raman spectral data of the current category with a Gaussian kernel function. The new sample dataset contains augmented spectral data. Based on the preprocessed spectral dataset, target augmented spectral data are selected from the new sample dataset to construct an augmented spectral dataset.

5. The method according to claim 4, characterized in that, Based on the sample size and the data augmentation requirements of the analysis, a new sample dataset is generated by fitting the preprocessed Raman spectra of the current category's spectral dataset with a Gaussian kernel function, including: The characteristics and requirements of different spectral data in the preprocessed spectral dataset are analyzed in order to adjust the bandwidth parameter of the Gaussian kernel function. Based on the number of samples, the Raman spectra of each sample in the preprocessed spectral dataset of the current category are fitted with the bandwidth parameter to generate a new sample dataset.

6. The method according to claim 4, characterized in that, Based on the preprocessed spectral dataset, target augmented spectral data are selected from the new sample dataset to construct an augmented spectral dataset, including: By using the Euclidean distance formula, the distance between each augmented spectral data and each spectral data in the corresponding preprocessed spectral dataset is analyzed, and the distance analysis results between different categories of spectral data are obtained. Based on the distance analysis results, a fuzzy nearest neighbor selection mechanism is adopted to select the top K nearest neighbor samples from each augmented spectral data. Calculate the mean of the K nearest neighbor samples as the representative distance; Based on the representative distance, target extended spectral data are selected from each extended spectral data to construct an extended spectral dataset.

7. The method according to claim 1, characterized in that, The sample dataset is input into the constructed multilayer perceptron model for iterative optimization training and loss function calculation until the optimal recognition model is determined, and the output prediction results are obtained, including: When training the multilayer perceptron model using a sample dataset, iterative optimization is performed using a stochastic gradient descent method. By using a dynamic learning rate to accelerate the convergence process of the loss function, the model is iteratively trained until the loss function no longer decreases, thus obtaining the best trained recognition model and acquiring the prediction results output by the model.

8. The method according to any one of claims 1-7, characterized in that, After obtaining the augmented spectral dataset, it also includes: Based on the preprocessed spectral dataset, dimensionality reduction was performed using principal component analysis, and a first analysis plot was plotted based on the dimensionality-reduced data before data augmentation. The first analysis plot was used to analyze the distribution of the original Raman spectral data. Based on the augmented spectral dataset, dimensionality reduction was performed using principal component analysis, and a second analysis plot was plotted after data augmentation. The second analysis plot was used to analyze the distribution of the augmented Raman spectral data. Based on the first and second analysis plots, the impact of different data augmentation parameters on the sample distribution is analyzed, and the data augmentation parameters are optimized during dataset augmentation processing.

9. A device for identifying antibiotics in water using Raman spectroscopy data enhancement combined with a multilayer sensor, characterized in that, include: The Raman spectroscopy data acquisition module is used to acquire the raw Raman spectral dataset of the target antibiotic from the prepared dendritic nanosilver Raman-enhanced substrate. The target antibiotic types include single-component antibiotics and corresponding mixtures. The single-component antibiotics include at least two types of sulfonamide antibiotics, and the mixtures are obtained by mixing at least two types of sulfonamide antibiotics. The dataset augmentation module is used to preprocess the original Raman spectrum dataset and then use data augmentation algorithms to augment the preprocessed spectrum dataset to obtain an expanded spectrum dataset. The model training and optimization module is used to construct a sample dataset based on the extended spectral dataset, input the sample dataset into the constructed multilayer perceptron model for iterative optimization training of the model and calculation of the loss function until the optimal recognition model is determined and the output prediction results are obtained. The feature sample construction module is used to interpret the explanatory variables and feature selection of the model based on the prediction results using the SHAP interpretation method, and to construct key features of the samples. The antibiotic identification module is used to input the Raman spectra of the collected antibiotics to be identified into the optimal identification model for feature extraction, and to combine the extracted features with the key features of the sample to identify the antibiotics and obtain the antibiotic identification results. Among them, the multilayer perceptron model is a perceptron identification model constructed based on the multilayer perceptron algorithm of the neural network model, and the expanded spectral dataset includes spectra of antibiotics collected under simulated matrix concentrations.

Citation Information

Cited By

  • Raman spectrum analysis method for multiple halogenated phenols based on hydrogen bond enhanced halogen bond recognition

    CN122217946A