Algae colony detection method, device, electronic device and storage medium

By expanding the number of anchor frames and using projection grids, the problems of large errors and low accuracy of algae population detection in the prior art are solved, and higher detection accuracy and applicability to multiple silt and sand water bodies are achieved.

CN116385862BActive Publication Date: 2024-11-12ECOLOGICAL ENVIRONMENT MONITORING & SCI RES CENT OF THE YELLOW RIVER BASIN ECOLOGICAL ENVIRONMENT SUPERVISION ADMINISTRATION OF THE MINISTRY OF ECOLOGY & ENVIRONMENT +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310377382.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-07
Publication Date
2024-11-12
Estimated Expiration
2043-04-07

AI Technical Summary

Technical Problem

The existing deep learning-based algae population detection methods have problems such as large errors and low accuracy, especially when detecting phytoplankton algae populations, they are prone to missed detection problems.

Method used

By expanding the number of anchor boxes, dividing high and low threshold sets, and using projection grids for detection, we can improve the detection accuracy of algae populations, and use the preliminary detection model to correct and segment the images to be detected to obtain the final detection result.

Benefits of technology

It effectively avoids missed detection of small targets, improves the accuracy of algae population detection, and is suitable for water environments such as the Yellow River with a lot of silt and sand, reducing interference with impurities such as silt and sand in water samples.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116385862B_ABST
    Figure CN116385862B_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide an algae colony detection method, device, electronic device and storage medium, which belong to the field of data processing technology. It includes: obtaining an image to be detected, detecting the image to be detected according to a preliminary detection model, outputting a preliminary detection result, correcting the position of the preliminary detection result, obtaining a corrected detection result, and dividing the corrected colony frame information into a first grid matrix and a second grid matrix; obtaining a corrected individual first frame information set and a corrected individual second frame information set, projecting the first grid matrix and the second grid matrix respectively, and filling and intersecting the obtained projection data to obtain the final detection result. The embodiments of the present application propose a method of screening using a projection grid, which has high detection accuracy and greatly reduces missed detections.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to an algae colony detection method, device, electronic device and storage medium. Background Art

[0002] In the Yellow River Basin, eutrophication of water bodies is developing, and algae blooms are serious, posing a serious threat to water resources, environment, and water ecological security. In order to understand the ecological situation of algae in the Yellow River Basin, computers can be used to analyze water bodies and detect algae in water bodies in real time.

[0003] Algae are diverse and have different shapes, especially colony cells, which are difficult to statistically analyze. Many phytoplankton colonies are composed of many algae daughter cells connected end to end. Therefore, in order to detect algae colony cells, the daughter cells in the phytoplankton colony can be detected.

[0004] Existing deep learning-based detection methods include: A relatively simple method is to set the length of these daughter cells, and then perform traditional image feature extraction and algae population cell population curve fitting on the detected group cell image, set the group length of each daughter cell, and divide the length of the curve by the length of the daughter cell to estimate the total number of cells. Another method is to use traditional anchor frame neural network detection, but because the daughter cells of algae are generally small, if ordinary anchor frame neural networks are used directly for detection, it is easy to miss detection and other problems. In summary, existing deep learning-based algae population detection methods generally have large errors and low accuracy. Summary of the invention

[0005] In order to solve the above technical problems, the embodiments of the present application provide an algae colony detection method, device, electronic device and storage medium.

[0006] In a first aspect, an embodiment of the present application provides a method for detecting algae populations, the method comprising:

[0007] Acquire an image to be detected, and detect the image to be detected according to a preliminary detection model, wherein the preliminary detection model is trained based on algae group samples and algae individual samples;

[0008] Outputting a preliminary detection result, wherein the preliminary detection result includes algae colony frame information, a first frame information set of algae individuals, and a second frame information set of algae individuals;

[0009] Performing position correction on the preliminary detection result to obtain a corrected detection result, wherein the corrected detection result includes corrected group frame information, corrected individual first frame information set, and corrected individual second frame information set;

[0010] dividing the modified group frame information into a first grid matrix and a second grid matrix;

[0011] Acquire the projection of the first frame information set of the corrected individual in the first grid matrix to obtain first projection data;

[0012] Filling the first projection data to obtain filled projection data;

[0013] Acquire the projection of the second frame information set of the corrected individual in the second grid matrix to obtain second projection data;

[0014] Taking the intersection of the filled projection data and the second projection data to obtain third projection data;

[0015] Taking the intersection of the second frame information of the corrected individual and the third projection data to obtain fourth projection data;

[0016] The fourth projection data is restored to obtain a final detection result.

[0017] In one embodiment, the first frame information set of algae individuals is a set of algae individual frame information having a confidence greater than or equal to a first confidence threshold, and the second frame information set of algae individuals is a set of algae individual frame information having a confidence less than or equal to a second confidence threshold, wherein the first confidence is greater than the second confidence.

[0018] In one embodiment, the performing position correction on the preliminary detection result to obtain a corrected detection result includes:

[0019] Determining whether the frame position corresponding to the algae colony frame information is horizontal;

[0020] If the frame position corresponding to the algae population frame information is not horizontal, the preliminary detection result is rotated to be horizontal to obtain the corrected population frame information;

[0021] Acquire the first minimum bounding rectangle of each frame in the first frame information set of the algae individual, and determine the set of the first minimum bounding rectangles as the revised individual first frame information set;

[0022] The second minimum bounding rectangle of each frame in the second frame information set of the algae individual is obtained, and the set of the second minimum bounding rectangles is determined as the revised individual second frame information set.

[0023] In one embodiment, dividing the modified group frame information into a first grid matrix and a second grid matrix includes:

[0024] Obtaining a first average value of long sides of all frames in the corrected individual first frame information set, dividing the corrected group frame information into a plurality of square grids with side lengths equal to the first average value, to obtain the first grid matrix;

[0025] A second average value of the long sides of all frames in the corrected individual second frame information set is obtained, and the corrected group frame information is divided into a plurality of square grids whose side lengths are equal to the second average value to obtain the second grid matrix.

[0026] In one embodiment, the step of acquiring a projection of the first frame information set of the corrected individual in the first grid matrix to obtain first projection data includes:

[0027] Obtaining the intersection area between each frame in the first frame information set of the corrected individual and each grid in the first grid matrix;

[0028] Determine the grid with the largest intersection area as the projection grid corresponding to the frame;

[0029] A set of all the projection grids is determined as the first projection data.

[0030] In one embodiment, filling the first projection data to obtain filled projection data includes:

[0031] Acquire two projection data with the shortest distance from the boundary of the first grid matrix in the first projection data, and fill the grids between the two projection data and the boundary of the first grid matrix based on the shortest distance principle to obtain intermediate filling data;

[0032] Obtaining eight connected subgroups in the intermediate filling data;

[0033] The grid where the eight-connected subgroups are located is filled so that all the eight-connected subgroups are eight-connected, thereby obtaining the filled projection data.

[0034] In one embodiment, each detection window of the preliminary detection model includes multiple anchor boxes.

[0035] In a second aspect, an embodiment of the present application provides an algae colony detection device, the algae colony detection device comprising:

[0036] An acquisition module, used for acquiring an image to be detected, and detecting the image to be detected according to a preliminary detection model, wherein the preliminary detection model is trained based on algae group samples and algae individual samples;

[0037] A detection module, used to output a preliminary detection result, wherein the preliminary detection result includes algae colony frame information, a first frame information set of algae individuals, and a second frame information set of algae individuals;

[0038] A correction module, used for performing position correction on the preliminary detection result to obtain a corrected detection result, wherein the corrected detection result includes corrected group frame information, corrected individual first frame information set and corrected individual second frame information set;

[0039] A segmentation module, used for segmenting the modified group frame information into a first grid matrix and a second grid matrix;

[0040] A first projection module, used for acquiring a projection of the first frame information set of the corrected individual in the first grid matrix to obtain first projection data;

[0041] A filling module, used for filling the first projection data to obtain filled projection data;

[0042] A second projection module, used for acquiring a projection of the second frame information set of the corrected individual in the second grid matrix to obtain second projection data;

[0043] A first operation module, configured to obtain the third projection data by taking the intersection of the filled projection data and the second projection data;

[0044] A second operation module is used to obtain the fourth projection data by taking the intersection of the second frame information of the corrected individual and the third projection data;

[0045] The restoration module is used to restore the position of the fourth projection data to obtain a final detection result.

[0046] In a third aspect, an embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory is used to store a computer program, and when the computer program is run by the processor, the algae colony detection method provided in the first aspect is executed.

[0047] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, which, when executed on a processor, executes the algae colony detection method provided in the first aspect.

[0048] The algae colony detection method provided by the present application expands more anchor frames to obtain stronger target compatibility, and at the same time, by dividing the high threshold set and the low threshold set and the projection grid, it effectively avoids the missed detection of small targets and improves the accuracy of algae colony detection. It does not use traditional image processing methods to avoid interference from impurities such as silt in water samples, and is suitable for algae detection in water bodies with a lot of silt, such as the Yellow River. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] In order to more clearly illustrate the technical solution of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present application and should not be regarded as limiting the scope of protection of the present application. In each of the drawings, similar components are numbered similarly.

[0050] Figure 1 A schematic diagram of a process of an algae population detection method provided in an embodiment of the present application is shown;

[0051] Figure 2 A schematic diagram showing the network structure of YOLOV5;

[0052] Figure 3 A schematic diagram showing the network structure of the preliminary detection model provided in an embodiment of the present application;

[0053] Figure 4 One of the schematic diagrams showing the substructure of the network structure of the preliminary detection model provided in the embodiment of the present application;

[0054] Figure 5 A second schematic diagram showing a substructure of the network structure of the preliminary detection model provided in an embodiment of the present application;

[0055] Figure 6 A third schematic diagram showing a substructure of the network structure of the preliminary detection model provided in an embodiment of the present application;

[0056] Figure 7 A fourth schematic diagram showing a substructure of the network structure of the preliminary detection model provided in an embodiment of the present application;

[0057] Figure 8 A fifth schematic diagram showing a substructure of the network structure of the preliminary detection model provided in an embodiment of the present application;

[0058] Fig. 9 One of the schematic diagrams showing a specific application of the algae colony detection method provided in the embodiment of the present application;

[0059] Fig.10 A second schematic diagram showing a specific application of the algae colony detection method provided in an embodiment of the present application;

[0060] Fig.11 A third schematic diagram showing a specific application of the algae colony detection method provided in an embodiment of the present application;

[0061] Fig.12 A fourth schematic diagram showing a specific application of the algae colony detection method provided in an embodiment of the present application;

[0062] Fig.13 A schematic structural diagram of an algae colony detection device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0063] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments.

[0064] The components of the embodiments of the present application generally described and shown in the drawings herein may be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0065] Hereinafter, the terms "including", "having" and their cognates, which may be used in various embodiments of the present application, are intended only to indicate specific features, numbers, steps, operations, elements, components, or combinations of the foregoing items, and should not be understood as first excluding the existence of one or more other features, numbers, steps, operations, elements, components, or combinations of the foregoing items or adding the possibility of one or more features, numbers, steps, operations, elements, components, or combinations of the foregoing items.

[0066] Furthermore, the terms “first”, “second”, “third”, etc. are merely used for distinguishing descriptions and are not to be understood as indicating or implying relative importance.

[0067] Unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meanings as those generally understood by those skilled in the art to which the various embodiments of the present application belong. The terms (such as those defined in generally used dictionaries) will be interpreted as having the same meanings as the contextual meanings in the relevant technical field and will not be interpreted as having idealized meanings or overly formal meanings unless clearly defined in the various embodiments of the present application.

[0068] Example 1

[0069] The disclosed embodiment provides a method for detecting algae populations.

[0070] For details, see Figure 1 , algae population detection methods include:

[0071] Step S1, obtaining an image to be detected, and detecting the image to be detected according to a preliminary detection model, wherein the preliminary detection model is trained based on algae group samples and algae individual samples;

[0072] In one embodiment, each detection window of the preliminary detection model includes multiple anchor boxes.

[0073] In order to make the network compatible with targets of different scales at the same time, the embodiment of the present application has increased the number of anchor frames of the traditional anchor frame neural network (such as the YOLO series). Taking YOLO V5 as an example, the existing 9 or 12 anchor frame networks are expanded to more than 15 anchor frames, that is, the 3 or 4 different scale networks of Yolo are strengthened to 5 or 6 different scale networks. In real projects, it can also be expanded to feature extraction of more different scales according to actual conditions. For specific network structure, please refer to Figure 2 and Figure 3 , taking YOLO V5 as an example, Figure 2 This is a schematic diagram of the network structure of YOLO V5. Figure 3 It is the network structure of the improved preliminary detection model of the embodiment of the present application. In which, the mark such as 1*256*32*32 in the figure represents the size of the output data obtained by the input data of each block through the structure (block).

[0074] Figure 2 The network structure of YOLO V5 shown in the figure includes the first CBS block, CSP2_3 block, the second CBS block, SPP block, CBS*2 block, CSP1_3 block, CSP1_3 block, CSP1_1 block, the third CBS block, Focus block, and Input block; Input is the input, and Focus is the attention mechanism, which is used to perform a downsampling and reduce the amount of calculation to speed up the network; the role of CSP is to reduce the amount of calculation and memory cost while maintaining the original accuracy; the primary role of the SPP module is to solve the problem of inconsistent input image size; CBS is used to obtain features.

[0075] It also includes a ReSize block connected to the CBS block to change the aspect ratio of the image; the first CBS block is also connected to the fully connected block Concat, the Concat block is connected to the CSP2_3 block, and the CSP2_3 block is connected to the Conv block, the Reshape block, and the Transpose block in sequence. Among them, the Reshape block is the reconstruction layer, and the Transpose block is the transposition layer.

[0076] It also includes a fully connected block Concat connected to the ReSize block and the CSP1_3 block, the Concat block is connected to the CSP2_3 block, the CSP2_3 block is connected to the CBS block, and the CBS block is connected to the Concat block;

[0077] The CBS block is also connected to the ReSize block, the ReSize block is connected to the Concat block, the Concat block is connected to the CSP2_3 block, the CSP2_3 block is connected to the CBS block, the CBS block is connected to the Concat block, the Concat block is connected to the CSP2_3 block, and the CSP2_3 block is connected to the Conv block, the Reshape block, and the Transpose block in sequence.

[0078] The network structure of the preliminary detection model provided in the embodiment of the present application disconnects the current network at the layer with a step size of 16 in the original network structure of YOLO V5, and adds at least one network layer of the same size as the feature map of the previous layer at the disconnection point, and relinks them, thereby achieving stronger detection performance for more anchor frames and samples. Figure 2 The disconnection position of the original network is shown, including 210, 220, and 230. Figure 3 310 in FIG. 1 shows a newly added network layer relative to the original YOLO V5 network structure.

[0079] The embodiment of the present application adds a network layer including a fully connected layer concat, a CSP module (CSP2_3), a CBS module, a conv layer (general convolution layer), a reshape layer, and a transpose layer at the disconnection point, and reconnects them to achieve stronger detection performance of more anchor frames and samples. The structure of this newly added network layer is similar to the structure of the previous layer, so it will not be repeated here, where the previous layer represents a layer close to the input block.

[0080] See also Figure 4 , Figure 4 The specific structure of the CSP1_X block is shown, including multiple CBS blocks for downsampling and channel doubling, X residual blocks, and a fully connected block Concat.

[0081] See also Figure 5 , Figure 5 The specific structure of the Res_x block is shown, including the CBS*2 blocks of the X layer and a multiplication-accumulation unit.

[0082] See also Figure 6 , Figure 6 The specific structure of the CSP2_3 block is shown, including multiple CBS blocks for downsampling and channel doubling, a fully connected block Concat and a CBS*3 block.

[0083] See also Figure 7 , Figure 7 The specific structure of the CBS block is shown, including the convolution layer Conv, the normalization layer BN, and the activation layer SiLu.

[0084] See also Figure 8 , Figure 4 The specific structure of the CSPn_X block is shown, including multiple CBS blocks for channels, size invariant, one X residual blocks and a fully connected block Concat.

[0085] In order to realize the function of preliminary extraction of algae cells, both the algae colony and daughter cells (algae individuals) are calibrated to obtain algae colony samples and algae individual samples, thereby forming an image database as training samples of different categories of neural networks.

[0086] Step S2, outputting a preliminary detection result, wherein the preliminary detection result includes algae colony frame information A, algae individual first frame information set B and algae individual second frame information set C;

[0087] In one embodiment, the algae individual first frame information set B is a set of algae individual frame information whose confidence is greater than or equal to a first confidence threshold, and the algae individual second frame information set C is a set of algae individual frame information whose confidence is less than or equal to a second confidence threshold, wherein the first confidence is greater than the second confidence.

[0088] The output result of the preliminary detection model includes multiple frames and their frame information, wherein the frame information includes but is not limited to category information, location information, size information, angle information, and the confidence of each information. Here, the confidence is mainly used as the criterion for dividing the set. Among them, the first confidence threshold can be set to 0.4-0.6, which is a relatively high confidence. The second confidence threshold can be set to 0.01, which is much smaller than the first confidence threshold.

[0089] The purpose of this step is to prevent missed detection during the initial detection process, because in the actual algae detection, there are many types of algae, such as colony cells and individual cells, some of which are very small and can easily lead to missed detection. Therefore, individuals with very low confidence are first screened out to prepare for subsequent screening through the projection grid to improve accuracy.

[0090] In addition, a lookup table of algae colonies and algae individuals needs to be prepared so that when counting the number of cells, only colony cells containing their corresponding individual cells are counted, and other cells will not be considered as belonging to the colony cells. For example, if the lookup table only stipulates that the colony cells of Aphanizomenon can include Anabaena, Pseudo-Anabaena, Aphanizomenon, etc., then algae that do not belong to these three types of cells will not be counted.

[0091] Step S3, performing position correction on the preliminary detection result to obtain a corrected detection result, wherein the corrected detection result includes corrected group frame information, corrected individual first frame information set and corrected individual second frame information set;

[0092] In one embodiment, the performing position correction on the preliminary detection result to obtain a corrected detection result includes:

[0093] Determining whether the frame position corresponding to the algae colony frame information is horizontal;

[0094] If the frame position corresponding to the algae group frame information is not horizontal, the preliminary detection result is rotated to be horizontal to obtain the modified group frame information A1;

[0095] Obtaining the first minimum bounding rectangle of each frame in the algae individual first frame information set, and determining the set of the first minimum bounding rectangles as the modified individual first frame information set B1;

[0096] The second minimum circumscribed rectangle of each frame in the algae individual second frame information set is obtained, and the set of the second minimum circumscribed rectangles is determined as the corrected individual second frame information set C1.

[0097] See also Fig. 9 , rotate the image along the center point to the horizontal direction corresponding to the corrected group frame information A, record the rotation angle as θ, A, B, C are all rotated synchronously with the image. In common target detection, the output results can be divided into positive frame output and oblique frame output. If it is positive frame output, no position correction is required. Step S3 is mainly applicable to the oblique frame output scenario.

[0098] Step S4, dividing the modified group frame information into a first grid matrix and a second grid matrix;

[0099] In one embodiment, it comprises:

[0100] Obtaining a first average value of long sides of all frames in the corrected individual first frame information set, dividing the corrected group frame information into a plurality of square grids with side lengths equal to the first average value, to obtain the first grid matrix;

[0101] A second average value of the long sides of all frames in the corrected individual second frame information set is obtained, and the corrected group frame information is divided into a plurality of square grids whose side lengths are equal to the second average value to obtain the second grid matrix.

[0102] See also Fig.10 , the resulting grid matrix is ​​similar to a chessboard, s1 is the first average value, and s2 is the second average value.

[0103] Step S5, obtaining a projection of the first frame information set of the corrected individual in the first grid matrix to obtain first projection data;

[0104] In one embodiment, the step of acquiring a projection of the first frame information set of the corrected individual in the first grid matrix to obtain first projection data includes:

[0105] Obtain the intersection area of ​​each frame in the first frame information set of the corrected individual and each grid in the first grid matrix; determine the grid with the largest intersection area as the projection grid corresponding to the frame; and determine the set of all the projection grids as the first projection data.

[0106] Step S6, filling the first projection data to obtain filled projection data;

[0107] The first projection data is usually discontinuous, and in order to avoid missed detection and the like, the first projection data needs to be filled.

[0108] In one embodiment, the filling the first projection data to obtain the filled projection data includes: acquiring two projection data with the shortest distance from the boundary of the first grid matrix in the first projection data, and filling the grids between the two projection data and the boundary of the first grid matrix based on the shortest distance principle to obtain intermediate filled data;

[0109] Obtaining eight connected subgroups in the intermediate filling data;

[0110] The grid where the eight-connected subgroups are located is filled so that all the eight-connected subgroups are eight-connected, thereby obtaining the filled projection data.

[0111] Among them, the eight-connected region means that starting from each pixel in the region, you can reach any pixel in the region by moving in eight directions, namely up, down, left, right, upper left, upper right, lower left, and lower right, without going out of the region. Therefore, during the filling process, if a certain direction is not connected, fill the grid in this direction until all eight-connected subgroups form eight connections.

[0112] Write the first projection data as A s1 . Find A respectively s1 The two grids a closest to the border of A1 s1 ,a s2 , fill a s1 ,a s2 All the grids that need to be passed to the shortest distance point on the boundary are obtained to obtain the new A s1 At this moment, A s1The shaded grids in the figure are not necessarily all 8-connected. Each subgroup that is already 8-connected is considered as a part A. s11 , A s12 ,..A s1n . Find A s11 , A s12 ,..A s1n All eight connected grids that need to be shaded are formed and placed in A s1 Fill in and get a new A s1 .

[0113] Step S7, obtaining the projection of the second frame information set of the corrected individual in the second grid matrix to obtain the second projection data A s2 ;

[0114] The second projection data is obtained in a similar manner to the first projection data, and will not be described in detail here. The second projection data is usually highly continuous, so it does not need to be filled like the first projection data, and the next step can be directly performed.

[0115] Step S8, taking the intersection of the filled projection data and the second projection data to obtain third projection data; s1 With A s2 Find the intersection and get the new projection grid A s .

[0116] Step S9, intersecting the second frame information of the corrected individual and the third projection data to obtain fourth projection data; finding the intersection of C1 and the projection grid A s There are intersecting boxes. Generally, if the intersection area exceeds 0.33, it is considered that C1 intersects with the projected grid.

[0117] At this time, the subset C1 in C1 that intersects with the projected grid will be obtained ∩ , at this time C1 ∩ The number of elements in the matrix is ​​the number of daughter cells in the current algal cell population.

[0118] Step S10, performing position restoration on the fourth projection data to obtain a final detection result.

[0119] Similar to step S3, if the preliminary result is an oblique frame detection, position restoration is performed and C1 ∩ And rotate -θ° along the center point of the image to obtain a new sub-cell frame set C new If it is a positive frame detection, this operation is not necessary. Output C new This is the final detection result for cell population A.

[0120] See also Fig.11 and Fig.12 , Fig.11If there is a missed detection at 610, you can find the missed detection part by looking for the low threshold frame, such as Fig.12 As shown in 710, the missed detection grids are supplemented with low threshold target boxes.

[0121] The embodiment of the present application establishes a projection grid to filter low-threshold targets and find targets that are missed by the initial detection model, thereby greatly improving the accuracy of algae colony detection.

[0122] The algae colony detection method provided in this embodiment expands more anchor frames to obtain stronger target compatibility, and at the same time, by dividing the high threshold set and the low threshold set and the projection grid, it effectively avoids the missed detection of small targets and improves the accuracy of algae colony detection. It does not use traditional image processing methods to avoid interference from impurities such as silt in water samples, and is suitable for algae detection in water bodies with a lot of silt, such as the Yellow River.

[0123] Example 2

[0124] In addition, the present disclosure provides an algae colony detection device, see Fig.13 , the algae colony detection device 800 comprises:

[0125] An acquisition module 810 is used to acquire an image to be detected, and detect the image to be detected according to a preliminary detection model, wherein the preliminary detection model is trained based on algae group samples and algae individual samples;

[0126] The detection module 820 is used to output a preliminary detection result, wherein the preliminary detection result includes algae colony frame information, algae individual first frame information set and algae individual second frame information set;

[0127] A correction module 830 is used to perform position correction on the preliminary detection result to obtain a corrected detection result, wherein the corrected detection result includes corrected group frame information, corrected individual first frame information set and corrected individual second frame information set;

[0128] A segmentation module 840 is used to segment the modified group frame information into a first grid matrix and a second grid matrix;

[0129] A first projection module 850 is used to obtain a projection of the first frame information set of the corrected individual in the first grid matrix to obtain first projection data;

[0130] A filling module 860 is used to fill the first projection data to obtain filled projection data;

[0131] A second projection module 870 is used to obtain a projection of the second frame information set of the corrected individual in the second grid matrix to obtain second projection data;

[0132] A first operation module 880 is used to obtain the third projection data by taking the intersection of the filled projection data and the second projection data;

[0133] A second operation module 890 is used to obtain the fourth projection data by taking the intersection of the second frame information of the corrected individual and the third projection data;

[0134] The restoration module 900 is used to restore the position of the fourth projection data to obtain a final detection result.

[0135] The algae colony detection device provided in this embodiment can implement the algae colony detection method provided in Example 1, and will not be described again here to avoid repetition.

[0136] The algae colony detection device provided in this embodiment expands more anchor frames to obtain stronger target compatibility, and at the same time, by dividing the high threshold set and the low threshold set and the projection grid, it effectively avoids missing small targets and improves the accuracy of algae colony detection. It does not use traditional image processing methods to avoid interference from impurities such as silt in water samples, and is suitable for algae detection in water bodies with a lot of silt, such as the Yellow River.

[0137] Example 3

[0138] In addition, an embodiment of the present disclosure provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program runs on the processor, the algae colony detection method provided in Example 1 is executed.

[0139] The electronic device provided in the embodiment of the present invention can implement the algae colony detection method provided in Example 1, which will not be described again here to avoid repetition.

[0140] The electronic device provided in this embodiment expands more anchor frames to obtain stronger target compatibility, and at the same time, by dividing the high threshold set and the low threshold set and the projection grid, it effectively avoids missing small targets and improves the accuracy of algae group detection. It does not use traditional image processing methods to avoid interference from impurities such as silt in water samples, and is suitable for algae detection in water bodies with a lot of silt, such as the Yellow River.

[0141] Example 4

[0142] The present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the algae colony detection method provided in Example 1 is implemented.

[0143] In this embodiment, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0144] The computer-readable storage medium provided in this embodiment can implement the algae colony detection method provided in Example 1, and will not be described again here to avoid repetition.

[0145] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or terminal including the element.

[0146] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0147] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose and protection scope of the present application, all of which are within the protection of the present application.

Claims

1. A method for detecting algae populations, characterized in that: The method comprises: Acquire an image to be detected, and detect the image to be detected according to a preliminary detection model, wherein the preliminary detection model is trained based on algae group samples and algae individual samples; Outputting a preliminary detection result, wherein the preliminary detection result includes algae colony frame information, a first frame information set of algae individuals, and a second frame information set of algae individuals; Performing position correction on the preliminary detection result to obtain a corrected detection result, wherein the corrected detection result includes corrected group frame information, corrected individual first frame information set, and corrected individual second frame information set; dividing the modified group frame information into a first grid matrix and a second grid matrix; Acquire the projection of the first frame information set of the corrected individual in the first grid matrix to obtain first projection data; Filling the first projection data to obtain filled projection data; Acquire the projection of the second frame information set of the corrected individual in the second grid matrix to obtain second projection data; Taking the intersection of the filled projection data and the second projection data to obtain third projection data; Taking the intersection of the second frame information of the corrected individual and the third projection data to obtain fourth projection data; Performing position restoration on the fourth projection data to obtain a final detection result; The first frame information set of algae individuals is a set of algae individual frame information with a confidence greater than or equal to a first confidence threshold, and the second frame information set of algae individuals is a set of algae individual frame information with a confidence less than or equal to a second confidence threshold, wherein the first confidence is greater than the second confidence; The step of dividing the modified group frame information into a first grid matrix and a second grid matrix comprises: Obtaining a first average value of long sides of all frames in the corrected individual first frame information set, dividing the corrected group frame information into a plurality of square grids with side lengths equal to the first average value, to obtain the first grid matrix; A second average value of the long sides of all frames in the corrected individual second frame information set is obtained, and the corrected group frame information is divided into a plurality of square grids whose side lengths are equal to the second average value to obtain the second grid matrix.

2. The algae colony detection method according to claim 1, characterized in that: The performing position correction on the preliminary detection result to obtain a corrected detection result includes: Determining whether the frame position corresponding to the algae colony frame information is horizontal; If the frame position corresponding to the algae population frame information is not horizontal, rotating the preliminary detection result to be horizontal to obtain the corrected population frame information; Acquire the first minimum bounding rectangle of each frame in the first frame information set of the algae individual, and determine the set of the first minimum bounding rectangles as the revised individual first frame information set; The second minimum bounding rectangle of each frame in the second frame information set of the algae individual is obtained, and the set of the second minimum bounding rectangles is determined as the revised individual second frame information set.

3. The algae colony detection method according to claim 1, characterized in that: The acquiring the projection of the first frame information set of the corrected individual in the first grid matrix to obtain first projection data includes: Obtaining the intersection area between each frame in the first frame information set of the corrected individual and each grid in the first grid matrix; Determine the grid with the largest intersection area as the projection grid corresponding to the frame; A set of all the projection grids is determined as the first projection data.

4. The algae colony detection method according to claim 3, characterized in that: The filling the first projection data to obtain filled projection data includes: Acquire two projection data with the shortest distance from the boundary of the first grid matrix in the first projection data, and fill the grids between the two projection data and the boundary of the first grid matrix based on the shortest distance principle to obtain intermediate filling data; Obtaining eight connected subgroups in the intermediate filling data; The grid where the eight-connected subgroups are located is filled so that all the eight-connected subgroups are eight-connected, thereby obtaining the filled projection data.

5. The algae colony detection method according to claim 1, characterized in that: Each detection window of the preliminary detection model includes multiple anchor boxes.

6. An algae colony detection device, characterized in that: The device comprises: An acquisition module, used for acquiring an image to be detected, and detecting the image to be detected according to a preliminary detection model, wherein the preliminary detection model is trained based on algae group samples and algae individual samples; A detection module, configured to output a preliminary detection result, wherein the preliminary detection result includes algae colony frame information, a first frame information set of algae individuals, and a second frame information set of algae individuals; the first frame information set of algae individuals is a set of algae individual frame information having a confidence greater than or equal to a first confidence threshold, and the second frame information set of algae individuals is a set of algae individual frame information having a confidence less than or equal to a second confidence threshold, wherein the first confidence is greater than the second confidence; A correction module, used for performing position correction on the preliminary detection result to obtain a corrected detection result, wherein the corrected detection result includes corrected group frame information, corrected individual first frame information set and corrected individual second frame information set; a segmentation module, configured to segment the modified group frame information into a first grid matrix and a second grid matrix; obtain a first average value of the long sides of all frames in the modified individual first frame information set, segment the modified group frame information into a plurality of square grids with a side length equal to the first average value, and obtain the first grid matrix; obtain a second average value of the long sides of all frames in the modified individual second frame information set, segment the modified group frame information into a plurality of square grids with a side length equal to the second average value, and obtain the second grid matrix; A first projection module, used for acquiring a projection of the first frame information set of the corrected individual in the first grid matrix to obtain first projection data; A filling module, used for filling the first projection data to obtain filled projection data; A second projection module, used for acquiring a projection of the second frame information set of the corrected individual in the second grid matrix to obtain second projection data; A first operation module, configured to obtain the third projection data by taking the intersection of the filled projection data and the second projection data; A second operation module is used to obtain the fourth projection data by taking the intersection of the second frame information of the corrected individual and the third projection data; The restoration module is used to restore the position of the fourth projection data to obtain a final detection result.

7. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the algae population detection method according to any one of claims 1 to 5 is executed.

8. A computer-readable storage medium, characterized in that: The device stores a computer program, which executes the algae population detection method according to any one of claims 1 to 5 when running on a processor.