Method and device for determining indoor fungal contamination level, equipment and medium
By performing grayscale and binarization processing on fungal images and combining them with a unit colony count model, the fungal contamination level can be automatically inferred, solving the problem of low discrimination accuracy in existing technologies and achieving a more accurate assessment of indoor fungal contamination levels.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHONGQING UNIV
- Filing Date
- 2022-09-05
- Publication Date
- 2026-07-14
AI Technical Summary
In existing technologies, when manually determining the level of indoor fungal contamination based on current area statistical standards, there is a problem of low accuracy.
By acquiring fungal images captured by a preset camera, performing grayscale and binarization processing, calculating the grayscale mean and colony area ratio, and using a unit colony count model to determine the predicted number of fungal colonies per unit, the fungal contamination level is automatically inferred by combining the grayscale mean and colony area ratio.
It improves the accuracy of indoor fungal pollution level determination, takes into account fungal growth characteristics, reduces the error of manual subjective statistics, and provides a more accurate pollution level assessment.
Smart Images

Figure CN115601298B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of fungi, and more particularly to a method, apparatus, equipment and medium for determining the level of indoor fungal contamination. Background Technology
[0002] Currently, when determining the level of indoor fungal contamination, the area encompassed by the outer edge of the colony, as observed by the human eye, is considered a percentage of the total area within a preset range (current area statistical standard). For example, if one-third of the area within the preset range is covered by continuous colonies, the coarse-grained generalization of the current contamination level is level 2. However, different fungal species have different hyphal patterns. There is a possibility that when the hyphae are sparse, the area percentage subjectively estimated by the human eye is lower, while the actual diffusion capacity of the fungus is greater; conversely, when the hyphae are abundant, the area percentage subjectively estimated by the human eye is higher, while the actual diffusion capacity of the fungus is smaller. Therefore, there is an error between the statistically estimated colony area percentage and the actual colony area percentage. Thus, when using the area encompassed by the outer edge of the colony, as observed by the human eye, to coarsely determine the level of indoor fungal contamination, there is a problem of misjudgment. In other words, the existing technology suffers from low accuracy when manually determining the level of indoor fungal contamination based on the current area statistical standard.
[0003] The above content is only used to help understand the technical solution of this application and does not represent an admission that the above content is prior art. Summary of the Invention
[0004] The main objective of this invention is to provide a method, apparatus, equipment, and medium for determining the level of indoor fungal contamination, aiming to solve the problem of low accuracy in the prior art when manually determining the level of indoor fungal contamination based on current area statistical standards.
[0005] To achieve the above objectives, this application provides a method for determining the level of indoor fungal contamination, the method comprising:
[0006] When a request to determine the level of indoor fungal contamination is received, fungal images captured by a preset camera are obtained;
[0007] A unit colony count model is determined, wherein the unit colony count model is different for different fungal species;
[0008] The fungal image is converted to grayscale to obtain a fungal grayscale image. The average grayscale value of all pixels in the fungal grayscale image is calculated to obtain the grayscale mean.
[0009] The grayscale image of the fungus is binarized to obtain a binary image of the fungus. Based on the binary image of the fungus, the proportion of the colony area is determined.
[0010] The mean gray level and the colony area ratio are input into the unit colony count model. Based on the unit colony count model, the mean gray level and the colony area ratio are processed to obtain the predicted number of unit colonies of the fungus.
[0011] The current fungal contamination level is determined based on the predicted number of colonies per unit.
[0012] Optionally, Canny edge detection is performed on the grayscale image of the fungus, and threshold segmentation is performed on the grayscale image of the fungus after edge detection based on a preset grayscale threshold to obtain the binary image of the fungus, wherein the grayscale values of all pixels in the binary image of the fungus include a first grayscale value and a second grayscale value.
[0013] After performing an erosion operation on the binary image of the fungus, a dilation operation is then performed. The area ratio of the pixels with the first gray value in the binary image of the fungus after the dilation operation is calculated to obtain the first ratio.
[0014] Calculate the area ratio of the pixels with the second gray value in the binary image of the fungus after the dilation operation to obtain the second ratio;
[0015] Based on the bacterial species, the first proportion is determined to be the proportion of the colony area, or the second proportion is determined to be the proportion of the colony area.
[0016] Optionally, after determining the current fungal contamination level based on the predicted number of unit colonies, the step further includes:
[0017] Determine the current interior wall material;
[0018] Based on the wall material, determine the first risk factor for the evolution of the corresponding colony count;
[0019] Determine the current indoor temperature;
[0020] Determine the relative humidity of the current indoor environment;
[0021] Based on the temperature and relative humidity, a second risk coefficient for the evolution of the corresponding colony count is determined;
[0022] Based on the first risk coefficient and the second risk coefficient, the evolution risk coefficient of the current fungal contamination is determined.
[0023] Optionally, the step of determining the unit colony count model includes:
[0024] Image recognition is performed based on the fungal image;
[0025] Based on the image recognition results, the fungal species were determined;
[0026] Based on the bacterial species, determine the type of the corresponding unit colony count model.
[0027] Optionally, before the step of determining the unit colony count model, the following steps are included:
[0028] Obtain samples labeled with the number of colonies per unit;
[0029] Based on the samples, the training dataset and the test dataset in the samples are determined;
[0030] Build the model to obtain the model to be trained;
[0031] The model to be trained is trained based on the training dataset to obtain the unit colony count model, until the test accuracy based on the test dataset reaches a preset test accuracy threshold.
[0032] Optionally, the step of determining the current fungal contamination level based on the predicted number of unit colonies includes:
[0033] Determine the range of colony counts corresponding to the preset fungal contamination level;
[0034] Based on the predicted number of colonies per unit and the range of colony counts within that range, the current fungal contamination level is determined.
[0035] Optionally, after the step of obtaining a sample labeled with the number of colonies per unit, the method further includes:
[0036] Remove a portion of the sample from the sample.
[0037] Furthermore, to achieve the above objectives, this application also provides a device for determining the level of indoor fungal contamination, the device comprising:
[0038] The acquisition module is used to acquire fungal images captured by a preset camera when a request for determining the level of indoor fungal contamination is received.
[0039] The first determining module is used to determine the unit colony count model, wherein the unit colony count model is different for different fungal species;
[0040] The first calculation module is used to perform grayscale processing on the fungal image to obtain a fungal grayscale image, and calculate the average grayscale value of all pixels in the fungal grayscale image to obtain the grayscale mean.
[0041] The second calculation module is used to perform binarization processing on the grayscale image of the fungus to obtain a binary image of the fungus, and to determine the proportion of the colony area based on the binary image of the fungus.
[0042] The processing module is used to input the mean gray level and the colony area ratio into the unit colony count model, and process the mean gray level and the colony area ratio based on the unit colony count model to obtain the predicted number of unit colonies of the fungus.
[0043] The second determining module determines the current fungal contamination level based on the predicted number of colonies per unit.
[0044] In addition, to achieve the above objectives, this application also provides an indoor fungal pollution level discrimination device, which is a physical node device. The indoor fungal pollution level discrimination device includes: a memory, a processor, and an indoor fungal pollution level discrimination program stored in the memory and executable on the processor. The processor executes the indoor fungal pollution level discrimination program to implement the steps of the indoor fungal pollution level discrimination method.
[0045] In addition, to achieve the above objectives, this application also provides a medium storing a program for implementing a method for determining the level of indoor fungal contamination, wherein when the program for determining the level of indoor fungal contamination is executed by a processor, it implements the steps of the method for determining the level of indoor fungal contamination described above.
[0046] This application provides a method, apparatus, equipment, and medium for determining the level of indoor fungal contamination. Compared with the prior art, where the accuracy of manually determining the level of indoor fungal contamination based on current area statistical standards is low, this application, upon receiving a request to determine the level of indoor fungal contamination, acquires a fungal image captured by a preset camera; determines a unit colony count model, wherein the unit colony count model differs depending on the fungal species; performs grayscale processing on the fungal image to obtain a fungal grayscale image, calculates the average grayscale value of all pixels in the fungal grayscale image to obtain the grayscale mean; performs binarization processing on the fungal grayscale image to obtain a fungal binary image, determines the colony area ratio based on the fungal binary image; inputs the grayscale mean and the colony area ratio into the unit colony count model, processes the grayscale mean and the colony area ratio based on the unit colony count model to obtain the predicted number of fungal colonies per unit; and determines the current fungal contamination level based on the predicted number of fungal colonies per unit. In this application, when a request to determine the level of indoor fungal contamination is received, the fungal image captured by the preset camera is processed, and two important parameters, grayscale mean and area ratio, are extracted from the image. Among them, a grayscale mean influence factor is added, and the grayscale mean reflects the sparseness of fungal growth, thus taking into account the growth characteristics of fungi. The current area statistics standard is updated (only pixels in the image that are actually covered with colonies participate in the area statistics). Based on the trained model, the number of colonies per unit is automatically inferred. The automatic inference process improves the low accuracy of manual subjective statistics, that is, it improves the determination accuracy of indoor fungal contamination level. Attached Figure Description
[0047] Figure 1 This is a schematic diagram of the process involved in the embodiments of this application;
[0048] Figure 2 This is a logical architecture diagram of the indoor fungal contamination level determination device according to an embodiment of this application;
[0049] Figure 3 This is a schematic diagram of Aspergillus niger involved in the embodiments of this application;
[0050] Figure 4 The image of Aspergillus niger captured by the preset camera involved in the embodiments of this application;
[0051] Figure 5 This is a grayscale image of the Aspergillus niger image involved in the embodiments of this application;
[0052] Figure 6 The image of Aspergillus whiteus taken by the preset camera involved in the embodiments of this application;
[0053] Figure 7This is a grayscale image of the Aspergillus white mold involved in the embodiments of this application;
[0054] Figure 8 This is a schematic diagram of the equipment structure of the hardware operating environment involved in the method for determining the level of indoor fungal contamination in this application embodiment.
[0055] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0056] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0057] Example 1
[0058] This application provides a method for determining the level of indoor fungal contamination. In the common embodiments of the method for determining the level of indoor fungal contamination in this application, refer to... Figure 1 A device for determining the level of indoor fungal contamination, wherein the method for determining the level of indoor fungal contamination includes:
[0059] Step S10: When a request to determine the level of indoor fungal contamination is received, acquire fungal images captured by a preset camera;
[0060] Step S20: Determine the unit colony count model, wherein the unit colony count model is different for different fungal species;
[0061] Step S30: Perform grayscale processing on the fungal image to obtain a fungal grayscale image, and calculate the average grayscale value of all pixels in the fungal grayscale image to obtain the grayscale mean.
[0062] Step S40: Binarize the grayscale image of the fungus to obtain a binary image of the fungus; and determine the proportion of the colony area based on the binary image of the fungus.
[0063] Step S50: Input the mean gray level and the colony area ratio into the unit colony count model, and process the mean gray level and the colony area ratio based on the unit colony count model to obtain the predicted number of unit colonies of the fungus.
[0064] Step S60: Determine the current fungal contamination level based on the predicted number of unit colonies.
[0065] As an example, the method for determining the level of indoor fungal contamination can be applied to a system for determining the level of indoor fungal contamination, which is subordinate to an equipment for determining the level of indoor fungal contamination.
[0066] As an example, the indoor fungal contamination level determination device includes an indoor fungal contamination level determination device, such as... Figure 2 As shown, the indoor fungal contamination level discrimination device includes an acquisition module, a first determination module, a first processing module, a second processing module, and a second determination module. The acquisition module acquires a fungal image captured by a preset camera when a discrimination request for an indoor fungal contamination level is received. The first determination module determines a unit colony count model, wherein the unit colony count model differs depending on the fungal species. The first calculation module performs grayscale processing on the fungal image to obtain a fungal grayscale image and calculates the average grayscale value of all pixels in the fungal grayscale image to obtain a grayscale mean. The second calculation module performs binarization processing on the fungal grayscale image to obtain a fungal binary image and determines the colony area ratio based on the fungal binary image. The processing module inputs the grayscale mean and the colony area ratio into the unit colony count model and processes the grayscale mean and the colony area ratio based on the unit colony count model to obtain the predicted number of fungal colonies per unit. The second determination module determines the current fungal contamination level based on the predicted number of fungal colonies per unit.
[0067] In this embodiment, the fungal image captured by the preset camera is an image of the vicinity of the fungal patch. As an example, the image of the area 1 cm away from the fungal patch captured by the preset camera is used as the fungal image.
[0068] In this embodiment, the unit colony count model is a trained model. Based on the unit colony count model, an approximate value of the unit colony count corresponding to the fungal image can be determined. That is, based on the fungal image, the unit colony count model can predict the corresponding unit colony count. The area encompassed by the outer edge of the colony is not directly related to the fungal's diffusion ability. A larger area does not necessarily mean a stronger diffusion ability. In particular, due to the different growth habits of each fungus, the hyphal patterns of different fungal species vary, and their diffusion abilities also differ. Specifically, it is possible that when the current fungal hyphae are underdeveloped, its diffusion ability is far superior to that of other fungal species when their hyphae are more developed. Therefore, the fungal species has a directional influence on the determination of the pollution level; that is, different fungal species correspond to different unit colony count models.
[0069] In this embodiment, when it is necessary to determine the current indoor fungal contamination level, an image of the indoor wall is captured by a preset camera. When the indoor fungal contamination level discrimination device receives a discrimination request for the indoor fungal contamination level, it acquires the fungal image captured by the preset camera and determines the unit colony count model. The unit colony count model is different for different fungal species. The fungal image is processed to obtain a fungal grayscale image. The mean grayscale value and the proportion of the colony area in the fungal grayscale image are input into the unit colony count model. Based on the unit colony count model, the mean grayscale value and the proportion of the colony area are processed to obtain the predicted number of fungal colonies per unit. Based on the predicted number of fungal colonies per unit, the current fungal contamination level is determined.
[0070] The specific steps are as follows:
[0071] Step S10: When a request to determine the level of indoor fungal contamination is received, acquire fungal images captured by a preset camera;
[0072] In this embodiment, when it is necessary to determine the current indoor fungal contamination level, an image of the indoor wall is captured by a preset camera. When the indoor fungal contamination level discrimination device receives a discrimination request for the indoor fungal contamination level, the fungal image captured by the preset camera is acquired.
[0073] As an example, when a request to determine the level of indoor fungal contamination is received, a fungal image captured by a preset camera is obtained, wherein the fungal image is an image of a 1 cm area near the fungal patch on the current indoor wall captured by the preset camera.
[0074] Step S20: Determine the unit colony count model, wherein the unit colony count model is different for different fungal species;
[0075] In this embodiment, fungi are eukaryotic, sporulating, chloroplast-free eukaryotic organisms. There are many types of fungi, including species such as Aspergillus niger, Aspergillus white, and Aspergillus flavus, etc., without any specific limitation.
[0076] In this embodiment, there can be multiple unit colony count models. The type of unit colony count model is related to the specific fungal species. Since different fungal species have different growth habits, if the same unit colony count model is used for different fungal species, the differences between fungal species will be ignored, and the determination of fungal contamination level will be inaccurate. That is, different unit colony count models for different fungal species should be distinguished.
[0077] Before the step of determining the unit colony count model in step S20, the following steps are included:
[0078] Step A1: Obtain samples labeled with the number of colonies per unit;
[0079] In this embodiment, the growth environment of different fungal species is simulated. When different fungal patches appear, images of the fungi are captured near each patch. The shooting position, distance, angle, and area size remain constant for each shot. The user processes the captured fungal sample images to obtain a grayscale image of the fungal sample. Each pixel in the grayscale image has two grayscale values. Based on the grayscale image, the mean grayscale value of each pixel in the image is determined. The sample area percentage of the fungal colonies in the image is also determined based on the grayscale image. Therefore, each fungal sample image corresponds to a mean grayscale value and a sample area percentage.
[0080] After the image is taken, the user samples fungi at the current shooting location using a sampling stick. The sampled fungi are then placed in an incubator for cultivation. When the cultivation time reaches a preset time threshold, the user counts the number of fungal colonies. The time threshold is the same for each type of fungus. Each fungal sample image corresponds to a unit colony count label.
[0081] That is, each fungal sample image corresponds to a sample grayscale mean and a sample area ratio, and each fungal sample image has a unit colony count label. Based on this, samples with unit colony count labels of different fungal species are identified.
[0082] As an example, samples with unit colony count labels corresponding to Aspergillus niger are obtained, where there are 1000 Aspergillus niger samples.
[0083] As an example, samples with unit colony count labels corresponding to Aspergillus white are obtained, where the number of Aspergillus white samples is also 1000.
[0084] Step A2: Based on the samples, determine the training dataset and the test dataset in the samples;
[0085] In this embodiment, the samples are divided into training datasets and test datasets.
[0086] As an example, 70% of the 1000 Aspergillus niger samples are used as the training dataset, and the remaining 30% are used as the test dataset, that is, 700 training samples and 300 test samples.
[0087] Step A3: Build the model to obtain the model to be trained;
[0088] In this embodiment, before obtaining the unit colony count model, a model is first built to obtain the training model, which is only the initial model.
[0089] As an example, let's build a multiple linear regression model. A multiple linear regression model refers to a mathematical model built upon the premise that the same dependent variable is influenced by multiple independent variables. One of the most common forms is as follows:
[0090] y = a0 + a1x1 + a2x2 + ... + a k x k +e
[0091] Where a0 is the constant term, a1 to ak are the regression coefficients, x1 to xk are the independent variables, y is the dependent variable, and e is the error term.
[0092] In this embodiment, there is a linear relationship between the area ratio of colonies in the grayscale image of fungal samples, the mean grayscale value in the grayscale image of fungal samples, and the number of colonies per unit. A multiple linear regression model (the model to be trained) is constructed based on the area ratio, the mean grayscale value, and the number of colonies per unit.
[0093] As an example, this embodiment has three variables: area ratio, grayscale mean, and number of colonies per unit. The model to be trained is y = a0 + a1x1 + a2x2, where the dependent variable y is the area ratio, the independent variable x1 is the number of colonies per unit, and the independent variable x2 is the grayscale mean.
[0094] Step A4: Train the model to be trained based on the training dataset to obtain the unit colony count model until the test accuracy based on the test dataset reaches the preset test accuracy threshold.
[0095] In this embodiment, the model to be trained is trained based on the training dataset to obtain the unit colony count model until the test accuracy based on the test dataset reaches a preset test accuracy threshold.
[0096] As an example, the training model y = a0 + a1x1 + a2x2 is trained based on 700 training datasets of Aspergillus niger to obtain the colony count model of Aspergillus niger. This process continues until the test accuracy based on 300 test datasets reaches a preset test accuracy threshold. As another example, the trained model yields the colony count model of Aspergillus niger as: y1 = 0.936 + 0.135x1 - 0.941x2, where the dependent variable y1 is the area ratio of Aspergillus niger colonies, the independent variable x1 is the number of colonies per unit of Aspergillus niger, and the independent variable x2 is the mean gray value of the Aspergillus niger grayscale image.
[0097] In this embodiment, because the fungal patterns of each species are different, such as Figure 3 The image is a pattern of Aspergillus niger. Based on fungal images captured by a preset camera, an artificial neural network algorithm is used to identify the species of the current fungus. Based on the identified species, the type of the corresponding unit colony count model is determined.
[0098] Step S20, the step of determining the unit colony count model, includes:
[0099] Step B1: Perform image recognition based on the fungal image;
[0100] Step B2: Based on the image recognition results, determine the species of the fungus;
[0101] Step B3: Based on the bacterial species, determine the type of the corresponding unit colony count model.
[0102] In this embodiment, the species of the current fungus is determined based on the image recognition results of the artificial neural network algorithm.
[0103] In this embodiment, the fungal species are identified based on the image, and the type of unit colony count model corresponding to the current species is determined.
[0104] As an example, if the current species is identified as Aspergillus niger, then the model for the number of colonies per unit of Aspergillus niger is determined as y1 = 0.936 + 0.135x1 - 0.941x2.
[0105] Step S30: Perform grayscale processing on the fungal image to obtain a fungal grayscale image, and calculate the average grayscale value of all pixels in the fungal grayscale image to obtain the grayscale mean.
[0106] In this embodiment, the grayscale mean is the average grayscale value of all pixels in the current fungal grayscale image. The grayscale mean reflects the growth status of the fungus. Specifically, if the color of the fungus is black, the color of a colony with denser hyphae is darker than that of a colony with sparser hyphae. Even if the area included by the outer edge of the two colonies is the same, the difference in the sparseness of the hyphae will cause the grayscale mean of the former to be lower than that of the latter.
[0107] In this embodiment, the captured fungal image is processed to grayscale. Specifically, the three channels (R channel, G channel, B channel) of the original fungal image are first converted to a single channel to improve the contrast between the subject and the background, thus obtaining a fungal grayscale image. Each pixel in the image has a corresponding grayscale value. The average grayscale value of all pixels in the fungal grayscale image is calculated to obtain the grayscale mean.
[0108] As an example, the gray value corresponding to each pixel in the fungal image is calculated, where the gray value formula is: Gray = R*0.299 + G*0.587 + B*0.114, where R, G, and B are the brightness of their respective channels, and Gray is the gray value of the pixel. The average gray value of all pixels in the fungal grayscale image is calculated to obtain the gray average.
[0109] As an example, such as Figure 4 As shown, Figure 4 Images of Aspergillus niger taken by a preset camera, such as Figure 5 As shown, Figure 5 The image after grayscale processing of the Aspergillus niger image removes the background outside the Aspergillus niger. Then, based on the grayscale image of Aspergillus niger, the mean grayscale value of Aspergillus niger for all pixels is determined.
[0110] As an example, such as Figure 6 As shown, Figure 6 Images of Aspergillus white mold taken by a preset camera, such as Figure 7 As shown, Figure 7 The image after grayscale processing of the Aspergillus white mold image is obtained by removing the background outside the Aspergillus white mold after grayscale processing. Then, the average grayscale value of Aspergillus white mold in all pixels is determined based on the grayscale image of Aspergillus white mold.
[0111] Step S40: Binarize the grayscale image of the fungus to obtain a binary image of the fungus; and determine the proportion of the colony area based on the binary image of the fungus.
[0112] In this embodiment, the grayscale image of the fungus is binarized to obtain a binary image of the fungus, and the proportion of the colony area is determined based on the binary image of the fungus.
[0113] Step S40, binarizing the grayscale image of the fungus to obtain a binary image of the fungus, and determining the proportion of colony area based on the binary image of the fungus, includes:
[0114] Step C1: Perform Canny edge detection on the grayscale image of the fungus. Based on a preset grayscale threshold, perform threshold segmentation on the grayscale image of the fungus after edge detection to obtain the binary image of the fungus. The grayscale values of all pixels in the binary image of the fungus include a first grayscale value and a second grayscale value.
[0115] In this embodiment, Canny edge detection is performed on the grayscale image of the fungus to determine the edges of the fungal image.
[0116] As an example, a Gaussian filter is first used to process the grayscale fungal image to remove noise points. Then, non-maximum suppression (NMS) is used to eliminate spurious effects. Next, the true edges and potential edges of the image are determined. Finally, isolated weak edges are suppressed to complete edge detection.
[0117] As an example, a preset grayscale threshold of 100 is used to perform threshold segmentation on the fungal image after edge detection. Pixels with a grayscale value greater than 100 are set to a grayscale value of 255, and pixels with a grayscale value less than or equal to 100 are set to a grayscale value of 0. Based on the preset grayscale threshold of 100, threshold segmentation is performed on the grayscale image of the fungus after edge detection to obtain a binary image of the fungus. The grayscale values of all pixels in the binary image of the fungus include a first grayscale value of 255 and a second grayscale value of 0.
[0118] Step C2: After erosion operation on the binary image of the fungus, dilation operation is performed, and the area ratio of the first gray value pixel in the binary image of the fungus after dilation operation is calculated to obtain the first ratio;
[0119] As an example, an opening operation is applied to a binary image of fungi, first performing an erosion operation and then a dilation operation to eliminate irregular edges.
[0120] Since all pixels in the binary image of a fungus have two grayscale values, including a first grayscale value of 255 and a second grayscale value of 0, after the dilation operation, the area ratio of pixels with the first grayscale value of 255 in the binary image of the fungus is calculated to obtain the first ratio.
[0121] Step C3: Calculate the area ratio of the pixels with the second gray value in the binary image of the fungus after the dilation operation to obtain the second ratio;
[0122] In this embodiment, after the dilation operation, the area ratio of the pixels with the second gray value of 0 in the binary image of fungus is calculated to obtain the second ratio. Since all pixels in the binary image of fungus have only two gray values, including the first gray value and the second gray value, the difference between 1 and the first ratio is the second ratio.
[0123] Step C4: Based on the bacterial species, determine the first proportion as the proportion of the colony area, or determine the second proportion as the proportion of the colony area.
[0124] In this embodiment, the colony area ratio is the ratio of the sum of the areas of pixels covered by colonies in the binary image of fungi to the total area of all pixels in the current binary image of fungi.
[0125] In this embodiment, different fungal species produce different colony colors. For example, the color of *Aspergillus niger* is darker than that of *Aspergillus white*. Therefore, in the binary image of *Aspergillus white*, the area ratio (first ratio) of pixels with a first gray-level mean of 255 in the fungal binary image is the colony area ratio of *Aspergillus white*. In the binary image of *Aspergillus niger*, the area ratio (second ratio) of pixels with a second gray-level mean of 0 in the fungal binary image is the colony area ratio of *Aspergillus white*.
[0126] Step S50: Input the mean gray level and the colony area ratio into the unit colony count model, and process the mean gray level and the colony area ratio based on the unit colony count model to obtain the predicted number of unit colonies of the fungus.
[0127] As an example, if the current fungus is Aspergillus niger, the mean gray value of Aspergillus niger and the proportion of Aspergillus niger colony area are input into the Aspergillus niger unit colony count model. Based on the Aspergillus niger unit colony count model, the mean gray value of Aspergillus niger and the proportion of Aspergillus niger colony area are processed to obtain the predicted number of Aspergillus niger unit colonies.
[0128] Step S60: Determine the current fungal contamination level based on the predicted number of unit colonies.
[0129] In this embodiment, the current fungal contamination level is determined based on the predicted number of colonies per unit, wherein the current fungal contamination level is related to the predicted number of colonies per unit.
[0130] Step S60: Determine the current fungal contamination level based on the predicted number of colonies per unit. This step of determining the current fungal contamination level based on the predicted number of colonies per unit includes:
[0131] Step S61: Determine the range of colony counts corresponding to the preset fungal contamination level;
[0132] Step S62: Based on the predicted number of colonies per unit and the range of colony counts within that range, determine the current fungal contamination level.
[0133] As an example, if the predicted number of colonies per unit is less than 2, the current fungal contamination level is determined to be level 0; if the predicted number of colonies per unit is between 2 and 5, the current fungal contamination level is determined to be level 1; if the predicted number of colonies per unit is between 5 and 10, the current fungal contamination level is determined to be level 2; and if the predicted number of colonies per unit is between 10 and 15, the current fungal contamination level is determined to be level 3.
[0134] This application provides a method, apparatus, equipment, and medium for determining the level of indoor fungal contamination. Compared with the prior art, where the accuracy of manually determining the level of indoor fungal contamination based on current area statistical standards is low, this application, upon receiving a request to determine the level of indoor fungal contamination, acquires a fungal image captured by a preset camera; determines a unit colony count model, wherein the unit colony count model differs depending on the fungal species; performs grayscale processing on the fungal image to obtain a fungal grayscale image, calculates the average grayscale value of all pixels in the fungal grayscale image to obtain the grayscale mean; performs binarization processing on the fungal grayscale image to obtain a fungal binary image, determines the colony area ratio based on the fungal binary image; inputs the grayscale mean and the colony area ratio into the unit colony count model, processes the grayscale mean and the colony area ratio based on the unit colony count model to obtain the predicted number of fungal colonies per unit; and determines the current fungal contamination level based on the predicted number of fungal colonies per unit. In this application, when a request to determine the level of indoor fungal contamination is received, the fungal image captured by the preset camera is processed, and two important parameters, grayscale mean and area ratio, are extracted from the image. Among them, a grayscale mean influence factor is added, and the grayscale mean reflects the sparseness of fungal growth, thus taking into account the growth characteristics of fungi. The current area statistics standard is updated (only pixels in the image that are actually covered with colonies participate in the area statistics). Based on the trained model, the number of colonies per unit is automatically inferred. The automatic inference process improves the low accuracy of manual subjective statistics, that is, it improves the determination accuracy of indoor fungal contamination level.
[0135] Example 2
[0136] Furthermore, based on Embodiment 1 of this application, another embodiment of this application is provided. In this embodiment, after step S60, which determines the current fungal contamination level based on the predicted number of unit colonies, the method further includes:
[0137] Step E1: Determine the current interior wall material;
[0138] Step E2: Based on the wall material, determine the first risk factor for the evolution of the corresponding colony count;
[0139] Step E3: Determine the current indoor temperature;
[0140] Step E4: Determine the relative humidity of the current indoor environment;
[0141] Step E5: Based on the temperature and relative humidity, determine the second risk coefficient for the evolution of the corresponding colony count;
[0142] Step E6: Based on the first risk coefficient and the second risk coefficient, determine the evolution risk coefficient of the current fungal contamination.
[0143] In this embodiment, the environmental factors affecting fungal growth include the current indoor wall material, the current indoor temperature, and the current indoor relative humidity. A warm and humid environment is suitable for fungal growth. As an example, the suitable temperature for fungal growth is 25-28 degrees Celsius, and the suitable relative humidity for fungal growth is above 65%.
[0144] As an example, wall materials include plaster, latex paint, and pure paper wallpaper, etc., without specific limitations.
[0145] As an example, the indoor temperature can be 25 degrees Celsius or 15 degrees Celsius; no specific limit is made here.
[0146] As an example, the relative humidity of the indoor environment can be 50% or 70%, without specific limitations.
[0147] In this embodiment, the current indoor wall material is determined, and based on the current indoor wall material, a first risk coefficient for the evolution of the corresponding colony count is determined. The current indoor temperature and the current indoor relative humidity are determined, and based on the temperature and the relative humidity, a second risk coefficient for the evolution of the corresponding colony count is determined. Based on the first risk coefficient and the second risk coefficient, the evolution risk coefficient of the current fungal contamination is determined.
[0148] As an example, if the current interior wall material is latex paint, the first risk coefficient for the evolution of colony count corresponding to latex paint is 0.2, the current indoor temperature is 25 degrees Celsius, and the current indoor relative humidity is 70%, then the second risk coefficient for the evolution of colony count corresponding to the current temperature and relative humidity is 0.7. Based on the first risk coefficient of 0.2 and the second risk coefficient of 0.7, the current risk coefficient for the evolution of fungal contamination is determined to be 0.9 (the sum of the two). Since 0.9 is higher than the health risk coefficient of 0.5 for human habitation, based on the current risk coefficient for the evolution of fungal contamination of 0.9, the current indoor environment is determined to be unsuitable for habitation.
[0149] In this embodiment, a step of determining the evolution risk coefficient of the current fungal contamination is added after the step of determining the current fungal contamination level. This adds a dynamic indicator of the evolution risk coefficient to the original static indicator of the current fungal contamination level. The combination of static and dynamic indicators in evaluating the current indoor environment makes the evaluation results more accurate, thus further improving the accuracy of determining the indoor fungal contamination level.
[0150] Example 3
[0151] Furthermore, based on Embodiments 1 and 2 of this application, another embodiment of this application is provided. In this embodiment, step A1: obtaining a sample with a unit colony count label; after the step of obtaining a sample with a unit colony count label, the following is included:
[0152] Remove a portion of the sample from the sample.
[0153] In this embodiment, some samples are removed from the sample. Specifically, blank fungal sample images are removed from the sample, and the remaining non-blank fungal sample images are retained, because blank areas may be collected during sampling.
[0154] In this embodiment, by removing some samples, the remaining samples with unit colony count labels are made more consistent with the actual situation. The unit colony count model trained based on more realistic samples has better performance, which further improves the discrimination accuracy when judging the level of indoor fungal contamination.
[0155] Example 4
[0156] Furthermore, based on all the above embodiments, another embodiment of this application is provided, in which an indoor fungal contamination level discrimination device is provided, the device comprising:
[0157] The acquisition module is used to acquire fungal images captured by a preset camera when a request for determining the level of indoor fungal contamination is received.
[0158] The first determining module is used to determine the unit colony count model, wherein the unit colony count model is different for different fungal species;
[0159] The first calculation module is used to perform grayscale processing on the fungal image to obtain a fungal grayscale image, and calculate the average grayscale value of all pixels in the fungal grayscale image to obtain the grayscale mean.
[0160] The second calculation module is used to perform binarization processing on the grayscale image of the fungus to obtain a binary image of the fungus, and to determine the proportion of the colony area based on the binary image of the fungus.
[0161] The processing module is used to input the mean gray level and the colony area ratio into the unit colony count model, and process the mean gray level and the colony area ratio based on the unit colony count model to obtain the predicted number of unit colonies of the fungus.
[0162] The second determining module determines the current fungal contamination level based on the predicted number of colonies per unit.
[0163] Optionally, in one possible embodiment of this application, the device for the step of binarizing the fungal grayscale image to obtain a fungal binary image, and determining the colony area ratio based on the fungal binary image, includes:
[0164] The threshold segmentation module is used to perform Canny edge detection on the grayscale image of the fungus. Based on a preset grayscale threshold, the grayscale image of the fungus after edge detection is segmented to obtain the binary image of the fungus. The grayscale values of all pixels in the binary image of the fungus include a first grayscale value and a second grayscale value.
[0165] The third calculation module is used to perform an erosion operation on the binary image of the fungus, and then perform a dilation operation to calculate the area ratio of the pixels with the first gray value in the binary image of the fungus after the dilation operation, so as to obtain the first ratio.
[0166] The fourth calculation module is used to calculate the area ratio of the pixels with the second gray value in the binary image of the fungus after the dilation operation, and obtain the second ratio;
[0167] Based on the bacterial species, the first proportion is determined to be the proportion of the colony area, or the second proportion is determined to be the proportion of the colony area.
[0168] Optionally, in one possible embodiment of this application, after the step of determining the current fungal contamination level based on the predicted number of unit colonies, the device includes:
[0169] The third module is used to determine the current interior wall material;
[0170] The fourth determining module is used to determine the first risk coefficient of the corresponding colony number evolution based on the wall material;
[0171] The fifth module is used to determine the current indoor temperature.
[0172] The sixth module is used to determine the relative humidity of the current indoor environment;
[0173] The seventh determining module is used to determine a second risk coefficient for the evolution of the corresponding colony count based on the temperature and the relative humidity;
[0174] The eighth determining module is used to determine the evolution risk coefficient of the current fungal contamination based on the first risk coefficient and the second risk coefficient.
[0175] Optionally, in one possible embodiment of this application, the apparatus for determining the unit colony count model includes:
[0176] The identification module is used to perform image recognition based on the fungal image;
[0177] The ninth determining module is used to determine the species of fungus based on the results of image recognition;
[0178] The tenth determining module is used to determine the type of the corresponding unit colony count model based on the bacterial species.
[0179] Optionally, in one possible embodiment of this application, prior to the step of determining the unit colony count model, the apparatus includes:
[0180] The first acquisition module is used to acquire samples labeled with the number of colonies per unit;
[0181] The eleventh determining module is used to determine the training dataset and the test dataset in the samples based on the samples;
[0182] The building module is used to build the model to obtain the model to be trained.
[0183] The training module is used to train the model to be trained based on the training dataset to obtain the unit colony count model until the test accuracy based on the test dataset reaches a preset test accuracy threshold.
[0184] Optionally, in one possible embodiment of this application, the device for determining the current fungal contamination level based on the predicted number of unit colonies includes:
[0185] The twelfth determination module is used to determine the range of colony counts corresponding to the preset fungal contamination level;
[0186] The thirteenth determination module is used to determine the current fungal contamination level based on the predicted number of unit colonies and the range of colony counts they fall within.
[0187] Optionally, in one possible embodiment of this application, after the step of obtaining a sample labeled with a unit colony count, the apparatus includes:
[0188] The removal module is used to remove a portion of the sample.
[0189] The specific implementation method of the indoor fungal pollution level discrimination device of this application is basically the same as the embodiments of the above-mentioned indoor fungal pollution level discrimination method, and will not be repeated here.
[0190] Example 5
[0191] Furthermore, based on all the above embodiments, another embodiment of this application is provided. In this embodiment, an indoor fungal pollution level discrimination device is provided. The indoor fungal pollution level discrimination device is a physical node device. The indoor fungal pollution level discrimination device includes: a memory, a processor, and a program stored in the memory for implementing the indoor fungal pollution level discrimination method. The memory is used to store the program for implementing the indoor fungal pollution level discrimination method; the processor is used to execute the program for implementing the indoor fungal pollution level discrimination method to implement the steps of the indoor fungal pollution level discrimination method in the above embodiments.
[0192] Reference Figure 8 , Figure 8 This is a schematic diagram of the device structure of the hardware operating environment involved in the embodiments of this application.
[0193] like Figure 8 As shown, the device for determining the level of indoor fungal contamination may include: a processor 1001, such as a CPU, a memory 1005, and a communication bus 1002. The communication bus 1002 is used to establish communication between the processor 1001 and the memory 1005. The memory 1005 may be a high-speed RAM or a stable, non-volatile memory, such as a disk drive. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0194] Optionally, the device for determining the level of indoor fungal contamination may also include a network interface, audio circuit, display, connecting cable, sensor, input module, etc. The network interface may include a standard wired interface or a wireless interface (such as a Wi-Fi interface or a Bluetooth interface). The input module may include a keyboard, a system soft keyboard, voice input, wireless receiver input, etc.
[0195] Those skilled in the art will understand that the structure of the device for determining the level of indoor fungal contamination does not constitute a limitation on the device for determining the level of indoor fungal contamination, and may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0196] The memory, as a computer medium, may include an operating system, an information exchange module, and a program for determining the level of indoor fungal contamination. The operating system is a program that manages and controls the hardware and software resources of the indoor fungal contamination level determination device, supporting the operation of the determination program and other software and / or programs. The information exchange module is used to enable communication between the various components within the memory, as well as communication with other hardware and software in the indoor fungal contamination level determination system.
[0197] In the indoor fungal pollution level determination device, the processor is used to execute the indoor fungal pollution level determination program stored in the memory to realize the above-mentioned steps of determining the indoor fungal pollution level.
[0198] The specific implementation method of the indoor fungal pollution level discrimination device of this application is basically the same as the above-mentioned indoor fungal pollution level discrimination method embodiments, and will not be repeated here.
[0199] Example 6
[0200] This application provides a medium that stores one or more programs, which can be executed by one or more processors to implement the steps of the method for determining the level of indoor fungal contamination in the above embodiments.
[0201] The specific implementation method of the medium in this application is basically the same as the embodiments of the above-mentioned method for determining the level of indoor fungal contamination, and will not be repeated here.
[0202] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0203] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0204] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM or RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0205] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A method for determining the level of indoor fungal contamination, characterized in that, The methods for determining the level of indoor fungal contamination include: When a request to determine the level of indoor fungal contamination is received, fungal images captured by a preset camera are obtained; A unit colony count model is determined, wherein the unit colony count model is different for different fungal species; The fungal image is converted to grayscale to obtain a fungal grayscale image. The average grayscale value of all pixels in the fungal grayscale image is calculated to obtain the grayscale mean. The grayscale image of the fungus is binarized to obtain a binary image of the fungus. Based on the binary image of the fungus, the proportion of the colony area is determined. The mean gray level and the colony area ratio are input into the unit colony count model. Based on the unit colony count model, the mean gray level and the colony area ratio are processed to obtain the predicted number of unit colonies corresponding to fungi in the fungal image. Based on the predicted number of colonies per unit, the current fungal contamination level is determined; the current indoor wall material is determined; based on the wall material, a first risk coefficient for the evolution of the corresponding colony count is determined; the current indoor temperature is determined; the current indoor relative humidity is determined; based on the temperature and the relative humidity, a second risk coefficient for the evolution of the corresponding colony count is determined; based on the first risk coefficient and the second risk coefficient, the evolution risk coefficient for the current fungal contamination is determined.
2. The method for determining the level of indoor fungal contamination according to claim 1, characterized in that, The step of binarizing the grayscale image of the fungus to obtain a binary image of the fungus, and determining the proportion of colony area based on the binary image of the fungus, includes: Canny edge detection is performed on the grayscale image of the fungus. Based on a preset grayscale threshold, threshold segmentation is performed on the grayscale image of the fungus after edge detection to obtain the binary image of the fungus. The grayscale values of all pixels in the binary image of the fungus include a first grayscale value and a second grayscale value. After performing an erosion operation on the binary image of the fungus, a dilation operation is then performed. The area ratio of the pixels with the first gray value in the binary image of the fungus after the dilation operation is calculated to obtain the first ratio. Calculate the area ratio of the pixels with the second gray value in the binary image of the fungus after the dilation operation to obtain the second ratio; Based on the bacterial species, the first proportion is determined to be the proportion of the colony area, or the second proportion is determined to be the proportion of the colony area.
3. The method for determining the level of indoor fungal contamination according to claim 1, characterized in that, The steps for determining the unit colony count model include: Image recognition is performed based on the fungal image; Based on the image recognition results, the fungal species were determined; Based on the bacterial species, determine the type of the corresponding unit colony count model.
4. The method for determining the level of indoor fungal contamination according to claim 1, characterized in that, Before the step of determining the unit colony count model, the following steps are included: Obtain samples labeled with the number of colonies per unit; Based on the samples, the training dataset and the test dataset in the samples are determined; Build the model to obtain the model to be trained; The model to be trained is trained based on the training dataset to obtain the unit colony count model, until the test accuracy based on the test dataset reaches a preset test accuracy threshold.
5. The method for determining the level of indoor fungal contamination according to claim 1, characterized in that, The step of determining the current fungal contamination level based on the predicted number of unit colonies includes: Determine the range of colony counts corresponding to the preset fungal contamination level; Based on the predicted number of colonies per unit and the range of colony counts within that range, the current fungal contamination level is determined.
6. The method for determining the level of indoor fungal contamination according to claim 4, characterized in that, After the step of obtaining samples labeled with unit colony count, the following steps are included: Remove a portion of the sample from the sample.
7. A device for determining the level of indoor fungal contamination, characterized in that, The device for determining the level of indoor fungal contamination includes: The acquisition module is used to acquire fungal images captured by a preset camera when a request for determining the level of indoor fungal contamination is received. The first determining module is used to determine the unit colony count model, wherein the unit colony count model is different for different fungal species; The first calculation module is used to perform grayscale processing on the fungal image to obtain a fungal grayscale image, and calculate the average grayscale value of all pixels in the fungal grayscale image to obtain the grayscale mean. The second calculation module is used to perform binarization processing on the grayscale image of the fungus to obtain a binary image of the fungus, and to determine the proportion of the colony area based on the binary image of the fungus. The processing module is used to input the mean gray level and the colony area ratio into the unit colony count model, and process the mean gray level and the colony area ratio based on the unit colony count model to obtain the predicted number of unit colonies corresponding to fungi in the fungal image. The second determining module determines the current fungal contamination level based on the predicted number of colonies per unit; determines the current indoor wall material; determines a first risk coefficient for the evolution of the corresponding colony count based on the wall material; determines the current indoor temperature; determines the current indoor relative humidity; determines a second risk coefficient for the evolution of the corresponding colony count based on the temperature and relative humidity; and determines the evolution risk coefficient of the current fungal contamination based on the first risk coefficient and the second risk coefficient.
8. A device for determining the level of indoor fungal contamination, characterized in that, The method includes a memory, a processor, and an indoor fungal contamination level discrimination program stored in the memory and executable on the processor. The processor executes the indoor fungal contamination level discrimination program to implement the steps of the indoor fungal contamination level discrimination method according to any one of claims 1 to 6.
9. A medium, characterized in that, The medium stores a program for implementing a method for determining the level of indoor fungal contamination, and the program for implementing the method for determining the level of indoor fungal contamination is executed by a processor to implement the steps of the method for determining the level of indoor fungal contamination as described in any one of claims 1 to 6.