Location-assisted algae labeling methods, devices, computers, and storage media
By training an algal body localization bounding box model using the YOLO algorithm and combining it with manual annotation, the problem of low annotation efficiency in algal training data was solved, enabling efficient and accurate annotation for automatic algal monitoring and reducing labor costs and time.
Patent Information
- Application Number
- CN202510942995.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-09
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2045-07-09
AI Technical Summary
In existing technologies, the training set data annotation efficiency for algae target detection is too low, relying on manual annotation leads to low accuracy, and professional personnel are scarce, making it difficult to meet the needs of automatic algae monitoring.
The YOLO algorithm is used to train an algal body localization bounding box model. The algal body image is automatically bounded using a lightweight training set, and the labeled material is formed by combining manually labeled species information, which reduces the workload of manual bounding box drawing and improves efficiency and accuracy.
It has achieved automated and efficient algae labeling, reduced labor costs, shortened training set production time, and improved the efficiency and accuracy of algae monitoring.
Smart Images

Figure CN120472246B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of algal detection, and in particular to a location-assisted algal labeling method, device, computer, and storage medium. Background Technology
[0002] my country's water protection goals for rivers, lakes, and reservoirs are shifting from water quality protection to aquatic ecological environment protection, creating an urgent need for scientific monitoring technologies for aquatic ecosystem assessment indicators, primarily based on algae. Accurate algae target detection relies on a large training set formed from labeled algae target data.
[0003] Traditional aquatic ecological indicators are primarily identified manually using microscopic methods. This technology requires highly skilled personnel, resulting in significant training costs and time. Furthermore, manual identification is labor-intensive and inherently subjective, hindering the scientific evaluation of algae assessment indicators. In recent years, with the development of artificial intelligence, automated algae identification technology based on target monitoring algorithms has emerged. This technology heavily relies on the accuracy and effectiveness of training data, requiring substantial amounts of data to optimize algorithm accuracy. Currently, the training data for algae target monitoring algorithms is mostly manually labeled. Similar to manual algae identification, this process suffers from high workload and a high degree of expertise required, highlighting the contradiction between the scarcity of qualified professionals and the massive demand for training data.
[0004] In the manual labeling process, the main reliance is on target labeling software such as Labelimg and Labelme. Currently, these software programs only support manual target labeling, requiring staff to manually draw bounding boxes and label category information. These two tasks consume a significant amount of the identification personnel's time and are prone to omissions and mislabeling in complex algal samples. Improving the efficiency of training set production through other technical methods is one of the bottlenecks in the further development of automated algal monitoring. Summary of the Invention
[0005] The main objective of this invention is to provide a location-assisted algae labeling method, device, computer, and storage medium, aiming to solve the problems of low efficiency when labeling entirely manually and low accuracy when using model training.
[0006] To achieve the above objectives, the present invention provides a positioning-assisted algae labeling method, apparatus, computer, and storage medium, comprising:
[0007] S1. Receive multiple images of water samples with manually selected algae bodies marked by annotation boxes to form a lightweight training set;
[0008] S2. Based on the YOLO algorithm, a localization bounding box model for algae is trained using the aforementioned lightweight training set.
[0009] S3. Receive multiple algal images, and use the algal positioning and selection model to select algae in the algal images to form multiple automatically selected algal images of water samples.
[0010] S4. Output the algae selected from the automatically selected algae image of the water sample to form an algae image;
[0011] S5. Receive the species label corresponding to the algal image, and combine it with the algal image to form label material, wherein the species label is generated manually.
[0012] Furthermore, in step S1, the label box is a rectangle or a circle.
[0013] Further, step S3 includes:
[0014] Receive multiple algal images, and generate a bounding box information file corresponding to the algal images using the algal positioning bounding box model;
[0015] The annotation box information file is matched with the algal body image to form an automatically selected image of algae in the water sample.
[0016] Furthermore, in step S1, the annotation box can be revoked, and step S4 includes:
[0017] The annotation boxes in the automatically selected image of algae in the water sample are selected one by one, and all image information in the annotation boxes are output to form an algae image. When a certain annotation box is selected, the remaining annotation boxes are deselected.
[0018] Further, in step S1, the annotation box is revocable, and the shape of the annotation box includes circles and polygons; step S4 includes:
[0019] Select the labeled boxes in the automatically selected image of the algae in the water sample one by one;
[0020] When the annotation box is circular, the image information of the annotation box with the highest circularity and area ratio exceeding the set value is output to form an algal image. In this case, after selecting a certain annotation box, all other annotation boxes are canceled.
[0021] When the annotation box is a polygon, all image information in the annotation box is output to form an algal body image. When a certain annotation box is selected, the remaining annotation boxes are deselected.
[0022] Furthermore, in step S4, the diameter of the envelope circle of the algae in the algal body image is scaled to a preset range value.
[0023] Furthermore, step S5 is followed by:
[0024] Multiple labeled materials are used to form a labeled training set, and an algal labeling model is trained using the labeled training set.
[0025] The present invention also provides an apparatus for running the above-described location-assisted algae labeling method, comprising:
[0026] The storage module is used to receive multiple manually selected images of water samples containing algae, with each algae body outlined by a labeled box, to form a lightweight training set.
[0027] The training module is used to train the algal body localization bounding box model using the lightweight training set;
[0028] The analysis module is used to receive multiple algal images, and to select algae in the algal images using the algal positioning and selection model, thereby forming multiple automatically selected algal images of water samples.
[0029] The output module is used to output the algae selected from the automatically selected image of the water sample algae to form an algae image;
[0030] The pairing module is used to receive the species label corresponding to the algal body image and combine it with the algal body image to form labeled material.
[0031] The present invention also provides a computer, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the above-described positioning-assisted algae labeling method.
[0032] The present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the above-described location-assisted algae labeling method.
[0033] The present invention provides a positioning-assisted algae labeling method, device, computer, and storage medium. It utilizes a lightweight training set generated from manual labeling to train an algae positioning bounding box model with positioning capabilities. This model automatically sets label boxes for algae in algae images, outputting image information from the automatically labeled boxes for manual labeling. Algae images and species labels correspond to form labeling materials, which can be directly output as water quality monitoring results or used as the basis for subsequent model training. By using a lightweight training set, a labeling tool with automatic algae target positioning and bounding capabilities is created, relieving labelers of the burden of bounding work, reducing labor costs, shortening training set creation time, and improving the efficiency and accuracy of algae monitoring. Attached Figure Description
[0034] Figure 1 This is a flowchart illustrating the location-assisted algae labeling method of the first embodiment of the present invention;
[0035] Figure 2 This is a conceptual schematic diagram of the apparatus for implementing the algae labeling method with positioning assistance according to an embodiment of the present invention;
[0036] Figure 3 This is a schematic diagram illustrating the working concept of the location-assisted algae labeling method according to the second embodiment of the present invention;
[0037] Figure 4 This is a schematic diagram illustrating the working concept of the location-assisted algae labeling method according to the third embodiment of the present invention (image of manually selected algae in a water sample).
[0038] Figure 5 This is a schematic diagram of the working concept of the location-assisted algae labeling method according to the third embodiment of the present invention (the labeling box is circular).
[0039] Figure 6 This is a schematic diagram of the working concept of the location-assisted algae labeling method according to the third embodiment of the present invention (the labeling frame is a polygon).
[0040] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0041] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0042] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” “the,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this specification means the presence of the stated features, integers, steps, operations, elements, units, modules, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, units, modules, components, and / or groups thereof. It should be understood that when we say an element is “connected” or “coupled” to another element, it can be directly connected or coupled to the other element, or there may be intermediate elements. Furthermore, “connected” or “coupled” as used herein can include wireless connection or wireless coupling. The term “and / or” as used herein includes all or any of the units and all combinations of one or more associated listed items.
[0043] It will be understood by those skilled in the art that, unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. It should also be understood that terms such as those defined in general dictionaries should be understood to have the same meaning as in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless specifically defined as herein.
[0044] Reference Figure 1 In one embodiment of the present invention, a location-assisted algae labeling method includes:
[0045] S1. Receive multiple images of water samples with manually selected algae bodies marked by annotation boxes to form a lightweight training set;
[0046] S2. Based on the YOLO algorithm, a localization bounding box model for algae is trained using the aforementioned lightweight training set.
[0047] S3. Receive multiple algal images, and use the algal positioning and selection model to select algae in the algal images to form multiple automatically selected algal images of water samples.
[0048] S4. Output the algae selected from the automatically selected algae image of the water sample to form an algae image;
[0049] S5. Receive the species label corresponding to the algal image, and combine it with the algal image to form label material, wherein the species label is generated manually.
[0050] In existing technologies, relying entirely on manual annotation is too inefficient, while relying entirely on model training results in low recognition accuracy.
[0051] In the manual labeling process, the main reliance is on target labeling software such as Labelimg and Labelme. Currently, these software programs only support manual target labeling, requiring staff to manually draw bounding boxes and label category information. These two tasks consume a significant amount of the identification personnel's time and are prone to omissions and mislabeling in complex algal samples. Improving the efficiency of training set production through other technical methods is one of the bottlenecks in the further development of automated algal monitoring.
[0052] The present invention provides a location-assisted algae labeling method.
[0053] In step S1, multiple manually selected images of aquatic algae, each containing a single algal body outlined by a bounding box, are received to form a lightweight training set. These manually selected images include algae and other materials, with the algae outlined by manually drawn bounding boxes. The lightweight training set is formed from multiple manually selected images of aquatic algae.
[0054] In step S2, the lightweight training set is used to train an algal body localization bounding box model. Through training, the algal body localization bounding box model acquires the ability to select algal bodies.
[0055] In step S3, multiple algal images are received, and the algal bodies in the algal images are selected using the algal body positioning and selection model to form multiple automatically selected algal images of the water sample.
[0056] In step S4, the algae selected from the automatically selected algae image of the water sample are output to form an algae image. Unnecessary information in the automatically selected algae image of the water sample is ignored before outputting the algae image.
[0057] In step S5, the species label corresponding to the algal image is received. Thus, the algal image and species label correspond to form labeled data. Multiple labeled data can serve as the basis for subsequent model training.
[0058] In a typical process, approximately 100 images of algal water samples are obtained from a microscope.
[0059] The algal water sample images were manually labeled, and only the algae in the algal water sample images were selected by box selection. The category was uniformly set as algae, without the need for classification, thus forming a lightweight training set.
[0060] Using a lightweight training set to train the YOLO model allows the model to achieve localization capabilities effectively, since the YOLO model does not need to provide classification capabilities. This results in a model capable of capturing the outlines of algae in an image.
[0061] Based on the Python language, an automatic bounding box button was added to the Labelme interactive interface. This button links to the target detection algorithm of the algae localization bounding box model.
[0062] Edit the target detection algorithm so that it can output a JSON file containing the algae target bounding boxes corresponding to the image.
[0063] The JSON file is loaded into the current Labelme interface, displaying the algae target bounding boxes identified by the YOLO localization model.
[0064] The identification personnel can modify the category information of the target bounding boxes identified by YOLO, requiring only manual completion of the algae classification work.
[0065] By combining computer-automated frame positioning with professional classification, effective annotation data can be obtained quickly.
[0066] For specific aquatic environments, an algal body positioning bounding box model is used to complete automatic bounding box selection. The selected graphics are then manually identified, ultimately generating labeled materials for the specific aquatic environment.
[0067] In summary, a lightweight training set generated by manual annotation is used to train an algae localization bounding box model with the ability to locate and select bounding boxes. This model automatically sets bounding boxes for algae in algae images, and finally outputs the image information within the automatically labeled boxes for manual annotation. The algae images and species labels correspond to form annotation materials, which can be directly output from water quality monitoring results or used as the basis for subsequent model training. By utilizing the lightweight training set, an annotation tool with automatic algae target localization and bounding box capabilities is created, relieving annotators of the burden of bounding box work, reducing labor costs, shortening training set creation time, and improving the efficiency and accuracy of algae monitoring.
[0068] In one embodiment, in step S1, the label box is a rectangle or a circle.
[0069] In this embodiment, the shape of the annotation box is restricted to rectangles, which simplifies the drawing process and can accommodate both circular and linear algae. Circular annotation boxes are convenient for circular algae; especially when multiple circular algae cluster together, multiple circular annotation boxes can be used to annotate each algae. Preferably, the area of the annotation box is 1.2 to 1.3 times the area of the algae within it, thereby preventing information outside the selected algae (including other algae or impurities) from being included.
[0070] In one embodiment, step S3 includes:
[0071] Receive multiple algal images, and generate a bounding box information file corresponding to the algal images using the algal positioning bounding box model;
[0072] The annotation box information file is matched with the algal body image to form an automatically selected image of algae in the water sample.
[0073] In this embodiment, the labeled information is separated from the algal body image, thereby providing a basis for flexible processing of the labeled boxes.
[0074] Reference Figure 3 In one embodiment, in step S1, the annotation box can be revoked, and step S4 includes:
[0075] The annotation boxes in the automatically selected image of algae in the water sample are selected one by one, and all image information in the annotation boxes are output to form an algae image. When a certain annotation box is selected, the remaining annotation boxes are deselected.
[0076] In this embodiment, the image information and annotation box information in the manually selected image of the algae sample are layered, and each annotation box can be independently revoked. For circular and clustered algal samples, during the annotation process, a circular annotation box of an appropriate size is drawn around each circular algal cell. Since the algae are clustered, multiple annotation boxes may intersect. Therefore, for the convenience of subsequent manual labeling, after selecting a certain annotation box, the remaining annotation boxes are revoked. Preferably, the area of the annotation box is 1.2 to 1.3 times the area of the algal cell. Figure 3 The system contains three circular algae arranged in a triangular pattern. First, the contents of the three circular annotation boxes are extracted (corresponding to the removal of the remaining annotation boxes), and then the contents within the annotation boxes are output.
[0077] Reference Figures 4 to 6 In one embodiment, in step S1, the annotation box is revocable, and the shape of the annotation box includes circles and polygons; step S4 includes:
[0078] Select the labeled boxes in the automatically selected image of the algae in the water sample one by one;
[0079] When the annotation box is circular, the image information of the annotation box with the highest circularity and area ratio exceeding the set value is output to form an algal image. In this case, after selecting a certain annotation box, all other annotation boxes are canceled.
[0080] When the annotation box is a polygon, all image information in the annotation box is output to form an algal body image. When a certain annotation box is selected, the remaining annotation boxes are deselected.
[0081] In this embodiment, to improve the accuracy of algal image output, the scheme was optimized. The image information and annotation box information in the manually selected algal image are set in layers, and each annotation box can be independently revoked. The annotation boxes are classified, and their shapes include circles and polygons. In steps S1 to S2, firstly, during the manual creation of the manually selected algal image, circular algae are labeled with circular annotation boxes, and other shapes of algae are labeled with polygonal annotation boxes. A lightweight training set is used to train an algal localization and selection model. This model can not only select algae but also label algae of different shapes with different shaped annotation boxes. In a preferred embodiment, the polygonal annotation boxes can be further subdivided to complete the classification and labeling of various algae.
[0082] In this embodiment, each is selected one by one. Figure 4 In the image, automatically selected algae from the water sample are bounded by labeled boxes. When the labeled box is circular, it indicates that circular algal cells have been selected (circular algal cell types make up the largest proportion). (See reference...) Figure 5The algorithm outputs the image information with the highest circularity within the labeled bounding box to form the algal body image. Once a bounding box is selected, all other bounding boxes are deselected. Circularity can be determined using methods such as gradient methods (using edge gradient directions to locate the center and radius), machine learning classification (extracting shape features and training models like SVM to recognize circles), or template matching (predefined circular templates for similarity comparison). Only the image information with the highest circularity is output to form the algal body image, thus removing impurity images within the labeled bounding box. Considering the possibility of tiny circular images, an area proportion criterion is also set when outputting the circular image information within the labeled bounding box to filter out images with excessively small areas.
[0083] Reference Figure 6 When the annotation box is a polygon, it means that the selected algae is not circular (such as linear or specific shape). The image information of all the annotation boxes is output to form an algae image. After selecting a certain annotation box, the remaining annotation boxes are canceled.
[0084] In one embodiment, in step S4, the diameter of the envelope circle of the algae in the algal body image is scaled to a preset range value.
[0085] In this embodiment, considering that in step S4, the automatically selected image of algae in the water sample includes the original image and the annotation box; the algae in the annotation box are output to form an image, which is then ready for manual annotation, the approximate image size of the algae helps to reduce the difficulty of manual annotation. Considering that conventional algae are approximately spherical, the diameter of the enveloping circle of the algae in the algae image is within a preset range, thus limiting the size of the algae in the algae image in the form of an enveloping circle.
[0086] In one embodiment, step S5 is followed by:
[0087] Multiple labeled materials are used to form a labeled training set, and an algal labeling model is trained using the labeled training set.
[0088] In this embodiment, a large number of labeled materials are used to form a labeled training set; the model is trained using the labeled training set to obtain an algal labeling model, which can ultimately be used to identify and judge algae in relevant water sample images.
[0089] The present invention also provides an apparatus for running the above-described location-assisted algae labeling method, comprising:
[0090] Storage module 10 is used to receive multiple manually selected images of water samples of algae by means of a single algae selected by a bounding box to form a lightweight training set;
[0091] Training module 20 is used to train an algal body localization bounding box model using the lightweight training set;
[0092] The analysis module 30 is used to receive multiple algal images, and to complete the selection of algal bodies in the algal images through the algal body positioning and selection model, thereby forming multiple automatically selected algal images of water samples.
[0093] Output module 40 is used to output the algae selected in the automatic selection image of the water sample algae to form an algae image;
[0094] The pairing module 50 is used to receive the species label corresponding to the algal body image and combine it with the algal body image to form label material.
[0095] In this embodiment, the working method of the device is the same as that in the aforementioned method embodiment, and will not be repeated here.
[0096] The present invention also provides a computer, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the above-described positioning-assisted algae labeling method.
[0097] The computer device includes a processor, storage, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The storage includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a file storage method. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad located on the computer device's casing, or an external keyboard, touchpad, or mouse.
[0098] The present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the above-described location-assisted algae labeling method.
[0099] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in this application and in the embodiments can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be obtained in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual-speed SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAM bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0100] In summary, the algae labeling method, device, computer, and storage medium provided by this invention utilize a lightweight training set generated from manual labeling to train an algae positioning bounding box model with positioning frame selection capabilities. The algae positioning bounding box model automatically sets label boxes for algae in algae images, and finally outputs the image information within the automatically labeled boxes for manual labeling. The algae images and species labels correspond to form labeling materials, which can be directly output as water quality monitoring results or used as the basis for subsequent model training. By utilizing a lightweight training set, a labeling tool with automatic algae target positioning and bounding box capabilities is created, relieving labelers of the burden of bounding box work, reducing the labor costs of labeling, shortening the training set creation time, and improving the efficiency and accuracy of algae monitoring work.
[0101] The above description is merely a preferred embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A location-assisted algae labeling method, characterized in that, include: S1. Receive multiple images of water samples with manually selected algae, each marked with a bounding box, to form a lightweight training set. Circular bounding boxes are used to select circular algae, while polygonal bounding boxes are used to select linear algae. S2. Based on the YOLO algorithm, a localization bounding box model for algae is trained using the aforementioned lightweight training set. S3. Receive multiple algal images, and use the algal positioning and selection model to select algae in the algal images to form multiple automatically selected algal images of water samples. S4. Output the algae selected from the automatically selected algae image of the water sample to form an algae image; S5. Receive the species label corresponding to the algal image, and combine it with the algal image to form label material, wherein the species label is generated manually; In step S1, the annotation box is revocable, and the shape of the annotation box includes circles and polygons. Step S4 includes: Select the labeled boxes in the automatically selected image of the algae in the water sample one by one; When the annotation box is circular, the image information of the annotation box with the highest circularity and area ratio exceeding the set value is output to form an algal image. In this case, after selecting a certain annotation box, all other annotation boxes are canceled. When the annotation box is a polygon, all image information in the annotation box is output to form an algal body image. When a certain annotation box is selected, the remaining annotation boxes are deselected.
2. The location-assisted algae labeling method according to claim 1, characterized in that, In step S4, the diameter of the envelope circle of the algae in the algal body image is scaled to a preset range value.
3. The location-assisted algae labeling method according to any one of claims 1 to 2, characterized in that, The step S5 is followed by: Multiple labeled materials are used to form a labeled training set, and an algal labeling model is trained using the labeled training set.
4. An apparatus for operating the positioning-assisted algae labeling method according to any one of claims 1 to 3, characterized in that, include: Storage module (10) is used to receive multiple manually selected images of water samples of algae by means of a single algae selected by a bounding box to form a lightweight training set; Training module (20) is used to train an algal body localization box selection model using the lightweight training set; The analysis module (30) is used to receive multiple algal images and complete the selection of algal bodies in the algal images through the algal body positioning and selection model, thereby forming multiple automatic selection images of algae in the water sample. Output module (40) is used to output the algae selected in the automatic selection image of the water sample algae to form an algae image; The pairing module (50) is used to receive the species label corresponding to the algal body image and combine it with the algal body image to form label material.
5. A computer, comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the positioning-assisted algae labeling method according to any one of claims 1 to 3.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the location-assisted algae labeling method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Image sample labeling method and device
CN110058756A
Multi-source algae image target detection method and system, electronic equipment and storage medium
CN115311657A