Portable algae detection device and method based on deep learning
A portable algae detection device using deep learning and image processing improves phytoplankton detection efficiency and accuracy, addressing the limitations of existing technologies by reducing size and cost, and enhancing portability.
Patent Information
- Application Number
- CN202411127540.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-16
- Publication Date
- 2024-12-27
AI Technical Summary
Current phytoplankton detection technologies, whether traditional optical microscopes or intelligent equipment, are cumbersome, require skilled operators, are large in size, costly, and lack portability and are not suitable for widespread use.
A portable algae detection device utilizing deep learning and image processing to improve the efficiency of detection work, and the use of an improved image weight determination method to enhance the accuracy of the detection results.
The device is portable, cost-effective, and provides accurate phytoplankton detection results, reducing mechanical complexity and maintenance costs while enhancing detection efficiency and reliability.
Smart Images

Figure CN119198707A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of plankton detection, and in particular to a portable algae detection device and method based on deep learning. Background Art
[0002] Phytoplankton is a type of microscopic plant that floats freely in water bodies. It has an important impact on ecology and human life. Phytoplankton produces oxygen through photosynthesis, providing oxygen for aquatic organisms to survive. At the same time, they are also primary producers in the aquatic food chain, providing food sources for aquatic animals such as fish and shrimp. However, when there are too many nutrients in the water body, phytoplankton will multiply in large numbers, forming a bloom phenomenon, causing water quality deterioration, affecting the utilization of water resources and the stability of the ecosystem.
[0003] The current phytoplankton detection technology is mainly based on traditional artificial optical microscope detection, supplemented by a small amount of artificial intelligence phytoplankton detection equipment. The traditional artificial optical microscope detection method requires high professional skills of the operator, is cumbersome to operate, and takes a long time. Compared with artificial optical microscope detection, the emerging intelligent phytoplankton detection equipment has the advantages of fast speed, large amount of information, multiple functions, and high efficiency, which effectively avoids the subjectivity and individual differences of manual detection. However, the current intelligent phytoplankton detection equipment is generally large in size, heavy in weight, and expensive, so it is limited in application scenarios and is not suitable for widespread application. Summary of the invention
[0004] The present invention provides a portable algae detection device and method based on deep learning to solve at least one of the above-mentioned technical problems.
[0005] The technical solution of the present invention to solve the above technical problems is as follows: A portable algae detection device based on deep learning, comprising:
[0006] Base;
[0007] A rotating turntable is horizontally rotatably mounted on the base;
[0008] A first motor, connected to the rotating turntable, for driving the rotating turntable to rotate in a horizontal direction;
[0009] A guide rail, vertically mounted on the base;
[0010] A slider, slidably mounted on the guide rail;
[0011] A second motor, connected to the slider, for driving the slider to move in a vertical direction along the guide rail;
[0012] An electronic camera with a microscope objective lens mounted on the lens is fixedly mounted on the slider and suspended above the rotating turntable, and is used to photograph a glass slide or a counting plate placed on the rotating turntable and loaded with an algae sample;
[0013] The processor is electrically connected to the first motor, the second motor and the electronic camera, and is used to control the operation of the first motor and the second motor, and to process the image taken by the electronic camera based on a deep learning method and a pyramid fusion method to obtain an algae detection result.
[0014] Based on the above-mentioned portable algae detection device based on deep learning, the present invention also provides a portable algae detection method based on deep learning.
[0015] A portable algae detection method based on deep learning, using the portable algae detection device based on deep learning to detect algae samples, comprising:
[0016] S1, placing a slide or counting plate loaded with algae samples on a rotating turntable;
[0017] S2, using a processor to control the operation of a second motor to drive the microscope objective lens to move from top to bottom, and in the process of the microscope objective lens moving from top to bottom, using an electronic camera to photograph the glass slide or counting plate, and using the processor to perform image clarity evaluation on the image photographed by the electronic camera to find the focal plane of the glass slide or counting plate;
[0018] S3, using the processor to control the first motor to operate at a preset angle so that the microscope objective lens captures a preset field of view of the glass slide or counting plate; using the focal plane of the glass slide or counting plate as a reference, using the processor to control the second motor to operate so as to drive the electronic camera to perform imaging of different liquid layers of the glass slide or counting plate under the preset field of view, and obtain an original image sequence under the preset field of view;
[0019] S4, in the processor, detecting the original image sequence under the preset field of view based on a deep learning method to obtain algae biological information of each original image in the original image sequence under the preset field of view;
[0020] S5, in the processor, based on the algae biological information of each original image in the original image sequence under the preset field of view, a pyramid fusion method is used to perform image fusion on the original image sequence under the preset field of view to obtain an algae detection result under the preset field of view;
[0021] S6, repeatedly executing S3 to S5 until the preset number of fields of view are detected.
[0022] Based on the above technical solution, the present invention can also be improved as follows.
[0023] Further, in S5, in the process of performing image fusion on the original image sequence under the preset field of view by using the pyramid fusion method, a weight matrix is constructed, and the specific steps of constructing the weight matrix are:
[0024] S51, performing Laplace processing and normalization on the original image sequence to obtain a Laplace image sequence;
[0025] S52, according to the detection frame in the algae biological information of each original image in the original image sequence under the preset field of view, selecting the area surrounded by the detection frame with the highest confidence in the original image sequence as a reference block;
[0026] S53, filtering each original image in the original image sequence to obtain a filtered image sequence, respectively calculating the sum of all pixels of each filtered image in the filtered image sequence, and taking the original image corresponding to the filtered image having the highest sum of all pixels as the initial base image;
[0027] S54, based on the initial base plate image, filling the initial base plate image with the reference block to obtain a base plate image;
[0028] S55, calculating the color angle hue value and gradient angle value of each original image in the original image sequence;
[0029] S56, calculating the difference in color angle hue value between each original image in the original image sequence and the base image, calculating the difference in gradient angle value between each original image in the original image sequence and the base image, performing weighted addition on the difference in color angle hue value between each original image in the original image sequence and the base image and the difference in gradient angle value between each original image in the original image sequence and the base image, to obtain an angle difference matrix sequence;
[0030] S57, multiplying the angle difference matrix sequence and the Laplacian image sequence to obtain an initial weight matrix, and normalizing the initial weight matrix to obtain the weight matrix.
[0031] Further, the S51 is specifically as follows:
[0032] Performing Laplace processing on the original image sequence to obtain the Laplace edge value of each original image in the original image sequence;
[0033] According to the Laplacian edge value of each original image in the original image sequence, normalization processing is performed on each original image in the original image sequence to obtain the Laplacian image sequence.
[0034] Further, in S55, the step of calculating the color angle hue value of each original image in the original image sequence is:
[0035] Convert each original image in the original image sequence from RGB space to huv space;
[0036] The h value of each original image in the original image sequence in the huv space is calculated, and the h value is the color angle hue value.
[0037] Further, in S55, the step of calculating the gradient angle value of each original image in the original image sequence is:
[0038] Performing x-axis filtering and y-axis filtering on each original image in the original image sequence to obtain an x-axis filtering value and a y-axis filtering value of each original image in the original image sequence;
[0039] The x-axis filtering value and the y-axis filtering value of each original image in the original image sequence are divided and the tan function is inverted to obtain the gradient angle value of each original image in the original image sequence.
[0040] Further, before S56, the method further includes:
[0041] Determine whether the color angle hue value and the gradient angle value of each original image in the original image sequence do not exceed the allowable error; if so, execute S56; if not, use a binary mapping processing formula of a multi-level threshold to process the original image whose color angle hue value and / or gradient angle value exceed the allowable error, so that the color angle hue value and the gradient angle value of the processed original image do not exceed the allowable error, and then execute S56 based on the processed original image;
[0042] The binary mapping processing formula is:
[0043]
[0044] t j+1 =t j +ξ;
[0045] Specifically, j represents the j-th level threshold, and j = 1, 2, ..., J, J is the total number of threshold levels, the first level threshold t1 is set to the ratio of the number of underexposed pixels in the k-th original image of the original image sequence to the total number of pixels, and the final level threshold t Jis set to be the ratio of the number of non-overexposed pixels to the total number of pixels in the kth original image of the original image sequence; ξ represents the step size; I k (x, y) represents the normalized intensity of the kth original image in the original image sequence at pixel (x, y), TB j,k (x, y) represents the pixel (x, y) of the kth original image in the original image sequence at the jth level threshold t j The binary map below.
[0046] Furthermore, the allowable error of the color angle hue value is 15°, and the allowable error of the gradient angle value is 10°.
[0047] Further, in S56, the formulas for calculating the difference between the color angle hue value of each original image in the original image sequence and the base image and for calculating the difference between the gradient angle value of each original image in the original image sequence and the base image are both:
[0048]
[0049] Among them, when T k (x, y) represents the difference in color angle hue value between each original image in the original image sequence and the base image, θ k (x, y) represents the color angle hue value of each original image in the original image sequence, θ ref (x, y) represents the color angle hue value of the base plate image; when T k When (x, y) represents the difference between the gradient angle values of each original image in the original image sequence and the base image, θ k (x, y) represents the gradient angle value of each original image in the original image sequence, θ ref (x, y) represents the gradient angle value of the base plate image; σ represents the preset coefficient.
[0050] Furthermore, in S5, in the process of performing image fusion based on the pyramid fusion method, the number of layers of the pyramid is 10.
[0051] The beneficial effects of the present invention are as follows: in a portable algae detection device and method based on deep learning of the present invention, the device is divided into two parts, one is a body part, and the other is a processor part; in the body part, an electronic camera with a microscope objective lens installed on the lens, a vertical motion platform and a horizontal rotation platform are included; the present invention replaces the horizontal xy two-axis moving platform with a rotating platform, effectively avoiding mechanical errors caused by mechanical processing, greatly reducing the difficulty of mechanical control and the cost of mechanical maintenance; the present invention replaces the entire set of optical microscope systems with a customized simplified optical microscope system, reducing the research and development and maintenance costs of the device, reducing the size and weight of the device, and making it easy to carry, so that the device is no longer limited to laboratory use, but can be widely used; in the processor part, deep learning and pyramid fusion intelligent detection are used to improve the efficiency of detection work, and the subjectivity and individual differences of manual detection are effectively avoided; in addition, the use of an improved image weight determination method in the process of pyramid fusion can improve the accuracy of image fusion, thereby making the detection result more reliable. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 It is an overall schematic diagram of a portable algae detection device based on deep learning of the present invention;
[0053] Figure 2 This is a schematic diagram of the specific structure of a body in a portable algae detection device based on deep learning of the present invention;
[0054] Figure 3 A flowchart of a portable algae detection method based on deep learning of the present invention;
[0055] Figure 4 The present invention provides a flowchart for constructing a weight matrix in a portable algae detection method based on deep learning.
[0056] In the accompanying drawings, the components represented by the reference numerals are listed as follows:
[0057] 10. Processor; 20. Body; 1. Base; 2. Rotating turntable; 3. First motor; 4. Guide rail; 5. Slider; 6. Second motor; 7. Microscope objective lens; 8. Electronic camera; 9. Glass slide or counting plate. DETAILED DESCRIPTION
[0058] The principles and features of the present invention are described below in conjunction with the accompanying drawings. The examples given are only used to explain the present invention and are not used to limit the scope of the present invention.
[0059] Embodiment 1:
[0060] like Figure 1 As shown, a portable algae detection device based on deep learning includes a processor 10 and a body 20; wherein, as Figure 2 As shown, the body 20 includes:
[0061] Base 1;
[0062] A rotating turntable 2 is horizontally rotatably mounted on the base 1;
[0063] A first motor 3, connected to the rotating turntable 2, and used to drive the rotating turntable 2 to rotate in a horizontal direction;
[0064] A guide rail 4 is vertically mounted on the base 1;
[0065] A slider 5 is slidably mounted on the guide rail 4;
[0066] A second motor 6, connected to the slider 5, for driving the slider 5 to move in a vertical direction along the guide rail 4;
[0067] An electronic camera 8 with a microscope objective lens 7 mounted on the lens is fixedly mounted on the slider 5 and suspended above the rotating turntable 2 for photographing a glass slide or a counting plate 9 placed on the rotating turntable 2 and loaded with algae samples.
[0068] The processor 10 is electrically connected to the first motor 3, the second motor 6 and the electronic camera 8, and is used to control the operation of the first motor 3 and the second motor 6, and to process the image taken by the electronic camera 8 based on a deep learning method and a pyramid fusion method to obtain an algae detection result.
[0069] In a portable algae detection device based on deep learning of the present invention, the microscope objective lens 7 can be a high-power microscope objective lens, and the electronic camera 8 can be a high-resolution electronic camera. The rotating platform composed of the rotating turntable 2 and the first motor 3 replaces the existing horizontal xy two-axis moving platform, which can effectively avoid the mechanical error caused by mechanical processing and greatly reduce the difficulty of mechanical control and the cost of mechanical maintenance; in addition, the electronic camera 8 with the microscope objective lens 7 installed on the lens constitutes a customized simplified optical microscope system to replace the existing complete set of optical microscope systems, which reduces the R&D and maintenance costs of the device, reduces the size and weight of the device, and is easy to carry, so that the device is no longer limited to laboratory use, but can be widely used.
[0070] Embodiment 2:
[0071] like Figure 3 As shown, a portable algae detection method based on deep learning is used to detect algae samples using the portable algae detection device based on deep learning, including:
[0072] S1, placing a glass slide or counting plate 9 loaded with an algae sample on a rotating turntable 2;
[0073] S2, using the processor 10 to control the second motor 6 to operate, so as to drive the microscope objective lens 7 to move from top to bottom, and in the process of the microscope objective lens 7 moving from top to bottom, using the electronic camera 8 to photograph the glass slide or the counting plate 9, and at the same time using the processor 10 to evaluate the image clarity of the image photographed by the electronic camera 8, so as to find the focal plane of the glass slide or the counting plate 9;
[0074] S3, using the processor 10 to control the first motor 3 to operate at a preset angle, so that the microscope objective lens 7 captures a preset field of view of the glass slide or the counting plate 9; using the focal plane of the glass slide or the counting plate 9 as a reference, using the processor 10 to control the second motor 6 to operate, so as to drive the electronic camera 8 to perform imaging of different liquid layers of the glass slide or the counting plate 9 under the preset field of view, and obtain an original image sequence under the preset field of view;
[0075] S4, in the processor 10, detecting the original image sequence under the preset field of view based on a deep learning method to obtain algae biological information of each original image in the original image sequence under the preset field of view;
[0076] S5, in the processor 10, based on the algae biological information of each original image in the original image sequence under the preset field of view, a pyramid fusion method is used to perform image fusion on the original image sequence under the preset field of view to obtain an algae detection result under the preset field of view;
[0077] S6, repeatedly executing S3 to S5 until the preset number of fields of view are detected.
[0078] In this specific embodiment:
[0079] The purpose of S2 is to achieve autofocus, which can use an autofocus method based on image clarity evaluation to find the focal plane of the circular slide or counting plate 9. The autofocus method based on image clarity evaluation can refer to the method disclosed in the patent application number CN202310786132.0, which will not be repeated here.
[0080] In this specific embodiment:
[0081] The S3 is actually a ZR two-axis simulated three-dimensional scanning, which first rotates the first motor 3 to a specified angle so that the microscope eyepiece 7 can capture an image of a specified field of view; then rotates the second motor 6 to obtain images of different liquid layers in the vertical direction of the specified field of view.
[0082] In this specific embodiment:
[0083] S4 implements intelligent recognition of biological information, which uses a pre-trained network to detect the original image sequence taken in S3 and automatically calculates the algae biological information in the preset field of view. Among them, the method of using a pre-trained network to detect the original image sequence taken in S3 can be referred to the method disclosed in the patent application number CN202211393317.7 or CN202211515386.0, which will not be repeated here.
[0084] In this specific embodiment:
[0085] In S5, in the process of using the pyramid fusion method to fuse the original image sequence under the preset field of view, it is first necessary to determine the weight of each original image in the original image sequence, that is, to construct a weight matrix; Figure 4 As shown, the specific steps of constructing the weight matrix are:
[0086] S51, performing Laplace processing and normalization on the original image sequence to obtain a Laplace image sequence;
[0087] S52, according to the detection frame in the algae biological information of each original image in the original image sequence under the preset field of view, selecting the area surrounded by the detection frame with the highest confidence in the original image sequence as a reference block;
[0088] S53, filtering each original image in the original image sequence to obtain a filtered image sequence, respectively calculating the sum of all pixels of each filtered image in the filtered image sequence, and taking the original image corresponding to the filtered image having the highest sum of all pixels as the initial base image;
[0089] S54, based on the initial base plate image, filling the initial base plate image with the reference block to obtain a base plate image;
[0090] S55, calculating the color angle hue value and gradient angle value of each original image in the original image sequence;
[0091] S56, calculating the difference in color angle hue value between each original image in the original image sequence and the base image, calculating the difference in gradient angle value between each original image in the original image sequence and the base image, performing weighted addition on the difference in color angle hue value between each original image in the original image sequence and the base image and the difference in gradient angle value between each original image in the original image sequence and the base image, to obtain an angle difference matrix sequence;
[0092] S57, multiplying the angle difference matrix sequence and the Laplacian image sequence to obtain an initial weight matrix, and normalizing the initial weight matrix to obtain the weight matrix.
[0093] In a portable algae detection method based on deep learning of the present invention, the method of constructing a weight matrix is an improved image weight determination method, which can improve the accuracy of image fusion and thus make the detection result more reliable.
[0094] Preferably, the S51 is specifically:
[0095] Performing Laplace processing on the original image sequence to obtain the Laplace edge value of each original image in the original image sequence;
[0096] According to the Laplacian edge value of each original image in the original image sequence, normalization processing is performed on each original image in the original image sequence to obtain the Laplacian image sequence.
[0097] Specifically, the original image sequence is the original image of the same field of view, and they are pixel-aligned; normalization of the original image means: at a fixed pixel point, the sum of the pixels of all the original images at the fixed pixel point is 1, which is called normalization; for example, the original image sequence has a total of 3 original images, at the pixel with coordinates (203,495), the Laplace edge value of the first original image is 0.1, the Laplace edge value of the second original image is 0.2, and the Laplace edge value of the third original image is 0.2, then the normalization results of these three original images at the pixel (203,495) are 0.5, 0.25, and 0.25.
[0098] Preferably, in S53, filtering each original image in the original image sequence may be image feature detection (including Laplacian image detection or Sobel image edge detection, etc.), and the filtering here is only to determine which original image is used as the initial base image, and the initial base image is still a color original image or an original image scaled to a fixed size.
[0099] Preferably, in S55, the step of calculating the color angle hue value of each original image in the original image sequence is:
[0100] Convert each original image in the original image sequence from RGB space to huv space;
[0101] The h value of each original image in the original image sequence in the huv space is calculated, and the h value is the color angle hue value.
[0102] Preferably, in S55, the step of calculating the gradient angle value of each original image in the original image sequence is:
[0103] Performing x-axis filtering and y-axis filtering on each original image in the original image sequence to obtain an x-axis filtering value and a y-axis filtering value of each original image in the original image sequence;
[0104] The x-axis filtering value and the y-axis filtering value of each original image in the original image sequence are divided and the tan function is inverted to obtain the gradient angle value of each original image in the original image sequence.
[0105] The Sobel filter used in edge detection in OpenCV can be used to perform x-axis filtering and y-axis filtering on each original image in the original image sequence.
[0106] Preferably, before S56, the method further includes:
[0107] Determine whether the color angle hue value and the gradient angle value of each original image in the original image sequence do not exceed the allowable error; if so, execute S56; if not, use the binary mapping processing formula of the multi-level threshold to process the original image whose color angle hue value and / or gradient angle value exceed the allowable error, so that the color angle hue value and the gradient angle value of the processed original image do not exceed the allowable error, and then execute S56 based on the processed original image.
[0108] The binary mapping processing formula is:
[0109]
[0110] t j+1 =t j +ξ;
[0111] Specifically, j represents the j-th level threshold, and j = 1, 2, ..., J, J is the total number of levels, the first level threshold t1 is set to the ratio of the number of underexposed pixels in the k-th original image of the original image sequence to the total number of pixels, and the final level threshold t J is set to the ratio of the number of non-overexposed pixels to the total number of pixels in the kth original image of the original image sequence; ξ represents the step size and is usually set to t1~t J 10-15% of the entire range; I k (x, y) represents the normalized intensity of the kth original image in the original image sequence at pixel (x, y), TB j,k (x, y) represents the binary mapping of the pixel (x, y) of the kth original image in the original image sequence under the jth level threshold.
[0112] Preferably, the allowable error of the color angle hue value is 15°, and the allowable error of the gradient angle value is 10°.
[0113] Preferably, in S56, the formulas for calculating the difference between the color angle hue value of each original image in the original image sequence and the base image and for calculating the difference between the gradient angle value of each original image in the original image sequence and the base image are both:
[0114]
[0115] Among them, when T k (x, y) represents the difference in color angle hue value between each original image in the original image sequence and the base image, θ k (x, y) represents the color angle hue value of each original image in the original image sequence, θ ref (x, y) represents the color angle hue value of the base plate image; when T k When (x, y) represents the difference between the gradient angle values of each original image in the original image sequence and the base image, θ k (x, y) represents the gradient angle value of each original image in the original image sequence, θ ref (x, y) represents the gradient angle value of the base image; σ represents a preset coefficient; specifically, when the pixel in the base image is poorly exposed, σ takes an arbitrary minimum value α, and in other cases, σ takes a value of β, and β is greater than α, so as to reduce the influence of the pixel in the image with a divergent gradient. In S56, since the base image is a reconstructed image, it has not been calculated, and its color angle hue value and gradient angle value are taken from other original images; based on the base image, if a block in the base image is not the one with the highest confidence, then that block uses the data of the original image with the highest confidence.
[0116] Preferably, in S5, in the process of performing image fusion based on the pyramid fusion method, the recommended number of pyramid layers is 10.
[0117] In a portable algae detection device and method based on deep learning of the present invention, the device is divided into two parts, one is a body part, and the other is a processor part; in the body part, an electronic camera with a microscope objective lens installed on the lens, a vertical motion platform and a horizontal rotation platform are included; the present invention replaces the horizontal xy two-axis moving platform with a rotating platform, effectively avoiding mechanical errors caused by mechanical processing, greatly reducing the difficulty of mechanical control and the cost of mechanical maintenance; the present invention replaces the entire set of optical microscope systems with a customized simplified optical microscope system, reducing the research and development and maintenance costs of the device, reducing the volume and weight of the device, and making it easy to carry, so that the device is no longer limited to laboratory use, but can be widely used; in the processor part, deep learning and pyramid fusion intelligent detection are used to improve the efficiency of detection work, and the subjectivity and individual differences of manual detection are effectively avoided; in addition, in the process of pyramid fusion, an improved image weight determination method is used to improve the accuracy of image fusion, thereby making the detection result more reliable.
[0118] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A portable algae detection device based on deep learning, characterized in that: include: Base (1); A rotating turntable (2) is horizontally rotatably mounted on the base (1); A first motor (3), connected to the rotating turntable (2), and used for driving the rotating turntable (2) to rotate in a horizontal direction; A guide rail (4) vertically mounted on the base (1); A slider (5) slidably mounted on the guide rail (4); a second motor (6), connected to the slider (5), and used for driving the slider (5) to move in a vertical direction along the guide rail (4); An electronic camera (8) having a microscope objective lens (7) mounted on the lens is fixedly mounted on the slider (5) and suspended above the rotating turntable (2), and is used to photograph a glass slide or a counting plate (9) placed on the rotating turntable (2) and loaded with an algae sample; A processor (10) is electrically connected to the first motor (3), the second motor (6) and the electronic camera (8), and is used to control the operation of the first motor (3) and the second motor (6), and to process the image taken by the electronic camera (8) based on a deep learning method and a pyramid fusion method to obtain an algae detection result.
2. A portable algae detection method based on deep learning, characterized in that: Using the portable algae detection device based on deep learning as claimed in claim 1 to detect algae samples, comprising: S1, placing a glass slide or a counting plate (9) loaded with an algae sample on a rotating turntable (2); S2, using a processor (10) to control the operation of a second motor (6) to drive the microscope objective lens (7) to move from top to bottom, and in the process of the microscope objective lens (7) moving from top to bottom, using an electronic camera (8) to photograph the glass slide or counting board (9), and at the same time using the processor (10) to evaluate the image clarity of the image photographed by the electronic camera (8) to find the focal plane of the glass slide or counting board (9); S3, using the processor (10) to control the first motor (3) to operate at a preset angle, so that the microscope objective lens (7) captures a preset field of view of the glass slide or the counting plate (9); using the focal plane of the glass slide or the counting plate (9) as a reference, using the processor (10) to control the second motor (6) to operate, so as to drive the electronic camera (8) to perform imaging of different liquid layers of the glass slide or the counting plate (9) under the preset field of view, and obtain an original image sequence under the preset field of view; S4, in the processor (10), detecting the original image sequence under the preset field of view based on a deep learning method to obtain algae biological information of each original image in the original image sequence under the preset field of view; S5, in the processor (10), based on the algae biological information of each original image in the original image sequence under the preset field of view, a pyramid fusion method is used to perform image fusion on the original image sequence under the preset field of view, so as to obtain an algae detection result under the preset field of view; S6, repeatedly executing S3 to S5 until the preset number of fields of view are detected.
3. The portable algae detection method based on deep learning according to claim 2 is characterized in that: In S5, in the process of using the pyramid fusion method to fuse the original image sequence under the preset field of view, a weight matrix is constructed, and the specific steps of constructing the weight matrix are: S51, performing Laplace processing and normalization on the original image sequence to obtain a Laplace image sequence; S52, according to the detection frame in the algae biological information of each original image in the original image sequence under the preset field of view, selecting the area surrounded by the detection frame with the highest confidence in the original image sequence as a reference block; S53, filtering each original image in the original image sequence to obtain a filtered image sequence, respectively calculating the sum of all pixels of each filtered image in the filtered image sequence, and taking the original image corresponding to the filtered image having the highest sum of all pixels as the initial base image; S54, based on the initial base plate image, filling the initial base plate image with the reference block to obtain a base plate image; S55, calculating the color angle hue value and gradient angle value of each original image in the original image sequence; S56, calculating the difference in color angle hue value between each original image in the original image sequence and the base image, calculating the difference in gradient angle value between each original image in the original image sequence and the base image, and multiplying the difference in color angle hue value between each original image in the original image sequence and the base image with the difference in gradient angle value between each original image in the original image sequence and the base image to obtain an angle difference matrix sequence; S57, multiplying the angle difference matrix sequence and the Laplacian image sequence to obtain an initial weight matrix, and normalizing the initial weight matrix to obtain the weight matrix.
4. The portable algae detection method based on deep learning according to claim 3 is characterized in that: The S51 is specifically: Performing Laplace processing on the original image sequence to obtain the Laplace edge value of each original image in the original image sequence; According to the Laplacian edge value of each original image in the original image sequence, normalization processing is performed on each original image in the original image sequence to obtain the Laplacian image sequence.
5. The portable algae detection method based on deep learning according to claim 3, characterized in that: In S55, the step of calculating the color angle hue value of each original image in the original image sequence is: Convert each original image in the original image sequence from RGB space to huv space; Calculate the h value of each original image in the original image sequence in the huv space, then the h value is the color angle hu e value.
6. The portable algae detection method based on deep learning according to claim 3, characterized in that: In S55, the step of calculating the gradient angle value of each original image in the original image sequence is: Performing x-axis filtering and y-axis filtering on each original image in the original image sequence to obtain an x-axis filtering value and a y-axis filtering value of each original image in the original image sequence; The x-axis filtering value and the y-axis filtering value of each original image in the original image sequence are divided and the tan function is inverted to obtain the gradient angle value of each original image in the original image sequence.
7. The portable algae detection method based on deep learning according to claim 3, characterized in that: Before the S56, the method further includes: Determine whether the color angle hue value and gradient angle value of each original image in the original image sequence do not exceed the allowable error; if so, execute S56; if not, use the binary mapping processing formula of the multi-level threshold to process the color angle hue. e Processing the original image whose color angle hue value and / or gradient angle value exceed the allowable error, so that the color angle hue value and gradient angle value of the processed original image do not exceed the allowable error, and then executing S56 based on the processed original image; The binary mapping processing formula is: t j+1 =t j +ξ; Specifically, j represents the j-th level threshold, and j = 1, 2, ..., J, J is the total number of threshold levels, the first level threshold t1 is set to the ratio of the number of underexposed pixels in the k-th original image of the original image sequence to the total number of pixels, and the final level threshold t j is set to be the ratio of the number of non-overexposed pixels to the total number of pixels in the kth original image of the original image sequence; ξ represents the step size; I k (x, y) represents the normalized intensity of the kth original image in the original image sequence at pixel (x, y), TB j,k (x, y) represents the pixel (x, y) of the kth original image in the original image sequence at the jth level threshold t j The binary map below.
8. The portable algae detection method based on deep learning according to claim 7, characterized in that: The allowable error of the color angle hue value is 15°, and the allowable error of the gradient angle value is 10°.
9. The portable algae detection method based on deep learning according to claim 3, characterized in that: In S56, the formulas for calculating the difference between the color angle hue value of each original image in the original image sequence and the base image and for calculating the difference between the gradient angle value of each original image in the original image sequence and the base image are both: Among them, when T k When (x, y) represents the difference in color angle hue value between each original image in the original image sequence and the base image, θ k (x, y) represents the color angle hue value of each original image in the original image sequence, θ ref (x, y) represents the color angle hue value of the base plate image; when T k When (x, y) represents the difference between the gradient angle values of each original image in the original image sequence and the base image, θ k (x, y) represents the gradient angle value of each original image in the original image sequence, θ ref (x, y) represents the gradient angle value of the base plate image; σ represents a preset coefficient.
10. The portable algae detection method based on deep learning according to claim 2, characterized in that: In S5, in the process of performing image fusion based on the pyramid fusion method, the number of layers of the pyramid is 10.