Method and system for monitoring the healing process of a diabetic foot wound
By extracting and fusing multi-dimensional Raman spectral features, adaptive kernel learning, and lightweight convolutional neural networks, combined with individual heterogeneity adaptation, a personalized diabetic foot wound healing monitoring system was constructed. This system solves the subjectivity and invasiveness problems of traditional methods and achieves accurate monitoring of wound healing progress and personalized adaptation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING SHIJITAN HOSPITAL CAPITAL MEDICAL UNIVERSITY
- Filing Date
- 2026-04-17
- Publication Date
- 2026-07-14
Smart Images

Figure CN122392944A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the technical field of foot wound healing process monitoring methods, and particularly relates to a method and system for monitoring the healing process of diabetic foot wounds. Background Technology
[0002] Diabetic foot, a common and serious complication of diabetes, is influenced by multiple factors, including infection, microcirculatory disturbances, and immune dysfunction, in its wound healing process. Macrophages, as the core immune cells in wound healing, directly reflect the healing trend through dynamic changes in their M1 / M2 polarization state, making them a key target for clinical intervention. Traditional wound monitoring methods rely heavily on visual observation, wound area measurement, and tissue biopsy. These methods are not only highly subjective and invasive, but also fail to capture real-time changes in cellular polarization function, making it difficult to accurately distinguish subtle differences in healing stages. This often leads to delays in intervention or a lack of targeted treatment, thereby increasing the risk of ulcer recurrence and amputation.
[0003] Raman spectroscopy, with its advantages of being non-invasive, in-situ, and rapid, provides a new approach for analyzing macrophage polarization status. However, it still faces significant technical challenges in the monitoring of diabetic foot wounds. On the one hand, the spectral signals from wounds contain interference from other cells and matrix components, resulting in weak and insignificant Raman feature signals related to macrophage polarization. Traditional feature extraction methods struggle to effectively separate these weakly different features. On the other hand, individual patient heterogeneity (such as age, duration of diabetes, and wound type) leads to significant differences in the distribution of spectral features. Existing models lack personalized adaptation capabilities and are prone to overfitting and insufficient generalization with small sample datasets, making it difficult to achieve accurate classification and continuous characterization of polarization status. This limits the large-scale application of this technology in point-of-care monitoring. Summary of the Invention
[0004] In view of the aforementioned problems, and in conjunction with the first aspect of the present invention, embodiments of the present invention provide a method for monitoring the healing process of diabetic foot wounds, the method comprising: We extract and fuse weak difference features of macrophage polarization Raman spectra from multiple dimensions to form a multi-dimensional feature set containing weak difference information. An adaptive kernel learning KPCA-regularized LDA fusion algorithm is constructed to perform dimensionality reduction on multi-dimensional feature sets and complete preliminary classification. A lightweight spectral attention convolutional neural network is constructed to selectively extract deep local weak difference features of Raman spectra and suppress interference from irrelevant signals. A continuous polarization value classification model for macrophages was established, and continuous polarization values were output through a convolutional neural network to accurately characterize the degree of cell polarization and the transition process. A dynamic branching module for individual heterogeneity adaptation is added to the main classification model, which integrates patients' clinical characteristics and spectral characteristics to achieve personalized weak difference feature recognition. A combined strategy of in vitro pre-training-in situ fine-tuning and incremental learning was adopted to carry out phased training and continuous optimization of the fusion model of KPCA-regularized LDA and SA-CNN; An ensemble classifier that integrates multiple models is constructed. The analysis results of different models are weighted, fused, and calibrated according to rules to output the final classification result of macrophage polarization state.
[0005] Furthermore, embodiments of the present invention also provide a system for monitoring the healing process of diabetic foot wounds, characterized in that it includes: A processor; a machine-readable storage medium for storing machine-executable instructions of the processor; wherein the processor is configured to perform the above-described method for monitoring the healing process of diabetic foot wounds by executing the machine-executable instructions.
[0006] In another aspect, embodiments of the present invention also provide a computer program product, the computer program product including machine-executable instructions, the machine-executable instructions being stored in a computer-readable storage medium, a processor of a computer device reading the machine-executable instructions from the computer-readable storage medium, and the processor executing the machine-executable instructions, causing the computer device to perform the above-described method for monitoring the healing process of diabetic foot wounds.
[0007] Based on the above, a multi-dimensional Raman spectroscopy weak differential feature extraction and fusion strategy, combined with an adaptive kernel learning algorithm and a lightweight spectral attention convolutional neural network, was adopted to achieve accurate identification and continuous characterization of macrophage polarization state. This technology effectively filters out irrelevant signal interference from wound debris cells and matrix components, enhances the discriminative power of polarization-specific weak differential features, and comprehensively portrays the dynamic changes in the polarization transition stage through a continuous value classification model. This addresses the technical pain points of traditional methods, such as difficulty in capturing subtle functional differences at the cellular level and the high subjectivity of assessment results, providing objective and quantitative evidence for assessing wound healing progress in clinical practice.
[0008] Meanwhile, the technology balances personalized adaptability and long-term stability through a collaborative design of dynamic branching adapted to individual heterogeneity, phased training, and incremental learning. Dynamic branching, while maintaining lightweight design, enables deep interaction between clinical and spectral features, allowing the model to adapt to individual differences among patients and significantly improving adaptability in complex clinical scenarios. The lightweight architecture and quantization optimization ensure the model can meet the real-time deployment requirements of bedside devices, while the weighted fusion and rule calibration mechanism of the integrated classifier further enhances robustness in complex scenarios such as noise interference and feature loss. Ultimately, this achieves non-invasive, in-situ, and precise monitoring of the healing process of diabetic foot wounds, providing strong support for the timely optimization of clinical intervention plans. Attached Figure Description
[0009] Figure 1 This is a schematic diagram of the execution flow of the method for monitoring the healing process of diabetic foot wounds provided in an embodiment of the present invention.
[0010] Figure 2 This is a schematic diagram of exemplary hardware and software components of the diabetic foot wound healing process monitoring system provided in an embodiment of the present invention. Detailed Implementation
[0011] The present invention will now be described in detail with reference to the accompanying drawings. Figure 1 This is a flowchart illustrating a method for monitoring the healing process of diabetic foot wounds according to an embodiment of the present invention. The following is a detailed description of this method for monitoring the healing process of diabetic foot wounds.
[0012] Step S110: Extract weak difference features of macrophage polarization Raman spectrum from multiple dimensions and fuse them to form a multi-dimensional feature set containing weak difference information; By employing a multi-dimensional extraction and fusion strategy, this study comprehensively captures weak Raman spectral differences related to macrophage polarization, providing high-quality feature support for subsequent polarization state identification. Specifically, extraction is conducted from three dimensions: peak shape micro-features, inter-peak correlation features, and wavenumber sequence trend features. Peak shape micro-features focus on the detailed parameters of individual feature peaks, inter-peak correlation features explore the quantization relationships between different feature peaks, and wavenumber sequence trend features capture the overall spectral variation patterns within a specific interval. During the extraction process, differentiated extraction methods are used for the characteristics of each dimension to ensure that weak differences are not overlooked. Subsequently, feature concatenation is used to integrate multi-dimensional information, followed by redundancy removal to eliminate highly correlated, collinear, and invalid features, ultimately forming a multi-dimensional fused feature set that is both complete and effective. This feature set retains key weak differences related to polarization while avoiding the interference of redundant data on model performance.
[0013] Step S111: Perform adaptive polynomial fitting baseline correction, db4 wavelet basis 3-layer decomposition denoising, and 1003cm on the raw Raman spectrum data of macrophages from diabetic foot wounds in sequence. -1 The internal reference peaks were normalized, and outlier data were removed using the 3σ criterion to obtain a standardized Raman spectrum dataset. To address issues such as noise, baseline drift, and data anomalies in the raw Raman spectroscopy data of macrophages from diabetic foot wounds, a standardized preprocessing workflow was implemented. First, adaptive polynomial fitting was used for baseline correction. The polynomial order (typically 3-5) was dynamically adjusted based on the actual baseline drift, and the true baseline was approximated through iterative fitting and subtracted, effectively eliminating baseline interference caused by fluorescence background. Next, a three-level decomposition denoising process was performed using the db4 wavelet basis, decomposing the spectrum into approximation coefficients and detail coefficients. Approximation coefficients reflecting the spectral signal were retained, while high-frequency detail coefficients containing noise were discarded before reconstructing the spectrum, achieving effective noise filtering. Subsequently, a 1003 cm⁻¹... -1 The internal reference peak was used as a reference for normalization, calibrating the intensity of this peak in all spectra to the same level, thus eliminating the inconsistency in intensity scale caused by differences in detection conditions. Finally, the 3σ criterion was applied to calculate the mean and standard deviation of the spectral data. Outliers exceeding the mean ± 3σ range were deemed invalid and removed, resulting in a standardized Raman spectral dataset with a stable baseline, low noise, uniform intensity, and no outliers.
[0014] Step S112: Based on the preset M1 and M2 polarization-specific Raman characteristic peak reference library, the characteristic peak vertices in the Raman spectrum are located using the continuous wavelet transform peak detection algorithm, the peak shape correlation parameters of the characteristic peaks are calculated, and the peak shape correlation parameters are Z-score standardized to form a subset of peak shape micro-features. Peak shape micro-features were extracted based on a pre-defined reference library of M1 and M2 polarization-specific Raman characteristic peaks. This reference library was constructed by integrating polarization-specific characteristic peaks reported in existing literature and verified experimentally, including 785 cm⁻¹ peaks related to M1 polarization. -1 1340cm -1 Equipotential positions, and the 1445 cm⁻¹ related to M² polarization. -1 1650cm -1 Equal peak position, with peak position error controlled within ±2cm -1Within the specified range, a continuous wavelet transform peak detection algorithm is used to locate the apex of characteristic peaks. The wavelet scale range is set to 1-10. A sliding window is used to traverse the spectrum, and the location of characteristic peaks is identified based on the extreme points of the wavelet coefficients. Simultaneously, a signal-to-noise ratio threshold of 3 is set to eliminate false peaks caused by noise interference. For the located characteristic peaks, peak height, peak width, half-width at half-maximum (FWHM), peak area, and peak symmetry are calculated. Then, Z-score standardization is performed on all peak shape parameters, i.e., the mean and standard deviation of each parameter are calculated, converting each parameter value to a standard normal distribution to eliminate dimensional differences between different parameters. Finally, all standardized peak shape parameters are organized according to sample dimensions to form a subset of peak shape micro-features. This subset accurately reflects the microscopic differences of individual characteristic peaks, providing detailed support for distinguishing polarization states.
[0015] Step S113: Select feature peak pairs with high polarization discrimination, calculate the peak area and vertex intensity of the feature peak pairs, and further obtain the peak area ratio, vertex intensity ratio and corresponding coefficient of variation. Standardize the ratio and coefficient of variation to form a subset of inter-peak correlation features. First, characteristic peak pairs with high polarization discrimination are screened. The screening process combines analysis of variance and mutual information calculation to quantitatively evaluate the correlation between each characteristic peak and the polarization label in the standardized spectral data. Characteristic peak combinations with significant discrimination (P value < 0.05) are selected first. Typical peak pairs include combinations of M1-specific peaks and M2-specific peaks (e.g., 785 cm⁻¹). -1 With 1445cm -1 ), combinations of specific peaks and internal reference peaks (e.g., 1340 cm⁻¹) -1 With 1003cm -1 A total of 8-12 core peak pairs were selected. For each peak pair, the peak area of the characteristic peak was calculated using an integral method (the integration interval is from the peak start point to the peak end point, determined by the point where the first derivative is zero), and the intensity value at the peak vertex was taken as the vertex intensity. Based on the calculated peak area and vertex intensity, the ratio of the two sets of parameters (e.g., the ratio of the peak area of peak pair A to the peak area of peak pair B) and the coefficient of variation (the degree of parameter fluctuation of the same peak pair in different samples) were calculated. The above ratios and coefficients of variation were normalized using Min-Max to scale the values to the 0-1 interval, eliminating the parameter scale differences between different peak pairs. Finally, all processed parameters were integrated in sample order to form a subset of inter-peak correlation features.
[0016] Step S114: Divide the Raman spectral wavenumber into three functional intervals, set a corresponding sliding window and step size for each functional interval, extract the trend feature parameters of each interval based on the sliding window and step size, perform PCA dimensionality reduction and standardization on the trend feature parameters, and form a wavenumber sequence trend feature subset. Based on the biomolecular vibrational functions in Raman spectroscopy, three intervals are defined, specifically 600-1200 cm⁻¹. -1 (Circular vibration range, including protein and nucleic acid-related vibrations), 1200-1800cm -1 (Amide band region, reflecting protein secondary structure), 1800-3000 cm⁻¹ -1 (CH vibrational regions, associated with lipids and proteins), the regions are divided according to the functional partitioning standards commonly used in the field of spectroscopy. For each region, based on spectral resolution (typically 2 cm⁻¹), -1 Set the appropriate sliding window and step size, where 600-1200cm -1 The interval is 15cm. -1 Window, 5cm -1 stride length, 1200-1800cm -1 The interval is 12cm. -1 Window, 4cm -1 stride length, 1800-3000cm -1 The interval is 20cm. -1 Window, 8cm -1 The step size is carefully chosen to ensure that local trends are captured without missing key information. Trend feature parameters within each window are extracted using a sliding window approach, including 10-15 parameters such as mean, variance, slope, number of peaks, and number of troughs. PCA dimensionality reduction is performed on the extracted trend feature parameters. By calculating eigenvalues and eigenvectors, principal components with a cumulative variance contribution rate ≥95% are retained, achieving dimensionality compression and noise filtering. Subsequently, Z-score standardization is applied to the dimensionality-reduced principal components to eliminate the dimensionality influence between them. Finally, the samples are integrated according to their dimensions to form a subset of wavenumber sequence trend features.
[0017] Step S1141: Organize the three standardized Raman spectral feature subsets, unify the sample dimensions and complete sample matching according to the detection sequence number, convert all feature parameters to floating point type, and add a unique named label containing the feature type and meaning to each feature parameter; First, the sample dimensions of the peak shape micro-feature subset, the inter-peak correlation feature subset, and the wavenumber sequence trend feature subset are normalized. Using the detection sequence number as a unique identifier, samples from the three subsets are matched one by one according to their detection sequence numbers. Samples without corresponding detection sequence numbers and samples with duplicate detection sequence numbers are deleted to ensure that the sample quantity of the three subsets is consistent and the order is completely aligned. If a subset has missing samples, the feature mean of samples of the same category is used for filling. Before filling, the rationality of the mean filling must be verified (error ≤ 5%). All feature parameters are uniformly converted to 64-bit floating-point type to ensure that the data accuracy meets the needs of subsequent calculations and to avoid numerical overflow or precision loss. A unique naming and labeling rule is designed for each feature parameter, with the naming format "feature type-parameter name-association information". The feature type includes "peak shape", "inter-peak", and "trend", the parameter name includes "peak height", "area ratio", "mean", etc., and the association information is the wavenumber or interval (e.g., "peak shape-half-width-785cm"). -1 "Trend-Variance-1200-1800cm" -1 This ensures that the core information of the features can be clearly identified through naming. Through these operations, uniformity is achieved across the three feature subsets in terms of sample dimensions, data types, and naming rules.
[0018] Step S1142: Concatenate the three feature subsets by column to construct an initial fused feature matrix, complete the storage of the initial fused feature matrix, and generate a feature column name index table. The feature column name index table clarifies the feature type, meaning, and naming information corresponding to each column in the initial fused feature matrix. The `concatenate` function from Python's NumPy library concatenates three regularized feature subsets along their feature dimensions, preserving the sample dimensions and sequentially concatenating the feature parameters of the three subsets into a complete feature matrix, forming the initial fused feature matrix. The matrix is stored in HDF5 format, which supports lossless storage and fast retrieval of large-scale numerical data. A data compression level of 3 is set during storage to balance storage efficiency and retrieval speed. The storage path is uniformly standardized as "preprocessed data / initial fused feature matrix.h5". A feature column name index table is also generated and stored in Excel format. The index table includes fields such as column number, feature name, feature type, feature meaning, data type, and standardization method. The column numbers correspond one-to-one with the column order of the initial fused feature matrix, and the feature meaning details the physical significance of the feature (e.g., "peak shape - peak height - 785cm"). -1 785cm -1 The peak intensity values of the characteristic peaks reflect the expression levels of M1 polarization-related molecules. The index table is stored in association with the initial fused feature matrix, facilitating subsequent queries of specific information for each column of features and ensuring the traceability and interpretability of the feature matrix.
[0019] Step S1143: Based on the initial fusion feature matrix, calculate the Pearson correlation coefficient by feature column, generate a symmetric feature correlation coefficient matrix and mark the autocorrelation coefficients on the diagonal of the matrix, set the absolute value of the correlation coefficient ≥ 0.9 as the high correlation threshold, traverse the feature correlation coefficient matrix to identify high correlation feature pairs, filter and retain features according to the feature importance principle and remove the remaining high correlation features, generate a de-correlation fusion feature matrix, and record the removal information of high correlation features to form a feature screening log; The Pearson correlation coefficients between feature columns in the initial fused feature matrix are calculated using the `corrcoef` function from the Python scipy library, generating a symmetric feature correlation coefficient matrix. The diagonal elements of this matrix represent the autocorrelation coefficients (value 1) of each feature, marked in red to distinguish them from other correlation coefficients. A high correlation threshold is set for correlation coefficients with an absolute value ≥ 0.9. This threshold, determined through multiple experiments, effectively removes redundant features while avoiding excessive removal that could lead to the loss of valuable information. The feature correlation coefficient matrix is iterated to identify all feature pairs that meet the high correlation threshold. For each pair of highly correlated features, they are selected and retained based on feature importance. Feature importance is determined by two criteria: first, the correlation between the feature and the polarization label (the larger the absolute value of the correlation coefficient, the more important it is); and second, the spectroscopic significance of the feature (the stronger the polarization specificity, the more important it is). For example, if "peak shape - peak height - 785cm" is a high correlation coefficient, then the feature is considered highly correlated. -1 "and "peak shape - peak area - 785cm -1 "Highly correlated features are retained and discarded due to their more significant polarization specificity at higher peaks. During the screening process, detailed information such as the name of each discarded feature, the name of its corresponding related feature, the correlation coefficient value, the screening time, and the operator is recorded to form a feature screening log. The log is stored in text format to ensure the traceability of the screening process. Finally, a de-correlated fusion feature matrix is generated, which effectively reduces redundant correlations between features."
[0020] Step S1144: For the high-correlation fusion feature matrix, construct a univariate linear regression model by taking each feature column as the dependent variable and the remaining feature columns as independent variables. Solve the determination coefficient R² of each model using the least squares method. Calculate the variance inflation factor (VIF) value of each feature according to the VIF calculation formula. Set VIF>10 as the collinearity threshold. After sorting the VIF values of all features in descending order, iteratively remove the feature column with the largest VIF value until the VIF value of all features in the matrix is ≤10. Record the information on the removal of collinear features during the iteration process to form a collinearity feature screening log. To address the issue of highly correlated feature matrices, a univariate linear regression model was constructed using the `LinearRegression` class from Python's `sklearn` library. Each feature column was used as the dependent variable, and all other feature columns were used as independent variables. The coefficient of determination (R²) was calculated using the least squares method. The R² value reflects the explanatory power of the independent variables for the dependent variable. Based on the calculated R² value, the Variance Inflation Factor (VIF) was calculated using custom Python code, following the logic for VIF calculation, ensuring the accuracy of the calculation process. A VIF > 10 was set as the collinearity threshold. This threshold is a common standard in statistics for determining severe collinearity; a VIF value greater than 10 indicates severe collinearity among features, which can affect the stability of subsequent models. All feature VIF values were sorted in descending order, and the feature column with the highest VIF value was removed first. After removal, the VIF values of all remaining features were recalculated, and this iterative process was repeated until the VIF values of all features in the matrix were ≤ 10. During the iteration process, detailed information such as the name of the feature removed each time, the VIF value at the time of removal, the number of iterations, and the number of remaining features is recorded to form a collinearity feature screening log. The log is stored in association with the previous feature screening log to facilitate the tracing of the collinearity processing process.
[0021] Step S1145: Verify the dimension and data integrity of the feature matrix after iteration, confirm that there are no missing values or outliers in the matrix, and associate and store the verified feature matrix with the feature column name index table, feature filtering log, and collinear feature filtering log to obtain a standardized redundancy-free fusion feature matrix.
[0022] The iteratively generated feature matrix undergoes dimensionality verification to check if the number of samples and features matches expectations (the number of samples should be the same as the effective number of samples in the standardized spectral dataset, and the number of features should be appropriately reduced based on iterative elimination). If the dimensions do not match, the issue is traced back to the collinearity feature selection step for troubleshooting. Next, data integrity verification is performed using Python's pandas library to check for outliers such as NaN and infinity. Each feature column is verified individually to ensure all elements are valid values. If outliers are found, the cause is traced back to the data preprocessing or feature extraction steps for correction, and the previous redundancy removal process is re-executed. After successful verification, the feature matrix is associated with the feature column name index table, feature selection log, and collinearity feature selection log, using the same file prefix for naming. The storage path is unified as "Preprocessed Data / Redundancy Removal and Fusion Feature Matrix / ", and a high-speed solid-state drive is chosen for storage to ensure data read speed and storage security. The final standardized redundancy removal and fusion feature matrix is obtained, which features reasonable dimensions, complete data, and independent features, and can be directly used for subsequent model training.
[0023] Step S115: Concatenate the peak-shaped micro-feature subset, the inter-peak correlation feature subset, and the wavenumber sequence trend feature subset to construct an initial fusion feature matrix. Remove highly correlated features from the initial fusion feature matrix using the Pearson correlation coefficient, and then remove collinear features using the variance inflation factor test. Use the random forest algorithm to evaluate and rank the importance of the features after redundancy removal. Combine with spectroscopic prior knowledge to remove invalid features. Normalize the remaining features again to obtain a multi-dimensional fusion feature set. First, the peak-shaped micro-feature subset, the inter-peak correlation feature subset, and the wavenumber sequence trend feature subset are aligned according to the sample dimension. The feature dimensions are then concatenated using Python's NumPy library to construct an initial fused feature matrix. Two rounds of redundancy removal are then performed: the first round uses the Pearson correlation coefficient to remove highly correlated features, calculating the correlation coefficient between each feature column and removing redundant features with an absolute correlation coefficient ≥ 0.9, retaining features with stronger polarization specificity; the second round uses the variance inflation factor (VIF) test to remove collinear features, iteratively removing features with severe collinearity according to a VIF > 10 standard, ensuring the independence between features. After redundancy removal, a random forest algorithm is used to evaluate feature importance, with 150 decision trees and a tree depth of 8. All features are ranked based on the feature importance scores output by the algorithm. Combining prior spectroscopic knowledge, features without biological significance or unrelated to macrophage polarization are removed, such as features correlated with non-polarization-specific peaks and trend features without a clear molecular vibrational correspondence. The remaining features are subjected to Min-Max normalization, which scales the feature values to the 0-1 range to eliminate the dimensional differences between different features. Finally, a multi-dimensional fusion feature set is formed, which integrates effective information from three dimensions, ensuring both feature diversity and good independence and discriminative power.
[0024] Step S116: The effectiveness of the multi-dimensional fusion feature set is verified by analysis of variance to confirm that it can effectively distinguish the M1 and M2 polarization states of macrophages.
[0025] One-way ANOVA was used to validate the effectiveness of the multi-dimensional fusion feature set. The polarization state of macrophages (M1, M2, and intermediate state) was used as the independent variable, and each feature in the fusion feature set was used as the dependent variable. An ANOVA model was constructed. The ANOVA was implemented using the `f_oneway` function in Python's scipy library, calculating the F-statistic and P-value for each feature under different polarization states. The F-statistic reflects the degree of difference in feature values between different groups, and the P-value reflects the significance of the difference. A significance threshold of P < 0.05 was set. If the P-value of a feature is less than this threshold, it indicates that the mean of that feature differs significantly under different polarization states, demonstrating its ability to distinguish polarization states. If the P-value is ≥ 0.05, it indicates that the feature's discriminative ability is insufficient and it is removed. All features in the fusion feature set were validated one by one, and the number of effective features (P < 0.05) was counted. The requirement was that the proportion of effective features ≥ 80% to ensure that the fusion feature set as a whole has good discriminative ability. After verification, the valid features are compiled into a final multi-dimensional fusion feature set, and a verification report is generated. The report includes information such as the F-statistic, P-value, and validity status of each feature, ensuring the scientific and traceable nature of the verification process. This step confirms that the constructed multi-dimensional fusion feature set can effectively distinguish different polarization states of macrophages, providing reliable feature input for subsequent classification or prediction models.
[0026] Step S120: Construct an adaptive kernel learning KPCA-regularized LDA fusion algorithm to perform dimensionality reduction on the multi-dimensional feature set and complete the initial classification; An adaptive kernel learning-based KPCA-regularized LDA fusion algorithm is constructed, integrating the advantages of KPCA nonlinear dimensionality reduction and regularized LDA classification. This algorithm addresses the high-dimensionality and nonlinearity of multi-dimensional fused feature sets by performing dimensionality reduction and preliminary classification. During algorithm implementation, the feature set is first standardized and preprocessed. Adaptive kernel learning is then used to select a kernel function and parameters suitable for the spectral feature distribution, resolving the issue of KPCA kernel function dependence on empirical selection. A regularization mechanism is then introduced, adaptively calculating regularization coefficients to alleviate the singularity problem of intra-class scatter matrix in small sample sizes, thus enhancing the inter-class discriminative ability of LDA. The overall process revolves around dimensionality reduction, enhanced discriminative power, and classification. First, KPCA maps high-dimensional features to a low-dimensional kernel principal component space, preserving key polarization-related information. Then, regularized LDA further enhances the inter-class differences of features. Finally, a Bayesian classifier is used to output preliminary classification results. The computational complexity of the algorithm is controlled throughout, with a lightweight search strategy employed during parameter optimization to ensure the algorithm is adaptable to the computational limitations of bedside equipment while maintaining classification accuracy that meets clinical application requirements.
[0027] Step S121: Load the Raman spectrum redundancy-free fusion feature matrix and perform min-max normalization. Divide the training set and test set into stratified sampling at a ratio of 8:2. Convert the dataset into NumPy array format and record the M1 / M2 / intermediate polarization labels corresponding to each sample. First, the redundant-removed Raman spectral fusion feature matrix is loaded. Min-Max normalization is used to scale all feature values to the 0-1 range. During normalization, the minimum and maximum values of each feature are recorded for subsequent feature inverse transformation in the inference stage. The training and test sets are stratified in an 8:2 ratio, based on macrophage polarization labels (M1, M2, intermediate state), ensuring the sample proportions of each polarization category in the training and test sets are consistent with the original data, avoiding sample distribution bias from affecting model performance. The dataset is converted to a 64-bit floating-point array using Python's NumPy library, with array dimensions of [number of samples, number of features]. A label array is constructed, encoding M1, M2, and the intermediate state as 0, 1, and 2 respectively, and a sample-label mapping table is generated, recording the detection sequence number, polarization label, and dataset affiliation of each sample. Data is stored in binary format to improve read efficiency. After preprocessing, the dataset integrity is verified by removing missing and outlier values to ensure no dimensionality errors, providing standardized input for the subsequent KPCA-regularized LDA algorithm.
[0028] Step S122: Determine four candidate kernel function pools and define the parameter search space for each kernel function. Design a joint optimization objective function. Optimize the kernel function and parameters using 5-fold cross-validation combined with grid search. Calculate the kernel matrix based on the optimal kernel function and parameter configuration and complete kernel matrix centering. Select principal components with a cumulative variance contribution rate ≥95% to construct a KPCA projection matrix. Map the features of the training set and test set to the low-dimensional kernel principal component space. Four candidate kernel function pools were identified: linear kernel, polynomial kernel, radial basis function (RBF) kernel, and sigmoid kernel. For each kernel function class, a differentiated parameter search space was defined: polynomial kernels searched for orders 2-5, RBF kernels searched for gamma values from 1e-4 to 1e-1, and sigmoid kernels searched for alpha values from 0.01 to 0.1. A joint optimization function was designed to maximize classification accuracy and minimize the computational complexity of the kernel matrix. The parameter space was traversed using 5-fold cross-validation combined with grid search to select the kernel function and parameter combination with the highest classification accuracy on the validation set as the optimal configuration. Based on the optimal configuration, the kernel matrices for the training and test sets were calculated, and the kernel matrices were centered to eliminate mean bias. The eigenvalues and eigenvectors of the kernel matrix were calculated and sorted in descending order of eigenvalues. Principal components with a cumulative variance contribution rate ≥95% were selected to construct a KPCA projection matrix, mapping high-dimensional features to a low-dimensional kernel principal component space. After dimensionality reduction, the feature dimension is typically compressed to 10%-20% of the original dimension, reducing computational complexity while preserving key polarization information.
[0029] Step S123: Calculate the inter-class scatter matrix and intra-class scatter matrix of the features after KPCA dimensionality reduction, adaptively calculate the regularization coefficient by combining the coefficient of variation of the number of samples and the trace of the intra-class scatter matrix, construct the regularized intra-class scatter matrix, solve the eigenvalues and eigenvectors of the regularized LDA, construct the LDA projection matrix, and project the features of the kernel principal component space to the LDA subspace. Based on the features reduced by KPCA, the inter-class scatter matrix and intra-class scatter matrix are calculated separately through matrix operations. The inter-class scatter matrix reflects the overall difference in features between different polarization categories, while the intra-class scatter matrix reflects the degree of feature fluctuation within samples of the same category. Combining the coefficient of variation of the sample number (the degree of fluctuation in the number of samples in each polarization category) and the trace of the intra-class scatter matrix (the sum of intra-class dispersion), a regularization coefficient is adaptively calculated—the larger the coefficient of variation of the sample number and the larger the trace of the intra-class scatter matrix, the higher the value of the regularization coefficient, thus addressing the singularity problem of the intra-class scatter matrix under small sample conditions. The regularization coefficient is incorporated into the intra-class scatter matrix to construct a regularized intra-class scatter matrix. The generalized eigenvalues and eigenvectors of the inter-class scatter matrix / regularized intra-class scatter matrix are solved, and the top two eigenvectors with the largest eigenvalues (number of polarization categories - 1) are selected to construct the LDA projection matrix. The training and test set features in the kernel principal component space are projected onto the LDA subspace to further enhance the inter-class discriminative power of the features. After projection, the feature dimension matches the number of polarization categories, facilitating subsequent classifier construction.
[0030] Step S124: Construct a Bayesian classifier based on the training set features of the LDA subspace, input the test set features of the LDA subspace into the Bayesian classifier, output the polarization classification results of macrophage M1 / M2 / intermediate states according to the maximum a posteriori probability criterion, and record the classification confidence of each sample. A Naive Bayes classifier is constructed based on the training set features of the LDA subspace. For the three polarization labels M1, M2, and intermediate states, the mean vector and covariance matrix of each feature are calculated. Assuming that the features follow a multivariate normal distribution, the posterior probability of a sample belonging to each category is derived based on Bayes' theorem. To avoid floating-point underflow, logarithmic probabilities are used for calculation to ensure numerical stability. The test set features of the LDA subspace are input into the classifier, and the posterior probability of each sample corresponding to the three polarization states is calculated. The category corresponding to the maximum posterior probability is selected as the classification result, and this maximum value is recorded as the classification confidence. Samples with a confidence score below 0.5 are marked as pending verification. A classification result table is generated, including the sample detection sequence number, LDA projected feature value, posterior probability of each polarization category, final classification result, and confidence score. This facilitates subsequent performance evaluation and result traceability, providing interpretable preliminary classification conclusions for macrophage polarization states.
[0031] Step S125: Calculate the classification accuracy and precision performance indicators and draw the confusion matrix. If the overall classification accuracy is <85%, expand the kernel parameter search range, adjust the regularization coefficient weights and re-execute parameter optimization, save the optimal parameter configuration and perform lightweight processing on the model to adapt the model to bedside device deployment.
[0032] Based on the classification results of the test set, the overall classification accuracy, precision, recall, and F1 score for each class are calculated. A confusion matrix is plotted using Python's sklearn library to visually display the classification error distribution of the M1, M2, and intermediate classes. If the overall classification accuracy is <85%, the kernel parameter search range is expanded (e.g., the RBF kernel gamma value is expanded to 1e-5 to 1e0), the weighting of the sample number variation coefficient in the regularization coefficient is adjusted, and 5-fold cross-validation and grid search are re-executed until the accuracy is ≥85%. The optimal parameter configuration (kernel function type, parameter values, regularization coefficients, projection matrix, etc.) is saved. The model is lightweighted through parameter pruning and matrix sparsification, compressing the model size to less than 10MB. The lightweight model is converted to the ONNX universal format, and an inference script adapted to the ARM architecture of bedside devices is written. The single-sample inference speed is tested to be ≤50ms, ensuring efficient and stable operation of the model on bedside devices.
[0033] Step S130: Construct a lightweight spectral attention convolutional neural network to specifically extract deep local weak difference features of Raman spectra and suppress interference from irrelevant signals; This study focuses on building a lightweight spectral attention convolutional neural network. Addressing the one-dimensional sequence characteristics and weak polarization difference feature extraction requirements of Raman spectra, it integrates depthwise separable convolutions with a lightweight attention mechanism, balancing feature extraction accuracy with model lightweightness. The network design revolves around the core logic of feature extraction, attention enhancement, and irrelevant signal suppression. First, it standardizes the spectral data format to adapt to the network input. Then, it captures local wavenumber correlations through customized convolutional units and introduces a dual-channel attention mechanism to focus on the 785cm² wavelength. -1 1445cm -1 Isopolarization-specific wavenumber regions are used to weaken irrelevant signals generated by extraneous cells and matrix in the wound. A weakly differential feature set, combining superficial local and deep abstract information, is generated through multi-stage feature fusion. A training strategy adapted to small to medium sample sizes ensures generalization ability, and the number of network parameters is kept ≤200k throughout the process. Finally, the effectiveness of the features is verified through attention heatmaps, signal-to-noise ratio calculations, and classification validation to ensure that the features extracted by the network accurately represent the polarization state of macrophages.
[0034] Step S131: Unify the wavenumber range, sequence length, and intensity scale of the Raman spectral data, convert it into a tensor format suitable for convolutional neural networks, and split the dataset using a hierarchical partitioning method to eliminate the impact of inconsistent data formats and distribution biases on model training. First, standardize the preprocessing criteria for Raman spectroscopy data: limit the wavenumber range to 600-3000 cm⁻¹. -1 Data exceeding the specified range was cropped, and insufficient data was zero-padding; the sequence length was standardized to 1200 wavenumber points, and the length was adjusted using linear interpolation to eliminate spectral length differences acquired by different devices; the intensity scale was set at 1003 cm⁻¹. -1 Internal parameter peak normalization eliminates intensity fluctuations caused by detection conditions. PyTorch is used to convert the processed spectrum into a three-dimensional tensor format [batch size, number of channels, sequence length], with the number of channels set to 1 to accommodate one-dimensional convolution. The training, validation, and test sets are hierarchically divided in a 7:1:2 ratio, based on polarization labels, to ensure consistent class distribution across datasets. Mean-standard deviation normalization is performed on the tensor data to eliminate distribution bias, validate data format and dimensionality, and remove samples with incorrect formatting or outdated dimensions, providing unbiased and standardized input data for network training.
[0035] Step S132: Construct a lightweight convolutional unit adapted to one-dimensional Raman spectra based on depthwise separable convolution, which accurately captures the feature correlation between continuous wavenumbers in local spectra while reducing the number of model parameters and computational cost. A lightweight convolutional unit adapted to one-dimensional Raman spectroscopy is constructed based on depthwise separable convolution. This unit consists of two parts: depthwise convolution and pointwise convolution. The depthwise convolution uses single-channel convolution kernels of sizes 3 / 5 / 7 (with a stride of 1 and same padding), with each kernel corresponding to one input channel, capturing the feature correlation of local continuous wavenumbers. The pointwise convolution uses 1×1 convolution kernels, fusing the multi-channel features output by the depthwise convolution to reduce dimensionality. Compared to traditional convolution, the number of parameters in this unit is reduced to 1 / 9, and the computational cost is reduced by more than 80%. Batch normalization layers and the ReLU6 activation function are added to the convolutional unit. ReLU6 limits the output range to adapt to low-precision computation and improves compatibility with point-of-care devices. A dropout rate of 0.1-0.2 is set after each unit to prevent overfitting. The number of stacked control units is 3-5 layers, further reducing the number of model parameters and computational cost while ensuring feature extraction capabilities.
[0036] Step S133: Design a dual-channel lightweight attention mechanism to focus on the characteristic information of the polarization-specific wavenumber region of macrophages, weaken irrelevant signals generated by impurities and matrix in the wound, and strictly control the number of attention module parameters to meet the overall lightweight requirements. A lightweight dual-channel attention mechanism is designed, comprising spatial and channel attention channels. The spatial attention channel targets the wavenumber dimension, extracting key information through global average pooling and max pooling, and generating an attention weight map via 1×1 convolution to focus on polarization-specific wavenumber regions. The channel attention channel targets the feature channel dimension, calculating the weight coefficients of each channel through a compression-activation mechanism to strengthen polarization-related channels and weaken irrelevant channels. The number of parameters in the attention module is controlled to within 5% of the total network parameters. Lightweighting is achieved by limiting the number of neurons in the fully connected layers to ≤64 and using depthwise separable convolutions instead of traditional convolutions. The attention module is embedded at the output of the convolutional unit, and the weight values are normalized to the 0-1 range using sigmoid. Weighted summation is used to strengthen polarization features and weaken irrelevant signals, while setting upper and lower limits of 0.1-0.9 for the weights to avoid feature distortion due to excessive attention.
[0037] Step S134: Integrate multiple sets of lightweight convolutional units and polarization attention modules to construct a low-parameter convolutional neural network structure. Through multiple rounds of feature extraction, enhancement and integration, output weak differential features that can characterize the polarization state of macrophages. A lightweight network structure is constructed by integrating multiple lightweight convolutional units and polarization attention modules, consisting of an input layer, a feature extraction layer, an attention enhancement layer, a feature fusion layer, and an output layer. The input layer receives a one-dimensional spectral tensor. The feature extraction layer stacks three convolutional units to progressively extract shallow local, mid-level correlation, and deep abstract features. Each unit is followed by a dual-channel attention module to specifically enhance features at each stage. The feature fusion layer concatenates the enhanced features from multiple stages and compresses the dimensions using a 1×1 convolution. The output layer outputs a weakly differential feature vector with ≤128 dimensions. The total number of network parameters is controlled to within 150k, achieving lightweighting by reducing the number of convolutional kernels (16 / 32 / 64) and removing redundant fully connected layers. Before training, He initialization is used to ensure gradient stability. The network is built on the PyTorch framework, supporting dynamic graph debugging for easy adjustment of training strategies later.
[0038] Step S135: The network is trained efficiently using a combination of loss function, customized optimizer and lightweight training strategy, which takes into account both the discriminative power of weak polarization features and the generalization ability of the model, and is suitable for Raman spectroscopy datasets with small to medium sample sizes. A combined loss function of MSE and MAE (7:3 weighting) is employed. MSE optimizes the numerical differences in polarization features, while MAE improves robustness to outliers, adapting to the characteristics of training with small to medium sample sizes. A customized AdamW optimizer is used with an initial learning rate of 1e-3 and a weight decay coefficient of 1e-4, employing a cosine annealing strategy with a 50% learning rate decay every 10 epochs. Lightweight training strategies include: gradient accumulation (4 steps) to simulate large-batch training, mixed-precision training to reduce memory usage, and an early stopping strategy (stopping if the validation set loss does not decrease for 5 consecutive epochs) to avoid overfitting. Data is input in batches (size 16), and training lasts for 50-80 epochs. Throughout the process, the training / validation set loss values and feature discrimination (intra-class / inter-class distance) are monitored to ensure that the model captures weak polarization differences while possessing good generalization ability.
[0039] Step S136: Extract multi-stage intermediate features based on the trained network, fuse and standardize the intermediate features to generate a macrophage polarization weak difference feature set that combines shallow local feature information and deep abstract feature information; Based on the trained network, intermediate features (dimensions 16, 32, and 64) from multiple stages—feature extraction layer, attention enhancement layer, and feature fusion layer—are extracted. Z-score normalization is used to process features at each stage, and the mean and standard deviation of the training set are used to avoid data leakage and eliminate dimensional differences. Features are integrated through weighted fusion: shallow layer features have a weight of 0.2 (preserving wavenumber details), mid-layer features 0.3 (preserving inter-peak correlations), and deep layer features 0.5 (preserving abstract polarization features), generating a 128-dimensional feature vector. The feature vector is converted to a NumPy array and organized into a weakly differential polarization feature set according to sample dimensions, stored with the sample detection sequence, polarization label, and feature weights. This feature set integrates information from different levels, comprehensively and accurately representing the polarization state of macrophages, providing high-quality feature input for subsequent classification or regression tasks.
[0040] Step S137: Through multi-dimensional verification methods such as attention heatmap analysis, signal-to-noise ratio calculation and classification verification, verify the suppression effect of the attention module on irrelevant signals to ensure that the extracted polarization weak difference features are effective and highly recognizable.
[0041] First, attention heatmap analysis visualizes the attention weights for each wavenumber region, verifying that the weights of polarization-specific wavenumber regions are ≥0.3 higher than those of irrelevant regions, confirming effective suppression of irrelevant signals. Second, signal-to-noise ratio (SNR) calculation compares the SNR of features when the attention module is on and off, requiring an SNR increase of ≥20% after enabling the module, verifying feature purity. Third, classification validation involves inputting the fused features into an SVM classifier, requiring a classification accuracy of ≥88%, verifying the feature discrimination ability. Validation was performed using 100 clinical samples covering different polarization states and wound types to ensure comprehensive results. A validation report was generated, including heatmaps, SNR comparisons, and classification metrics. If validation failed, the attention module parameters or the number of convolutional units were adjusted, and the network was retrained until validation was passed, ensuring the effectiveness and high discriminative power of the extracted weakly differential polarization features.
[0042] Step S140: Establish a macrophage polarization continuous value classification model, and output polarization continuous values through a convolutional neural network to accurately characterize the degree of cell polarization and transition process; A continuous polarization genotyping model for macrophages was established. A modified convolutional neural network outputs continuous polarization values in the 0-1 range to accurately quantify the degree of polarization and capture the transition process. The model construction follows a logic of "feature extraction - continuous value regression - personalized adaptation," reusing the optimized core module for polarization feature extraction while retaining the ability to capture deep, weakly differential features. The classification output layer was modified into a regression layer to adapt for continuous value prediction. The training process employs a combination loss and optimization strategy adapted to small to medium sample sizes to ensure prediction accuracy, while calibration curves correct for systematic errors. Continuous values are interpreted segmented according to polarization state: 0-0.2 corresponds to strong M1, 0.2-0.8 corresponds to an intermediate state, and 0.8-1 corresponds to strong M2, achieving a refined representation of the polarization transition stage. After lightweight processing, the model is adapted for bedside equipment, providing clinical users with a polarization assessment tool that combines quantitative accuracy with process representation capabilities.
[0043] Step S141: Standardize the format of macrophage Raman spectroscopy data and perform standardization processing. Construct a polarization continuous value label with a value range of 0-1 based on the expression level of the gold standard biomarker. Use a lightweight data augmentation strategy to expand the training data and solidify the data foundation for model training. Unified wavenumber range 600-3000cm -1 The sequence length was adjusted to 1200 points using linear interpolation, with a length of 1003 cm⁻¹. -1 Internal reference peaks were normalized to eliminate differences in detection conditions. Min-Max normalization was used to narrow the spectral intensity to the 0-1 range, ensuring data standardization. Based on the expression levels of the gold standard biomarkers (iNOS and TNF-α for M1 type, and Arg-1 and IL-10 for M2 type), a 0-1 range polarization continuous value label was constructed through linear mapping, with the highest expression level corresponding to 1 and the lowest to 0. Lightweight data augmentation strategies included adding ±1% random intensity perturbation and ±2cm² perturbation to the spectrum. -1 The wavenumbers are slightly shifted to expand the training data volume (expansion ratio ≤30%) without changing the core features. After data preprocessing, the integrity is verified, and samples with missing biomarker expression levels or spectral anomalies are removed to construct a high-quality training dataset.
[0044] Step S142: Reuse the constructed macrophage polarization feature extraction core module, transform the original classification output layer into a regression output layer adapted for continuous value prediction in the 0-1 interval, and strictly control the total number of model parameters to meet the requirements of lightweight deployment. The core feature extraction module of the lightweight spectral attention convolutional neural network constructed in step S130 is reused. This module contains three sets of lightweight convolutional units and a dual-channel attention mechanism, with approximately 120k parameters. The original classification output layer (3 neurons, Softmax activation) is transformed into a regression output layer: a single-neuron structure is adopted, paired with a sigmoid activation function to ensure that the output value is limited to the 0-1 range. To meet the requirements of lightweight deployment, the regression output layer retains only one fully connected layer, with ≤32 neurons, and redundant hidden layers are removed, controlling the total number of model parameters to ≤150k. After the transformation, gradient stability is ensured through parameter initialization strategies (Xavier initialization for the regression layer). The module interface is seamlessly integrated with the original feature extraction module, without the need to adjust the feature dimensions, ensuring the compatibility and lightweight characteristics of the overall model structure.
[0045] Step S143: Customize the combined loss function of MSE and MAE to adapt to the polarization continuous value regression task, and combine it with AdamW optimizer and cosine annealing learning rate strategy to ensure the accuracy of continuous value prediction and the stability of model training process. A customized loss function combining MSE and MAE is used, with MSE accounting for 70% of the weight to optimize the overall prediction accuracy of polarization continuous values, and MAE accounting for 30% to improve the model's robustness to extreme values such as intermediate states, adapting to the needs of regression tasks with small to medium sample sizes. The AdamW optimizer is used, with an initial learning rate of 1e-3 and a weight decay coefficient of 1e-4 to suppress overfitting. A cosine annealing learning rate strategy is employed, with the learning rate decaying by 50% every 10 epochs to balance early convergence speed with later accuracy improvement. To adapt to the stability of continuous value prediction, a gradient clipping mechanism is introduced into the optimizer, with a gradient norm threshold set to 1.0 to avoid gradient explosion. The combined strategy has been validated through multiple rounds of experiments, demonstrating that it can reduce prediction errors while ensuring a smooth decrease in loss values during training, adapting to the needs of continuous value regression with weak spectral differences.
[0046] Step S144: Execute a refined training process of data input, feature extraction, and continuous value regression, introduce an early stopping strategy to avoid model overfitting, monitor RMSE and R² regression indicators in real time during training, and focus on ensuring the prediction accuracy of intermediate state polarization values. First, standardized spectral data is input into the model in batches (batch size 16). The feature extraction module captures weak polarization differences, and then the regression output layer outputs continuous values. An early stopping strategy is introduced during training, using the validation set RMSE as a monitoring metric. If the RMSE does not decrease for five consecutive epochs, training stops, and the optimal model weights are retained. Core regression metrics are monitored in real-time: RMSE and R² for both the training and validation sets, requiring R² ≥ 0.90 for the training set and R² ≥ 0.85 for the validation set. Special emphasis is placed on ensuring the prediction accuracy of polarization values in the intermediate state (0.2-0.8 range). Intermediate state samples are assigned a loss weight of 1.2 times to reduce prediction bias in this range, requiring RMSE ≤ 0.06 for these samples. The metric change curves are recorded throughout training, and the learning rate or batch size is adjusted promptly to ensure the model converges to a stable state.
[0047] Step S145: Output the original polarization continuous values in the 0-1 interval, construct a calibration curve based on the gold standard data to correct systematic errors; divide the continuous values into intervals according to polarization state to interpret them in segments and accurately characterize the macrophage polarization transition stage; First, the model-predicted continuous polarization values in the 0-1 interval are output. A calibration curve is then constructed based on gold standard data: 200 samples covering the entire polarization interval are selected, with the gold standard continuous values on the x-axis and the model-predicted values on the y-axis. A polynomial fitting is used to construct the calibration curve, correcting the model's systematic error. After correction, the deviation between the predicted values and the gold standard is reduced by ≥15%. The continuous values are interpreted segmentally according to polarization state: 0.0-0.2 represents strong M1 polarization, 0.2-0.4 represents an M1-dominant transitional state, 0.4-0.6 represents a neutral transitional state, 0.6-0.8 represents an M2-dominant transitional state, and 0.8-1.0 represents strong M2 polarization. Each interval corresponds to a clear range of biomarker expression and clinical significance. For example, a neutral transitional state indicates that macrophage polarization is not yet fully defined, providing a window for intervention and achieving precise characterization of the polarization transition process.
[0048] Step S146: The model is fully validated from three dimensions: regression accuracy, polarization transition characterization ability, and robustness, to ensure that continuous value prediction is accurate and can stably capture the polarization transition process. Regarding regression accuracy, the RMSE and R² of the test set were calculated, requiring RMSE ≤ 0.05 and R² ≥ 0.88 to ensure accurate prediction of continuous values. For polarization transition characterization, 50 intermediate state samples were selected to verify the continuity of the predicted value distribution within the transition interval, requiring the overlap rate of predicted values between adjacent transition intervals to be ≤ 10% and no cross-interval jumps. For robustness, ±3% Gaussian noise was added to the spectral data, and 5% of wavenumber points were randomly masked. The model's predicted RMSE fluctuation was verified to be ≤ 0.01, ensuring stable capture of polarization states even with slight data perturbations. The validation process employed a blinded test, selecting 100 clinical samples not involved in training to ensure objective and reliable validation results and comprehensively guarantee the model's practicality in clinical scenarios.
[0049] Step S147: Perform quantization and compression processing on the validated model, export a universal adaptation format, and write a standardized inference interface to adapt to the computing power limitations of bedside devices and actual usage needs, so as to realize the clinical application of the model.
[0050] The validated model undergoes 8-bit quantization compression, converting model weights from 32-bit floating-point to 8-bit integer. Predictive accuracy is preserved through quantization-aware training, reducing the model size to under 5MB. The model is exported in the ONNX universal format, compatible with mainstream inference frameworks (TensorFlowLite, PyTorchMobile). A standardized inference interface is developed, supporting input of standardized spectral data and optional clinical features, outputting calibrated polarization continuity values, segmented interpretation results, and prediction confidence (confidence ≥ 0.7 is considered valid). The interface is adapted to the ARM architecture of point-of-care devices, optimizing the inference process with a single-sample inference time ≤ 30ms, meeting real-time detection requirements. When deployed on point-of-care devices, offline operation is supported, requiring no network connection. A results visualization interface is provided, intuitively displaying polarization continuity values and transition stages for rapid interpretation by clinical staff.
[0051] Step S150: Add an individual heterogeneity-adaptive dynamic branching module to the main classification model, which integrates patient clinical characteristics and spectral characteristics to achieve personalized weak difference feature recognition. A dynamic branch module for individual heterogeneity adaptation is added to the main classification model. Its core function is to achieve personalized weak-difference feature recognition by fusing patient clinical characteristics with Raman spectral features. The dynamic branch, as an auxiliary module, does not alter the core structure of the main model; it only optimizes the output results through feature adaptation and fusion. Clinical features include key indicators such as patient age, duration of diabetes, wound area, and glycated hemoglobin level. These features work synergistically with spectral features to dynamically adjust feature weights based on individual physiological and wound microenvironment differences, strengthening weak-difference features strongly correlated with individual polarization states and weakening individual-specific interference signals. The module design strictly adheres to lightweight principles, ensuring that the overall parameter count and inference speed of the main model and dynamic branch meet bedside deployment requirements, achieving a precise recognition mode of "general model + personalized adaptation."
[0052] Step S151: Define the dynamic branch as an auxiliary module of the main model that adapts to individual patient differences. Its input is the spectral features extracted by the main model and the patient's clinical features, and its output is the personalized fusion features adapted to the main model. The total number of parameters of the dynamic branch is controlled within 10% of the number of parameters of the main model to meet the lightweight deployment requirements of bedside equipment. This module is an auxiliary unit for the main model adapted to individual patient differences. The input consists of two parts: 256-dimensional spectral weak difference features extracted by the main model, and a preprocessed 32-dimensional clinical feature vector. The output is a 128-dimensional personalized fusion feature, which can be directly input into the main model's output layer without additional dimensional adjustment. The total number of parameters in the dynamic branches is strictly controlled within 10% of the main model's parameters; if the main model has 150k parameters, the number of parameters in the dynamic branches is ≤15k. Lightweighting is achieved by simplifying the network structure (containing only 3 lightweight fully connected layers and 1 convolutional layer), ensuring that after the module is integrated, the overall inference speed of the main model decreases by no more than 10%, and the model size increases by ≤2MB, fully meeting the stringent requirements of bedside devices for computing power and storage, without affecting the ease of clinical use.
[0053] Step S152: Sort over the patient's clinical characteristics and divide them into discrete and continuous features. Normalize the continuous features and fill missing values with the median. Perform one-hot encoding on the discrete features. Concatenate the encoded discrete features with the normalized continuous features to form a fixed-dimensional clinical feature vector. Patient clinical characteristics were analyzed, and 12 core indicators were selected, divided into discrete and continuous features: discrete features included wound type (ulcerative / gangrenous), infection status (present / absent), and medication history (yes / no), totaling 3 items; continuous features included age, duration of diabetes, wound area, glycated hemoglobin, blood pressure, and blood lipids, totaling 9 items. Min-Max normalization was applied to the continuous features to shrink them to the 0-1 range and eliminate dimensional differences. For missing values (missing rate ≤5%), the median of patients of the same sex and age group was used for imputation to ensure data integrity. One-hot encoding was performed on the discrete features; for example, wound type was encoded as a 2D vector, and infection status as a 2D vector, resulting in a total of 8 dimensions for the discrete features. The encoded 8-dimensional discrete feature vector was concatenated with the 9-dimensional continuous feature vector to form a 17-dimensional fixed-dimensional clinical feature vector, which was then Z-score standardized for subsequent dynamic branch feature interactions.
[0054] Step S153: Construct a three-layer lightweight structure of clinical feature perception, dynamic weight generation, and spectral feature adaptation. First, capture the correlation between clinical features and spectral features through two fully connected layers to generate a dynamic weight vector in the 0-1 interval. Then, multiply the dynamic weight vector element-wise with the original spectral features output by the main model to strengthen individual related weak difference features and weaken irrelevant noise. A lightweight three-layer structure is constructed: clinical feature perception, dynamic weight generation, and spectral feature adaptation. The clinical feature perception layer consists of two fully connected layers: the first layer contains 32 neurons, and the second layer contains 16 neurons. The ReLU activation function is used to capture the correlation between clinical features and polarization states. The dynamic weight generation layer uses the Sigmoid activation function to convert the perception layer output into a 256-dimensional dynamic weight vector in the 0-1 range. This vector corresponds one-to-one with the spectral feature dimensions output by the main model. The spectral feature adaptation layer multiplies the dynamic weight vector element-wise with the spectral features, applying the weights to spectral features strongly correlated with individual clinical characteristics (such as the 785cm² feature of infected patients). -1 Peak correlation features are assigned high weights (0.7-0.9), while irrelevant noise (such as wound matrix interference signals) is assigned low weights (0.1-0.3), achieving the enhancement of weak differential features and the weakening of noise. All three layers are trained stably using batch normalization layers, and the total number of parameters is controlled within 12k to ensure lightweight design.
[0055] Step S154: Concatenate the clinical feature vector with the adapted spectral feature vector, extract feature interaction information through a 1×1 convolutional layer, and output personalized fusion features that can be directly input into the output layer of the main model; First, the 17-dimensional clinical feature vector and the adapted 256-dimensional spectral feature vector are concatenated column-wise to form a 273-dimensional joint feature vector. This is used to extract interaction information between features (such as high glycated hemoglobin +1445cm). -1To investigate the correlation between peak intensity, a 1×1 convolutional layer with 128 kernels, a stride of 1, and no padding is introduced to compress the 273-dimensional joint features to 128 dimensions, while simultaneously exploring the nonlinear correlation between clinical and spectral features. After convolution, a BatchNorm layer and a LeakyReLU activation function (negative slope 0.01) enhance feature representation, outputting a 128-dimensional personalized fusion feature. The dimension of this feature vector perfectly matches the input dimension of the main model's output layer, allowing direct input to the fully connected output layer of the main model without the need for an additional dimension transformation module. This ensures seamless integration of dynamic branches with the main model, improving overall inference efficiency.
[0056] Step S155: During the training phase, the dynamic branch learns the spectral feature weight rules corresponding to different clinical features. During the inference phase, a dynamic weight vector is generated in real time based on the clinical features of new patients. A learnable gating coefficient is added after the dynamic weight generation layer to balance the influence of clinical features on spectral features and avoid overfitting. During the training phase, the dynamic branch learns the spectral feature weight patterns corresponding to different combinations of clinical features through backpropagation. Examples include the polarization-specific peak weight distribution between young and elderly patients, and the difference in feature weights between infected and non-infected wounds, forming a clinical feature-spectral weight mapping relationship. During the inference phase, a dedicated dynamic weight vector is generated in real-time based on the clinical feature vector of a new patient. The entire process takes ≤0.5ms, without affecting real-time performance. A learnable gating coefficient (initial value 0.5) is added after the dynamic weight generation layer. This coefficient is adaptively adjusted through training to balance the influence of clinical features and spectral features. If the influence of clinical features on polarization state is weak (e.g., no infection, short disease course), the gating coefficient approaches 0.3, reducing the weight of clinical features. If the influence of clinical features is significant (e.g., severe infection), the gating coefficient approaches 0.7, strengthening the adaptation effect of clinical features and effectively avoiding feature distortion caused by over-adaptation.
[0057] Step S156: Load the pre-trained optimal weights of the main model without dynamic branches. First, freeze the main model and train the dynamic branches separately for 5 epochs. Then, unfreeze the main model and train it together for 45 epochs. Use the original MSE+MAE combined loss function and add a dynamic branch L2 regularization term. Adapt the AdamW optimizer, cosine annealing learning rate and early stopping strategy to ensure that the main model and dynamic branches converge together. First, the pre-trained optimal weights (validation set R² ≥ 0.85) are loaded onto the main model without dynamic branches. The feature extraction layer and output layer of the main model are frozen, and only the dynamic branch is trained for 5 epochs, allowing the dynamic branch to initially learn the association between clinical and spectral features. Then, the output layer of the main model is unfrozen, while the feature extraction layer remains frozen. The main model's output layer and dynamic branch are jointly trained for 20 epochs. Finally, all layers of the main model are unfrozen, and the entire model is jointly trained for 25 epochs, achieving synergistic optimization of feature extraction, dynamic adaptation, and output prediction. The loss function uses the MSE+MAE combined loss, with a new L2 regularization term (coefficient 1e-5) for the dynamic branch to suppress overfitting. The optimizer uses AdamW with a learning rate of 5e-4. The cosine annealing strategy decays the learning rate every 15 epochs. The early stopping strategy uses the RMSE of the joint validation set as the metric; training stops if there is no decrease after 6 consecutive epochs, ensuring that the main model and dynamic branch converge to the optimal state.
[0058] Step S157: Stratify and validate patients by grouping them according to their clinical characteristics. Each subgroup is required to have a predicted RMSE decrease of ≥10%. Select typical patient cases to validate the rationality of personalized weights. The deviation between the predicted value and the gold standard should be ≤0.02. Add slight noise to the clinical characteristics and validate that the fluctuation of the dynamic branch output weight is ≤5% to ensure the stability of the fit. Stratified validation grouped patients by clinical characteristics, including age (≤60 years / >60 years), wound area (≤5cm² / >5cm²), and infection status (present / absent), for a total of 6 subgroups. Each subgroup was required to show a ≥10% decrease in predicted RMSE compared to the control without dynamic branching. Case validation selected 30 typical patients (covering different ages, wound types, and infection statuses) to analyze the rationality of the personalized weight vector. The deviation of the predicted value from the gold standard was required to be ≤0.02, and the correlation between the weight distribution and clinical characteristics should conform to medical logic (e.g., higher weights for M1 polarization-related features in infected patients). Robustness validation added ±5% random noise to the clinical characteristics (e.g., age ±2 years, wound area ±0.5cm²) to verify that the fluctuation range of the dynamic branch output weights was ≤5%, ensuring that the adaptation effect remained stable even with slight measurement errors in clinical characteristics, without affecting the final prediction accuracy.
[0059] Step S158: By removing the bias term of the fully connected layer, using a 1×1 convolution kernel to control the dynamic branch parameter quantity, performing 8-bit quantization compression on the branch weight, embedding the dynamic branch into the main model and exporting it in a unified ONNX format, only additional clinical feature vectors need to be input during inference, increasing the single-sample inference time by ≤1ms, thus adapting to the real-time requirements of bedside equipment.
[0060] By removing the bias terms of fully connected layers and replacing traditional fully connected layers with 1×1 convolutional kernels, the number of parameters in the dynamic branch is compressed from 15k to less than 10k. Eight-bit quantization compression is performed on the branch weights, and quantization-aware training ensures that the prediction accuracy loss after compression is ≤2%. The dynamic branch is embedded in the main model, and exported in a unified ONNX format using PyTorch's torch.jit module, with an overall model size ≤8MB. A standardized inference interface is developed, supporting input spectral data (1200 dimensions) and clinical feature data (12 raw indicators, with automatic preprocessing within the interface). The single-sample inference time increases by only ≤1ms compared to without dynamic branches, meeting the real-time requirements of bedside devices. The interface is compatible with Windows, Linux, and embedded operating systems, providing both C++ and Python calling methods for easy integration with different types of bedside devices and rapid clinical deployment.
[0061] Step S160: A combined strategy of in vitro pre-training, in situ fine-tuning, and incremental learning is adopted to carry out phased training and continuous optimization of the fusion model of KPCA-regularized LDA and SA-CNN. A combined strategy of in vitro pre-training, in-situ fine-tuning, and incremental learning was employed to conduct phased training and continuous optimization of the KPCA-regularized LDA and SA-CNN fusion model. The in vitro pre-training phase utilized large-scale general Raman spectral data to enable the model to master the general extraction rules of polarization features. The in-situ fine-tuning phase optimized model parameters to adapt to the target scenario using specific spectral data for diabetic foot wounds. The incremental learning phase continuously absorbed new clinical data to update the model's knowledge and prevent performance degradation. The core of the combined strategy is the progressive logic of building general capabilities, adapting to scenarios, and long-term iteration. The fusion model achieves complementary advantages through feature-level fusion (discriminative features from KPCA + deep weak differential features from SA-CNN). Simultaneously, a full lifecycle management mechanism was established, ensuring the model's long-term adaptation to changes in the distribution of clinical data and maintaining stable polarization state recognition performance through regular retraining and outlier removal.
[0062] Step S161: Clarify the functional division of the SA-CNN module, which is responsible for extracting Raman spectral depth weak difference features, and the KPCA-regularized LDA module, which is responsible for extracting spectral discrimination features. Concatenate the features output by the two modules and complete feature fusion through convolutional layers. Control the total number of model parameters to ≤150k. Complete the parameter initialization of SA-CNN, KPCA-regularized LDA and fusion layer, and build the basic model architecture for phased training. The SA-CNN module is responsible for extracting deep weakly discriminative features from Raman spectra. This module contains three sets of lightweight convolutional units and a dual-channel attention mechanism, outputting 256-dimensional features. The KPCA-regularized LDA module is responsible for extracting linear discriminative features from the spectra, outputting 64-dimensional features. The two types of features are concatenated column-wise to form a 320-dimensional joint feature, which is then input into a 1×1 convolutional fusion layer (64 convolutional kernels) and compressed into a 64-dimensional fused feature for subsequent classification or regression tasks. The total number of model parameters is strictly controlled to ≤150k, with the SA-CNN module accounting for 120k, the KPCA-regularized LDA module accounting for 20k, and the fusion layer accounting for 10k. Parameter initialization adopts a differential strategy: the SA-CNN convolutional layers are initialized with He, and the fully connected layers are initialized with Xavier; the KPCA-regularized LDA projection matrix is initialized with random orthogonal initialization to ensure gradient stability in the early stages of training, laying a structural foundation for phased training.
[0063] Step S162: Based on a general Raman spectrum dataset of ≥5000 images, the SA-CNN module, KPCA-regularized LDA module, and fusion layer are pre-trained independently in separate modules. After training, the pre-training effect is evaluated by RMSE and R² metrics. Once the metrics are met, the pre-training weights of each module are saved, so that the model has the ability to extract and discriminate spectral features across scenes. Pre-training was conducted using a general Raman spectroscopy dataset of ≥5000 entries. This dataset covers Raman spectra of macrophages at different polarization stages (M1, M2, intermediate states) and from different cell sources (in vitro culture, animal models, clinical samples), ensuring data diversity. Modules were pre-trained independently: the SA-CNN module used the training strategy in step S135 (combined loss, AdamW optimizer) for 60 epochs; the KPCA-regularized LDA module optimized the kernel function and parameters through grid search for 30 epochs; and the fusion layer was jointly trained with the SA-CNN module for 40 epochs. Pre-training performance was evaluated using RMSE and R² metrics, requiring a validation set R² ≥ 0.85 for the SA-CNN module, a classification accuracy ≥ 82% for the KPCA-regularized LDA module, and a validation set R² ≥ 0.88 for the fusion model. Once the metrics are met, the pre-trained weights of each module (SA-CNN weights, KPCA kernel parameters and projection matrix, fusion layer weights) are saved to enable the model to extract and discriminate spectral features across scenes, providing high-quality initial parameters for subsequent transfer fine-tuning.
[0064] Step S163: Transfer the pre-trained model to the target dataset of macrophage Raman spectroscopy of diabetic foot wounds. Adopt a staged fine-tuning strategy of first freezing the backbone, then unfreezing the fusion layer, and then gradually unfreezing the feature extraction layer to adapt to the weak spectral difference features in the diabetic foot scenario. During the fine-tuning process, optimize the kernel parameters of the KPCA module to improve the feature fusion effect. Monitor the RMSE and R² indicators of the validation set in real time and execute an early stopping strategy to avoid overfitting. The pre-trained model was transferred to the target dataset of macrophage Raman spectroscopy for diabetic foot wounds (containing 1000 clinical samples), employing a phased fine-tuning strategy: Phase 1 (1-10 epochs): The feature extraction layer and KPCA-regularized LDA module of SA-CNN were frozen, while only the fusion layer was unfrozen, optimizing the fusion weights to adapt to the target scene features; Phase 2 (11-30 epochs): The last set of convolutional units and attention module of SA-CNN were unfrozen, and the fusion layer and the local structure of SA-CNN were jointly optimized; Phase 3 (31-50 epochs): All layers were unfrozen, and the entire model was fine-tuned. During fine-tuning, the kernel parameters of the KPCA module (such as the gamma value of the RBF kernel) were optimized, evaluated every 5 epochs, and the parameter combination with the best performance on the validation set was selected. The RMSE and R² of the validation set were monitored in real time, requiring R² ≥ 0.90 after fine-tuning, and an early stopping strategy was implemented (stopping if there was no improvement after 5 consecutive epochs). Overfitting was suppressed by gradient clipping (threshold 1.0) and Dropout (probability 0.15) to ensure that the model fits the weak spectral difference features of diabetic foot wounds (such as interference signals from wound cells and matrix).
[0065] Step S164: Perform cross-device calibration and standardized preprocessing on the newly added clinical Raman spectroscopy data, adopt an elastic weight consolidation strategy to protect the old knowledge already learned by the model, input the preprocessed incremental data into the model in batches for training, evaluate the model's performance indicators on the new and old data simultaneously after training, and perform lightweight heavy training on the model every quarter to integrate the new and old knowledge. Cross-device calibration uses the characteristic peak (1003 cm⁻¹) of a standard sample (polystyrene film). -1 1601cm -1Based on this, the wavenumber and intensity consistency of spectra acquired by different devices were adjusted. Baseline correction, denoising, and normalization were performed according to the standard of step S111, and outlier data was removed using the 3σ criterion. An elastic weight consolidation (EWC) strategy was adopted to protect existing knowledge, assigning protective weights to key parameters in the pre-training and fine-tuning stages (such as the convolutional kernel weights of SA-CNN and the projection matrix of KPCA) to prevent the forgetting of existing knowledge due to training with new data. Preprocessed incremental data was input into the model for training in batches (200 cases per batch), with each batch trained for 30 epochs. After training, the model's performance metrics on both old and new data were evaluated simultaneously (R² ≥ 0.88 for old data, R² ≥ 0.90 for new data). The model underwent lightweight retraining every quarter, integrating accumulated incremental data (≥ 500 cases) to re-optimize model parameters, ensuring effective fusion of old and new knowledge and maintaining stable model performance.
[0066] Step S165: Set evaluation metrics for each stage of pre-training, transfer fine-tuning, and incremental learning; dynamically adjust the learning rate and Dropout hyperparameters based on the evaluation results of each stage; and verify that the model converges and meets the criteria at each stage. The pre-training phase focuses on cross-scene feature generalization, with evaluation metrics including R² across different data sources, classification accuracy, and feature visualization clustering effects, requiring R² fluctuation ≤5% across data sources. The transfer fine-tuning phase focuses on target scene adaptability, with evaluation metrics including RMSE, R², and intermediate state prediction bias on the target dataset, requiring intermediate state RMSE ≤0.05. The incremental learning phase focuses on compatibility between old and new data, with evaluation metrics including old data performance degradation rate (≤3%), new data accuracy (≥92%), and model stability (R² fluctuation ≤2% across three consecutive batches of data). Hyperparameters are dynamically adjusted based on the evaluation results of each phase: if the learning rate is too high and causes oscillations during the pre-training phase, it is reduced to 50% of its original value; if overfitting occurs during the fine-tuning phase, the Dropout probability is increased from 0.15 to 0.2; if the compatibility between old and new data is low during the incremental learning phase, the protection weight of the EWC strategy is increased. After each phase of training is completed, it is verified whether the model has converged to the target (meeting the preset threshold); if not, the strategy is backtracked and retrained.
[0067] Step S166: Establish a model version management mechanism and a performance baseline comparison system. Every 6 months, integrate the accumulated clinical data to retrain the model. Before training, label and remove abnormal samples in the incremental data. Through the above management methods, ensure that the model adapts to changes in clinical data in the long term and maintains stable feature extraction and discrimination effects.
[0068] Model version management adopts a main version + iteration version naming convention. The main version is updated annually (e.g., V2024), and the iteration version is updated in incremental training batches (e.g., V2024.01). Each version records core parameters, training data, performance metrics, and update logs to ensure traceability. The performance baseline comparison system uses the initial fine-tuned model performance as the benchmark (R²≥0.90, accuracy≥92%). After each incremental training, the model is compared with the baseline. If the performance degradation is ≥5%, a full retraining is triggered. Every 6 months, accumulated clinical data (≥1000 cases) is integrated. Before training, abnormal samples (e.g., excessive spectral noise, abnormal biomarker expression) are removed using a combination of the 3σ criterion and manual review, with the percentage of abnormal samples ≤3%. Full retraining uses the fine-tuning strategy in step S163 to optimize all module parameters, ensuring that the model adapts to changes in the distribution of clinical data in the long term (e.g., changes in polarization characteristics caused by changes in patient age structure and treatment regimens), maintaining stable feature extraction and discrimination effects.
[0069] Step S170: Construct an ensemble classifier that integrates multiple models, perform weighted fusion and rule calibration on the analysis results of different models, and output the final classification result of macrophage polarization state.
[0070] The core of building an ensemble classifier that integrates multiple models is to combine the strengths of different models and improve classification accuracy and stability through weighted fusion and rule calibration. The model pool includes four complementary models: SA-CNN (excels at deep weak differential features and intermediate state recognition), KPCA-regularized LDA (excels at linear discriminant analysis and extreme state recognition), XGBoost (excels at clinical-spectral feature fusion), and kernel SVM (excels at nonlinear feature classification). The ensemble process follows the logic of independent prediction-weighted fusion-rule calibration-result output. First, each model independently outputs classification results and probabilities. Then, the fusion weights are dynamically adjusted based on model performance. Finally, bias is corrected through hierarchical rules and threshold optimization. The classifier not only outputs the final polarization state (strong M1 / intermediate / strong M2) but also provides detailed auxiliary information to meet clinical interpretability needs. It also has iterative optimization capabilities, allowing performance to continuously improve with new data.
[0071] Step S171: Construct a complementary model pool consisting of SA-CNN deep model, KPCA-regularized LDA model, XGBoost model, and kernel SVM model. Unify the input features of all models to a fusion feature set of standardized Raman spectral features and encoded clinical features. Unify the classification target to a three-class classification of strong M1, intermediate state, and strong M2 and label the categories. Unify the output format of all models to the hard classification label and soft classification probability of the corresponding category. SA-CNN deep model (150k parameters), KPCA-regularized LDA model (20k parameters), XGBoost model (100 trees, tree depth 6), and kernel SVM model (RBF kernel). Input features are standardized across all models: 600-3000cm. -1 A fusion feature set (1217 dimensions) of standardized Raman spectral features (1200 dimensions) and 17-dimensional clinical feature vectors was used. The unified classification objective was three-class classification: strong M1 (label 0), intermediate state (label 1), and strong M2 (label 2), based on the gold standard polarization state labeling. A unified output format was used: hard classification labels (0 / 1 / 2) and corresponding soft classification probabilities for the three classes (e.g., [0.92, 0.05, 0.03]), with a probability sum of 1. Data format standardization (all converted to NumPy arrays), feature dimension alignment, and unified label encoding ensured the consistency of input and output across models, laying the foundation for subsequent weighted fusion. This also highlighted the complementarity of the model pools, covering different feature extraction logics such as deep learning / traditional, linear / nonlinear, and spectral / multi-feature fusion.
[0072] Step S172: Using the same partitioned training / validation / test dataset, complete independent training according to the optimal training strategy of each model, and quantitatively evaluate the performance of each model from the dimensions of overall accuracy, precision of each category, recall, and F1 score. Calculate and assign initial fusion weights based on the mean of the F1 scores of each model for each category. The same training / validation / test dataset (7:1:2 ratio) was used, containing 2000 clinical samples to ensure consistent training data across models. Each model was trained independently using its optimal strategy: SA-CNN employed the training strategy of step S135 (combined loss, AdamW optimizer) for 80 epochs; KPCA-regularized LDA used the optimization strategy of step S122, with grid search kernel parameters; XGBoost was set with a learning rate of 0.1, 100 iterations, and a tree depth of 6, and optimized using cross-validation; Kernel SVM optimized the C-value and gamma value through grid search. Multi-dimensional performance evaluation: Overall accuracy, precision, recall, and F1 score for each category are calculated. Example evaluation results are for SA-CNN (89% accuracy, intermediate F1 score = 0.88), KPCA-regularized LDA (87% accuracy, strong M1 / M2 F1 score = 0.90), XGBoost (86% accuracy, strong M2 F1 score = 0.89), and kernel SVM (85% accuracy, strong M1 F1 score = 0.88). Initial fusion weights are calculated based on the mean F1 score for each category: SA-CNN 0.35, KPCA-regularized LDA 0.30, XGBoost 0.20, and kernel SVM 0.15, with a weight sum of 1, thus allocating fusion weights according to performance.
[0073] Step S173: First, the soft classification probabilities output by each model are weighted and summed based on the initial fusion weights to obtain the initial fusion probability. Then, the sample difficulty coefficient based on the divergence entropy value of the sample prediction by all models is introduced. For high-difficulty samples, the weight of the best model is increased and the weight of the worst model is decreased. For low-difficulty samples, the static weight is maintained to complete the dynamic adjustment of the weights. Finally, the dynamically adjusted fusion probability is normalized to obtain the initial classification result. A fusion strategy of "static weighting + dynamic adjustment" is adopted: First, based on the initial fusion weights, the soft classification probabilities output by each model are weighted and summed. For example, the fusion probability of strong M1 = SA-CNN probability × 0.35 + KPCA-regularized LDA probability × 0.30 + XGBoost probability × 0.20 + kernel SVM probability × 0.15. Similarly, the fusion probabilities of intermediate states and strong M2 are calculated to obtain the initial fusion probability vector. A sample difficulty coefficient is introduced, which is calculated based on the entropy value of the divergence between the predictions of all models for the sample. The higher the entropy value, the greater the divergence and the higher the sample difficulty. The dynamic adjustment rules for weights are as follows: if the entropy value > 0.8 (high-difficulty samples), the weight of the best model (such as SA-CNN) is increased by 0.1, and the weight of the worst model (such as kernel SVM) is decreased by 0.1; if the entropy value < 0.4 (low-difficulty samples), the static weights remain unchanged; if the entropy value is between 0.4 and 0.8, the weights are finely adjusted proportionally. After dynamic adjustment, the fusion probability vector is normalized (divided by the sum of probabilities) to ensure that the sum is 1. The category corresponding to the maximum probability is selected as the initial classification result to improve the fusion robustness.
[0074] Step S174: Based on the category recognition advantages of each model, formulate hierarchical calibration rules, match the results of the preset polarization feature rule library to the high-disparity abnormal samples, and optimize the fusion probability judgment threshold, wherein the intermediate state judgment threshold is lowered and the strong M1 / strong M2 judgment threshold is raised to correct the deviation of the initial classification results. The strong M1 calibration rule is as follows: if the probability of KPCA-regularized LDA for strong M1 is >0.85, and the initial fusion result is an intermediate state, then it is corrected to strong M1. The strong M2 calibration rule is as follows: if the probability of XGBoost for strong M2 is >0.85, and the initial fusion result is an intermediate state, then it is corrected to strong M2. The intermediate state calibration rule is as follows: if the probability of SA-CNN for the intermediate state is >0.8, and the initial fusion result is strong M1 / strong M2, then it is corrected to an intermediate state. For high-divergence anomaly samples (entropy >1.0), a pre-defined polarization feature rule base is used for matching. This rule base includes long pathological durations +785cm. -1 High peak intensity → strong M1, high glycated hemoglobin +1445cm -1Twenty core rules, including high peak intensity (strong M2), are constructed based on spectroscopic priors and clinical experience. The fusion probability determination thresholds have been optimized: the intermediate state threshold has been lowered from 0.5 to 0.45, and the strong M1 / strong M2 threshold has been raised from 0.5 to 0.55, reducing misclassification and missed classifications and correcting biases in initial classification results.
[0075] Step S175: Encapsulate the complete process of model prediction, static weighting, dynamic adjustment, rule calibration, and result output. Use 5-fold cross-validation combined with grid search to optimize the static weight allocation ratio, sample difficulty entropy threshold, and rule calibration probability threshold. For each new batch of data, re-evaluate the performance of the basic model and update the initial fusion weights. Iterate and optimize the rule calibration library based on new sample misjudgment cases. This paper encapsulates the complete workflow of an ensemble classifier, employing Python classes to encapsulate five functional modules: model prediction, static weighting, dynamic adjustment, rule calibration, and result output. It supports batch processing and single-sample prediction. The core parameters are optimized using 5-fold cross-validation combined with grid search: the search step size for the static weight allocation ratio is 0.05, the search range for the sample difficulty entropy threshold is 0.3-1.0 (step size 0.1), and the search range for the rule calibration probability threshold is 0.4-0.6 (step size 0.05). The optimization objective is to maximize the overall F1 score of the ensemble classifier, with a focus on ensuring the F1 score of intermediate states. For each new batch of data (≥200 records), the performance metrics of the base model are re-evaluated, and the initial fusion weights are updated according to step S172. Misclassified cases in new samples (e.g., strong M1 being misclassified as an intermediate state) are collected, and the reasons are analyzed before supplementing or adjusting the rule calibration library (e.g., adding high TNF-α expression +785cm). -1 Peak area ratio > 2 → strong M1 rule), to achieve iterative optimization of the ensemble classifier.
[0076] Step S176: Output the classification results of macrophage polarization state, and simultaneously output auxiliary information such as fusion probability, sample difficulty coefficient, contribution of each basic model, feature contribution value and rule calibration trigger description; Output the classification results of macrophage polarization states (strong M1 / intermediate / strong M2), and simultaneously output multi-dimensional auxiliary information: the final fusion probability of the three polarization states (e.g., [0.93, 0.04, 0.03]), intuitively showing the classification confidence; the sample difficulty coefficient (entropy value), indicating the classification difficulty of the sample; the contribution of each basic model (e.g., SA-CNN 42%, KPCA-regularized LDA 31%), explaining the impact of each model on the final result; and the contribution values of the first three key features (e.g., 785cm). -1The output includes peak intensity, wound area, and duration of diabetes, explaining the classification criteria. If rule calibration is triggered, a calibration trigger explanation is output (e.g., due to KPCA-regularized LDA strong M1 probability 0.87 > 0.85, it is corrected to strong M1). All output information is stored in JSON format, and a visualization report (including fusion probability bar chart and feature contribution heatmap) is generated to meet the needs of clinical medical staff for interpretability and traceability of results, facilitating clinical decision-making and case analysis.
[0077] Step S177: Verify the performance of the ensemble classifier from the dimensions of overall accuracy and F1 value of each category. Verify robustness by adding spectral Gaussian noise and masking some clinical features. The overall accuracy of the ensemble classifier should be improved by ≥3% compared to the best single base model. Based on misjudgment cases in clinical applications, analyze the reasons and retrain the target base model, supplement calibration rules or expand the model pool to complete the iterative optimization of the ensemble classifier.
[0078] In terms of core performance, the overall accuracy and F1 score of each category on the test set are calculated, requiring an overall accuracy of ≥92%, a strong M1 / M2 F1 score of ≥0.90, and an intermediate F1 score of ≥0.89. Regarding robustness, adding ±5% Gaussian noise to spectral features verifies an accuracy decrease of ≤2%; randomly masking 10% of clinical features verifies an accuracy decrease of ≤1%. Performance comparison requires the overall accuracy of the ensemble classifier to be ≥3% higher than the best single base model (e.g., SA-CNN 89%). Based on misclassification cases in clinical applications (≥50 cases collected per quarter), the causes of misclassification are analyzed: if the misclassification is due to insufficient performance of a base model (e.g., low recognition rate of strong M2 kernel SVM), the model is retrained; if the misclassification is due to missing rules (e.g., no corresponding calibration rules for special wound types), calibration rules are added; if the misclassification is due to insufficient model pool coverage (e.g., failure to consider rare polarization subtypes), an adapted model (e.g., LightGBM) is added. Through continuous iterative optimization, the performance of the ensemble classifier is ensured to steadily improve, meeting the needs of accurate clinical diagnosis.
[0079] Based on the same inventive concept, please refer to Figure 2 The diagram shows a schematic block diagram of a diabetic foot wound healing process monitoring system 100 provided in this application embodiment for performing the above-described diabetic foot wound healing process monitoring method. The diabetic foot wound healing process monitoring system 100 may include a communication unit 110, a machine-readable storage medium 120, and a processor 130.
[0080] In this embodiment, both the machine-readable storage medium 120 and the processor 130 are located within the diabetic foot wound healing process monitoring system 100 and are separately configured. However, it should be understood that the machine-readable storage medium 120 may also be independent of the diabetic foot wound healing process monitoring system 100 and may be accessed by the processor 130 via a bus interface. Alternatively, the machine-readable storage medium 120 may also be integrated into the processor 130 and may communicate and interact with external systems via the communication unit 110.
[0081] The processor 130 is the control center of the diabetic foot wound healing process monitoring system 100. It connects various parts of the system via various interfaces and lines, and performs various functions and processes data by running or executing software programs and / or modules stored in the machine-readable storage medium 120, and by calling data stored in the machine-readable storage medium 120, thereby providing overall monitoring of the system. Optionally, the processor 130 may include one or more processing cores; for example, the processor 130 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor. The machine-readable storage medium 120 stores machine-executable instructions for implementing the scheme of this application, and the processor 130 executes the machine-executable instructions stored in the machine-readable storage medium 120 to implement the diabetic foot wound healing process monitoring method provided in the aforementioned method embodiments.
[0082] It should be noted that, in order to simplify the description of the present invention and thus help to understand one or more embodiments of the invention, multiple features may sometimes be grouped into one embodiment, drawing or description thereof in the foregoing description of the embodiments of the present invention.
Claims
1. A method for monitoring the healing process of diabetic foot wounds, characterized in that: Includes the following steps: We extract and fuse weak difference features of macrophage polarization Raman spectra from multiple dimensions to form a multi-dimensional feature set containing weak difference information. An adaptive kernel learning KPCA-regularized LDA fusion algorithm is constructed to perform dimensionality reduction on multi-dimensional feature sets and complete preliminary classification. A lightweight spectral attention convolutional neural network is constructed to selectively extract deep local weak difference features of Raman spectra and suppress interference from irrelevant signals. A continuous polarization value classification model for macrophages was established, and continuous polarization values were output through a convolutional neural network to accurately characterize the degree of cell polarization and the transition process. A dynamic branching module for individual heterogeneity adaptation is added to the main classification model, which integrates patients' clinical characteristics and spectral characteristics to achieve personalized weak difference feature recognition. A combined strategy of in vitro pre-training-in situ fine-tuning and incremental learning was adopted to carry out phased training and continuous optimization of the fusion model of KPCA-regularized LDA and SA-CNN; An ensemble classifier that integrates multiple models is constructed. The analysis results of different models are weighted, fused, and calibrated according to rules to output the final classification result of macrophage polarization state.
2. The method for monitoring the healing process of diabetic foot wounds according to claim 1, characterized in that: The multidimensional extraction and fusion of weak differential Raman spectral features of macrophage polarization forms a multidimensional feature set containing weak differential information, including: The raw Raman spectral data of macrophages from diabetic foot wounds were sequentially subjected to adaptive polynomial fitting baseline correction, db4 wavelet basis 3-layer decomposition denoising, and 1003cm. -1 The internal reference peaks were normalized, and outlier data were removed using the 3σ criterion to obtain a standardized Raman spectrum dataset. Based on the preset M1 and M2 polarization-specific Raman characteristic peak reference library, the characteristic peak vertices in the Raman spectrum are located using the continuous wavelet transform peak detection algorithm. The peak shape correlation parameters of the characteristic peaks are calculated and the peak shape correlation parameters are Z-score standardized to form a subset of peak shape micro-features. Feature peak pairs with high polarization discrimination are selected, and the peak area and vertex intensity of the feature peak pairs are calculated. The peak area ratio, vertex intensity ratio and corresponding coefficient of variation are further obtained. The ratio and coefficient of variation are standardized to form a subset of inter-peak correlation features. The Raman spectral wavenumbers are divided into three functional regions, and a corresponding sliding window and step size are set for each functional region. Based on the sliding window and step size, trend feature parameters of each region are extracted, and PCA dimensionality reduction and standardization are performed on the trend feature parameters to form a wavenumber sequence trend feature subset. The peak-shaped micro-feature subset, the inter-peak correlation feature subset, and the wavenumber sequence trend feature subset are concatenated to construct an initial fusion feature matrix. Highly correlated features in the initial fusion feature matrix are removed by Pearson correlation coefficient, and collinear features are removed by variance inflation factor test. The importance of the features after redundancy removal is evaluated and ranked by random forest algorithm. Invalid features are removed by combining spectroscopic prior knowledge. The remaining features are normalized again to obtain a multi-dimensional fusion feature set. The effectiveness of the multi-dimensional fusion feature set was verified by analysis of variance, confirming that it can effectively distinguish the M1 and M2 polarization states of macrophages.
3. The method for monitoring the healing process of diabetic foot wounds according to claim 2, characterized in that: The Raman spectral wavenumbers are divided into three functional intervals, and a corresponding sliding window and step size are set for each functional interval. Trend feature parameters for each interval are extracted based on the sliding window and step size. These trend feature parameters are then subjected to PCA dimensionality reduction and standardization to form a subset of wavenumber sequence trend features, including: Three standardized Raman spectral feature subsets are organized, sample dimensions are unified and sample matching is completed according to detection sequence number, all feature parameters are converted to floating point type, and a unique named label containing feature type and meaning is added to each feature parameter; The three feature subsets are concatenated column by column to construct an initial fused feature matrix, the initial fused feature matrix is stored, and a feature column name index table is generated. The feature column name index table clarifies the feature type, meaning and naming information corresponding to each column in the initial fused feature matrix. Based on the initial fusion feature matrix, Pearson correlation coefficients are calculated by feature column to generate a symmetric feature correlation coefficient matrix and the autocorrelation coefficients on the diagonal of the matrix are marked. The absolute value of the correlation coefficient ≥ 0.9 is set as the high correlation threshold. The feature correlation coefficient matrix is traversed to identify high correlation feature pairs. Features are selected and retained according to the principle of feature importance, and the remaining high correlation features are removed to generate a de-correlation fusion feature matrix. At the same time, the removal information of high correlation features is recorded to form a feature selection log. For the aforementioned high-correlation fusion feature matrix, each feature column is used as the dependent variable and the remaining feature columns are used as independent variables to construct a univariate linear regression model. The determination coefficient R² of each model is solved by the least squares method. The variance inflation factor (VIF) value of each feature is calculated according to the VIF calculation formula. A VIF>10 is set as the collinearity threshold. After sorting the VIF values of all features in descending order, the feature column with the largest VIF value is iteratively removed until the VIF value of all features in the matrix is ≤10. During the iteration process, the information on the removal of collinear features is recorded to form a collinearity feature screening log. After verifying the dimension and data integrity of the feature matrix after the iteration, confirm that there are no missing or outlier values in the matrix. Then, associate and store the verified feature matrix with the feature column name index table, feature filtering log, and collinear feature filtering log to obtain a standardized deredundancy fusion feature matrix.
4. The method for monitoring the healing process of diabetic foot wounds according to claim 1, characterized in that: The KPCA-regularized LDA fusion algorithm based on adaptive kernel learning is used to perform dimensionality reduction on multi-dimensional feature sets and complete preliminary classification, including: Load the redundant fusion feature matrix of the Raman spectrum and perform min-max normalization. Divide the training set and test set into stratified sampling at a ratio of 8:
2. Convert the dataset into NumPy array format and record the M1 / M2 / intermediate polarization label of each sample. Four candidate kernel function pools were identified and the parameter search space of each kernel function was defined. A joint optimization objective function was designed. The kernel function and parameters were optimized by combining 5-fold cross-validation with grid search. The kernel matrix was calculated based on the optimal kernel function and parameter configuration and the kernel matrix was centered. The principal components with a cumulative variance contribution rate ≥95% were selected to construct the KPCA projection matrix and the features of the training set and test set were mapped to the low-dimensional kernel principal component space. Calculate the inter-class scatter matrix and intra-class scatter matrix of the features after KPCA dimensionality reduction. Combine the coefficient of variation of the sample number with the trace of the intra-class scatter matrix to adaptively calculate the regularization coefficient, construct the regularized intra-class scatter matrix, solve the eigenvalues and eigenvectors of the regularized LDA, construct the LDA projection matrix, and project the features of the kernel principal component space to the LDA subspace. A Bayesian classifier is constructed based on the training set features of the LDA subspace. The test set features of the LDA subspace are input into the Bayesian classifier. The polarization classification results of macrophage M1 / M2 / intermediate states are output according to the maximum a posteriori probability criterion, and the classification confidence of each sample is recorded. Calculate the classification accuracy and precision performance metrics and plot the confusion matrix. If the overall classification accuracy is less than 85%, expand the kernel parameter search range, adjust the regularization coefficient weights, and re-execute parameter optimization. Save the optimal parameter configuration and perform lightweight processing on the model to make the model suitable for bedside device deployment.
5. The method for monitoring the healing process of diabetic foot wounds according to claim 1, characterized in that: The construction of a lightweight spectral attention convolutional neural network, which specifically extracts deep local weak difference features of Raman spectra and suppresses interference from irrelevant signals, includes: The wavenumber range, sequence length, and intensity scale of Raman spectral data are unified and converted into a tensor format suitable for convolutional neural networks. The dataset is split into layers to eliminate the impact of inconsistent data formats and distribution bias on model training. A lightweight convolutional unit adapted to one-dimensional Raman spectroscopy is constructed based on depthwise separable convolution, which reduces the number of model parameters and computational cost while accurately capturing the feature correlation between continuous wavenumbers in local spectra. A dual-channel lightweight attention mechanism was designed to focus on the characteristic information of the polarization-specific wavenumber region of macrophages, weaken irrelevant signals generated by impurities and matrix in the wound, and strictly control the number of parameters of the attention module to meet the overall lightweight requirements. By integrating multiple sets of lightweight convolutional units and polarization attention modules, a low-parameter convolutional neural network structure is constructed. Through multiple rounds of feature extraction, enhancement and integration, core weak differential features that can characterize the polarization state of macrophages are output. The network is trained efficiently using a combination of loss functions, a customized optimizer, and a lightweight training strategy, balancing the discriminative power of weak polarization features with the generalization ability of the model, and is suitable for Raman spectroscopy datasets with small to medium sample sizes. Based on the trained network, multi-stage intermediate features are extracted, and the intermediate features are fused and standardized to generate a macrophage polarization weak difference feature set that combines shallow local feature information and deep abstract feature information. Through multi-dimensional verification methods such as attention heatmap analysis, signal-to-noise ratio calculation, and classification verification, the effect of the attention module on suppressing irrelevant signals is verified, ensuring that the extracted polarization weak difference features are effective and highly discriminative.
6. The method for monitoring the healing process of diabetic foot wounds according to claim 1, characterized in that: The establishment of a continuous polarization value classification model for macrophages, which outputs continuous polarization values through a convolutional neural network to accurately characterize the degree of cell polarization and the transition process, includes: The format of macrophage Raman spectroscopy data was standardized and processed. Polarization continuous value labels with values ranging from 0 to 1 were constructed based on the expression levels of gold standard biomarkers. Lightweight data augmentation strategies were used to expand the training data and strengthen the data foundation for model training. The core module for extracting macrophage polarization features was reused, and the original classification output layer was transformed into a regression output layer adapted for predicting continuous values in the 0-1 interval. The total number of model parameters was strictly controlled to meet the requirements for lightweight deployment. A customized loss function combining MSE and MAE is used to adapt to polarized continuous value regression tasks. Combined with the AdamW optimizer and cosine annealing learning rate strategy, the accuracy of continuous value prediction and the stability of the model training process are ensured. A refined training process is implemented, including data input, feature extraction, and continuous value regression. An early stopping strategy is introduced to avoid model overfitting. RMSE and R² regression indicators are monitored in real time during training to ensure the prediction accuracy of intermediate state polarization values. Output the raw polarization continuous value in the 0-1 interval, construct a calibration curve based on gold standard data to correct systematic errors; divide the continuous value into intervals according to polarization state to interpret the segmented value, accurately characterize the macrophage polarization transition stage; The model was fully validated from three dimensions: regression accuracy, polarization transition characterization ability, and robustness, to ensure that continuous value prediction is accurate and can stably capture the polarization transition process. The validated model is subjected to quantization and compression processing, a universal adaptation format is exported, and a standardized inference interface is written to adapt to the computing power limitations of bedside devices and actual usage needs, so as to realize the clinical application of the model.
7. The method for monitoring the healing process of diabetic foot wounds according to claim 1, characterized in that: The main classification model is enhanced with an individual heterogeneity-adaptive dynamic branching module, which integrates patient clinical characteristics and spectral features to achieve personalized weakly differential feature recognition, including: The dynamic branch is defined as an auxiliary module of the main model that adapts to individual patient differences. Its input is the spectral features extracted by the main model and the patient's clinical features, and its output is the personalized fusion features adapted to the main model. The total number of parameters of the dynamic branch is controlled within 10% of the number of parameters of the main model to meet the lightweight deployment requirements of bedside equipment. The patient's clinical characteristics were analyzed and divided into discrete and continuous features. The continuous features were normalized and missing values were filled with median. The discrete features were one-hot encoded. The encoded discrete features were concatenated with the normalized continuous features to form a fixed-dimensional clinical feature vector. We construct a three-layer lightweight structure for clinical feature perception, dynamic weight generation, and spectral feature adaptation. First, we capture the correlation between clinical features and spectral features through two fully connected layers to generate a dynamic weight vector in the 0-1 interval. Then, we multiply the dynamic weight vector element-wise with the original spectral features output by the main model to strengthen individual-related weak difference features and weaken irrelevant noise. The clinical feature vector is concatenated with the adapted spectral feature vector, and the feature interaction information is extracted through a 1×1 convolutional layer to output a personalized fusion feature that can be directly input into the output layer of the main model. During the training phase, the dynamic branches learn the weight rules of spectral features corresponding to different clinical features. During the inference phase, dynamic weight vectors are generated in real time based on the clinical features of new patients. Learnable gating coefficients are added after the dynamic weight generation layer to balance the influence of clinical features on spectral features and avoid overfitting. The pre-trained optimal weights of the main model without dynamic branches are loaded. First, the main model is frozen and trained separately for 5 epochs with dynamic branches. Then, the main model is unfrozen and trained jointly for 45 epochs. The original MSE+MAE combined loss function is used and a new L2 regularization term for dynamic branches is added. The AdamW optimizer, cosine annealing learning rate and early stopping strategy are adapted to ensure that the main model and dynamic branches converge together. Stratified validation was performed by grouping patients according to their clinical characteristics. Each subgroup was required to predict a decrease in RMSE of ≥10%. Typical patient cases were selected to verify the rationality of personalized weights. The deviation between the predicted value and the gold standard was ≤0.
02. Slight noise was added to the clinical characteristics to verify that the fluctuation of the dynamic branch output weight was ≤5% to ensure the stability of the fit. By removing the bias term of the fully connected layer, using a 1×1 convolution kernel to control the dynamic branch parameter quantity, performing 8-bit quantization compression on the branch weights, embedding the dynamic branches into the main model and exporting them in a unified ONNX format, only additional clinical feature vectors need to be input during inference, increasing the single-sample inference time by ≤1ms, thus adapting to the real-time requirements of bedside equipment.
8. The method and system for monitoring the healing process of diabetic foot wounds according to claim 1, characterized in that: The aforementioned combined strategy of in vitro pre-training-in-situ fine-tuning and incremental learning is used to conduct phased training and continuous optimization of the fusion model of KPCA-regularized LDA and SA-CNN, including: The functional division of labor is clearly defined: the SA-CNN module is responsible for extracting Raman spectral depth weak difference features, and the KPCA-regularized LDA module is responsible for extracting spectral discrimination features. The features output by the two modules are concatenated and feature fusion is completed through convolutional layers. The total number of model parameters is controlled to be ≤150k. The parameters of SA-CNN, KPCA-regularized LDA and fusion layer are initialized, and the basic model architecture for phased training is built. Based on a general Raman spectrum dataset of ≥5000 entries, the SA-CNN module, KPCA-regularized LDA module, and fusion layer were pre-trained independently in separate modules. After training, the pre-training effect was evaluated by RMSE and R² metrics. Once the metrics met the standards, the pre-training weights of each module were saved, enabling the model to have the ability to extract and discriminate spectral features across different scenarios. The pre-trained model was transferred to the target dataset of macrophage Raman spectroscopy for diabetic foot wounds. A phased fine-tuning strategy was adopted, which first froze the backbone, then thawed the fusion layer, and then gradually thawed the feature extraction layer to adapt to the weak spectral differences in the diabetic foot scenario. During the fine-tuning process, the kernel parameters of the KPCA module were optimized to improve the feature fusion effect. The RMSE and R² indicators of the validation set were monitored in real time and an early stopping strategy was implemented to avoid overfitting. For newly added clinical Raman spectroscopy data, cross-device calibration and standardized preprocessing are performed. An elastic weight consolidation strategy is adopted to protect the old knowledge already learned by the model. The preprocessed incremental data is input into the model in batches for training. After training, the performance indicators of the model on the new and old data are evaluated simultaneously. The model is lightly retrained every quarter to integrate the new and old knowledge. Evaluation metrics were set for each stage of pre-training, transfer fine-tuning, and incremental learning. The learning rate and Dropout hyperparameters were dynamically adjusted based on the evaluation results of each stage to verify that the model converged and met the criteria at each stage. Establish a model version management mechanism and performance baseline comparison system. Every 6 months, integrate the accumulated clinical data to retrain the model. Before training, label and remove abnormal samples in the incremental data. Through the above management methods, ensure that the model adapts to changes in clinical data in the long term and maintains stable feature extraction and discrimination effects.
9. The method for monitoring the healing process of diabetic foot wounds according to claim 1, characterized in that: The constructed multi-model fusion ensemble classifier performs weighted fusion and rule calibration on the analysis results of different models, outputting the final classification result of macrophage polarization state, including: A complementary model pool consisting of SA-CNN deep model, KPCA-regularized LDA model, XGBoost model and kernel SVM model was constructed. The input features of all models were unified as a fusion feature set of standardized Raman spectral features and encoded clinical features. The classification objective was unified as a three-class classification of strong M1, intermediate state and strong M2 and the categories were labeled and encoded. The output format of all models was unified as hard classification label and soft classification probability of the corresponding category. Using the same partitioned training / validation / test dataset, each model is trained independently according to its optimal training strategy. The performance of each model is quantitatively evaluated from the dimensions of overall accuracy, precision of each category, recall, and F1 score. Initial fusion weights are calculated and assigned based on the mean F1 score of each model for each category. First, the soft classification probabilities output by each model are weighted and summed based on the initial fusion weights to obtain the initial fusion probability. Then, the sample difficulty coefficient based on the divergence entropy value of the sample prediction by all models is introduced. For high-difficulty samples, the weight of the best model is increased and the weight of the worst model is decreased. For low-difficulty samples, the static weight is maintained to complete the dynamic adjustment of the weights. Finally, the dynamically adjusted fusion probability is normalized to obtain the initial classification result. Based on the category recognition advantages of each model, hierarchical calibration rules are formulated. High-disagreement abnormal samples are matched with a preset polarization feature rule library to correct the results and optimize the fusion probability judgment threshold. Among them, the intermediate state judgment threshold is lowered and the strong M1 / strong M2 judgment threshold is raised to correct the deviation of the initial classification results. It encapsulates the complete process of model prediction, static weighting, dynamic adjustment, rule calibration, and result output. It uses 5-fold cross-validation combined with grid search to optimize the static weight allocation ratio, sample difficulty entropy threshold, and rule calibration probability threshold. For each new batch of data, the performance of the basic model is re-evaluated and the initial fusion weights are updated. The rule calibration library is iteratively optimized based on the new sample misjudgment cases. Output the classification results of macrophage polarization state, and simultaneously output auxiliary information such as fusion probability, sample difficulty coefficient, contribution of each basic model, feature contribution value and rule calibration trigger description; The performance of the ensemble classifier was verified by measuring the overall accuracy and F1 score of each category. Robustness was verified by adding spectral Gaussian noise and masking some clinical features. The overall accuracy of the ensemble classifier was required to be ≥3% higher than the best single base model. Based on misclassification cases in clinical applications, the causes were analyzed and the target base model was retrained, calibration rules were supplemented, or the model pool was expanded to complete the iterative optimization of the ensemble classifier.
10. A system for monitoring the healing process of diabetic foot wounds, characterized in that, include: processor; A machine-readable storage medium for storing machine-executable instructions of the processor; The processor is configured to execute the method for monitoring the healing process of diabetic foot wounds according to any one of claims 1 to 9 by executing the machine-executable instructions.