An apparatus and method for fish behavior analysis based on underwater image processing

By using the improved YOLOv8 algorithm and automatic cleaning device, combined with SPPELAN and CPAM attention mechanisms, efficient and intelligent monitoring of underwater fish behavior is achieved. This solves the problems of difficult camera cleaning, large image processing latency, and inaccurate behavior analysis in existing technologies, thus improving monitoring efficiency and accuracy.

CN120032423BActive Publication Date: 2026-01-02SOUTH CHINA NORMAL UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510050156.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-13
Publication Date
2026-01-02
Estimated Expiration
2045-01-13

AI Technical Summary

Technical Problem

Existing underwater fish behavior monitoring systems suffer from problems such as difficulty in cleaning cameras, large image processing delays, and insufficient accuracy in behavior analysis. Traditional manual inspections are inefficient and lack real-time performance, making it difficult to meet the needs of large-scale aquaculture farms.

Method used

An improved YOLOv8 algorithm model combined with SPPELAN and CPAM attention mechanisms is used for fish behavior analysis. Efficient and intelligent fish behavior monitoring is achieved through a camera module and an automatic cleaning unit. The camera module includes a sliding bracket and an automatic cleaning device, and real-time analysis is performed by combining image enhancement technology and target detection algorithms.

Benefits of technology

It enables efficient and automated monitoring of fish behavior, improves the accuracy of target detection and data integrity, ensures comprehensive monitoring within the aquaculture pond, reduces labor costs, and increases the survival rate of aquaculture.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120032423B_ABST
    Figure CN120032423B_ABST
Patent Text Reader

Abstract

The application discloses a fish behavior analysis method based on underwater image processing, and relates to aquatic product breeding equipment, and solves the technical problems of low efficiency, poor real-time performance and insufficient data analysis capability of traditional monitoring methods which mostly rely on manual inspection. The method comprises the following steps: acquiring image data, inputting the image data into an improved YOLO algorithm model to generate a detection model file, performing behavior feature analysis on the detection model file to generate fish activity behavior feature values, and triggering a fish abnormal behavior judgment mechanism according to the fish activity behavior feature values. The application further discloses a fish behavior analysis device based on underwater image processing. The application realizes comprehensive monitoring of the water environment in a breeding pond, ensures omnibearing and multilevel monitoring from pond bottom sediments to water surface breeding fish, and provides detailed and real-time water body condition information for breeders.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to aquaculture equipment, more particularly, it relates to a device and method for fish behavior analysis based on underwater image processing. BACKGROUND

[0002] With the rapid development of aquaculture industry, the monitoring and management of the breeding environment become particularly important. Traditional monitoring methods rely mostly on manual inspection, which has low efficiency, poor real-time performance and insufficient data analysis capabilities. In recent years, the development of computer vision and artificial intelligence technology has provided a new solution for intelligent monitoring of the breeding environment. However, the existing camera monitoring systems for underwater environments have defects such as difficult camera cleaning, large image processing delay, and inaccurate behavior analysis. Accurate methods for detecting abnormal fish behavior are crucial for fisheries as they can significantly improve yields and timely detection. Small-scale fisheries usually rely on manual observation, but this method is time-consuming and labor-intensive, and is not suitable for large-scale farms. Although computer vision technology has made progress in other fields, its application in complex breeding environments is still limited. There is an urgent need for an efficient and intelligent underwater fish behavior monitoring device to solve the above problems. SUMMARY

[0003] The technical problem solved by the present application is to provide a device and method for fish behavior analysis based on underwater image processing to solve the technical problems of traditional monitoring methods relying mostly on manual inspection, which has low efficiency, poor real-time performance and insufficient data analysis capabilities.

[0004] The method for fish behavior analysis based on underwater image processing comprises obtaining image data, inputting the image data into an improved YOLOv8 algorithm model to generate a detection model file, performing behavior feature analysis on the detection model file to generate fish activity behavior feature values, and triggering a fish abnormal behavior judgment mechanism according to the fish activity behavior feature values.

[0005] Further improvements are made to the construction method of the improved YOLOv8 algorithm model as follows:

[0006] The attention mechanism of the spatial pyramid pooling and efficient layer aggregation network is combined into the backbone network part SPPF of the YOLOv8 algorithm model to form an SPPELAN module to segment and recombine the image data and form a new feature map.

[0007] A CPAM attention mechanism module is added to the YOLOv8 algorithm model to process the new feature map through channel and position attention mechanism to obtain an output feature map.

[0008] Further, the CPAM attention mechanism module processes the new feature map in the following way:

[0009] A one-dimensional convolution is set, and the CPAM attention mechanism module analyzes and processes the proportional mapping relationship between the channel dimension of the new feature map and the convolution kernel of the one-dimensional convolution, so that the convolution kernel adapts to the size of different channels of the new feature map, so that the CPAM attention mechanism module can process multiple channels of the new feature map.

[0010] The CPAM attention mechanism module divides the new feature map into a width part and a height part according to the width and height, takes the width part as the width of the input feature map, and takes the height part as the height of the input feature map. The position attention coordinates are output according to the width of the input feature map and the height of the input feature map. A pair of feature map width and feature map height dependent on the spatial position are generated through the position attention coordinates and the Sigmoid activation function. The feature map width and feature map height dependent on the spatial position are multiplied by the preset channel and position attention weight to obtain the output feature map.

[0011] Further, the construction method of the SPPELAN module is to divide the image data into multiple feature parts through the Transition module, and send each feature part into the Block module for processing to re-integrate all parallel branch feature parts to form a new feature map.

[0012] Further, the x coordinates and y coordinates between different frames of image data are extracted from the detection model file, and the speed and acceleration of the fish school are calculated through the x coordinates and y coordinates between different frames. The activity time t of fish in a specific region is obtained, and the rotation angle of the fish school is calculated through the x coordinates and y coordinates between different frames and the activity time t. The center coordinates and individual coordinates of each frame of fish school in the detection model file are obtained, and the dispersion of the fish school is obtained according to the center coordinates and individual coordinates of each frame of fish school. The shooting center coordinates of the camera in the detection model file are obtained, and the center distance is calculated through the shooting center coordinates of the camera and the center coordinates of each frame of fish school. The speed and acceleration of the fish school, the rotation angle of the fish school, the dispersion of the fish school, and the center distance are taken as the fish activity behavior feature value.

[0013] Further, the expression of the speed and acceleration of the fish school is:

[0014] ; ;

[0015] wherein, is the distance between two points (x1, y1) and (x2, y2) in different frames. Vthe velocity of the fish school; a the acceleration of the fish school; the time difference between two frames;

[0016] the rotation angle of the fish school is expressed as:

[0017] ;

[0018] wherein, K t the rotation angle of the fish school; x t the x coordinate between different frames within the active time; y t the y coordinate between different frames within the active time;

[0019] the expression for calculating the dispersion of the fish school is:

[0020] ;

[0021] wherein, LS the dispersion of the fish school; 、 the center coordinate of each frame of fish school, x i 、 y i the individual coordinate of the fish; n is the number of detected target fish;

[0022] the expression for the center distance is:

[0023] ;

[0024] wherein, ND the center distance; , the center coordinate of the fish school, the center coordinate of the camera;

[0025] the expression for the center coordinate of each frame of fish school is:

[0026] ; ;

[0027] wherein, 、 the center coordinate of each frame of fish school, x i 、 y i the individual coordinate of the fish.

[0028] Further, the fish abnormal behavior judging mechanism is used to compare the fish activity behavior characteristic value with a preset normal activity characteristic threshold value, when the fish activity behavior characteristic value is greater than the normal activity characteristic threshold value, it is judged that the fish activity behavior is abnormal, and when the fish activity behavior characteristic value is less than or equal to the normal activity characteristic threshold value, it is judged that the fish activity behavior is normal.

[0029] An underwater image processing fish behavior analysis device, the device comprises,

[0030] A camera module is used to acquire image data in a breeding pond;

[0031] An external controller is used to process the image data according to the underwater image processing fish behavior analysis method and judge whether the fish behavior is abnormal.

[0032] Further improvement, the camera module is installed in the breeding pond through a slidable support, and an automatic cleaning unit is installed on the camera module.

[0033] Further, the automatic cleaning unit comprises a roller, a solenoid valve, a cavitation nozzle and two connecting rods, the camera module comprises a shell, a camera is fixedly installed on the shell, a limiting groove is formed on the side surface of the shell on both sides of the camera, a fourth ball screw is installed in the limiting groove, one end of the two connecting rods is connected with the sliding block of the fourth ball screw through the limiting groove, and a roller is rotatably installed between the other ends of the two connecting rods; The surface of the roller is provided with a brush.

[0034] The shell is provided with a solenoid valve, a horn-shaped air inlet pipe is installed on the air inlet of the solenoid valve, the air outlet of the solenoid valve is connected with a cavitation nozzle through a pipeline, the air outlet of the cavitation nozzle faces the camera, and the cavitation nozzle, the solenoid valve and the air inlet pipe are communicated.

[0035] A third stepper motor is installed in the shell, and the driving end of the third stepper motor is in transmission connection with the fourth ball screw.

[0036] The camera, the third stepper motor and the solenoid valve are electrically connected with the external controller.

[0037] Advantages

[0038] The advantages of the present application are:

[0039] 1.The fish behavior analysis method based on underwater image processing is provided, which comprises the following steps: collecting image data, and analyzing the fish behavior according to the image data, thereby improving the accuracy of subsequent target detection, and compared with the traditional method, the method has the advantages of high automation, objective accuracy, good data integrity, etc., and can be used for real-time health monitoring of fish groups in large-scale breeding ponds, thereby improving the survival rate of breeding, reducing economic losses, and providing strong technical support for modern aquaculture.

[0040] 2.The fish behavior analysis device based on underwater image processing is provided, which comprises a camera module and a slidable support, the slidable support is installed on the inner wall of one side of the breeding pond, the camera module is installed on the slidable support, an automatic cleaning unit is arranged on the camera module, and the camera module and the slidable support are electrically connected with an external controller, the system can clean the algae and suspended solids in front of the camera in time through the automatic cleaning unit in front of the camera, thereby prolonging the service life of the camera, capturing the fish activity pictures of different water surface heights and different areas, realizing comprehensive monitoring of the water environment in the breeding pond, ensuring omnibearing and multilevel monitoring from the sediment at the bottom of the pond to the breeding fish on the water surface, and providing detailed and real-time water body condition information for the breeder. BRIEF DESCRIPTION OF DRAWINGS

[0041] Figure 1 It is a schematic diagram of the overall structure of the monitoring device of the present application.

[0042] Figure 2 It is a schematic diagram of the structure of the slidable support of the present application.

[0043] Figure 3 It is a schematic diagram of the structure of the camera module of the present application.

[0044] Figure 4 It is a sectional view of the cavitation nozzle of the present application.

[0045] Figure 5 It is a flowchart of the image processing and analysis method of the present application.

[0046] Figure 6 It is a flowchart of the fish behavior feature analysis of the present application.

[0047] Figure 7 It is a structure diagram of the improved SPPELAN of the present application.

[0048] Figure 8 It is a network structure diagram of the improved YOLOV8 algorithm model of the present application.

[0049] Wherein: 101-external controller, 102-slidable support, 103-camera module, 201-first stepper motor, 202-ball screw fixed seat, 203-first ball screw, 204-slid of third ball screw, 205-third ball screw, 206-ball screw bearing seat, 207-second stepper motor, 208-second ball screw, 301-camera, 302-brush, 303-roller, 304-linkage, 305-limiting groove, 306-underwater searchlight, 307-air inlet pipe, 308-solenoid valve, 309-cavitation nozzle, 310-housing, 401-inlet pipe section, 402-contracting pipe section, 403-expanding pipe section, 404-outlet pipe section. DETAILED DESCRIPTION

[0050] The application will be further described below in conjunction with the embodiments, but does not constitute any limitation to the application, and any limited number of modifications made by anyone within the scope of the claims of the application is still within the scope of the claims of the application.

[0051] Reference Figures 1-8 The device for fish behavior analysis based on underwater image processing comprises a camera module 103 and a slidable support 102. The slidable support 102 is installed on the inner wall of one side of the breeding pond, and the camera module 103 is installed on the slidable support 102. An automatic cleaning unit is arranged on the camera module 103. The camera module 103 and the slidable support 102 are electrically connected with the external controller 101.

[0052] A highly flexible underwater camera device is installed at the edge of the breeding pond, which has the ability of omnidirectional sliding, aiming to realize comprehensive monitoring of the water environment in the breeding pond. The camera module 103 can accurately adjust its position through the external controller 101 and according to the needs, to respectively shoot and record the bottom, middle and upper pictures of the water body in the breeding pond. This design ensures comprehensive and multi-level monitoring from the bottom sediment to the surface of the breeding fish, providing detailed and real-time water condition information for the breeder. Through flexible scheduling of the camera module 103, the changes of fish activity behavior in the bottom, middle layer and surface can be clearly captured.

[0053] As Figure 2As shown, the slidable support 102 comprises a first ball screw 203, a second ball screw 208 and a third ball screw 205, the first ball screw 203 and the second ball screw 208 are both fixedly installed on the inner wall of one side of the breeding tank, the first ball screw 203 and the second ball screw 208 are arranged in parallel, one end of the first ball screw 203 is fixedly installed with a first stepping motor 201, the driving end of the first stepping motor 201 is in transmission connection with the first ball screw 203, one end of the second ball screw 208 close to the first stepping motor 201 is fixedly installed with a ball screw fixed seat 202. The ball screw fixed seat 202 is used for fixing the second ball screw 208 on the inner wall of the breeding tank. The first stepping motor 201 is used for horizontal transmission of the first ball screw 203, so as to drive the horizontal movement of the camera module 103 in the breeding tank.

[0054] The bottom of the third ball screw 205 is fixedly installed on the sliding block of the first ball screw 203 and the sliding block of the second ball screw 208, the third ball screw 205 is arranged perpendicularly to the first ball screw 203, one end of the third ball screw 205 close to the first ball screw 203 is fixedly installed with a second stepping motor 207, the driving end of the second stepping motor 207 is in transmission connection with the third ball screw 205, the sliding block 204 of the third ball screw is fixedly installed with the camera module 103. The first stepping motor 201 and the second stepping motor 207 are both electrically connected with the external controller 101 through the motor controller. The second stepping motor 207 is used for vertical transmission of the third ball screw 205, so as to drive the vertical movement of the camera module 103 in the breeding tank.

[0055] The ball screw bearing seat 206 is fixedly installed on the first ball screw 203, the second ball screw 208 and the third ball screw 205. The ball screw bearing seat 206 can fix the position of the ball screw to prevent it from deviating during movement. By adjusting the position and fastening degree of the bearing seat, the precise positioning and guidance of the transmission system can be realized, and the reliability and accuracy of the whole system are improved.

[0056] When it is needed to move the camera module 103 horizontally on the inner wall of the breeding tank, the external controller 101 controls the driving end of the first stepping motor 201 to rotate, the driving end of the first stepping motor 201 drives the first ball screw 203 to move the sliding block of the first ball screw 203, the sliding block of the first ball screw 203 drives the third ball screw 205 to move, the third ball screw 205 drives the camera module 103 installed on the sliding block 204 of the third ball screw to move horizontally, the sliding block of the second ball screw 208 also moves horizontally, and the second ball screw 208 plays a role in assisting horizontal movement.

[0057] When the camera module 103 needs to move vertically on the inner wall of the culture tank, the external controller 101 controls the driving end of the second stepper motor 207 to rotate, the driving end of the second stepper motor 207 drives the third ball screw 205 to move the sliding block 204 of the third ball screw in the vertical direction of the inner wall of the culture tank, and the sliding block 204 of the third ball screw drives the camera module 103 to move vertically.

[0058] As shown in Figure 3 The camera module 103 includes a housing 310, a camera 301 is fixedly installed on the housing 310, limit grooves 305 are formed on the sides of the housing 310 on both sides of the camera 301, and a moving unit is installed in the limit grooves 305. The limit grooves 305 are used to limit the movement of the connecting rods 304.

[0059] The moving unit includes a fourth ball screw and a third stepper motor, the fourth ball screw is installed in the limit groove 305, the third stepper motor is installed inside the housing 310, the driving end of the third stepper motor is in transmission connection with the fourth ball screw, one end of the connecting rod 304 is fixedly connected with the sliding block of the fourth ball screw, and the third stepper motor is electrically connected with the external controller 101 through a motor controller. The moving unit is used to drive the brush 302 to move up and down.

[0060] The automatic cleaning unit includes a roller 303, an electromagnetic valve 308, a cavitation nozzle 309, and two connecting rods 304, one end of each of the two connecting rods 304 is connected with the moving unit through the limit groove 305, the roller 303 is rotatably installed between the other ends of the two connecting rods 304, and the surface of the roller 303 is provided with the brush 302. The brush 302 is used to clean the camera 301.

[0061] The electromagnetic valve 308 is fixedly installed on the top of the housing 310, the air inlet of the electromagnetic valve 308 is provided with a horn-shaped air inlet pipe 307, the air outlet of the electromagnetic valve 308 is connected with the cavitation nozzle 309 through a pipeline, the air outlet of the cavitation nozzle 309 faces the camera 301, and the cavitation nozzle 309, the electromagnetic valve 308 and the air inlet pipe 307 are in communication. The electromagnetic valve 308 is used to control the on-off of the fluid in the cavitation nozzle 309.

[0062] Two underwater searchlights 306 are fixedly installed above the camera 301 on the housing 310. The underwater searchlights 306 provide light sources for collecting image data.

[0063] The camera 301, the underwater searchlights 306, the moving unit and the electromagnetic valve 308 are electrically connected with the external controller.

[0064] The cavitation nozzle 309 comprises an outlet pipe section 404, an inlet pipe section 401, a contraction pipe section 402 and an expansion pipe section 403. The inlet pipe section 401 is fixedly connected with the outlet pipe section 404 through the contraction pipe section 402 and the expansion pipe section 403 connected in sequence, and the outlet pipe section 404, the inlet pipe section 401, the contraction pipe section 402 and the expansion pipe section 403 are all communicated. The inlet pipe section 401 ensures smooth fluid inflow for guiding the jet fluid into the nozzle. The contraction pipe section 402 is internally provided with a first cavity with a diameter gradually decreasing, and the contraction pipe section 402 converts the pressure energy of the fluid into kinetic energy by gradually reducing the passage diameter of the fluid, so that the contraction section can accelerate the flow speed of the fluid to reach the state of high-speed jet. The expansion pipe section 403 is internally provided with a second cavity with a diameter gradually increasing, and the expansion pipe section 403 can slow down the speed of the jet fluid and help form a stable jet, thereby improving the stability and efficiency of the jet, and the outlet pipe section 404 is the position where the cavitation bubble generated by the jet passes through.

[0065] When the camera 301 is dirty, the external controller 101 controls the driving end of the third stepper motor to rotate, the driving end of the third stepper motor drives the fourth ball screw to move the sliding block of the fourth ball screw, the sliding block of the fourth ball screw drives the connecting rod 304 to move, and the connecting rod 304 drives the brush 302 to move up and down. At the same time, the external controller 101 controls the electromagnetic valve 308 to open, water enters the electromagnetic valve 308 through the water inlet pipe 307, and the water forms cavitation bubbles through the cavitation nozzle 309 and sprays towards the camera 301, thereby removing the dirt on the lens.

[0066] An automatic cleaning unit is developed to ensure the high definition and long-term stability of camera image acquisition. The core function of this unit is to automatically and efficiently remove various turbid objects and pollutants in front of the camera lens, thereby maintaining the optimal performance of the visual monitoring or image capture system. Specifically, the automatic cleaning unit skillfully integrates gas purging and physical brushing cleaning mechanisms. First, at the top position of the camera 301, a cavitation nozzle 309 controlled by an electromagnetic valve is installed, which can shoot cavitation bubbles to clean the lens. The cavitation water jet mainly uses Bernoulli's principle. First, the pressure of the water flow is increased by a booster pump, and then a special nozzle structure is used to form a high jet beam in the water, so that the local pressure of the liquid decreases with the increase of the kinetic energy of the liquid. When the local pressure of the liquid is less than the saturated vapor pressure of the water flow, a large number of bubbles contained in the water will be precipitated. With the water jet impacting the surface, the shock wave generated by the rupture of the cavitation bubbles has good cleaning effect. The cavitation nozzle is aimed at the optical center of the camera, and can be automatically triggered and release high-pressure gas according to the preset time interval or the actual monitored image quality decline. The directional airflow can effectively remove the impurities and pollutants on the lens surface that are weakly attached and easily stripped by bubbles. In order to deal with stubborn stains that are strongly attached and difficult to be removed by bubbles alone, the invention further designs a limiting groove 305 on both sides of the camera 301. These limiting grooves 305 not only provide a stable installation basis for subsequent cleaning components, but also ensure the accuracy and consistency of the cleaning action. Below the camera 301, a set of roller brush cleaning structure is installed. The device rolls the brush 302 up and down. The brush 302 can effectively remove stubborn stains on the lens surface without causing any damage to the lens surface. Through the precise control of the third stepper motor, the brush 302 can clean at the most suitable speed and force, avoiding unnecessary wear and tear and prolonging the service life of the camera 301.

[0067] A fish behavior analysis method based on underwater image processing, the method comprises the steps of:

[0068] Step one: screening the image data to obtain target image data, first screening the data set, using DarkLabel software to detect and label the target, providing accurate supervision signals for subsequent algorithm learning.

[0069] Step two: denoising the target image data to generate denoised image data. To address the noise problem prevalent in underwater images, a high-efficiency denoising processing flow is designed. This flow integrates multiple denoising algorithms, including the classic median filter, wavelet transform method, and dual-channel residual network and non-mean denoising method. Median filtering can effectively remove salt and pepper noise in images while preserving edge details. Wavelet transform can decompose images in the frequency domain, removing high-frequency noise and preserving low-frequency information to achieve the dual effects of denoising and image enhancement. The dual-channel residual network learns the noise distribution in the image through a deep learning model, automatically removing noise while preserving important features in the image as much as possible. The non-mean denoising method adaptively adjusts the denoising strength based on the local statistical properties of the image, further improving the denoising effect and making the image clearer.

[0070] Step three: enhancing the denoised image data to generate enhanced image data. After denoising, we address the color distortion and contrast reduction problems caused by light absorption in underwater images by using a series of image enhancement techniques. First, we use the CLAHE (Contrast Limited Adaptive Histogram Equalization) algorithm to enhance the local contrast of the image, improving the visual effect and highlighting the details. Next, we use the dark channel prior method to restore the true colors of the image based on the physical properties of underwater images, removing color deviations caused by light absorption. To further improve image quality, we introduce the GANs (Generative Adversarial Networks) technique, which generates clearer and more colorful underwater images through the adversarial training of the generator and discriminator.

[0071] Step four: input the enhanced image data into the improved YOLOV8 algorithm model for training to generate a detection model file.

[0072] For the YOLOV8 algorithm model, since the original model's detection accuracy, recall rate, robustness, and inference speed do not meet the requirements of underwater image detection, the algorithm modules need to be modified.

[0073] Since the targets of underwater detection often have small targets to process, the size of the receptive field is crucial to the model's ability to capture details at this time. Therefore, for the backbone network part in YOLOv8, SPPF (Separable Pyramid Pooling with Fusion) increases the receptive field by combining large kernel convolution and non-dilated convolution. However, due to the small size of small targets, large kernel convolution may not provide enough spatial resolution to effectively capture the features of small targets, which may be diluted during information fusion, thereby affecting detection accuracy. Therefore, the SPPF module is improved, using the SPPELAN (Spatial Pyramid Pooling with Efficient Layer Aggregation Network) module that combines the attention mechanism of spatial pyramid pooling (SPP) and efficient layer aggregation network (ELAN). The input feature map is processed through a Transition module for data conversion and processing. The feature map processed by the Transition module is divided into multiple parts, and each feature part after division is sent to different Block modules for processing. Each Block can represent any calculation module, and the feature map after processing by multiple Blocks is integrated by the Concatenation (concatenation) operation to integrate the features of all parallel branches.

[0074] Figure 7 Structure diagram of the improved SPPELAN.

[0075] In the field of target detection, different targets have different characteristics due to different environments, and the importance of different characteristics is different. In the convolutional neural network, the input image is processed by convolution, pooling and other operations, so that the importance of different feature maps is different. Therefore, the CPAM (Channel and Position Attention Mechanism) attention mechanism structure is introduced here, which is based on the mixed domain attention mechanism and has the advantage of considering both channel information and spatial position information. In order to preserve the channel information of each feature map, the method of cross-channel interaction in the local range is considered by considering the k nearest neighbors of each channel. A one-dimensional convolution with size k is used for processing to ensure the performance of the model without introducing too much computational complexity. The CPAM module analyzes and processes the proportional mapping relationship between the channel dimension C and the size k of the convolution kernel, and the mapping relationship formula is: The channel dimension C is usually an exponential multiple of 2, and the calculation formula of k is: wherein odd denotes the parity of the nearest neighbor channel of the channel, the size of Y is set to 2, and the size of b is set to 1. Y and b are scaling parameters for controlling the ratio of the size of the convolution kernel k and the channel dimension C respectively. After the above nonlinear mapping, the size of k is more perfectly adapted to the size of different channels, so that the CPAM module takes longer exchange time in the case of high value channels and shorter exchange time in the case of low value channels when processing channel information, achieving deeper mining of multiple channel features and thus improving the performance and efficiency of the model. Then the feature map is divided into two parts according to the width and height, and the two parts after division are respectively subjected to global average pooling operation on the width axis and the height axis, and the specific formula is:

[0076] , wherein w denotes the width of the input feature map, h denotes the height of the input feature map, and is the value of the input feature map at position . When generating the position attention coordinates, Concat connection is used on the width axis and the height axis, which needs to be subjected to convolution operation by a 1x1 convolution kernel, and the specific formula is: wherein denotes the output of the position attention coordinates, a w denotes the width coordinate of the output attention coordinates, a h denotes the height coordinate of the output attention coordinates, Conv denotes the 1x1 convolution kernel, Concat denotes the connection operation. Then, the network will segment the attention feature and generate a pair of features depending on the spatial position through the Sigmoid activation function, and the specific formula is:

[0077] feature map width: ,

[0078] feature map height: . The output of the CPAM attention mechanism module is the output feature map obtained by multiplying the height and width with the weight,

[0079] and the formula of the output feature map is: ;

[0080] wherein E is the weight of the channel and position attention, F CPAM is the output of the CPAM attention mechanism module, S W is the feature map width input into the CPAM attention mechanism module, S hWidth of a feature map input to a CPAM attention mechanism module.

[0081] Figure 8 Improved YOLOv8 network structure diagram.

[0082] As shown in Figure 8 , the improved YOLOv8 network structure includes a backbone network, a neck network and a detection head connected in sequence.

[0083] The backbone network includes a first CBS module, a second CBS module, a first C2f3 module, a third CBS module, a first C2f6 module, a fourth CBS module, a second C2f6 module, a fifth CBS module, a second C2f3 module and an SPPELAN module connected in sequence, and the input of the first CBS module is image data.

[0084] The connection relationship of each module in sequence is: the output end of the first CBS module is connected with the input end of the second CBS module, the output end of the second CBS module is connected with the input end of the first C2f3 module, the output end of the first C2f3 module is connected with the input end of the third CBS module, the output end of the third CBS module is connected with the input end of the first C2f6 module, the output end of the first C2f6 module is connected with the input end of the fourth CBS module, the output end of the fourth CBS module is connected with the input end of the second C2f6 module, the output end of the second C2f6 module is connected with the input end of the fifth CBS module, the output end of the fifth CBS module is connected with the input end of the second C2f3 module, and the output end of the second C2f3 module is connected with the input end of the SPPELAN module.

[0085] The neck network includes a first Upsample module, a first Concat module, a second Concat module, a third C2f3 module, a fourth C2f3 module, a second Upsample module, a third Concat module, a sixth CBS module, a fifth C2f3 module, a sixth C2f3 module, a first CPAM attention mechanism module and a second CPAM attention mechanism module.

[0086] The module connection relationship is as follows:

[0087] The first output end of the SPPELAN module is connected with the input end of the first Upsample module, the second output end of the SPPELAN module is connected with the input end of the first Concat module, and the output end of the first Concat module is connected with the input end of the third C2f3 module.

[0088] The output end of the first Upsample module is connected with the input end of the second Concat module, and the output end of the second Concat module is connected with the input end of the fourth C2f3 module.

[0089] The first output end of the fourth C2f3 module is connected with the input end of the sixth CBS module, the output end of the sixth CBS module is connected with the input end of the fifth C2f3 module, and the output end of the fifth C2f3 module is connected with the input end of the second CPAM attention mechanism module.

[0090] The second output end of the fourth C2f3 module is connected with the input end of the second Upsample module, the output end of the second Upsample module is connected with the input end of the third Concat module, the output end of the third Concat module is connected with the input end of the sixth C2f3 module, and the output end of the sixth C2f3 module is connected with the input end of the first CPAM attention mechanism module.

[0091] The detection head includes a first detection head for detecting small targets, a second detection head for detecting medium targets, and a third detection head for detecting large targets, corresponding to different scale target detection. The first detection head is connected with the output end of the first CPAM attention mechanism module, the second detection head is connected with the output end of the second CPAM attention mechanism module, and the third detection head is connected with the output end of the third C2f3 module.

[0092] The detection head adopts the same three detection heads as YOLOv8, which are used to detect large targets, medium targets and small targets. Among them, the first detection head is used to detect small targets, the second detection head is used to detect medium targets, and the third detection head is used to detect large targets.

[0093] During the training process, various optimization strategies are adopted, such as adjusting the learning rate and adding regularization terms, to improve the generalization ability and detection accuracy of the model for subsequent target detection. Through a series of preprocessing steps, the quality of underwater images in complex environments is significantly improved, and the transmitted images are analyzed in real time to extract the position information of fish, providing a new technical solution for the field of underwater image analysis.

[0094] Step five: perform behavior feature analysis on the detection model file to generate fish activity behavior feature values, and compare the fish activity behavior feature values with preset normal activity feature threshold values. When the fish activity behavior feature values are greater than the normal activity feature threshold values, the fish activity behavior is abnormal, and when the fish activity behavior feature values are less than or equal to the normal activity feature threshold values, the fish activity behavior is normal.

[0095] For the speed feature, the algorithm calculates the displacement of the center of the fish target bounding box in consecutive frames, combined with the frame rate information, to obtain the instantaneous speed of the fish. The acceleration feature is obtained by calculating the rate of change of speed over time, reflecting the acceleration of fish movement. The corner information of the abnormal behavior analysis part and the local distance are derived from the center coordinates to analyze the overall dispersion degree. The above features are analyzed by machine learning method on a large amount of collected data to obtain the feature threshold range of normal fish activity. If the fish activity exceeds the normal activity feature threshold in subsequent monitoring, it means that an abnormality has occurred, thereby achieving the purpose of abnormal warning.

[0096] The x and y coordinates of the target can be obtained through the above YOLOV8 target detection module, and the speed can be calculated through the difference between the x and y coordinates of different frames , wherein is the distance between two points (x, y) in different frames, x i is the x coordinate of the i-th frame, y i is the y coordinate of the i-th frame, and the acceleration feature is: , is the time difference between two frames.

[0097] When the external environment of the fry changes, the movement angle of the fry changes frequently, and the calculation of the rotation angle can also analyze the fish movement behavior. The rotation angle calculation formula is: , wherein, , is the first and second derivatives of x with respect to t, , is the first and second derivatives of y with respect to t. The fry group in normal state moves through regular formation, and under external stimulation, starts irregular and dispersed movement,

[0098] The behavior characteristics of the fry are analyzed by quantifying the dispersion degree of the fry. The center coordinates of each frame of fish school are calculated, and the overall dispersion degree is derived from the center coordinates. The calculation formula of the dispersion degree of the fish school is:

[0099] , , , wherein , are the center coordinates of the fish, x i , y i are the individual coordinates of the fish, and n is the number of detected target fish. By analyzing the difference between the center coordinates of the fish school and the center coordinates of the camera, i.e. the center distance, the behavior characteristics of the fish can be understood, and the calculation formula is: , wherein the camera center coordinates are .

[0100] By analyzing the values of the above-mentioned V, a, K, LS, ND, etc., including the activity time t and trajectory of fish in a specific area, etc., by comparing with a large amount of past data, using characteristic probability statistics, SVM, etc., it can be concluded whether the fish has abnormal behavior, and feedback in time.

[0101] The advantage of the present application is that through the underwater camera, underwater multi-camera and automatic cleaning device, image enhancement, target trajectory tracking and behavior feature analysis, the fish behavior in the breeding environment can be automatically detected and analyzed in real time, reducing subjective error and labor cost, providing accurate and repeatable behavior data, timely judging fish abnormal behavior and avoiding economic loss. The analysis system can be widely used in fish behavior research, breeding management, ecological protection and other fields.

[0102] The following is the use steps:

[0103] 1. Equipment installation:

[0104] Install underwater cameras and their slidable mechanical frames around the breeding pond to ensure coverage of the bottom, middle and upper areas of the pond. The slidable support allows vertical and horizontal movement to adjust the shooting height and area.

[0105] 2. Cleaning device configuration:

[0106] Install an automatic cleaning unit in front of each camera 301, including a timed cleaning cavitation nozzle 309 and a brush 302.

[0107] Set the cleaning period to ensure that the lens of the camera 301 can be cleaned regularly to maintain clear images.

[0108] 3. Image transmission system setup:

[0109] Connect the camera to the central computing device of the external controller 101, equipped with wired or wireless transmission modules.

[0110] Ensure the real-time and stability of data transmission to avoid image loss or delay.

[0111] 4. Computing device and software configuration:

[0112] Install image processing software on the computing device, integrating image enhancement and YOLOV8 target detection modules.

[0113] Configure behavior analysis algorithms for abnormal detection based on fish behavior characteristics.

[0114] 5. System debugging and optimization:

[0115] System testing is conducted to adjust camera positions and cleaning cycles, and optimize image processing parameters.

[0116] The YOLOV8 model is trained to improve the accuracy and efficiency of target detection.

[0117] The above is only the preferred embodiment of the present application, it should be noted that for those skilled in the art, without departing from the structure of the present application, can make several variations and improvements, these will not affect the effect and practicality of the patent implementation of the present application.

Claims

1. A method of fish behavior analysis based on underwater image processing, characterized by, The method is, acquiring image data, inputting the image data into an improved YOLOv8 algorithm model to generate a detection model file, performing behavior feature analysis on the detection model file to generate fish activity behavior feature values, and triggering a fish abnormal behavior judgment mechanism according to the fish activity behavior feature values; The construction method of the improved YOLOv8 algorithm model is: The attention mechanism of the spatial pyramid pooling and the efficient layer aggregation network is combined into the SPPF in the backbone network part of the YOLOv8 algorithm model to form an SPPELAN module to segment and recombine the image data to form a new feature map; A CPAM attention mechanism module is added in the YOLOv8 algorithm model to process the new feature map through the channel and position attention mechanism to obtain an output feature map; The network structure of the improved YOLOv8 algorithm model includes a backbone network, a neck network and a detection head connected in sequence; the detection head includes a first detection head for detecting small targets, a second detection head for detecting medium targets and a third detection head for detecting large targets; a first CPAM attention mechanism module is added in front of the first detection head, and a second CPAM attention mechanism module is added in front of the second detection head; The device for realizing the fish behavior analysis method based on underwater image processing includes, a camera module (103) for acquiring image data in a culture pond; an external controller (101) for processing the image data and judging whether the fish behavior is abnormal; The camera module (103) is installed in the culture pond through a slidable support (102), and an automatic cleaning unit is installed on the camera module (103); The automatic cleaning unit includes a roller (303), an electromagnetic valve (308), a cavitation nozzle (309) and two connecting rods (304), the camera module (103) includes a shell (310), the shell (310) is fixedly installed with a camera (301), limit grooves (305) are formed in the side surfaces of the shell (310) on both sides of the camera (301), fourth ball screws are installed in the limit grooves (305), one ends of the two connecting rods (304) are connected with the sliders of the fourth ball screws through the limit grooves (305), a roller (303) is rotatably installed between the other ends of the two connecting rods (304), and brushes (302) are arranged on the surface of the roller (303); The shell (310) is installed with the electromagnetic valve (308) on the top, the air inlet of the electromagnetic valve (308) is installed with a horn-shaped air inlet pipe (307), the air outlet of the electromagnetic valve (308) is connected with the cavitation nozzle (309) through a pipeline, the air outlet of the cavitation nozzle (309) faces the camera (301), and the cavitation nozzle (309), the electromagnetic valve (308) and the air inlet pipe (307) are communicated; A third stepper motor is installed in the shell (310), and the driving end of the third stepper motor is in transmission connection with the fourth ball screw. The camera (301), the third stepper motor and the electromagnetic valve (308) are electrically connected with the external controller (101).

2. The method of fish behavior analysis based on underwater image processing according to claim 1, wherein, The CPAM attention mechanism module processes the new feature map in the following manner: A one-dimensional convolution is set, and the CPAM attention mechanism module analyzes and processes a proportional mapping relationship between a channel dimension of the new feature map and a convolution kernel of the one-dimensional convolution, so that the convolution kernel adapts to the size of different channels of the new feature map, and the CPAM attention mechanism module can process multiple channels of the new feature map. The CPAM attention mechanism module divides the new feature map into a width part and a height part according to the width and the height, takes the width part as the width of an input feature map, takes the height part as the height of the input feature map, outputs a position attention coordinate according to the width of the input feature map and the height of the input feature map, generates a pair of feature map width and feature map height depending on a spatial position through the position attention coordinate and a Sigmoid activation function, and multiplies the feature map width and the feature map height depending on the spatial position by a preset channel and position attention weight to obtain an output feature map.

3. The method of fish behavior analysis based on underwater image processing according to claim 1, wherein, The SPPELAN module is constructed by dividing the image data into multiple feature parts through a Transition module, and processing each feature part through a Block module to re-integrate the feature parts of all parallel branches to form a new feature map.

4. The method of fish behavior analysis based on underwater image processing according to claim 1, wherein, The x coordinates and y coordinates between different frames of image data are extracted from the detection model file, and the speed and acceleration of the fish school are calculated through the x coordinates and y coordinates between the different frames. The activity time t of the fish school in a specific region is obtained, and the rotation angle of the fish school is calculated through the x coordinates and y coordinates between the different frames and the activity time t. The center coordinates and individual coordinates of each frame of the fish school in the detection model file are obtained, and the dispersion of the fish school is calculated according to the center coordinates and individual coordinates of each frame of the fish school. The shooting center coordinates of the camera in the detection model file are obtained, and the center distance is calculated through the shooting center coordinates of the camera and the center coordinates of each frame of the fish school. The speed and acceleration of the fish school, the rotation angle of the fish school, the dispersion of the fish school and the center distance are taken as the fish activity behavior feature values.

5. The method of fish behavior analysis based on underwater image processing according to claim 4, characterized in that, The expression of the speed and acceleration of the fish school is: ; ; wherein, is the distance between two points (xl,yl) and (x2,y2) of different frames; V is the velocity of the school; a is the acceleration of the school; is the time difference between two frames, , is the first and second derivative of x with respect to t, , is the first and second derivative of y with respect to t; The expression of the rotation angle of the fish school is: ; wherein, K t is the angle of rotation of the school; x t is the x coordinate between different frames within the active time; y t is the y coordinate between different frames within the active time; The expression for calculating the dispersion of the fish school is: ; wherein, LS is the dispersion of the fish school; , are the center horizontal and vertical coordinates of each frame fish school, respectively, x i , y i are the individual horizontal and vertical coordinates of the fish, respectively; n is the number of detected target fish; The expression of the center distance is: ; wherein, ND is the center distance; , are the center horizontal coordinate and the center vertical coordinate of each frame of fish school, respectively; is the center coordinate of the camera; The expression of the center coordinates of each frame of the fish school is: ; ; wherein, , are the center horizontal and vertical coordinates of each frame of fish school respectively, x i , y i are the individual horizontal and vertical coordinates of the fish respectively.

6. The method for fish behavior analysis based on underwater image processing according to claim 1, wherein, The fish abnormal behavior judgment mechanism is to compare the fish activity behavior feature values with the preset normal activity feature threshold value. When the fish activity behavior feature values are greater than the normal activity feature threshold value, it is judged that the fish activity behavior is abnormal. When the fish activity behavior feature values are less than or equal to the normal activity feature threshold value, it is judged that the fish activity behavior is normal.

Citation Information

Patent Citations

  • Fish body injury detection method and system based on improved YOLOv7

    CN118823451A

  • Eel fry fishing investigation method based on high-resolution remote sensing image data

    CN119007029A