Method for detecting microalgae in freshwater breeding industry through slice-assisted super-reasoning multi-resolution images
By dividing large-sized water monitoring images into multiple slices and using YOLOV8 model for detection, combined with SAHI technology to process the edges and overlapping areas, the problems of low efficiency and low accuracy of traditional microalgae detection methods are solved, and high efficiency is achieved , accurate microalgae detection, suitable for real-time monitoring of large-scale farms.
Patent Information
- Application Number
- CN202411266316.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-11
- Publication Date
- 2025-01-07
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional microalgae detection methods are inefficient, have great influence on human factors, and are difficult to automate. The existing high-resolution image processing methods consume a lot of computing resources and have low detection accuracy, especially when detecting large objects.
Using slice-assisted ultra-inference multi-resolution image detection method, large-sized water monitoring images are sliced into multiple slices, and each slice is identified and counted using the YOLOV8 object detection model, and the results are combined to obtain the detection results of the entire image. , SAHI technology is used to process slice edges and overlapping areas to improve detection accuracy and efficiency.
It realizes efficient and accurate microalgae detection, which is suitable for real-time monitoring of large-scale farms, improves detection accuracy and speed, can be integrated with automation equipment and information systems, and realizes the automation and intelligence of microalgae detection.
Smart Images

Figure CN119273628A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a slice-assisted hyper-inference multi-resolution image freshwater aquaculture microalgae detection method. Background Art
[0002] In freshwater aquaculture, the detection and monitoring of microalgae is an important means to ensure the health of water quality and the aquaculture environment. Microalgae are not only an important food source for aquatic organisms, but also can provide oxygen to the water through photosynthesis. However, the excessive reproduction of microalgae (such as algal blooms) can lead to deterioration of water quality and even cause mass deaths of fish and other aquatic organisms. In addition, microalgae also have significant feed value in freshwater aquaculture. Microalgae are rich in protein, fatty acids and a variety of nutrients, and are high-quality natural feed for fish and other aquatic organisms. By effectively monitoring and managing the growth of microalgae, feed delivery strategies can be optimized, the use of artificial feed can be reduced, and feed costs can be saved. Therefore, timely and accurate detection and monitoring of the number and type of microalgae are crucial to maintaining the aquaculture environment.
[0003] Traditional microalgae detection methods mainly rely on microscopic observation and manual counting. Although this method can provide relatively accurate results, it has the following disadvantages:
[0004] Low efficiency: Microscope observation and manual counting require a lot of time and manpower, and it is difficult to achieve high-frequency monitoring for large-scale farms;
[0005] Human factors have a great influence: different operators have different experience and technical levels, which can easily lead to subjectivity and inconsistency in test results;
[0006] Difficult to automate: Traditional methods are difficult to integrate with modern automated equipment and information systems, limiting detection efficiency and data utilization.
[0007] In recent years, with the development of image processing technology, image-based automated detection methods have gradually become a research hotspot. However, existing methods face the following challenges when processing high-resolution images:
[0008] High consumption of computing resources: High-resolution images contain a large number of pixels. Processing these images requires a lot of computing resources and memory, which is difficult to run efficiently in resource-limited environments.
[0009] Low detection accuracy: Existing models often have difficulty taking into account both global and local details when processing high-resolution images, resulting in low detection accuracy, especially when detecting tiny objects.
[0010] Poor detection of large objects: Since the input image size is usually fixed, the pre-trained model may not be able to adapt to slices and intersection areas when processing large objects, resulting in poor detection results.
[0011] Therefore, an efficient and accurate detection method for microalgae in freshwater aquaculture is urgently needed to meet the real-time monitoring needs of large-scale farms. Summary of the invention
[0012] The purpose of this application is to provide a slice-assisted hyper-inference multi-resolution image freshwater aquaculture microalgae detection method to solve the technical problems raised in the above background.
[0013] To achieve the above objectives, the present application discloses the following technical solution: a slice-assisted hyper-inference multi-resolution image freshwater aquaculture microalgae detection method, the method comprising the following steps:
[0014] Image slicing: adjust and preset the size and overlapping area of the slices, and cut large-size water monitoring images into multiple slices;
[0015] Slice processing: Use the YOLOV8 target detection model to identify and count the microalgae in each slice individually;
[0016] Result merging: Merge the detection results of all slices to obtain the detection results of the entire large-scale water body monitoring image.
[0017] Preferably, the image slice specifically includes:
[0018] Image input: Input a large-size water body detection image, and define the size of the image as H×W;
[0019] Slice parameter settings: Set the slice height slice_height to the height input size during YOLOV8 target detection model training, set the slice width slice_width to the width input size during YOLOV8 target detection model training, and set the height overlap ratio overlap_height_ratio and width overlap ratio overlap_width_ratio;
[0020] Calculate the size of the overlapping area: Use the formula overlap_height = slice_height × overlap_height_ratio to calculate the height overlap size overlap_height, and use the formula overlap_width = slice_width × overlap_width_ratio to calculate the width overlap size overlap_width;
[0021] Slice the image: Slice the large-size water monitoring image based on the set slicing parameters and overlapping area size.
[0022] Preferably, the slicing of the image specifically includes:
[0023] Slice step length: The vertical step length step_height is calculated by the formula step_height = slice_height-overlap_height, and the horizontal step length step_width is calculated by the formula step_width = slice_width-overlap_width;
[0024] Slicing operation: Initialize the slice list S, where the vertical direction starts from 0 and slices with a step length of step_height in the vertical direction until the bottom of the large-sized water body monitoring image; the horizontal direction starts from 0 and slices with a step length of step_width in the horizontal direction until the right edge of the large-sized water body monitoring image, and for each slice, record its upper left corner coordinates (x, y) and lower right corner coordinates (x+slice_width, y+slice_height);
[0025] Slicing result: a plurality of slices are obtained, wherein the size of each slice is slice_width×slice_width, and the offset information of each slice in the large-size water body monitoring image is (x, y).
[0026] Preferably, the slicing process specifically includes:
[0027] Input the slice into the YOLOV8 target detection model for reasoning to obtain a detection result, wherein the detection result includes the location, type and confidence of the microalgae;
[0028] The detection results are post-processed to filter out low-confidence detection boxes and retain high-confidence detection results.
[0029] Preferably, the result merging specifically includes:
[0030] Coordinate adjustment: convert the detection results in the slice back to the coordinate system of the large-scale water monitoring image;
[0031] Merge results: Merge the detection results of all slices of the coordinate system converted into a large-size water body monitoring image to form an overall detection result;
[0032] Obtaining the final detection result: Using non-maximum suppression to remove redundant bounding boxes from the overall detection result, retaining the best detection result as the detection result of the entire large-scale water body monitoring image.
[0033] Preferably, the coordinate adjustment specifically includes:
[0034] Calculate the offset: The position of each slice in the large-scale water monitoring image is calculated using the upper left corner coordinate of the slice (offset x ,offset y ) is used to indicate;
[0035] Coordinate transformation: Adjust the coordinates of the upper left corner and lower right corner of each detection box to obtain the transformed coordinates (x' max ,y' max ),and, Among them, the coordinates of the upper left corner of each detection box are (x min ,y min ), the coordinate of the lower right corner is (x max ,y max ).
[0036] Preferably, the obtaining of the final detection result specifically includes:
[0037] Algorithm processing: Sort the detection frames according to their confidence scores, perform non-maximum suppression on the detection frames in the overlapping areas, and remove duplicate detection frames; process each detection frame one by one, and retain the detection frames whose overlap with the current detection frame is lower than the threshold;
[0038] Non-maximum suppression is applied to the formed overall detection result, and the detection results of each slice are spliced according to their positions in the large-scale water body monitoring image to form the detection result of the entire large-scale water body monitoring image.
[0039] Preferably, the calculation process of the overlap degree is specifically as follows:
[0040] Define the coordinates of the upper left corner of the detection box A as The coordinates of the lower right corner of the detection box A are The coordinates of the upper left corner of the detection box B are The coordinates of the lower right corner of the detection box B are
[0041]
[0042] The coordinates of the overlapping area are
[0043] The area of the overlapping region is
[0044] The area of the detection box A is The area of the detection box B is
[0045]
[0046] The calculation formula for the overlap between detection frame A and detection frame B is:
[0047]
[0048] Beneficial effect: The slice-assisted super-inference multi-resolution image freshwater aquaculture microalgae detection method of the present application is based on slicing large-scale water body monitoring images to achieve refined detection and detail enhancement, which can more accurately identify and classify different types of microalgae, ensure the accuracy of water quality monitoring, and, by processing each slice separately and merging the results, under the condition of parallel processing, the detection efficiency can be improved to ensure timely discovery of water quality problems. At the same time, during the processing, the resolution can be dynamically adjusted to improve the detection flexibility and accuracy. In addition, the method fully considers the overlapping area of the slices, thereby avoiding the problem of the target (algae) being ignored when it is cut at the edge. Therefore, the slice-assisted super-inference multi-resolution image freshwater aquaculture microalgae detection method of the present application, by introducing SAHI and YOLOV8 technology, can process large-size images, improve detection accuracy and speed, and is suitable for real-time monitoring needs of large-scale farms. In addition, by cutting large images into small slices and combining the YOLOV8 target detection model, the method has high flexibility and adaptability, and can be integrated with existing automation equipment and information systems to realize the automation and intelligence of microalgae detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.
[0050] Figure 1 A schematic diagram of the process of the slice-assisted hyper-inference multi-resolution image freshwater aquaculture microalgae detection method provided in an embodiment of the present application;
[0051] Figure 2 Schematic diagram of the SAHI method;
[0052] Figure 3 A schematic diagram of the resolution statistics of the microalgae dataset provided in the embodiments of the present application;
[0053] Figure 4 Comparative display of the effects provided by the embodiments of this application Figure 1 ;
[0054] Figure 5 Comparative display of the effects provided by the embodiments of this application Figure 2 ;
[0055] Figure 6 Comparative display of the effects provided by the embodiments of this application Figure 3 . DETAILED DESCRIPTION
[0056] The technical solutions in the embodiments of the present application are described clearly and completely below. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present application.
[0057] In this article, the term "comprising" is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of more restrictions, the elements defined by the sentence "comprising..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0058] Slice-Aware Hyper Inference (SAHI) is a technique used in computer vision and object detection to improve the performance of models when processing large-size images. SAHI overcomes computing resource and memory limitations and improves detection accuracy by splitting large images into smaller slices for processing. The main features and advantages of SAHI include:
[0059] High-resolution image processing: SAHI is particularly suitable for processing large-size images, such as water monitoring images of freshwater farms. It divides large images into small blocks for processing, reduces computational complexity, retains edge features, and improves detection accuracy;
[0060] Fine-grained detection: Slicing can improve the granularity of target detection, especially when there are small targets in high-resolution images. Slicing can detect these small targets more accurately and improve the detection accuracy of microalgae.
[0061] Parallel computing: Slice processing can be performed in parallel, thus speeding up the processing of the entire image. This is particularly important for application scenarios that require real-time processing;
[0062] Boundary effect processing: During the slicing process, SAHI can process targets on the slice boundaries by overlapping slices or other methods to avoid targets being truncated by the slice boundaries and affecting the detection effect;
[0063] Flexibility: Depending on the specific application scenario, the processing resolution and slice size can be flexibly adjusted to achieve the best balance between detection effect and efficiency. And the SAHI method can be used in combination with various target detection models without major modifications to existing models, thus having high flexibility and adaptability.
[0064] To facilitate understanding of the technical means of the present application, this embodiment first introduces the SAHI method. Figure 2 As shown, the slicing method is used in the reasoning step of the SAHI method, specifically:
[0065] 1. Image slicing: First, the original query image I is segmented into l overlapping patches 1,2,...,PI 1,PI 2,...,PI l of size ×M×N;
[0066] 2. Resize: Resize each patch while maintaining the aspect ratio;
[0067] 3. Independent reasoning: Perform object detection forward pass independently for each overlapping patch;
[0068] 4. Full Image Reasoning (optional): You can choose to perform a full reasoning (FI) on the original image to detect larger objects;
[0069] 5. Merge results: Merge the prediction results of all overlapping patches and the full-image inference results (if used) back to the original image size. Non-maximum suppression (NMS) is used in the merging process, and the intersection over union (IoU) is higher than the predefined matching threshold T m Match the boxes and delete the boxes with a detection probability lower than T d The test results.
[0070] Through the above steps, SAHI can effectively improve the detection accuracy of small objects while maintaining the detection capability of large objects, and realize multi-resolution microalgae image detection.
[0071] Secondly, the YOLOv8 model introduces a more advanced network architecture and optimization techniques, which makes it perform better when processing complex images. Combined with SAHI technology, YOLOv8 can process large-size images more efficiently and is suitable for microalgae detection in freshwater farms. Since the size of the input image is usually fixed during the YOLOv8 training process, the data sets mostly involve low-resolution images (640×640) with fairly large objects and large pixel coverage (average coverage of 60% of the image height). Models pre-trained using these data sets provide very successful detection performance for similar inputs. But on the other hand, their accuracy is significantly lower. Larger objects may not fit into slices and intersection areas, which may lead to poor detection of larger objects.
[0072] It can be seen that using a single detection method to detect microalgae in freshwater farms may result in poor detection results.
[0073] In this regard, this embodiment introduces SAHI and YOLOv8 technologies to provide an efficient and accurate multi-resolution image freshwater aquaculture microalgae detection method, which can not only ensure the health of water quality and aquaculture environment, but also optimize feed delivery strategies, save feed costs, and meet the real-time monitoring needs of large-scale farms.
[0074] Specifically, if Figure 1 As shown, the slice-assisted hyper-inference multi-resolution image freshwater aquaculture microalgae detection method of this embodiment includes the following steps:
[0075] Image slicing: adjust and preset the size and overlapping area of the slices, and cut large-size water monitoring images into multiple slices;
[0076] Slice processing: Use the YOLOV8 target detection model to identify and count the microalgae in each slice individually;
[0077] Result merging: Merge the detection results of all slices to obtain the detection results of the entire large-scale water body monitoring image.
[0078] Here, the input size of the YOLOV8 target detection model training is 640×640, the height overlap ratio is set to 0.2, that is, 20% overlap, and the width overlap ratio is set to 0.2, that is, 20% overlap. The specific content of this solution is described as follows.
[0079] 1. Image Slicing
[0080] Divide the large-scale water monitoring image into multiple small slices. The size and overlapping area of the slices can be adjusted according to specific needs to ensure detection accuracy and efficiency. The selection of slice size should take into account the input size of the model and computing resources, usually between 256x256 pixels and 1024x1024 pixels. The setting of overlapping areas can reduce edge effects and improve the continuity and accuracy of detection. The specific steps are as follows:
[0081] (1) Image input
[0082] Input a large-size image, denoted as P, whose size is H×W (H is the image height and W is the image width).
[0083] (2) Slice parameter setting
[0084] Set the slice size and overlap area (Overlap) according to specific needs. The setting of the overlap area can help detect targets at the edge of the slice to avoid omissions.
[0085] Slice height slice_height: Usually set to the input size (i.e. 640) when training the YOLOV8 target detection model.
[0086] Slice width slice_width: Usually set to the input size when training the YOLOV8 target detection model (ie 640).
[0087] Height overlap ratio overlap_height_ratio: Set to 0.2, which means 20% overlap.
[0088] Width overlap ratio overlap_width_ratio: Set to 0.2, which means 20% overlap.
[0089] Set the specific values as follows:
[0090] slice_height=640
[0091] slice_width=640
[0092] overlap_height_ratio=0.2
[0093] overlap_width_ratio=0.2
[0094] (3) Calculate the size of the overlapping area
[0095] Calculate the actual size of the overlapping area according to the set overlap ratio:
[0096] Height Overlap Dimensions:
[0097] overlap_height=slice_height×overlap_height_ratio=640×0.2=128
[0098] Width overlap size:
[0099] overlap_width=slice_width×overlap_width_ratio=640×0.2=128
[0100] (4) Image slicing
[0101] The large-size image P is divided into several small blocks (slices), and the size of each slice is usually consistent with the input size during YOLOv8 training (640x640).
[0102] 1) Slicing step size:
[0103] Vertical step size:
[0104] step_height=slice_height-overlap_height=640-128=512
[0105] Horizontal step size:
[0106] step_width=slice_width-overlap_width=640-128=512
[0107] 2) Slicing operation:
[0108] Initialize the slice list S, starting from 0 in the vertical direction, and slice with step_height as the step length until the bottom of the image.
[0109] The horizontal direction starts from 0 and slices with step_width as the step length until the right edge of the image.
[0110] For each slice, record its upper left corner coordinates (x, y) and lower right corner coordinates (x+slice_width, y+slice_height).
[0111] 3) Slicing results:
[0112] The result is a number of slices, each of which is 640×640 in size, and each slice contains its offset information (ie, offset) in the large-size image P as (x, y).
[0113] 2. Slice processing
[0114] Microalgae detection was performed on each slice separately. The YOLOV8 target detection model was used to identify and count the microalgae in the slices. The microalgae species included in the dataset, such as Platymonas, Glechoma, Zesiton, Microcystis, Microcystis, Spirulina, Oocystis, Elegant Oocystis, Chlorella, and Holothuria, were implemented by algorithm, and the dominant algae in freshwater farms (such as Oocystis, Chlorella, Chlamydomonas, Scenedesmus, and Crucis in green algae; Microcystis, Oscillatoria, and Elegant Oocystis in cyanobacteria; Nitzschia in diatoms) were verified to ensure the wide applicability and accuracy of the detection method. The image resolution statistics of the microalgae dataset are as follows: Figure 3 shown.
[0115] The slice reasoning steps are as follows:
[0116] The slices are input into the YOLOV8 target detection model for inference to obtain the detection results, including the location, type and confidence of the microalgae.
[0117] The detection results are post-processed to filter out low-confidence detection boxes and retain high-confidence detection results.
[0118] 3. Merge results
[0119] Merge the detection results of all slices to get the detection results of the entire large image. During the merging process, the detection results of the overlapping areas need to be processed to ensure the continuity and accuracy of the detection results. In the target detection method combining YOLOv8 and SAHI, result merging is a key step. This step includes converting the detection results of each slice back to the coordinate system of the original large image, and merging and optimizing all detection results. The specific steps are as follows:
[0120] (1) Coordinate Adjustment
[0121] The detection results of each slice are based on the slice's own coordinate system. In order to merge these results into the original large image, the detection results in the slice need to be converted back to the coordinate system of the original large image. The specific steps are as follows:
[0122] 1) Calculate the offset:
[0123] The position of each slice in the original large image can be expressed using the coordinates of the upper left corner of the slice (offset x ,offset y )express.
[0124] For each detection box, its coordinates need to be converted back to the coordinate system of the original large image by adding the offset.
[0125] 2) Coordinate transformation:
[0126] Adjust the coordinates of the upper left and lower right corners of each detection box:
[0127] Assume the coordinates of the upper left corner of the detection box in the slice are (x min ,y min ), the coordinate of the lower right corner is (x max ,y max ).
[0128] The transformed coordinates (x' max ,y' max )for:
[0129] (2) Result merging
[0130] Combine the detection results of all slices to form an overall detection result.
[0131] (3) Non-maximum suppression (NMS)
[0132] After merging all detection results, there may be multiple overlapping or repeated detection boxes. Non-maximum suppression (NMS) is used to remove redundant bounding boxes and retain the best detection results. The specific steps include:
[0133] 1) NMS algorithm:
[0134] The detection boxes are sorted according to their confidence scores. Non-maximum suppression (NMS) is performed on the detection boxes in the overlapping areas to remove duplicate detection boxes.
[0135] Process the detection boxes one by one, and retain the detection boxes whose overlap (IoU) with the current detection box is lower than the threshold.
[0136] 2) Calculate IoU (Intersect ion over Un ion):
[0137] Define the coordinates of the upper left corner of the detection box A as The coordinates of the lower right corner of the detection box A are
[0138] The coordinates of the upper left corner of the detection box B are The coordinates of the lower right corner of the detection box B are
[0139] The coordinates of the overlapping area are
[0140] The area of the overlapping region is
[0141] The area of the detection box A is
[0142] The area of the detection box B is
[0143] The calculation formula for the overlap between detection frame A and detection frame B is:
[0144]
[0145] 3) Apply NMS:
[0146] Non-maximum suppression is applied to all the merged detection results, and the detection results of each slice are spliced according to their positions in the large image to form a complete detection result map to obtain the final detection result, that is, the detection result of the entire large-scale water body monitoring image.
[0147] As we all know, in the freshwater aquaculture industry, microalgae detection is a key task to ensure water quality and fish health. The slice-assisted super-resolution image reasoning method has introduced many innovations in this field, significantly improving the detection effect and efficiency. The following are the technical features of the slice-assisted super-inference multi-resolution image freshwater aquaculture microalgae detection method provided in this embodiment:
[0148] 1. Combination of Slicing Processing and Super-resolution
[0149] Technical point 1-fine detection: Divide the large image into multiple small slices, so that the detection system can process each area more finely. For tiny targets such as microalgae, fine detection is particularly important.
[0150] Technical point 2-Detail enhancement: Super-resolution technology can improve image resolution, enhance image details, and make the features of microalgae clearer. This is very helpful for detecting tiny microalgae with different shapes.
[0151] Application: In freshwater aquaculture, there are many types of microalgae in the water and they are small in size. Through refined detection and detail enhancement, different types of microalgae can be more accurately identified and classified to ensure the accuracy of water quality monitoring.
[0152] 2. Parallel Processing
[0153] Technical point 1-Efficient detection: Slice processing allows large images to be divided into multiple small slices, and each slice is processed in parallel, which significantly improves the detection speed. This is especially important for real-time monitoring and large-scale water body detection.
[0154] Technical point 2-resource optimization: Through parallel processing, a large number of images can be processed in a shorter time, optimizing the use of computing resources and improving overall detection efficiency.
[0155] Application: In large farms or reservoirs, the water area is vast and the number of large images that need to be processed is huge. Parallel processing can significantly increase the detection speed and ensure that water quality problems are discovered in a timely manner.
[0156] 3. Dynamically adjust resolution
[0157] Technical point 1-Adaptive processing: Dynamically adjust the image resolution according to the image content and detection requirements. For areas with rich details, high resolution can be used for detection; for simpler areas, the resolution can be reduced to save computing resources.
[0158] Technical point 2-Intelligent reasoning: Using machine learning algorithms, based on image features and detection results, intelligently select the optimal resolution for reasoning to improve detection effect and efficiency.
[0159] Application: In actual detection, the distribution and density of microalgae in different waters may vary greatly. Dynamic adjustment of resolution can be optimized according to actual conditions to improve the flexibility and accuracy of detection.
[0160] 4. Full coverage detection
[0161] Technical point 1-Sliding window technology: Slicing is performed in a sliding window manner to ensure that every area of the large image can be fully detected. There can be a certain overlap between slices to avoid the target being cut at the edge.
[0162] 5. Flexibility and Scalability
[0163] Technical point 1-Parameter adaptation: The detection system can flexibly adjust the slice size and super-resolution parameters according to actual needs to adapt to different detection tasks and image types.
[0164] Technical point 2-Modular design: The slice processing and super-resolution inference modules can be independently developed and optimized, with strong scalability and easy integration into different detection systems.
[0165] Application: In freshwater aquaculture, different farms and water bodies may have different detection requirements. Flexibility and scalability allow the detection system to be adjusted and optimized according to specific needs to adapt to various detection scenarios.
[0166] Combination Figure 4-6 As shown, it can be seen that compared with the prior art, this method has a significant improvement in detection effect. Figure 4 The technical basis of the method is: obtaining high-resolution images of freshwater aquaculture ponds with an image size of 5472x 3648 pixels; dividing the images into slices of 640x640 pixels with an overlap area of 128 pixels between slices. Figure 5 The technical basis of the method is: obtaining high-resolution images of freshwater aquaculture ponds with an image size of 5472x 3648 pixels; dividing the images into slices of 640x640 pixels with an overlap area of 128 pixels between slices. Figure 6The technical basis is: obtaining high-resolution images of freshwater aquaculture ponds with an image size of 1382x 1432 pixels; dividing the images into slices of 640x640 pixels with an overlap of 128 pixels between slices. Directly using model inference refers to the results obtained by directly using the YOLOv8 model or SAHI method.
[0167] In summary, the slice-assisted super-inference multi-resolution image freshwater aquaculture microalgae detection method of this embodiment, by introducing SAHI and YOLOV8 technology, can process large-size images, improve detection accuracy and speed, and is suitable for real-time monitoring needs of large-scale farms. By dividing large images into small slices and combining the YOLOV8 target detection model, in addition, this method has high flexibility and adaptability, and can be integrated with existing automation equipment and information systems to realize the automation and intelligence of microalgae detection.
[0168] In the embodiments provided in the present application, it should be understood that the embodiments described herein can be implemented in hardware, software, firmware, middleware, code or any appropriate combination thereof. For hardware implementation, the processor can be implemented in one or more of the following units: application specific integrated circuit (ASIC), digital signal processor (DSP), digital signal processing device (DSPD), programmable logic device (PLD), field programmable gate array (FPGA), processor, controller, microcontroller, microprocessor, other electronic units designed to implement the functions described herein or their combination. For software implementation, part or all of the flow of the embodiment can be completed by instructing the relevant hardware through a computer program. When implemented, the above program can be stored in a computer-readable storage medium or transmitted as one or more instructions or codes on a computer-readable storage medium. Computer-readable storage media include computer storage media and communication media, wherein the communication medium includes any medium that is convenient for transmitting a computer program from one place to another. The storage medium can be any available medium that a computer can access. The computer-readable storage medium can include but is not limited to RAM, ROM, EEPROM, CD-ROM or other optical disk storage, disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of an instruction or data structure and can be accessed by a computer.
[0169] Finally, it should be noted that the above is only a preferred embodiment of the present application and is not intended to limit the present application. Although the present application has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A slice-assisted hyper-inference multi-resolution image freshwater aquaculture microalgae detection method, characterized in that: The method comprises the following steps: Image slicing: adjust and preset the size and overlapping area of the slices, and cut large-size water monitoring images into multiple slices; Slice processing: Use the YOLOV8 target detection model to identify and count the microalgae in each slice individually; Result merging: Merge the detection results of all slices to obtain the detection results of the entire large-scale water body monitoring image.
2. The slice-assisted hyper-inference multi-resolution image freshwater aquaculture microalgae detection method according to claim 1 is characterized in that: The image slices specifically include: Image input: Input a large-size water body detection image, and define the size of the image as H×W; Slice parameter settings: Set the slice height slice_height to the height input size during YOLOV8 target detection model training, set the slice width slice_width to the width input size during YOLOV8 target detection model training, and set the height overlap ratio overlap_height_ratio and width overlap ratio overlap_width_ratio; Calculate the size of the overlapping area: Use the formula overlap_height = slice_height × overlap_height_ratio to calculate the height overlap size overlap_height, and use the formula overlap_width = slice_width × overlap_width_ratio to calculate the width overlap size overlap_width; Slice the image: Slice the large-size water monitoring image based on the set slicing parameters and overlapping area size.
3. The slice-assisted hyper-inference multi-resolution image freshwater aquaculture microalgae detection method according to claim 2 is characterized in that: The slicing of the image specifically includes: Slice step length: The vertical step length step_height is calculated by the formula step_height = slice_height-overlap_height, and the horizontal step length step_width is calculated by the formula step_width = slice_width-overlap_width; Slicing operation: Initialize the slice list S, where the vertical direction starts from 0 and slices with a step length of step_height in the vertical direction until the bottom of the large-sized water body monitoring image; the horizontal direction starts from 0 and slices with a step length of step_width in the horizontal direction until the right edge of the large-sized water body monitoring image, and for each slice, record its upper left corner coordinates (x, y) and lower right corner coordinates (x+slice_width, y+slice_height); Slicing result: a plurality of slices are obtained, wherein the size of each slice is slice_width×slice_width, and the offset information of each slice in the large-size water body monitoring image is (x, y).
4. The slice-assisted hyper-inference multi-resolution image freshwater aquaculture microalgae detection method according to claim 3 is characterized in that: The slicing process specifically includes: Input the slice into the YOLOV8 target detection model for reasoning to obtain a detection result, wherein the detection result includes the location, type and confidence of the microalgae; The detection results are post-processed to filter out low-confidence detection boxes and retain high-confidence detection results.
5. The slice-assisted hyper-inference multi-resolution image freshwater aquaculture microalgae detection method according to claim 4 is characterized in that: The combined results specifically include: Coordinate adjustment: convert the detection results in the slice back to the coordinate system of the large-scale water monitoring image; Merge results: Merge the detection results of all slices of the coordinate system converted into a large-size water body monitoring image to form an overall detection result; Obtaining the final detection result: Using non-maximum suppression to remove redundant bounding boxes from the overall detection result, retaining the best detection result as the detection result of the entire large-scale water body monitoring image.
6. The slice-assisted hyper-inference multi-resolution image freshwater aquaculture microalgae detection method according to claim 5 is characterized in that: The coordinate adjustment specifically includes: Calculate the offset: The position of each slice in the large-scale water monitoring image is calculated using the upper left corner coordinate of the slice (offset x ,offset y ) is used to indicate; Coordinate transformation: Adjust the coordinates of the upper left corner and lower right corner of each detection box to obtain the transformed coordinates (x' max ,y' max ),and, Among them, the coordinates of the upper left corner of each detection box are (x min ,y min ), the coordinate of the lower right corner is (x max ,y max ).
7. The slice-assisted hyper-inference multi-resolution image freshwater aquaculture microalgae detection method according to claim 6 is characterized in that: The obtaining of the final detection result specifically includes: Algorithm processing: Sort the detection frames according to their confidence scores, perform non-maximum suppression on the detection frames in the overlapping areas, and remove duplicate detection frames; process each detection frame one by one, and retain the detection frames whose overlap with the current detection frame is lower than the threshold; Non-maximum suppression is applied to the formed overall detection result, and the detection results of each slice are spliced according to their positions in the large-scale water body monitoring image to form the detection result of the entire large-scale water body monitoring image.
8. The slice-assisted hyper-inference multi-resolution image freshwater aquaculture microalgae detection method according to claim 7 is characterized in that: The calculation process of the overlap degree is specifically as follows: Define the coordinates of the upper left corner of the detection box A as The coordinates of the lower right corner of the detection box A are The coordinates of the upper left corner of the detection box B are The coordinates of the lower right corner of the detection box B are The coordinates of the overlapping area are The area of the overlapping region is The area of the detection box A is The area of the detection box B is The calculation formula for the overlap between detection frame A and detection frame B is:
Citation Information
Patent Citations
Road environment multi-target identification and tracking method and device
CN114882462A
Powder spraying defect detection method based on improved YOLOV7
CN116645352A
Image small target detection method and device based on slice auxiliary network module
CN117541862A
Large-scale image ore detection method based on improved YOLOv5x
CN117611807A
Cited By
Solenopsis invicta identification method, device and equipment applied to biological detection vehicle and medium
CN121214073A
Ultra-large background image diatom positioning and identification method based on deep learning
CN121564381A