Helicobacter pylori detection method, device and apparatus

By screening and optimizing candidate wavelength combinations for Helicobacter pylori detection, and utilizing particle swarm optimization and support vector machine models, the problem of low detection accuracy in existing methods has been solved, achieving efficient and accurate Helicobacter pylori detection.

CN122306713APending Publication Date: 2026-06-30HE BEI SHENG ZHONG YI YUAN (FIRST AFFILIATED HOSPITAL OF HEBEI UNIVERSITY OF TRADITIONAL CHINESE MEDICINE HEBEI CENTER FOR PREVENTION & CONTROL OF SCOLIOSIS IN CHILDREN & ADOLESCENTS) +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HE BEI SHENG ZHONG YI YUAN (FIRST AFFILIATED HOSPITAL OF HEBEI UNIVERSITY OF TRADITIONAL CHINESE MEDICINE HEBEI CENTER FOR PREVENTION & CONTROL OF SCOLIOSIS IN CHILDREN & ADOLESCENTS)
Filing Date
2026-03-13
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

Existing methods for detecting Helicobacter pylori have low accuracy and cannot effectively distinguish Helicobacter pylori infection.

Method used

By acquiring sample spectral datasets, candidate wavelengths are screened, and the optimal wavelength combination is obtained through iterative optimization using the particle swarm optimization algorithm. Combined with the support vector machine model, Helicobacter pylori detection is performed, and wavelength combinations that significantly respond to the infection status are selected for Helicobacter pylori detection.

Benefits of technology

It improves the accuracy of Helicobacter pylori detection, ensures the ability to distinguish infection status, reduces computational complexity, and enhances detection efficiency and stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122306713A_ABST
    Figure CN122306713A_ABST
Patent Text Reader

Abstract

This invention provides a method, apparatus, and device for detecting Helicobacter pylori, relating to the field of Helicobacter pylori detection technology. The method includes: acquiring a sample spectral dataset; the sample spectral dataset includes reflectance signals corresponding to normal samples, interference samples, and Helicobacter pylori-infected samples at multiple initial wavelengths; for the sample spectral dataset, candidate wavelengths are selected by analyzing the reflectance differences of different types of samples; candidate wavelengths characterize wavelengths with significant reflectance differences among different types of samples; arbitrarily combining the candidate wavelengths to obtain multiple candidate wavelength combinations; iteratively optimizing the multiple candidate wavelength combinations with the objectives of maximizing classification accuracy, minimizing the number of wavelengths, and minimizing the standard deviation of spectral data, to obtain the optimal wavelength combination; and performing Helicobacter pylori detection based on the optimal wavelength combination to obtain the detection result. This invention can improve the accuracy of Helicobacter pylori detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of Helicobacter pylori detection technology, and in particular to a method, apparatus and equipment for detecting Helicobacter pylori. Background Technology

[0002] Helicobacter pylori is a Gram-negative bacillus that can colonize the gastric mucosa. Early and accurate detection and intervention are of great clinical significance in reducing the incidence of digestive system diseases and improving patient prognosis. With the advancement of medical technology, non-invasive, rapid, and portable Helicobacter pylori detection methods are gradually becoming a hot demand in clinical and primary healthcare settings.

[0003] Among them, the spectral detection method in the non-invasive Helicobacter pylori detection method is based on the analysis of the spectral response of the sample at characteristic wavelengths to determine the infection status.

[0004] Most existing Helicobacter pylori detection methods rely on empirical wavelength selection, resulting in insufficient sensitivity of characteristic wavelengths to infection status, making it impossible to effectively distinguish Helicobacter pylori infection and leading to low detection accuracy. Summary of the Invention

[0005] This invention provides a method, apparatus, and device for detecting Helicobacter pylori, in order to solve the problem of low detection accuracy in existing Helicobacter pylori detection methods.

[0006] In a first aspect, embodiments of the present invention provide a method for detecting Helicobacter pylori, comprising: acquiring a sample spectral dataset; the sample spectral dataset includes reflectance signals corresponding to normal samples, interference samples, and Helicobacter pylori-infected samples at multiple initial wavelengths; for the sample spectral dataset, candidate wavelengths are selected by analyzing the reflectance differences of different types of samples; the candidate wavelengths characterize wavelengths with significant reflectance differences among different types of samples; the candidate wavelengths are arbitrarily combined to obtain multiple candidate wavelength combinations; the multiple candidate wavelength combinations are iteratively optimized with the objectives of maximizing classification accuracy, minimizing the number of wavelengths, and minimizing the standard deviation of spectral data, to obtain the optimal wavelength combination; and Helicobacter pylori detection is performed based on the optimal wavelength combination to obtain the detection result.

[0007] In one possible implementation, with the objectives of maximizing classification accuracy, minimizing the number of wavelengths, and minimizing the standard deviation of spectral data, multiple candidate wavelength combinations are iteratively optimized to obtain the optimal wavelength combination. This includes: initializing particle swarm parameters, with each particle corresponding to a candidate wavelength combination; initializing the position and velocity of the particle swarm based on the candidate wavelengths; calculating the classification accuracy, number of wavelengths, and standard deviation of spectral data for each particle's corresponding candidate wavelength combination using an SVM classification model; calculating the fitness value of each particle based on the classification accuracy, number of wavelengths, and standard deviation of spectral data; determining the optimal position of each individual particle and the global optimal position based on the fitness value; updating the velocity and position of each particle, repeating the steps to calculate the fitness value and determine the optimal position of each individual particle and the global optimal position until convergence is achieved, at which point the iteration stops, and the final global optimal position is obtained; and using the candidate wavelength combination corresponding to the final global optimal position as the optimal wavelength combination.

[0008] In one possible implementation, the optimal wavelength combination includes a first preset wavelength, a second preset wavelength, a third preset wavelength, and a fourth preset wavelength. Based on the optimal wavelength combination, Helicobacter pylori detection is performed to obtain detection results, including: calculating the reflectance difference of each preset wavelength based on the reflected signals of the first, second, third, and fourth preset wavelengths of the patient's tongue, combined with the reflectance of normal samples at the corresponding preset wavelengths; performing interference analysis based on the reflectance differences of each preset wavelength to obtain interference results, including the presence or absence of interference; if no interference is found, calculating the Helicobacter pylori infection risk index based on the reflectance differences of each preset wavelength; and performing infection risk detection based on the reflectance differences of each preset wavelength and the Helicobacter pylori infection risk index, combined with the corresponding risk threshold, to obtain detection results.

[0009] In one possible implementation, interference analysis is performed based on the reflectivity differences of each preset wavelength to obtain interference results, including: if the reflectivity differences of each preset wavelength meet the interference conditions, then interference is determined to exist; if the reflectivity differences of each preset wavelength do not meet the interference conditions, then interference is determined to not exist.

[0010] In one possible implementation, if the reflectance difference of each preset wavelength meets the interference condition, then interference is determined to exist, including: if the reflectance difference of the first preset wavelength is less than the first difference threshold, and the reflectance differences of the second, third, and fourth preset wavelengths are all within the preset interference range, then food residue interference is determined to exist; if the reflectance difference of the third preset wavelength is greater than the second difference threshold, and the reflectance difference of the fourth preset wavelength is greater than the third difference threshold, then insufficient blood color interference is determined to exist.

[0011] In one possible implementation, if there is no interference, the Helicobacter pylori infection risk index is calculated based on the reflectance difference of each preset wavelength, including: the Helicobacter pylori infection risk index is calculated based on the reflectance difference of the first preset wavelength, the reflectance difference of the second preset wavelength, and the reflectance difference of the fourth preset wavelength, combined with a preset formula.

[0012] In one possible implementation, infection risk detection is performed based on the reflectance difference of each preset wavelength and the Helicobacter pylori infection risk index, combined with the corresponding risk threshold, to obtain the detection result, including: if the Helicobacter pylori infection risk index is greater than or equal to the first risk threshold, and the reflectance difference of the first preset wavelength is within the first risk range, the reflectance difference of the second preset wavelength is greater than the second risk threshold, and the reflectance difference of the fourth preset wavelength is less than the third risk threshold, then the detection result is high risk of Helicobacter pylori infection; if the Helicobacter pylori infection risk index is less than the first risk threshold, or the reflectance difference of the first preset wavelength is not within the first risk range, the reflectance difference of the second preset wavelength is less than or equal to the second risk threshold, and the reflectance difference of the fourth preset wavelength is greater than or equal to the third risk threshold, then the detection result is normal.

[0013] In one possible implementation, candidate wavelengths are selected from the sample spectral dataset by analyzing the reflectance differences of different types of samples. This includes: preprocessing the sample spectral dataset to obtain a preprocessed spectral dataset; performing ANOVA analysis on the preprocessed spectral dataset to calculate the reflectance differences between normal samples, interference samples, and Helicobacter pylori-infected samples at each initial wavelength; and selecting candidate wavelengths based on the reflectance difference values ​​and reflectance difference thresholds.

[0014] Secondly, embodiments of the present invention provide a Helicobacter pylori detection device, comprising: a communication module for acquiring a sample spectral dataset; the sample spectral dataset includes reflectance signals corresponding to normal samples, interference samples, and Helicobacter pylori-infected samples at multiple initial wavelengths; a processing module for analyzing the reflectance differences of different types of samples in the sample spectral dataset to obtain candidate wavelengths; the candidate wavelengths characterize wavelengths with significant reflectance differences between different types of samples; arbitrarily combining the candidate wavelengths to obtain multiple candidate wavelength combinations; iteratively optimizing the multiple candidate wavelength combinations with the objectives of maximizing classification accuracy, minimizing the number of wavelengths, and minimizing the standard deviation of spectral data to obtain the optimal wavelength combination; and performing Helicobacter pylori detection based on the optimal wavelength combination to obtain the detection result.

[0015] Thirdly, embodiments of the present invention provide an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method described in the first aspect or any possible implementation thereof.

[0016] This invention first analyzes the reflectance differences of different sample types to screen candidate wavelengths with significant reflectance differences between different types, retaining wavelengths that significantly respond to Helicobacter pylori infection status. Then, this invention combines candidate wavelengths to obtain multiple candidate wavelength combinations, and iteratively optimizes these combinations using multiple objectives to obtain the optimal wavelength combination. Specifically, it maximizes classification accuracy to ensure the selected wavelength combinations have excellent ability to distinguish infection status, guaranteeing the accuracy of subsequent detection. It also minimizes the number of wavelengths to simplify the wavelength combinations, reducing the computational complexity of subsequent detection processes and improving detection efficiency. Furthermore, it minimizes the standard deviation of spectral data to improve the stability of wavelengths in different sample detections, avoiding deviations in detection results due to data fluctuations, ultimately improving the accuracy of Helicobacter pylori detection. Attached Figure Description

[0017] Figure 1 This is a flowchart illustrating the implementation of the Helicobacter pylori detection method provided in this embodiment of the invention; Figure 2 This is a comparison diagram of the characteristic wavelength reflectance spectra of different tongue samples provided in the embodiments of the present invention; Figure 3 This is a schematic diagram of the signal flow of the Helicobacter pylori detection method provided in the embodiments of the present invention; Figure 4a This is a schematic diagram (a) of the miniature spectroscopic device provided in an embodiment of the present invention; Figure 4b This is a schematic diagram (II) of the miniature spectroscopic device provided in an embodiment of the present invention; Figure 5 This is a logic block diagram of the Helicobacter pylori detection method provided in the embodiments of the present invention; Figure 6 This is a schematic diagram of the ROC curve analysis of the Helicobacter pylori infection risk index provided in this embodiment of the invention; Figure 7 This is a schematic diagram of the structure of the Helicobacter pylori detection device provided in an embodiment of the present invention; Figure 8 This is a schematic diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0018] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0019] See Figure 1The flowchart illustrating the implementation of the Helicobacter pylori detection method provided in this embodiment of the invention is described in detail below: Step 101: Obtain the sample spectral dataset; the sample spectral dataset includes the reflection signals of normal samples, interference samples, and Helicobacter pylori-infected samples at multiple initial wavelengths.

[0020] In some embodiments, the sample spectral dataset refers to the collection of raw spectral data collected during the R&D phase for wavelength screening. The sample spectral dataset contains reflectance signals from three core sample categories: normal samples (tongues with negative carbon-13 breath test and no interference), interfering samples (samples with food residue or insufficient blood color), and Helicobacter pylori (HP) infected samples (tongues with positive carbon-13 breath test). The reflectance signal of each sample covers multiple initial wavelengths across a broad spectral range of 400-950 nm. This serves as the data source foundation for algorithm optimization, providing sufficient sample diversity and data support for subsequent reflectance difference analysis.

[0021] In some embodiments, the initial wavelength is a pool of all wavelengths pre-selected within a wide spectral range for preliminary screening (in this invention, 50 wavelengths within the 400-950nm range, spaced approximately 11nm apart), which is a candidate wavelength pool.

[0022] In some embodiments, the reflected signal is the electrical signal (raw data form) corresponding to the reflected light of different wavelengths by the tongue tissue after the light source illuminates the tongue; the analog / digital signal converted by the optical signal through the spectral acquisition module is the original basis for calculating reflectivity and reflectivity difference.

[0023] Step 102: For the sample spectral dataset, candidate wavelengths are obtained by analyzing the reflectance differences of different types of samples; the candidate wavelengths represent wavelengths with significant differences in reflectance among different types of samples.

[0024] As one possible implementation, step 102 can be specifically implemented as steps 1021-1023.

[0025] 1021: Preprocess the sample spectral dataset to obtain the preprocessed spectral dataset.

[0026] In some embodiments, preprocessing is a preliminary data cleaning and standardization operation performed on the original sample spectral dataset. Preprocessing includes removing outlier samples and standardizing spectral reflectance.

[0027] For example, outlier samples are removed, such as invalid data due to equipment malfunction or tongue position deviation during the collection process. Spectral reflectance is standardized, such as mapping the reflectance data of different samples to a uniform numerical range, eliminating systematic errors caused by individual differences and slight equipment fluctuations.

[0028] In this embodiment, abnormal data is removed to ensure data reliability, data is standardized to eliminate system interference, and data stability is improved.

[0029] 1022: ANOVA analysis was performed on the preprocessed spectral dataset to calculate the reflectance differences among normal samples, interference samples, and Helicobacter pylori-infected samples at each initial wavelength.

[0030] In some embodiments, ANOVA analysis, or analysis of variance, is a statistical analysis method used to quantitatively calculate the degree of difference in reflectance between different types of samples (normal samples, interference samples, and HP-infected samples) at the same wavelength, and to determine whether the wavelength can effectively distinguish between different sample types.

[0031] In some embodiments, the reflectance difference value is a quantitative indicator, calculated using ANOVA analysis, characterizing the degree of reflectance difference between different sample types at the same initial wavelength. It is a core criterion for determining whether a wavelength has value in distinguishing sample types; the larger the difference value, the better that wavelength can capture the spectral characteristics differences between HP-infected and normal / interfering samples.

[0032] In this embodiment, the ability to distinguish wavelengths is quantified to accurately locate the effective wavelength range.

[0033] 1023: Candidate wavelengths are selected based on reflectance difference values ​​and reflectance difference thresholds.

[0034] In some embodiments, the reflectance difference threshold is a preset criterion for screening candidate wavelengths. Only initial wavelengths with reflectance differences exceeding this threshold are considered capable of distinguishing sample types. This threshold serves as a cutoff for selecting effective wavelengths, eliminating redundant wavelengths that lack distinguishing value.

[0035] In some embodiments, the candidate wavelengths are initial wavelengths whose reflectance difference values ​​are greater than the reflectance difference threshold after ANOVA analysis. These wavelengths form the core pool of candidate wavelengths for subsequent iterative optimization (IPSO algorithm). The candidate wavelengths possess the fundamental ability to distinguish between HP-infected, normal, and interfering samples, reducing the computational load of subsequent algorithm optimization and improving optimization efficiency.

[0036] In this embodiment, redundant wavelengths are significantly reduced, the complexity of subsequent algorithms is lowered, and the targeting of subsequent optimizations is improved, laying the foundation for detection accuracy.

[0037] Step 103: Arbitrarily combine the candidate wavelengths to obtain multiple candidate wavelength combinations.

[0038] In some embodiments, a candidate wavelength combination is a set of multiple wavelengths formed by arbitrarily combining the selected candidate wavelengths.

[0039] Step 104: With the objectives of maximizing classification accuracy, minimizing the number of wavelengths, and minimizing the standard deviation of spectral data, iterative optimization is performed on multiple candidate wavelength combinations to obtain the optimal wavelength combination.

[0040] As one possible implementation, step 104 can be specifically implemented as steps 1041-1047.

[0041] 1041: Initialize the particle swarm parameters, with each particle corresponding to a candidate wavelength combination.

[0042] In this embodiment, the algorithm's operating rules are clearly defined to ensure the orderliness of the search.

[0043] 1042: Initialize the position and velocity of the particle swarm based on candidate wavelengths.

[0044] In this embodiment, the foundation for iterative optimization is laid, and the search capabilities are balanced.

[0045] 1043: Combining the SVM classification model, calculate the classification accuracy, number of wavelengths, and standard deviation of spectral data for each candidate wavelength combination corresponding to each particle.

[0046] In some embodiments, classification accuracy is the proportion of samples whose type (HP infection / normal / interference) is correctly determined after a candidate wavelength combination is classified by an SVM model.

[0047] In some embodiments, the standard deviation of spectral data is the degree of dispersion (fluctuation range) of spectral reflectance signal data acquired multiple times under the same wavelength combination. The smaller the standard deviation, the more stable the detection data of that wavelength combination and the stronger its anti-interference ability.

[0048] In this embodiment, the core performance of the quantized wavelength combination is ensured to guarantee the reliability of the evaluation results.

[0049] 1044: The fitness value of each particle is calculated based on classification accuracy, number of wavelengths, and standard deviation of spectral data.

[0050] In this embodiment, multi-objective unified quantization is achieved.

[0051] 1045: Determine the optimal position of an individual and the global optimal position based on the fitness value.

[0052] In this embodiment, local and global high-quality solutions are locked to prevent the algorithm from getting trapped in local optima.

[0053] 1046: Update the velocity and position of each particle, repeat the steps to calculate the fitness value and determine the individual optimal position and the global optimal position until convergence is achieved, stop the iteration, and obtain the final global optimal position.

[0054] In this embodiment, the algorithm gradually approaches the global optimal solution, ensuring both efficiency and stability.

[0055] 1047: The candidate wavelength combination corresponding to the final global optimal position is taken as the optimal wavelength combination.

[0056] In some embodiments, the improved particle swarm optimization algorithm determines the optimal wavelength combination as follows: 1. Algorithm Improvements: A class weighting factor is introduced to strengthen the priority of HP infection detection. The weight of HP-infected samples is set to ω_HP = 1.5, and the weight of interference samples is set to ω_interference = 1.0. The objective function is optimized to balance HP priority, the number of wavelengths, and data stability. The objective function is as follows:

[0057] In the formula, Acc is the SVM classification accuracy; N is the number of wavelengths (target ≤ 6); ωcat is the weight of the corresponding class; and StdDev is the standard deviation of the spectral data (reflecting data stability).

[0058] 2. Algorithm Execution Steps: Input Initial Data: 50 candidate wavelength points, spectral data of 1000 samples; Data Preprocessing: Remove outlier samples, standardize spectral reflectance data; Primary Filtering (ANOVA Analysis): Remove wavelengths with reflectance differences <5% between different sample types, retaining 28 candidate wavelengths; Intelligent Optimization (IPSO Iteration): Initialize the particle swarm (each particle corresponds to a set of wavelength combinations), calculate the fitness value, and find the optimal wavelength combination by updating the particle position; Model Validation: 5-fold cross-validation combined with an SVM model to evaluate detection performance and determine the optimal wavelength combination.

[0059] In this embodiment, the core detection criteria are output, clarifying the wavelength combination ultimately used for on-site detection, thus providing a foundation for subsequent rapid spectral acquisition and simplified data processing.

[0060] Step 105: Based on the optimal wavelength combination, perform Helicobacter pylori detection to obtain the detection results.

[0061] In some embodiments, the optimal wavelength combination includes a first preset wavelength, a second preset wavelength, a third preset wavelength, and a fourth preset wavelength. The first preset wavelength to the fourth preset wavelength are 450nm, 520nm, 640nm, and 850nm, respectively.

[0062] As one possible implementation, step 105 can be specifically implemented as steps 1051-1054.

[0063] 1051: Based on the reflection signals of the first, second, third, and fourth preset wavelengths of the tongue of the patient to be tested, and combined with the reflectance of normal samples at the corresponding preset wavelengths, the reflectance difference of each preset wavelength is calculated.

[0064] In some embodiments, the reflected signal of the patient's tongue to be detected is a digital electrical signal obtained by the spectral acquisition module after the light source illuminates the patient's tongue at four preset wavelengths during on-site detection. The original data of the reflected light of the patient's tongue to specific wavelengths is the basis for subsequent calculation of reflectivity and reflectivity difference.

[0065] In some embodiments, the normal sample reflectance is a standard reflectance benchmark value corresponding to four preset wavelengths, obtained in advance through statistical analysis of a large number of normal samples; it serves as a reference benchmark for comparison with patient samples and is used to calculate the reflectance difference to reflect the spectral abnormalities of the patient's tongue.

[0066] In some embodiments, the reflectance difference is the difference between the reflectance of the patient's tongue and that of a normal sample at a preset wavelength. Quantifying the spectral differences between the patient's tongue and a normal tongue, the greater the difference, the more likely there is Helicobacter pylori infection or interference (such as food residue or insufficient blood color).

[0067] In this embodiment, a quantitative comparison between the sample and the standard is achieved, providing core data support for subsequent analysis and simplifying computational complexity.

[0068] 1052: Based on the reflectivity difference of each preset wavelength, interference analysis is performed to obtain interference results, which include the presence of interference and the absence of interference.

[0069] In some embodiments, interference analysis is based on the reflectance difference of four preset wavelengths, combined with preset interference judgment rules, to determine whether there is food residue or insufficient blood color on the patient's tongue, thus eliminating invalid detection scenarios and avoiding false positive / false negative results caused by interference factors.

[0070] As one possible implementation, step 1052 can be specifically implemented as steps 201-202.

[0071] 201: If the reflectivity difference of each preset wavelength meets the interference condition, then interference is determined to exist.

[0072] In some embodiments, the reflectance difference of each preset wavelength is the difference between the reflectance of the patient's tongue and the reflectance of a normal sample corresponding to each of the four preset wavelengths. Quantifying the spectral differences between the patient's tongue and a normal tongue is the core data basis for determining the type of interference.

[0073] In some embodiments, the interference conditions are pre-defined rules based on clinical sample data to determine the presence of specific interference, and the interference conditions are divided into two categories: food residue interference conditions and blood color deficiency interference conditions.

[0074] As one possible implementation, step 201 can be specifically implemented as steps 2011-2012.

[0075] 2011: If the reflectance difference of the first preset wavelength is less than the first difference threshold, and the reflectance differences of the second preset wavelength, the third preset wavelength, and the fourth preset wavelength are all within the preset interference range, then it is determined that there is food residue interference.

[0076] In some embodiments, the first difference threshold is a critical value set for the difference in reflectance at a first preset wavelength (450 nm) to determine food residue interference.

[0077] In some embodiments, the preset interference range is a numerical range set for the reflectivity difference between the second preset wavelength, the third preset wavelength, and the fourth preset wavelength, used to determine food residue interference.

[0078] In some embodiments, food residue interference is a type of detection interference caused by food residue (such as food not cleaned after eating) adhering to the surface of the patient's tongue, resulting in distortion of the spectral reflectance signal.

[0079] In this embodiment, food residue interference is accurately identified, reducing false positives. The rules are simple and easy to implement, adapting to rapid detection needs. The types of interference are clearly defined, and user operation guidance is optimized.

[0080] 2012: If the reflectance difference of the third preset wavelength is greater than the second difference threshold, and the reflectance difference of the fourth preset wavelength is greater than the third difference threshold, then it is determined that there is insufficient blood color interference.

[0081] In some embodiments, the second difference threshold is a critical value set for the third preset wavelength reflectance difference to determine interference from insufficient blood color.

[0082] In some embodiments, the third difference threshold is a critical value set for the fourth preset wavelength reflectance difference to determine the interference of insufficient blood color.

[0083] In some embodiments, insufficient blood color interference is a type of detection interference caused by insufficient blood color in the tongue due to conditions such as anemia in the patient, resulting in abnormal reflection signals of hemoglobin-related wavelengths.

[0084] In some embodiments, to improve the specificity of *Helicobacter pylori* infection detection and avoid interference from common tongue surface conditions, this invention simultaneously integrates rapid exclusion logic for food residue and insufficient blood color. This logic is executed before *Helicobacter pylori* risk assessment; if triggered, it directly outputs the interference type and does not enter the *Helicobacter pylori* infection risk index (HRI) calculation process. Simultaneously, auxiliary detection models for food residue and insufficient blood color are constructed: Food residue detection: ΔR_450 < -0.15, and ΔR_520, ΔR_640, ΔR_850 ∈ [-0.05, 0.05]; Insufficient blood color detection: ΔR_640 > 0.1, and ΔR_850 > 0.05. A comparison of characteristic wavelength reflectance spectra of different tongue samples is shown below. Figure 2 As shown.

[0085] In this embodiment, insufficient blood color interference is accurately identified to ensure detection specificity. Focusing on key wavelengths reduces the complexity of interference determination. Non-infectious abnormalities are distinguished to avoid misleading users.

[0086] 202: If the reflectivity difference of each preset wavelength does not meet the interference condition, then it is determined that there is no interference.

[0087] In this embodiment, effective samples are accurately screened to provide a reliable data foundation for subsequent evaluation. A balance is struck between detection sensitivity and specificity.

[0088] 1053: If there is no interference, the Helicobacter pylori infection risk index is calculated based on the reflectivity difference of each preset wavelength.

[0089] As one possible implementation, step 1053 can be specifically processed as follows: Based on the reflectance difference of the first preset wavelength, the reflectance difference of the second preset wavelength, and the reflectance difference of the fourth preset wavelength, and combined with the preset formula, the Helicobacter pylori infection risk index is calculated.

[0090] In some embodiments, the Helicobacter pylori infection risk index is a core indicator that quantifies the likelihood of Helicobacter pylori infection, constructed based on interference-free reflectance differences; it transforms spectral data into intuitive risk quantification values, facilitating subsequent threshold determination.

[0091] In some embodiments, the reflectance difference of each preset wavelength is the difference between the reflectance of the patient's tongue to be tested and the reflectance of a normal sample corresponding to each of the four preset wavelengths.

[0092] In some embodiments, based on the optimal wavelength selected by IPSO, the reflectance difference (ΔR = R_sample - R_normal) is calculated to construct a multi-feature Helicobacter pylori infection risk index (HRI) model, eliminating the influence of interfering factors.

[0093] Core formula: 1. Reflectivity difference: ΔR_λ = R_sample - R_normal (characterizing the absorption / scattering change at the target wavelength); 2. HRI Index:

[0094] Judgment rule: When HRI≥0.12, and ΔR_450∈[-0.12,-0.08], ΔR_520>0.1, and ΔR_850<-0.05, it is judged as high risk of HP infection.

[0095] The above comprehensive judgment threshold is the optimal solution determined after system optimization based on ROC curve analysis of the training sample set, with the principle of maximizing the Youden exponent, ensuring high specificity (89%) while taking into account sensitivity (82%).

[0096] In this embodiment, a proprietary preset formula is used to transform interference-free multidimensional spectral difference data into an accurate and intuitive Helicobacter pylori infection risk index. This not only solves the problem of difficulty in determining multidimensional data, but also simplifies subsequent processes, improves the operability of the test, and provides core quantitative basis for the final accurate determination.

[0097] 1054: Based on the reflectivity difference of each preset wavelength and the Helicobacter pylori infection risk index, combined with the corresponding risk threshold, infection risk detection is performed to obtain the detection results.

[0098] As one possible implementation, step 1054 can be specifically implemented as steps 301-302.

[0099] 301: If the Helicobacter pylori infection risk index is greater than or equal to the first risk threshold, and the reflectance difference of the first preset wavelength is within the first risk range, the reflectance difference of the second preset wavelength is greater than the second risk threshold, and the reflectance difference of the fourth preset wavelength is less than the third risk threshold, then the test result is a high risk of Helicobacter pylori infection.

[0100] In some embodiments, a high risk of Helicobacter pylori infection is defined as the Helicobacter pylori infection risk index (HRI) and the key wavelength reflectance difference of the patient being tested both meeting a preset risk threshold, indicating that the spectral characteristics of the tongue body are highly matched with those of the Helicobacter pylori-infected sample, and the possibility of Helicobacter pylori infection is extremely high.

[0101] In this embodiment, accurate determination of multi-dimensional constraints is achieved, significantly improving detection specificity. It precisely captures the specific spectral patterns of Helicobacter pylori (HP) infection, enhancing sensitivity. The determination rules are rigorous and reproducible, meeting medical testing standards.

[0102] 302: If the Helicobacter pylori infection risk index is less than the first risk threshold, or the reflectance difference of the first preset wavelength is not within the first risk range, the reflectance difference of the second preset wavelength is less than or equal to the second risk threshold, or the reflectance difference of the fourth preset wavelength is greater than or equal to the third risk threshold, then the test result is normal.

[0103] In some embodiments, normal means that the HRI index or key wavelength reflectance difference of the patient being tested does not meet all risk threshold conditions, indicating that its tongue spectral characteristics are consistent with normal samples and there are no obvious signs of HP infection.

[0104] In this embodiment, the normal judgment boundary is clearly defined to avoid balancing missed and false positives. It simplifies user understanding and adapts to non-professional scenarios. A closed-loop judgment logic is formed to ensure the integrity of the detection process.

[0105] This invention first analyzes the reflectance differences of different sample types to screen candidate wavelengths with significant reflectance differences between different types, retaining wavelengths that significantly respond to Helicobacter pylori infection status. Then, this invention combines candidate wavelengths to obtain multiple candidate wavelength combinations, and iteratively optimizes these combinations using multiple objectives to obtain the optimal wavelength combination. Specifically, it maximizes classification accuracy to ensure the selected wavelength combinations have excellent ability to distinguish infection status, guaranteeing the accuracy of subsequent detection. It also minimizes the number of wavelengths to simplify the wavelength combinations, reducing the computational complexity of subsequent detection processes and improving detection efficiency. Furthermore, it minimizes the standard deviation of spectral data to improve the stability of wavelengths in different sample detections, avoiding deviations in detection results due to data fluctuations, ultimately improving the accuracy of Helicobacter pylori detection.

[0106] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0107] The above embodiments are in Figure 1 Based on the method shown, each step will be discussed in detail. To facilitate understanding of the complete execution process, the overall method flow will be discussed below with reference to an embodiment.

[0108] The system of this invention adopts a split architecture of "hardware detection terminal + smartphone application software", and the two work together through Bluetooth wireless communication. The overall design strictly follows the closed-loop working logic of "spectral acquisition - data processing - risk decision-making - result output", with the core objective of accurate detection of Helicobacter pylori (HP) infection throughout the process. All architectural designs are centered around improving the accuracy and efficiency of HP infection detection.

[0109] Hardware composition and module association The hardware testing terminal adopts a modular design, consisting of five core parts: a light source module, a spectrum acquisition module, a control and processing module, a communication module, and a mechanical structure. These modules work together through a standard interface to form a complete link of "light excitation - signal acquisition - data processing - wireless transmission".

[0110] Hardware system design and module integration Modular architecture and related logic This section corresponds to the "portable hardware integration innovation" proposed in the introduction, and elaborates on how to ensure detection stability under the premise of miniaturization through modular architecture.

[0111] like Figure 3 As shown, the collaborative relationship between the various hardware modules follows a clear signal and control flow: the control processing module (MCU) acts as the central hub, sending timing commands to the light source module to drive specific wavelength LEDs to emit light in a time-division manner; the spectrum acquisition module synchronously receives the light reflected from the tongue and converts it into a digital signal, feeding it back to the MCU; after the MCU completes preliminary data processing, it uploads the data to the mobile app via the communication module (Bluetooth). The mechanical structure ensures that the relative positions of each optical component are fixed, maintaining a standard detection distance of 5cm and a vertical illumination angle.

[0112] Core configuration and selection criteria for each module. The specific hardware selection, key parameters, and selection criteria for each module to achieve the above module functions and collaborative logic are shown in the table below.

[0113]

[0114] like Figure 4a , Figure 4b This is a schematic diagram of a miniature spectroscopic device. The miniature spectroscopic device includes a light source receiver, a light source emitter, a device switch, and a Type-C charging port.

[0115] Software layered architecture The software system adopts a three-tier architecture design, strictly distinguishing between hardware and software functions, and clearly defining the interaction logic and algorithm positioning of each layer: 1. Low-level control layer: Based on STM32 firmware development, the core function is hardware driver and timing coordination, including timing driver for the light source module, data reading for the spectrum acquisition module, and adaptation for the communication module. It interacts directly with the hardware and does not involve complex algorithm processing.

[0116] 2. Data Processing Layer: The core layer of the software system, responsible for HP detection-related data processing and algorithm execution. It communicates with the underlying control layer through a data interface. Specific functions include data preprocessing (mean denoising, standardization), IPSO algorithm wavelength optimization, HRI index calculation, interference elimination judgment, and transmitting the processing results to the application interaction layer. It can also feed back parameter adjustment signals to the underlying control layer.

[0117] 3. Application Interaction Layer: Developed based on React Native, this mobile app's core functions are user interaction and result output. It transmits data with the data processing layer via Bluetooth, including device connection management, visualization of test results, and storage of historical data (≥100 HP test records). It is only responsible for data presentation and responding to user operations.

[0118] Inter-layer communication logic: Application interaction layer → Low-level control layer (user operation commands); Low-level control layer → Data processing layer (raw spectral data); Data processing layer → Application interaction layer (HP detection results); Data processing layer → Low-level control layer (parameter adjustment signals).

[0119] Core Algorithm Design Algorithm architecture and execution mechanism To achieve accurate and rapid detection of Helicobacter pylori infection on the tongue, this system constructs a hierarchical algorithm processing flow. This flow, centered on Helicobacter pylori infection identification, sequentially executes three key steps: rapid interference elimination, characteristic wavelength optimization, and risk index calculation and decision-making, ensuring both specificity and efficiency in the detection.

[0120] Rapid interference elimination: First, the system quickly screens for two common interferences—food residue and insufficient blood color—based on a preset reflectance difference (ΔR) threshold. If the interference criteria are met, the system directly outputs the interference type and terminates the subsequent HP assessment process.

[0121] Feature wavelength optimization: If there is no significant interference, proceed to the core detection process. This step uses an improved particle swarm optimization (IPSO) algorithm to intelligently select a few feature wavelengths that are most sensitive to HP infection from the broad spectrum data.

[0122] Risk Decision-Making: Based on the optimal wavelength combination (450nm, 520nm, 640nm, 850nm) selected by IPSO, the reflectivity difference (ΔR) of each wavelength is calculated and substituted into the HP infection risk index (HRI) model for calculation and judgment. Figure 5 As shown.

[0123] Testing procedures and experimental protocols Experimental samples 1000 clinical samples were collected, including 400 normal samples (negative carbon-13 breath test, normal blood routine, no obvious food residue), 200 H. pylori infected samples (positive carbon-13 breath test for diagnosis), 200 food residue samples (clearly within 1 hour after eating, no H. pylori infection or anemia), and 200 blood deficiency samples (blood routine confirmed anemia, no H. pylori infection).

[0124] Testing process The process is executed in the following sequence: "Equipment Installation → Data Acquisition → Algorithm Processing → Result Output": ① Equipment Installation: The miniature spectrometer is fixed to the back of the mobile phone using clips. The APP guides the tongue positioning (the tongue occupies ≥60% of the screen); ② Spectral Acquisition: The light source illuminates the device at preset times (400ms per wavelength). The sensor collects the reflected light signal at a sampling rate of 1MSPS. Each group of signals is collected 10 times, and the average value is used for noise reduction; ③ Data Processing: The STM32 calculates the ΔR value and HRI index in real time and transmits them to the APP via Bluetooth; ④ Result Determination: The APP runs a lightweight SVM model and outputs the detection results (green = normal, yellow = food residue / insufficient blood color, red = high risk of HP infection), with visualization charts and intervention suggestions. The entire process takes less than 6 seconds.

[0125] Experimental verification scheme The system's detection performance was validated using carbon-13 breath test results (HP infection), complete blood count results (insufficient blood color), and clinical medical records (food residue) as the gold standard. Core evaluation metrics included accuracy, sensitivity, specificity, and area under the ROC curve (AUC). Five-fold cross-validation was employed to reduce experimental error.

[0126] result Wavelength optimization results After IPSO algorithm optimization and 5-fold cross-validation, 450nm, 520nm, 640nm, and 850nm were finally determined as the specific characteristic wavelength combination for *Helicobacter pylori* infection. The SVM classification accuracy of *Helicobacter pylori* infected samples corresponding to this combination reached 94.2%, an improvement of 8.2 percentage points compared to the traditional uniform wavelength selection scheme (86% accuracy for *Helicobacter pylori* infection detection). Furthermore, the recognition rate for mild *Helicobacter pylori* infected samples was significantly improved (from 75% to 82%), demonstrating that this wavelength combination can effectively capture the spectral characteristics of *Helicobacter pylori* infection.

[0127] System performance testing Validation results from 1000 clinical samples showed that the system achieved an accuracy of 94.2% in detecting *Helicobacter pylori* infection, a sensitivity of 82%, a specificity of 89%, an area under the ROC curve (AUC) of 0.89, and an optimal decision threshold of HRI=0.12 (with Youden's index at its maximum of 0.71). Figure 6 As shown in the figure. Among the auxiliary detection indicators, the accuracy rate for identifying food residue is 91.5%, and the accuracy rate for identifying insufficient blood color is 88.0%, both of which can effectively eliminate interference.

[0128] The system exhibits excellent real-time performance: single sample spectral acquisition takes 2.4 seconds, data processing takes <3ms, Bluetooth transmission takes <0.5 seconds, APP result output takes <0.1 seconds, and the total time is <6 seconds, meeting the requirements for rapid detection.

[0129] Equipment stability verification Twenty samples were selected for repeatability testing (each sample was tested 5 times). The results showed that the HP infection detection results were consistent and the coefficient of variation (CV) was <3%. After the equipment worked continuously for 2 hours, the core performance indicators did not decrease significantly (accuracy fluctuation <1%), and the stability met the requirements of practical application.

[0130] in conclusion This study successfully developed a miniature spectrometer based on an improved particle swarm optimization algorithm, enabling accurate and rapid detection of *Helicobacter pylori* infection on the tongue. The system is portable in hardware and user-friendly in software, achieving an accuracy of >94%, sensitivity of 82%, and specificity of 89%, with a total detection time of <6 seconds. It effectively eliminates interference factors such as food residue and insufficient blood coloring. The results indicate that this system provides an innovative technical means for the initial screening of *Helicobacter pylori* infection, possessing significant clinical application value and promising prospects for wider application.

[0131] The following are device embodiments of the present invention. For details not described in detail, please refer to the corresponding method embodiments described above.

[0132] Figure 7 A schematic diagram of the Helicobacter pylori detection device provided in an embodiment of the present invention is shown. For ease of explanation, only the parts related to the embodiment of the present invention are shown, and are described in detail below: like Figure 7 As shown, the Helicobacter pylori detection device 7 includes: Communication module 71 is used to acquire sample spectral dataset; the sample spectral dataset includes the reflection signals of normal samples, interference samples and Helicobacter pylori infected samples at multiple initial wavelengths; Processing module 72 is used to analyze the reflectance differences of different types of samples in the sample spectral dataset to screen candidate wavelengths; candidate wavelengths represent wavelengths with significant reflectance differences between different types of samples; the candidate wavelengths are arbitrarily combined to obtain multiple candidate wavelength combinations; with the objectives of maximizing classification accuracy, minimizing the number of wavelengths, and minimizing the standard deviation of spectral data, the multiple candidate wavelength combinations are iteratively optimized to obtain the optimal wavelength combination; based on the optimal wavelength combination, Helicobacter pylori detection is performed to obtain the detection results.

[0133] Figure 8 This is a schematic diagram of an electronic device provided in an embodiment of the present invention. For example... Figure 8 As shown, the electronic device 8 of this embodiment includes a processor 80 and a memory 81. The memory 81 stores a computer program 82. When the processor 80 executes the computer program 82, it implements the steps in the various method embodiments described above. Alternatively, when the processor 80 executes the computer program 82, it implements the functions of each module / unit in the various device embodiments described above.

[0134] For example, computer program 82 may be divided into one or more modules / units, which are stored in memory 81 and executed by processor 80 to complete the present invention. The one or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of computer program 82 in electronic device 8.

[0135] Electronic device 8 may include, but is not limited to, processor 80 and memory 81. Those skilled in the art will understand that... Figure 8 This is merely an example of electronic device 8 and does not constitute a limitation on electronic device 8. It may include more or fewer components than shown, or combine certain components, or different components. For example, electronic device 8 may also include input / output devices, network access devices, buses, etc.

[0136] For the sake of simplicity and clarity, only the above-described functional modules / units are used as examples. In practical applications, the functions described above can be assigned to different functional modules / units as needed. These modules / units can be implemented in hardware, software, or a combination of both.

[0137] In the above embodiments, the descriptions of each embodiment have their own emphasis. Parts not detailed or described in a particular embodiment can be referred to in the relevant descriptions of other embodiments. Unless otherwise specified or in conflict with logic, the terminology and / or descriptions between different embodiments are consistent and can be referenced interchangeably. Technical features in different embodiments can be combined to form new embodiments based on their inherent logical relationships.

[0138] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.

Claims

1. A method for detecting Helicobacter pylori, characterized in that, include: Obtain a sample spectral dataset; the sample spectral dataset includes the reflection signals of normal samples, interference samples, and Helicobacter pylori-infected samples at multiple initial wavelengths; For the sample spectral dataset, candidate wavelengths are obtained by analyzing the reflectance differences of different types of samples; the candidate wavelengths represent wavelengths with significant differences in reflectance among different types of samples. The candidate wavelengths can be combined arbitrarily to obtain multiple candidate wavelength combinations; With the objectives of maximizing classification accuracy, minimizing the number of wavelengths, and minimizing the standard deviation of spectral data, the multiple candidate wavelength combinations are iteratively optimized to obtain the optimal wavelength combination. Based on the optimal wavelength combination, Helicobacter pylori detection was performed, and the detection results were obtained.

2. The method for detecting Helicobacter pylori according to claim 1, characterized in that, The goal is to maximize classification accuracy, minimize the number of wavelengths, and minimize the standard deviation of spectral data. This involves iterative optimization of multiple candidate wavelength combinations to obtain the optimal wavelength combination, including: Initialize the particle swarm parameters, with each particle corresponding to a candidate wavelength combination; Based on the candidate wavelength, initialize the position and velocity of the particle swarm; By combining the SVM classification model, the classification accuracy, number of wavelengths, and standard deviation of spectral data for each candidate wavelength combination are calculated. Based on the classification accuracy, the number of wavelengths, and the standard deviation of the spectral data, the fitness value of each particle is calculated. Based on the fitness value, the optimal position of the individual and the global optimal position are determined; Update the velocity and position of each particle, repeat the steps to calculate the fitness value and determine the individual optimal position and the global optimal position until convergence is reached, stop the iteration, and obtain the final global optimal position; The candidate wavelength combination corresponding to the final global optimal position is taken as the optimal wavelength combination.

3. The method for detecting Helicobacter pylori according to claim 1, characterized in that, The optimal wavelength combination includes a first preset wavelength, a second preset wavelength, a third preset wavelength, and a fourth preset wavelength; The detection of Helicobacter pylori based on the optimal wavelength combination yields the following results: Based on the reflection signals of the first preset wavelength, the second preset wavelength, the third preset wavelength, and the fourth preset wavelength of the tongue of the patient to be tested, and combined with the reflectance of the normal sample at the corresponding preset wavelength, the reflectance difference of each preset wavelength is calculated. Interference analysis is performed based on the reflectivity difference of each preset wavelength to obtain interference results, which include the presence of interference and the absence of interference. If there is no interference, the Helicobacter pylori infection risk index is calculated based on the reflectivity difference of each preset wavelength. Based on the reflectivity difference of each preset wavelength and the Helicobacter pylori infection risk index, combined with the corresponding risk threshold, infection risk detection is performed to obtain the detection results.

4. The method for detecting Helicobacter pylori according to claim 3, characterized in that, The interference analysis based on the reflectivity difference of each preset wavelength yields the interference results, including: If the reflectivity difference of each preset wavelength meets the interference condition, then interference is determined to exist. If the reflectivity difference of each preset wavelength does not meet the interference condition, then it is determined that there is no interference.

5. The method for detecting Helicobacter pylori according to claim 4, characterized in that, If the reflectivity difference of each preset wavelength meets the interference condition, then interference is determined to exist, including: If the reflectance difference of the first preset wavelength is less than the first difference threshold, and the reflectance differences of the second preset wavelength, the third preset wavelength, and the fourth preset wavelength are all within the preset interference range, then it is determined that there is food residue interference. If the reflectance difference of the third preset wavelength is greater than the second difference threshold, and the reflectance difference of the fourth preset wavelength is greater than the third difference threshold, then it is determined that there is insufficient blood color interference.

6. The method for detecting Helicobacter pylori according to claim 3, characterized in that, If there is no interference, the Helicobacter pylori infection risk index is calculated based on the reflectance difference of each preset wavelength, including: Based on the reflectance difference of the first preset wavelength, the reflectance difference of the second preset wavelength, and the reflectance difference of the fourth preset wavelength, and combined with the preset formula, the Helicobacter pylori infection risk index is calculated.

7. The method for detecting Helicobacter pylori according to claim 3, characterized in that, The infection risk is detected based on the reflectance difference of each preset wavelength and the Helicobacter pylori infection risk index, combined with the corresponding risk threshold, to obtain the detection results, including: If the Helicobacter pylori infection risk index is greater than or equal to the first risk threshold, and the reflectance difference of the first preset wavelength is within the first risk range, the reflectance difference of the second preset wavelength is greater than the second risk threshold, and the reflectance difference of the fourth preset wavelength is less than the third risk threshold, then the detection result is a high risk of Helicobacter pylori infection. If the Helicobacter pylori infection risk index is less than the first risk threshold, or the reflectance difference of the first preset wavelength is not within the first risk range, the reflectance difference of the second preset wavelength is less than or equal to the second risk threshold, or the reflectance difference of the fourth preset wavelength is greater than or equal to the third risk threshold, then the detection result is normal.

8. The method for detecting Helicobacter pylori according to claim 1, characterized in that, The candidate wavelengths are obtained by analyzing the reflectance differences of different types of samples in the sample spectral dataset, including: The sample spectral dataset is preprocessed to obtain a preprocessed spectral dataset; ANOVA analysis was performed on the preprocessed spectral dataset to calculate the reflectance differences among normal samples, interference samples, and Helicobacter pylori-infected samples at each initial wavelength. The candidate wavelengths are obtained based on the reflectance difference value and the reflectance difference threshold.

9. A Helicobacter pylori detection device, characterized in that, include: The communication module is used to acquire sample spectral datasets; the sample spectral datasets include the reflection signals of normal samples, interference samples, and Helicobacter pylori-infected samples at multiple initial wavelengths; The processing module is used to analyze the reflectance differences of different types of samples in the sample spectral dataset and screen out candidate wavelengths; the candidate wavelengths represent wavelengths with significant reflectance differences between different types of samples. The candidate wavelengths are arbitrarily combined to obtain multiple candidate wavelength combinations. With the objectives of maximizing classification accuracy, minimizing the number of wavelengths, and minimizing the standard deviation of spectral data, the multiple candidate wavelength combinations are iteratively optimized to obtain the optimal wavelength combination. Based on the optimal wavelength combination, Helicobacter pylori detection is performed to obtain the detection results.

10. An electronic device, characterized in that, It includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method as described in any one of claims 1 to 8.