An underwater fish population number estimation method based on sonar images

CN122990448APending Publication Date: 2026-10-27HONG KONG POLYTECHNIC UNIVERSITY (JINJIANG) TECHNOLOGY INNOVATION RESEARCH INSTITUTE CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611473692.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-21
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

尽管声呐数鱼在浑浊、黑暗、深水环境中可以稳定工作,但是声呐原始数据普遍存在噪声干扰强、目标特征不显著的问题,直接用于识别易引发误检

Benefits of technology

[0017]与现有技术相比,本发明具有如下优点,第一,通过多尺度卷积与动静权重融合机制同时提取鱼体局部轮廓、细微纹理、鱼群整体形态和大范围分布密度信息,提高模型对不同体型、不同密集程度和不同集群形态鱼群的适应能力。第二,通过几何边缘分支增强鱼体轮廓和边界区域的可分辨性,并通过坐标注意力分支对有效鱼群区域进行空间重校准,有利于抑制声呐图像中的杂波、声阴影和空白水域干扰。第三,通过检测分支、计数分支与数量修正的联合设计,实现鱼群位置识别与数量估算的协同优化,降低鱼群重叠、重复检测和漏检造成的计数误差。第四,该方法对鱼群数量的识别效率高,能够在浑浊、弱光、深水等复杂水下养殖环境中保持较好的识别稳定性和鲁棒性,可为水产养殖密度监测、智能渔业管理、养殖保险评估和声呐图像自动分析提供可靠数据支撑。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122990448A_ABST
    Figure CN122990448A_ABST
Patent Text Reader

Abstract

The present application relates to a kind of underwater fish population estimation method based on sonar image, belong to image recognition and aquaculture technical field, mainly solve the problem of insufficient precision of traditional fish population recognition technology in complex underwater environment, it includes: obtaining the original sonar image of underwater fish population, and carries out data preprocessing;After the preprocessed sonar image is sequentially subjected to multi-scale feature extraction, dynamic weight and static weight fusion, double-branch feature refinement, feature fusion and extraction, enhance the quality of sonar image and extract fish population feature, again via detection branch, count branch parallel prediction, the original single-region fish population is corrected, and the corrected single-region fish population is obtained, and the final fish population is obtained by merging.This application realizes the collaborative optimization of fish population position recognition and quantity estimation, greatly improves the recognition accuracy of fish population quantity in complex sonar image and provides reliable data support for intelligent breeding.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of image recognition and aquaculture technology, specifically relating to a method for estimating the number of underwater fish populations based on sonar images. Background Technology

[0002] Aquaculture is a vital industry for ensuring global food security and the supply of high-quality protein. With the widespread adoption of factory farming and large-scale aquaculture models, the need for accurate fish population statistics is becoming increasingly urgent. Traditional aquaculture relies on manual inspections and experience-based judgment, leading to inaccurate fish population counts. High rates of missed detection, such as dead fish at the bottom and areas inside net cages, can easily trigger disease outbreaks, water quality deterioration, and large-scale aquaculture losses. Furthermore, global climate change and frequent extreme weather events like typhoons further exacerbate the risks and instability of aquaculture production.

[0003] In cities like Hong Kong and Ningde, where there is a huge demand for fish population statistics and abundant fishery resources, fisheries play a unique role in ensuring the supply of high-quality protein and preserving fishing village culture. However, due to the scarcity of land resources and the frequent occurrence of extreme weather events such as typhoons, the traditional aquaculture industry faces urgent pressure to transform and upgrade.

[0004] Early optical fish counting relied entirely on manual labor, using cameras next to the fish cages to count the fish by hand, which was extremely inefficient. Later, traditional image processing methods based on threshold segmentation and edge detection were developed, which could count individual fish in clear water environments, but had very high environmental requirements. With the application of deep learning models such as Faster R-CNN and YOLO, the accuracy of optical fish counting has been greatly improved, but it is still easily affected by environmental factors such as water turbidity, insufficient light, and algae obstruction, making it difficult to work stably in turbid or low-light aquaculture water.

[0005] To address the instability of existing optical fish counting methods in turbid, low-light, and deep-water environments, sonar technology has been increasingly applied to estimate fish biomass by analyzing echo intensity. Sonar fish counting involves actively emitting sound waves and receiving echo signals reflected from fish bodies, then using signal processing and recognition algorithms to detect and count fish schools. With the widespread adoption of multibeam imaging sonar and synthetic aperture sonar, sonar fish counting has entered a new phase, generating two-dimensional sonar images of fish schools. Combined with target detection and tracking algorithms, this enables the identification, counting, and trajectory tracking of individual fish within the school. Although sonar fish counting can operate stably in turbid, dark, and deep-water environments, raw sonar data generally suffers from strong noise interference and indistinct target features, making direct use for identification prone to false positives. Furthermore, sonar data annotation is costly, and deep learning models face challenges such as insufficient training samples and limited generalization ability. In addition, when fish are densely distributed and their swimming trajectories intersect, echo signals tend to overlap, significantly increasing the difficulty of individual differentiation and continuous tracking. Summary of the Invention

[0006] In view of the shortcomings of the prior art, the purpose of the present invention is to provide a method for estimating the number of underwater fish based on sonar images, so as to solve or improve at least some of the defects existing in the prior art.

[0007] To achieve the above objectives, the present invention adopts the following technical solution: a method for estimating the number of underwater fish schools based on sonar images, comprising: Acquire raw sonar images of underwater fish schools and perform data preprocessing on the raw sonar images to obtain preprocessed sonar images; The preprocessed sonar image is subjected to multi-scale feature extraction to obtain multiple fish target feature maps at different scales. The fish swarm target feature maps of multiple different scales are fused with dynamic and static weights to obtain a fused fish swarm feature map. The fish swarm fusion feature map is refined into a dual-branch feature map to obtain a fish swarm edge enhancement feature map and a fish swarm spatial recalibration feature map. The fish school edge enhancement feature map and the fish school spatial recalibration feature map are fused and extracted to obtain a shared fused feature map; The shared fusion feature map is subjected to parallel prediction of detection and counting branches to obtain the target bounding box coordinates, target confidence, and the original number of fish in a single region. Based on the target bounding box coordinates and the target confidence level, the original single-area fish population is corrected to obtain the corrected single-area fish population. The corrected fish populations in each area are then combined to obtain the final fish population count.

[0008] Preferably, the specific method for acquiring the raw sonar image of the underwater fish school and preprocessing the raw sonar image to obtain the preprocessed sonar image includes: The aquaculture water body is scanned 360° by sonar equipment to obtain raw sonar data; wherein, the raw sonar data is a binary format file containing fish school echo information, environmental noise information and acoustic shadow information, and each binary format file generates a raw sonar video of a predetermined duration; Image frames are extracted from the original sonar video at a predetermined frequency to obtain multiple frames of original sonar images of underwater fish schools; The pixel values ​​of the original sonar images of the underwater fish school in multiple frames are normalized to obtain the preprocessed sonar images.

[0009] Preferably, the specific method for extracting multi-scale features from the preprocessed sonar image to obtain multiple fish target feature maps at different scales is as follows: Parallel convolution was performed on the preprocessed sonar image using convolution kernels of 3×3, 5×5, 7×7, 11×11, and 15×15, respectively, to obtain five fish target feature maps at different scales.

[0010] Preferably, the specific method for fusing multiple fish target feature maps of different scales using dynamic and static weights to obtain a fused fish feature map includes: The fusion weights of the fish target feature maps at various scales are calculated using the following formula: ; Among them, w i w is the fusion weight of the fish swarm target feature map at the i-th scale. static For pre-trained static weights, w dynamic The weights are dynamically generated adaptively by the multilayer perceptron, and α is a learnable balance coefficient with a value range of [0, 1]. Based on the fusion weights of the fish target feature maps at different scales, a weighted sum is performed on multiple fish target feature maps at different scales to obtain the fish fusion feature map; the specific formula is as follows: ; in, This is a feature map of fish fusion. Let M be the feature map of the fish swarm at the i-th scale, where M is the number of scales.

[0011] Preferably, the specific method for refining the fish swarm fusion feature map into a bi-branch feature map to obtain the fish swarm edge enhancement feature map and the fish swarm spatial recalibration feature map includes: The fish swarm fusion feature map is refined by geometric edge branch features, specifically by Sobel gradient calculation, initial edge map generation and residual convolution block processing, to obtain the fish swarm edge enhancement feature map. The fish swarm fusion feature map is refined by coordinate attention branch features, specifically by one-dimensional pooling cross-directional fusion, attention generation, and feature space recalibration, to obtain the fish swarm spatial recalibrated feature map.

[0012] Preferably, the fish swarm fusion feature map is refined by geometric edge branch features. Specifically, this is achieved through Sobel gradient calculation, initial edge map generation, and residual convolutional block processing to obtain the fish swarm edge enhancement feature map. Sobel gradient calculation is performed on the fused feature map of the fish swarm, using horizontal convolution kernel K respectively. x Vertical convolution kernel K y Convolution is performed on the fused feature map of the fish swarm to obtain the horizontal gradient map G. x Vertical gradient map G y ; An initial edge map is generated using the horizontal gradient map and the vertical gradient map, using the following formula: ; in, This is the initial edge map; The initial edge map is input into a residual convolutional block for processing to obtain the fish school edge enhancement feature map; the specific formula is as follows: ; in, Enhance the feature map for geometric edges. The edge detail compensation and noise suppression feature maps learned by the residual convolutional block.

[0013] Preferably, the fish swarm fusion feature map is refined by coordinate attention branch features, specifically through one-dimensional pooling cross-directional fusion, attention generation, and feature space recalibration, to obtain the fish swarm spatially recalibrated feature map. The specific method includes: One-dimensional pooling cross-directional fusion is performed on the fish swarm fusion feature map to aggregate spatial information along the horizontal and vertical directions, respectively, to obtain spatial features with direction-aware capabilities. ; The horizontal attention weight M is generated through the attention generation module. h Vertical and horizontal attention weights M w ; The fish swarm spatial recalibration feature map is obtained by multiplying the horizontal attention weights and the vertical and horizontal attention weights pixel by pixel with the fish swarm fusion feature map, as shown in the following formula: ; in, Spatial recalibration of feature maps for fish schools This is a feature map of fish swarm fusion.

[0014] Preferably, the specific method for fusing and extracting features from the enhanced fish school edge feature map and the fish school spatial recalibration feature map to obtain the enhanced fish school feature map includes: The fish swarm edge enhancement feature map and the fish swarm spatial recalibration feature map are concatenated along the channel dimension to obtain the concatenated fused feature map. The specific formula is as follows: ; in, This is the fused feature map after splicing. T' is the geometric edge enhancement feature map, and T' is the fish swarm spatial recalibration feature map; A 1×1 convolution kernel is used to convolve the concatenated fused feature map to obtain a dual-branch refined enhancement incremental feature map for edges and attention. The specific formula is as follows: ; Among them, T fused Enhance the incremental feature map by refining the dual branches of edge and attention; The incremental feature map is refined and enhanced by connecting the residuals to the edge and the attention in a two-branch process, resulting in the final enhanced feature map. The specific formula is as follows: ; in, To ultimately enhance the feature map, This is a feature map of fish fusion. It is a learnable controllable coefficient; The feature extraction module is used to extract shared features from the final enhanced feature map to obtain a shared fused feature map.

[0015] Preferably, the specific method for performing parallel prediction of the shared fused feature map using detection and counting branches to obtain the target bounding box coordinates, target confidence, and the original number of fish in a single region includes: The target region of the fish school in the shared fused feature map is identified by detecting the branch, and the target bounding box coordinates and target confidence of the target region of the fish school are output. The original number of fish in each target area is estimated by counting branches to obtain the original number of fish in a single area.

[0016] Preferably, the specific method for correcting the original single-area fish population based on the target bounding box coordinates and the target confidence level to obtain the corrected single-area fish population includes: Based on the coordinates of the target bounding box, the intersection-union ratio between different target bounding boxes is calculated to obtain the degree of overlap of the target regions; Based on the target confidence level and the overlap degree of the target region, the original single-region fish population is corrected to obtain the corrected single-region fish population, using the following formula: ; Among them, Y i Y represents the corrected fish population size in a single area. d denoted as the original fish population size in a single area, and k is the population correction coefficient.

[0017] Compared with existing technologies, this invention has the following advantages: First, by using a multi-scale convolution and dynamic-static weight fusion mechanism, it simultaneously extracts local fish contours, fine textures, overall fish morphology, and large-scale distribution density information, improving the model's adaptability to fish schools of different sizes, densities, and cluster patterns. Second, by enhancing the discriminability of fish contours and boundary regions through geometric edge branches, and by using coordinate attention branches to spatially recalibrate effective fish school regions, it helps suppress clutter, acoustic shadows, and interference from blank water areas in sonar images. Third, through the joint design of detection branches, counting branches, and quantity correction, it achieves synergistic optimization of fish school location identification and quantity estimation, reducing counting errors caused by overlapping, duplicate detection, and missed detections. Fourth, this method has high efficiency in identifying fish school numbers and maintains good identification stability and robustness in complex underwater aquaculture environments such as turbidity, low light, and deep water, providing reliable data support for aquaculture density monitoring, intelligent fisheries management, aquaculture insurance assessment, and automatic sonar image analysis. Attached Figure Description

[0018] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.

[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This is a flowchart illustrating a method for estimating the number of underwater fish based on sonar images, according to an embodiment of the present invention.

[0021] Figure 2 This is a diagram illustrating the working mode of a sonar device for estimating the number of underwater fish based on sonar images, according to an embodiment of the present invention.

[0022] Figure 3 This is a block diagram illustrating the principle of an underwater fish population estimation method based on sonar images, according to an embodiment of the present invention.

[0023] Figure 4 This is a schematic diagram illustrating the shared feature extraction of an underwater fish population estimation method based on sonar images, according to an embodiment of the present invention.

[0024] Figure 5 This is a schematic diagram of the detection branch process of an underwater fish population estimation method based on sonar images, according to an embodiment of the present invention.

[0025] Figure 6 This is a schematic diagram of the counting branch process of an underwater fish population estimation method based on sonar images, according to an embodiment of the present invention. Detailed Implementation

[0026] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Many specific details are set forth in the following description to provide a thorough understanding of the present invention. However, the present invention can be practiced in many other ways different from those described herein, and those skilled in the art can make similar modifications without departing from the spirit of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0027] Please see Figures 1 to 6 The present invention provides a method for estimating the number of underwater fish schools based on sonar images, comprising the following steps: S100. Acquire the original sonar image of the underwater fish school, and perform data preprocessing on the original sonar image to obtain the preprocessed sonar image. S200. Perform multi-scale feature extraction on the preprocessed sonar image to obtain multiple fish target feature maps at different scales. S300. The multiple fish target feature maps of different scales are fused with dynamic weights and static weights to obtain a fused fish feature map. S400. The fish swarm fusion feature map is refined into a dual-branch feature map to obtain a fish swarm edge enhancement feature map and a fish swarm spatial recalibration feature map. S500: The fish school edge enhancement feature map and the fish school spatial recalibration feature map are fused and extracted to obtain a shared fused feature map; S600. Perform parallel prediction of detection branch and counting branch on the shared fusion feature map to obtain the target bounding box coordinates, target confidence and the original number of fish in a single region. S700. Based on the target bounding box coordinates and the target confidence level, the original number of fish in a single area is corrected to obtain the corrected number of fish in a single area. S800. The corrected number of fish in a single area is merged to obtain the final number of fish.

[0028] In one embodiment of the present invention, optionally, step S100 involves acquiring the original sonar image of an underwater fish school and performing data preprocessing on the original sonar image to obtain a preprocessed sonar image. The specific method includes the following steps: S110. The aquaculture water body is scanned 360° using a sonar device to obtain raw sonar data; wherein, the raw sonar data is a binary format file containing fish echo information, environmental noise information and acoustic shadow information, and each binary format file generates a raw sonar video of a predetermined duration (e.g., 30 minutes). Please refer to Figure 2 Sonar equipment can be moved underwater by unmanned vessels or sliding platforms. For example, three 120° sector-scanning sonar devices can be used to achieve a 360° scan of aquaculture water bodies (such as aquaculture ponds). Figure 2 In the figure, x, y, and z form an underwater three-dimensional global coordinate system, φ is the sonar probe elevation angle, θ is the sonar horizontal scanning azimuth angle, α is the sonar vertical beamwidth, and β is the sonar horizontal beamwidth. S120. Extract image frames from the original sonar video at a predetermined frequency (e.g., 4 frames / second) to obtain multiple frames of original sonar images of underwater fish schools; S130. Normalize the pixel values ​​of the original sonar images of the underwater fish school in multiple frames, for example, unify the pixel values ​​to 1280×960 to obtain the preprocessed sonar images.

[0029] In one embodiment of the present invention, optionally, the specific method for step S200 of extracting multi-scale features from the preprocessed sonar image to obtain multiple fish target feature maps at different scales is as follows: Parallel convolution was performed on the preprocessed sonar image using convolution kernels of 3×3, 5×5, 7×7, 11×11, and 15×15, respectively, to obtain five fish target feature maps at different scales.

[0030] Compared to traditional single-size convolutions, which can only adapt to fish schools of a single size, small kernels are prone to losing global distribution features, while large kernels ignore the details of tiny fish fry. In this embodiment, step S200 inputs the preprocessed sonar image into a multi-scale convolution module. The multi-scale convolution module has five levels of convolution kernels (T1, T2, T3, T4, T5) with kernel sizes of [3×3, 5×5, 7×7, 11×11, 15×15], achieving full-scale feature coverage from microscopic individuals to macroscopic fish schools, and extracting information through multi-level complementary processing. Among them, the small convolution kernels of [3×3, 5×5] are good at capturing the local contours, fine textures and edge details of fish bodies, and can distinguish the weak echo boundaries between densely stacked individuals. The large convolution kernels of [7×7, 11×11, 15×15] can cover a large area of ​​water, completely extracting the overall morphology of the fish school, the large-scale distribution density and global background clutter features. By extracting multi-dimensional features through multi-scale parallel convolution, the model overcomes the poor adaptability of single-scale convolution, significantly enhancing its ability to capture features of fish targets of different sizes, densities, and cluster patterns. It also weakens the interference caused by noise and clutter in sonar images, providing a basic feature map with complete details and sufficient global information for subsequent feature enhancement, thereby reducing the probability of missed or false detections of fish from the source.

[0031] In one embodiment of the present invention, optionally, step 300, which fuses the multiple fish swarm target feature maps of different scales using dynamic weights and static weights to obtain a fused fish swarm feature map, includes the following steps: S310. Calculate the fusion weights of the fish target feature maps at various scales. The specific formula is as follows: ; Among them, w i w is the fusion weight of the fish swarm target feature map at the i-th scale. static These are pre-trained static weights, fixed baseline weights obtained during the initial pre-training of the neural network. They are slowly optimized during the overall training iterations of the model and are used to learn the basic importance of features at different scales in the overall task. These weights are gradually optimized during training and can preserve stable global feature representations; w dynamic The dynamic weights are adaptively generated by the multilayer perceptron. They are generated in real time by a small multilayer perceptron based on a single input sonar image. Each image will output a new set of weights and adaptively adjust them according to the specific working conditions of a single image. α is a learnable balance coefficient with a value range of [0, 1], which serves as the adjustment hub for static and dynamic weights. Controlling the proportion of basic static features ensures that the model does not completely deviate from the general prior; α controls the magnitude of dynamic adaptive adjustment, giving the neural network the ability to autonomously balance the "general prior" and "real-time adaptation of a single graph" based on the characteristics of the dataset, without the need for manual fixing of the ratio of the two weights; S320. Based on the fusion weights of the fish target feature maps at various scales, a weighted sum is performed on the multiple fish target feature maps at different scales to obtain the fish fusion feature map; the specific formula is as follows: ; in, For fish swarm fusion feature map, T i Let M be the feature map of the fish swarm at the i-th scale, where M is the number of scales.

[0032] In step S300 of this embodiment, the weighted multi-layer, multi-scale features are superimposed channel by channel to form a fish swarm fusion feature map that takes into account both global general rules and the characteristics of a single image scene, thus completing the first layer of noise filtering and feature selection. The multi-scale features, through a fusion mechanism that combines static and dynamic weights, solve the problems of poor adaptability and unstable recognition when traditional feature fusion relies solely on fixed static weights and faces noise abrupt changes and clutter interference.

[0033] In one embodiment of the present invention, optionally, the specific method for refining the fish swarm fusion feature map into a bi-branch feature map and a fish swarm spatial recalibration feature map in step S400 includes the following steps: S410. The fish swarm fusion feature map is refined by geometric edge branch features, specifically by Sobel gradient calculation, initial edge map generation and residual convolution block processing, to obtain the fish swarm edge enhancement feature map. S420. The fish swarm fusion feature map is refined by coordinate attention branch features, specifically by one-dimensional pooling cross-directional fusion, attention generation, and feature space recalibration, to obtain the fish swarm space recalibrated feature map.

[0034] In one embodiment of the present invention, optionally, step S410 refines the geometric edge branch features of the fish swarm fusion feature map by sequentially performing Sobel gradient calculation, initial edge map generation, and residual convolution block processing to obtain the fish swarm edge enhancement feature map. The specific method includes the following steps: S411. Perform Sobel gradient calculation on the fish swarm fusion feature map, using horizontal convolution kernel K respectively. x Vertical convolution kernel K y Convolution is performed on the fused feature map of the fish swarm to obtain the horizontal gradient map G. x Vertical gradient map G y ; S412. An initial edge map is generated using the horizontal gradient map and the vertical gradient map, using the following formula: ; in, This is the initial edge map; S413. Input the initial edge map into the residual convolution block for processing to obtain the fish school edge enhancement feature map; the specific formula is: ; in, Enhance the feature map for geometric edges. The edge detail compensation and noise suppression feature maps learned by the residual convolutional block.

[0035] In step S410 of this embodiment, the boundaries of the fish school with abrupt gray-level changes are accurately located through Sobel gradient calculation in the geometric edge branch. Then, the edges are strengthened and weakened by residual convolution, which solves the problem of indistinguishability caused by blurred fish body boundaries and severe contour breaks in sonar echoes. In step S411, the horizontal convolution kernel K x Responsible for capturing vertical brightness transitions in an image, with K convolution kernels in the vertical direction. y The system captures lateral grayscale changes; bidirectional parallel computation can completely capture the boundary of fish schools in any direction, adapting to the irregular and random orientation of underwater fish. Step S412 extracts the fish outline, fish school boundary, and grayscale change area between the target and the background from the sonar image by generating an initial edge map; this formula integrates the gradient intensity in both horizontal and vertical directions, outputting a unified edge response amplitude. The higher the value, the more drastic the grayscale change at that location, corresponding to the true outline of the fish, while a value close to 0 indicates calm water clutter and background noise, achieving preliminary edge screening and filtering out meaningless uniform background. Step S413 further enhances the edge information through residual connections and convolution operations. The residual direct connection structure directly preserves the original edge information and superimposes the enhanced features learned by the neural network, avoiding the loss of edge details and gradient vanishing problems caused by deep convolution.

[0036] In one embodiment of the present invention, optionally, step S420 refines the fish swarm fusion feature map by performing coordinate attention branch features, specifically by sequentially performing one-dimensional pooling cross-directional fusion, attention generation, and feature space recalibration, to obtain the fish swarm spatial recalibrated feature map. The specific method includes the following steps: S421. Perform one-dimensional pooling cross-directional fusion on the fish swarm fusion feature map, aggregating spatial information along the horizontal and vertical directions respectively to obtain spatial features with direction-aware capabilities. ; S422. Generate horizontal attention weights M using the attention generation module. h Vertical and horizontal attention weights Mw ; S423. The fish swarm fusion feature map is obtained by multiplying the horizontal attention weight and the vertical and horizontal attention weights pixel by pixel. The specific formula is as follows: ; in, Spatial recalibration of feature maps for fish schools This is a feature map of fish swarm fusion.

[0037] In this embodiment, step S420, within the coordinate attention branch, automatically identifies localized areas where fish congregate through azimuth localization, reduces the feature weights of empty water areas, and filters out invalid interference from a spatial perspective. Step S421 performs one-dimensional pooling along the vertical or horizontal direction, applying global average pooling to each column or row to capture the density and distribution of fish within each vertical or horizontal region. Step S422 involves horizontal attention weight M. h Vertical and horizontal attention weights M w Used to highlight the area where fish are located and suppress background noise, the values ​​represent the importance of the area in the horizontal and vertical directions, respectively. The more concentrated the fish are, the higher the weight value, while the weight of the empty water area tends to be 0. In step S423, each pixel of the fish fusion feature map is multiplied by the attention weight of that row and column. Only when both rows and columns are determined to have an intersection area where fish are found will the feature be amplified and enhanced. Features in areas with only a weak response in a single direction and pure clutter background areas will be significantly attenuated, achieving accurate noise reduction.

[0038] In one embodiment of the present invention, optionally, step S500 involves fusing and extracting features from the enhanced fish school edge feature map and the fish school spatial recalibration feature map to obtain an enhanced fish school feature map. The specific method includes the following steps: S510. The fish swarm edge enhancement feature map and the fish swarm spatial recalibration feature map are concatenated along the channel dimension to obtain the concatenated fused feature map. The specific formula is as follows: ; Among them, T concat This is the fused feature map after splicing. T' is the geometric edge enhancement feature map, and T' is the fish swarm spatial recalibration feature map; S520. A 1×1 convolution kernel is used to convolve the stitched fused feature map to obtain a dual-branch refined enhancement incremental feature map for edges and attention. The specific formula is as follows: ; Among them, T fused The incremental feature map is enhanced by refining the two branches of edge and attention, which is responsible for compensating for the defects of blurred contours and background clutter; S530. The incremental feature map is refined and enhanced by connecting the edge and attention in a dual-branch manner using residuals, resulting in the final enhanced feature map. The specific formula is as follows: ; Among them, T out T0 is the final enhanced feature map; T0 is the fish swarm fusion feature map, which contains basic scale information of fish swarms of different sizes; γ is a learnable controllable coefficient, which automatically controls the contribution intensity of the refined fusion features. The original basic features and the enhanced incremental features are superimposed through the residual direct connection structure, which not only retains the complete information of the original multi-scale features, but also superimposes the optimization gain brought by edge enhancement and spatial noise reduction, avoiding the gradient vanishing of deep networks and the loss of effective features at the bottom layer. S540. The feature extraction module is used to extract shared features from the final enhanced feature map to obtain a shared fused feature map.

[0039] In this embodiment, step S500 fuses the fish swarm edge enhancement features output by the geometric edge branch with the fish swarm spatial recalibration features output by the coordinate attention branch. This allows the features to simultaneously possess the dual advantages of clear fish swarm boundaries and precise spatial region selection, thereby weakening clutter and repairing broken fish body contours at the feature level. Step S510 concatenates the two types of features along the channel dimension. The concatenation operation fully preserves the unique information extracted by each of the two branches, without losing edge details or spatial orientation features, achieving complementarity between contour information and spatial positioning information. After concatenation, the number of channels doubles, and directly inputting it into subsequent networks would significantly increase the computational load. Therefore, the convolution in step S520 is used for cross-channel information interaction and channel dimension compression, fusing the channel information of the two types of features without losing image spatial resolution, thus reducing computational complexity. Step S540 performs shared feature extraction to reduce redundant feature extraction and improve algorithm efficiency; for example, see [reference needed]. Figure 4 The feature extraction module consists of a series of interconnected convolutional layers (Conv), activation layers (ReLU), pooling layers (Pool), convolutional layers (Conv), activation layers (ReLU), pooling layers (Pool), and fully connected layers (FC), which are input to the final enhanced feature map T. out Output a shared fused feature map.

[0040] In one embodiment of the present invention, optionally, step S600, which involves performing parallel prediction of the shared fused feature map using detection and counting branches to obtain the target bounding box coordinates, target confidence, and the original number of fish in a single region, includes the following steps: S610. Identify the target region of the fish school in the shared fusion feature map by detecting the branch, and output the target bounding box coordinates and target confidence of the target region of the fish school. Among them, the target bounding box coordinates represent the location parameters of the target area of ​​the fish school, such as the center point coordinates, width, and height; the target confidence score is used to represent the probability that the area belongs to the target area of ​​the fish school. S620. Estimate the original number of fish in each target area of ​​the fish population by using the counting branch to obtain the original number of fish in a single area.

[0041] Based on the shared fusion feature map, this embodiment sets up two parallel branches: a detection branch and a counting branch. The detection branch obtains the spatial distribution and detection reliability of the fish population within the shared fusion feature map. The counting branch estimates the number of fish in a single region. Based on the local density, texture distribution, and target response intensity in the shared fusion feature map, the counting branch predicts the original number of fish in each region, obtaining an estimate of the number of fish in a single region. For example, see... Figure 5 and Figure 6 The detection branch consists of a convolutional layer (Conv), an activation layer (ReLU), and a 1×1 convolutional layer connected in sequence, while the counting branch consists of a convolutional layer (Conv), an activation layer (ReLU), an average pooling layer, and a fully connected layer (FC) connected in sequence.

[0042] In one embodiment of the present invention, optionally, step S700 corrects the original number of fish in a single region based on the target bounding box coordinates and the target confidence level, and the specific method for obtaining the corrected number of fish in a single region includes the following steps: S710. Calculate the intersection-union ratio between different target borders based on the target border coordinates to obtain the degree of overlap of the target regions; S720. Based on the target confidence level and the overlap degree of the target region, the original number of fish in a single region is corrected to obtain the corrected number of fish in a single region. The specific formula is as follows: ; Among them, Y i Y represents the corrected number of fish in a single area. d denoted as the original number of fish in a single area; k is the quantity correction coefficient, with a value range of [0, 1], which can be determined jointly based on the target confidence level, IoU value, target density, and regional overlap.

[0043] To reduce counting errors caused by overlapping fish targets, repeated detections, or overlapping region boundaries, this embodiment includes step S700, which corrects the original number of fish in a single region using a quantity correction module. For example, step S710 calculates the intersection-union ratio (IoU) between different target bounding boxes based on the target bounding box coordinates output by the detection branch using the IoU calculation unit. If the IoU value between two target bounding boxes exceeds 0.5, it indicates that they have significant overlap and may correspond to the same fish group region or a repeated detection region. If the IoU value is less than or equal to 0.5, it indicates that they correspond to different regions.

[0044] This embodiment yields the final fish population estimate, which can be used for scenarios such as aquaculture density monitoring, fishery resource assessment, underwater ecological surveys, and intelligent sonar image analysis.

[0045] Through the above-described embodiments, this invention can fully utilize multi-scale features, edge structure features, and spatial attention features in sonar images, and combine the joint output of the detection branch and the counting branch to make a more accurate estimation of fish population size. Compared with methods that rely solely on a single detection model or a single counting model, this invention can effectively reduce the impact of fish overlap, edge blurring, background noise, and repeated detection in sonar images on the population estimation results, thereby improving the accuracy and stability of fish population identification.

[0046] This invention fundamentally solves the problem of yield forecasting errors caused by traditional aquaculture's reliance on experience-based estimations. It enables refined management of aquaculture production, reduces large-scale disease and mortality losses, and significantly improves survival rates and economic benefits. Furthermore, quantifiable fish population data effectively reduces information asymmetry in aquaculture insurance, promoting more reasonable premium pricing and transparent claims processes. Insurance companies can scientifically assess aquaculture risk levels and develop fairer, more reasonable premium plans based on real, traceable fish population and growth data. In the event of losses, fish data can serve as objective evidence for claims, reducing disputes and accelerating claims review and payment processes. This lowers the barriers to insurance for fishermen and provides them with greater confidence in their loss protection, offering solid data support for the improvement and large-scale promotion of the fisheries insurance system.

[0047] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0048] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the scope of protection of the present invention. Therefore, the scope of protection of this patent should be determined by the appended claims.

Claims

1. A method for estimating the number of underwater fish schools based on sonar images, characterized in that, include: Acquire raw sonar images of underwater fish schools and perform data preprocessing on the raw sonar images to obtain preprocessed sonar images; The preprocessed sonar image is subjected to multi-scale feature extraction to obtain multiple fish target feature maps at different scales. The fish swarm target feature maps of multiple different scales are fused with dynamic and static weights to obtain a fused fish swarm feature map. The fish swarm fusion feature map is refined into a dual-branch feature map to obtain a fish swarm edge enhancement feature map and a fish swarm spatial recalibration feature map. The fish school edge enhancement feature map and the fish school spatial recalibration feature map are fused and extracted to obtain a shared fused feature map; The shared fusion feature map is subjected to parallel prediction of detection and counting branches to obtain the target bounding box coordinates, target confidence, and the original number of fish in a single region. Based on the target bounding box coordinates and the target confidence level, the original single-area fish population is corrected to obtain the corrected single-area fish population. The corrected fish populations in each area are then combined to obtain the final fish population count.

2. The method for estimating the number of underwater fish schools based on sonar images according to claim 1, characterized in that, The specific methods for acquiring raw sonar images of underwater fish schools and preprocessing the raw sonar images to obtain preprocessed sonar images include: The aquaculture water body is scanned 360° by sonar equipment to obtain raw sonar data; wherein, the raw sonar data is a binary format file containing fish school echo information, environmental noise information and acoustic shadow information, and each binary format file generates a raw sonar video of a predetermined duration; Image frames are extracted from the original sonar video at a predetermined frequency to obtain multiple frames of original sonar images of underwater fish schools; The pixel values ​​of the original sonar images of the underwater fish school in multiple frames are normalized to obtain the preprocessed sonar images.

3. The method for estimating the number of underwater fish schools based on sonar images according to claim 1, characterized in that, The specific method for extracting multi-scale features from the preprocessed sonar image to obtain multiple fish target feature maps at different scales is as follows: Parallel convolution was performed on the preprocessed sonar image using convolution kernels of 3×3, 5×5, 7×7, 11×11, and 15×15, respectively, to obtain five fish target feature maps at different scales.

4. The method for estimating the number of underwater fish schools based on sonar images according to claim 1, characterized in that, The specific method for fusing multiple fish target feature maps of different scales using dynamic and static weights to obtain a fused fish feature map includes: The fusion weights of the fish target feature maps at various scales are calculated using the following formula: ; Among them, w i w is the fusion weight of the fish swarm target feature map at the i-th scale. static For pre-trained static weights, w dynamic The weights are dynamically generated adaptively by the multilayer perceptron, and α is a learnable balance coefficient with a value range of [0, 1]. Based on the fusion weights of the fish target feature maps at different scales, a weighted sum is performed on multiple fish target feature maps at different scales to obtain the fish fusion feature map; the specific formula is as follows: ; Where T0 is the fish swarm fusion feature map, T i Let M be the feature map of the fish swarm at the i-th scale, where M is the number of scales.

5. The method for estimating the number of underwater fish schools based on sonar images according to claim 1, characterized in that, The specific method for refining the fish swarm fusion feature map into a bi-branch feature map to obtain the fish swarm edge enhancement feature map and the fish swarm spatial recalibration feature map includes: The fish swarm fusion feature map is refined by geometric edge branch features, specifically by Sobel gradient calculation, initial edge map generation and residual convolution block processing, to obtain the fish swarm edge enhancement feature map. The fish swarm fusion feature map is refined by coordinate attention branch features, specifically by one-dimensional pooling cross-directional fusion, attention generation, and feature space recalibration, to obtain the fish swarm spatial recalibrated feature map.

6. The method for estimating the number of underwater fish schools based on sonar images according to claim 5, characterized in that, The fish swarm fusion feature map is refined by geometric edge branch features. Specifically, this is achieved through Sobel gradient calculation, initial edge map generation, and residual convolutional block processing. The specific method for obtaining the fish swarm edge enhancement feature map includes: Sobel gradient calculation is performed on the fused feature map of the fish swarm, using horizontal convolution kernel K respectively. x Vertical convolution kernel K y Convolution is performed on the fused feature map of the fish swarm to obtain the horizontal gradient map G. x Vertical gradient map G y ; An initial edge map is generated using the horizontal gradient map and the vertical gradient map, using the following formula: ; in, This is the initial edge map; The initial edge map is input into a residual convolutional block for processing to obtain the fish school edge enhancement feature map; the specific formula is as follows: ; in, Enhance the feature map for geometric edges. The edge detail compensation and noise suppression feature maps learned by the residual convolutional block.

7. The method for estimating the number of underwater fish schools based on sonar images according to claim 5, characterized in that, The fish swarm fusion feature map is refined by coordinate attention branch features, specifically through one-dimensional pooling cross-directional fusion, attention generation, and feature space recalibration, to obtain the fish swarm spatially recalibrated feature map. The specific method includes: One-dimensional pooling cross-directional fusion is performed on the fish swarm fusion feature map to aggregate spatial information along the horizontal and vertical directions, respectively, to obtain spatial features with direction-aware capabilities. ; The horizontal attention weight M is generated through the attention generation module. h Vertical and horizontal attention weights M w ; The fish swarm spatial recalibration feature map is obtained by multiplying the horizontal attention weights and the vertical and horizontal attention weights pixel by pixel with the fish swarm fusion feature map, as shown in the following formula: ; in, Spatial recalibration of feature maps for fish schools This is a feature map of fish swarm fusion.

8. The method for estimating the number of underwater fish schools based on sonar images according to claim 1, characterized in that, The specific method for fusing and extracting features from the enhanced fish school edge feature map and the spatial recalibration feature map of the fish school to obtain the enhanced fish school feature map includes: The fish swarm edge enhancement feature map and the fish swarm spatial recalibration feature map are concatenated along the channel dimension to obtain the concatenated fused feature map. The specific formula is as follows: ; in, This is the fused feature map after splicing. T' is the geometric edge enhancement feature map, and T' is the fish swarm spatial recalibration feature map; A 1×1 convolution kernel is used to convolve the concatenated fused feature map to obtain a dual-branch refined enhancement incremental feature map for edges and attention. The specific formula is as follows: ; in, Enhance the incremental feature map by refining the dual branches of edge and attention; The incremental feature map is refined and enhanced by connecting the residuals to the edge and the attention in a two-branch process, resulting in the final enhanced feature map. The specific formula is as follows: ; in, To ultimately enhance the feature map, This is a feature map of fish fusion. It is a learnable controllable coefficient; The feature extraction module is used to extract shared features from the final enhanced feature map to obtain a shared fused feature map.

9. The method for estimating the number of underwater fish schools based on sonar images according to claim 1, characterized in that, The specific method for performing parallel prediction of the shared fused feature map using detection and counting branches to obtain the target bounding box coordinates, target confidence, and the original number of fish in a single region includes: The target region of the fish school in the shared fused feature map is identified by detecting the branch, and the target bounding box coordinates and target confidence of the target region of the fish school are output. The original number of fish in each target area is estimated by counting branches to obtain the original number of fish in a single area.

10. The method for estimating the number of underwater fish schools based on sonar images according to claim 1, characterized in that, The specific method for correcting the original single-region fish population based on the target bounding box coordinates and the target confidence level to obtain the corrected single-region fish population includes: Based on the coordinates of the target bounding box, the intersection-union ratio between different target bounding boxes is calculated to obtain the degree of overlap of the target regions; Based on the target confidence level and the overlap degree of the target region, the original single-region fish population is corrected to obtain the corrected single-region fish population, using the following formula: ; Among them, Y i Y represents the corrected fish population size in a single area. d denoted as the original fish population size in a single area, and k is the population correction coefficient.