A method for phytoplankton volume detection based on spectral imaging
Through a method based on spectral imaging and a random forest algorithm to construct a prediction model, the problem of low volume detection accuracy of phytoplankton in the existing technology is solved, and higher accuracy and wider applicable phytoplankton volume detection is achieved.
Patent Information
- Application Number
- CN202510039679.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-10
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2045-01-10
AI Technical Summary
In the prior art, the volume detection of phytoplankton depends on geometric models, with low accuracy and cannot adapt to phytoplankton with complex structures.
Using a spectral imaging-based method, a transmittance spectral image of phytoplankton is collected through a microscopic hyperspectral imager, and a prediction model is constructed in combination with a random forest algorithm to predict the thickness of each pixel point, thereby calculating the volume of phytoplankton.
It improves the accuracy of phytoplankton volume detection, is suitable for a wider range of phytoplankton shapes, and shortens measurement time.
Smart Images

Figure CN119444835B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of plankton biomass detection, and in particular to a phytoplankton volume detection method based on spectral imaging. Background Art
[0002] As people pay more and more attention to environmental protection, ecological environment monitoring has gradually become an important technical development direction. Phytoplankton plays an important role in aquatic ecosystems, especially in carbon cycle and oxygen production. Understanding the biomass of phytoplankton is crucial to assessing water quality, monitoring ecological health, and formulating environmental protection policies. Phytoplankton biomass is an important indicator parameter for water quality assessment and ecological environment health indication. It can better reflect changes in the ecological environment, provide evaluation indicators for ecological restoration, and evaluate the effectiveness of governance measures.
[0003] Existing methods mainly use geometric estimation methods, that is, treating phytoplankton as simple geometric bodies and their combinations, measuring the main dimensions of the key structures of phytoplankton, and applying corresponding geometric formulas to estimate their volumes. Some more advanced methods use artificial intelligence algorithms to automatically measure the main dimensions, but they are still based on traditional geometric models, with low accuracy and large deviations for phytoplankton with complex structures. Summary of the invention
[0004] In view of the shortcomings of the prior art, the present invention proposes a phytoplankton volume detection method based on spectral imaging to solve the problem that the traditional geometric model has low accuracy and cannot adapt to the volume detection of phytoplankton with more complex structures.
[0005] The specific technical solutions are as follows:
[0006] A method for detecting phytoplankton volume based on spectral imaging comprises the following steps:
[0007] S1: Select multiple spherical phytoplankton and collect the transmittance spectral image and spectral image pseudo-color image of the spherical phytoplankton through a microscopic hyperspectral imager;
[0008] S2: Use a perfect circle to mark the phytoplankton in the pseudo-color image of the spectral image as the target range;
[0009] S3: Calculate the thickness of each pixel point in the target range according to the radius of the target range. The thickness of each pixel point is the length of the chord passing through the point and perpendicular to the line connecting the point and the center of the target range.
[0010] S4: construct a training data set, including: thickness data and transmittance of each pixel point in each target range, and thickness data and transmittance of randomly acquired background pixel points; background pixel points are pixel points outside the target range, and their thickness is 0;
[0011] S5: Use the training data set to train the prediction model based on the random forest algorithm to obtain the relationship between pixel transmittance and thickness;
[0012] S6: Obtain a transmittance spectrum image of the phytoplankton in the volume to be measured, input it into the trained prediction model, and obtain the thickness prediction result of each pixel point;
[0013] S7: Determine the actual area of a single pixel according to the image resolution and the actual size of the image, and obtain the volume of the phytoplankton to be measured in combination with the thickness prediction result.
[0014] Furthermore, in S1, the microscopic hyperspectral imager obtains the transmittance spectrum image in the following specific operations:
[0015] (1.1) Perform black and white calibration on the microscopic hyperspectral imager, that is, obtain the light intensity I measured when the light source is turned on and there is no obstruction max , and the original light intensity I when there is no light source min ;
[0016] (1.2) The spherical phytoplankton sample is placed on a microscopic hyperspectral imager to collect the original spectral image. The information contained in the original spectral image is the light intensity information I;
[0017] (1.3) The light intensity information is converted into transmittance to obtain the transmittance spectrum image. The conversion expression is as follows:
[0018] ;
[0019] Where T represents the transmittance.
[0020] Furthermore, the number of background pixels accounts for 20% of the number of all pixels.
[0021] Furthermore, in S5, when the prediction model is trained, cross-validation is performed to determine whether the cross-validation accuracy reaches the set threshold. If so, the trained prediction model is output and S6 is executed; if not, it is further confirmed whether the target range is marked accurately; if not, it returns to S2 and re-marks the target range; if accurate, it returns to S1 and continues to collect images of spherical phytoplankton to increase the amount of data in the training data set.
[0022] Furthermore, in S7, the actual area calculation expression of a single pixel is as follows:
[0023] ;
[0024] In the formula, A represents the actual area of a single pixel, L real Indicates the actual length, n pixelIndicates the number of pixels corresponding to this length.
[0025] Furthermore, the actual length is obtained according to the actual size of the field of view in the imaging device parameters, or is obtained by photographing a micrometer.
[0026] Further, in S7, the volume calculation expression of the phytoplankton to be measured is as follows:
[0027] ;
[0028] In the formula, V represents the volume of phytoplankton to be measured, h i It represents the thickness of any pixel in the region estimated by the prediction model, and n represents the total number of pixels in the region.
[0029] Furthermore, in S3, the thickness expression of each pixel point is as follows:
[0030] ;
[0031] In the formula, r represents the radius of a target range, x represents the distance from any pixel point in the target range to its center, and h represents the thickness of the pixel point.
[0032] The beneficial effects of the present invention are:
[0033] The present invention can predict the volume of phytoplankton within the image range through a single spectral image and display the distribution of thickness. The shape of phytoplankton can be irregular, which is suitable for a wider range of phytoplankton and improves the prediction accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 It is a flow chart of a phytoplankton volume detection method based on spectral imaging in an embodiment of the present invention.
[0035] Figure 2 Schematic diagram of using a perfect circle to mark phytoplankton in a pseudo-color image of a spectral image in an embodiment of the present invention.
[0036] Figure 3 It is a predicted thickness distribution diagram of the phytoplankton of the volume to be measured in the embodiment of the present invention. DETAILED DESCRIPTION
[0037] The present invention will be described in detail below according to the accompanying drawings and preferred embodiments, and the purpose and effect of the present invention will become more clear. The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0038] like Figure 1As shown, a phytoplankton volume detection method based on spectral imaging comprises the following steps:
[0039] S1: Select multiple spherical phytoplankton and collect the transmittance spectral images and spectral image pseudo-color images of the spherical phytoplankton through a microscopic hyperspectral imager.
[0040] The specific method of obtaining the transmittance spectrum image by the microscopic hyperspectral imager is as follows:
[0041] (1.1) Perform black and white calibration on the microscopic hyperspectral imager, that is, obtain the light intensity I measured when the light source is turned on and there is no obstruction max , and the original light intensity I when there is no light source min .
[0042] (1.2) Placing a spherical phytoplankton sample: Take a spherical phytoplankton sample (in this example, Chlorella vulgaris) and add it to a culture dish, and place it on the stage. Adjust the coarse and fine focusing knobs of the microscopic hyperspectral imager and move the stage until a clear image can be observed.
[0043] Set the platform moving speed, start capturing images, stop moving after acquisition is complete, and check the image capture effect to ensure that the captured image is clear and complete. The original spectral image obtained contains the light intensity information I.
[0044] (1.3) The light intensity information is converted into transmittance to obtain the transmittance spectrum image, which is expressed as follows:
[0045] ;
[0046] Where T represents the transmittance.
[0047] S2: Use perfect circles to mark the phytoplankton in the pseudo-color image of the spectral image, and determine the center position of each perfect circle as the target range. Figure 2 As shown, in this embodiment, the white area is the marking area and the black area is the background area.
[0048] S3: Calculate the thickness of each pixel in the marked target range according to the radius of the target range. The specific calculation method is as follows:
[0049] Based on the transmittance spectrum image, the radius of each target range and the distance from each pixel point in the target range to the center of the target range are determined by shooting a micrometer or other methods, so as to calculate the thickness of each pixel point. The expression is as follows:
[0050] ;
[0051] In the formula, h represents the thickness, r represents the radius of a target range, and x represents the distance from any pixel point in the target range to its center.
[0052] S4: Pixels outside the target range are recorded as background pixels, and the thickness of each background pixel is 0. The thickness data and transmittance of each pixel in each target range, as well as the randomly acquired thickness data and transmittance of background pixels, are collected to obtain a training data set. In this embodiment, the number of background pixels accounts for 20% of the total.
[0053] S5: Use the training data set to train the prediction model built based on the random forest algorithm to obtain the relationship between pixel transmittance and thickness.
[0054] After the training is completed, cross validation is performed, specifically using ten-fold cross validation to ensure that the prediction model is reliable. It is determined whether the cross validation accuracy reaches the set threshold. In this embodiment, the threshold is set to 80%. If so, the trained prediction model is output and S6 is executed; if not, it is further confirmed whether the target range is accurately marked. If not, it returns to S2 and re-marks the target range; if accurate, it returns to S1 and continues to collect images of spherical phytoplankton to increase the amount of data in the training data set.
[0055] S6: Collect the phytoplankton in the volume to be measured, perform the operation in S1 on it, obtain the transmittance spectrum image, input it into the trained prediction model, and obtain the thickness prediction result of each pixel. The shape of the phytoplankton in the volume to be measured is not strictly limited, and can be a general shape, so that the method of the present invention is applicable to a wider range of phytoplankton.
[0056] S7: Determine the actual area of a single pixel according to the image resolution and the actual size of the image, and then obtain the volume of the phytoplankton to be measured.
[0057] The actual area A of a single pixel is calculated as follows:
[0058] ;
[0059] Where, L real Indicates the actual length, n pixel In particular, if the imaging device parameters do not tell the actual size of the field of view, this data can be obtained by photographing the micrometer.
[0060] The calculation expression of the volume V of the phytoplankton to be measured is as follows:
[0061] ;
[0062] In the formula, h i It represents the thickness of any pixel in the region estimated by the prediction model, and n represents the total number of pixels in the region.
[0063] In this embodiment, the phytoplankton to be measured is an elliptical micro-dinoflagellates. The thickness and volume of each pixel point in the region are calculated by the method of the present invention, and finally the following is obtained: Figure 3 Thickness distribution diagram shown.
[0064] Compared with the existing volume detection methods, the present invention has the following advantages: compared with the existing geometric estimation method, the present invention has higher volume measurement accuracy and a wider range of applicable phytoplankton; compared with the existing estimation method based on three-dimensional high-precision modeling, the present invention has less modeling workload and calculation amount while ensuring measurement accuracy, and shortens the measurement time.
[0065] Those skilled in the art can understand that the above are only preferred examples of the invention and are not intended to limit the invention. Although the invention is described in detail with reference to the above examples, those skilled in the art can still modify the technical solutions recorded in the above examples or replace some of the technical features therein with equivalents. Any modification, equivalent replacement, etc. made within the spirit and principle of the invention shall be included in the protection scope of the invention.
Claims
1. A method for detecting phytoplankton volume based on spectral imaging, characterized in that: The following steps are involved: S1: Select multiple spherical phytoplankton and collect the transmittance spectral image and spectral image pseudo-color image of the spherical phytoplankton through a microscopic hyperspectral imager; S2: Use a perfect circle to mark the phytoplankton in the pseudo-color image of the spectral image as the target range; S3: Calculate the thickness of each pixel point in the target range according to the radius of the target range. The thickness of each pixel point is the length of the chord passing through the point and perpendicular to the line connecting the point and the center of the target range. S4: construct a training data set, including: thickness data and transmittance of each pixel point in each target range, and thickness data and transmittance of randomly acquired background pixel points; background pixel points are pixel points outside the target range, and their thickness is 0; S5: Use the training data set to train the prediction model based on the random forest algorithm to obtain the relationship between pixel transmittance and thickness; S6: Obtain a transmittance spectrum image of the phytoplankton in the volume to be measured, input it into the trained prediction model, and obtain the thickness prediction result of each pixel point; S7: Determine the actual area of a single pixel according to the image resolution and the actual size of the image, and obtain the volume of the phytoplankton to be measured in combination with the thickness prediction result.
2. The method for detecting phytoplankton volume based on spectral imaging according to claim 1, characterized in that: In S1, the specific operation of obtaining the transmittance spectrum image by the microscopic hyperspectral imager is as follows: (1.1) Perform black and white calibration on the microscopic hyperspectral imager, that is, obtain the light intensity I measured when the light source is turned on and there is no obstruction max , and the original light intensity I when there is no light source min ; (1.2) The spherical phytoplankton sample is placed on a microscopic hyperspectral imager to collect the original spectral image. The information contained in the original spectral image is the light intensity information I; (1.3) The light intensity information is converted into transmittance to obtain the transmittance spectrum image. The conversion expression is as follows: ; Wherein, T represents the transmittance.
3. The method for detecting phytoplankton volume based on spectral imaging according to claim 1, characterized in that: The number of the background pixels accounts for 20% of the number of all pixels.
4. The method for detecting phytoplankton volume based on spectral imaging according to claim 1, characterized in that: In S5, when the prediction model is trained, cross-validation is performed to determine whether the cross-validation accuracy reaches the set threshold. If so, the trained prediction model is output and S6 is executed; if not, it is further confirmed whether the target range is marked accurately; if not, it returns to S2 and re-marks the target range; if accurate, it returns to S1 and continues to collect images of spherical phytoplankton to increase the amount of data in the training data set.
5. The method for detecting phytoplankton volume based on spectral imaging according to claim 1, characterized in that: In S7, the actual area calculation expression of a single pixel is as follows: ; In the formula, A represents the actual area of a single pixel, L real Indicates the actual length, n pixel Indicates the number of pixels corresponding to this length.
6. The method for detecting phytoplankton volume based on spectral imaging according to claim 5, characterized in that: The actual length is obtained according to the actual size of the field of view in the imaging device parameters, or is obtained by photographing a micrometer.
7. The method for detecting phytoplankton volume based on spectral imaging according to claim 5, characterized in that: In S7, the volume calculation expression of the phytoplankton to be measured is as follows: ; In the formula, V represents the volume of phytoplankton to be measured, h i It represents the thickness of any pixel in the region estimated by the prediction model, and n represents the total number of pixels contained in the region.
8. The method for detecting phytoplankton volume based on spectral imaging according to claim 1, characterized in that: In S3, the thickness expression of each pixel is as follows: ; In the formula, r represents the radius of a target range, x represents the distance from any pixel point in the target range to its center, and h represents the thickness of the pixel point.
Citation Information
Patent Citations
SVM-based plankton particle size spectrum detection method
CN110348533A
Plankton automatic detection method based on deep learning
CN111898677A