Faster R-CNN marine benthos detection method based on improved attention mechanism
By introducing a multi-scale channel attention mechanism and RoIAlign layer in the Faster R-CNN model and using the extreme learning machine classification network, the problem of insufficient accuracy in traditional marine benthic biological detection algorithms in complex environments is solved, and efficient and accurate are achieved marine benthic biological detection.
Patent Information
- Application Number
- CN202411359698.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2044-09-27
AI Technical Summary
Traditional marine benthic biological detection algorithms face problems such as color shift, low contrast and blur in complex marine environments, resulting in insufficient detection accuracy and real-time performance.
Using the Faster R-CNN method based on improved attention mechanism, the multi-scale channel attention mechanism (MSCAM) is added to the ResNet50 network and the RoIAlign layer is replaced with the traditional RoIPooling layer, and finally the extreme learning machine (ELM) is used in the classification stage. ) Feedforward classification network.
The feature extraction ability and detection frame positioning accuracy are significantly improved, the generalization ability and classification efficiency of the model are enhanced, and high-precision marine benthic biological detection is achieved.
Smart Images

Figure CN119418367A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of marine benthic organism detection, and in particular relates to a Faster R-CNN marine benthic organism detection method based on an improved attention mechanism. Background Art
[0002] With the continuous development of society and the advancement of science and technology, the scarcity of land resources has become increasingly apparent, and the development of marine resources has become a common goal pursued by the world. In recent years, computer vision technology has flourished, enabling humans to use equipment such as remotely operated vehicles (ROVs) and autonomous underwater vehicles (AUVs) to explore the seabed and develop marine ecological resources in a non-invasive way. Underwater target detection is an important research direction of computer vision technology in the development of marine resources. However, traditional target detection algorithms often lack accuracy and real-time performance when dealing with complex scenes such as color shift, low contrast and blur in underwater images. With the widespread application and rapid development of deep learning technology in the field of images, high-precision and rapid recognition of complex tasks such as image classification, target detection and image segmentation can be achieved by building deep neural network models. Marine benthic organism detection algorithms based on deep learning have also continued to improve, providing more effective technical support for the development of marine resources.
[0003] Nowadays, marine benthic organism detection algorithms mainly rely on optical images for feature extraction, and can be divided into two-stage and single-stage detection algorithms. The two-stage detection algorithm first generates candidate regions, and then performs classification and position fine-tuning. Although this method has a high computational cost, it is more accurate in terms of precision and is suitable for scenarios with high accuracy requirements. Girshick et al. first proposed a method that combines candidate regions with convolutional neural networks: R-CNN, which opened the precedent for the two-stage detection algorithm. Subsequently, improvements to the R-CNN algorithm include Fast R-CNN, Faster R-CNN, and Mask R-CNN and R-FCN proposed by upgrading the network structure. These methods have achieved good detection results. Single-stage target detection methods do not need to generate candidate regions and directly convert the problem into an end-to-end regression problem. For example, the YOLO series, SSD series, and DSSD series. These methods directly use neural networks to detect and locate targets from the entire image. Although the detection speed is faster, the detection accuracy is slightly inferior. Wang et al. optimized the YOLO-v2 algorithm by increasing the number of grids in the last convolutional layer of the model and reducing the number of filters, which improved the rapid classification and recognition of fish images. Muksit et al. improved the YOLO-v3 algorithm by adjusting the upsampling step size and adding spatial pyramid pooling to improve detection accuracy.
[0004] Chinese patent CN116778311A proposes an underwater target detection method based on an improved Faster R-CNN. However, this method may have some limitations or shortcomings, especially in the selection of attention mechanisms and classifiers, which are different from our proposed solution. Our solution introduces a multi-scale channel attention mechanism (MSCAM), which can more effectively capture key features at different scales and enhance feature representation capabilities. In contrast, CN116778311A uses a more traditional spatial channel hybrid attention mechanism (CBAM) and does not use a similar multi-scale processing method, which may lead to insufficient feature extraction when dealing with complex scenes with targets of various sizes, thereby affecting detection accuracy. Our method uses an extreme learning machine (ELM) feedforward classification network in the classification stage, which not only improves the generalization ability of the model, but also enhances the classification efficiency. CN116778311A uses a standard fully connected layer or other conventional classifiers, which may not provide the same generalization ability and classification performance, especially when dealing with complex and diverse marine benthic biological data.
[0005] As object detection research deepens, researchers have found that the concepts of single-stage and two-stage detection methods are not completely different. Some research works aim to leverage the advantages of two-stage detection methods to enhance the performance of single-stage detection methods. RefineDet divides single-stage detection into two submodules: anchor optimization module and object detection module. AlignDet uses deformable convolution (DCN) to imitate RoIAlign and obtain aligned features in the second stage. RepPoints draws on the ideas of optimization and feature alignment and proposes an anchor-free detector based on key point detection. The progress of single-stage detection methods has also promoted the development of two-stage detection methods. CenterNet2 found that a powerful anchor-free single-stage detector can act as an RPN to predict accurate object likelihood and provide an overall detection score. Combining the object likelihood of RPN and the conditional classification score of R-CNN can reduce the number of proposals while achieving higher performance, thereby reducing the cost of inference. Mandal et al. combined Faster R-CNN with three classification networks to achieve automatic detection and recognition of fish species in underwater videos. Summary of the invention
[0006] The purpose of the present invention is to address the problems of complex environmental noise, diverse biological scales, insufficient positioning and classification accuracy of target detection frames in marine benthic organisms, and propose a new marine benthic organism detection technology based on attention mechanism, bilinear interpolation technology and feedforward neural network. An improved multi-scale channel attention mechanism is used to optimize the ResNet50 network and use it as the backbone network of the Faster R-CNN model to enhance feature extraction capabilities. The RoIAlign layer with bilinear interpolation technology is then used to replace the traditional RoIPooling layer to improve the position accuracy of the detection frame. In the final classification stage, an extreme learning machine (ELM) feedforward classification network is introduced to replace the fully connected layer to improve classification accuracy.
[0007] The present invention provides a method for detecting marine benthic organisms based on Faster R-CNN with an improved attention mechanism, comprising the following steps: Step 1: Obtain a marine benthic organism target detection dataset, wherein each data in the marine benthic organism target detection dataset includes a marine benthic organism image and a biological species label; Step 2: Build a Faster R-CNN marine benthic organism detection model based on the improved attention mechanism: The original convolutional neural network VGG16 in the Faster R-CNN model is replaced by the residual network ResNet50 network, and a multi-scale channel attention mechanism MSCAM is added after stage 3 of the residual network ResNet50. By processing features of different scales, the model's attention to important features is enhanced, which is helpful for feature fusion in stage 4.
[0008] Replace the original RoIPooling layer in the Faster R-CNN model with the RoIAlign layer, which significantly reduces the quantization error; In the final classification and bounding box regression part of the Faster R-CNN model, the original classification fully connected layer in the Faster R-CNN model was replaced with an extreme learning machine (ELM) classifier, which improved the classification performance while improving the generalization ability, and obtained a marine benthic organism detection model.
[0009] Step 3: Use the marine benthic organism target detection data set obtained in step 1 to train the marine benthic organism detection model to obtain a trained marine benthic organism detection model; obtain the marine benthic organism image to be detected, input the trained marine benthic organism detection model, and obtain the detection result.
[0010] Preferably, in step S1, the marine benthic organism detection dataset includes a URPC2020 dataset and a RUOD dataset. The URPC2020 dataset contains four marine organism categories, namely echinus, holothurians, scallops and starfish, and the RUOD dataset contains ten biological detection categories, namely holothurian, echinus, scallops, starfish, fish, corals, diver, cuttlefish, turtle and jellyfish. The two marine benthic organism target detection datasets are then divided into their own training set, validation set and test set, and the sizes of the images in the datasets are uniformly set.
[0011] Preferably, in step S2, the input feature map of the multi-scale channel attention mechanism MSCAM F is a three-dimensional tensor with a shape of C×H×W, where C is the number of channels and H and W are the spatial dimensions; the input feature map F First, the bilinear interpolation function is used to obtain feature maps of different scales according to different scale factors. The specific calculation formula is as follows: in is the scale factor at different scales, The input feature maps at different scales are then entered into the module of the channel attention mechanism to calculate their respective channel attention maps. The calculation expression is as follows: in It is a multi-layer perceptron, which means that the parameters pass through two fully connected layers and a ReLU activation function; and Respectively represent the channels The features of are calculated after global average pooling and global maximum pooling. and It represents the trainable parameters of the two fully connected layers. Finally, the original sigmoid activation function is replaced by Hard sigmoid to further improve the computational efficiency without affecting the performance, and can effectively reduce the impact of the gradient vanishing problem.
[0012] Through the calculation of the channel attention mechanism, we can obtain the attention maps at different scales. After that, these attention maps are added and averaged to obtain the fused attention map , the specific calculation formula is as follows: in The number of representative scales; Finally, the obtained comprehensive attention map is expanded into the input feature map F The size and shape of the input feature map are applied element-wise. F The final output feature map is obtained F out .
[0013] Preferably, in step S2, the RoIAlign layer has a bilinear interpolation technology to perform precise sampling on each region of interest RoI, replacing the traditional RoIPooling layer that relies on simple integer coordinate mapping. The quantization error is further reduced to ensure that the features extracted from each candidate region are more faithful to the original information. Especially for small object detection, the RoIAlign layer can capture target details more delicately, greatly improving the positioning accuracy, thereby comprehensively optimizing the detection performance of the model.
[0014] Preferably, in step S2, the hidden layer parameters of the extreme learning machine ELM remain unchanged after initialization, and the ELM mainly calculates the weights on the output layer by efficiently solving the linear system using the least squares method or pseudo-inverse matrix technology, which greatly reduces the training time of the Faster R-CNN model and improves the efficiency of model iteration and deployment, further improving the classification performance and generalization ability.
[0015] Preferably, in step S3, the training of the marine benthic organism detection model includes: in the URPC2020 dataset, setting the training round Epoch to 100, the batch size BatchSize to 4, and the learning rate Learning-rate to 1e-4; in the RUOD dataset, setting the training round Epoch to 60, the batch size BatchSize to 4, and the learning rate Learning-rate to 1e-4.
[0016] Beneficial effects of the present invention: In view of the growing demand for the development of marine resources, the detection of marine benthic organisms has become increasingly important, and traditional detection algorithms face challenges in complex marine environments. Based on the two-stage target detection framework Faster R-CNN, a series of improvement measures are made, taking advantage of its advantages in multi-scale, multi-category and high-precision detection performance, while improving its problems in detection speed, and so on, and proposing a Faster R-CNN-ResNet50-MSCAM-RoIAlign-ELM marine benthic organism detection model. By updating the backbone network to ResNet50 and adding a multi-scale channel attention mechanism (MSCAM), the key features are effectively highlighted and information of different scales is taken into account, and the feature representation ability is significantly enhanced, which is particularly suitable for detecting targets of various sizes. The RoIAlign layer is used to replace the original RoIPooling layer, and the bilinear interpolation method is used to eliminate the quantization error, further improving the accuracy of the detection results. In the classification and regression stage, the extreme learning machine (ELM) feedforward classification network is used, which not only increases the generalization ability of the model, but also improves the classification efficiency. Through experimental verification, the mean average precision (mAP) of the proposed model on two marine benthic organisms datasets was as high as 82.5% and 81.36%, respectively. These results fully demonstrate the effectiveness of the proposed algorithm. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is the BottleNeck structure diagram; Among them, the 1×1 convolution layer along the input channel is used for dimensionality reduction and reduces the number of channels. The BN layer accelerates convergence by standardizing the input. The ReLU layer introduces nonlinear activation to prevent gradient disappearance. The 3×3 convolution layer captures features on the feature map with reduced number of channels and reduces calculation parameters. The last 1×1 convolution layer is used for dimensionality increase and restores the number of channels. The dotted line on the left acts on the identity mapping between the BottleNeck layers in each stage, and the downsampling solid line on the right acts on the dimensionality matching between stages through the 1×1 convolution layer dimensionality increase operation.
[0018] Figure 2 This is the traditional ResNet50 network structure diagram Among them, the traditional ResNet50 network is composed of input layer, stage0 layer, stage1 layer, stage2 layer, stage3 layer, stage4 layer, global average pooling layer Avg layer, fully connected layer FC layer and output layer in sequence; among them, the stage0 layer is composed of 7×7 convolution layer, BN layer, ReLU activation layer and 3×3 maximum pooling layer in sequence, the stage1 layer includes 3 BottleNecks, the stage2 layer includes 4 BottleNecks, the stage3 layer includes 6 BottleNecks, and the stage4 layer includes 3 BottleNecks.
[0019] Figure 3 This is the structure diagram of the channel attention mechanism Figure 4 It is a flow chart of the multi-scale channel attention mechanism structure Figure 5 This is the structure diagram of the Faster R-CNN-ResNet50-MSCAM-RoIAlign-ELM marine benthic organism detection network Figure 6 It is the training visualization of the model of the present invention Among them, (a) and (b) are the visualization process of model training on the URPC2020 dataset; (c) and (d) are the visualization process of model training on the RUOD dataset.
[0020] Figure 7 This is the mAP growth curve of each algorithm on the URPC2020 dataset Figure 8 It is the mAP growth curve of each algorithm model on the RUOD dataset DETAILED DESCRIPTION
[0021] The present invention will be further described below in conjunction with the accompanying drawings.
[0022] The present invention comprises the following steps: Step 1: Acquire images of marine benthic organisms, prepare datasets and perform preprocessing The experimental process of the present invention selected two data sets specially designed to evaluate and optimize the detection performance of marine benthic organisms, namely the URPC2020 and RUOD data sets.
[0023] The URPC2020 dataset originated from the Underwater Robot Perception Challenge, focusing on four types of marine benthic organisms: sea urchins (echinus), sea cucumbers (holothurians), scallops (scallops) and starfish (starfish). The dataset follows the VOC format and is mainly composed of two subdirectories: "JPEGImages" and "Annotations". The "JPEGImages" directory contains a total of 7543 images, of which 5543 are marked as training sets. The "Annotations" directory records in detail the type of species in each image and its specific location in the image, providing detailed annotation information for model training.
[0024] The RUOD dataset is specifically built to address the inherent problems of uneven illumination, color attenuation, and suspended particle interference in underwater environments. Its goal is to establish a comprehensive benchmark platform to promote and measure the progress of marine benthic biological detection algorithms. The dataset also follows the VOC format and brings together 14,000 high-resolution marine biological images and more than 74,903 carefully annotated instances, covering a wide range of underwater biological species, mainly including ten different biological detection categories such as echinus, holothurian, scallops, starfish, fish, corals, diver, cuttlefish, turtle, and jellyfish. The dataset is divided into training and test sets in a ratio of 9:1, in which the training set and validation set are divided in a ratio of 9:1 for the training process, and the test set is used for the final performance effect detection.
[0025] Step 2: Replace the Faster R-CNN backbone network with a ResNet50 network with an improved attention mechanism The high parameter density of the fully connected layers of the original Faster R-CNN model's backbone network VGG16 significantly increases the computational cost and memory requirements, which can easily lead to performance bottlenecks, especially when GPU resources are tight. In addition, its limited structural depth restricts its learning ability when faced with complex scenes and subtle features, and its gradient vanishing and lack of generalization have also become its shortcomings. These factors make it difficult to adapt to the needs of contemporary model selection. The deep residual network ResNet50, with its 50-layer depth and expanded model capacity, enables the network to capture more subtle feature details, and is expected to significantly enhance model performance. The introduction of the attention mechanism can further enhance the model's focus on important features, while suppressing irrelevant or minor features, thereby improving the performance of the model.
[0026] (2.1) ResNet50 network As attached Figure 1As shown in the figure, the ResNet50 network uses the BottleNeck residual block and a 1×1 convolution layer for dimensionality reduction and dimensionality increase, which reduces the computational cost of the intermediate 3×3 convolution layer, thereby improving computational efficiency and saving computational resources. Each convolution layer is followed by a ReLU activation function, which introduces nonlinear transformations and helps the model learn more complex feature representations. The solid line shortcut part on the right side of the figure applies downsample processing and uses a 1×1 convolution layer for dimensionality increase, which is mainly used to match the number of output channels in the previous stage with the number of input channels in this stage, and mainly acts on the first layer of each stage. The dashed line shortcut part on the left keeps the input and output dimensions the same for direct identity mapping, and acts on the next few layers of each stage for series connection to further deepen the network.
[0027] According to the attached Figure 2 As shown in the figure, the network structure of ResNet50 can be generally divided into 5 stages. In the study of underwater target detection in this paper, the first 4 stages are mainly used for feature extraction and organization, and the last stage is mainly used for target classification. The role of stage0 is input preprocessing, which resizes and normalizes the input image; then through the feature extraction of three stages from stage1 to stage3, the edge texture features of the input image, the part and shape features of the object, and the position and size features of the object are gradually learned and understood; finally, through the feature fusion of stage4, the higher resolution and rich semantic information are integrated with other branches to generate high-quality candidate boxes and perform accurate target classification.
[0028] (2.2) Multi-scale channel attention mechanism (MSCAM) like Figure 4 , the structure of the multi-scale channel attention mechanism is as follows: The input feature map module converts the feature map F First, it is fed into the scale transformation module, in which the bilinear interpolation algorithm is used to transform the feature map. F Perform proportional resizing to obtain the adjusted feature map F cx ; Then, the feature map F cx is passed to the channel attention module (e.g. Figure 3 As shown in Figure 2, in this module, the attention weight matrix is learned in different channel dimensions through global maximum pooling and global average pooling operations combined with the multi-layer perceptron (MLP) structure. The attention weight matrix is further multiplied by the channel-by-channel operation of the input feature map to generate a channel attention feature map. M cx ; Next, channel attention feature maps from different scales Mcx The weighted average fusion module is used to integrate and form a comprehensive multi-scale channel attention feature map. M c Finally, the comprehensive feature map M c By expanding the feature map module, mapping back to the original input feature map, the final output feature map is generated F out , and achieved effective processing and enhancement of input data.
[0029] In order to further enhance the model's attention to important features, the present invention proposes to add a multi-scale channel attention mechanism after stage 3 of the deep residual network ResNet50. By processing features of different scales, the model can further identify detection objects of different sizes, and at the same time help the model to more efficiently use computing resources to improve the accuracy of detection and classification. Figure 3 As shown in the figure, this is a structural flow chart of the multi-scale channel attention mechanism.
[0030] Input feature map in the figure F It is a three-dimensional tensor with a shape of C×H×W, where C is the number of channels and H and W are the spatial dimensions. Input feature map F Input into the multi-scale channel attention mechanism module, firstly, the bilinear interpolation function is used to obtain feature maps of different scales according to different scale factors. The specific calculation formula is as follows: (1) in is the scale factor at different scales, The input feature maps at different scales are then entered into the module of the channel attention mechanism to calculate their respective channel attention maps. The calculation expression is as follows: (2) (3) in It is a multi-layer perceptron, which means that the parameters pass through two fully connected layers and a ReLU activation function; and Respectively represent the channels The features of are calculated after global average pooling and global maximum pooling. and It represents the trainable parameters of the two fully connected layers. Finally, the original sigmoid activation function is replaced by Hard sigmoid to further improve the computational efficiency without affecting the performance, and can effectively reduce the impact of the gradient vanishing problem.
[0031] Through the calculation of the channel attention mechanism, we can obtain the attention maps at different scales. After that, these attention maps are added and averaged to obtain the fused attention map , the specific calculation is as follows: (4) in Represents the number of scales, that is, the number of different scales of interpolated feature maps in the multi-scale channel attention module. By fusing the attention information from different scales to generate a comprehensive attention map, the importance of features at multiple scales can be effectively captured. Finally, the obtained comprehensive attention map is expanded into the input feature map F The size and shape of the input feature map are applied element-wise. F The final output feature map is obtained F out .
[0032] The feature maps refined by the multi-scale channel attention mechanism significantly enhance the ResNet50 network's ability to parse core features, while effectively eliminating irrelevant and noise components, achieving precise cropping and selection at the feature level. This mechanism, through its unique multi-scale insight, can extract image information from all directions, from micro to macro, covering a broad field of view of details, thereby stimulating the selective activation of features. This gives the network the intelligence to dynamically adjust its focus of attention, enabling it to flexibly respond to diverse scenarios of external input. In summary, this design effectively promotes the performance leap of the ResNet50 network in performing target detection and classification tasks in the fourth stage, which not only improves the precision of detection, but also enhances the accuracy of classification judgment.
[0033] Step 3: Introduce the RoIAlign layer and the extreme learning machine (ELM) feed-forward classification network In the Faster R-CNN model, although the RoIPooling layer successfully converts candidate regions of any size into feature maps of uniform specifications, its coarse-grained sampling strategy based on integer coordinates introduces non-negligible quantization errors. This error originates from the inexact match between the RoI boundary and the feature map grid. The cumulative effect of the error is particularly obvious when dealing with smaller-scale objects, which may lead to distortion of key feature information and thus weaken detection performance.
[0034] (3.1) RoIAlign layer In view of this, the present invention proposes to use the RoIAlign layer to replace the traditional RoIPooling layer, introduce bilinear interpolation technology, and implement precise sampling for each RoI instead of relying on simple integer coordinate mapping. This innovative method significantly reduces the quantization error and ensures that the features extracted from each candidate region are more faithful to the original information. Especially for small object detection, the RoIAlign layer can capture target details more delicately and greatly improve positioning accuracy. The leap forward in positioning accuracy is of great significance to the target detection task, because it is directly related to the geometric accuracy of the detection box, thereby comprehensively optimizing the detection performance of the model.
[0035] Not only that, the RoIAlign layer also indirectly enhances the generalization ability of the model by reducing quantization errors. During the training phase, more accurate feature extraction enables the model to learn more robust representations, and maintain a high level of detection accuracy even when faced with unprecedented data or complex and changing real-world scenarios. This enhanced generalization capability is particularly critical in the field of target detection. Considering the uncertainty and diversity of the actual application environment, the model must have strong adaptability in order to maintain consistent and reliable performance under various conditions. In summary, the introduction of the RoIAlign layer not only directly promotes the improvement of detection accuracy, but also ensures that the model exhibits excellent stability and reliability in complex and changing real-world applications from a long-term perspective.
[0036] (3.2) Extreme Learning Machine (ELM) Classifier In order to improve the model training process, enhance training stability, strengthen parallel computing efficiency, enhance model generalization ability, and simplify the tediousness of hyperparameter adjustment. The present invention proposes to replace the classification part in the Faster R-CNN model with an extreme learning machine (ELM) classifier by the traditional fully connected layer. In the Faster R-CNN model, the classifier plays a core role in classifying candidate regions (Region Proposals), and the integration of ELM significantly optimizes this key link. Since the hidden layer parameters of ELM remain unchanged after initialization, its training process mainly focuses on the calculation of the output layer weights. This step can be efficiently completed by solving a linear system, usually using the least squares method or pseudo-inverse matrix technology, which is in sharp contrast to the traditional deep learning model that needs to iteratively update the weights of all levels through back propagation. This feature of ELM greatly reduces the training time of the Faster R-CNN model and improves the efficiency of model iteration and deployment.
[0037] After improvement, the final Faster R-CNN-ResNet50-MSCAM-RoIAlign-ELM marine benthic organism detection model was obtained, as shown in the attached figure. Figure 4As shown in the figure. The dataset image is preprocessed into a specific size and enters the feature extraction network. After the feature extraction of the ResNet50-MSCAM backbone network, the feature map is obtained; the obtained feature map is input into the region proposal network to generate candidate regions that may contain targets, and the prior boxes (Anchors) of different scales and proportions are classified and bounding box regression is predicted to generate more accurate proposal boxes; then through the RoIAlign layer, the bilinear interpolation technology is used to ensure that the feature map is accurately aligned with the RoI boundary, eliminating the quantization error, thereby improving the accuracy of detection; finally, the output of the RoIAlign layer is sent to two sub-networks of classification and bounding box regression, one of which uses the feedforward classification network ELM to classify the target and determine whether there is a target in the area, and the other sub-network is used for bounding box regression to accurately locate the position of the target.
[0038] Step 4: Set training hyperparameters In order to evaluate the performance difference between the proposed improved Faster R-CNN model and the existing mainstream target detection model, we selected a wide range of target detection algorithms for comparative experiments. The relevant general training parameters of each algorithm in this experiment are set as follows: In order to ensure the stability and robustness of the training process, each algorithm uniformly selects the Adam optimizer, and uniformly selects the learning rate adjustment strategy of cosine decay to ensure a smooth transition of the training process. The transfer learning training method is adopted, and the pre-trained weights are used to further improve the model learning efficiency and performance while saving computing resources. The IOU threshold is 0.5. The remaining parameters and model sizes of each algorithm are listed in Table 1.
[0039] Table 1 Parameter settings of the algorithm in this paper and other comparative experiments
[0040] Step 5: Input the dataset into the model for training According to step 2 and step 3, the Faster R-CNN-ResNet50-MSCAM-RoIAlign-ELM marine benthic organism detection model proposed by the present invention is obtained. In step 1, the training data set is processed, and in step 4, the training hyperparameters are set. Next, the training set and the validation set need to be input into the model for training. Figure 6 The following is a visualization of the training process of the model of the present invention. Figure 6 Part (a) is the training visualization process of the model of the present invention on the URPC2020 dataset. After 100 epochs, the mAP index of the model gradually increased and finally stabilized to a maximum of nearly 82.5%. The training loss and validation loss also stabilized with the training, and no rebound occurred, which shows that there was no overfitting phenomenon during the model training process, and a good fitting effect was achieved overall. Figure 6 Part (b) is the training visualization process of the present invention on the RUOD dataset. Since the dataset has high-quality images, the training loss and validation loss of the model tend to be stable after 60 epochs, and there is no overfitting phenomenon. The mAP index also steadily increases and finally stabilizes, reaching a maximum of nearly 81%.
[0041] In order to better reflect the performance of the model of the present invention, we conducted a series of ablation experiments on the URPC2020 dataset. By strategically removing specific parts or functions of the model, we accurately evaluated the relative importance and practical utility of each component. Under the premise that the experimental environment remains unchanged, the impact of adding and removing a component on the overall model performance is observed. The specific experimental results are shown in Table 2 (where ① represents ResNet50-MSCAM, ② represents RoIAlign, and ③ represents ELM classifier).
[0042] Table 2 Effectiveness analysis of adding components to the Faster R-CNN model on URPC2020
[0043] Based on the experimental data analysis in the table, under the premise that the intersection-over-union (IoU) threshold is set to 0.5 and the confidence standard is also set to 0.5, the test result mAP after replacing the backbone network of the Faster R-CNN original model with ResNet50 is 77.90%. After embedding the multi-scale channel attention mechanism (MSCAM) in the original ResNet50 network to form the ResNet50-MSCAM backbone network, the test result mAP has increased by 1.2%, reflecting the effectiveness of MSCAM in feature refinement and enhancement; after replacing the relatively rough RoIPooling layer in the original model with the more precise RoIAlign layer, the test result mAP has increased by 2.4%, confirming the superiority of RoIAlign in processing irregular shapes of bounding boxes. After adding the ResNet50-MSCAM backbone network and the RoIAlign layer to the original model at the same time, the test result mAP has increased by 3.1%, further confirming the important role of the two components. Finally, the three components proposed in this paper are integrated into the original model, and the test results show that the mAP reaches 82.5%, which is 4.6% higher than the baseline model. In addition, focusing on the average precision (AP) performance of four specific detection categories in the dataset, the results show that the AP values of these categories show a stable growth trend under the synergy of various components. In summary, the experimental results consistently confirm that the proposed components play an indispensable role in improving the recognition accuracy and generalization ability of the Faster R-CNN model.
[0044] Step 6: Enter test data to obtain prediction results Load the optimal weight parameters obtained by training on the two datasets in step 5 into the model, and then input the test dataset into the model to obtain the test results. In order to scientifically evaluate the effectiveness of the proposed model, this study uses several key performance indicators, including mean average precision (mAP), average precision (AP), precision, recall, accuracy, and F1 score. The following are the definitions and calculation formulas of these indicators: (5) (6) (7) (8) (9) Table 3 shows the performance comparison experimental results of the proposed marine benthic organism detection algorithm model on the URPC2020 dataset with all algorithms in step 4 after 100 training iterations, where the detection indicators always remain at the forefront and can achieve the highest mAP value of 82.5% on the validation set. Secondly, our method also performs well in the average precision (AP) of specific categories such as sea urchins (echinus), sea cucumbers (holothurian), scallops (scallops), and starfish (starfish). This means that our algorithm has better detection effects for these marine organisms, which is very important for practical applications. In addition, in terms of F1, Precision, and Recall, the proposed method is still competitive with other methods. This shows that our algorithm can achieve a good balance between Precision and Recall, so as to better identify the target objects in the image. Although our method is slightly higher than some other methods in terms of computational complexity and number of parameters, it can still meet the requirements in terms of real-time performance, and it sacrifices detection speed in exchange for higher detection accuracy.
[0045] Table 3 Comparative experimental results on the URPC2020 dataset
[0046] Attached Figure 7 The figure shows the mean average precision (mAP) growth curve of each algorithm model after 100 batches of training on the URPC2020 dataset. Our model algorithm grows steadily, and after 25 rounds, it always maintains a leading position and finally achieves the highest mAP value.
[0047] Table 4 shows the performance of the model algorithm of the present invention and other algorithms on the RUOD dataset. The comparison indicators include the Mean Average Precision (mAP) of each algorithm, as well as the F1 score, Precision and Recall represented by the largest number of sea urchins (echinus). In the comparison with each algorithm, the mAP value of the algorithm of the present invention achieved the highest value, which shows that the overall performance is very good. For the representative category of sea urchins (echinus), the Average Precision (AP) of the algorithm of this paper is still leading, and a good balance is achieved between Precision and Recall. Since the algorithm of the present invention belongs to a two-stage detection model, it may not be as good as other algorithms in terms of computational complexity and detection speed, but this setting can bring higher detection accuracy, which also reflects the advantages of the algorithm of this paper. This comprehensively illustrates that the algorithm model proposed in the present invention effectively improves the target detection effect of marine organisms.
[0048] Table 4 Comparative experimental results on the RUOD dataset
[0049] Attached Figure 8 The mean average precision (mAP) growth curve of each algorithm model after 60 batches of training on the RUOD dataset is presented. In view of the diversity of detection categories, the algorithm of the present invention begins to show advantages from the initial stage, and its detection accuracy curve continues to lead throughout the training process until it reaches the peak. These results further confirm the superiority of the algorithm of the present invention in terms of detection performance compared with other algorithms.
[0050] In view of the growing demand for marine resource development, the detection of marine benthic organisms is becoming increasingly important, and traditional detection algorithms face challenges in complex marine environments. Based on the two-stage target detection framework Faster R-CNN, a series of improvement measures are made, taking advantage of its advantages in multi-scale, multi-category and high-precision detection performance, while improving its problems in detection speed, etc., and proposing a Faster R-CNN-ResNet50-MSCAM-RoIAlign-ELM marine benthic organism detection model. The backbone network is updated from the default configuration to ResNet50, and MSCAM is added on this basis. This improvement effectively highlights the key features and takes into account information of different scales, significantly enhances the feature representation capability, and is particularly suitable for detecting targets of various sizes; the original RoIPooling layer is replaced by RoIAlign, and the bilinear interpolation method is used to eliminate quantization errors, thereby further improving the accuracy of the detection results; the extreme learning machine (ELM) feedforward classification network is used in the classification and regression stage, which not only increases the generalization ability of the model, but also improves the classification efficiency. In summary, through innovative improvements, this model can efficiently and accurately complete the target detection task of marine benthic organisms, providing strong support for the scientific research of marine benthic organisms.
Claims
1. A method for detecting marine benthic organisms based on Faster R-CNN with improved attention mechanism, characterized in that: The following steps are involved: Step 1: Obtain a marine benthic organism target detection dataset, wherein each data in the marine benthic organism target detection dataset includes a marine benthic organism image and a biological species label; Step 2: Build a Faster R-CNN marine benthic organism detection model based on the improved attention mechanism: The original convolutional neural network VGG16 in the Faster R-CNN model is replaced with the residual network ResNet50 network, and a multi-scale channel attention mechanism MSCAM is added after stage 3 of the residual network ResNet50 to enhance the model's attention to important features by processing features of different scales; The original RoIPooling layer in the Faster R-CNN model is replaced by the RoIAlign layer, which significantly reduces the quantization error. In the final classification and bounding box regression part of the Faster R-CNN model, the original classification fully connected layer in the Faster R-CNN model is replaced with the extreme learning machine ELM classifier; and a marine benthic organism detection model is obtained; Step 3: Use the marine benthic organism target detection data set obtained in step 1 to train the marine benthic organism detection model to obtain a trained marine benthic organism detection model; obtain the marine benthic organism image to be detected, input the trained marine benthic organism detection model, and obtain the detection result.
2. A method for detecting marine benthic organisms based on Faster R-CNN with improved attention mechanism as claimed in claim 1, characterized in that: In step S1, the marine benthic organism detection dataset includes the URPC2020 dataset and the RUOD dataset.
3. The method for detecting marine benthic organisms based on Faster R-CNN with improved attention mechanism as claimed in claim 1, characterized in that: In step S2, Input feature map of the multi-scale channel attention mechanism MSCAM F is a three-dimensional tensor with a shape of C×H×W, where C is the number of channels and H and W are the spatial dimensions; the input feature map F First, the bilinear interpolation function is used to obtain feature maps of different scales according to different scale factors. The specific calculation formula is as follows: in is the scale factor at different scales, The input feature maps at different scales are then entered into the module of the channel attention mechanism to calculate their respective channel attention maps. The calculation expression is as follows: , in is a multilayer perceptron, which means that the parameters pass through two fully connected layers and a ReLU activation function; and Respectively represent the channels The features of are calculated after global average pooling and global maximum pooling. and It represents the trainable parameters of the two fully connected layers; finally, the original sigmoid activation function is replaced by Hard sigmoid; Through the calculation of the channel attention mechanism, we can obtain the attention maps at different scales. After that, these attention maps are added and averaged to obtain the fused attention map , the specific calculation formula is as follows: in The number of representative scales; Finally, the obtained comprehensive attention map is expanded into the input feature map F The size and shape of the input feature map are applied element-wise. F The final output feature map is obtained F out .
4. A method for detecting marine benthic organisms based on Faster R-CNN with improved attention mechanism as claimed in claim 3, characterized in that: In step S2, the RoIAlign layer has a bilinear interpolation technique to perform precise sampling on each region of interest RoI.
5. The method for detecting marine benthic organisms based on Faster R-CNN with improved attention mechanism as claimed in claim 4, characterized in that: In step S2, the hidden layer parameters of the extreme learning machine ELM remain unchanged after initialization.
6. The method for detecting marine benthic organisms based on Faster R-CNN with improved attention mechanism according to claim 1, characterized in that: In step S3, the training of the marine benthic organism detection model includes: in the URPC2020 dataset, setting the training Epoch to 100, the batch size BatchSize to 4, and the learning rate Learning-rate to 1e-4; in the RUOD dataset, setting the training Epoch to 60, the batch size BatchSize to 4, and the learning rate Learning-rate to 1e-4.
Citation Information
Patent Citations
Multi-scale attention fusion Faster RCNN marine organism detection method and structure
CN116524174A
Underwater target detection method based on improved Faster R-CNN
CN116778311A