A fish counting system and method in underwater environment based on density map

Through the fish counting system based on density map, the counting feature enhancement and interference feature separation technology are introduced to solve the accuracy and stability problems of underwater fish counting. It is suitable for complex underwater aquaculture environments and realizes efficient and accurate fish counting.

CN120183004BActive Publication Date: 2025-09-26SOUTH CHINA AGRICULTURAL UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510668232.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-23
Publication Date
2025-09-26
Estimated Expiration
2045-05-23

AI Technical Summary

Technical Problem

Traditional fish counting methods rely on manual operation, have large errors and are harmful to the fish. Existing non-contact methods are unstable in underwater environments and ignore the influence of environmental factors, resulting in insufficient counting accuracy and stability.

Method used

A fish counting system based on density map is adopted, and counting feature enhancement and interference feature separation technologies are introduced. Through underwater fish data set processing, classification, image cropping, interference feature extraction and counting feature extraction, a fish counting model is constructed, and the model parameters are optimized to separate interference features and enhance counting features.

Benefits of technology

The accuracy and stability of fish counting in complex underwater environments have been improved, adapting to changing breeding scenarios, reducing the negative impact of environmental factors on counting, and avoiding subjective errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120183004B_ABST
    Figure CN120183004B_ABST
Patent Text Reader

Abstract

The present invention discloses a system and method for counting fish schools in underwater environments based on density maps. The system comprises: an underwater fish school data set 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. For each type of underwater fish school image, multiple background images and single fish images are cropped, the background images are scaled and interference features are extracted, and feature convolution kernels are extracted from the single fish images. A fish school counting model is constructed and trained, model parameters are optimized using a loss function to separate interference features, and a convolution operation is performed based on the feature convolution kernel and original image features to enhance fish school counting features. A density map is output based on the trained fish school counting model, and the pixel values ​​of the density map are summed to obtain the number of fish schools. The present invention achieves accurate and stable counting of fish schools in complex underwater environments.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a system and method for counting fish schools in an underwater environment based on a density map. Background Art

[0002] Traditional fish counting methods rely heavily on manual labor, primarily through random sampling and manual counting, relying on past experience to estimate populations. However, subjectivity can easily lead to significant miscounts and omissions, resulting in significant population deviations and severely impacting the accuracy and efficiency of aquaculture management. Furthermore, these contact-based methods can cause physical damage to fish, induce stress responses, and be detrimental to their health. Therefore, non-contact fish counting methods are urgently needed within the industry.

[0003] In recent years, machine vision and image processing technologies have developed rapidly. Artificial neural network (ANN)-based methods can achieve contactless fish counting, but this method relies on manually selected features, and the presence of subjectivity can affect the accuracy and stability of counting. Currently, target detection mainly detects targets in low-density scenes. For example, the Yolo target detection model can identify the category and location of objects in images and is currently widely used for counting tasks. However, this method cannot achieve stable counting performance for underwater fish. In aquaculture environments, fish aggregation cannot be controlled, and in some cases, fish schools are blocked, which poses a serious obstacle to the implementation of target detection methods.

[0004] Currently, density map-based counting methods can count occluded targets of different sizes, but they still face many challenges in counting accuracy and stability, which limits their widespread application. Moreover, in actual underwater aquaculture environments, unlike terrestrial scenes, underwater scenes are complex and changeable. Due to the influence of factors such as light intensity and water turbidity, the counting scenarios are diverse. Current density map-based counting methods often focus on the fish themselves, lack consideration of environmental factors, and the counting stability and accuracy are insufficient. Summary of the Invention

[0005] In order to overcome the defects and shortcomings of the existing technology, the present invention provides a fish counting system and method in an underwater environment based on a density map. The present invention introduces counting feature enhancement and interference feature separation technology into the fish counting model to reduce the impact of complex background on fish counting, thereby achieving accurate and stable counting of fish in complex underwater environments.

[0006] In order to achieve the above object, the present invention adopts the following technical solutions:

[0007] The present invention provides a fish counting system in an underwater environment based on a density map, comprising: a fish data set processing module in the underwater environment, a classification module, an image cropping module, a zooming operation module, an interference feature extraction module, a counting feature extraction module, a fish counting model construction module, a fish counting model training module, and a fish counting result output module;

[0008] The underwater fish data set processing module is used to obtain the underwater fish data set, and perform data set division and data preprocessing on the underwater fish data set;

[0009] The classification module is used to classify the underwater fish data set after data preprocessing;

[0010] The image cropping module is used to crop each type of underwater fish school image into multiple background images and single fish images;

[0011] The scaling operation module is used to perform scaling operations on the background image;

[0012] The interference feature extraction module is used to extract interference features from the background image after the scaling operation;

[0013] The counting feature extraction module is used to extract feature convolution kernels from a single fish image;

[0014] The fish counting model building module is used to build a fish counting model;

[0015] The fish counting model training module is used to input the training set of the underwater fish data set into the fish counting model for training, optimize the model parameters through the loss function, reduce the similarity between the original image features and the 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 counting features;

[0016] The fish counting result output module is used to output a density map based on the trained fish counting model, and sum up the pixel values ​​of the density map to obtain the number of fish.

[0017] As a preferred technical solution, data preprocessing specifically includes:

[0018] Dark channel prior dehazing is used to dehaze underwater fish school images in the underwater fish school dataset.

[0019] As a preferred technical solution, the classification module is used to classify the underwater fish data set after data preprocessing, specifically including:

[0020] Classify underwater fish images from the underwater fish dataset based on light intensity and water clarity.

[0021] As a preferred technical solution, the interference feature extraction module is used to extract interference features from the background image after the scaling operation, specifically including:

[0022] The scaled background image is input into the front-end network, and multiple feature maps are output. The multiple feature maps are connected to obtain the overall feature map, and the average value of the overall feature map is calculated through the average operation to obtain the interference feature.

[0023] As a preferred technical solution, the counting feature extraction module is used to extract feature convolution kernels for a single fish image, specifically including:

[0024] A single fish image is input into the front-end network to obtain single fish feature maps of different sizes. After scaling, the size of each feature map is unified. The unified feature maps are spliced ​​together through the connection operation to obtain the feature convolution kernel.

[0025] As a preferred technical solution, the fish counting model includes a front-end network, a counting feature enhancement module, a feature supplement module and a back-end network;

[0026] Input the training set into the front-end network for feature extraction to obtain the original feature map;

[0027] The original feature map is input into the counting feature enhancement module and the feature supplementation module respectively. In the counting feature enhancement module, a convolution operation is performed based on the feature convolution kernel and the original image features to obtain an enhanced feature map. In the feature supplementation module, the dimension of the feature map is adjusted by different convolution kernels, and the feature maps of different dimensions are fused through the connection operation.

[0028] Connect the feature maps output by the counting feature enhancement module and the feature supplementation module and input them into the backend network;

[0029] The backend network extracts deep feature information and generates density maps.

[0030] As a preferred technical solution, the counting feature enhancement module includes three network branches, and the original feature map is processed by the three network branches respectively;

[0031] In the first network branch, the down-pooling operation is used to reduce the original feature map, and the convolution operation is performed on the reduced feature map based on the feature convolution kernel. The convolved feature map is restored to the original feature map size based on the up-pooling operation.

[0032] In the second network branch, the feature convolution kernel is convolved with the original feature map to obtain a new feature map;

[0033] In the third network branch, the original feature map is enlarged based on the upsampling operation, the feature convolution is performed on the enlarged feature map, and the convolution operation is performed on the feature map. The convolved feature map is restored to the original feature map size based on the down-pooling operation.

[0034] The feature maps output by the three network branches are fused based on the connection operation to obtain the feature map output by the counting feature enhancement module.

[0035] As a preferred technical solution, the feature supplementation module includes two network branches, and the original feature map is processed by the two network branches respectively;

[0036] In the first network branch, the original feature map is sequentially processed through multiple convolution kernels of different sizes to adjust the dimension of the feature map;

[0037] In the second network branch, the original feature map is processed through a convolution kernel to adjust the dimension of the feature map;

[0038] The feature maps output by the two network branches are fused based on the connection operation to obtain the feature map output by the feature supplement module.

[0039] As a preferred technical solution, the model parameters are optimized through the loss function, and the total loss function is expressed as:

[0040] ;

[0041] ;

[0042] ;

[0043] in, 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 Represents the channel vectors of the interference features and the original features at the corresponding positions in the entire feature map, and represents the modulus of the corresponding channel vector, Indicates the number of pixels in the density map, and Represents the element values ​​of the corresponding positions in the predicted density map and the true density map respectively.

[0044] The present invention further provides a method for counting fish schools in an underwater environment based on a density map, which is provided with the above-mentioned system for counting fish schools in an underwater environment based on a density map, comprising the following steps:

[0045] Obtain underwater fish school dataset, and perform data segmentation and data preprocessing on the underwater fish school dataset;

[0046] Classify the underwater fish data set after data preprocessing;

[0047] For each type of underwater fish school image, multiple background images and single fish images are cropped, and the background images are scaled;

[0048] Extract interference features from the background image after scaling, and extract feature convolution kernels from the single fish image;

[0049] A fish counting model was constructed. The training set of the underwater fish dataset was input into the fish counting model for training. The model parameters were optimized through the loss function to reduce the similarity between the original image features and the interference features of the training set, separate the interference features, and perform convolution operations based on the feature convolution kernel and the original image features to enhance the fish counting features.

[0050] Based on the trained fish counting model output density map, the pixel values ​​of the density map are summed to obtain the number of fish.

[0051] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0052] While existing density map-based counting technologies can effectively enhance counting targets, they often overlook interference from environmental factors, such as light variations, water flow fluctuations, and water quality. This is particularly noticeable in real aquaculture environments. This invention introduces counting feature enhancement and interference feature separation techniques into the fish counting model to reduce the impact of complex backgrounds on fish counting. This improves both the accuracy of fish counting and its environmental adaptability, ensuring the stability and reliability of fish counting in variable underwater environments.

[0053] Specifically, the counting feature enhancement module effectively extracts and strengthens the characteristic information of fish schools, improves the image quality, and makes counting more accurate. The interference loss can reduce the similarity between the original features and the interference features, thereby separating the interference factors and reducing the negative impact of these factors on the counting results, further improving the stability of the counting. It can be applied to various complex underwater aquaculture environments and can meet the counting needs in different aquaculture scenarios. It does not need to rely on the selection of artificial features, thus avoiding the subjective errors caused by this. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Figure 1 Schematic diagram of the overall network architecture of the fish counting model of the present invention;

[0055] Figure 2 Schematic diagram of the network architecture of the interference feature extraction module and the counting feature extraction module of the present invention;

[0056] Figure 3 Schematic diagram of the flow of the method for counting fish schools in an underwater environment based on a density map of the present invention. DETAILED DESCRIPTION

[0057] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, 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 intended to limit the present invention.

[0058] Example 1

[0059] like Figure 1 As shown, this embodiment provides a fish counting system in an underwater environment based on a density map, comprising: a fish data set processing module in an underwater environment, a classification module, an image cropping module, a zooming operation module, an interference feature extraction module, a counting feature extraction module, a fish counting model construction module, a fish counting model training module, and a fish counting result output module;

[0060] In this embodiment, the fish school data set processing module in the underwater environment is used to obtain the underwater fish school data set, perform data set division and data preprocessing on the underwater fish school data set,

[0061] Specifically, this embodiment divides the underwater fish data set into 70% as a training set, 10% as a validation set, and 20% as a test set;

[0062] In this embodiment, data preprocessing is performed on the underwater fish dataset. Specifically, a dark channel prior dehazing (DCP) algorithm is used to dehaze the underwater fish images in the underwater fish dataset to improve the quality of the images in the underwater fish dataset.

[0063] In this embodiment, the classification module is used to classify the underwater fish data set after data preprocessing, specifically including:

[0064] Classify underwater fish school images in the underwater fish school dataset based on light intensity and water clarity;

[0065] In this embodiment, the image cropping module is used to crop each type of underwater fish school image into multiple background images and single fish images;

[0066] In this embodiment, the scaling operation module is used to perform a scaling (Resize) operation on the background image to keep the size consistent with the original image;

[0067] like Figure 2 As shown, the interference feature extraction module is used to extract interference features from the background image after the scaling operation, specifically including:

[0068] The scaled background image is input into the front-end network, and multiple feature maps are output. The multiple feature maps are connected to obtain the overall feature map, and the average value of the overall feature map is calculated by the average operation to obtain the interference feature;

[0069] In this embodiment, the counting feature extraction module is used to extract the feature convolution kernel for a single fish image, specifically including:

[0070] A single fish image is input into the front-end network to obtain single fish feature maps of different sizes. Each feature map is resized after scaling, and the resized feature maps are concatenated through concatenation to obtain the feature convolution kernel.

[0071] In this embodiment, the fish counting model building module is used to build a fish counting model, combined with Figure 1 As shown, the fish counting model includes a front-end network, a counting feature enhancement module, a feature supplement module and a back-end network;

[0072] Input the training set into the front-end network for feature extraction to obtain the original feature map;

[0073] The original feature map is input into the counting feature enhancement module and the feature supplementation module respectively. In the counting feature enhancement module, a convolution operation is performed based on the feature convolution kernel and the original image features to obtain an enhanced feature map. In the feature supplementation module, the dimension of the feature map is adjusted by different convolution kernels, and the feature maps of different dimensions are fused through the connection operation.

[0074] Connect the feature maps output by the counting feature enhancement module and the feature supplementation module and input them into the backend network;

[0075] The backend network extracts deep feature information and generates density maps.

[0076] In this embodiment, the counting feature enhancement module includes three network branches, and the original feature map is processed by the three network branches respectively;

[0077] In the first network branch, the down-pooling operation is used to reduce the original feature map, and the convolution operation is performed based on the feature convolution kernel and the reduced feature map. The up-pooling operation is used to restore the convolved feature map to the original feature map size. Specifically, it is expressed as:

[0078] ;

[0079] ;

[0080] ;

[0081] in, represents the original feature map, represents the down-pooling operation, represents the reduced feature map, represents the feature convolution kernel, represents the convolution operation, represents the feature map after convolution, Represents the feature map after processing by the first network branch;

[0082] In the second network branch, the feature convolution kernel is convolved with the original feature map to obtain a new feature map, which is expressed as:

[0083] ;

[0084] in, Represents the feature map after processing by the second network branch;

[0085] In the third network branch, the original feature map is enlarged based on the upsampling operation, the feature convolution is performed on the enlarged feature map, and the convolution operation is performed on the feature map after the enlargement. The convolution operation is used to restore the feature map after the enlargement to the original feature map size. Specifically, it is expressed as follows:

[0086] ;

[0087] ;

[0088] ;

[0089] in, represents the enlarged feature map, represents the upsampling operation, represents the feature map after convolution, Represents the feature map after processing by the third network branch;

[0090] The feature maps output by the counting feature enhancement module are fused using a concatenation operation. Using three branches to scale the feature maps improves multi-scale object recognition. Convolution of the feature maps with the feature convolution kernel increases their relevance to fish information, focusing more on fish schools and enhancing fish counting.

[0091] In this embodiment, the feature supplementation module includes two network branches, and the original feature map is processed by the two network branches respectively;

[0092] In the first network branch, the original feature map is sequentially processed through multiple convolution kernels of different sizes to adjust the dimension of the feature map;

[0093] In the second network branch, the original feature map is processed through a convolution kernel to adjust the dimension of the feature map;

[0094] The feature maps output by the two network branches are fused based on the connection operation to obtain the feature map output by the feature supplement module.

[0095] In this embodiment, the fish counting model training module is used to input the training set of the underwater fish data set into the fish counting model for training, optimize the model parameters through the loss function, reduce the similarity between the original image features and the 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 counting features;

[0096] In this embodiment, the total loss function is expressed as:

[0097] ;

[0098] ;

[0099] ;

[0100] in, 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 Represents the channel vectors of the interference features and the original features at the corresponding positions in the entire feature map, and represents the modulus of the corresponding channel vector, Indicates the number of pixels in the density map, and Represents the element values ​​of the corresponding positions in the predicted density map and the true density map respectively.

[0101] In this embodiment, the fish counting result output module is used to output a density map based on the trained fish counting model, and sum up the pixel values ​​of the density map to obtain the number of fish.

[0102] Example 2

[0103] like Figure 3 As shown, this embodiment provides a method for counting fish schools in an underwater environment based on a density map, comprising the following steps:

[0104] S1: Obtain underwater fish school dataset, divide the dataset and perform data preprocessing on the underwater fish school dataset;

[0105] S2: Classify the underwater fish school images in the underwater fish school dataset after data preprocessing according to light intensity and water clarity. Specifically, they can be divided into four categories: bright + clear, bright + turbid, dark + clear, and dark + turbid;

[0106] S3: For each type of underwater fish school image, M background images and N single fish images are cropped;

[0107] In this embodiment, M and N are preferably both 10. The background image refers to an image containing only the background, and the single fish image contains only one fish. 40 background images and 40 single fish images can be obtained, and the background image is resized to keep it consistent with the original image size.

[0108] S3: Input the scaled background image into the interference feature extraction module to extract the interference features, and input the single fish image into the counting feature extraction module to extract the feature convolution kernel;

[0109] In this embodiment, the interference feature extraction module and the count feature extraction module have the same network structure, both using the first 10 convolution layers of the VGG16 network, i.e., the front-end network;

[0110] In this embodiment, the interference feature extraction process specifically includes:

[0111] The scaled background images of the four categories are sequentially fed into the first 10 convolutional layers of the VGG16 network. Using pre-trained weights, a feature map of dimension (1, 512, 1 / 8 H, 1 / 8 W) is obtained for each image, where H and W represent the height and width of the original image. The 40 feature maps are concatenated to obtain an overall feature map of dimension (40, 512, 1 / 8 H, 1 / 8 W). The average of the overall feature map is calculated through the mean operation to obtain the interference feature of dimension (1, 512, 1 / 8 H, 1 / 8 W).

[0112] In this embodiment, the counting feature extraction process includes:

[0113] The single fish image is fed into the first 10 convolution layers of the VGG16 network, resulting in single fish feature maps of different sizes. This is due to the inconsistent sizes of the captured single fish images. After resizing, the height and width of each feature map are uniformly set to 3, and the dimensions become (1, 512, 3, 3). Then, the 40 single fish feature maps are concatenated through the concatenation operation to obtain a feature map of dimension (40, 512, 3, 3) as the feature convolution kernel.

[0114] S4: Build a fish counting model, input the training set of the underwater fish data set into the fish counting model for training, and optimize the model parameters through the loss function;

[0115] In this embodiment, the fish counting model includes a front-end network, a counting feature enhancement module, a feature supplementation module, and a back-end network. The counting feature enhancement module is used to enhance fish information, and the feature supplementation module is used to avoid the loss of detailed information and the occurrence of overfitting, thereby achieving accurate and stable counting.

[0116] Before model training, pre-processing is performed to obtain interference features and feature convolution kernels. The interference features are used to calculate the interference loss, thereby achieving the separation of original image features from interference features. The feature convolution kernel is used in the counting feature enhancement module in the fish counting model to enhance the counting features.

[0117] 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 convolution layers of the VGG16 network and initially uses pre-trained weights. The original feature map is input into the counting feature enhancement module and the feature supplementation module for processing. In the counting feature enhancement module, the original feature map is processed by three network branches respectively.

[0118] Specifically, in the first network branch, the down-pooling operation is used to reduce the size of the original feature map by half, and then the feature convolution kernel is used to perform a convolution operation with the reduced feature map. Finally, the up-pooling operation is used to restore the convolved feature map to the original feature map size.

[0119] The second network branch directly convolves the feature convolution kernel with the original feature map to obtain a new feature map;

[0120] The third network branch uses an upsampling operation to double the size of the original feature map, then convolves the feature map with the enlarged feature map, and finally uses a down-pooling operation to restore the convolved feature map to the original feature map size;

[0121] After processing the three network branches, three feature maps with equal channel sizes and a ratio of 1:1:1 are obtained, and they are fused using a connection operation.

[0122] However, although such an operation can improve the recognition ability of the model, the features will lose a lot of detailed information in this process. The feature supplementation module exists to solve the whole problem. In the feature supplementation module, the original feature map is processed by two network branches respectively. In the first network branch, the original feature map is processed by 1×1, 3×3, and 5×5 convolution kernels to adjust the dimension of the feature map. In the second network branch, the original feature map is processed by a 1×1 convolution kernel to adjust the dimension of the feature map. The ratio of the number of channels 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.

[0123] After processing by the counting feature enhancement module and the feature supplementation 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 exactly the same number of channels and size as the original feature map is obtained, which is then input into the back-end network. The function of the back-end network is to extract the deep information of the features and generate a density map without changing the size of the feature map. The back-end network includes 6 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 to an expanded convolution with a dilation sparsity of 2. The deep information is extracted through 6 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.

[0124] During the model training phase, the model parameters are updated through a loss function. The loss function of this embodiment is divided into two parts. One part is the interference loss, which aims to reduce the similarity between the original features and the interference features of the original feature map to separate the generated interference features. The other part is the count loss, which aims to regress the density map predicted by the model with the real density map in the dataset to make the predicted density map more closely fit the real density map. The total loss function is expressed as:

[0125] ;

[0126] ;

[0127] ;

[0128] in, 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 Represents the channel vectors of the interference features and the original features at the corresponding positions in the entire feature map, and represents the modulus of the corresponding channel vector, Indicates the number of pixels in the density map, and Represents the element values ​​of the corresponding positions in the predicted density map and the true density map respectively.

[0129] The brackets in the interference loss formula represent the calculation of cosine similarity. Since the similarity value is between [-1, 1], 1 is added to it to change its range to [0, 2]. Combined with the previous coefficient, it becomes a value between [0, 1]. The closer it is to 0, the smaller the similarity. The interference loss can separate the similar parts of the interference features and the original features, thereby filtering out the interference features.

[0130] After a round of training, the model parameters are updated by calculating the loss. In addition, the interference features only play a role in calculating the loss during the training phase and do not need to be involved in the model inference process.

[0131] S5: Model inference usage. During the inference stage, 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.

[0132] The present invention uses counting feature enhancement technology to more effectively extract and strengthen the characteristic information of fish schools, making counting more accurate. At the same time, interference features are obtained by extracting background features, and the background includes interference factors such as water flow fluctuations and light changes. Through interference feature separation technology, interference factors such as water flow fluctuations and light changes can be identified and separated. Interference loss can reduce the similarity between the original features and the interference features, thereby separating the interference factors, thereby reducing the negative impact of these factors on the counting results, and further improving the stability of counting. It can be applied to various complex underwater aquaculture environments and can meet the counting needs in different aquaculture scenarios.

[0133] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be considered as equivalent replacement methods and are included in the scope of protection of the present invention.

Claims

1. A fish counting system in an underwater environment based on a density map, characterized in that: include: Fish data set processing module, classification module, image cropping module, scaling operation module, interference feature extraction module, counting feature extraction module, fish counting model construction module, fish counting model training module, and fish counting result output module in underwater environment; The underwater fish data set processing module is used to obtain the underwater fish data set, and perform data set division and data preprocessing on the underwater fish data set; The classification module is used to classify the underwater fish data set after data preprocessing; The image cropping module is used to crop each type of underwater fish school image into multiple background images and single fish images; The scaling operation module is used to perform scaling operations 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 feature convolution kernels from a single fish image; The fish counting model building module is used to build a fish counting model; The fish 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; The original feature map is input into the counting feature enhancement module and the feature supplementation module respectively. In the counting feature enhancement module, a convolution operation is performed based on the feature convolution kernel and the original image features to obtain an enhanced feature map. In the feature supplementation module, the dimension of the feature map is adjusted by different convolution kernels, and the feature maps of different dimensions are fused through the connection operation. Connect the feature maps output by the counting feature enhancement module and the feature supplementation module and input them into the backend network; The backend network extracts deep feature information and generates density maps; The counting feature enhancement module includes three network branches, and the original feature map is processed by the three network branches respectively; In the first network branch, the down-pooling operation is used to reduce the original feature map, and the convolution operation is performed on the reduced feature map based on the feature convolution kernel. The convolved feature map is restored to the original feature map size based on the up-pooling operation. In the second network branch, the feature convolution kernel is convolved with the original feature map to obtain a new feature map; In the third network branch, the original feature map is enlarged based on the upsampling operation, the feature convolution is performed on the enlarged feature map, and the convolution operation is performed on the feature map. The convolved feature map is restored to the original feature map size based on the down-pooling operation. The feature maps output by the three network branches are fused based on the connection operation to obtain the feature map output by the counting feature enhancement module; The feature supplementation module includes two network branches, and the original feature map is processed by the two network branches respectively; In the first network branch, the original feature map is sequentially processed through multiple convolution kernels of different sizes to adjust the dimension of the feature map; In the second network branch, the original feature map is processed through a convolution kernel to adjust the dimension of the feature map; The feature maps output by the two network branches are fused based on the connection operation to obtain the feature map output by the feature supplement module; The fish counting model training module is used to input the training set of the underwater fish data set into the fish counting model for training, optimize the model parameters through the loss function, reduce the similarity between the original image features and the 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 counting features; The fish counting result output module is used to output a density map based on the trained fish counting model, and sum up the pixel values ​​of the density map to obtain the number of fish.

2. The fish counting system in an underwater environment based on a density map according to claim 1, characterized in that: Data preprocessing specifically includes: Dark channel prior dehazing is used to dehaze underwater fish school images in the underwater fish school dataset.

3. The fish 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 data set after data preprocessing, specifically including: Classify underwater fish images from the underwater fish dataset based on light intensity and water clarity.

4. The fish counting system in an underwater environment based on 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: The scaled background image is input into the front-end network, and multiple feature maps are output. The multiple feature maps are connected to obtain the overall feature map, and the average value of the overall feature map is calculated through the average operation to obtain the interference feature.

5. The fish counting system in an underwater environment based on density map according to claim 1, characterized in that: The counting feature extraction module is used to extract the feature convolution kernel for a single fish image, specifically including: A single fish image is input into the front-end network to obtain single fish feature maps of different sizes. After scaling, the size of each feature map is unified. The unified feature maps are spliced ​​together through the connection operation to obtain the feature convolution kernel.

6. The fish counting system in an underwater environment based on density map according to claim 1, characterized in that: The model parameters are optimized by the loss function, and the total loss function is expressed as: in, 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 Represents the channel vectors of the interference features and the original features at the corresponding positions in the entire feature map, and represents the modulus of the corresponding channel vector, Indicates the number of pixels in the density map, and Represents the element values ​​of the corresponding positions in the predicted density map and the true density map respectively.

7. A method for counting fish schools in an underwater environment based on a density map, characterized in that: The fish counting system in an underwater environment based on a density map according to any one of claims 1 to 6 comprises the following steps: Obtain underwater fish school dataset, and perform data segmentation and data preprocessing on the underwater fish school dataset; Classify the underwater fish data set after data preprocessing; For each type of underwater fish school image, multiple background images and single fish images are cropped, and the background images are scaled; Extract interference features from the background image after scaling, and extract feature convolution kernels from the single fish image; A fish counting model was constructed. The training set of the underwater fish dataset was input into the fish counting model for training. The model parameters were optimized through the loss function to reduce the similarity between the original image features and the interference features of the training set, separate the interference features, and perform convolution operations based on the feature convolution kernel and the original image features to enhance the fish counting features. Based on the trained fish counting model output density map, the pixel values ​​of the density map are summed to obtain the number of fish.

Citation Information

Patent Citations

  • Shrimp group automatic counting method and device, electronic equipment and storage medium

    CN113284164A

  • Fish school counting method based on density map regression

    CN119380379A