A method and system for constructing an active sludge indicative microorganism target detection model
By improving the deep learning model and combining Res2Net and CBAM, the detection of microorganisms in activated sludge is optimized, which solves the problem of low efficiency in traditional detection methods and achieves high-precision and low-missing-detection activated sludge microorganism detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENYANG INSTITUTE OF CHEMICAL TECHNOLOGY
- Filing Date
- 2022-06-24
- Publication Date
- 2026-07-10
AI Technical Summary
Traditional activated sludge microbial detection relies on manual identification, which is inefficient and prone to missed or false detections, especially when the differences between activated sludge microbial species are small and the background is similar, resulting in insufficient detection accuracy.
We employ a RetinaNet-based deep learning model, combined with Res2Net modules, channel and spatial attention mechanisms (CBAM), and deep hyperparameterized convolutions. We optimize model parameters using the Focal Loss function to improve feature extraction and detection accuracy.
Under similar background conditions in activated sludge images, the accuracy of microbial detection was significantly improved, the number of missed and false detections was reduced, and the level of intelligent diagnosis in wastewater treatment plants was enhanced.
Smart Images

Figure CN115294569B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to wastewater treatment detection methods and systems, and more particularly to a method and system for constructing a target detection model for indicative microorganisms in activated sludge, which is a method and system for constructing a target detection model for indicative microorganisms in activated sludge based on deep learning. Background Technology
[0002] The main components of an activated sludge system are microorganisms. The diversity and abundance of microbial species are important parameters for controlling wastewater treatment. The accurate detection of microorganisms in phase contrast microscopic images of activated sludge in the activated sludge process is not only key to the activated sludge wastewater treatment method, but also helps to monitor the operation of the activated sludge process. Traditional microscopic examination of activated sludge microorganisms mainly relies on manual identification of microbial species and quantities. This detection method requires professional domain knowledge and suffers from problems such as time consumption and low efficiency.
[0003] In recent years, with the rapid development of neural network theory and artificial intelligence, and the improvement of computing power, more and more scholars have introduced deep learning-based target detection networks into the detection of microorganisms in wastewater. Compared with traditional detection methods, deep learning models have higher detection accuracy and faster speed. However, there are still problems such as the small size of small target microorganisms, the small morphological variation, and the similarity between the color of individual microorganisms and the background color of the image, which lead to the phenomenon of missed detection and false detection of activated sludge microorganisms.
[0004] In view of this, the present invention is proposed. Summary of the Invention
[0005] The technical problem this invention aims to solve is to overcome the shortcomings of existing technologies and provide a method and system for constructing a deep learning-based indicative microbial target detection model for activated sludge. This invention uses a Res2Net module to replace the residual units in the ResNet model to capture rich information from the original features, thus enhancing the network's feature extraction capabilities. Then, a channel and spatial attention mechanism (CBAM) is introduced into the first layer of the backbone network output to further facilitate the flow of feature information within the network. Deep hyperparameterized convolution is introduced in the feature fusion module to continuously accelerate model convergence without increasing computational cost. This invention not only improves the accuracy of activated sludge microorganism detection even when the background color of activated sludge images is similar, but also reduces the false negatives and false negatives of activated sludge microorganisms.
[0006] To address the aforementioned technical problems, this invention proposes a method for constructing a deep learning-based indicative microbial target detection model for activated sludge, comprising the following steps:
[0007] S1, Activated sludge microbial image acquisition system;
[0008] S2: A detection model for detecting microorganisms in activated sludge images is constructed based on the dual attention mechanism CBAM, deep hyperparameterized convolution, and Res2Net-RetinaNet;
[0009] S3: The detection model is trained using an activated sludge microbial image dataset, and the parameters of the detection model are updated using the Focalloss function;
[0010] S4: Input the activated sludge microbial image into the trained model for detection, and output the location and category of the target in the activated sludge microbial image.
[0011] Further, optionally, step S1 includes the following steps:
[0012] S11 uses an optical microscope, an industrial digital camera, and an image acquisition system to scan samples on glass slides to obtain live multi-layer sludge microscopic images, and expands the dataset through data augmentation methods such as rotation, cropping, translation, cutout, brightness, and noise random operations.
[0013] S12, Label the activated sludge microbial image samples, using rectangles to label the eight categories of activated sludge microorganisms and their locations.
[0014] Further, optionally, step S2 includes the following steps:
[0015] S21, the Res2Net module is used as the bottleneck module of ResNet to form a ResNet network as the backbone network;
[0016] S22, the backbone network is responsible for calculating the convolutional feature maps on the entire input image. The first layer of the feature output incorporates a channel-space combined attention mechanism, CBAM, to lock the target region to the region of focus, suppress useless information in the image background, and help feature information flow in the network.
[0017] S23 replaces the traditional convolution in FPN with DO-conv (depth hyperparameterized convolution) and together with the dual attention mechanism CBAM, it forms the CBAM-DOconv-FPN structure, which focuses on key regions while improving network performance and accelerating network training.
[0018] In S24, the first sub-network of the detection module performs convolutional object classification on the output of CBAM-DOconv-FPN; the second sub-network performs convolutional boundary regression. The classification sub-network adopts the Focal Loss function based on the cross-entropy loss function. By inputting anchors, it maps the information of the ground truth boxes onto the output space (targets / labels) of the DADC-Res2Net-RetinaNet network, and solves the loss with the network's output (predictions) in the forward process.
[0019] Further, optionally, step S3 includes the following steps:
[0020] S31, divide the activated sludge microbial dataset into training set, validation set, and test set;
[0021] S32 allows you to set training parameters such as batch size, number of training rounds, learning rate, and weight decay.
[0022] S33, the Focal Loss function based on the cross-entropy loss function is used as the loss function of the classification subnet to calculate the loss, and the optimal solution of the loss function is solved by the gradient descent method. The parameters of the detection model are updated according to the optimal solution of the loss function, and the trained model is saved.
[0023] S34, The detection model is tested using the test set.
[0024] Alternatively, the Focal Loss function formula is as follows:
[0025]
[0026] in, Represents the Focal Loss function. Indicates the confidence level of the sample. is a variable parameter, and y represents the label. Normalization is performed based on the number of true anchor boxes assigned, with the vast majority of anchor boxes being negative samples, receiving negligible loss values under FocalLoss.
[0027] The present invention also proposes a deep learning-based system for constructing a target detection model for indicative microorganisms in activated sludge, which includes one or more processors and a non-transitory computer-readable storage medium storing program instructions. When the one or more processors execute the program instructions, the one or more processors are used to implement the method according to any one of the above technical solutions.
[0028] The present invention also proposes an activated sludge microbial image acquisition system, which includes a server and an edge device, wherein the server is connected to the edge device, and the server adopts any one of the above technical solutions.
[0029] By adopting the above technical solution, this invention has the following beneficial effects compared with the prior art: Addressing the problem that small-target microorganisms among different types of activated sludge microorganisms are small in size, have little morphological variation, and have similar individual microbial colors to the image background, this invention improves this problem by using a Res2Net module and adding a channel- and spatially combined attention mechanism (CBAM) in the RetinaNet backbone network. Simultaneously, introducing deep hyperparameterized convolution in the feature fusion module continuously accelerates model convergence without increasing computational cost. This invention helps improve the intelligent diagnostic level of wastewater treatment plants, enabling real-time and high-precision detection of activated sludge microorganisms. Attached Figure Description
[0030] The accompanying drawings, as part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments and descriptions of the invention are used to explain the invention, but do not constitute an undue limitation of the invention. Obviously, the drawings described below are merely some embodiments, and those skilled in the art can obtain other drawings based on these drawings without creative effort. In the drawings:
[0031] Figure 1 This is a flowchart illustrating a method for constructing a deep learning-based indicative microbial target detection model for activated sludge, according to an embodiment of the present invention.
[0032] Figure 2 This is a schematic diagram of the structure of an activated sludge microbial detection model based on DADC-Res2Net-RetinaNet according to an embodiment of the present invention.
[0033] Figure 3 This is a comparison chart of the regression loss during the training process of the original RetinaNet model and the improved model DADC-Res2Net-RetinaNet model, according to an embodiment of the present invention.
[0034] Figure 4 This is a comparison chart of the detection results of the original RetinaNet model and the improved model DADC-Res2Net-RetinaNet according to an embodiment of the present invention.
[0035] Figure 5 This is a system framework diagram of an activated sludge microbial detection system based on DADC-Res2Net-RetinaNet according to an embodiment of the present invention.
[0036] It should be noted that these accompanying drawings and textual descriptions are not intended to limit the scope of the invention in any way, but rather to illustrate the concept of the invention to those skilled in the art by referring to specific embodiments. Detailed Implementation
[0037] The specific embodiments of the present invention will now be described in further detail with reference to the accompanying drawings.
[0038] This invention applies deep learning target detection algorithms to the identification of indicator microorganisms in activated sludge. Based on the RetinaNet algorithm and considering the difficulties faced in activated sludge microbial detection, an improved algorithm, DADC-Res2Net-RetinaNet, is proposed, which enables rapid and accurate detection of activated sludge microorganisms and reduces missed and false detections of target microorganisms.
[0039] Figure 1 A flowchart illustrating a method for constructing a deep learning-based indicative microbial target detection model for activated sludge according to an embodiment of the present invention is shown. The method for constructing the detection model includes:
[0040] S1, Activated sludge microbial image acquisition system;
[0041] S11, activated sludge samples were collected from the return outlet of the aerobic tank and the external return outlet of the secondary sedimentation tank in the municipal wastewater treatment plant, at a distance of 50 cm from the liquid surface. Each sample was 500 mL, and the interval between sample collection, image acquisition, and water quality index measurement did not exceed 3 hours. Using a pipette, 10 μL of activated sludge sample was extracted and dropped onto a glass slide, which was then covered with a 24 mm × 24 mm square coverslip. The slide was placed on a phase-contrast microscope equipped with a color CCD camera. Using image acquisition software (ToupView), a zigzag path was used from the upper left to the upper right corner, at 100x magnification (10x eyepiece × 10x objective), in a 6×6 pattern, 36 consecutive microscopic images of the activated sludge were acquired in one go. During image acquisition, for smaller microorganisms, the microscope magnification was adjusted to 400x (10x eyepiece × 40x objective) for image acquisition.
[0042] S12 selected 756 representative image samples and expanded the dataset using data augmentation methods such as rotation, cropping, translation, cutout, brightness adjustment, and noise reduction. The LabelImg data annotation tool was used to label the activated sludge microbial image samples, using bounding boxes to label eight categories of activated sludge microorganisms and their locations. The dataset is in VOC format, and the image annotations were performed using LabelImg software, with the annotated files having a .xml extension. The eight categories of activated sludge microorganisms are: Voryicella; Arcella; Aspidisca; Peranema; Rotaria; Entosiphon; Lecan; and Nematoda.
[0043] S2, a detection model for detecting microorganisms in activated sludge images is constructed based on the dual attention mechanism CBAM, deep hyperparameterized convolution, and Res2Net-RetinaNet. Specifically, this DADC-Res2Net-RetinaNet-based detection model is used for, but not limited to, the detection of indicator microorganisms in activated sludge. Figure 2 As shown, the detection model consists of four parts: Input, Backbone, Neck, and Head. S2 includes the following steps:
[0044] S21, Model Input Section. Input mainly consists of data input, with experimental data being microscopic images of activated sludge microorganisms.
[0045] S22, Building the Backbone Model.
[0046] Specifically, the Res2Net module is used as the bottleneck module of the ResNet backbone network. By constructing hierarchical residual-like connections in individual residual blocks, the fineness of the receptive field is changed, capturing both detailed and overall features. While maintaining the original structure's kernel size and total number, the kernels are categorized into multiple branches with a small number of kernels. The Res2Net module represents multi-scale features with finer granularity and enhances the neural network's ability to detect objects while increasing the internal receptive field. Fine-grained feature fusion is achieved through a series of operations such as channel partitioning, grouped convolution, inter-block fusion, and channel concatenation. The specific formula is as follows:
[0047]
[0048] Among them, input features After channel division, it is divided into Block feature map, Indicates the first Block feature map, Indicates the fusion of the first Convolutional layers of block feature maps Indicates fusion The feature maps obtained afterward. Since the number of categories detected in this paper is not large, a Res2Net-50 with a scale of 4 is selected as the backbone network of the Feature Pyramid Network (FPN). This reduces the network depth and improves the detection accuracy while ensuring sufficient extraction of semantic features.
[0049] S23, Constructing the Neck Part of the Model. The Neck part of the DADC-Res2Net-RetinaNet detection model mainly uses CBAM, Do-conv, and FPN structures;
[0050] Specifically, a CBAM attention mechanism is added to the first layer of the feature output to lock the target region to the area of focus, suppress useless background information, and help feature information flow in the network, thereby improving the detection capability of small target microorganisms. The 2D convolution in FPN is replaced with DO-conv (depth hyperparameterized convolution) to improve network performance and accelerate training. Finally, five feature maps with different strides are output. Based on the anchor mechanism, a large number of candidate anchor boxes are generated on these five feature maps to achieve the detection of targets at various scales.
[0051] CBAM comprises two independent sub-modules: the Channel Attention Module (CAM) and the Spartial Attention Module (SAM). The channel attention mechanism focuses on the target of an input image, while the spatial attention mechanism primarily focuses on the target and complements the channel attention. The output of the convolutional layer first passes through a channel attention module to obtain a weighted result, and then passes through a spatial attention module for final weighted summation to obtain the final result. The formulas for the channel and spatial attention mechanisms are as follows:
[0052]
[0053] in Indicates the input feature map, Represents the activation function. Represents a multilayer perceptron. , To share the two layers of parameters of the perceptron, and These represent the global average pooling and maximum average pooling of the channel attention mechanism, respectively.
[0054]
[0055] in This represents a 7×7 convolution kernel operation. and Let's distinguish between global average pooling and maximum average pooling for spatial attention mechanisms.
[0056] DO-Conv is a combination of traditional convolution and depthwise convolution, using... Indicates the depth of the convolution kernel. and This represents the size of the feature of each channel in the depthwise convolution and , and This represents the number of channels before and after the convolution operation. In depthwise convolution, the trainable convolution kernel... Traditional convolution uses a convolution kernel. Given an input patch. DO-Conv has the same output as a convolutional layer. The formula for calculating depthwise overparameterized convolution is as follows:
[0057]
[0058] in, For depthwise convolution, For ordinary convolution, For DO-Conv convolution operations, for Transpose in the first two coordinates.
[0059] S24, Building the Model Header. The first sub-network of the detection module performs convolutional object classification on the output of CBAM-DOconv-FPN; the second sub-network performs convolutional boundary regression, and the classification sub-network uses the FocalLoss function based on the cross-entropy loss function;
[0060] Specifically, the bounding box regression network is a fully convolutional network that is added to the features of each output. This network employs four 3×3 convolutional layers with 256 channels each, and each convolutional layer... The activation layers are connected, followed by a 3×3 convolutional layer with 36 channels. The final result can predict the relative deviation between the anchor box and the ground truth box. After determining the model's predicted and ground truth values, the regression loss for the bounding boxes is calculated. This method uses four 3×3 convolutional layers, each connected to an activation layer. Layers, then ( It is the number of categories. The network consists of 3×3 convolutional layers (containing the number of anchors) and a sigmoid activation function. The classification network primarily predicts the probability that A anchors at each position belong to K classes. Building upon this, an improved loss function based on cross-entropy is introduced, reducing the weight of negative samples while increasing the weight of positive samples. This improves... The detection algorithm suffers from an imbalance between positive and negative samples, which improves the detection accuracy.
[0061] S3: The detection model is trained using an activated sludge microbial image dataset, and the parameters of the detection model are updated using the Focalloss function;
[0062] S31, divide the activated sludge microbial dataset into training set, validation set, and test set;
[0063] Specifically, the 1602 activated sludge datasets obtained in step S1 are divided into training set, validation set, and test set in a 6:2:2 ratio.
[0064] S32 allows you to set training parameters such as batch size, number of training rounds, learning rate, and weight decay.
[0065] Specifically, the batch size is 8, the training epochs are 200, the learning rate is 0.0001, and the weight decay is 0.9.
[0066] S33, the Focal Loss function based on the cross-entropy loss function is used as the loss function of the classification subnet to calculate the loss, and the optimal solution of the loss function is solved by the gradient descent method. The parameters of the detection model are updated according to the optimal solution of the loss function, and the trained model is saved.
[0067] Specifically, the optimal solution of the total loss function is obtained by using gradient descent on the training and validation sets. The weight parameters of the DADC-Res2Net-RetinaNet model are updated based on the optimal solution. The process is iterated over 200 rounds of training, and the weight parameters that achieve the highest accuracy on the validation set are saved as the model parameters obtained from training.
[0068] The Focal Loss function is used as the loss function for the classification subnet. This loss function is based on the cross-entropy loss function to calculate the loss. It effectively solves the class imbalance problem. The formula for the Focal Loss function is as follows:
[0069]
[0070] in, Represents the Focal Loss function. Indicates the confidence level of the sample. It is a variable parameter. The label is represented by the number of true anchor boxes assigned. Normalization is performed based on the number of true anchor boxes, with the vast majority of anchor boxes being negative samples, resulting in negligible loss values under FocalLoss. Should follow The change in decimates when , Minimize losses at that time.
[0071] S34, The detection model is tested using the test set.
[0072] Specifically, to test the detection performance of the DADC-Res2Net-RetinaNet-based detection model for indicator microorganisms in activated sludge, precision, recall, mean precision (mAP), and parameters were selected as evaluation metrics. To calculate mAP, it's necessary to understand AP, which is the area under the curve plotted using different combinations of precision and recall points. mAP is the average of the AP values for all classes. Evaluation metrics include... Figure 1 As shown.
[0073] Table 1. Detection metrics of different modules on RetinaNet
[0074]
[0075] Here, the training of the DADC-Res2Net-RetinaNet detection model in this embodiment has been completed. The model test results are as follows: the average mAP of the original RetinaNet network in the experiment is 88.4%, and the average mAP of DADC-Res2Net-RetinaNet after adding all the improvement strategies on the basis of the original YOLOv5s algorithm is 92.8%, which is a 4.97% improvement in detection accuracy compared to the original RetinaNet algorithm. This proves that the improvement strategy of this paper is effective. After using the Res2Net module in the original RetinaNet, the average mAP increased by 2%, indicating that the Res2Net module enhances the receptive field of each layer of the backbone network and can extract more features, thereby more accurately completing the detection of microorganisms. For example, in the detection task, after using Res2Net and CBAM in the original RetinaNet, the average mAP improved by 0.5%, indicating that the CBAM module can improve the feature representation ability of the detected target in complex environments, effectively combine spatial and channel information and redistribute the weights of the feature maps, and enhance important features. DADC-Res2Net-RetinaNet replaces the traditional convolution in the fusion module with depth hyperparameterized convolution based on Res2Net and CBAM. The final experimental average mAP reached 92.8%. The model weights remained unchanged while improving accuracy, indicating that replacing traditional convolution with DO-Conv not only accelerates the convergence of the model, but also improves the network performance without increasing the computational cost.
[0076] Specifically, to further verify the effectiveness of the CBAM strategy, the Coordinate Attention (CA) module was used to replace the CBAM module, and the model was tested on the test set. The performance of the model is shown in Table 2.
[0077] Table 2 Comparison of the effects of different attention module improvement methods
[0078]
[0079] Here, the model using the CBAM attention mechanism performs better, with an average accuracy (mAP) 1.2% higher than that using CA, verifying that the channel-space combined attention mechanism CBAM used in this invention performs better.
[0080] S4: Input the activated sludge microbial image into the trained model for detection, and output the location and category of the target in the activated sludge microbial image.
[0081] In this embodiment, the image to be detected is input into the original RetinaNet model and the DADC-Res2Net-RetinaNet model respectively, and the detection results are compared. Figure 4 As shown in Figure (a), only *Strombus sclerotium* was correctly identified; other microorganisms were incorrectly identified, and the background of the image was mistakenly identified as *Vorticella*. Figure (b) misidentified *Strombus sclerotium* as *Vorticella* and *Epidermophytes*. Figure (c) misidentified *Rotifera cavatum* as *Vorticella*, and *Strombus sclerotium* was not detected, while multi-frame recognition also occurred. Figure (d) missed detections occurred because the target microorganisms were small. Figure (e) multi-frame recognition occurred because the morphological differences between several small microorganisms were not significant. Figure (f) misidentification occurred because two microorganisms were stuck together, and the algorithm did not fully extract the morphological features of the microorganisms. The DADC-Res2Net-RetinaNet algorithm proposed in this paper fully extracts the features of each type of microorganism, effectively solving the above problems.
[0082] Figure 5 This is an activated sludge indicator microbial detection system according to an embodiment of the present invention. For example... Figure 5 As shown, the activated sludge indicator microorganism detection system includes: offline training of the model and online application. The offline training uses microorganisms acquired by the activated sludge microorganism image acquisition system to train the DADC-Res2Net-RetinaNet model. The online application uses the offline-trained deep learning-based activated sludge indicator microorganism target detection system to detect the activated sludge indicator microorganisms under test.
[0083] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the above technical solutions, in essence or the parts that contribute to the prior art, can be embodied in the form of software products. These computer software products can be stored in computer-readable storage media, such as ROM / RAM, magnetic disks, optical disks, etc., and include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0084] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-described technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes, and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.
Claims
1. A method for constructing a target detection model for indicative microorganisms in activated sludge, characterized in that, Includes the following steps: S1: Activated sludge microbial image acquisition system; S2: A detection model for activated sludge microbial images is constructed based on the dual attention mechanism CBAM, deep hyperparameterized convolution, and Res2Net-RetinaNet; S3: The detection model is trained using the activated sludge microbial image dataset, and the parameters of the detection model are updated using the Focal loss function; S4: Input the activated sludge microbial image into the trained model for detection, and output the location and category of the target in the activated sludge microbial image; Step S2 includes the following steps: S21, the Res2Net module is used as the bottleneck module of ResNet to form a ResNet network as the backbone network; S22, Constructing the Backbone Part of the Model; Using the Res2Net module as the bottleneck module of the ResNet backbone network, the fineness of the receptive field is changed by constructing hierarchical residual-like connections in individual residual blocks, capturing detailed and overall features; while keeping the original structure's convolutional kernel size and total number unchanged, the convolutional kernels are classified into multiple branches with a small number of convolutional kernels. The Res2Net module represents multi-scale features with finer granularity and enhances the neural network's ability to detect targets while increasing the internal receptive field; fine-grained feature fusion is achieved through a series of operations such as channel partitioning, grouped convolution, inter-block fusion, and channel concatenation, as shown in the following formula: ; Among them, input features After channel segmentation, the feature map is divided into s blocks. Indicates the first Block feature map, Indicates the fusion of the first Convolutional layers of block feature maps Indicates fusion The feature map obtained afterwards; S23, Constructing the Neck Part of the Model; The Neck part of the DADC-Res2Net-RetinaNet detection model mainly uses CBAM, Do-conv, and FPN structures; Specifically: CBAM attention mechanism is added to the first layer of feature output to lock the target region to the key areas of interest, suppress useless information in the image background, help feature information flow in the network, and improve the detection ability of small target microorganisms; the two-dimensional convolution in FPN is replaced with deep hyperparameterized convolution DO-conv to improve network performance and speed up network training; Finally, five feature maps with different strides are output, and a large number of candidate anchor boxes are generated on the five feature maps according to the Anchor mechanism to achieve the detection of targets at various scales; S24, Constructing the Model Header: The first sub-network of the detection module performs convolutional object classification on the output of CBAM-DOconv-FPN; the second sub-network performs convolutional bounding box regression, and the classification sub-network uses the Focal Loss function based on the cross-entropy loss function; specifically: the bounding box regression network is a fully convolutional network, which is added to the features of each output; this network uses four layers of 3×3 convolutions with 256 channels each, and each convolution is coupled with... The activation layers are connected, followed by a 3×3 convolutional layer with 36 channels. The final result can predict the relative deviation between the anchor box and the ground truth box. After determining the model's predicted and ground truth values, the regression loss of the bounding boxes is calculated. This method uses four 3×3 convolutional layers, each connected to an activation layer. Layers, then The 3×3 convolutional layer is followed by a sigmoid activation function. It is the number of categories. This refers to the number of anchors; the classification network is mainly used to predict the probability that A anchors at each position belong to K classes; based on this, an improved method based on cross-entropy is introduced. Loss function.
2. The method for constructing an indicator microbial target detection model for activated sludge according to claim 1, characterized in that, Step S1 specifically involves: S11 uses an optical microscope, an industrial digital camera, and an image acquisition system to scan samples on glass slides to obtain live multi-layer sludge microscopic images, and expands the dataset through data augmentation methods such as rotation, cropping, translation, cutout, brightness, and noise random operations. S12, labeling activated sludge microbial samples.
3. The method for constructing an indicator microbial target detection model for activated sludge according to claim 1, characterized in that, Step S3 specifically involves: S31, divide the activated sludge microbial dataset into training set, validation set, and test set; S32 allows you to set training parameters such as batch size, number of training rounds, learning rate, and weight decay. S33, the Focal Loss function based on the cross-entropy loss function is used as the loss function of the classification subnet to calculate the loss, and the optimal solution of the loss function is solved by the gradient descent method. The parameters of the detection model are updated according to the optimal solution of the loss function, and the trained model is saved. S34, The detection model is tested using the test set.
4. The method for constructing an activated sludge indicative microbial target detection model according to claim 3, wherein the method is a dual-attention depth hyperparameter convolution Res2Net-RetinaNet activated sludge indicative microbial detection model construction method, characterized in that, The formula for the Focal Loss function is as follows: ; in, Represents the Focal Loss function. Indicates the confidence level of the sample. is a variable parameter; y represents the label, which is normalized by the number of true anchor boxes assigned. The vast majority of anchor boxes are negative samples, and the loss value is negligible under FocalLoss.
5. The method for constructing an indicator microbial target detection model for activated sludge according to claim 1, characterized in that, The activated sludge indicator microbial target detection system includes one or more processors and a non-transitory computer-readable storage medium storing program instructions. When the one or more processors execute the program instructions, the one or more processors...
6. A system for constructing a target detection model for indicative microorganisms in activated sludge, the system comprising a server and edge devices, wherein, The server is connected to the edge device, and the server employs the method of any one of claims 1-4.