A method and system for detecting large yellow croaker using deep learning technology
Through deep learning technology, the YOLOv8 and HRNet models are improved, combined with attention mechanism and the interchange ratio loss function, real-time automated measurement of three-dimensional morphological parameters of yellow croaker is realized, and the low efficiency and error of fish morphological parameters measurement in the existing technology is solved. The big problem improves detection accuracy and efficiency.
Patent Information
- Application Number
- CN202410774527.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-17
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2044-06-17
AI Technical Summary
The existing fish morphological parameter measurement methods are inefficient and labor-intensive. Due to the introduction of subjective errors in manual operations, it affects the reliability and consistency of the measurement results, especially in complex environments, it is difficult to accurately detect the three-dimensional morphological parameters of fish.
Using deep learning technology, by improving the YOLOv8 algorithm model and HRNet network architecture, combining attention mechanism and interchange loss function, real-time automated measurement of three-dimensional morphological parameters of yellow croaker is realized, and 11 key points are defined to construct the fish body skeleton structure, and Contactless, real-time object detection.
It improves the accuracy and accuracy of yellow croaker detection, reduces the demand for computing resources, realizes lightweight target detection, reduces manual intervention, and improves measurement efficiency and data collection accuracy.
Smart Images

Figure CN118506103B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of fish morphological target detection, and in particular to a method and system for detecting large yellow croaker targets using deep learning technology. Background Art
[0002] Marine aquaculture plays an important role in the national economy and plays a significant role in ensuring the sustained growth of the national economy and improving people's living standards. The demand for aquatic products has increased significantly, leading to the rapid expansion of the aquaculture industry. In the process of fish farming, researchers use a series of key indicators to guide the selection and cultivation of high-quality fish fry.
[0003] At present, the mainstream method for measuring the morphological size of fish is mainly based on manual operation. This method requires the operator to first catch and fix the fish with fishing tools, and then rely on personal experience and visual inspection or use tape measures, measuring tools, etc. to record the body length of the fish. This method is not only inefficient, but also easily introduces subjective judgment errors due to a large amount of manual participation, affecting the reliability and consistency of the measurement results and increasing the error rate. In addition, since fish are extremely sensitive to environmental changes, the steps of capture, anesthesia and fixation force fish to leave their aquatic environment for a long time, which may cause different degrees of physical damage to them, induce physiological stress reactions such as excessive nerve excitement, decreased appetite, etc., and in extreme cases may lead to death, which has a negative impact on sustainable and healthy breeding. In view of the above problems, it is particularly important to explore efficient, accurate and non-contact measurement methods that have little impact on fish.
[0004] In the current field of fish farming, the three-dimensional morphological parameters of fish bodies are of great importance to fishery researchers. Especially in fishery research, researchers often need to refer to the three-dimensional morphological parameters of fish bodies such as body length and body width when screening fry. The use of non-contact methods based on computer vision can significantly reduce the cost of manpower and material resources, improve the efficiency and accuracy of data collection, and provide key references for breeding work. This method reduces the stress response to aquatic organisms, reduces subjective bias by protecting the integrity of the fish body and adopting standardized measurement processes, and accelerates the progress of breeding research. In the aquaculture industry, accurate measurement of three-dimensional morphological parameters is not only crucial for resource management, but also can promote the maximization of economic benefits and the rapid development of the industry. In general, the application of computer vision in the field of fisheries is not only a reflection of scientific and technological progress, but also an important symbol of the modernization and efficient development of the industry.
[0005] In actual aquaculture practice, great progress has been made in the field of fish morphological parameter measurement, but there are also certain problems as follows: 1. Traditional fish morphological parameter measurement methods mainly rely on manual operation, which is inefficient and labor-intensive, and has a negative impact on the accuracy of data analysis and result acquisition due to large measurement errors. 2. Complex environments and fish characteristics make it difficult for target detection models to distinguish key information of fish. For example, in complex environments, vision-based underwater images usually show low contrast and uneven illumination due to the scattering and absorption of light during propagation in water. In addition, the image may contain multiple non-fish background interferences similar to fish. For complex fish features, due to different camera viewing angles, the scale of fish in the image may vary, ranging from hundreds of pixels to thousands of pixels. In addition, in high-density scenes, mutual occlusion may occur between fish. 3. Target detection models with high detection accuracy are usually subject to multiple limitations and require a lot of computing resources. Therefore, there is an urgent need to apply lightweight target detection models to fish detection systems to achieve real-time fish detection. Most of the target detection models proposed in existing aquaculture-related studies rely on training with large-scale labeled datasets to achieve excellent performance. However, annotating densely distributed fish species in images is a time-consuming and labor-intensive task. Summary of the invention
[0006] In order to solve the above problems, the purpose of the present invention is to provide a target detection technology for large yellow croaker using deep learning technology, focusing on the real-time automated measurement of three-dimensional morphological parameters of large yellow croaker, and intending to assist breeders in quickly and efficiently screening out high-quality large yellow croaker fry.
[0007] In order to achieve the above technical objectives, the present application provides a method for detecting large yellow croaker using deep learning technology, comprising the following steps:
[0008] Collect the three-dimensional morphological parameters of large yellow croaker;
[0009] Based on the YOLOv8 algorithm model, the ResBlock design is introduced to enhance the model feature extraction capability. Four attention mechanism modules are integrated, and the SIoU loss function is used to improve the positioning accuracy. The attention network and the neck network are optimized using the intersection-over-union loss function. An improved YOLOv8 algorithm model is constructed for target detection based on three-dimensional morphological parameters.
[0010] Based on the HRNet network architecture, the spatial feature discretization attention module was introduced to replace the point convolution in the architecture to construct an improved HRNet network architecture, which was used to perform key point detection and locate large yellow croaker according to the three-dimensional morphological parameters corresponding to the target detection results.
[0011] Preferably, in the process of improving the YOLOv8 algorithm model, the head network structure of the YOLOv8 algorithm model is optimized through ResBlock design, wherein the ResBlock design is a dual-path design: the first branch is used as a feature extraction channel, which is completed by connecting three convolution layers with different kernel scales in series; the second branch is a short-circuit connection, which directly transmits the original input features or performs a convolution operation to achieve matching between feature layers.
[0012] Preferably, in the process of integrating four attention mechanism modules, the four attention mechanism modules include a ResCBAM module, a ResGAM module, a ResSA module and a ResECA module.
[0013] Preferably, in the process of improving the YOLOv8 algorithm model, the neck network of the YOLOv8 algorithm model is optimized in combination with BiFPN feature fusion.
[0014] Preferably, in the process of obtaining the intersection-over-union loss function, an intersection-over-union loss function is generated according to the angle difference, the distance difference, the shape difference and the IoU difference, so as to measure the angle loss, the distance loss, the shape loss and the IoU loss.
[0015] The present invention discloses a target detection system for large yellow croaker using deep learning technology, comprising:
[0016] A data acquisition module is used to obtain the three-dimensional morphological parameters of large yellow croaker;
[0017] The detection module is used to build an improved YOLOv8 algorithm model based on the YOLOv8 algorithm model. It introduces the ResBlock design to enhance the model's feature extraction capability, integrates four attention mechanism modules, uses the SIoU loss function to improve positioning accuracy, and uses the intersection-over-union loss function to optimize the attention network and the neck network. It is used to detect targets based on three-dimensional morphological parameters.
[0018] The positioning module is used to improve the HRNet network architecture by introducing a spatial feature discretization attention module to replace the point convolution in the architecture, and to build an improved HRNet network architecture. It is used to perform key point detection and locate large yellow croaker according to the three-dimensional morphological parameters corresponding to the target detection results.
[0019] Preferably, the detection module is also used to optimize the head network structure of the YOLOv8 algorithm model through ResBlock design, wherein the ResBlock design is a dual-path design: the first branch is used as a feature extraction channel, which is completed by connecting three convolution layers with different kernel scales in series; the second branch is a short-circuit connection, which directly transmits the original input features or performs a convolution operation to achieve matching between feature layers.
[0020] Preferably, the four attention mechanism modules of the detection module include a ResCBAM module, a ResGAM module, a ResSA module and a ResECA module.
[0021] Preferably, the detection module is also used to optimize the neck network of the YOLOv8 algorithm model in combination with BiFPN feature fusion.
[0022] Preferably, the detection module is also used to generate an intersection-over-union loss function based on the angle difference, distance difference, shape difference and IoU difference, which is used to measure the angle loss, distance loss, shape loss and IoU loss.
[0023] The present invention discloses the following technical effects:
[0024] The present invention transforms the data measurement problem into a key point positioning problem, and constructs the skeleton structure of the large yellow croaker body by defining 11 key points, thereby accurately describing the body shape of the large yellow croaker in the two-dimensional image. Through this method, the three-dimensional morphological parameters of the large yellow croaker can be obtained in a non-contact, real-time manner.
[0025] The present invention adopts the latest single-stage target detection algorithm YOLOv8. Combining the residual attention structure, the bidirectional feature fusion structure and the SIoU target box loss function, the detection precision and accuracy of large yellow croaker can be improved by using this algorithm.
[0026] The present invention adopts a method combining spatial feature discretization and attention module, which greatly reduces the number of parameters and calculations of key point detection algorithms and effectively improves the detection speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0028] Figure 1 It is the resnet residual unit described in the present invention;
[0029] Figure 2 The ResCBAM module and the ResGAM module described in the present invention;
[0030] Figure 3 The ResSA module and the ResECA module of the present invention;
[0031] Figure 4 It is a comparison of the feature fusion process of FPN, PANet and BiFPN described in the present invention;
[0032] Figure 5 It is the loss design of angle and distance described in the present invention;
[0033] Figure 6 It is the HRNet core architecture of the present invention;
[0034] Figure 7 It is the HRNet backbone network structure described in the present invention;
[0035] Figure 8 It is the GC, HSFDA, WSFDA characteristic aggregation structure of the present invention;
[0036] Fig. 9 It is a schematic diagram of the method flow of the present invention;
[0037] Fig.10 It is the mechanism of parallel stream feature fusion in HRNet described in the present invention. DETAILED DESCRIPTION
[0038] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0039] like Figure 1-9 As shown, the present invention provides a target detection technology for large yellow croaker using deep learning technology, which specifically includes the following processes:
[0040] 1. Large yellow croaker target detection based on improved YOLOv8-RBS:
[0041] The present invention makes three key improvements to the YOLOv8 detection algorithm to enhance its real-time performance and accuracy in complex application scenarios. First, the present invention integrates four mainstream attention mechanism modules: CBAM, GAM, ECA and SA into the neck network of YOLOv8 and combines it with the ResBlock structure. This step aims to improve the model's ability to recognize key features in the image while reducing the impact of background noise and irrelevant information. The relevant mechanisms have been introduced in detail in Chapter 2. Secondly, the feature fusion architecture of the neck network is optimized to improve the processing speed. Finally, an improved intersection-over-union (SIoU) loss function is introduced, which takes into account the sensitivity of angles and sizes, thereby aiming to improve the training efficiency and prediction accuracy of the model. Through these improvements, the present invention can significantly improve the performance of the YOLOv8 algorithm, making it more suitable for target detection tasks that require high real-time performance and high accuracy.
[0042] Based on the YOLOv8 algorithm, the present invention has deeply optimized its structure through a series of specific improvement measures. These improvements include the optimization of the details of the head network structure, the introduction of ResBlock design to enhance the feature extraction capability, the integration of four mainstream attention mechanism modules, and the use of SIoU loss function to improve the positioning accuracy, and jointly construct a new target detection architecture. In addition, the present invention also optimizes the design of the attention network and the neck network, and effectively solves the limitations of traditional target detection algorithms in certain scenarios by introducing an improved intersection-over-union loss function. Through a series of experimental verifications, the proposed algorithm shows significant performance improvement in the large yellow croaker detection task. In addition, the present invention also deeply explores the influence of different attention mechanisms, feature fusion techniques and loss functions on the model's accuracy in large yellow croaker detection, providing important reference and guidance for the performance optimization of target detection technology in practical applications.
[0043] 1.1. Residual Network (ResNet): It is a groundbreaking convolutional neural network architecture in the field of deep learning. It mainly solves the problem of gradient vanishing or gradient exploding as the number of layers of network training increases by introducing the design of cross-layer direct connection (Shortcut Connection), thus providing a guarantee for the increase of the number of layers of convolutional neural networks. The core concept of residual network is to let the network learn the residual between input and output, that is, by adding the input features directly to the output features, the learning target is transformed into a residual function. This innovative design not only promotes the effective flow of gradients and alleviates the problem of gradient vanishing, but also simplifies the task of network learning, improves the efficiency of training and the accuracy of the model. The residual structure achieves its remarkable performance through a parallel dual-branch design. Among them, the first branch is used as a feature extraction channel, which is mainly completed by connecting three convolution layers with different kernel sizes (1x1 and 3x3 convolution kernels respectively). Such a cascade not only ensures sufficient feature extraction capabilities, but also effectively reduces the number of model parameters and improves computational efficiency.
[0044] The second branch, Shortcut Connection, is designed to directly transfer the original input features or achieve matching between feature layers through a single convolution operation, thereby promoting the flow of information in the network, preventing the problem of gradient disappearance or explosion, and ensuring the stable training of the model and the effective extraction of deep features. This structure is not only suitable for processing images of various sizes, but also effectively ensures the smooth transmission of information from one layer to the next through direct connection or feature matching, so that the network can maintain the stability of the gradient and the effectiveness of feature extraction while increasing in depth. On this basis, the introduced 1×1 convolution layer is used for dimensionality reduction and dimensionality increase to reduce the number of parameters, while the 3×3 convolution layer is responsible for extracting features. This design optimizes the parameter efficiency in the feature extraction process.
[0045] The present invention optimizes and innovates the residual structure by combining the residual block (ResBlock) with four different attention mechanism modules, forming four new attention modules (such as Figure 2 , Figure 3 These modules are designed to further enhance the model's ability to capture features and learning efficiency, especially when dealing with complex and changing image content. These optimized attention modules not only inherit the advantages of the residual structure to prevent gradient disappearance, but also add the attention mechanism, providing new possibilities and a broader perspective for the application of deep learning models in various tasks.
[0046] 1.2. Neck network design combined with BiFPN feature fusion:
[0047] Bi-directional Feature Pyramid Network (BiFPN) is designed to solve the problem of multi-scale feature fusion in target detection tasks. By introducing bidirectional information flow and weighted feature fusion mechanism, it significantly improves the efficiency and effect of feature fusion compared to the traditional feature pyramid network (FPN). In FPN, information is transmitted from top to bottom in one direction, and when merging features of different scales, there may be uneven contribution problems. BiFPN establishes bidirectional cross-scale connections between features of different resolutions (such as Figure 4 ), so that low-level features can obtain the contextual information of high-level features, and high-level features can also obtain the detailed information of low-level features, enhancing the fusion effect of multi-scale features. In addition, by assigning independent weights to each input feature, BiFPN enables the network to learn to identify the importance of each feature, optimizes the flow of information in the fusion process, and significantly improves the overall performance of the model, making it more accurate and efficient when dealing with objects of various scales.
[0048] In feature fusion, conventional methods usually adjust features of different resolutions to the same resolution and then add them together. BiFPN introduces a weighted fusion mechanism to assign independent weights to each feature map involved in the fusion, allowing the network to learn the relative importance of different feature maps. This mechanism gives the network greater flexibility and accuracy when fusing multi-resolution features, while optimizing the efficiency of information flow. Through this weighted feature fusion method, BiFPN effectively solves the information imbalance problem that may occur when fusing features of different resolutions, improves the model's ability to detect targets of various scales, and ensures detection accuracy and model robustness in complex environments.
[0049] 1.3. Loss function design based on improved intersection-over-union ratio:
[0050] The construction of the loss function is crucial for the model to accurately predict the results. Traditional object detection loss functions mainly rely on metrics such as bounding box regression error, overlapping area ratio, and aspect ratio, such as GIoU, CIoU, DIoU, etc. Although these metrics can measure the similarity between the predicted box and the true box to a certain extent, they fail to fully consider the directional differences between the boxes, which may lead to large errors in the predicted box during training and make it difficult to achieve stable convergence.
[0051] To solve this problem, the SIoU loss function was proposed, which redefines the loss function by introducing angle difference, distance difference, shape difference and IoU difference, in order to improve the training efficiency and reasoning accuracy of the model. The design idea of the SIoU loss function is to comprehensively consider the angle difference between the real box and the predicted box, as well as the distance and shape differences between them, and combine with the traditional IoU indicator to more comprehensively measure the consistency between the predicted box and the real box. Such a loss function can effectively guide the model to adjust the predicted box more accurately during the training process, reduce errors, and improve the accuracy of the final detection.
[0052] The SIoU loss function consists of four parts (such as Figure 5 The SIoU loss function (shown in Figure 2)—angle loss, distance loss, shape loss, and IoU loss—each optimizes the key factors in the object detection process to ensure that the model can achieve good performance in different aspects. This multi-dimensional consideration allows the SIoU loss function to accurately predict the target position and shape in complex backgrounds by considering the directionality of the prediction box, effectively reducing background interference. For targets with significant size changes, the SIoU loss function reduces the reliance on additional training data, and improves the adaptability and detection accuracy of the model by sensitively processing size and shape changes. In high-precision scenarios such as autonomous driving and face recognition, the introduction of a refined loss metric provides the model with a more precise optimization direction, improving performance and reliability in key applications. These characteristics of the SIoU loss function make it an effective performance improvement strategy when facing object detection challenges.
[0053] 2. Large yellow croaker key point detection based on lightweight HRNet of target detection results:
[0054] After successfully identifying and framing the fish body, in order to improve the measurement accuracy and real-time performance of the three-dimensional morphological parameters of the fish body, the present invention proposes an improved processing method to replace the traditional manual measurement method. By combining computer vision technology and image processing technology, the present invention develops an algorithm network based on key point positioning for accurately measuring the three-dimensional morphology of the fish body. This method first involves preprocessing the fish body image, then using focus shape analysis to identify the key points of the fish body, and obtaining the three-dimensional data of the fish body through these key points. In particular, in complex backgrounds or when fast processing is required, the key point positioning algorithm in the traditional method may not be able to accurately identify the target point. Therefore, the present invention draws on the key point positioning method in human posture estimation technology and develops a key point positioning network designed specifically for fish bodies. The skeleton morphology of the large yellow croaker body is summarized by defining 11 key points, and then the distance between these points is calculated through depth information to obtain the true three-dimensional morphological parameters.
[0055] 2.1. Key point positioning based on HRNet:
[0056] The architecture of HRNet (structure as Figure 6 The high-resolution representation module, multi-resolution representation module and information fusion module are integrated in the network. These three modules work together on the network to achieve the simultaneous capture and effective use of fine-grained and coarse-grained information. Among them, the main task of the high-resolution representation module is to maintain the high-definition information in the image and ensure that the high-resolution features are maintained during the entire network processing. As the depth of the network increases, the multi-resolution representation module begins to play a role, gradually introducing low-resolution feature representations. These features of different resolutions are processed in parallel to capture the information level from coarse to fine. The core of this design idea is that features of different resolutions exist in parallel in the network, rather than the traditional sequential processing method of gradually reducing the resolution and then upgrading it back, thus avoiding the loss and blurring of information. The information fusion module plays a vital bridging role. Through multiple scale fusion operations, it promotes the exchange and integration of information between different resolution levels. This interaction and fusion of information not only enhances the network's ability to capture details and global information in the image, but also makes the final output feature representation richer and more accurate, greatly improving the accuracy and efficiency of identifying various attributes of the image.
[0057] The design of HRNet is divided into four main stages. The initial stage consists of a high-resolution network, and each subsequent stage introduces a new low-resolution network with a resolution of half the lowest resolution of the previous stage. The information between stages is exchanged through multi-resolution blocks including multi-resolution group convolution and multi-resolution convolution. Figure 7 As shown in Figure 1, the HRNet network starts with a high-resolution feature map stage, followed by multiple stages consisting of high-to-low resolution streams, which are composed of parallel multi-resolution streams and repeated multi-resolution fusion modules. This structure integrates feature maps of different resolutions to show features of each scale, thereby improving the accuracy of key point detection.
[0058] HRNet's parallel multi-resolution fusion process is carried out in multiple stages. The process starts with a high-resolution convolutional stream, and then gradually integrates streams from high resolution to low resolution and connects them in parallel. This way, the resolution of each subsequent stage is formed by combining the resolution of the previous stage and an additional lower resolution stream. The mechanism of parallel stream feature fusion in HRNet can be achieved by Fig.10It is represented in the form of, where Nsb represents the subnetwork in the b-th branch of the s-th stage. The first branch maintains the highest resolution and its size is one-fourth of the input image. In the HRNet network, the width H and height W of the feature map x∈RC×H×W are of the same order of magnitude as the number of channels C. Therefore, the computational complexity in high-resolution pose estimation can be reduced by shifting the focus from C to the spatial dimensions: H and W.
[0059] After the four stage feature maps produced by the backbone network of HRNet, the feature integration step needs to be further performed. For the key point recognition task, the header of the network will increase the dimension of the output of each branch, and then sort it from high to low according to the resolution, and use downsampling to reduce the resolution while merging layer by layer, and perform feature fusion by accumulation, and finally use a 1×1 convolution operation to complete the dimensionality increase.
[0060] In summary, HRNet has two major advantages over traditional network architectures in the field of posture estimation. First, unlike most existing solutions that sequentially connect low-resolution subnetworks, HRNet maintains high resolution of features throughout the feature transfer process by connecting subnetworks of different resolutions in parallel. This design avoids the process of gradually restoring low to high resolution in traditional methods, which can improve the accuracy of spatial prediction and generate more accurate heat maps. In addition, unlike most current fusion strategies, which usually only merge low-level and high-level representations, HRNet implements multi-stage multi-scale fusion, using low-resolution representations of similar depth and equivalent level to enhance high-resolution representations. This method considers information of different levels and fine-grainedness during the fusion process. In this way, the expressive power of high-resolution representations can be improved. And vice versa. Such complementary and enhanced effects make high-resolution features richer and more accurate when performing posture estimation.
[0061] 2.2. Improved method combining spatial feature discretization:
[0062] With the continuous advancement of deep learning technology, key point detection has been widely used in many fields, among which key point detection of large yellow croaker has important practical application value. However, given the complexity of the body characteristics of large yellow croaker, the application of traditional key point detection algorithms to identify its target key points often faces the need to process high-resolution image representations [53-55]. The challenges that may be encountered in this process include numerous parameters and high computational complexity. In order to accurately locate the key point positions on large yellow croaker, improve the efficiency of key point detection and reduce the dependence on low-resolution images, this study proposes to introduce the spatial feature discretization attention (SFDA) module and combine it with the HRNet network architecture for optimization.
[0063] At present, the mainstream method of key point localization relies on predicting a two-dimensional heat map for each key point, where each pixel value of the heat map reflects the probability of the corresponding position being a key point. The step of identifying the position of the key point includes searching for the local maximum point on the heat map. In order to retain high-resolution details while reducing computational complexity, the method proposed in the present invention first maximizes the confidence of all key point regions in the entire two-dimensional space, and then projects the obtained two-dimensional confidence map in the horizontal and vertical directions respectively to form two one-dimensional confidence heat vectors. In this way, the two-dimensional heat map of each key point can be reconstructed by a pair of one-dimensional heat vectors. Based on this idea, the present invention draws on the design idea of GCBlock and adopts the spatial feature discretization attention module (SFDA) to replace the point convolution (1×1 convolution) in HRNet to improve the accuracy and efficiency of key point detection.
[0064] GCBlock is an improved form of non-local network (NLNet). Non-local network is an effective means to capture long-distance feature dependencies by adopting the self-attention mechanism to model the dependencies between pixels. Non-local network introduces an innovative mechanism, which is to capture long-distance dependencies by aggregating the global context of a specific query position, thereby effectively enhancing the representation ability of the network. However, this network must calculate a global attention map that is independent of position when analyzing each pixel of the feature map, which leads to unnecessary resource consumption. GCBlock is further optimized on this basis (such as Figure 8 As shown in the figure): First, the present invention uses 1×1 convolution operation Wk and softmax function to calculate the attention weight, and extracts global context features through global attention pooling operation. In this way, the present invention can focus on key global information and extract features; secondly, the present invention uses 1×1 convolution Wv to transform the features. This conversion operation can adjust and map the dimensions of the features to meet subsequent processing requirements; finally, the present invention adds the extracted global context features to the features of each position through feature fusion. This fusion operation can effectively reduce the number of parameters and computational complexity associated with non-local networks.
[0065] SFDA optimizes feature representation (e.g., Figure 8). The specific workflow is as follows: First, the SFDA module groups features along a single spatial dimension (height H or width W) by applying a combination matrix xq to output unidirectional context features; then, these grouped features are transformed through 1×1 point-wise convolution to learn attention vectors on the remaining spatial dimensions; finally, these learned attention vectors are aggregated with the input feature map through matrix dot multiplication operations. Since SFDA only applies convolution on a single spatial dimension of linear complexity and uses point-wise (1×1) convolution to process two-dimensional space, it further reduces the computational complexity and the number of required parameters.
[0066] The introduction of the SFDA module not only significantly reduces the computational complexity, but also effectively captures the long-distance dependencies in the feature map through its built-in attention mechanism. This capability enables the network to more deeply parse the contextual information in the image, thereby improving the accuracy of key point positioning. In addition, the addition of the SFDA module also enhances the interpretability of the network, making the features learned by the model more consistent with the real structure of the body posture of the large yellow croaker, which is of great significance for improving the efficiency and accuracy of key point detection.
[0067] In a specific implementation scheme, the fish body image is cropped and input into the key point positioning network in combination with the detection results of the target detection model, and the network outputs the key point coordinates of the fish body. Then, the point cloud data is established by mapping the color map and the depth map through the binocular structured light camera, and the three-dimensional distance between the key points is calculated to obtain accurate three-dimensional morphological parameters. The core of the present invention is how to quickly and accurately obtain the key point coordinates. The HRNet
[49] network is used as a benchmark, and the method is improved by introducing an attention mechanism based on spatial feature discretization. The method enhances the accuracy of key point positioning by maintaining high-resolution feature representation and adopting a multi-scale fusion strategy. At the same time, by adding the SFDA module, the reasoning efficiency is improved and the network parameters are reduced. The experimental results show the excellent performance of the key point detection algorithm on the large yellow croaker dataset, proving the effectiveness and practical value of the method. This measurement technology not only ensures good accuracy, but also improves the real-time performance of detection, proving its potential value in practical applications.
[0068] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0069] In the description of the present invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0070] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A method for detecting large yellow croaker using deep learning technology, characterized in that: The following steps are involved: Collect the three-dimensional morphological parameters of large yellow croaker; Based on the YOLOv8 algorithm model, the ResBlock design is introduced to enhance the model feature extraction capability, four attention mechanism modules are integrated, the SIoU loss function is used to improve the positioning accuracy, and the attention network and the neck network are optimized using the intersection-over-union loss function. An improved YOLOv8 algorithm model is constructed for target detection according to the three-dimensional morphological parameters. Based on the HRNet network architecture, the spatial feature discretization attention module is introduced to replace the point convolution in the architecture to improve it, and an improved HRNet network architecture is constructed to perform key point detection according to the three-dimensional morphological parameters corresponding to the target detection results to locate the large yellow croaker; In the process of improving the YOLOv8 algorithm model, the head network structure of the YOLOv8 algorithm model is optimized through the ResBlock design, wherein the ResBlock design is a dual-path design: the first branch is used as a feature extraction channel, which is completed by connecting three convolution layers with different kernel scales in series; the second branch is a short-circuit connection, which directly transmits the original input features or performs a convolution operation to achieve matching between feature layers; In the process of integrating four attention mechanism modules, the four attention mechanism modules include ResCBAM module, ResGAM module, ResSA module and ResECA module; In the process of obtaining the intersection-over-union loss function, the intersection-over-union loss function is generated according to the angle difference, the distance difference, the shape difference and the IoU difference, so as to measure the angle loss, the distance loss, the shape loss and the IoU loss; In the process of improving point convolution, the specific workflow is as follows: first, the SFDA module groups the features along a single spatial dimension by applying the combination matrix xq and outputs unidirectional contextual features; then, these grouped features are transformed through 1×1 point-by-point convolution to learn the attention vectors on the remaining spatial dimensions; finally, these learned attention vectors are aggregated with the input feature map through matrix dot multiplication operations.
2. A method for detecting large yellow croaker using deep learning technology according to claim 1, characterized in that: In the process of improving the YOLOv8 algorithm model, the neck network of the YOLOv8 algorithm model is optimized by combining BiFPN feature fusion.
3. A target detection system for large yellow croaker using deep learning technology, characterized in that: include: A data acquisition module is used to obtain the three-dimensional morphological parameters of large yellow croaker; A detection module is used to build an improved YOLOv8 algorithm model based on the YOLOv8 algorithm model, which introduces the ResBlock design to enhance the model feature extraction capability, integrates four attention mechanism modules, adopts the SIoU loss function to improve the positioning accuracy, and optimizes the attention network and the neck network using the intersection-over-union loss function, so as to perform target detection according to the three-dimensional morphological parameters; A positioning module is used to improve the HRNet network architecture by introducing a spatial feature discretization attention module to replace the point convolution in the architecture, and to construct an improved HRNet network architecture, which is used to perform key point detection according to the three-dimensional morphological parameters corresponding to the target detection results, and to locate the large yellow croaker; The detection module is further used to optimize the head network structure of the YOLOv8 algorithm model through the ResBlock design, wherein the ResBlock design is a dual-path design: the first branch is used as a feature extraction channel, which is completed by connecting three convolution layers with different kernel scales in series; the second branch is a short-circuit connection, which directly transmits the original input features or performs a convolution operation to achieve matching between feature layers; The four attention mechanism modules of the detection module include ResCBAM module, ResGAM module, ResSA module and ResECA module; The detection module is also used to generate the intersection-over-union loss function according to the angle difference, distance difference, shape difference and IoU difference, so as to measure the angle loss, distance loss, shape loss and IoU loss; In the process of improving point convolution, the specific workflow is as follows: first, the SFDA module groups the features along a single spatial dimension by applying the combination matrix xq and outputs unidirectional contextual features; then, these grouped features are transformed through 1×1 point-by-point convolution to learn the attention vectors on the remaining spatial dimensions; finally, these learned attention vectors are aggregated with the input feature map through matrix dot multiplication operations.
4. According to claim 3, a target detection system for large yellow croaker using deep learning technology is characterized in that: The detection module is also used to optimize the neck network of the YOLOv8 algorithm model in combination with BiFPN feature fusion.
Citation Information
Patent Citations
Fish detection and identification method based on improved YOLOX-nano algorithm
CN117911790A
Systems and methods for monitoring urban areas
WO2023015344A1