A pathogenic bacteria typing method and device based on microscopic hyperspectral imaging technology
By combining microscopic hyperspectral imaging technology with pathogen body fluid models, the problem of detection error of the same bacteria under different body fluid environments has been solved, enabling accurate classification and identification of pathogens and improving detection efficiency and accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- XIAN FANGHEYUAN OPTICAL INSPECTION TECH CO LTD
- Filing Date
- 2023-05-11
- Publication Date
- 2026-04-14
AI Technical Summary
Existing technologies, when detecting the same type of bacteria in different bodily fluids, suffer from detection errors due to differences in growth environments, and therefore cannot accurately reflect the types of pathogens causing hospital-acquired infections.
Using microscopic hyperspectral imaging technology, pathogen samples from the body fluid to be tested are acquired, a pre-defined pathogen body fluid model is constructed, and hyperspectral images are labeled and classified using the center sampling method and random forest model to reduce errors caused by differences in growth environment.
It enables accurate classification and identification of pathogens, improves detection efficiency and accuracy, avoids the tediousness and time-consuming nature of manual judgment, and enhances the reliability of detection results.
Smart Images

Figure CN116625958B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of pathogen identification technology, specifically to a pathogen typing method and apparatus based on microscopic hyperspectral imaging technology. Background Technology
[0002] Clinical microbiology testing provides timely and accurate etiological diagnosis for clinicians. It mainly involves identifying pathogenic microorganisms in patients by extracting human blood, urine, excrement, sterile body fluids, etc. Bacteria are almost ubiquitous in human life. Beneficial bacteria are good for the body, while pathogenic bacteria pose a threat to human health. Therefore, efficient detection of bacterial categories is very important.
[0003] Clinically positive samples collected from different bodily fluids may exhibit variations in morphology, biochemical state, and protein amino acid composition due to differences in the body's internal circulation, nutrient supply, and normal flora in different regions. Currently, when detecting the same type of bacteria in different bodily fluids, they are simply grouped into a broad category for identification, thus determining the type of pathogen and some characteristic differences. However, because of the differences in the growth environment of the same type of bacteria in different bodily fluids, errors in identification can occur, making it impossible to completely and accurately reflect the category of hospital-acquired infection pathogens.
[0004] Therefore, a novel pathogen identification method is urgently needed to solve the above-mentioned technical problems. Summary of the Invention
[0005] This application provides a pathogen typing method and device based on microscopic hyperspectral imaging technology. The method involves inputting different pathogens in known body fluids into a preset pathogen body fluid model for analysis, thereby determining the type of pathogen and reducing detection errors caused by differences in the growth environment of the same bacteria in different body fluids.
[0006] In a first aspect, this application provides a pathogen typing method based on microscopic hyperspectral imaging technology, applied to a server, to acquire pathogen samples in the body fluid to be tested; to collect the pathogen samples in the body fluid to be tested and obtain a first hyperspectral image corresponding to the pathogen samples in the body fluid to be tested; to input the first hyperspectral image into a preset pathogen body fluid model to obtain the pathogen species, so as to determine the species of pathogen samples in the body fluid to be tested.
[0007] By adopting the above technical solution, and by acquiring and collecting pathogen samples from the body fluid to be tested, a true hyperspectral image of the pathogen in the body fluid to be tested can be obtained. This enables accurate classification and identification of infecting pathogens, reduces detection errors caused by differences in the spectrum images of the same bacteria in different body fluids, and achieves more accurate microbial detection.
[0008] Optionally, the first hyperspectral image is marked using the center-point sampling method, and the coordinates of the pathogen points are generated; the bands of the pathogen points in the first hyperspectral image are obtained; the coordinates and bands of the pathogen points are input into a preset pathogen body fluid model to obtain the pathogen species.
[0009] By adopting the above technical solution, the center-point sampling method is used to mark the first hyperspectral image, which can avoid errors caused by overly random sampling while ensuring the sample coverage area. At the same time, by obtaining the coordinates and bands of pathogen points, pathogens can be classified and identified more accurately, thereby improving the detection efficiency of pathogens.
[0010] Optionally, the body fluid type to be tested is obtained, including blood type and urine type; the coordinates, bands and body fluid type of the pathogen point are input into the preset body fluid sub-model to obtain the pathogen type; wherein, the preset pathogen body fluid model includes preset body fluid sub-model, and one body fluid type corresponds to one preset body fluid sub-model.
[0011] By adopting the above technical solution, pathogens can be classified and treated according to different types of body fluids, avoiding errors caused by differences in the composition and structure of the same pathogen in different body fluids. Furthermore, by inputting the coordinates, bands, and body fluid types of pathogen points into a preset body fluid sub-model, pathogens can be classified and identified more accurately, avoiding the tediousness and time-consuming nature of manual judgment and improving detection efficiency.
[0012] Optionally, a first pathogen training sample and a second pathogen training sample are obtained; the first pathogen training sample is a pathogen training sample in a first body fluid, and the second pathogen training sample is a pathogen training sample in a second body fluid, wherein the first body fluid and the second body fluid are any two different body fluid types; a second hyperspectral image corresponding to the first pathogen training sample is acquired, and a third hyperspectral image corresponding to the second pathogen training sample is acquired; a preset pathogen body fluid model is constructed, which includes a first body fluid sub-model and a second body fluid sub-model; the first body fluid sub-model is constructed from the second hyperspectral image, and the second body fluid sub-model is constructed from the third hyperspectral image.
[0013] By adopting the above technical solution, we can obtain more comprehensive spectral information of pathogens in different body fluid types, construct a preset pathogen body fluid model, and classify and identify pathogens based on the spectral information of different body fluid types. This avoids the influence of subjective factors when making judgments manually and improves the accuracy and reliability of the test results.
[0014] Optionally, the bands corresponding to the second hyperspectral image are obtained; the bands corresponding to the second hyperspectral image are clustered using a clustering algorithm to obtain the band features corresponding to the second hyperspectral image; a first volume fluid model is constructed, which includes the correspondence between the band features and the second hyperspectral image.
[0015] By adopting the above technical solutions, the accuracy of pathogen detection can be improved, the model construction process can be optimized, and the relationship between various elements in the model can be more clearly displayed.
[0016] Optionally, multiple sub-bands are obtained from the pathogen spot, and each band includes multiple sub-bands; a first weight is obtained, which is the weight corresponding to any one of the multiple sub-bands; it is determined whether the first weight is greater than a preset weight; when the first weight is greater than or equal to the preset weight, a first feature band corresponding to the pathogen spot is obtained, which includes the sub-band corresponding to the first weight; when the first weight is less than the preset weight, a second feature band corresponding to the pathogen spot is obtained, which does not include the sub-band corresponding to the first weight.
[0017] By adopting the above technical solution, more comprehensive spectral information of pathogens can be obtained, improving the accuracy of pathogen detection. By determining whether the first weight is greater than or equal to the preset weight, important sub-bands can be screened more effectively, avoiding excessive redundant information and noise interference, thereby optimizing the selection process of characteristic bands and improving detection efficiency.
[0018] Optionally, a random forest model is constructed based on multiple sub-bands, the random forest model including a decision tree; the first out-of-bag data error corresponding to the first sub-band is calculated based on the out-of-bag data of the decision tree; a second sub-band is constructed, the second sub-band is obtained by adding random noise to the first sub-band; the second out-of-bag data error corresponding to the second sub-band is calculated; the first out-of-bag data error and the second out-of-bag data error are summed to obtain the weight of the first sub-band.
[0019] By adopting the above technical solutions and using random forest models, including decision trees, pathogens can be classified and identified more accurately, the feature selection process is optimized, and the random forest model can be trained quickly due to its parallel processing, thus improving the efficiency of model training.
[0020] In a second aspect, this application provides a pathogen typing device based on microscopic hyperspectral imaging technology. The device is a server, which includes an acquisition unit, a processing unit, and a confirmation unit: the acquisition unit is used to acquire pathogen samples in the body fluid to be tested; the processing unit is used to collect the pathogen samples in the body fluid to be tested and obtain a first hyperspectral image corresponding to the pathogen samples in the body fluid to be tested; the confirmation unit is used to input the first hyperspectral image into a preset pathogen body fluid model to obtain the pathogen species, so as to determine the species of pathogen samples in the body fluid to be tested.
[0021] Optionally, the first hyperspectral image is marked using the center sampling method, and the coordinates of the pathogen points are generated; the acquisition unit is used to acquire the bands of the pathogen points in the first hyperspectral image; the processing unit is used to input the coordinates and bands of the pathogen points into a preset pathogen body fluid model to obtain the pathogen species.
[0022] Optionally, the acquisition unit is used to acquire the body fluid type of the body fluid to be tested, including blood type and urine type; the processing unit is used to input the coordinates, bands and body fluid type of the pathogen point into the preset body fluid sub-model to obtain the pathogen type; wherein, the preset pathogen body fluid model includes preset body fluid sub-models, and one body fluid type corresponds to one preset body fluid sub-model.
[0023] Optionally, the acquisition unit is used to acquire a first pathogen training sample and a second pathogen training sample; the first pathogen training sample is a pathogen training sample in a first body fluid, and the second pathogen training sample is a pathogen training sample in a second body fluid, wherein the first body fluid and the second body fluid are any two different body fluid types; a second hyperspectral image corresponding to the first pathogen training sample is acquired, and a third hyperspectral image corresponding to the second pathogen training sample is acquired; a preset pathogen body fluid model is constructed, the preset pathogen body fluid model including a first body fluid sub-model and a second body fluid sub-model; the first body fluid sub-model is constructed from the second hyperspectral image, and the second body fluid sub-model is constructed from the third hyperspectral image.
[0024] Optionally, the acquisition unit is used to acquire the bands corresponding to the second hyperspectral image; the processing unit is used to cluster the bands corresponding to the second hyperspectral image using a clustering algorithm to obtain the band features corresponding to the second hyperspectral image; and to construct a first volumetric fluid model, which includes the correspondence between the band features and the second hyperspectral image.
[0025] Optionally, the acquisition unit is used to acquire multiple sub-bands in the pathogen spot, and the band includes multiple sub-bands; the acquisition unit is used to acquire a first weight, which is the weight corresponding to any one of the multiple sub-bands; the processing unit is used to determine whether the first weight is greater than or equal to a preset weight; when the first weight is greater than or equal to the preset weight, the first feature band corresponding to the pathogen spot is obtained, and the first feature band includes the sub-band corresponding to the first weight; the confirmation unit is used to acquire a second feature band corresponding to the pathogen spot when the first weight is less than the preset weight, and the second feature band does not include the sub-band corresponding to the first weight.
[0026] Optionally, the processing unit is used to construct a random forest model based on multiple sub-bands, the random forest model including a decision tree; calculate the first out-of-bag data error corresponding to the first sub-band based on the out-of-bag data of the decision tree; construct a second sub-band, the second sub-band being obtained by adding random noise to the first sub-band; calculate the second out-of-bag data error corresponding to the second sub-band; and sum the first out-of-bag data error and the second out-of-bag data error to obtain the weight of the first sub-band.
[0027] In a third aspect, this application provides an electronic device including a processor, a memory, a user interface, and a network interface. The memory is used to store instructions, the user interface and the network interface are used to communicate with other devices, and the processor is used to execute the instructions stored in the memory, causing the electronic device to perform any of the methods described above in this application.
[0028] In a fourth aspect, this application provides a computer-readable storage medium storing instructions that, when executed, perform any of the methods described above in this application.
[0029] In summary, one or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages:
[0030] 1. Reduce the detection error of pathogens caused by the differences in composition and structure of the same bacteria growing in different body fluid environments, and achieve more accurate microbial detection.
[0031] 2. It can classify and identify pathogens more accurately, thereby improving the detection efficiency of pathogens.
[0032] 3. It can classify and identify pathogens more accurately, avoiding the tedious and time-consuming process of manual judgment and improving detection efficiency.
[0033] 4. It avoids the influence of subjective factors in manual judgment, further improving the accuracy and reliability of test results. Attached Figure Description
[0034] Figure 1This is a schematic diagram of the first process of a pathogen typing method based on microscopic hyperspectral imaging technology provided in an embodiment of this application;
[0035] Figure 2 This is a first scene diagram of a pathogen typing method based on microscopic hyperspectral imaging technology provided in an embodiment of this application;
[0036] Figure 3 This is a second scene diagram of a pathogen typing method based on microscopic hyperspectral imaging technology provided in an embodiment of this application;
[0037] Figure 4 This is a schematic diagram of the second process of a pathogen typing method based on microscopic hyperspectral imaging technology provided in an embodiment of this application;
[0038] Figure 5 This is a third scene diagram of a pathogen typing method based on microscopic hyperspectral imaging technology provided in an embodiment of this application;
[0039] Figure 6 This is a schematic diagram of the pathogen typing device based on microscopic hyperspectral imaging technology provided in the embodiments of this application;
[0040] Figure 7 This is a schematic diagram of the structure of an electronic device disclosed in an embodiment of this application.
[0041] Explanation of reference numerals in the attached drawings: 601, acquisition unit; 602, processing unit; 603, confirmation unit; 700, electronic device; 701, processor; 702, communication bus; 703, user interface; 704, network interface; 705, memory. Detailed Implementation
[0042] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments.
[0043] In the description of the embodiments of this application, the words "for example" or "for instance" are used to indicate examples, illustrations, or explanations. Any embodiment or design that is described as "for example" or "for instance" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design options. Rather, the use of the words "for example" or "for instance" is intended to present the relevant concepts in a specific manner.
[0044] In the description of the embodiments of this application, the term "multiple" means two or more. For example, multiple systems means two or more systems, and multiple screen terminals means two or more screen terminals. The terms "comprising," "including," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.
[0045] Clinical microbiology testing provides timely and accurate etiological diagnosis for clinicians. It mainly involves identifying pathogenic microorganisms in patients by extracting human blood, urine, excrement, sterile body fluids, etc. Bacteria are almost ubiquitous in human life. Beneficial bacteria are good for the body, while pathogenic bacteria pose a threat to human health. Therefore, efficient detection of bacterial categories is very important.
[0046] Except for a few genes that maintain stable expression under all types of external environments, the expression of most genes in microorganisms, and the level of expression, is regulated according to changes in the external environment. The environment affects not only the individual organism but also its genetic material. By providing matter and energy, the environment selects genes, influences epigenetic modifications, damages genes, and induces gene mutations, thus affecting genes in various ways.
[0047] Colony morphology (including size, shape, edge, luster, texture, color, and transparency) is a fixed set of characteristics for each bacterium under specific conditions. Therefore, from a bacterial identification perspective, bacterial morphology remains relatively stable under constant influencing factors such as culture method, culture medium, and culture time. Opportunistic pathogens refer to normal flora residing in certain parts of the human body. They are relatively stable and do not normally exhibit pathogenic effects. They can only cause disease when the body's immunity is weakened, the residing site changes, or the flora becomes imbalanced. For example, accelerated reproduction of microorganisms in the original parasitic site can change their numbers, leading to local microbial imbalance and disease. Alternatively, changes in the normal parasitic site of these microorganisms can cause a change in the residing site, triggering a series of immune responses in the body and leading to disease.
[0048] Clinically positive samples collected from different bodily fluids may exhibit variations in morphology, biochemical state, and protein amino acid composition due to differences in the body's internal circulation, nutrient supply, and normal flora in different regions. Currently, when testing for the same type of bacteria in different bodily fluids, they are simply grouped into a broad category for identification, thus determining the type of pathogen and some characteristic differences. However, because of the differences in the growth environment of the same type of bacteria in different bodily fluids, errors in identification can occur, failing to accurately and objectively reflect the precise category of hospital-acquired infection pathogens, leading to inaccurate test results.
[0049] Therefore, reducing detection errors caused by differences in composition and structure due to the growth of the same bacteria in different bodily fluid environments, and improving the detection efficiency of pathogens, is a pressing problem that needs to be solved. This application provides a pathogen typing method based on microscopic hyperspectral imaging technology, applied in a server. The server in this application can be a platform for microbial testing services. Figure 1 This is a schematic diagram of the first process of a pathogen typing method based on microscopic hyperspectral imaging technology provided in an embodiment of this application. (Refer to...) Figure 1 The method includes the following steps S101-S103.
[0050] Step S101: Obtain pathogen samples from the body fluid to be tested.
[0051] In the above steps, before the server obtains the pathogen sample from the body fluid to be tested, it needs to extract the pathogen sample from the body fluid to be tested.
[0052] Pathogens can also be cultured, and then slides prepared to obtain pathogen samples from the body fluids to be tested. The isolation and pure culture of pathogens is as follows: Step 1: Prepare a 0.5 McFarland unit suspension of the target bacteria; Step 2: Spread the bacterial suspension from Step 1 evenly onto blood agar plates using the three-zone streak method; Step 3: Incubate the blood agar plates in an incubator for 16-24 hours. The required incubation time varies depending on the specific pathogen; the incubation time should be determined according to the actual pathogen's requirements, and no specific time limit is specified here.
[0053] After culturing the pathogens, a slide is prepared. The slide preparation steps are as follows: Step 1: Take a clean turbidity tube containing physiological saline and set aside. Step 2: Use a medical cotton swab to pick up an appropriate amount of pathogens from the culture dish and add it to the prepared turbidity tube to make a bacterial suspension. Shake and mix thoroughly with a shaker. Step 3: Measure the turbidity of the bacterial suspension. Once the turbidity is suitable, set the prepared bacterial suspension aside. Step 4: Take a clean glass slide, clean it thoroughly, and then bake it thoroughly with an alcohol lamp to remove the wax. Let it cool and set aside. Step 5: Take an appropriate amount of bacterial suspension from the turbidity tube and spread it evenly and quickly onto the glass slide obtained in Step 4. Step 6: Place the prepared smear in a biosafety cabinet until it is completely dry. The dried glass slide needs to be baked back and forth under an alcohol lamp several times to fix the pathogens. Step 7: Alternatively, rinse the smear prepared in Step 6 with physiological saline (75% alcohol), then blot off any residual physiological saline (75% alcohol) from its surface and allow it to air dry for fixation. After preparing the smear for the pathogen, the pathogen sample to be tested is obtained.
[0054] Step S102: Collect pathogen samples from the body fluid to be tested and obtain the first hyperspectral image corresponding to the pathogen samples from the body fluid to be tested.
[0055] In the above steps, the server acquires the first hyperspectral image corresponding to the pathogen sample in the body fluid to be tested. The user places the slide of the pathogen sample in the body fluid to be tested onto the microscope stage. At this point, the user refers to the relevant personnel who will be testing the pathogen sample. They can first search for the field of view under a 10x objective lens, and then switch the objective lens to a 100x objective lens to search for a field of view where the bacteria are evenly distributed. Then, automatic sweeping is performed to obtain the hyperspectral image of the bacteria, which is the first hyperspectral image corresponding to the pathogen sample in the body fluid to be tested.
[0056] Step S103: Input the first hyperspectral image into the preset pathogen body fluid model to obtain the pathogen species, so as to determine the species of pathogen samples in the body fluid to be tested.
[0057] In the above steps, after the server acquires the first hyperspectral image, it inputs it into a preset pathogen body fluid model. Based on the first hyperspectral image, a corresponding preset image is matched within the preset pathogen body fluid model. The preset image refers to the hyperspectral image corresponding to different pathogens in different body fluids within the preset pathogen body fluid model. Then, the pathogen species are determined based on the preset image, allowing the user to identify the species of pathogen in the sample of the body fluid to be tested.
[0058] Furthermore, before inputting the first hyperspectral image into the preset pathogen body fluid model to obtain the pathogen species, the preset pathogen body fluid model needs to be constructed in advance. Constructing the preset pathogen body fluid model specifically includes: obtaining a first pathogen training sample and a second pathogen training sample. The first pathogen training sample is a pathogen training sample in the first body fluid, and the second pathogen training sample is a pathogen training sample in the second body fluid. The first and second body fluids are any two different body fluid types, including human blood, urine, excrement, sterile body fluids, tissue fluid, intrapleural fluid, intraperitoneal fluid, and cerebrospinal fluid, etc.
[0059] A second hyperspectral image corresponding to the first pathogen training sample is acquired, and a third hyperspectral image corresponding to the second pathogen training sample is acquired. A preset pathogen body fluid model is constructed. The preset pathogen body fluid model includes a first body fluid sub-model and a second body fluid sub-model. The first body fluid sub-model is constructed from the second hyperspectral image, and the second body fluid model is constructed from the third hyperspectral image.
[0060] After obtaining the second hyperspectral image, the center-point method is used to mark the second hyperspectral image and generate the coordinates of pathogen points. The corresponding bands are obtained based on the coordinates of the pathogen points. The first body fluid model is constructed from the second hyperspectral image, specifically including: after obtaining the bands corresponding to the second hyperspectral image, clustering the bands corresponding to the second hyperspectral image is performed using a clustering algorithm. The specific clustering steps are as follows: Step 1: Obtain data sample D. Data sample D is obtained after processing multiple bands in the second hyperspectral image. Then, randomly select K data samples from data sample D as mass points (reference points) 0j, where the value of j ranges from 1 to K. Step 2: Repeatedly assign the remaining sample points to the K clusters. Step 3: Randomly select a non-mass point sample W; calculate the exchange object W and the 01 reference point, and repeat the above step 2 operation to generate a new set of clusters. Calculate the objective function S. If S < 0, exchange W and 01 and retain the new clusters; otherwise, retain the original center point and clusters. Repeat step 3 until the K centroids no longer change. Once the K centroids no longer change, the clustering result is obtained, as shown below. Figure 2 As shown, Figure 2 This is a first scene diagram of a pathogen typing method based on microscopic hyperspectral imaging technology provided in an embodiment of this application.
[0061] Based on the clustering results, the second hyperspectral image is then divided to obtain the band features corresponding to the second hyperspectral image. Different band features correspond to different images. The band features and the second hyperspectral image are stored in the first volume liquid model to establish the correspondence between the band features and the second hyperspectral image. The correspondence is also stored in the first volume liquid model.
[0062] For example, based on the actual situation, the second hyperspectral image is divided into 9 clusters, and the images corresponding to the 9 clusters are as follows: Figure 3 As shown, Figure 3 This is a second scene image of a pathogen typing method based on microscopic hyperspectral imaging technology provided in this application embodiment. The images corresponding to the nine clusters have subtle differences, and the important pathogen points in the second hyperspectral image are determined based on the differences.
[0063] The first and second body fluids are two different types of body fluids, but the construction method of the second body fluid sub-model based on the third hyperspectral image is the same as that of the first body fluid sub-model, so it will not be explained again here. After constructing the second body fluid sub-model according to the construction method, the second body fluid sub-model stores the first band features corresponding to the third hyperspectral image, and also stores the correspondence between the third hyperspectral image and the first band features.
[0064] The preset pathogen body fluid model includes multiple preset body fluid sub-models. One preset body fluid sub-model corresponds to one body fluid type. Multiple preset body fluid sub-models can be set according to the actual body fluid type, and there is no limitation here.
[0065] To more accurately extract the characteristic spectral lines of the same pathogen in different body fluid environments, different body fluid sub-models are established based on the same pathogen in different body fluids. The number of body fluid sub-models can be set according to the actual body fluid type, and examples will not be given here.
[0066] For example, when a first pathogen training sample is obtained, if the first pathogen training sample is pathogen sample A, the body fluid type of pathogen sample A is determined. If the body fluid type of pathogen sample A is the first body fluid and the first body fluid is blood, the second hyperspectral image corresponding to pathogen sample A is collected and stored in the preset first body fluid sub-model. At this time, the preset first body fluid sub-model stores pathogen training samples with body fluid type of blood.
[0067] In addition, if the body fluid category of pathogen sample A is the second body fluid and the second body fluid is urine, the third hyperspectral image corresponding to pathogen sample A is collected and stored in the preset second body fluid sub-model. At this time, the preset second body fluid sub-model is a training sample of pathogens with body fluid type of urine.
[0068] In one possible implementation, after obtaining the first hyperspectral image, the first hyperspectral image can be marked using the center sampling method, and the coordinates of the pathogen points can be generated; the bands of the pathogen points in the first hyperspectral image can be obtained, all the pathogen points in the image can be selected, and the coordinates of each point can be obtained according to the stored pixel blocks, each coordinate corresponding to a different band; then the coordinates and bands of the pathogen points are input into a preset pathogen body fluid model to obtain the pathogen species.
[0069] Furthermore, the body fluid type to be tested is obtained, including human blood, urine, excrement, and sterile body fluid types. The coordinates, wavelengths, and body fluid type of the pathogen points are then input into a preset body fluid sub-model to obtain the pathogen species. The preset pathogen body fluid model includes preset body fluid sub-models, with one preset body fluid sub-model corresponding to one body fluid type.
[0070] For example, if the body fluid to be tested is blood, the coordinates and bands of the pathogen points in the first hyperspectral image are obtained. A preset body fluid sub-model can be determined according to the body fluid type. At this time, the preset body fluid sub-model is a sub-model specifically for blood type. Then, the coordinates and bands of the pathogen points are input into the preset body fluid sub-model for matching. The preset body fluid sub-model matches pathogen species with similar coordinates and bands to the pathogen points and outputs similar pathogen species, thus determining the pathogen species of the pathogen sample in the body fluid to be tested.
[0071] Furthermore, after obtaining multiple bands corresponding to the first hyperspectral image, in order to perform detection on the first hyperspectral image more quickly, a weight calculation is performed on each band in the first hyperspectral image. The importance of each band is measured based on the weight, and subsequent operations are then performed according to the importance of each band. For example... Figure 4 As shown, Figure 4 This is a schematic diagram of the second process of a pathogen typing method based on microscopic hyperspectral imaging technology provided in this application embodiment. The method includes the following steps S401-S404.
[0072] Step S401: Obtain multiple sub-bands from the pathogen spot, where each band includes multiple sub-bands.
[0073] In the above steps, the first hyperspectral image is marked using the center sampling method, and the coordinates of the pathogen points are generated; then the bands of the pathogen points in the first hyperspectral image are obtained, and the bands include multiple sub-bands.
[0074] Step S402: Obtain the first weight, which is the weight corresponding to any one of the multiple sub-bands.
[0075] In the above steps, a random forest model is constructed based on multiple sub-bands. The random forest model includes decision trees. When building the decision trees, a dataset is obtained through repeated sampling to train the decision trees. Data that is not sampled for training the decision trees is called out-of-bag data. The out-of-bag data is then used to evaluate the performance of the decision trees, and its out-of-bag error is calculated. First, the first out-of-bag error corresponding to the first sub-band is calculated, denoted as A1. The first sub-band is any one of the multiple sub-bands. Then, the second sub-band is constructed by randomly adding noise interference to all samples of the out-of-bag data, randomly changing the sample values, and then calculating the second out-of-bag error corresponding to the second sub-band, denoted as A2. Based on the number of bands N involved in constructing the random forest model, the first out-of-bag error and the second out-of-bag error are summed to obtain the weight of the first sub-band, denoted as B. The weight calculation formula is as follows:
[0076]
[0077] The weight values are used to illustrate the importance of each band. If adding random noise significantly reduces the accuracy of out-of-bag data (i.e., the error of the second out-of-bag data increases), it indicates that the first sub-band has a significant impact on the prediction results of the samples, thus demonstrating its high importance. Weights are then calculated for other sub-bands to obtain their corresponding weights.
[0078] Step S403: Determine whether the first weight is greater than or equal to the preset weight.
[0079] In the above steps, after calculating the first weight of the first sub-band, the preset weight is the average data set based on the weight data. It can be set according to the actual situation and is not limited here. Then, it is determined whether the first weight is greater than or equal to the preset weight.
[0080] Step S404: When the first weight is greater than or equal to the preset weight, the first characteristic band corresponding to the pathogen point is obtained. The first characteristic band includes the sub-band corresponding to the first weight. When the first weight is less than the preset weight, the second characteristic band corresponding to the pathogen point is obtained. The second characteristic band does not include the sub-band corresponding to the first weight.
[0081] In the above steps, when the first weight is greater than or equal to the preset weight, it is confirmed that the first sub-band has a significant impact on the prediction result of the sample. Therefore, the first feature band corresponding to the pathogen point is obtained, and the first feature band includes the sub-band corresponding to the first weight. For example, if the first weight is set to 0.004 and the preset weight value is 0.002, the first weight is greater than the preset weight, and the sub-band corresponding to the first weight is retained.
[0082] Furthermore, when the first weight is less than the preset weight, it is confirmed that the first sub-band has little impact on the prediction results of the sample. Therefore, the second feature band corresponding to the pathogen point is obtained. The second feature band does not include the sub-band corresponding to the first weight. For example, if the first weight is set to 0.001 and the preset weight value is 0.002, and the first weight is less than the preset weight, it is confirmed that the sub-band corresponding to the first weight is removed.
[0083] Furthermore, the weights of the other sub-bands are calculated sequentially, and then it is determined whether each weight is greater than a preset weight. Based on the determination result, the corresponding feature band set is obtained. Alternatively, the weights of each sub-band can be calculated first, and then sorted in descending order according to the weights to obtain the first sorted set, such as... Figure 5 As shown, Figure 5This is a third scene diagram of a pathogen typing method based on microscopic hyperspectral imaging technology provided in this application embodiment. According to a preset ratio, sub-bands in the first sorted set are removed to obtain a second sorted set. Then, the weight corresponding to each sub-band in the second sorted set is calculated, and sub-bands in the second sorted set are removed again according to the preset ratio until the number of sub-bands in the second sorted set reaches a preset value. The out-of-bag error corresponding to the preset value is then obtained, and the feature set with the smaller out-of-bag error is selected. Figure 5 The characteristic band set in the image is obtained by processing the aforementioned pathogens, and does not mean that the characteristic band sets of all pathogens are like this. Figure 5 As shown here, this is just an example. Different pathogens correspond to different characteristic band sets, so the corresponding characteristic band sets are also different. Different pathogens are processed according to the actual situation to obtain the corresponding characteristic band sets.
[0084] Then, cluster analysis is performed on the features to obtain the corresponding feature bands. The feature bands are then input into a preset body fluid sub-model for matching to determine the type of pathogen.
[0085] This application also provides a pathogen typing device based on microscopic hyperspectral imaging technology. Figure 6 This is a schematic diagram of the pathogen typing device based on microscopic hyperspectral imaging technology provided in the embodiments of this application. (Refer to...) Figure 6 The server includes an acquisition unit 601, a processing unit 602, and a confirmation unit 603.
[0086] Acquisition unit 601 is used to acquire pathogen samples in the body fluid to be tested.
[0087] The processing unit 602 is used to collect pathogen samples in the body fluid to be tested and obtain the first hyperspectral image corresponding to the pathogen sample in the body fluid to be tested.
[0088] The confirmation unit 603 is used to input the first hyperspectral image into a preset pathogen body fluid model to obtain the pathogen species, so as to determine the species of pathogen sample in the body fluid to be tested.
[0089] In one possible implementation, the first hyperspectral image is marked using a center sampling method, and the coordinates of the pathogen points are generated; the acquisition unit 601 is used to acquire the bands of the pathogen points in the first hyperspectral image; the processing unit 602 is used to input the coordinates and bands of the pathogen points into a preset pathogen body fluid model to obtain the pathogen species.
[0090] In one possible implementation, the acquisition unit 601 is used to acquire the body fluid type of the body fluid to be tested, including blood type and urine type; the processing unit 602 is used to input the coordinates, bands and body fluid type of the pathogen point into a preset body fluid sub-model to obtain the pathogen type; wherein, the preset pathogen body fluid model includes a preset body fluid sub-model, and one body fluid type corresponds to one preset body fluid sub-model.
[0091] In one possible implementation, the acquisition unit 601 is used to acquire a first pathogen training sample and a second pathogen training sample; the first pathogen training sample is a pathogen training sample in a first body fluid, and the second pathogen training sample is a pathogen training sample in a second body fluid, wherein the first body fluid and the second body fluid are any two different body fluid types; a second hyperspectral image corresponding to the first pathogen training sample is acquired, and a third hyperspectral image corresponding to the second pathogen training sample is acquired; a preset pathogen body fluid model is constructed, the preset pathogen body fluid model including a first body fluid sub-model and a second body fluid sub-model; the first body fluid sub-model is constructed from the second hyperspectral image, and the second body fluid sub-model is constructed from the third hyperspectral image.
[0092] In one possible implementation, the acquisition unit 601 is used to acquire the band corresponding to the second hyperspectral image; the processing unit 602 is used to cluster the band corresponding to the second hyperspectral image using a clustering algorithm to obtain the band features corresponding to the second hyperspectral image; and to construct a first volumetric model, which includes the correspondence between the band features and the second hyperspectral image.
[0093] In one possible implementation, the acquisition unit 601 is used to acquire multiple sub-bands in the pathogen spot, the band including multiple sub-bands; the acquisition unit 601 is used to acquire a first weight, the first weight being the weight corresponding to any one of the multiple sub-bands; the processing unit 602 is used to determine whether the first weight is greater than or equal to a preset weight; when the first weight is greater than or equal to the preset weight, a first feature band corresponding to the pathogen spot is obtained, the first feature band including the sub-band corresponding to the first weight; the confirmation unit is used to acquire a second feature band corresponding to the pathogen spot when the first weight is less than the preset weight, the second feature band not including the sub-band corresponding to the first weight.
[0094] In one possible implementation, the processing unit 602 is configured to construct a random forest model based on multiple sub-bands, the random forest model including a decision tree; calculate the first out-of-bag data error corresponding to the first sub-band based on the out-of-bag data of the decision tree; construct a second sub-band, the second sub-band being obtained by adding random noise to the first sub-band; calculate the second out-of-bag data error corresponding to the second sub-band; and sum the first out-of-bag data error and the second out-of-bag data error to obtain the weight of the first sub-band.
[0095] It should be noted that the above embodiments of the apparatus are only illustrated by the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.
[0096] This application also discloses an electronic device. (See reference...) Figure 7 , Figure 7 This application provides a schematic diagram of the structure of an electronic device. The electronic device 700 may include: at least one processor 701, at least one network interface 704, a user interface 703, a memory 705, and at least one communication bus 702.
[0097] The communication bus 702 is used to enable communication between these components.
[0098] The user interface 703 may include a display screen and a camera. Optionally, the user interface 703 may also include a standard wired interface and a wireless interface.
[0099] The network interface 704 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface).
[0100] The processor 701 may include one or more processing cores. The processor 701 connects to various parts of the server using various interfaces and lines, and performs various server functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in memory 705, and by calling data stored in memory 705. Optionally, the processor 701 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 701 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and application requests; the GPU is responsible for rendering and drawing the content required for display; and the modem handles wireless communication. It is understood that the modem may also not be integrated into the processor 701 and may be implemented as a separate chip.
[0101] The memory 705 may include random access memory (RAM) or read-only memory. Optionally, the memory 705 may include a non-transitory computer-readable storage medium. The memory 705 may be used to store instructions, programs, code, code sets, or instruction sets. The memory 705 may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for at least one function (such as touch functionality, sound playback functionality, image playback functionality, etc.), instructions for implementing the various method embodiments described above, etc.; the data storage area may store data involved in the various method embodiments described above, etc. Optionally, the memory 705 may also be at least one storage device located remotely from the aforementioned processor 701.
[0102] like Figure 7 As shown, the memory 705, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and an application program for pathogen typing based on microscopic hyperspectral imaging technology.
[0103] exist Figure 7In the electronic device 700 shown, the user interface 703 is mainly used to provide an input interface for the user and to obtain the user input data; while the processor 701 can be used to call the application program based on pathogen typing technology stored in the memory 705. When executed by one or more processors, the electronic device performs one or more of the methods described in the above embodiments.
[0104] An electronic device readable storage medium stores instructions that, when executed by one or more processors, cause the electronic device to perform one or more of the methods described in the above embodiments.
[0105] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0106] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0107] In the several embodiments provided in this application, it should be understood that the disclosed apparatus can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some service interfaces; indirect couplings or communication connections between devices or units may be electrical or other forms.
[0108] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0109] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0110] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned memory includes various media capable of storing program code, such as USB flash drives, portable hard drives, magnetic disks, or optical disks.
[0111] The above description is merely an exemplary embodiment of this disclosure and should not be construed as limiting the scope of this disclosure. Any equivalent changes and modifications made in accordance with the teachings of this disclosure shall still fall within the scope of this disclosure. Those skilled in the art will readily conceive of other embodiments of this disclosure upon considering the specification and the disclosure of practical truths. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not described in this disclosure.
Claims
1. A pathogen typing method based on microscopic hyperspectral imaging technology, characterized in that, When applied to a server, the method includes: Obtain pathogen samples from the body fluids to be tested; A pathogen sample is collected from the body fluid to be tested, and a first hyperspectral image corresponding to the pathogen sample in the body fluid to be tested is obtained; The first hyperspectral image is input into a preset pathogen body fluid model to obtain the pathogen species, so as to determine the species of pathogen samples in the body fluid to be tested; the step of inputting the first hyperspectral image into the preset pathogen body fluid model to obtain the pathogen species specifically includes: marking the first hyperspectral image using the center sampling method and generating the coordinates of the pathogen points; obtaining the bands of the pathogen points in the first hyperspectral image; inputting the coordinates and bands of the pathogen points into the preset pathogen body fluid model to obtain the pathogen species; the step of obtaining the bands of the pathogen points in the first hyperspectral image specifically includes: obtaining the bands of the pathogen points in the first hyperspectral image. The band includes multiple sub-bands; a first weight is obtained, which is the weight corresponding to any one of the multiple sub-bands; it is determined whether the first weight is greater than or equal to a preset weight; when the first weight is greater than or equal to the preset weight, it is confirmed that the sub-band corresponding to the first weight is retained, and a first feature band corresponding to the pathogen point is obtained, the first feature band including the sub-band corresponding to the first weight; when the first weight is less than the preset weight, it is confirmed that the sub-band corresponding to the first weight is removed, and a second feature band corresponding to the pathogen point is obtained, the second feature band not including the sub-band corresponding to the first weight; The method further includes: calculating the weights corresponding to multiple sub-bands, sorting them in descending order according to the weights to obtain a first sorted set, removing sub-bands from the first sorted set according to a preset ratio to obtain a second sorted set, calculating the weight corresponding to each sub-band in the second sorted set, removing sub-bands from the second sorted set according to the preset ratio until the number of sub-bands in the second sorted set is a preset number, obtaining the out-of-bag error corresponding to the preset number, selecting a feature set with a smaller out-of-bag error, performing cluster analysis on the feature set with a smaller out-of-bag error, and obtaining feature bands.
2. The method according to claim 1, characterized in that, The coordinates and wavelength of the pathogen point are input into the preset pathogen body fluid model to obtain the pathogen type. Specifically, it includes: Obtain the body fluid type of the body fluid to be tested, including blood type and urine type; The coordinates of the pathogen point, the band, and the body fluid type are input into a preset body fluid sub-model to obtain the pathogen type; wherein, the preset pathogen body fluid model includes the preset body fluid sub-model, and one body fluid type corresponds to one preset body fluid sub-model.
3. The method according to claim 1, characterized in that, Before inputting the first hyperspectral image into the preset pathogen body fluid model to obtain the pathogen species, the preset pathogen body fluid model is constructed, specifically including: Acquire a first pathogen training sample and a second pathogen training sample; the first pathogen training sample is a pathogen training sample in a first body fluid, and the second pathogen training sample is a pathogen training sample in a second body fluid, wherein the first body fluid and the second body fluid are any two different body fluid types; acquire a second hyperspectral image corresponding to the first pathogen training sample, and acquire a third hyperspectral image corresponding to the second pathogen training sample; A preset pathogen body fluid model is constructed, which includes a first body fluid sub-model and a second body fluid model; the first body fluid sub-model is constructed from the second hyperspectral image, and the second body fluid model is constructed from the third hyperspectral image.
4. The method according to claim 3, characterized in that, The first volumetric fluid model is constructed from the second hyperspectral image and specifically includes: Obtain the band corresponding to the second hyperspectral image; Clustering algorithms are used to cluster the bands corresponding to the second hyperspectral image to obtain the band features corresponding to the second hyperspectral image. Construct the first volume liquid model, which includes the correspondence between the band features and the second hyperspectral image.
5. The method according to claim 1, characterized in that, The process of obtaining the first weight specifically includes: constructing a random forest model based on multiple sub-bands, wherein the random forest model includes a decision tree; The first out-of-bag data error corresponding to the first sub-band is calculated based on the out-of-bag data of the decision tree. A second sub-band is constructed, which is obtained by adding random noise to the first sub-band; Calculate the second out-of-bag data error corresponding to the second sub-band; The weight of the first sub-band is obtained by summing the first out-of-bag data error and the second out-of-bag data error.
6. A pathogen typing device based on microscopic hyperspectral imaging technology, characterized in that, The device is a server, which includes an acquisition unit (601), a processing unit (602), and a confirmation unit (603): the acquisition unit (601) is used to acquire pathogen samples in the body fluid to be tested; The processing unit (602) is used to collect pathogen samples in the body fluid to be tested and obtain a first hyperspectral image corresponding to the pathogen samples in the body fluid to be tested. The confirmation unit (603) is used to input the first hyperspectral image into a preset pathogen body fluid model to obtain the pathogen species, so as to determine the species of pathogen sample in the body fluid to be tested; The first hyperspectral image is input into a preset pathogen body fluid model to obtain the pathogen species; Specifically, this includes: marking the first hyperspectral image using a center-point sampling method and generating the coordinates of pathogen points; obtaining the bands of the pathogen points in the first hyperspectral image; inputting the coordinates of the pathogen points and the bands into the preset pathogen body fluid model to obtain the pathogen species; the step of obtaining the bands of the pathogen points in the first hyperspectral image specifically includes: obtaining multiple sub-bands of the pathogen points, each band including multiple sub-bands; obtaining a first weight, the first weight being the weight corresponding to any one of the multiple sub-bands; determining whether the first weight is greater than or equal to a preset weight; when the first weight is greater than or equal to the preset weight, confirming the retention of the sub-band corresponding to the first weight, obtaining a first feature band corresponding to the pathogen point, the first feature band including the sub-band corresponding to the first weight; when the first weight is less than the preset weight, confirming the removal of the sub-band corresponding to the first weight, obtaining a second feature band corresponding to the pathogen point, the second feature band not including the sub-band corresponding to the first weight; The weights corresponding to the multiple sub-bands are calculated, and the sub-bands are sorted in descending order according to the weights to obtain a first sorted set. The sub-bands in the first sorted set are removed according to a preset ratio to obtain a second sorted set. The weights corresponding to each sub-band in the second sorted set are calculated, and the sub-bands in the second sorted set are removed according to the preset ratio until the number of sub-bands in the second sorted set is a preset number. The out-of-bag error corresponding to the preset number is obtained. The feature set with smaller out-of-bag error is selected, and cluster analysis is performed on the feature set with smaller out-of-bag error to obtain the feature bands.
7. An electronic device, characterized in that, The device includes a processor (701), a memory (705), a user interface (703), and a network interface (704). The memory (705) is used to store instructions. The user interface (703) and the network interface (704) are used to communicate with other devices. The processor (701) is used to execute the instructions stored in the memory (705) to cause the electronic device (700) to perform the method as described in any one of claims 1-5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed, perform the method as described in any one of claims 1-5.
Citation Information
Patent Citations
Detection of Biological Cells or Biological Substances
US20200193140A1