Density map-based fish school counting system and method in underwater environment
By introducing counting feature enhancement and interference feature separation technology into the fish school counting system, the problem of insufficient accuracy and stability of fish school counting in underwater environments is solved, and high accuracy and stability of fish school counting in complex environments is achieved.
Patent Information
- Application Number
- CN202510668232.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-23
- Publication Date
- 2025-06-20
- Estimated Expiration
- 2045-05-23
AI Technical Summary
The prior art has problems of insufficient accuracy and stability in fish population counting in underwater environments, especially in complex backgrounds and changing environments, and it is difficult to effectively reduce the influence of factors such as light changes and water flow fluctuations.
A fish school counting system based on density map is adopted, counting feature enhancement and interference feature separation technology are introduced. Through data preprocessing, feature extraction and model training, the impact of complex backgrounds on fish school counting is reduced and the accuracy and stability of counting is improved.
Accurate and stable counting of fish schools in complex underwater environments is achieved, which improves the environmental adaptability and stability of counting, and reduces the negative impact of factors on counting results.
Smart Images

Figure CN120183004A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and particularly relates to a fish school counting system and method in an underwater environment based on a density map. Background Art
[0002] Traditional fish school counting methods rely heavily on manual labor. Mainly through sampling fishing and manual counting, and relying on past experience to estimate the quantity. However, affected by subjectivity, this method is prone to a large number of miscounts and omissions, resulting in a large quantity deviation, seriously affecting the accuracy and efficiency of aquaculture management; in addition, such contact counting means may also cause physical damage to the fish body, inducing stress reactions, which is not conducive to the health of the fish school. Non-contact fish school counting methods have become an urgent need in the industry; In recent years, machine vision and image processing technologies have developed rapidly. The method based on artificial neural network (ANN) can achieve non-contact fish counting, but this method relies on artificial feature selection, and the existence of subjectivity will affect the accuracy and stability of counting; currently, object detection mainly detects objects in low-density scenarios. For example, the Yolo object detection model can identify the category and position of objects in a picture and is currently widely used in counting tasks. However, this method cannot achieve stable counting performance for fish schools in the underwater environment because the aggregation of fish schools cannot be controlled in the aquaculture environment. In some cases, the fish school will be in an occluded state, which poses a serious obstacle to the implementation of object detection methods; Currently, the counting method based on density maps can count occluded targets of different sizes, but still faces many challenges in terms of counting accuracy and stability, restricting its wide application. Moreover, in the actual underwater aquaculture environment, different from the ground scene, the underwater scene is complex and changeable. Due to the influence of factors such as light intensity and water turbidity, the counting scene is diverse. The current counting method based on density maps often focuses on the fish school itself and lacks consideration of environmental factors, resulting in insufficient counting stability and accuracy. Summary of the Invention
[0003] In order to overcome the defects and deficiencies existing in the prior art, the present invention provides a fish school counting system and method in an underwater environment based on a density map. The present invention introduces a counting feature enhancement and interference feature separation technology into the fish school counting model to reduce the influence of complex backgrounds on fish school counting, and realizes accurate and stable counting of fish schools in complex underwater environments.
[0004] To achieve the above object, the present invention adopts the following technical solutions: The present invention provides a fish population counting system in an underwater environment based on a density map, including: a processing module for fish population datasets in the underwater environment, a classification module, a picture cropping module, a scaling operation module, an interference feature extraction module, a counting feature extraction module, a fish population counting model construction module, a fish population counting model training module, and a fish population counting result output module; The processing module for fish population datasets in the underwater environment is used to obtain an underwater fish population dataset and perform dataset division and data preprocessing on the underwater fish population dataset; The classification module is used to classify the underwater fish population dataset after data preprocessing; The picture cropping module is used to crop multiple background pictures and single fish pictures from each type of underwater fish population picture respectively; The scaling operation module is used to perform a scaling operation on the background pictures; The interference feature extraction module is used to extract interference features from the background pictures after the scaling operation; The counting feature extraction module is used to extract feature convolution kernels from single fish pictures; The fish population counting model construction module is used to construct a fish population counting model; The fish population counting model training module is used to input the training set of the underwater fish population dataset into the fish population counting model for training, optimize the model parameters through a loss function, reduce the similarity between the original picture features and interference features of the training set, separate the interference features, and perform a convolution operation based on the feature convolution kernels and the original picture features to enhance the fish population counting features; The fish population counting result output module is used to output a density map based on the trained fish population counting model, and sum the pixel values of the density map to obtain the number of fish in the population.
[0005] As a preferred technical solution, the data preprocessing specifically includes: Performing defogging processing on the underwater fish population pictures in the underwater fish population dataset by using dark channel prior defogging.
[0006] As a preferred technical solution, the classification module is used to classify the underwater fish population dataset after data preprocessing, specifically including: Classifying the underwater fish population pictures in the underwater fish population dataset according to the light intensity and water clarity.
[0007] As a preferred technical solution, the interference feature extraction module is used to extract interference features from the background pictures after the scaling operation, specifically including: Inputting the background pictures after the scaling operation into a front-end network, outputting multiple feature maps, obtaining an overall feature map through a connection operation on the multiple feature maps, and calculating the average value of the overall feature map through an average operation to obtain the interference features.
[0008] As a preferred technical solution, the counting feature extraction module is used to extract a feature convolution kernel from a single fish picture, specifically including: Input the single fish picture into the front-end network to obtain single fish feature maps of different sizes. After scaling processing, the sizes of each feature map are unified, and the feature maps with unified sizes are spliced through a connection operation to obtain a feature convolution kernel.
[0009] As a preferred technical solution, the fish school counting model includes a front-end network, a counting feature enhancement module, a feature supplement module, and a back-end network; Input the training set into the front-end network for feature extraction to obtain an original feature map; Input the original feature map into the counting feature enhancement module and the feature supplement module respectively. In the counting feature enhancement module, a convolution operation is performed based on the feature convolution kernel and the original picture feature to obtain an enhanced feature map. In the feature supplement module, the dimensions of the feature map are adjusted through different convolution kernels, and the feature maps of different dimensions are fused through a connection operation; Perform a connection operation on the feature maps output by the counting feature enhancement module and the feature supplement module, and input them into the back-end network; The back-end network extracts deep feature information and generates a density map.
[0010] As a preferred technical solution, the counting feature enhancement module includes three network branches, and the original feature map is processed through the three network branches respectively; In the first network branch, a downsampling operation is used to shrink the original feature map, a convolution operation is performed based on the feature convolution kernel and the shrunk feature map, and an upsampling operation is used to restore the convolved feature map to the size of the original feature map; In the second network branch, a convolution operation is performed on the feature convolution kernel and the original feature map to obtain a new feature map; In the third network branch, the original feature map is enlarged based on an upsampling operation, a convolution operation is performed on the feature convolution sum and the enlarged feature map, and a downsampling operation is used to restore the convolved feature map to the size of the original feature map; Fuse the feature maps output by the three network branches through a connection operation to obtain the feature map output by the counting feature enhancement module.
[0011] As a preferred technical solution, the feature supplement module includes two network branches, and the original feature map is processed through the two network branches respectively; In the first network branch, the original feature map is successively adjusted in dimension through multiple convolution kernels of different sizes; In the second network branch, the dimension of the original feature map is adjusted through a convolution kernel; Fuse the feature maps output by two network branches based on a connection operation to obtain the feature map output by the feature supplementation module.
[0012] As a preferred technical solution, optimize the model parameters through a loss function. The total loss function is expressed as: ; ; ; where represents the total loss function, represents the interference loss, represents the counting loss, H and W respectively represent the height and width of the interference feature and the original feature, and respectively represent the channel vectors at the corresponding positions of the interference feature and the original feature in the entire feature map, and represent the norms of the corresponding channel vectors, represents the number of pixels in the density map, and respectively represent the element values at the corresponding positions in the predicted density map and the true density map.
[0013] The present invention also provides a method for counting fish schools in an underwater environment based on a density map. Provided with the above-mentioned system for counting fish schools in an underwater environment based on a density map, it includes the following steps: Obtain an underwater fish school dataset, and perform dataset division and data preprocessing on the underwater fish school dataset; Classify the underwater fish school dataset after data preprocessing; For each type of underwater fish school picture, respectively crop multiple background pictures and single-fish pictures, and perform a scaling operation on the background pictures; Extract interference features from the scaled background pictures, and extract feature convolution kernels from the single-fish pictures; Construct a fish school counting model, input the training set of the underwater fish school dataset into the fish school counting model for training, optimize the model parameters through a loss function, reduce the similarity between the original features and interference features of the training set, separate the interference features, and perform a convolution operation based on the feature convolution kernels and the original features to enhance the fish school counting features; Based on the density map output by the trained fish school counting model, sum the pixel values of the density map to obtain the number of fish schools.
[0014] Compared with the prior art, the present invention has the following advantages and beneficial effects: Although existing density map-based counting techniques can effectively enhance counting targets, they often overlook the interference of environmental factors such as light changes, water flow fluctuations, and water quality. This is particularly significant in real aquaculture environments. The present invention introduces counting feature enhancement and interference feature separation techniques into the fish population counting model to reduce the impact of complex backgrounds on fish population counting, achieving a dual improvement in the accuracy and environmental adaptability of fish population counting, and ensuring the stability and reliability of fish population counting in a changing underwater environment. Specifically, the counting feature enhancement module effectively extracts and enhances the feature information of the fish population, improves the quality of the image, making the counting more accurate. The interference loss can reduce the similarity between the original features and the interference features, thereby separating the interference factors, reducing the negative impact of these factors on the counting results, further enhancing the stability of the counting, being applicable to various complex underwater aquaculture environments, meeting the counting requirements in different aquaculture scenarios, and not relying on the selection of artificial features, avoiding the subjective errors caused thereby. Brief Description of the Drawings
[0015] Figure 1 It is a schematic diagram of the overall network architecture of the fish population counting model of the present invention; Figure 2 It is a schematic diagram of the network architecture of the interference feature extraction module and the counting feature extraction module of the present invention; Figure 3 It is a schematic diagram of the flow of the fish population counting method in an underwater environment based on a density map of the present invention. Detailed Embodiments
[0016] In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0017] Embodiment 1 As Figure 1 shown, this embodiment provides a fish population counting system in an underwater environment based on a density map, including: a fish population dataset processing module in an underwater environment, a classification module, a picture cropping module, a scaling operation module, an interference feature extraction module, a counting feature extraction module, a fish population counting model construction module, a fish population counting model training module, and a fish population counting result output module; In this embodiment, the fish population dataset processing module in the underwater environment is used to obtain an underwater fish population dataset and perform dataset partitioning and data preprocessing on the underwater fish population dataset. Specifically, in this embodiment, the underwater fish population dataset is partitioned, with 70% of it used as the training set, 10% as the validation set, and 20% as the test set; In this embodiment, data preprocessing is performed on the underwater fish population dataset. Specifically, the Dark Channel Prior (DCP) dehazing algorithm is used to dehaze the underwater fish population images in the underwater fish population dataset, improving the quality of the images in the underwater fish population dataset. In this embodiment, the classification module is used to classify the underwater fish population dataset after data preprocessing, specifically including: Classify the underwater fish population images in the underwater fish population dataset according to the light intensity and water clarity; In this embodiment, the picture cropping module is used to crop multiple background pictures and single fish pictures from each type of underwater fish population picture respectively; In this embodiment, the scaling operation module is used to perform a scaling (Resize) operation on the background pictures to make them the same size as the original pictures; As Figure 2 shown, the interference feature extraction module is used to extract interference features from the background pictures after the scaling operation, specifically including: Input the background pictures after the scaling operation into the front-end network, output multiple feature maps, obtain the overall feature map through a concatenation operation, and calculate the average value of the overall feature map through an averaging operation to obtain the interference feature; In this embodiment, the counting feature extraction module is used to extract feature convolution kernels from single fish pictures, specifically including: Input the single fish pictures into the front-end network to obtain single fish feature maps of different sizes. After scaling processing, the sizes of each feature map are unified, and the feature maps with unified sizes are concatenated through a concatenation operation to obtain the feature convolution kernel; In this embodiment, the fish population counting model construction module is used to construct a fish population counting model. As Figure 1 shown, the fish population counting model includes a front-end network, a counting feature enhancement module, a feature supplement module, and a back-end network; Input the training set into the front-end network for feature extraction to obtain the original feature map; Input the original feature map into the counting feature enhancement module and the feature supplement module respectively. In the counting feature enhancement module, a convolution operation is performed based on the feature convolution kernel and the original picture features to obtain the enhanced feature map. In the feature supplement module, the dimensions of the feature map are adjusted through different convolution kernels, and the feature maps of different dimensions are fused through a concatenation operation; Perform a concatenation operation on the feature maps output by the counting feature enhancement module and the feature supplement module, and input them into the back-end network; The back-end network extracts deep feature information and generates a density map.
[0018] In this embodiment, the counting feature enhancement module includes three network branches, and the original feature map is processed through the three network branches respectively; In the first network branch, the original feature map is reduced by using the downsampling operation. A convolution operation is performed based on the feature convolution kernel and the reduced feature map. The convolved feature map is restored to the size of the original feature map based on the upsampling operation, which is specifically expressed as: ; ; ; Among them, represents the original feature map, represents the downsampling operation, represents the reduced feature map, represents the feature convolution kernel, represents the convolution operation, represents the convolved feature map, represents the feature map processed by the first network branch; In the second network branch, a convolution operation is performed on the original feature map with the feature convolution kernel to obtain a new feature map, which is expressed as: ; Among them, represents the feature map processed by the second network branch; In the third network branch, the original feature map is enlarged based on the upsampling operation. A convolution operation is performed on the enlarged feature map with the feature convolution sum. The convolved feature map is restored to the size of the original feature map based on the downsampling operation, which is specifically expressed as: ; ; ; Among them, represents the enlarged feature map, represents the upsampling operation, represents the convolved feature map, represents the feature map processed by the third network branch; Based on the concatenation operation, the feature maps output by the three network branches are fused to obtain the feature map output by the counting feature enhancement module. In this process, the purpose of using the three branches to scale the feature map is to improve the recognition ability for multi-scale targets. The convolution operation of the feature convolution kernel on the feature map can improve the correlation between the feature map and fish information, increase the attention of the feature map to the fish school, and strengthen the fish school counting feature.
[0019] In this embodiment, the feature supplement module includes two network branches, and the original feature map is processed through the two network branches respectively; In the first network branch, the original feature map successively passes through multiple convolutional kernels of different sizes to adjust the dimension of the feature map; In the second network branch, the original feature map passes through a convolutional kernel to adjust the dimension of the feature map; Based on the connection operation, the feature maps output by the two network branches are fused to obtain the feature map output by the feature supplement module.
[0020] In this embodiment, the fish school counting model training module is used to input the training set of the underwater fish school dataset into the fish school counting model for training, optimize the model parameters through the loss function, reduce the similarity between the original image features and interference features of the training set, separate the interference features, and perform a convolution operation based on the feature convolutional kernel and the original image features to enhance the fish school counting features; In this embodiment, the total loss function is expressed as: ; ; ; Among them, represents the total loss function, represents the interference loss, represents the counting loss, H and W respectively represent the height and width of the interference feature and the original feature, and respectively represent the channel vectors of the interference feature and the original feature at the corresponding positions in the entire feature map, and represent the modulus lengths of the corresponding channel vectors, represents the number of pixels in the density map, and respectively represent the element values at the corresponding positions in the predicted density map and the true density map.
[0021] In this embodiment, the fish school counting result output module is used to output a density map based on the trained fish school counting model, and sum the pixel values of the density map to obtain the number of fish schools.
[0022] Embodiment 2 As Figure 3 shown, this embodiment provides a method for counting fish schools in an underwater environment based on a density map, including the following steps: S1: Obtain an underwater fish school dataset, and perform dataset division and data preprocessing on the underwater fish school dataset; S2: Classify the underwater fish school pictures in the underwater fish school dataset after data preprocessing according to the light intensity and water clarity, which can be specifically divided into four categories: bright + clear, bright + turbid, dark + clear, dark + turbid; S3: Crop M background images and N single - fish images from each type of underwater fish - group image respectively; In this embodiment, both M and N are preferably 10. The background image refers to an image that only contains the background, and the single - fish image only contains one fish. 40 background images and 40 single - fish images can be obtained, and the background images are resized to be the same size as the original image; S3: Input the resized background images into the interference feature extraction module to extract the interference features, and input the single - fish images into the counting feature extraction module to extract the feature convolution kernel; In this embodiment, the network structures of the interference feature extraction module and the counting feature extraction module are the same, both using the first 10 convolutional layers of the VGG16 network, that is, the front - end network; In this embodiment, the process of extracting the interference features specifically includes: Input the four types of resized background images into the first 10 convolutional layers of the VGG16 network in sequence, and use the pre - trained weights. For each image, a feature map with a dimension of (1, 512, 1 / 8 H, 1 / 8 W) can be obtained, where H and W represent the height and width of the original image. Concatenate the 40 feature maps through the Concatenation operation to obtain an overall feature map with a dimension of (40, 512, 1 / 8H, 1 / 8W), and calculate the average value of this overall feature map through the Mean operation to obtain the interference feature with a dimension of (1, 512, 1 / 8 H, 1 / 8 W); In this embodiment, the process of extracting the counting features includes: Input the single - fish images into the first 10 convolutional layers of the VGG16 network to obtain single - fish feature maps of different sizes, which is caused by the inconsistent sizes of the intercepted single - fish images. After resizing (Resize), the height and width of each feature map are both unified to 3, and the dimension becomes (1, 512, 3, 3). Then, concatenate the 40 single - fish feature maps through the Concatenation operation to obtain a feature map with a dimension of (40, 512, 3, 3) as the feature convolution kernel; S4: Construct a fish - group counting model, input the training set of the underwater fish - group dataset into the fish - group counting model for training, and optimize the model parameters through the loss function; In this embodiment, the fish - group counting model includes a front - end network, a counting feature enhancement module, a feature supplement module, and a back - end network. The counting feature enhancement module is used to strengthen the fish - group information, and the feature supplement module is used to avoid the loss of detailed information and the occurrence of over - fitting, so as to achieve accurate and stable counting; Before model training, perform pre - operations to obtain interference features and feature convolution kernels. Among them, the interference features are used to calculate the interference loss, so as to realize the separation of the original image features and the interference features. The feature convolution kernels are used in the counting feature enhancement module of the fish school counting model to enhance the counting features; Specifically, the training set is input into the front - end network for feature extraction to obtain the original feature map. The front - end network uses the first 10 convolutional layers of the VGG16 network and initially uses pre - trained weights. The original feature map is respectively input into the counting feature enhancement module and the feature supplement module for processing. In the counting feature enhancement module, the original feature map is processed through three network branches respectively; Specifically, in the first network branch, use the down - pooling operation to halve the size of the original feature map, then use the feature convolution kernel to perform convolution operation on the reduced feature map, and finally use the up - pooling operation to restore the convolved feature map to the size of the original feature map; The second network branch directly performs convolution operation on the feature convolution kernel and the original feature map to obtain a new feature map; The third network branch uses the up - sampling operation to double the size of the original feature map, then performs convolution operation on the feature convolution sum and the enlarged feature map, and finally uses the down - pooling operation to restore the convolved feature map to the size of the original feature map; After being processed by the three network branches, three feature maps with a channel ratio of 1:1:1 and equal size are obtained, and they are fused using the concatenation operation.
[0023] However, although such an operation can improve the recognition ability of the model, a lot of detailed information of the features will be lost in this process. The feature supplement module exists to solve this problem. In the feature supplement module, the original feature map is processed through two network branches respectively. In the first network branch, the original feature map successively passes through 1×1, 3×3, and 5×5 convolutional kernels to adjust the dimension of the feature map. In the second network branch, the original feature map passes through a 1×1 convolutional kernel to adjust the dimension of the feature map. The channel ratio of the two feature maps is 1:4. Finally, the feature maps are fused through the concatenation operation. After fusion, the two feature maps become one, and the dimension size of the new feature map becomes the sum of the dimensions of the two feature maps; After being processed by the counting feature enhancement module and the feature supplement module, two fused feature maps are obtained, and the ratio of their number of channels is 3:5. After the concatenation operation, a new feature map with the same number of channels and size as the original feature map is obtained, and then it is input into the backend network. The role of the backend network is to extract the deep information of the features and generate a density map without changing the size of the feature map. The backend network includes six 3×3 convolutions and one 1×1 convolution. In order to keep the size of the feature map unchanged, the 3×3 convolution is set as a dilated convolution with a dilation rate of 2. Deep information is extracted through six 3×3 convolutions, and the 1×1 convolution is used to generate the density map. The sum of the pixel values of the density map is the estimated number of fish schools; In the model training stage, the parameters of the model are updated through the loss function. The loss function in this embodiment is divided into two parts. One part is the interference loss. The purpose of this loss is to reduce the similarity between the original features and the interference features of the original feature map, and it is used to separate the generated interference features. The other part is the counting loss. The purpose of this loss is to regress the density map predicted by the model with the real density map in the dataset, so that the predicted density map fits the real density map better. The total loss function is expressed as: ; ; ; Among them, represents the total loss function, represents the interference loss, represents the counting loss, H and W represent the height and width of the interference feature and the original feature respectively, and represent the channel vectors at the corresponding positions of the interference feature and the original feature in the entire feature map respectively, and represent the norms of the corresponding channel vectors, represents the number of pixels of the density map, and represent the element values at the corresponding positions in the predicted density map and the real density map respectively.
[0024] What is inside the parentheses in the interference loss formula represents the calculation of the cosine similarity. Since the value of the similarity is between [-1, 1], adding 1 is used to change its range to [0, 2], and cooperating with the previous coefficient, it becomes a value between [0, 1]. When it gets closer to 0, it indicates that the similarity is smaller. Through the interference loss, the similar parts between the interference feature and the original feature can be separated, so as to filter out the interference features; After a round of training is completed, the model parameters are updated by calculating the loss. Additionally, the interference features only play a role when calculating the loss during the training phase and do not need to participate during the model inference process.
[0025] S5: Used for model inference. During the inference phase, the model does not involve the calculation of the loss function. After outputting the density map, the pixel values of the density map are summed to obtain a numerical value, which is used as the number of fish schools.
[0026] The present invention more effectively extracts and strengthens the feature information of fish schools through the counting feature enhancement technology, making the counting more accurate. At the same time, the interference features are obtained by extracting background features, and the background contains interference factors such as water flow fluctuations and light changes. Through the interference feature separation technology, interference factors such as water flow fluctuations and light changes can be identified and separated. The interference loss can reduce the similarity between the original features and the interference features, thereby separating the interference factors, reducing the negative impact of these factors on the counting result, further improving the stability of counting, being applicable to various complex underwater aquaculture environments, and meeting the counting requirements under different aquaculture scenarios.
[0027] The above embodiments are preferred embodiments of the present invention, but the embodiments of the present invention are not limited by the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications made without departing from the spirit and principle of the present invention shall be equivalent replacement methods and are all included in the protection scope of the present invention.
Claims
1. A fish school counting system in an underwater environment based on a density map, characterized in that, Including: A fish school dataset processing module, a classification module, an image cropping module, a scaling operation module, an interference feature extraction module, a counting feature extraction module, a fish school counting model construction module, a fish school counting model training module, and a fish school counting result output module in an underwater environment; The fish school dataset processing module in the underwater environment is used to obtain an underwater fish school dataset and perform dataset division and data preprocessing on the underwater fish school dataset; The classification module is used to classify the underwater fish school dataset after data preprocessing; The image cropping module is used to crop multiple background images and single fish images from each type of underwater fish school image respectively; The scaling operation module is used to perform a scaling operation on the background image; The interference feature extraction module is used to extract interference features from the background image after the scaling operation; The counting feature extraction module is used to extract a feature convolution kernel from the single fish image; The fish school counting model construction module is used to construct a fish school counting model; The fish school counting model training module is used to input the training set of the underwater fish school dataset into the fish school counting model for training, optimize the model parameters through a loss function, reduce the similarity between the original image features and interference features of the training set, separate the interference features, and perform a convolution operation based on the feature convolution kernel and the original image features to enhance the fish school counting features; The fish school counting result output module is used to output a density map based on the trained fish school counting model, and sum the pixel values of the density map to obtain the number of fish schools.
2. The fish school counting system in an underwater environment based on a density map according to claim 1, characterized in that, The data preprocessing specifically includes: Using dark channel prior dehazing to perform dehazing processing on the underwater fish school images in the underwater fish school dataset.
3. The fish school counting system in an underwater environment based on a density map according to claim 1, characterized in that, The classification module is used to classify the underwater fish school dataset after data preprocessing, specifically including: Classifying the underwater fish school images in the underwater fish school dataset according to the light intensity and water clarity.
4. The fish school counting system in an underwater environment based on a density map according to claim 1, characterized in that, The interference feature extraction module is used to extract interference features from the background image after the scaling operation, specifically including: Inputting the background image after the scaling operation into the front-end network, outputting multiple feature maps, obtaining an overall feature map through a connection operation on the multiple feature maps, and calculating the average value of the overall feature map through an average operation to obtain the interference feature.
5. The fish school counting system in an underwater environment based on a density map according to claim 1, characterized in that, The counting feature extraction module is used to extract a feature convolution kernel from the single fish image, specifically including: Inputting the single fish image into the front-end network to obtain single fish feature maps of different sizes, unifying the size of each feature map through scaling processing, and splicing the feature maps with unified sizes through a connection operation to obtain the feature convolution kernel.
6. The fish school counting system in an underwater environment based on a density map according to claim 1, characterized in that, The fish school counting model includes a front-end network, a counting feature enhancement module, a feature supplement module, and a back-end network; Inputting the training set into the front-end network for feature extraction to obtain an original feature map; Respectively inputting the original feature map into the counting feature enhancement module and the feature supplement module, performing a convolution operation based on the feature convolution kernel and the original image features in the counting feature enhancement module to obtain an enhanced feature map, adjusting the dimension of the feature map through different convolution kernels in the feature supplement module, and fusing feature maps of different dimensions through a connection operation; Performing a connection operation on the feature maps output by the counting feature enhancement module and the feature supplement module, and inputting them into the back-end network; The backend network extracts deep feature information and generates a density map.
7. The fish school counting system in an underwater environment based on a density map according to claim 6, characterized in that, The counting feature enhancement module includes three network branches, and the original feature map is processed through the three network branches respectively; In the first network branch, a downsampling operation is used to shrink the original feature map, a convolution operation is performed based on the feature convolution kernel and the shrunk feature map, and an upsampling operation is used to restore the convolved feature map to the size of the original feature map; In the second network branch, a convolution operation is performed on the feature convolution kernel and the original feature map to obtain a new feature map; In the third network branch, the original feature map is enlarged based on an upsampling operation, a convolution operation is performed on the feature convolution sum and the enlarged feature map, and a downsampling operation is used to restore the convolved feature map to the size of the original feature map; Based on a concatenation operation, the feature maps output by the three network branches are fused to obtain the feature map output by the counting feature enhancement module.
8. The fish school counting system in an underwater environment based on a density map according to claim 6, characterized in that, The feature supplement module includes two network branches, and the original feature map is processed through the two network branches respectively; In the first network branch, the original feature map sequentially passes through multiple convolution kernels of different sizes to adjust the dimension of the feature map; In the second network branch, the original feature map passes through a convolution kernel to adjust the dimension of the feature map; Based on a concatenation operation, the feature maps output by the two network branches are fused to obtain the feature map output by the feature supplement module.
9. The fish school counting system in an underwater environment based on a density map according to claim 1, characterized in that, The model parameters are optimized through a loss function, and the total loss function is expressed as: ; ; ; Among them, represents the total loss function, represents the interference loss, represents the counting loss, H and W represent the height and width of the interference feature and the original feature respectively, and represent the channel vectors at the corresponding positions of the interference feature and the original feature in the entire feature map respectively, and represent the magnitudes of the corresponding channel vectors, represents the number of pixels in the density map, and represent the element values at the corresponding positions in the predicted density map and the ground-truth density map respectively.
10. A fish school counting method in an underwater environment based on a density map, characterized in that, The fish school counting system in an underwater environment based on a density map according to any one of claims 1-9, includes the following steps: Obtain an underwater fish school dataset, and perform dataset division and data preprocessing on the underwater fish school dataset; Classify the underwater fish school dataset after data preprocessing; For each type of underwater fish school picture, crop multiple background pictures and single fish pictures respectively, and perform a scaling operation on the background pictures; Extract interference features from the scaled background pictures, and extract feature convolution kernels from the single fish pictures; Construct a fish school counting model, input the training set of the underwater fish school dataset into the fish school counting model for training, optimize the model parameters through a loss function, reduce the similarity between the original image features and the interference features of the training set, separate the interference features, perform a convolution operation based on the feature convolution kernel and the original image features, and enhance the fish school counting features; Output a density map based on the trained fish school counting model, and sum the pixel values of the density map to obtain the number of fish schools.
Citation Information
Patent Citations
Shrimp group automatic counting method and device, electronic equipment and storage medium
CN113284164A
Fish multi-target tracking method based on balanced joint network
CN114202563A
Multi-scale dual-channel-based fish school counting method
CN116883360A
Underwater fish school small target robust counting method based on density map
CN117953361A
Underwater dense fish school detection method and device based on structure re-parameterization
CN118247648A