Lightweight multi-scale fusion microalgae detection method based on YOLOV8

By constructing a lightweight multi-scale fusion microalgae detection method, and using mobilenetV3, BiFPN and MGCAA modules to optimize the YOLOV8 network, the problems of insufficient detection accuracy and high computational overhead are solved, and efficient microalgae target recognition is achieved.

CN120279549APending Publication Date: 2025-07-08SOUTHWEAT UNIV OF SCI & TECH
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510317621.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-18
Publication Date
2025-07-08

AI Technical Summary

Technical Problem

The existing microalgae detection method based on convolutional neural networks is insufficient in detection accuracy and has a large calculation overhead when facing scenes with dense microalgae and complex backgrounds.

Method used

By adopting the lightweight multi-scale fusion method based on YOLOV8, by building a lightweight backbone network, neck network, attention mechanism and detection head, combining mobilenetV3, BiFPN, C2f RepGhost modules and MGCAA modules, feature extraction and fusion are optimized, computing complexity is reduced, and detection accuracy is improved.

Benefits of technology

In a complex context, the accuracy and efficiency of microalgae detection are significantly improved, and the computing overhead is reduced, and it is suitable for real-time detection of mobile terminals and embedded devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120279549A_ABST
    Figure CN120279549A_ABST
Patent Text Reader

Abstract

The invention relates to a light-weight multi-scale fusion microalgae detection method based on YOLOV8. The method comprises the following steps: acquiring and preprocessing a microalgae data set to obtain a training set, a verification set and a test set; constructing a lightweight multi-scale feature information microalgae image detection network model based on YOLOV8, wherein the network model comprises a lightweight backbone network, a neck network, an attention mechanism and a detection head; adopting the training set and the verification set to train the lightweight multi-scale feature information microalgae image detection network model; and inputting the test set into the trained lightweight multi-scale feature information microalgae image detection network model, and outputting a microalgae type detection result. According to the method, different types of microalgae in the image under the microscope can be identified according to the characteristics that the region of the microalgae in the image is complex in background and the to-be-detected target is tiny and densely exists, and the position of the microalgae in the image is positioned through the bounding box, so that the reasoning speed is increased and the calculation overhead is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of object detection, and particularly to a lightweight multi-scale fusion microalgae detection method based on YOLOV8. Background Art

[0002] Microalgae are the main single-celled organisms in the water ecosystem and play a crucial role. As the main producers of organic matter, they absorb carbon dioxide through photosynthesis and convert it into organic matter, while releasing oxygen, which not only provides a food source for other organisms in the water but also effectively alleviates the greenhouse effect. In addition, microalgae also have important value in the social and commercial fields. They can absorb nitrogen and phosphorus in the water, thus playing a role in purifying sewage. Due to their rich oil content, microalgae are also regarded as an ideal raw material for producing biodiesel. Therefore, in order to maintain the balance of the microalgae living water ecosystem, it is necessary to regularly monitor and evaluate the types of microalgae.

[0003] With the rapid development of computer vision and the continuous increase in the demand for microalgae detection under the microscope, machine learning and deep learning have dominated the microalgae detection field in just a few years. In recent years, object detection methods based on convolutional neural networks have been widely applied to multiple microbial detection scenarios such as fungal detection, virus detection, and protozoan detection. This method has also been applied to microalgae detection. By innovating various convolutional structures to improve the network's feature extraction and feature fusion capabilities and continuously improving, a single-celled algae detection model AlgaeNet based on the improved VGG16 model has been proposed, three branches have been added on the basis of Faster R-CNN to achieve multi-task microalgae detection, the OSA-V3 block different from the traditional backbone network, and a microalgae detection method EOA based on YOLOX and dynamic input feature extraction. Although the method based on convolutional neural network has excellent performance, due to the feature locality brought by the progressive operator in the convolutional structure, they still have unbalanced features when modeling global and context information. Therefore, the convolutional structure has limitations in feature description for targets with large differences in texture, shape, and size. YOLOv8 can show relatively high accuracy when detecting small targets (such as microalgae) with its powerful feature extraction and multi-scale fusion, but its accuracy is slightly insufficient and the computational cost is relatively large when facing scenes with dense microalgae and complex backgrounds.

[0004] Therefore, in the related art, there is an urgent need for a method that can improve the accuracy of microalgae object detection and reduce the computational cost. Summary of the Invention

[0005] Based on this, it is necessary to provide a lightweight multi-scale fusion microalgae detection method based on YOLOV8 that can improve the accuracy of microalgae object detection and reduce the computational cost for the above technical problems.

[0006] In the first aspect, the present application provides a lightweight multi-scale fusion microalgae detection method based on YOLOV8. The method includes:

[0007] Obtain a microalgae dataset and perform preprocessing to obtain a training set, a validation set, and a test set;

[0008] Build a lightweight multi-scale feature information microalgae image detection network model based on YOLOV8. The network model includes a lightweight backbone network, a neck network, an attention mechanism, and a detection head;

[0009] Use the training set and the validation set to train the lightweight multi-scale feature information microalgae image detection network model;

[0010] Input the test set into the trained lightweight multi-scale feature information microalgae image detection network model to output the microalgae type detection result.

[0011] Optionally, in an embodiment of the present application, the lightweight backbone network includes a mobilenetV3 module, a con-bn-hardswish activation function module, and a multi-scale fusion mechanism module.

[0012] Optionally, in an embodiment of the present application, the neck network is built based on the multi-scale feature pyramid BiFPN structure, and the C2f module is replaced by a C2f RepGhost module.

[0013] Optionally, in an embodiment of the present application, the attention mechanism includes a multi-branch depthwise separable convolution structure, a dynamic gating mechanism, and a channel splicing fusion strategy.

[0014] Optionally, in an embodiment of the present application, the method further includes:

[0015] Evaluate the performance of the microalgae image detection network model using accuracy, recall, and mean average precision.

[0016] In the second aspect, the present application also provides a lightweight multi-scale fusion microalgae detection device based on YOLOV8. The device includes:

[0017] An image acquisition module for obtaining a microalgae dataset and performing preprocessing to obtain a training set, a validation set, and a test set;

[0018] A model building module for building a lightweight multi-scale feature information microalgae image detection network model based on YOLOV8. The network model includes a lightweight backbone network, a neck network, an attention mechanism, and a detection head;

[0019] A model training module for training the lightweight multi-scale feature information microalgae image detection network model using the training set and the validation set;

[0020] A microalgae detection module for inputting the test set into the trained lightweight multi-scale feature information microalgae image detection network model and outputting the microalgae type detection result.

[0021] In a third aspect, the present application also provides a computer device. The computer device includes a memory and a processor. The memory stores a computer program, and the processor executes the steps of the methods described in the above respective embodiments.

[0022] In a fourth aspect, the present application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, and when the computer program is executed by a processor, the steps of the methods described in the above respective embodiments are implemented.

[0023] The above-mentioned microalgae detection method based on lightweight multi-scale fusion of YOLOV8 first obtains a microalgae data set and performs preprocessing to obtain a training set, a validation set, and a test set; then, constructs a lightweight multi-scale feature information microalgae image detection network model based on YOLOV8, and the network model includes a lightweight backbone network, a neck network, an attention mechanism, and a detection head; then, trains the lightweight multi-scale feature information microalgae image detection network model using the training set and the validation set; finally, inputs the test set into the trained lightweight multi-scale feature information microalgae image detection network model and outputs the microalgae type detection result. That is to say, through multi-dimensional technological innovation, the coordinated optimization of detection accuracy and real-time performance is achieved: First, a lightweight backbone network is constructed based on mobilenetV3, significantly reducing the model parameter quantity and computational complexity, and combining with the SPPELAN structure to enhance the multi-scale feature fusion ability, effectively improving the detection performance of small targets while ensuring low resource consumption of mobile / embedded devices; Second, a feature fusion neck is constructed using the BiFPN architecture and the C2f RepGhost module is innovatively introduced, and multi-scale spatial information is deeply absorbed through a multi-level feature interaction and context propagation mechanism; The further designed MGCAA lightweight attention module, through the dual-branch cooperation of local detail enhancement and large receptive field modeling, combined with the optimized combination of depthwise separable convolution and dilated convolution, significantly enhances the feature distinguishability of small and dense targets in complex backgrounds, while maintaining the balance of high-frequency detail fidelity and computational efficiency. It can identify different types of microalgae in microscopic images according to the characteristics of the complex background in the area where microalgae are located in the picture, the small and dense presence of the targets to be detected, and locate their positions in the image through bounding boxes, improving the inference speed and reducing the computational overhead. Description of the Drawings

[0024] Figure 1 It is an application environment diagram of a microalgae detection method based on lightweight multi-scale fusion of YOLOV8 in an embodiment;

[0025] Figure 2 It is a schematic flow diagram of a microalgae detection method based on lightweight multi-scale fusion of YOLOV8 in an embodiment;

[0026] Figure 3 It is a schematic structural diagram of a microalgae image detection network model with lightweight multi-scale feature information in an embodiment;

[0027] Figure 4 It is a schematic structural diagram of a lightweight backbone network in an embodiment;

[0028] Figure 5 It is a schematic diagram of the multi-scale feature pyramid structure of the neck network in an embodiment;

[0029] Figure 6 It is a schematic structural diagram of the C2f RepGhost module in an embodiment;

[0030] Figure 7 It is a schematic architecture diagram of MGCAA in an embodiment;

[0031] Figure 8 It is a structural block diagram of a microalgae detection device based on lightweight multi-scale fusion of YOLOV8 in an embodiment;

[0032] Figure 9 It is an internal structure diagram of a computer device in an embodiment. Specific embodiments

[0033] In order to make the objectives, technical solutions and advantages of this application clearer, the following further elaborates on this application in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not used to limit this application.

[0034] The microalgae detection method based on lightweight multi-scale fusion of YOLOV8 provided in the embodiments of this application can be applied to, for example Figure 1In the application environment shown. Among them, the terminal communicates with the server through the network. The data storage system can store the data that the server needs to process. The data storage system can be integrated on the server, or can be placed on the cloud or other network servers. Among them, the terminal can be but is not limited to various personal computers, laptop computers, smart phones, tablet computers, Internet of Things devices, and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, etc. The portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server can be implemented with an independent server or a server cluster composed of multiple servers.

[0035] In one embodiment, as Figure 2 shown, a lightweight multi-scale fusion microalgae detection method based on YOLOV8 is provided. Taking the server in Figure 1 as an example for illustration, it includes the following steps:

[0036] S201: Obtain a microalgae dataset and perform preprocessing to obtain a training set, a validation set, and a test set.

[0037] In the embodiment of the present application, first, collect samples of independent types of microalgae, place them under a microscope for observation, and take original images. The microalgae types are common freshwater types such as Anabaena. At the same time, perform pairwise random mixing and three-way random mixing of microalgae samples, and also take original images. And standardize the resolution of all images to 640×640 pixels. Then, randomly allocate the original images of all algae according to the ratio of the sum of the training set and the validation set to the test set being 9:1, and then randomly divide the images into a training set and a validation set according to the ratio of the training set to the validation set being 9:1. Manually annotate all the images in the training set and the validation set, and store them in the PASCAL VOC format.

[0038] S203: Build a lightweight multi-scale feature information microalgae image detection network model based on YOLOV8. The network model includes a lightweight backbone network, a neck network, an attention mechanism, and a detection head.

[0039] In the embodiment of the present application, based on the YOLOV8 object detection network, a lightweight multi-scale feature information microalgae image detection network model is built, as Figure 3As shown, the network model includes a lightweight backbone network, a neck network, an attention mechanism, and a detection head. The operations adopted by each layer corresponding to each box are as follows: the green box represents the upsampling operation, the red box represents the downsampling operation, the yellow box represents the attention mechanism designed by the present invention, and the purple box represents the three detection heads of the original YOLOV8 object detection network. The numbers beside the boxes represent the changes in the image size. Among them, mobilenetV3 is used to replace the CSPDarknet backbone network to achieve backbone lightweighting, and SPPELAN (Spatial PyramidPooling with Enhanced Local Attention Network) with a better multi-scale fusion mechanism is added to enable better feature extraction and detection of small targets; the neck of the object detection network is built with a BiFPN (Bi-directional Feature Pyramid Network) structure to reduce the impact of complex backgrounds in the image on the detection of microalgae targets, and then the original C2f module is replaced with a C2f RepGhost module to further help the model better distinguish small targets from complex backgrounds; and a lightweight attention module named Multi-Granularity Context Aggregation Attention (MGCAA) is added between the neck network and the detection head. This module fuses local details and context information through a multi-branch structure and enhances the feature response of small targets by combining residual connections.

[0040] Specifically, in an embodiment of the present application, the lightweight backbone network includes a mobilenetV3 module, a con-bn-hardswish activation function module, and a multi-scale fusion mechanism module.

[0041] In an embodiment of the present application, the lightweight backbone network includes a mobilenetV3 module, a con-bn-hardswish activation function module, and a multi-scale fusion mechanism module. As Figure 4 shown, the leftmost is an overview diagram of the entire lightweight backbone network, and the three networks on the right are the disassemblies of each part of the overview diagram. Represents the linear superposition of features in the channel dimension. The size change of the feature map tensor is marked beside the box. Depthwise separable convolution (DWConv) is adopted in the modules of MobileNetV3, significantly reducing the number of parameters and computational volume. The Hardswish activation function enhances the non-linearity, improves the learning efficiency, and maintains the performance at the same time. The SE layer selectively emphasizes important features and can represent relevant information more effectively compared with the traditional residual connections of the original backbone CSPDarknet of YOLOV8. In addition, the improved backbone can choose to use or not use the SE block and Hardswish according to needs, facilitating optimization according to the specific situation of the microalgae detection task. The improved backbone emphasizes efficiency and adaptability, and is more suitable for the diverse deployment scenarios such as microalgae detection. In contrast, the original network backbone is more complex and heavy. Let be the input tensor, with C in ≠C hidden as an example, the main calculation process in the MobileNetV3 block is as follows:

[0042] PWconv:

[0043] DWconv:

[0044] SE module:

[0045]

[0046] In addition to lightweighting the backbone network, compared with the original Spatial Pyramid Pooling Layer (SPPF) of YOLOV8, the advantages of SPPELAN are more obvious when detecting small targets in complex backgrounds. Its multi-scale pooling layer can extract more fine-grained features, helping to capture the details of small targets. In addition, the convolutional structure of SPPELAN makes it more robust when dealing with complex backgrounds and can distinguish targets from backgrounds more effectively. Therefore, SPPELAN is superior to SPPF in terms of accuracy and detection ability, especially in challenging environments. In microalgae detection, SPPELAN is more capable because it can process the subtle features in complex backgrounds. Some microalgae are small in size and similar to the background, so the multi-scale feature extraction ability of SPPELAN can help improve the detection accuracy. In addition, the structure of SPPELAN can better adapt to the morphological changes of microalgae and enhance the recognition ability of different types of microalgae. Let be the input tensor, and the main calculation process in SPPELAN is as follows:

[0047]

[0048] In one embodiment of the present application, the neck network is built based on the multi-scale feature pyramid BiFPN structure, and the C2f RepGhost module is used to replace the C2f module.

[0049] In one embodiment of the present application, for the neck network, the BiFPN (Bi-directional Feature Pyramid Network) with better detection effect is used to replace the FPN structure of the original PANet (Path Aggregation Network) in yolov8. The structures of the two are as Figure 5 shown. The colored dots represent the same operation layer, and the colorless dots represent the three inputs from the backbone network (from three different layers respectively).

[0050] The advantage of BiFPN is that by introducing a bidirectional feature transfer mechanism, it enables features to flow bidirectionally between the high layer and the low layer, which helps to better fuse features at different levels and improve the detection ability for some small targets existing in microalgae. In addition, compared with PANet, BiFPN can more effectively fuse the feature information from different layers. This fusion method can better capture the background complexity and reduce the influence of noise on the detection of microalgae patterns in complex backgrounds. Moreover, BiFPN enhances the feature expression ability through bidirectional feature fusion, making it easier for the model to identify and distinguish small microalgae targets in complex backgrounds.

[0051] To further enhance the detection efficiency of the model, the original C2f module is replaced with the C2f RepGhost module. The structure of C2f RepGhost makes it more efficient in feature extraction. By using the RepGhost Bottleneck, the number of parameters of the model can be effectively reduced while maintaining the expression ability of high-dimensional features. This is particularly important for the detection of small targets because these targets often resemble the features of complex backgrounds, and detailed feature extraction can help the model better distinguish targets from backgrounds. In addition, it is more computationally efficient. It accelerates the forward propagation process by reducing redundant calculations, which means that the model can respond faster when processing images, and this is very important for a real-time microalgae detection system. Moreover, through the repeated bottleneck structure, C2F RepGhost can better fuse features at different scales and improve the sensitivity to microalgae targets. The overall structure of C2F RepGhost is as Figure 6 shown, and the left side is the structure diagram of RepGhost Bottleneck in the C2f RepGhost module. Let be the input tensor, and the main calculation process of the RepGhost Bottleneck module is as follows:

[0052]

[0053] In one embodiment of the present application, the attention mechanism includes a multi-branch depthwise separable convolution structure, a dynamic gating mechanism, and a channel splicing and fusion strategy.

[0054] In one embodiment of the present application, to better solve the detection problems such as the similar colors of microalgae targets and the culture medium background under the microscope, small size, and dense distribution, a multi-granularity context aggregation attention mechanism (MGCAA) designed for microalgae microscopic images is introduced between the network neck and the detection head: In the spatial attention generation part, a multi-branch depthwise separable convolution structure (including three parallel branches: 3×3 local convolution, 5×5 dilated convolution, and a direct connection path) is designed to fuse the feature responses of different scales through a dynamic gating mechanism. The improved attention module adopts a "branch-fusion" strategy. First, it extracts local texture and large-range context information through depthwise separable convolution, then uses lightweight cross-branch interaction gating to adaptively allocate the weights of each branch, and finally focuses on the key area through channel splicing and spatial attention.

[0055] This mechanism significantly improves the detection ability of small and dense targets in microscopic images through three core designs: First, in the multi-branch feature extraction architecture, the 3×3 depthwise separable convolution focuses on local high-frequency details to enhance the target edge contrast, the 5×5 dilated convolution (dilation = 3) constructs a large receptive field to perceive context information and suppress background noise, and the direct connection path retains the complete morphological features at the original resolution; Second, the cross-branch dynamic gating mechanism generates adaptive weights through lightweight global feature analysis, realizes the autonomous balance between local details and context information, and ensures stable feature selection in the low-contrast scene between the target and the background; Third, the channel splicing and fusion strategy is combined with 1×1 convolution compression to integrate multi-scale features while maintaining a lightweight number of parameters, avoiding the real-time processing delay of microscopic images caused by module complexity. This design specifically addresses the core pain points of small target size, dense distribution, and complex background in the microscopic scene, and optimizes the detection robustness through multi-level feature complementarity and dynamic weight decision-making. Let X ∈ R C×H×W be the input tensor, and the overall structure of the new attention mechanism designed by the present invention is as Figure 7 shown. "DWconv" represents the depthwise separable convolution layer (Depthwise Separable Convolution), "GAP" represents the global average pooling layer (Global Average Pooling), and "⊙" represents the element-wise multiplication of features (broadcasting mechanism). The main calculation process in the new attention mechanism is as follows:

[0056] Multi-branch feature extraction:

[0057]

[0058] Y3 = X ∈ R C×H×W

[0059] Cross-branch interaction gating:

[0060]

[0061] α, β = Softmax(Conv 1×1 (ReLU(Conv 1×1 (GAP(Y gate ))))), α + β = 1

[0062] F1 = α ⊙ Y1, F2 = β ⊙ Y2

[0063] Multi-granularity feature fusion:

[0064]

[0065] M = Sigmoid(Conv 1×1 (Y concat )) ∈ [0, 1] 1×H×W

[0066] Feature enhancement and residual connection:

[0067] X enhanced = X ⊙ M ∈ R C×H×W

[0068] Y = X enhanced + X

[0069] S205: Use the training set and the validation set to train the lightweight multi-scale feature information microalgae image detection network model.

[0070] In the embodiment of the present application, the number of training iterations is set to 300, the batch normalization size is 32, the initial learning rate is 1e-3, the Adam optimizer is used to optimize the model, and the prepared training data set is used to train the model; during the training process, the prepared validation set is loaded for validation every 1 iteration of training, the current obtained validation average precision result is recorded, and each time a comparison is made, when the precision is higher, the current model weights are saved until the iteration loop ends, and finally the model weights with the best average precision of the validation result will be saved. It is also possible to appropriately adjust the number of iterations or set early stopping according to the precision result measured by the validation set to save training time and avoid overfitting.

[0071] S207: Input the test set into the trained lightweight multi-scale feature information microalgae image detection network model, and output the microalgae type detection result.

[0072] In the embodiments of the present application, the prepared test set is used to test the model effect by loading the model weights, and the test set is tested three times to obtain the average test result, that is, the microalgae type detection result.

[0073] In one embodiment of the present application, the method further includes:

[0074] The performance of the microalgae image detection network model is evaluated by accuracy, recall rate, and mean average precision.

[0075] In one embodiment of the present application, for multi-class object detection, the average precision (AP) is calculated using the model accuracy (P) and recall rate (R) of each class, and then the mean average precision (mAP) is derived as the performance evaluation criterion for the object detection model. Therefore, the model performance is evaluated by checking the experimental AP value. The accuracy rate is the percentage of correctly predicted samples among the samples predicted as positive, and the recall rate is the proportion of correctly predicted positive samples in the total actual positive samples. Thus, the accuracy rate and recall rate are defined as follows:

[0076]

[0077] Among them, true positive (TP) means that the prediction is positive and the actual is positive. False positive (FP) means that the predicted value is positive while the actual value is negative. False negative (FN) means that the predicted value is negative while the actual value is positive.

[0078] The F1 value is the harmonic mean of the accuracy rate and the recall rate, and is used to evaluate the overall performance of the model, especially when both indicators are important and the dataset is imbalanced. The AP value is the area between the curve and the coordinate axis. The mean AP value of multiple classes is the mAP value. The specific formulas are as follows:

[0079]

[0080] AP = ∫0 1 P(R)dR

[0081]

[0082] In an embodiment of the present application, a comparison is made between an existing classical model and the lightweight multi-scale feature information microalgae image detection network model of the present application on the same dataset. The results show that the proposed method has significant advantages in microalgae image detection. Compared with the original YOLOv8, the inference time per single image, mAP@0.5 have been significantly improved. The inference time per single image is significantly shortened, mAP@0.5 is improved, and the number of model parameters and floating-point operation amounts are also greatly reduced. The improvement in the model detection ability and the significant reduction in the model scale also make it possible to detect microalgae with high-precision requirements on small mobile devices. In the specific scenario of identifying microalgae with the model of the present application on a self-made dataset, not only the precision rate, F1 value, and mAP@0.5 exceed other methods, but also the inference time per single image is shorter than other methods.

[0083] In the above-mentioned microalgae detection method based on lightweight multi-scale fusion of YOLOv8, first, a microalgae dataset is obtained and preprocessed to obtain a training set, a validation set, and a test set; then, a lightweight multi-scale feature information microalgae image detection network model is constructed based on YOLOv8. The network model includes a lightweight backbone network, a neck network, an attention mechanism, and a detection head; then, the training set and the validation set are used to train the lightweight multi-scale feature information microalgae image detection network model; finally, the test set is input into the trained lightweight multi-scale feature information microalgae image detection network model to output the microalgae type detection result. That is to say, through multi-dimensional technological innovation, the collaborative optimization of detection accuracy and real-time performance is achieved: First, a lightweight backbone network is constructed based on MobileNetV3, which significantly reduces the number of model parameters and computational complexity. Combining the SPPELAN structure enhances the multi-scale feature fusion ability, and effectively improves the detection performance of small targets on the premise of ensuring low resource consumption of mobile / embedded devices; Second, a feature fusion neck is constructed using the BiFPN architecture and the C2f RepGhost module is innovatively introduced. Through multi-level feature interaction and context propagation mechanisms, multi-scale spatial information is deeply absorbed; The further designed MGCAA lightweight attention module, through the dual-branch collaboration of local detail enhancement and large receptive field modeling, combined with the optimized combination of depthwise separable convolution and dilated convolution, significantly enhances the feature distinguishability of small and dense targets in complex backgrounds, while maintaining the balance of high-frequency detail fidelity and computational efficiency. It can identify different types of microalgae in microscopic images according to the characteristics of the complex background in the area where microalgae are located in the picture, the small and dense presence of the targets to be detected, and locate their positions in the image through bounding boxes, improving the inference speed and reducing the computational overhead.

[0084] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are shown in sequence according to the indications of the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.

[0085] Based on the same inventive concept, an embodiment of the present application further provides a microalgae detection device based on lightweight multi-scale fusion of YOLOV8 for implementing the above-mentioned microalgae detection method based on lightweight multi-scale fusion of YOLOV8. The implementation solutions provided by this device to solve problems are similar to the implementation solutions described in the above method. Therefore, the specific limitations in one or more embodiments of the microalgae detection device based on lightweight multi-scale fusion of YOLOV8 provided below can refer to the limitations on the microalgae detection method based on lightweight multi-scale fusion of YOLOV8 in the above text, and will not be repeated here.

[0086] In one embodiment, as Figure 8 shown, a microalgae detection device 800 based on lightweight multi-scale fusion of YOLOV8 is provided, including: an image acquisition module 801, a model construction module 803, a model training module 805, and a microalgae detection module 807, where:

[0087] The image acquisition module 801 is used to obtain a microalgae data set and perform preprocessing to obtain a training set, a validation set, and a test set.

[0088] The model construction module 803 is used to construct a lightweight multi-scale feature information microalgae image detection network model based on YOLOV8. The network model includes a lightweight backbone network, a neck network, an attention mechanism, and a detection head.

[0089] The model training module 805 is used to train the lightweight multi-scale feature information microalgae image detection network model by using the training set and the validation set.

[0090] The microalgae detection module 807 is used to input the test set into the trained lightweight multi-scale feature information microalgae image detection network model and output a microalgae type detection result.

[0091] In one embodiment of the present application, the lightweight backbone network includes a mobilenetV3 module, a con-bn-hardswish activation function module, and a multi-scale fusion mechanism module.

[0092] In one embodiment of the present application, the neck network is built based on the multi-scale feature pyramid BiFPN structure, and the C2f RepGhost module is used to replace the C2f module.

[0093] In one embodiment of the present application, the attention mechanism includes a multi-branch depthwise separable convolution structure, a dynamic gating mechanism, and a channel splicing and fusion strategy.

[0094] In one embodiment of the present application, the method further includes:

[0095] Evaluating the performance of the microalgae image detection network model using accuracy, recall, and mean average precision.

[0096] Each module in the above-mentioned microalgae detection device based on lightweight multi-scale fusion of YOLOV8 can be implemented in whole or in part by software, hardware, and their combination. The above-mentioned modules can be embedded in the processor of the computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to the above-mentioned modules.

[0097] In one embodiment, a computer device is provided. The computer device can be a terminal, and its internal structure diagram can be as Figure 9 shown. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner. The wireless manner can be achieved through WIFI, a mobile cellular network, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a method for detecting microalgae based on lightweight multi-scale fusion of YOLOV8. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covered on the display screen, or a button, a trackball, or a touchpad set on the housing of the computer device, or an external keyboard, a touchpad, or a mouse, etc.

[0098] Those skilled in the art can understand, Figure 9The structure shown is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.

[0099] In one embodiment, a computer device is provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the steps in the above method embodiments are implemented.

[0100] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above method embodiments are implemented.

[0101] In one embodiment, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the steps in the above method embodiments are implemented.

[0102] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0103] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., without limitation.

[0104] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in this specification.

[0105] The above-described embodiments merely represent several implementation manners of the present application. The description is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.

Claims

1. A lightweight multi-scale fusion microalgae detection method based on YOLOV8, characterized in that The method includes: Obtaining a microalgae dataset and performing preprocessing to obtain a training set, a validation set, and a test set; Constructing a lightweight multi-scale feature information microalgae image detection network model based on YOLOV8, where the network model includes a lightweight backbone network, a neck network, an attention mechanism, and a detection head; Training the lightweight multi-scale feature information microalgae image detection network model using the training set and the validation set; Inputting the test set into the trained lightweight multi-scale feature information microalgae image detection network model to output the microalgae type detection result.

2. The lightweight multi-scale fusion microalgae detection method based on YOLOV8 according to claim 1, wherein The lightweight backbone network includes a mobilenetV3 module, a con-bn-hardswish activation function module, and a multi-scale fusion mechanism module.

3. The microalgae detection method based on lightweight multi-scale fusion of YOLOV8 according to claim 1, characterized in that The neck network is built based on the multi-scale feature pyramid BiFPN structure, and the C2fRepGhost module is used to replace the C2f module.

4. The lightweight multi-scale fusion microalgae detection method based on YOLOV8 according to claim 1, wherein The attention mechanism includes a multi-branch depthwise separable convolution structure, a dynamic gating mechanism, and a channel splicing and fusion strategy.

5. The lightweight multi-scale fusion microalgae detection method based on YOLOV8 according to claim 1, wherein, The method further includes: Evaluating the performance of the microalgae image detection network model using accuracy, recall, and mean average precision.

6. A lightweight multi-scale fusion microalgae detection device based on YOLOV8, characterized in that, The apparatus includes: An image acquisition module for obtaining a microalgae dataset and performing preprocessing to obtain a training set, a validation set, and a test set; A model construction module for constructing a lightweight multi-scale feature information microalgae image detection network model based on YOLOV8, where the network model includes a lightweight backbone network, a neck network, an attention mechanism, and a detection head; A model training module for training the lightweight multi-scale feature information microalgae image detection network model using the training set and the validation set; A microalgae detection module for inputting the test set into the trained lightweight multi-scale feature information microalgae image detection network model to output the microalgae type detection result.

7. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.

8. 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 method according to any one of claims 1 to 5.

Citation Information

Cited By

  • Chemical experiment device identification method, device and equipment based on multilayer feature fusion

    CN121904723A

  • Chemical experiment device recognition method, device and equipment based on multi-layer feature fusion

    CN121904723B