Alga target detection method, system and device based on deep learning

Through the deep learning-based algae object detection method, the optimized YOLO object detection model is used to detect and post-process the water body image data, which solves the problems of low algae detection accuracy and high error detection rate in the existing technology, and realizes the Efficient and accurate algae detection.

CN119478651APending Publication Date: 2025-02-18HUAYU ECOLOGICAL ENVIRONMENT TECHNOLOGY (TIANJIN) CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411728406.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

The prior art has problems in algae detection with low detection accuracy and high error detection rate, and the deep learning model has not been specifically optimized for algae detection, which is difficult to meet the practical application needs.

Method used

Using the deep learning-based algae object detection method, water body image data is collected through image sensing equipment, pre-processed and small target split, and the optimized YOLO object detection model is trained to target detection and post-process the measured image data. Generate standardized results.

Benefits of technology

It significantly improves the degree of automation and detection accuracy of algae detection, reduces the false detection rate, is suitable for real-time monitoring and analysis of complex water environments, reduces manual intervention, and improves detection efficiency and effectiveness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119478651A_ABST
    Figure CN119478651A_ABST
Patent Text Reader

Abstract

The invention provides an algae target detection method, system and device based on deep learning, and relates to the field of computer vision environment monitoring, and the method mainly comprises the steps: collecting the image data of a water body through an image sensing device; splitting and preprocessing the image data according to a preset size; performing small target splitting and data enhancement on the training image data; based on the training image data, training the optimized YOLO target detection model; and performing target detection on the detected image data through the trained YOLO target detection model to obtain a detection result. According to the scheme, by introducing and optimizing a YOLO series algorithm, the automation degree and the detection precision of algae detection can be remarkably improved; according to the scheme, algae target detection and classification can be accurately and efficiently carried out in complex water backgrounds and various algae environments, and the false detection rate can be effectively reduced; the scheme is suitable for real-time monitoring and analysis scenes of a large-scale and complex water body environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer vision environment monitoring, and in particular to an algae target detection method, system and device based on deep learning. Background Art

[0002] The detection and monitoring of algae are of great significance in environmental protection and water resource management. Traditional algae detection methods mainly rely on manual sampling and microscopic observation, which are inefficient and susceptible to human errors.

[0003] Although the development of image processing technology has improved algae detection methods, these methods usually rely on artificial experience to design features, such as morphological features, color features, and texture features. This method not only requires a lot of professional knowledge, but also has strong subjectivity and is difficult to cope with complex and changeable algae morphology and environmental conditions.

[0004] With the gradual development of deep learning technology, computer vision technology has been widely used in various image detection tasks. In particular, the YOLO (You Only Look Once) series of algorithms have performed well in various application scenarios due to their efficient target detection capabilities.

[0005] However, existing technologies still have some defects when applied to algae detection. For example, the traditional YOLO algorithm may have problems with low detection accuracy and high false detection rate when dealing with complex backgrounds and multiple types of algae targets. In addition, most existing deep learning models are general models that have not been specifically optimized for algae detection and are difficult to fully meet the needs of actual applications.

[0006] At the same time, special equipment for long-term photography and detection of underwater algae is still in the product gap stage. How to combine underwater cameras or image sensing equipment such as microscopes to conduct long-term photography and detection of underwater algae has also become an important technical issue that needs to be urgently solved in the industry. Summary of the invention

[0007] The object of the present invention is to provide an algae target detection method, system and device based on deep learning to solve at least one of the above-mentioned technical problems existing in the prior art.

[0008] In a first aspect, in order to solve the above technical problems, the present invention provides an algae target detection method based on deep learning, comprising the following steps:

[0009] Step 1: Collect image data of water bodies through image sensing equipment; the image data includes training image data and measured image data; the training image data is marked with algae species and actual scenes;

[0010] Step 2: split the image data according to the preset size to meet the requirements of the subsequent target detection model; pre-process the image data to improve the image quality and visibility of the algae target for subsequent processing;

[0011] Step 3, splitting the training image data into small targets; the small target refers to a target when the actual size of the algae target instance is smaller than the preset algae size, and the ratio between the actual size and the size of the entire image is smaller than the preset size ratio;

[0012] Step 4: Based on the training image data, train the optimized YOLO target detection model; perform target detection on the image data to be tested through the trained YOLO target detection model to obtain a detection result; the detection result includes the location of the algae and the category of the algae at the corresponding location;

[0013] Step 5: Post-process the test results to generate unified standardized results for subsequent analysis and visualization.

[0014] Through the above method, in the field of algae target detection, based on computer vision technology, the YOLO series of algorithms were introduced and optimized, which can automatically extract various complex and changeable algae features (morphological features, color features, texture features, etc.), improve detection efficiency and reduce the impact of human errors.

[0015] In a feasible implementation manner, the image sensing device in step 1 includes an underwater camera.

[0016] In a feasible implementation manner, the preprocessing method in step 2 includes noise reduction, image enhancement, image segmentation and background noise removal.

[0017] In a feasible implementation manner, step 3 specifically includes:

[0018] Step 31, (in the laboratory) classify and cultivate each known species of algae, and record the cultivation images and categories of these algae at each growth stage, so as to reduce the workload and cost of subsequent data annotation; the categories include species, size, morphology and color;

[0019] Step 32: based on the culture image and part of the labeled training image data, modify the category labels of all algae to one, and train a single-category algae detection model (such as a YOLO target detection model); based on the single-category algae detection model, detect the culture image to obtain the location of each algae target and associate it with the algae category recorded in the laboratory;

[0020] Step 33, segmenting the culture image according to the algae instance through the SAM segmentation model to obtain an algae entity image, which is conducive to retaining the algae entity in the target frame as much as possible; and performing mask processing on the non-algae part of the culture image; the mask processing includes occluding representation through a transparent channel;

[0021] Step 34, randomly map the algae entity image to the training image data or the corresponding blank water area image data, and record the mapping position to obtain a training sample; based on a preset algae size (the pixel size or area occupied) and a preset size ratio, filter the training sample for small target algae to obtain a small target algae training sample; in this way, a large amount of pseudo-labeled data of different types of algae at various growth stages in a simulated real scene can be easily obtained, thereby eliminating the need to rely on manual re-labeling, saving manpower and improving efficiency.

[0022] In a feasible implementation manner, the training samples further include impurity samples; the impurity samples refer to samples obtained by marking suspected algae areas and non-algae characteristic significant areas as impurity areas in the training image data and processing them in two ways respectively:

[0023] Method 1: Fill the impurity area with a mask, where the pixel value of the mask is the color mean of the entire training image;

[0024] Method 2: Remove the mark of the impurity area and regard the impurity area as the image background;

[0025] This can enrich the training samples, reduce the interference of impurity areas such as suspected algae on the YOLO target detection model, and improve the false detection rate of the YOLO target detection model.

[0026] In a feasible implementation, the step 3 also includes step 35, performing data enhancement on the training samples, and the data enhancement specifically includes: adding noise to a preset proportion of training samples and / or blurring a preset proportion of training samples and / or simulating lighting processing on a preset proportion of training samples and / or performing algae color enhancement operations on a preset proportion of training samples, etc.; this can enrich the training samples, thereby enhancing the generalization ability of the target detection model after training, and further improving the false detection rate of the YOLO target detection model.

[0027] In a feasible implementation, the YOLO target detection model in step 4 is specifically a PPYOLOE_Plus model.

[0028] Of course, in other embodiments, similar target detection models such as YOLOV8 and YOLO 11 may also be used.

[0029] In a feasible implementation, the specific detection process of the PPYOLOE_Plus model includes: extracting the characteristic information of algae in the image data under test through the Backbone network; then based on the characteristic information, performing target detection and classification of algae to obtain target frame coordinates and categories; based on the target frame coordinates and categories, calculating the probability that each target frame coordinate corresponds to different categories, taking the category corresponding to the maximum probability as the category corresponding to the target frame coordinate, and obtaining a merged result; then performing non-maximum suppression filtering on the merged result through the NMS algorithm to obtain the final detection result.

[0030] In a feasible implementation, double-branch detection can also be performed using the PPYOLOE_Plus model, and the specific method is as follows:

[0031] Step 41, training the first PPYOLOE_Plus model using small target algae training samples;

[0032] Step 42: train the second PPYOLOE_Plus model using the original training samples;

[0033] Step 43, in the inference stage, the same image data to be tested is subjected to target detection through the first PPYOLOE_Plus model and the second PPYOLOE_Plus model respectively to obtain a first detection result and a second detection result; the two detection results are merged and then filtered by non-maximum suppression using the NMS algorithm to obtain the final detection result; this can reduce the probability of missing small-sized algae targets when detecting a variety of algae targets with large size differences, thereby obtaining a more accurate detection result.

[0034] In a feasible implementation, the post-processing in step 5 includes performing statistical analysis on the detection results of the YOLO target detection model, specifically including the Shannon-Wiener Diversity Index and / or the Margalef richness index and / or the Pielou evenness index and / or the Simpson ecological dominance index.

[0035] In a feasible implementation manner, the calculation formula of the Shannon Weiner diversity index is specifically:

[0036]

[0037] Among them, H′ represents the Shannon Weiner diversity index, which is used to express the richness and uniformity of algae distribution. The more algae there are and the more uniform their distribution, the larger the index is, and the higher the community diversity is; s represents the number of algae categories; p iIt represents the relative abundance of the i-th algae (i.e. the proportion of the number of individuals of this algae to the total number of individuals).

[0038] In a feasible implementation manner, the specific calculation formula of the Margalef richness index is:

[0039]

[0040] Where D represents the Margalef richness index, which is used to measure the category richness in the algal community. That is, it does not consider the relative abundance between algal categories, but only focuses on the number of algal categories. This index is more sensitive to changes in sample size; s represents the number of algal categories; N represents the total number of individuals of all algae in the community.

[0041] In a feasible implementation manner, the specific calculation formula of the Pielou uniformity index is:

[0042]

[0043] Wherein, J′ represents the Pielou evenness index, which reflects the evenness of algae distribution in the community: when all algae are evenly distributed, the J′ value is 1; otherwise (i.e., a few algae are dominant), the J′ value is less than 1; H′ represents the Shannon Weiner diversity index; H′ max It represents the maximum Shannon Weiner diversity index value that can be achieved under a given number of algae categories S and the same total number of individuals. The specific calculation formula when all algae categories are evenly distributed is: H′ max =ln(S).

[0044] In a feasible implementation, the specific calculation formula of the Simpson ecological dominance index is:

[0045]

[0046] Where D′ represents the Simpson ecological dominance index, which reflects the concentration of dominant algae in the community: if the dominant algae in the community is more prominent and the diversity is lower, the D′ value is closer to 1; conversely, the more uniform the distribution of algae in the community and the higher the diversity, the D′ value is less than 1; S represents the number of algae categories; p i represents the relative abundance of the i-th algae (i.e. the proportion of the number of individuals of this algae to the total number of individuals);

[0047] Preferably, the Simpson ecological dominance index also includes an inverse Simpson index, and the value of the inverse Simpson index is the reciprocal of the Simpson ecological dominance index; the inverse Simpson index directly reflects the degree of algae diversity, and the larger the inverse Simpson index, the higher the degree of algae diversity.

[0048] In a second aspect, based on the same inventive concept, the present application also provides an algae target detection system based on deep learning, including a client and a server;

[0049] The client comprises an interaction unit and a first communication unit;

[0050] The interactive unit is used to receive image data of the water body and detection model parameters, and feed back detection results; the image data includes training image data and detected image data; the training image data is marked with algae species and actual scenes;

[0051] The server includes a second communication unit, a preprocessing unit, a feature extraction unit, an online detection model unit and a post-processing unit;

[0052] The second communication unit is used to exchange information with the first communication unit of the client;

[0053] The preprocessing unit is used to split the image data according to a preset size and perform preprocessing;

[0054] The feature extraction unit performs small target segmentation on the training image data; the small target refers to a target when the actual size of the algae target instance is smaller than the preset algae size, and the ratio between the actual size and the size of the entire image is smaller than the preset size ratio;

[0055] The online detection model unit trains an optimized YOLO target detection model based on the training image data; performs target detection on the image data to be tested through the trained YOLO target detection model to obtain a detection result; the detection result includes the location and category of the algae;

[0056] The post-processing unit is used to post-process the detection result to generate a standardized result.

[0057] In a feasible implementation, the client further includes an offline detection model unit, which is used to download the trained YOLO target detection model to the client through double encryption to perform offline detection of algae targets.

[0058] In a feasible implementation, the double encryption includes inner encryption and outer encryption:

[0059] The inner encryption is to encrypt the YOLO target detection model according to the CPU_ID number and hard disk serial number transmitted by the WEB website, combined with the inner encryption strategy; the inner encryption strategy includes the first MD5 function, which is specifically defined as follows:

[0060] MD5(CPU_ID+hard disk serial number+"other characters");

[0061] The outer layer encryption is to encrypt the compressed package (e.g., ZIP package) of the YOLO target detection model according to the model name and the creation date of the current compressed package of the model, combined with the outer layer encryption strategy; the outer layer encryption strategy includes a second MD5 function, which is specifically defined as follows:

[0062] MD5(model name + creation date + "other characters").

[0063] Preferably, during encryption, the calculation results of each MD5 function are dynamically written into the YOLO target detection model and the compressed file through a third-party encryption library;

[0064] During decryption, the encrypted file is directly read in the memory without downloading it to the local hard disk, so that the encrypted file can be cracked; the same MD5 function dynamic calculation is performed locally to obtain the key; the key is string matched with the calculation result: if it matches, the decryption is successful; if it does not match, the decryption fails.

[0065] In a feasible implementation manner, the client is a C++ desktop client.

[0066] On the third aspect, based on the same inventive concept, the present application also provides an algae target detection device based on deep learning, including a processor, a memory and a bus, the memory stores instructions and data read by the processor, the processor is used to call the instructions and data in the memory to execute the algae target detection method based on deep learning as described above, and the bus connects the functional components for transmitting information.

[0067] In a feasible implementation manner, the apparatus further includes an image sensing device for collecting image data of the water body.

[0068] In a feasible implementation manner, the image sensing device is an underwater camera.

[0069] In a feasible implementation manner, the device further includes a display screen for displaying the detection results.

[0070] In a feasible implementation manner, the device further includes a communication module, including a wireless communication module or a wired communication module, for realizing long-distance transmission of data.

[0071] By adopting the above technical solution, the present invention has the following beneficial effects:

[0072] The present invention provides an algae target detection method, system and device based on deep learning, which can significantly improve the automation level and detection accuracy of algae detection by introducing and optimizing the YOLO series algorithms; the scheme can accurately and efficiently detect and classify algae targets in complex water backgrounds and various algae environments, and can effectively reduce the false detection rate; the scheme is suitable for real-time monitoring and analysis scenarios of large-scale and complex water environments, and can effectively reduce the influence of human intervention, thereby improving the efficiency and effectiveness of subsequent water quality monitoring and environmental protection work; the scheme can perform both online and offline detection, is flexible and convenient to use, and has good data confidentiality. BRIEF DESCRIPTION OF THE DRAWINGS

[0073] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0074] Figure 1 A flow chart of an algae target detection method based on deep learning provided by an embodiment of the present invention;

[0075] Figure 2 for Figure 1 Flowchart of step 3 in ;

[0076] Figure 3 A double branch detection flow chart provided by an embodiment of the present invention;

[0077] Figure 4 A diagram of an algae target detection system based on deep learning provided by an embodiment of the present invention;

[0078] Figure 5 A three-dimensional structural diagram of an algae target detection device based on deep learning provided by an embodiment of the present invention;

[0079] Figure 6 for Figure 5 The main view;

[0080] Figure 7 A bottom view of a floating portion provided by an embodiment of the present invention;

[0081] Figure 8 A three-dimensional diagram of a photographing unit provided by an embodiment of the present invention;

[0082] Fig. 9 for Figure 8A three-dimensional partial cross-sectional view of

[0083] Fig.10 A front view of a photographing unit provided by an embodiment of the present invention;

[0084] Fig.11 for Fig.10 A front cross-sectional view of

[0085] Fig.12 for Fig.10 A top sectional view of

[0086] Fig.13 A diagram illustrating the scanning principle of a photographing unit provided in an embodiment of the present invention;

[0087] Reference numerals:

[0088] 1-floating part; 11-solar panel; 12-control part; 121-first wiring harness socket; 13-hanging ear; 2-shooting part; 21-second wiring harness socket; 22-water inlet; 23-motor; 231-rotating plate; 232-first camera; 233-second camera; 24-transparent plate; 25-water outlet; 26-third wiring harness socket; 27-sample pool; 28-light-emitting panel; 3-anchor body; 4-waterproof wiring harness; 5-chain. DETAILED DESCRIPTION

[0089] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0090] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.

[0091] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0092] The present invention is further explained below in conjunction with specific implementation modes.

[0093] It should also be noted that the following specific embodiments or specific implementations are a series of optimized settings listed in the present invention to further explain the specific content of the invention, and these settings can be used in combination or in association with each other.

[0094] Embodiment 1:

[0095] like Figure 1 As shown, this embodiment provides an algae target detection method based on deep learning, comprising the following steps:

[0096] Step 1: Collect image data of water bodies (resolution is 2w*2w=400 million pixels) through image sensing equipment; the image data includes training image data and tested image data; the training image data is marked with algae species and actual scenes;

[0097] Step 2: Split the image data according to a preset size (the resolution of the split single image is 2k*2k=400W pixels) to meet the requirements of the subsequent target detection model; pre-process the image data to improve the image quality and visibility of the algae target for subsequent processing;

[0098] Step 3, splitting the training image data into small targets; the small target refers to a target when the actual size of the algae target instance is smaller than the preset algae size, and the ratio between the actual size and the size of the entire image is smaller than the preset size ratio;

[0099] Step 4: Based on the training image data, train the optimized YOLO target detection model; perform target detection on the image data to be tested through the trained YOLO target detection model to obtain a detection result; the detection result includes the location of the algae and the category of the algae at the corresponding location;

[0100] Step 5: Post-process the test results to generate unified standardized results for subsequent analysis and visualization.

[0101] Through the above method, in the field of algae target detection, based on computer vision technology, the YOLO series of algorithms were introduced and optimized, which can automatically extract various complex and changeable algae features, improve detection efficiency and reduce the impact of human errors.

[0102] Furthermore, the image sensing device in step 1 includes an underwater camera.

[0103] Furthermore, the preprocessing method in step 2 includes noise reduction, image enhancement, image segmentation and background noise removal.

[0104] Furthermore, if Figure 2 As shown, step 3 specifically includes:

[0105] Step 31: In a laboratory environment, various known algae species are classified and cultured in culture containers, and the culture images and categories of these algae at various growth stages are recorded, thereby reducing the workload and cost of subsequent data annotation; the categories include species, size, morphology and color;

[0106] Step 32: based on the culture image and part of the labeled training image data, after modifying the category labels of all algae to one, a single-category algae detection model (such as a YOLO target detection model) is trained; based on the single-category algae detection model, the culture image is detected to obtain the position of each algae target and associate it with the algae category recorded in the laboratory; in this way, there is no need to tediously label the category of the culture image;

[0107] Step 33, segmenting the culture image according to the algae instance through the SAM segmentation model to obtain a pixel-level algae entity image, which is conducive to retaining the algae entity in the target frame as much as possible; and performing mask processing on the non-algae part of the culture image; the mask processing includes occlusion representation through a transparent channel; the SAM segmentation model is a basic image segmentation model trained by Facebook on one billion masks of 11 million images;

[0108] Step 34, randomly map the algae entity image (for example, by using the mapping method in the OpenCV library: binarization and inversion operation) to the training image data or the corresponding blank water area image data, and record the mapping position to obtain a training sample; based on a preset algae size (the pixel size or area occupied) and a preset size ratio, filter the training sample for small target algae to obtain a small target algae training sample; in this way, algae data with a known category, a known target position, and different growth stages can be obtained to constitute new training data, and data can be generated in large quantities, thereby making up for the problems of insufficient total data, difficulty in collecting data at different growth stages in a real environment, and time-consuming and costly labeling.

[0109] Through the above method, a large number of training samples with known algae categories and fine classification can be automatically obtained without relying on manual re-labeling, thereby saving manpower and labeling costs, improving efficiency, and helping to enhance the adaptability of subsequent YOLO target detection models to different water environments.

[0110] Furthermore, the training samples also include impurity samples; the impurity samples refer to samples obtained by marking suspected algae areas and non-algae feature-significant areas as impurity areas in the training image data and processing them in two ways:

[0111] Method 1: Fill the impurity area with a mask, where the pixel value of the mask is the color mean of the entire training image;

[0112] Method 2: Remove the mark of the impurity area and regard the impurity area as the image background;

[0113] This can enrich the training samples, reduce the interference of impurity areas such as suspected algae on the YOLO target detection model, and improve the false detection rate of the YOLO target detection model.

[0114] Furthermore, if Figure 2 As shown, step 3 also includes step 35, performing data enhancement on the training samples, and the data enhancement specifically includes: adding noise to a preset proportion of training samples and / or blurring a preset proportion of training samples and / or simulating lighting processing on a preset proportion of training samples and / or performing algae color enhancement operations on a preset proportion of training samples, etc.; this can enrich the training samples, thereby enhancing the generalization ability of the target detection model after training, and further improving the false detection rate of the YOLO target detection model.

[0115] Furthermore, the YOLO target detection model in step 4 is a PPYOLOE_Plus model, and the specific detection process includes: extracting the characteristic information of algae in the image data under test through the Backbone backbone network; then based on the characteristic information, performing target detection and classification of algae to obtain the target frame coordinates and categories; based on the target frame coordinates and categories, calculating the probability that each target frame coordinate corresponds to different categories, taking the category corresponding to the maximum probability as the category corresponding to the target frame coordinate, thereby completing the merging and obtaining the merged result; then performing non-maximum suppression filtering on the merged result through the NMS (Non-Maximum Suppression) algorithm to obtain the final detection result.

[0116] Furthermore, if Figure 3 As shown, dual-branch detection can also be performed through the PPYOLOE_Plus model. The specific method is:

[0117] Step 41, training the first PPYOLOE_Plus model using small target algae training samples;

[0118] Step 42: train the second PPYOLOE_Plus model using the original training samples;

[0119] Step 43, in the inference stage, the same image data to be tested is subjected to target detection through the first PPYOLOE_Plus model and the second PPYOLOE_Plus model respectively to obtain a first detection result and a second detection result; the two detection results are merged and then filtered by non-maximum suppression using the NMS algorithm to obtain the final detection result; this can reduce the probability of missing small-sized algae targets when detecting a variety of algae targets with large size differences, thereby obtaining a more accurate detection result.

[0120] Furthermore, the evaluation indicators of the PPYOLOE_Plus model include mean average precision (mAP).

[0121] Furthermore, the post-processing in step 5 includes performing statistical analysis on the detection results of the YOLO target detection model, specifically including the Shannon-Wiener Diversity Index and / or the Margalef richness index and / or the Pielou evenness index and / or the Simpson ecological dominance index.

[0122] Furthermore, the calculation formula of the Shannon Weiner diversity index is specifically as follows:

[0123]

[0124] Among them, H′ represents the Shannon Weiner diversity index, which comprehensively considers the richness and uniformity of algae distribution. The more algae there are and the more uniform their distribution, the larger the index is, and the higher the community diversity is; S represents the number of algae categories; p i It represents the relative abundance of the i-th algae (i.e. the proportion of the number of individuals of this algae to the total number of individuals).

[0125] Furthermore, the specific calculation formula of the Margalef richness index is:

[0126]

[0127] Among them, D represents the Margalef richness index, which is used to measure the category richness in the algal community. That is, it does not consider the relative abundance between algal categories, but only focuses on the number of algal categories. This index is more sensitive to changes in sample size; S represents the number of algal categories; N represents the total number of individuals of all algae in the community.

[0128] Furthermore, the specific calculation formula of the Pielou uniformity index is:

[0129]

[0130] Wherein, J′ represents the Pielou evenness index, which reflects the evenness of algae distribution in the community: when all algae are evenly distributed, the J′ value is 1; otherwise (i.e., a few algae are dominant), the J′ value is less than 1; H′ represents the Shannon Weiner diversity index; H′ max It represents the maximum Shannon Weiner diversity index value that can be achieved under a given number of algae categories S and the same total number of individuals. The specific calculation formula when all algae categories are evenly distributed is: H′ max =ln(S).

[0131] Furthermore, the specific calculation formula of the Simpson ecological dominance index is:

[0132]

[0133] Where D′ represents the Simpson ecological dominance index, which reflects the concentration of dominant algae in the community: if the dominant algae in the community is more prominent and the diversity is lower, the D′ value is closer to 1; conversely, the more evenly the algae are distributed in the community and the higher the diversity, the D′ value is less than 1; s represents the number of algae categories; p i represents the relative abundance of the i-th algae (i.e. the proportion of the number of individuals of this algae to the total number of individuals);

[0134] Preferably, the Simpson ecological dominance index also includes an inverse Simpson index, and the value of the inverse Simpson index is the reciprocal of the Simpson ecological dominance index; the inverse Simpson index directly reflects the degree of algae diversity, and the larger the inverse Simpson index, the higher the degree of algae diversity.

[0135] Embodiment 2:

[0136] like Figure 4 As shown, this embodiment provides an algae target detection system based on deep learning, including a client and a server;

[0137] The client comprises an interaction unit and a first communication unit;

[0138] The interactive unit is used to receive image data of the water body and detection model parameters, and feed back detection results; the image data includes training image data and detected image data; the training image data is marked with algae species and actual scenes;

[0139] The server includes a second communication unit, a preprocessing unit, a feature extraction unit, an online detection model unit and a post-processing unit;

[0140] The second communication unit is used to exchange information with the first communication unit of the client;

[0141] The preprocessing unit is used to split the image data according to a preset size and perform preprocessing;

[0142] The feature extraction unit performs small target segmentation on the training image data; the small target refers to a target when the actual size of the algae target instance is smaller than the preset algae size, and the ratio between the actual size and the size of the entire image is smaller than the preset size ratio;

[0143] The online detection model unit trains an optimized YOLO target detection model based on the training image data; performs target detection on the image data to be tested through the trained YOLO target detection model to obtain a detection result; the detection result includes the location and category of the algae;

[0144] The post-processing unit is used to post-process the detection result to generate a standardized result.

[0145] Furthermore, the client also includes an offline detection model unit, which is used to download the trained YOLO target detection model to the client through double encryption to perform offline detection of algae targets.

[0146] Furthermore, the double encryption includes inner encryption and outer encryption:

[0147] The inner encryption is to encrypt the YOLO target detection model according to the CPU_ID number and hard disk serial number transmitted by the WEB website, combined with the inner encryption strategy; the inner encryption strategy includes the first MD5 function, which is specifically defined as follows:

[0148] MD5(CPU_ID+hard disk serial number+"other characters");

[0149] The outer layer encryption is to encrypt the compressed package (e.g., ZIP package) of the YOLO target detection model according to the model name and the creation date of the current compressed package of the model, combined with the outer layer encryption strategy; the outer layer encryption strategy includes a second MD5 function, which is specifically defined as follows:

[0150] MD5(model name + creation date + "other characters").

[0151] Preferably, during encryption, the calculation results of each MD5 function are dynamically written into the YOLO target detection model and the compressed file through a third-party encryption library;

[0152] During decryption, the encrypted file is directly read in the memory without downloading it to the local hard disk, so that the encrypted file can be cracked; the same MD5 function dynamic calculation is performed locally to obtain the key; the key is string matched with the calculation result: if it matches, the decryption is successful; if it does not match, the decryption fails.

[0153] Furthermore, the client is a C++ desktop client.

[0154] Embodiment three:

[0155] The present embodiment provides an algae target detection device based on deep learning, including a processor, a memory and a bus, wherein the memory stores instructions and data read by the processor, the processor is used to call the instructions and data in the memory to execute the algae target detection method based on deep learning as described above, and the bus connects the functional components for transmitting information.

[0156] Furthermore, the device also includes an image sensing device for collecting image data of the water body.

[0157] Furthermore, the image sensing device is an underwater camera.

[0158] Furthermore, the device also includes a display screen for displaying the detection results.

[0159] Furthermore, the device also includes a communication module, including a wireless communication module or a wired communication module, for realizing long-distance transmission of data.

[0160] Embodiment 4:

[0161] like Figure 5-6 As shown, this embodiment provides an algae target detection device based on deep learning, including a floating part 1, a shooting part 2, an anchor body 3, a waterproof harness 4 and a chain 5;

[0162] The floating part 1 is used to float on the water surface;

[0163] A control unit 12 is provided at the center of the bottom of the floating unit 1, including a processor, a memory and a bus. The memory stores instructions and data read by the processor. The processor is used to call the instructions and data in the memory to execute the algae target detection method based on deep learning as described above. The bus connects the functional components to transmit information.

[0164] A solar panel 11 is provided on the top of the floating part 1 to supply power to the device;

[0165] A shooting unit 2 is provided below the floating unit 1 for shooting image data of the water body; the shooting unit 2 is electrically connected to the control unit 12 through a waterproof harness 4 for power supply and data exchange;

[0166] An anchor body 3 is provided below the photographing unit 2, which is used to position the device at a preset position in the water area; the two chains 5 are respectively connected in sequence to the two hanging ears 13 of the floating unit 1, the two hanging ears of the photographing unit 2 and the lifting ring of the anchor body 3, which are used to connect the floating unit 1, the photographing unit 2 and the anchor body 3 and fix them in sections;

[0167] Through the above structure, the device can be deployed for a long time in the water area where algae target detection is required, thereby achieving the purpose of long-term algae target detection in the water area.

[0168] Furthermore, if Figure 7 As shown, a first wiring harness socket 121 is provided at the bottom center of the control unit 12 for waterproof plugging with a plug at one end of the waterproof wiring harness 4; Figure 8 As shown, a second harness socket 21 is provided at the top center of the shooting part 2 for waterproof plugging with the plug at the other end of the waterproof harness 4 .

[0169] Furthermore, if Figure 9-11 As shown, a motor 23 is provided at the top center of the inner cavity of the photographing part 2, and the output shaft of the motor 23 is connected to the top center of the rotating plate 231; a first camera 232 and a second camera 233 are provided at the bottom of the rotating plate 231; a transparent plate 24 is provided below the two cameras, so as to close the upper half of the inner cavity of the photographing part 2, and at the same time, the two cameras can also capture the image below the transparent plate 24 through the transparent plate 24; in this way, by controlling the rotation of a motor 23 through a program, the two cameras can be driven to rotate, so that the scanning shooting range can cover the required area below the transparent plate 24, and this design structure is simple, easy to maintain, and has low cost;

[0170] A light emitting plate 28 is provided below the transparent plate 24 to seal the lower half of the inner cavity of the photographing part 2 and illuminate the sample pool 27 between the transparent plate 24 and the light emitting plate 28. Fig.12 As shown; the water inlet 22 and the water outlet 25 are symmetrically arranged at the left and right ends of the sample pool 27, which are used to allow the water in the water area to enter and exit the sample pool 27 under the action of the water flow, so that the two cameras can collect image data of the water body for algae target detection.

[0171] Furthermore, a third wiring harness socket 26 is provided at the bottom center of the shooting unit 2. In other embodiments, multiple shooting units 2 can be connected in series through multiple waterproof wiring harnesses 4, so that algae target detection can be performed simultaneously in different depth water layers in the same water area.

[0172] Furthermore, the first camera 232 and the second camera 233 are asymmetrically arranged at the bottom of the rotating plate 231, and the sum of the rotational shooting range of the first camera 232 and the rotational shooting range of the second camera 233 is greater than or equal to the range of the sample pool 27, so that each area of ​​the sample pool 27 can be photographed to avoid omissions.

[0173] Furthermore, if Fig.13 As shown, the two cameras are located at both ends of the rotating plate 231; the first camera 232 is close to the center of the rotating plate 231; the second camera 233 is away from the center of the rotating plate 231; the sum of the shooting diameter of the first camera 232 and the shooting diameter of the second camera 233 is greater than or equal to the diameter of the sample pool 27; in this way, when the motor 23 rotates, the two cameras perform horizontal rotation (as shown by the wide arrows in the figure), which can cover the entire range of the sample pool 27, and it is also convenient to set a lighter counterweight structure on the rotating plate 231, thereby ensuring the smooth rotation of the motor 23 while reducing the driving power consumption of the motor 23.

[0174] Furthermore, the motor 23 is a stepping motor so that the rotation angle of the camera can be controlled by a program.

[0175] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A deep learning-based algae target detection method, characterized in that: include: Step 1: Collect image data of water body by image sensing equipment; the image data includes training image data and measured image data; The training image data are marked with algae species and actual scenes; Step 2: split the image data according to a preset size; pre-process the image data; Step 3, splitting the training image data into small targets; the small target refers to a target when the actual size of the algae target instance is smaller than the preset algae size, and the ratio between the actual size and the size of the entire image is smaller than the preset size ratio; Step 4: Based on the training image data, train the optimized YOLO target detection model; perform target detection on the image data to be tested through the trained YOLO target detection model to obtain a detection result; the detection result includes the location and category of the algae; Step 5: Post-process the test results to generate standardized results.

2. The method according to claim 1, characterized in that The preprocessing methods in step 2 include noise reduction, image enhancement, image segmentation and background noise removal.

3. The method according to claim 1, characterized in that Step 3 specifically includes: Step 31, classify and cultivate each known species of algae, and record the cultivation images and categories of these algae at each growth stage; the categories include species, size, shape and color; Step 32: based on the culture image and the training image data, modify the category labels of all algae to one, and train a single-category algae detection model; based on the single-category algae detection model, detect the culture image to obtain the target position of each algae and associate it with the category; Step 33, segmenting the culture image according to the algae instance through the SAM segmentation model to obtain an algae entity image; and performing mask processing on the non-algae part of the culture image; Step 34: randomly map the algae entity image to the training image data or the corresponding blank water area image data, and record the mapping position to obtain a training sample; based on a preset algae size (occupied pixel size or area) and a preset size ratio, filter the training sample for small target algae to obtain a small target algae training sample.

4. The method according to claim 3, characterized in that The training samples also include impurity samples; the impurity samples refer to samples obtained by marking suspected algae areas and non-algae feature-significant areas as impurity areas in the training image data and processing them in two ways: Method 1: Fill the impurity area with a mask, where the pixel value of the mask is the color mean of the entire training image; Method 2: Remove the mark of the impurity area and regard the impurity area as the image background.

5. The method according to claim 3, characterized in that: The step 3 also includes step 35, performing data enhancement on the training samples, and the data enhancement specifically includes: adding noise to a preset proportion of the training samples and / or blurring a preset proportion of the training samples and / or simulating lighting processing on a preset proportion of the training samples and / or performing algae color enhancement operations on a preset proportion of the training samples.

6. The method according to claim 1, characterized in that The YOLO target detection model in step 4 is the PPYOLOE_Plus model. The specific detection process includes: extracting the characteristic information of algae in the image data under test through the Backbone network; then based on the characteristic information, performing target detection and classification of algae to obtain the target frame coordinates and categories; based on the target frame coordinates and categories, calculating the probability that each target frame coordinate corresponds to different categories, taking the category corresponding to the maximum probability as the category corresponding to the target frame coordinate, and obtaining the merged result; then performing non-maximum suppression filtering on the merged result through the NMS algorithm to obtain the final detection result.

7. The method according to claim 1, characterized in that The post-processing in step 5 includes statistical analysis of the detection results of the YOLO target detection model, specifically including the Shannon Weiner diversity index and / or the Margalef richness index and / or the Pielou evenness index and / or the Simpson ecological dominance index.

8. The method according to claim 7, characterized in that The calculation formula of the Shannon Weiner diversity index is specifically as follows: Where H′ represents the Shannon Weiner diversity index, which is used to reflect the richness and uniformity of algae distribution. The more algae there are and the more uniform their distribution, the larger the index is; s represents the number of algae categories; p i Represents the relative abundance of the i-th algae; The specific calculation formula of the Margalef richness index is: Where D represents the Margalef richness index, which is used to measure the class richness in the algal community; N represents the total number of individuals of all algae in the community; The specific calculation formula of the Pielou uniformity index is: Wherein, J′ represents the Pielou evenness index, which is used to reflect the evenness of algae distribution in the community: when all algae are evenly distributed, the J′ value is 1; otherwise, the J′ value is less than 1; H′ represents the Shannon Weiner diversity index; H′ max It represents the maximum Shannon Weiner diversity index value that can be achieved under a given number of algae categories S and the same total number of individuals. The specific calculation formula when all algae categories are evenly distributed is: H′ max =In(S); The specific calculation formula of the Simpson ecological dominance index is: Among them, D′ represents the Simpson ecological dominance index, which is used to reflect the concentration of dominant algae categories in the community: if the dominant algae category in the community is more prominent and the diversity is lower, the D′ value is closer to 1; otherwise, the D′ value is less than 1.

9. An algae target detection system based on deep learning, characterized in that: Including client and server; The client comprises an interaction unit and a first communication unit; The interactive unit is used to receive image data of the water body and detection model parameters, and feed back detection results; the image data includes training image data and detected image data; the training image data is marked with algae species and actual scenes; The server includes a second communication unit, a preprocessing unit, a feature extraction unit, an online detection model unit and a post-processing unit; The second communication unit is used to exchange information with the first communication unit of the client; The preprocessing unit is used to split the image data according to a preset size and perform preprocessing; The feature extraction unit performs small target segmentation on the training image data; the small target refers to a target when the actual size of the algae target instance is smaller than the preset algae size, and the ratio between the actual size and the size of the entire image is smaller than the preset size ratio; The online detection model unit trains an optimized YOLO target detection model based on the training image data; performs target detection on the image data to be tested through the trained YOLO target detection model to obtain a detection result; the detection result includes the location and category of the algae; The post-processing unit is used to post-process the detection result to generate a standardized result.

10. An algae target detection device based on deep learning, characterized in that: It includes a processor, a memory and a bus, the memory stores instructions and data read by the processor, the processor is used to call the instructions and data in the memory to execute the algae target detection method as described in any one of claims 1-8, and the bus connects the functional components for transmitting information.

Citation Information

Cited By

  • Algae population detection method and instrument

    CN121582927A