A space vision-based condition monitoring and quantity identification system and method
Patent Information
- Application Number
- CN202611111258.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-24
- Publication Date
- 2026-10-13
AI Technical Summary
[0005]本发明提供一种基于空间视觉的状态监测与数量识别系统,旨在解决深海网箱高密度养殖环境下,深海养殖鱼类因强光产生严重应激反应、海水悬浮颗粒导致光学退化、以及鱼体密集交错重叠导致的状态监测不准与数量估算困难的问题
1.本发明通过切换电路单元实现了水下照明装置与相机的时序选通控制,采用瞬时闪烁补光策略,消除了长期持续光源对深海养殖鱼类产生的强光应激和群态干扰。
Smart Images

Figure CN122906533A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of deep-sea intelligent aquaculture, and in particular to a state monitoring and quantity identification system and method based on spatial vision. Background Technology
[0002] With the rapid development of my country's deep-sea cage aquaculture industry, the scale of deep-sea farmed fish (such as large yellow croaker) as an important economic marine product is constantly expanding. However, the high-density aquaculture environment in deep-sea cages faces many technical challenges: First, strong light can cause severe stress in deep-sea farmed fish, affecting their growth and health; second, suspended particles, bubbles, and microalgae in seawater can cause optical degradation, resulting in blurred underwater images and reduced contrast; third, the dense overlapping of fish makes it difficult for traditional visual monitoring methods to accurately identify the number of individuals and assess biomass.
[0003] Existing fish monitoring methods mainly rely on manual counting or simple image processing techniques, which suffer from low efficiency, large errors, and severe susceptibility to environmental influences. In recent years, deep learning technology has made significant progress in the field of image recognition, and convolutional neural networks (CNNs) have been widely used in fish recognition tasks. However, traditional CNN models face problems such as insufficient feature extraction capabilities and poor multi-scale feature fusion performance when dealing with complex underwater environments.
[0004] Deep residual networks (ResNet) address the degradation problem in deep network training by introducing residual connections; however, their standard residual blocks employ fixed convolution and normalization operations, lacking adaptability to dynamic underwater environments. Furthermore, single-scale feature extraction struggles to capture both the fine local features of individual deep-sea farmed fish and the global distribution characteristics of fish schools. Therefore, designing a monitoring system capable of adaptively handling complex underwater environments and effectively fusing multi-scale features has become a pressing technical challenge in the field of intelligent deep-sea aquaculture. Summary of the Invention
[0005] This invention provides a state monitoring and quantity identification system based on spatial vision, which aims to solve the problems of inaccurate state monitoring and difficulty in quantity estimation caused by strong light, optical degradation due to suspended particles in seawater, and dense overlapping of fish bodies in the high-density aquaculture environment of deep-sea cages.
[0006] Based on this, the technical solution of the present invention is as follows: A state monitoring and quantity recognition system based on spatial vision, the system comprising an image acquisition and storage module, a preprocessing module, a state monitoring and quantity recognition module, and a data output module connected in sequence.
[0007] According to an embodiment of the present invention, the image acquisition and storage module includes an image acquisition unit and a data storage unit. The image acquisition unit is located at multiple spatial points within the acquisition point (e.g., a seawater cage) and is used to acquire image information, status information, and quantity information of training samples, as well as image information of samples to be tested. Preferably, the image information includes photographs of deep-sea farmed fish at different spatial locations and under different lighting conditions, and the image information is in image format. The data storage unit is used to store image information, status information, and quantity information acquired by the image acquisition unit.
[0008] According to an embodiment of the present invention, the image acquisition unit includes a switching circuit unit, at least two cameras, and at least two lighting devices. The switching circuit unit is used to switch between different combinations of cameras and lighting devices to achieve image acquisition under different spatial positions and lighting conditions.
[0009] According to an embodiment of the present invention, such as Figure 2 As shown, the switching circuit unit includes a diode D1, a lighting device DS1, a first control interface J1, a second control interface J2, a third control interface J3, a fourth control interface J4, a fifth control interface J5, a first relay K1, a second relay K2, a field-effect transistor Q1, a first resistor R1, a second resistor R2, a third resistor R3, a first optocoupler U1, a third optocoupler U3, and a multiplexer U2; The pin of the first control interface J1 is connected to pin a4 of the first relay K1; pins a1 and a3 of the first relay K1 are both connected to the ground terminal GND; pin a2 of the first relay K1 is connected to pin 13 of the multiplexer U2. The pins of the second control interface J2 are connected to pin b4 of the second relay K2; pins b1 and b3 of the second relay K2 are both connected to the ground terminal GND; pin b2 of the second relay K2 is connected to pin 3 of the multiplexer U2. The sixth pin (6) and seventh pin (7) of multiplexer U2 are both connected to ground (GND); the ninth pin (9) of multiplexer U2 is connected to the pin of the fifth control interface (J5); and the tenth pin (10) of multiplexer U2 is connected to the pin of the fourth control interface (J4). The twelfth pin 12 of the multiplexer U2 is connected to the pin U1-2 of the first optocoupler U1; the first pin 1 of the multiplexer U2 is connected to the pin U3-2 of the third optocoupler U3. Pin U1-1 of the first optocoupler U1 is connected to the power input terminal VCC; pin U1-3 of the first optocoupler U1 is connected to the first resistor R1; the other end of the first resistor R1 is connected to the second resistor R2, and together they are connected to the power input terminal VCC2; the other end of the second resistor R2 is connected to the resistive lighting device DS1, and the other end of the lighting device DS1 is connected to the cathode of diode D1 and pin Q1-1 of field-effect transistor Q1; the anode of diode D1 is connected to the third resistor R3 and pin Q1-3 of field-effect transistor Q1, and together they are connected to the ground terminal GND; pin 4 of the first optocoupler U1 is connected to the third resistor R3 and pin Q1-2 of field-effect transistor Q1. Pin U3-1 of the third optocoupler U3 is connected to the power input terminal VCC; pin U3-3 of the third optocoupler U3 is connected to the power input terminal VCC3; pin U3-4 of the third optocoupler U3 is connected to the pin of the third control interface J3.
[0010] Preferably, such as Figure 2 In the switching circuit unit shown, diode D1, lighting device DS1, field-effect transistor Q1, first resistor R1, second resistor R2, third resistor R3, and first optocoupler U1 together constitute module M1. Module M1 serves as the isolation drive and power switching unit for the lighting device. The first optocoupler U1 is used to isolate high and low voltage circuits, and the field-effect transistor Q1 is used to respond to signals to drive the switching of lighting device DS1. The number of M1 modules is configured according to the actual number of lighting devices deployed. For example, when the system is configured with 4 lighting devices, the 4 selection output pins of multiplexer U2 (such as pin 12, pin 14, pin 15, and pin 11) are respectively connected to the input terminals (i.e., pins U1-2) of the first optocouplers U1 of 4 independent M1 modules to achieve independent time-division multiplexing and driving of the 4 spatial monitoring node lighting devices (DS1). For example, in the second M1 module, pin U1-2 of the first optocoupler U1 is connected as a control pin to pin 14 of the multiplexer U2; in the third M1 module, pin U1-2 of the first optocoupler U1 is connected as a control pin to pin 15 of the multiplexer U2; and in the fourth M1 module, pin U1-2 of the first optocoupler U1 is connected as a control pin to pin 11 of the multiplexer U2.
[0011] Preferably, the third control interface J3 and the third optocoupler U3 together constitute the M2 module, which serves as a camera hard trigger isolation unit. The third optocoupler U3 is used to achieve electrical isolation between the control terminal and the underwater camera trigger power supply terminal, preventing underwater ground loop interference and surge backflow. The number of M2 modules is configured according to the actual number of cameras deployed. When the system is configured with 4 cameras, the 4 gate output pins of the multiplexer U2 (e.g., first pin 1, fifth pin 5, sixth pin 2, and fourth pin 4) are respectively connected to the input terminals (i.e., pin U3-2) of the third optocouplers U3 of the 4 independent M2 modules to achieve independent trigger control of the 4 cameras. When the number of cameras continues to increase, multiple cameras can be selected and controlled by cascading multiplexer chips.
[0012] Preferably, the camera includes a high-definition camera, an infrared camera, a depth camera, etc., such as a combination of a high-definition camera and an infrared camera, for acquiring image information of deep-sea farmed fish under visible light and infrared light. Preferably, a high-definition camera equipped with a 1 / 1.3-inch CMOS sensor is used to support 4K resolution imaging.
[0013] Preferably, the lighting device includes white LED lights, infrared LED lights, blue LED lights, etc., to provide lighting light of different wavelengths.
[0014] Preferably, multiple cameras and multiple lighting devices form multiple spatial monitoring nodes, which are arranged vertically at different spatial depths of the seawater cage.
[0015] According to an embodiment of the present invention, the switching circuit unit is used to select different camera and lighting device channels to realize the timing switching of the camera and lighting device.
[0016] Preferably, the lighting device uses a green light band light source for deep-sea aquaculture fish. The switching circuit unit controls the lighting device to turn on t1 milliseconds before the camera starts acquiring images and turn off t2 milliseconds after image acquisition ends. Both t1 and t2 are greater than 0, implementing instantaneous flashing supplemental lighting to eliminate the stress response and group disturbance caused by long-term continuous underwater light sources to deep-sea aquaculture fish.
[0017] Preferably, the switching control of the camera and lighting device is realized through the first control interface J1 and the second control interface J2, respectively. The selection control of different camera and lighting device channels is realized through the fourth control interface J4 and the fifth control interface J5. The fourth control interface J4 and the fifth control interface J5 are respectively input to the first address selection terminal (i.e., pin 10) and the second address selection terminal (i.e., pin 9) of the multiplexer U2. Different high and low level combinations (logic "0" or logic "1") of the fourth control interface J4 and the fifth control interface J5 are used to decode a 2-bit binary address, thereby accurately selecting four independent camera and underwater lighting device channel groups.
[0018] Preferably, the image acquisition unit further includes a timer, which is used to record the time information of each image acquisition, realize the acquisition of time-series images, and perform reference time alignment and storage.
[0019] Preferably, the image acquisition unit further includes a camera calibration module, which is used to calibrate the camera system, estimate the camera intrinsic parameter matrix and lens distortion parameters, correct radial and tangential distortion, and ensure the geometric accuracy and scale consistency of the image.
[0020] According to an embodiment of the present invention, the preprocessing module is used to preprocess image information, including distortion correction, multi-scale feature space transformation and denoising, to obtain preprocessed data; Furthermore, the multi-scale feature space transformation includes resampling and cropping the image information at different resolutions to construct a multi-scale image containing global and local features. Preferably, the preprocessing module is further configured to associate the preprocessed information (i.e., preprocessed data) of all training samples with the corresponding state information and quantity information to form a training database, and randomly divide the training database into a training set, a validation set, and a test set. The training set accounts for 60% to 80% of the total dataset (i.e., including the training set, validation set, and test set), the validation set accounts for 10% to 30% of the total dataset, and the test set accounts for 10% to 30% of the total dataset (and the sum of the three percentages is 100%). Preferably, the training set accounts for 70%, the validation set for 20%, and the test set for 10%.
[0021] According to an embodiment of the present invention, the preprocessing module includes a preprocessing unit, a classification unit, and a balancing unit; The preprocessing unit is used to adjust the format of the image information to be the same. Preferably, the image information is color corrected and contrast enhanced. More preferably, bicubic interpolation scaling is used to obtain images of the same size, for example, the size of the image is 1200 pixels × 1200 pixels.
[0022] Preferably, the preprocessing unit is also used to perform distortion correction and noise reduction on the image.
[0023] The distortion correction includes correcting lens distortion and cropping out the actual detection area.
[0024] The denoising process includes Gaussian filtering and median filtering of the image information. Preferably, a fluid adaptive morphological filter is used to filter and denoise the dynamic scattering noise generated by suspended particles, bubbles, and microalgae in seawater to obtain preprocessed data. Preferably, the denoising process includes Gaussian filtering of the image using a 5×5 Gaussian kernel and median filtering using a 3×3 pixel window; for the dynamic scattering noise generated by suspended particles, bubbles, and microalgae in seawater, a fluid adaptive morphological filter is used, and the binary image is dilated three times using a 5×5 diamond pixel window, followed by three erosion operations using a 3×3 square pixel window.
[0025] Preferably, the preprocessing unit is also used for underwater image quality assessment. Preferably, the image sharpness is classified based on the Underwater Color Image Quality Assessment Index (UCIQE) and the Underwater Image Quality Measurement Index (UIQM), and the images are divided into three levels: high sharpness (UCIQE ≥ 0.6), medium sharpness (0.3 ≤ UCIQE < 0.6), and low sharpness (UCIQE < 0.3).
[0026] Preferably, the classification unit is used to classify the population size of the data information processed by the preprocessing unit according to the aggregation characteristics of the population of the sample to be detected (deep-sea farmed fish) in the image. The population includes: discrete swimming (normal state), high-density aggregation (feeding state), multi-contour dispersion (night resting state), and abnormal bottom sinking (sick fish / dead fish state). Preferably, the balancing unit is used to adjust the amount of image data information of different group states to a balance, and the amount of image data information of the four group states is adjusted by an algorithm to 1:(0.8 ~1.2):(0.8 ~1.2):(0.8 ~1.2), for example, 1:1:1:1.
[0027] Preferably, the balancing unit is adjusted in number using Synthetic Minority Oversampling Technique (SMOTE) to increase the number of samples of data such as "abnormal sinking" in real aquaculture, reduce the sample imbalance between different group images, and obtain a preprocessed training database with a balanced number of data of different group states, thereby improving the model's sensitivity to detecting abnormal states such as diseased fish and dead fish.
[0028] Furthermore, the state monitoring and quantity identification module is used to perform state monitoring and quantity identification on the sample to be tested based on the training database constructed by the preprocessing module. The state monitoring includes the health status and growth status of the sample to be tested (deep-sea farmed fish), and the quantity identification includes the individual quantity statistics and biomass assessment of the deep-sea farmed fish.
[0029] Preferably, the state monitoring and quantity recognition module includes a convolutional neural network model training unit and an SVM (Support Vector Machine) model training unit. The convolutional neural model training unit is used to train the convolutional network model based on the preprocessed data, state information, and quantity information of the training samples. The SVM model training unit is used to train the SVM model based on the preprocessed data, state information, and quantity information of the training samples.
[0030] Furthermore, the convolutional network model is used to predict the state classification category of the sample to be detected (e.g., deep-sea farmed fish) based on the preprocessed data (including image information) of the sample to be detected, and output the corresponding classification probability; The SVM model is used to perform regression prediction based on the preprocessed data, state classification category, and classification probability of the sample to be tested, so as to obtain the quantity statistics (i.e., quantity information) and biomass assessment results of the sample to be tested (e.g., deep-sea farmed fish).
[0031] Preferably, both the convolutional neural model training unit and the convolutional network model adopt a convolutional neural network architecture based on deep residual networks or multi-scale attention mechanisms. The convolutional neural network architecture includes a backbone feature extraction network module from low to high level, a dynamic multi-scale feature fusion module, and an attention enhancement module. The backbone feature extraction network module employs a deep residual network and / or a multi-scale attention mechanism.
[0032] The backbone feature extraction network module includes multiple Bottleneck residual blocks, each of which embeds a convolutional dynamically gated linear unit (CDGLU) for adaptive feature modulation. The dynamic multi-scale feature fusion module employs an intelligent cross-attention fusion module (ACAF) to effectively connect semantic features at different scales. The attention enhancement module employs a pooled channel spatial attention module (PCSA) to collaboratively utilize statistical pooling and grouped axial attention to enhance feature representations.
[0033] The state monitoring and quantity identification module also includes a global average pooling module and a Softmax classification output layer; The global average pooling module is a spatial feature dimensionality reduction and aggregation unit that connects the previous level module (such as the attention enhancement module or the dynamic multi-scale feature fusion module) with the Softmax classification output layer. The Softmax classification output layer is the decision classification unit located at the very end of the state monitoring and quantity recognition module, used to realize multi-objective probabilistic mapping and state discrimination.
[0034] The multi-scale images are image information preprocessed by the preprocessing module and then input into the state monitoring and quantity recognition module. The input of the multi-scale images employs a dual-branch parallel input strategy: small-scale and large-scale image patches are adjusted to 224 pixels × 224 pixels using bilinear interpolation, and then input into two parallel backbone feature extraction network modules. These two parallel backbone feature extraction network modules include small-scale and large-scale branches. The small-scale branch focuses on extracting local fine features of individual deep-sea farmed fish (including local features such as the fish's eye outline, gill cover edge, and scale texture), while the large-scale branch focuses on extracting the global distribution features of the fish school. The feature outputs of the two branches are fused through the intelligent cross-attention fusion module (ACAF) within the dynamic multi-scale feature fusion module to achieve an effective combination of local and global features. The fused features are further input to the attention enhancement module for feature enhancement; then input to the global average pooling module to aggregate into a one-dimensional global feature vector; finally, input to the Softmax classification output layer to calculate the classification category and probability.
[0035] The SVM model is obtained by training a Support Vector Machine (SVM) model training unit on a training dataset. Specifically, the state classification category and corresponding probability of the training samples output by the convolutional network model are used as prior feature data for each image and added to the training database to obtain an expanded database. The data in the expanded database is then used as the training set and input into the SVM model training unit. The features are mapped to a high-dimensional space using a radial basis function (RBF) for nonlinear quantitative regression training. The kernel function parameter γ = 1 / 2048 and the penalty coefficient C = 10 are used. The model parameters are dynamically adjusted based on the prediction error to finally obtain the SVM model.
[0036] According to an embodiment of the present invention, the data output module is used to output the state classification results, quantity statistics results, and biomass assessment results of deep-sea farmed fish predicted by the state monitoring and quantity identification module.
[0037] The present invention also provides a method for state monitoring and quantity identification based on the above system, comprising the following steps: Step 1: Use the image acquisition and storage module (specifically the image acquisition unit of the image acquisition and storage module) to acquire the image information, state information, and quantity information of the training samples, and acquire the image information of the samples to be detected; Step 2: Input the acquired image information into the preprocessing module for correction, noise reduction, and multi-scale feature space transformation. The preprocessing module further associates the image information with the corresponding state information and quantity information to form a training database. Step 3: Import the data from the training database into the state monitoring and quantity recognition module (specifically the convolutional neural network model training unit) for training to obtain the convolutional network model; Image information (including image information of training samples and samples to be detected) is input into the convolutional network model, and the state classification category and corresponding classification probability of the sample to be detected (i.e., deep-sea farmed fish) are output. Step 4: Use the image information, state classification categories, and corresponding classification probabilities of the training samples as training data for the SVM (Support Vector Machine) model. Import the training data of the SVM model into the SVM model training unit for training to obtain the SVM model. Step 5: Import the image information of the sample to be detected into the convolutional network model and the SVM model to obtain the predicted state classification results, quantity statistics results and biomass assessment results of the sample to be detected.
[0038] According to an embodiment of the present invention, in step 1, acquiring image information of the training samples, or acquiring image information of the samples to be detected, includes: using the switching circuit unit of the image acquisition unit to switch between different cameras and lighting devices, acquiring image data of the training samples and the samples to be detected at different spatial locations and under different lighting conditions, and storing them as pictures.
[0039] Preferably, the camera and lighting device have the definitions described above.
[0040] According to an embodiment of the present invention, before step 1, the following steps are further included: using the camera calibration module of the image acquisition unit to calibrate the camera system, estimate the camera intrinsic parameter matrix and lens distortion parameters, correct radial and tangential distortion, and ensure the geometric accuracy and scale consistency of the image.
[0041] According to an embodiment of the present invention, after step 1 and before step 2, the following step is further included: preprocessing the image information using a preprocessing module; The preprocessing includes the following steps: Step a: Use the preprocessing module to perform distortion correction and noise reduction on the image information, and crop out the actual detection area.
[0042] Step b: The image of the actual detection area in step a is subjected to color correction and contrast enhancement by the preprocessing unit of the preprocessing module, and scaled using bicubic interpolation to obtain image information of consistent size, for example, the size of the image information is 1200 pixels × 1200 pixels.
[0043] Step c: The image information obtained in step b is subjected to Gaussian filtering, median filtering, and fluid adaptive morphological filtering to remove noise and obtain preprocessed data.
[0044] Step d: The preprocessing unit classifies the image sharpness based on the Underwater Color Image Quality Assessment Index (UCIQE) and the Underwater Image Quality Measurement Index (UIQM), dividing the images into three levels: high resolution, medium resolution, and low resolution.
[0045] Step e: Perform multi-scale image processing to extract sub-images with different spatial spans to form multi-scale input image data: For example, a 100-pixel × 100-pixel local viewport is cropped from a high-resolution image. This viewport size (i.e., the local viewport size) corresponds to the scale of the eye, gill cover, and local lateral line of a single deep-sea farmed fish, and is specifically used to capture local fine biological features of deep-sea farmed fish individuals in high-density, crowded conditions, in order to separate and distinguish overlapping individuals with severe adhesion and occlusion. A global viewpoint is selected from the image information, consisting of a large-scale image patch of 1200 pixels × 1200 pixels. This viewpoint contains the complete local spatial perspective of the fish cage and is specifically designed to capture global features such as the overall spatial distribution density of the fish school and the center of gravity of the group. It is used to extract the overall features of the sample to be detected (such as deep-sea farmed fish), such as the fish outline and size.
[0046] According to an embodiment of the present invention, the preprocessing further includes the following step: increasing the number of minority group data in the preprocessed data, so that the ratio of image data information of the four group states—discrete swimming (normal state), high-density aggregation (feeding state), multi-outline dispersion (nighttime resting state), and abnormal bottom sinking (sick / dead fish state)—is within a balanced range of 1:(0.8~1.2):(0.8~1.2):(0.8~1.2). Preferably, the ratio of image data information of the four group states is precisely adjusted to 1:1:1:1.
[0047] According to an embodiment of the present invention, the step of increasing the number of minority class data in the preprocessed data is as follows: determining the number of each type of preprocessed data, using the synthetic minority class oversampling technique in the balancing unit to adjust the number of each type of preprocessed group state data, reducing the imbalance between different types of preprocessing, thereby increasing the sensitivity to the minority class.
[0048] Preferably, step 2 further includes the following steps: randomly dividing the training database into a training set, a validation set, and a test set, wherein the training set accounts for 60% to 80% of the total dataset, the validation set accounts for 10% to 30% of the total dataset, and the test set accounts for 10% to 30% of the total dataset (and the sum of the three percentages is 100%); preferably, the training set accounts for 70%, the validation set for 20%, and the test set for 10%.
[0049] According to an embodiment of the present invention, in step 3, the associated data input state monitoring and quantity recognition module (specifically a convolutional neural network model training unit) in the training database is trained to obtain a convolutional network model. The output layer of the convolutional network model outputs the output state classification category of the sample to be detected, as well as the probability corresponding to each classification category.
[0050] According to an embodiment of the present invention, in step 3, the specific steps for the convolutional neural model training unit to train and obtain the convolutional network model are as follows: Step 311: Input multi-scale images from the training database into the backbone feature extraction network module to extract local features (including local features such as the outline of the fish's eyes, the edge of the gill cover, and the texture of the fish scales) and global features (i.e., the overall morphology) of the sample to be detected in an underwater low-contrast environment (e.g., deep-sea farmed fish); the convolutional dynamic gating linear unit in the backbone feature extraction network module introduces group normalization and dynamic gating mechanisms to adaptively modulate the features of each residual block; Step 312: Input the local and global features into the intelligent cross-attention fusion module (ACAF) within the dynamic multi-scale feature fusion module to achieve effective interaction between shallow detail information and deep semantic information, improve the multi-scale feature expression capability, and achieve effective combination of local and global features; Step 313: Input the fused features into the attention enhancement module for feature enhancement, and use statistical pooling and grouped axial attention in a coordinated manner to enhance the feature representation in order to cope with underwater degradation; Step 314: After passing through the global average pooling module, the fused features are globally aggregated to obtain a one-dimensional global feature vector; Step 315: Input the one-dimensional global feature vector into the Softmax classification output layer. Use the Softmax layer to convert the one-dimensional global feature vector into the probability of each state classification category. The category with the largest response has the highest probability (i.e., the corresponding probability). The sum of the probabilities of all categories is equal to 1.
[0051] According to an embodiment of the present invention, in step 3, high-precision feature extraction and classification of small sample images are achieved by using multi-scale image input and combining it with a transfer learning mechanism, and by utilizing pre-trained weights. Specifically, the convolutional neural model training unit adopts a two-stage fine-tuning training strategy of freezing and unfreezing to obtain the convolutional network model, and the specific steps are as follows: (3a) The backbone feature extraction network freezes the training phase; the parameters of each convolutional layer of the backbone feature extraction network module are frozen (defined as untrainable state), preventing the gradient update of the pre-trained weights, and only the newly added classifier layer (specifically including the fully connected layer (FC layer) and the Softmax classification output layer) are defined as trainable state; the fully connected layer is a high-dimensional feature integration and nonlinear linear transformation unit located between the backbone feature extraction network module and the classification output layer (Softmax layer).
[0052] The training set data is input into the backbone feature extraction network module, and then flows sequentially through the backbone feature extraction network module, the dynamic multi-scale feature fusion module, the attention enhancement module, and the global average pooling module. The classifier layer calculates the loss and updates the classifier layer weights to complete the frozen training and obtain the frozen model.
[0053] (3b) Full-network unfreezing and fine-tuning training stage; Unfreeze each convolutional layer of the backbone feature extraction network module in the frozen model (redefine it as a trainable state), which is the unfrozen model; Input multi-scale image data from the training database into the unfrozen model, so that all network parameters, including the backbone feature extraction network module, dynamic multi-scale feature fusion module, attention enhancement module, global average pooling module, and classifier layers (FC layer and Softmax classification output layer), participate in gradient update and full-network fine-tuning training; After training converges, the convolutional network model is finally obtained.
[0054] According to an embodiment of the present invention, step 4 specifically includes the following steps: Step 41: Take the state classification category and corresponding classification probability of the training samples output by the convolutional network model in Step 3 as the prior feature data of each image and add them to the image data of the training database to obtain the expanded database. Step 42: Input the data from the extended database as the training set into the Support Vector Machine (SVM) model; given the distribution pattern of nonlinear occlusion of the underwater samples to be detected (deep-sea farmed fish), the SVM model uses the classification category and classification probability as input variables, and performs nonlinear quantitative regression training by mapping the features to a high-dimensional space through the radial basis function (RBF); based on the SVM model, predict the error value between the number of deep-sea farmed fish and the corresponding actual verification number in the extended database, dynamically adjust the parameters of the SVM model, and finally obtain an SVM model that can accurately invert the number of deep-sea farmed fish in a high-density overlapping underwater environment.
[0055] The present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the method described herein.
[0056] The present invention also provides an apparatus comprising the aforementioned storage medium and a processor, wherein the processor implements the method described above when executing a computer program on the storage medium.
[0057] The beneficial effects of this invention are: 1. This invention achieves timing gating control between the underwater lighting device and the camera by switching circuit units, and adopts an instantaneous flashing supplementary lighting strategy to eliminate the strong light stress and group disturbance caused by long-term continuous light source to deep-sea farmed fish.
[0058] 2. The system of this invention adopts a multi-scale feature extraction strategy with dual-branch parallel input, which breaks through the accuracy bottleneck of individual identification and quantity estimation under high-density occlusion environment.
[0059] 3. The system of the present invention achieves opto-isolation by switching circuit units. At the same time, through the cooperation of the camera calibration module and the timer, it has extremely high system security and spatiotemporal consistency, ensuring high consistency of multiple monitoring nodes in time series and geometric space.
[0060] 4. This invention embeds a convolutional dynamic gated linear unit inside the convolutional network, and uses group normalization and dynamic gating mechanisms to adaptively modulate the residual network features. Combined with the intelligent cross-attention fusion module (ACAF) and the pooled channel spatial attention module (PCSA), it achieves spatial alignment fusion of global coarse-grained semantics and local fine-grained contours, which significantly improves the network's feature representation ability and generalization robustness in harsh underwater imaging environments. Attached Figure Description
[0061] Figure 1 This is a schematic diagram of the structure of the present invention, which is based on spatial vision for state monitoring and quantity recognition. Figure 2 This is a circuit diagram of the switching circuit unit of the present invention; Figure 3 This is a schematic diagram of biometric identification provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of organism length prediction provided in an embodiment of the present invention.
[0062] Figure 2 In the diagram, D1 is a diode, DS1 is a lighting device, J1 is the first control interface, J2 is the second control interface, J3 is the third control interface, J4 is the fourth control interface, J5 is the fifth control interface, K1 is the first relay, K2 is the second relay, Q1 is a field-effect transistor, R1 is the first resistor, R2 is the second resistor, R3 is the third resistor, U1 is the first optocoupler, U3 is the third optocoupler, U2 is a multiplexer; a1 is pin a1 of the first relay K1; a2 is pin a2 of the first relay K1; a3 is pin a3 of the first relay K1; a4 is the first relay... Pin a4 of relay K1; pin b1 is pin b1 of first relay K2; pin b2 is pin b2 of first relay K2; pin b3 is pin b3 of first relay K2; pin b4 is pin b4 of first relay K2; pins 1-15 are the first, second, ... fifteenth pins of multiplexer U2, respectively; GND is the ground terminal; pins U1-1, U1-2, U1-3, and U1-4 are the pins of first optocoupler U1, respectively; pins U3-1, U3-2, U3-3, and U3-4 are the pins of third optocoupler U3, respectively; VCC, VCC2, and VCC3 are all power input terminals; Detailed Implementation
[0063] The technical solution of the present invention will be further described in detail below with reference to specific embodiments. It should be understood that the following embodiments are merely illustrative and explanatory of the present invention, and should not be construed as limiting the scope of protection of the present invention. All technologies implemented based on the above content of the present invention are covered within the scope of protection intended by the present invention.
[0064] Unless otherwise stated, the raw materials and reagents used in the following examples are commercially available products or can be prepared by known methods.
[0065] Example 1 A spatial vision-based state monitoring and quantity identification system is deployed in a deep-sea cage aquaculture environment for the state classification and quantity statistics of deep-sea farmed fish.
[0066] The system includes an image acquisition and storage module, a preprocessing module, a status monitoring and quantity recognition module, and a data output module.
[0067] The image acquisition and storage module includes an image acquisition unit and a data storage unit.
[0068] The image acquisition unit is deployed at multiple spatial points within a 23-meter-side square deep-sea cage, comprising four spatial monitoring nodes positioned at the upper (2-meter depth), middle (5-meter depth), lower (8-meter depth), and bottom (10-meter depth) levels of the cage. Each monitoring node includes one high-definition camera and one green LED light. The high-definition camera is an industrial-grade underwater camera equipped with a 1 / 1.3-inch CMOS sensor, supporting 4K resolution imaging at 30fps. The green LED light uses a high-power LED light source with a wavelength of 520nm and a luminous power of 50W, optimized for the visual sensitivity of deep-sea farmed fish.
[0069] The image acquisition unit also includes a switching circuit unit. This switching circuit unit is used to select different camera (i.e., underwater high-definition camera) and lighting device (e.g., a lighting lamp, i.e., a green LED light) channels, enabling time-series switching between the camera and the lighting device. The switching circuit has a response time of less than 1ms; an opto-isolation circuit is provided between the switching circuit and the space monitoring node to isolate instantaneous power surges in the high-humidity seawater environment.
[0070] like Figure 2 As shown, the switching circuit unit includes a diode D1, a lighting device DS1, a first control interface J1, a second control interface J2, a third control interface J3, a fourth control interface J4, a fifth control interface J5, a first relay K1, a second relay K2, a field-effect transistor Q1, a first resistor R1, a second resistor R2, a third resistor R3, a first optocoupler U1, a third optocoupler U3, and a multiplexer U2; The pin of the first control interface J1 is connected to pin a4 of the first relay K1; pins a1 and a3 of the first relay K1 are both connected to the ground terminal GND; pin a2 of the first relay K1 is connected to pin 13 of the multiplexer U2. The pins of the second control interface J2 are connected to pin b4 of the second relay K2; pins b1 and b3 of the second relay K2 are both connected to the ground terminal GND; pin b2 of the second relay K2 is connected to pin 3 of the multiplexer U2. The sixth pin (6) and seventh pin (7) of multiplexer U2 are both connected to ground (GND); the ninth pin (9) of multiplexer U2 is connected to the pin of the fifth control interface (J5); and the tenth pin (10) of multiplexer U2 is connected to the pin of the fourth control interface (J4). The twelfth pin 12 of the multiplexer U2 is connected to the pin U1-2 of the first optocoupler U1; the first pin 1 of the multiplexer U2 is connected to the pin U3-2 of the third optocoupler U3. Pin U1-1 of the first optocoupler U1 is connected to the power input terminal VCC; pin U1-3 of the first optocoupler U1 is connected to the first resistor R1; the other end of the first resistor R1 is connected to the second resistor R2, and together they are connected to the power input terminal VCC2; the other end of the second resistor R2 is connected to the resistive lighting device DS1, and the other end of the lighting device DS1 is connected to the cathode of diode D1 and pin Q1-1 of field-effect transistor Q1; the anode of diode D1 is connected to the third resistor R3 and pin Q1-3 of field-effect transistor Q1, and together they are connected to the ground terminal GND; pin 4 of the first optocoupler U1 is connected to the third resistor R3 and pin Q1-2 of field-effect transistor Q1. Pin U3-1 of the third optocoupler U3 is connected to the power input terminal VCC; pin U3-3 of the third optocoupler U3 is connected to the power input terminal VCC3; pin U3-4 of the third optocoupler U3 is connected to the pin of the third control interface J3.
[0071] Preferably, such as Figure 2 In the switching circuit unit shown, diode D1, lighting device DS1, field-effect transistor Q1, first resistor R1, second resistor R2, third resistor R3, and first optocoupler U1 together constitute module M1. Module M1 serves as the isolation drive and power switching unit for the lighting device. The first optocoupler U1 is used to isolate high and low voltage circuits, and the field-effect transistor Q1 is used to respond to signals to drive the switching of lighting device DS1. The number of M1 modules is configured according to the actual number of lighting devices deployed. For example, when the system is configured with 4 lighting devices, the 4 selection output pins of multiplexer U2 (such as pin 12, pin 14, pin 15, and pin 11) are respectively connected to the input terminals (i.e., pins U1-2) of the first optocouplers U1 of 4 independent M1 modules to achieve independent time-division multiplexing and driving of the 4 spatial monitoring node lighting devices (DS1). For example, in the second M1 module, pin U1-2 of the first optocoupler U1 is connected as a control pin to pin 14 of the multiplexer U2; in the third M1 module, pin U1-2 of the first optocoupler U1 is connected as a control pin to pin 15 of the multiplexer U2; and in the fourth M1 module, pin U1-2 of the first optocoupler U1 is connected as a control pin to pin 11 of the multiplexer U2.
[0072] Preferably, the third control interface J3 and the third optocoupler U3 together constitute the M2 module, which serves as a camera hard trigger isolation unit. The third optocoupler U3 is used to achieve electrical isolation between the control terminal and the underwater camera trigger power supply terminal, preventing underwater ground loop interference and surge backflow. The number of M2 modules is configured according to the actual number of cameras deployed. When the system is configured with 4 cameras, the 4 gate output pins of the multiplexer U2 (e.g., first pin 1, fifth pin 5, sixth pin 2, and fourth pin 4) are respectively connected to the input terminals (i.e., pin U3-2) of the third optocouplers U3 of the 4 independent M2 modules to achieve independent trigger control of the 4 cameras. When the number of cameras continues to increase, multiple cameras can be selected and controlled by cascading multiplexer chips.
[0073] The switching circuit unit controls the underwater lighting to turn on 50 milliseconds before the underwater camera starts acquiring images and turn off 30 milliseconds after image acquisition ends, implementing instantaneous flashing supplemental lighting to eliminate the stress response and group disturbance caused by long-term continuous underwater light sources to deep-sea farmed fish.
[0074] The first control interface J1 and the second control interface J2 are used to control the switching of the camera and the lighting device, respectively. The fourth control interface J4 and the fifth control interface J5 are used to select different camera and lighting device channels. The fourth control interface J4 and the fifth control interface J5 are respectively input to the first address selection terminal (i.e., pin 10) and the second address selection terminal (i.e., pin 9) of the multiplexer U2. By using different high and low level combinations (logic "0" or logic "1") of the fourth control interface J4 and the fifth control interface J5, a 2-bit binary address decoding is achieved, thereby accurately selecting four independent camera and underwater lighting device channel groups.
[0075] The image acquisition unit also includes a timer for recording the time information of each image acquisition, realizing the acquisition of time-series images, and performing reference time alignment and storage.
[0076] The image acquisition unit also includes a camera calibration module, which uses an underwater optical flow distortion matrix to correct the deflection distortion caused by the multi-medium of seawater-quartz window-air. The camera system is calibrated using the Zhang Zhengyou checkerboard calibration method, with each grid being 30mm in size. The camera intrinsic parameter matrix and lens distortion parameters are estimated, and radial and tangential distortions are corrected to ensure the geometric accuracy and scale consistency of the image.
[0077] The preprocessing module includes a preprocessing unit, a classification unit, and a balancing unit.
[0078] The preprocessing unit is used to adjust the format of the image information to be the same, perform color correction and contrast enhancement on the acquired 4K resolution image, and scale it to a 1200 pixel × 1200 pixel image using bicubic interpolation. A preprocessing unit is used to perform distortion correction and denoising on the image. Distortion correction includes correcting lens distortion and cropping out the actual detection area. Denoising includes Gaussian filtering of the image using a 5×5 Gaussian kernel and median filtering using a 3×3 pixel window. For dynamic scattering noise generated by suspended particles, bubbles, and microalgae in seawater, a fluid adaptive morphological filter is used. The binary image is dilated three times using a 5×5 diamond pixel window, followed by three erosion operations using a 3×3 square pixel window. The preprocessing unit classifies the image sharpness based on the Underwater Color Image Quality Assessment Index (UCIQE) and the Underwater Image Quality Measurement Index (UIQM), dividing the image into three levels: high sharpness (UCIQE≥0.6), medium sharpness (0.3≤UCIQE<0.6), and low sharpness (UCIQE<0.3).
[0079] The classification unit is used to classify the population size of deep-sea farmed fish based on the aggregation characteristics of the population in the image after processing by the preprocessing unit. The population size is divided into four categories: discrete swimming (normal state), high-density aggregation (feeding state), multi-outline dispersion (nighttime resting state), and abnormal bottom sinking (sick / dead fish state).
[0080] The balancing unit is used to adjust the amount of image data information of different population categories to a balanced state. The balancing unit increases the number of minority class data such as "abnormal bottoming" and "multi-profile dispersion" that rarely occur in actual aquaculture by synthesizing minority class oversampling technology (SMOTE), and adjusts the amount of image data information of the four population categories to 1:1:1:1, thereby reducing the sample imbalance between images of different population categories.
[0081] The state monitoring and quantity recognition module includes a convolutional neural network model training unit and an SVM model training unit.
[0082] The training unit and convolutional network model of the convolutional neural network both adopt a convolutional neural network architecture based on deep residual networks or multi-scale attention mechanisms. The convolutional neural network architecture includes a backbone feature extraction network module (ResNet-50) from low level to high level, a dynamic multi-scale feature fusion module, and an attention enhancement module. The backbone feature extraction network module employs a deep residual network and / or a multi-scale attention mechanism.
[0083] The backbone feature extraction network module includes multiple Bottleneck residual blocks, each of which embeds a convolutional dynamically gated linear unit (CDGLU) for adaptive feature modulation. The dynamic multi-scale feature fusion module employs an intelligent cross-attention fusion module (ACAF) to effectively connect semantic features at different scales. The attention enhancement module employs a pooled channel spatial attention module (PCSA) to collaboratively utilize statistical pooling and grouped axial attention to enhance feature representations.
[0084] The state monitoring and quantity identification module also includes a global average pooling module and a Softmax classification output layer; The global average pooling module is the spatial feature dimensionality reduction and aggregation unit of the previous module (i.e., the attention enhancement module or the dynamic multi-scale feature fusion module) and the Softmax classification output layer; The Softmax classification output layer is a decision classification unit located at the end of the network, used to implement multi-objective probabilistic mapping and state discrimination.
[0085] The multi-scale images are image information preprocessed by a preprocessing module and used as input to the state monitoring and quantity recognition module. The input of the multi-scale images employs a dual-branch parallel input strategy: small-scale and large-scale image patches are adjusted to 224 pixels × 224 pixels using bilinear interpolation, and then input into two parallel backbone feature extraction network modules (ResNet-50). These two parallel backbone feature extraction network modules (ResNet-50) include small-scale and large-scale branches. The small-scale branch focuses on extracting local fine features of individual deep-sea farmed fish (including local features such as the fish's eye outline, gill cover edge, and scale texture), while the large-scale branch focuses on extracting the global distribution features of the fish school. The feature outputs of the two branches are fused through an intelligent cross-attention fusion module (ACAF) within the dynamic multi-scale feature fusion module to achieve an effective combination of local and global features. The fused features are further input to an attention enhancement module for feature enhancement; then input to a global average pooling module to aggregate into a one-dimensional global feature vector; finally, input to the Softmax classification output layer to calculate the classification category and its corresponding probability.
[0086] The SVM model is used to perform regression prediction based on the preprocessed data, state classification categories, and classification probabilities of the samples to be detected, to obtain the quantity statistics and biomass assessment results of deep-sea farmed fish. The SVM model is obtained by training a Support Vector Machine (SVM) model training unit on a training dataset. Specifically, the state classification categories and corresponding probabilities of the training samples output by the convolutional network model are used as prior feature data for each image and added to the training database to obtain an expanded database. The data in the expanded database is then used as the training set and input into the SVM model training unit. The features are mapped to a high-dimensional space using a radial basis function (RBF) for nonlinear quantitative regression training. The kernel function parameter γ = 1 / 2048, and the penalty coefficient C = 10. The model parameters are dynamically adjusted based on the prediction error to finally obtain the SVM model.
[0087] The data output module is used to output the status classification results, quantity statistics results, and biomass assessment results of deep-sea farmed fish predicted by the status monitoring and quantity identification module.
[0088] Example 2 This embodiment provides a status monitoring and quantity identification method based on the above system, including the following steps: Step 1: Before image acquisition, the camera system is calibrated using the camera calibration module of the image acquisition unit to estimate the camera intrinsic parameter matrix and lens distortion parameters, correct radial and tangential distortion, and ensure the geometric accuracy and scale consistency of the image.
[0089] Step 2: Using the image acquisition unit of the image acquisition and storage module, image information, status information, and quantity information of the training samples are acquired, as well as image information of the samples to be tested. A switching circuit unit is used to switch between different camera and lighting combinations to acquire image data of the training samples and samples to be tested under different spatial positions and lighting conditions, and store them as images. The image acquisition parameters are set as follows: ISO 100-200, shutter speed 1 / 250-1 / 500s, aperture F2.8.
[0090] Step 3: Input the image information acquired in Step 2 into the preprocessing module and perform the following preprocessing procedure; Step a: Correct the underwater refraction distortion of the lens of the multi-channel underwater camera and crop out the actual detection area; Step b: The image of the actual detection area in step a is subjected to color correction and contrast enhancement by the preprocessing unit of the preprocessing module, and scaled using bicubic interpolation to obtain image information of consistent size, for example, the size of the image information is 1200 pixels × 1200 pixels.
[0091] Step c: The image information obtained in step b is subjected to Gaussian filtering, median filtering, and fluid adaptive morphological filtering to remove noise and obtain preprocessed data.
[0092] Step d: The preprocessing unit classifies the image sharpness based on the Underwater Color Image Quality Assessment Index (UCIQE) and the Underwater Image Quality Measurement Index (UIQM), dividing the images into three levels: high resolution, medium resolution, and low resolution.
[0093] Step e: Image sharpness is classified using UCIQE and UIQM, resulting in three levels: high-resolution, medium-resolution, and low-resolution. Sub-images with different spatial spans are extracted to form multi-scale input image data. A 100-pixel × 100-pixel local viewport is cropped from the high-resolution image. This viewport size corresponds to the scale of the eye, gill cover, and local lateral line of a single deep-sea farmed fish, specifically designed to capture the fine local biological features of deep-sea farmed fish individuals under high-density crowding conditions, in order to separate and distinguish overlapping individuals with severe adhesion and occlusion. A global viewpoint of a large-scale image patch of 1200 pixels × 1200 pixels is selected from the image information. It contains the complete local spatial view of the fish cage and is specifically used to capture the overall spatial distribution density relationship of the fish school and global features such as the center of gravity of the group. It is used to extract the overall features of deep-sea farmed fish, such as the fish outline and body size.
[0094] Step 4: Using the balancing unit of the preprocessing module, increase the amount of minority class data in the preprocessed data until the data volume of all classes is balanced. Use SMOTE to artificially synthesize and replicate minority class image data, ensuring that the data volume ratio of all classes is 1:1.
[0095] Step 5: Randomly divide the training database into training set, validation set and test set in a ratio of 7:2:1.
[0096] Step 6: Import the image information, state information, and quantity information into the state monitoring and quantity recognition module (specifically, the convolutional neural network model training unit) for training to obtain the convolutional network model. The specific steps are as follows: Step 61: Extract two types of sub-images with different spatial spans (i.e., small-scale image patches and large-scale image patches) from the image data of the training set in the training database to form a multi-scale image, which is used as the input data for the state monitoring and quantity recognition module. The small-scale image patch is 100 pixels × 100 pixels, and the large-scale image patch is 1200 pixels × 1200 pixels. Use bilinear interpolation to adjust the image patches of different scales to 224 pixels × 224 pixels. Use a dual-branch parallel input strategy to input the images into two parallel backbone feature extraction network modules (ResNet-50). Step 62: After the image data extracts low-level (i.e., local features) and high-level (i.e., global features) features in the backbone feature extraction network module (ResNet-50), it is input into the dynamic multi-scale feature fusion module (specifically the intelligent cross-attention fusion module (ACAF)) to complete the interactive fusion of local features and global features. The fused features are further input into the attention enhancement module for feature enhancement, and statistical pooling and grouped axial attention are used in synergy to enhance feature representation in order to cope with underwater degradation. The input is then fed into the global average pooling module to aggregate into a one-dimensional global feature vector; finally, it is fed into the Softmax classification output layer, where the Softmax layer converts the one-dimensional global feature vector into the probability of each state's classification category, and calculates the classification category and its corresponding classification probability. Step 63: Freeze the training phase of the backbone feature extraction network; freeze the parameters of each convolutional layer of the backbone feature extraction network module (defined as untrainable state), prevent gradient updates of pre-trained weights, and define only the newly added classifier layer (specifically including the fully connected layer (FC layer) and the Softmax classification output layer) as trainable state, and train only the weights of the new classifier layer; the fully connected layer is a high-dimensional feature integration and nonlinear linear transformation unit located between the backbone feature extraction network module and the classification output layer (Softmax layer).
[0097] The training data is input into the network and flows sequentially through the backbone feature extraction network module, the dynamic multi-scale feature fusion module, the attention enhancement module, and the global average pooling module. The classifier layer then calculates the loss and updates the classifier layer weights, completing the frozen training and obtaining the frozen model. During the frozen training phase, the gradients of the two branches are used to update the parameters. Transfer learning is used for 10 epochs of frozen training with a batch size of 32 and a learning rate of 1e-3. Step 64: Full-network unfreezing and fine-tuning training phase; Unfreeze each convolutional layer of the backbone feature extraction network module in the frozen model (redefine it to a trainable state), which is the unfrozen model; Input multi-scale image data from the training database into the model, so that all network parameters, including the backbone feature extraction network module, dynamic multi-scale feature fusion module, attention enhancement module, global average pooling module, and classifier layers (FC layer and Softmax classification output layer), participate in gradient update and full-network fine-tuning training; Perform full-network fine-tuning training for 30 epochs, with a batch size of 16 and a learning rate of 1e-4, and finally obtain the convolutional network model.
[0098] Step 7: Add the state classification categories and corresponding classification probabilities of the training samples output by the convolutional network model to the training database. This database will then be used as the training dataset for the support vector machine (SVM) model, resulting in the SVM model. Specifically: Step 71: The state classification category and corresponding classification probability of the training samples output by the convolutional network model are used as the prior feature data of each image and added to the training database to obtain the expanded database; Step 72: Input the data from the extended database as the training set into the SVM (Support Vector Machine) model training unit. Given the distribution pattern of nonlinear occlusion of deep-sea aquaculture fish, the Support Vector Machine (SVM) model uses classification category and classification probability as input variables. The features are mapped to a high-dimensional space through the radial basis function (RBF) for nonlinear quantitative regression training. The kernel function parameter γ=1 / 2048 and the penalty coefficient C=10 are used. The model parameters are dynamically adjusted according to the prediction error to finally obtain the SVM model.
[0099] Step 8: Import the image information of the sample to be detected into the convolutional network model and the SVM model to obtain the predicted state classification results, quantity statistics results and biomass assessment results output by the data output module. Figure 3 and Figure 4 These are schematic diagrams for biometric identification and biological length prediction, respectively.
[0100] The embodiments of the present invention have been described above by way of example. However, the scope of protection of the present invention is not limited to the above embodiments. Any modifications, equivalent substitutions, improvements, etc., made by those skilled in the art within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A state monitoring and quantity recognition system based on spatial vision, characterized in that, The system includes an image acquisition and storage module, a preprocessing module, a status monitoring and quantity recognition module, and a data output module connected in sequence.
2. The system according to claim 1, characterized in that, The image acquisition and storage module includes an image acquisition unit and a data storage unit. The image acquisition unit is located at multiple spatial points of the acquisition point and is used to acquire image information, state information, and quantity information of training samples, and image information of samples to be tested. Preferably, the image information includes photographs of deep-sea farmed fish at different spatial locations and under different lighting conditions, and the image information is in image format. The data storage unit is used to store image information, status information, and quantity information acquired by the image acquisition unit. The image acquisition unit includes a switching circuit unit, at least two cameras, and at least two lighting devices. The switching circuit unit is used to switch between different combinations of cameras and lighting devices to achieve image acquisition under different spatial positions and lighting conditions.
3. The system according to claim 1, characterized in that, The switching circuit unit includes a diode (D1), a lighting device (DS1), a first control interface (J1), a second control interface (J2), a third control interface (J3), a fourth control interface (J4), a fifth control interface (J5), a first relay (K1), a second relay (K2), a field-effect transistor (Q1), a first resistor (R1), a second resistor (R2), a third resistor (R3), a first optocoupler (U1), a third optocoupler (U3), and a multiplexer (U2). The pins of the first control interface (J1) are connected to the a4 pin (a4) of the first relay (K1); the a1 pin (a1) and the a3 pin (a3) of the first relay (K1) are both connected to the ground terminal (GND); the a2 pin (a2) of the first relay (K1) is connected to the thirteenth pin (13) of the multiplexer (U2); The pins of the second control interface (J2) are connected to the b4 pin (b4) of the second relay (K2); the b1 pin (b1) and the b3 pin (b3) of the second relay (K2) are both connected to the ground terminal (GND); the b2 pin (b2) of the second relay (K2) is connected to the third pin (3) of the multiplexer (U2); The sixth pin (6) and the seventh pin (7) of the multiplexer (U2) are both connected to the ground terminal (GND); the ninth pin (9) of the multiplexer (U2) is connected to the pin of the fifth control interface (J5); the tenth pin (10) of the multiplexer (U2) is connected to the pin of the fourth control interface (J4); The twelfth pin (12) of the multiplexer (U2) is connected to the pin (U1-2) of the first optocoupler (U1); the first pin (1) of the multiplexer (U2) is connected to the pin (U3-2) of the third optocoupler (U3); The first optocoupler (U1) has its pin (U1-1) connected to the power input terminal (VCC); the first optocoupler (U1) has its pin (U1-3) connected to the first resistor (R1); the other end of the first resistor (R1) is connected to the second resistor (R2), and together they are connected to the power input terminal (VCC2); the other end of the second resistor (R2) is connected to the resistive lighting device (DS1), and the other end of the lighting device (DS1) is connected to the negative terminal of the diode (D1) and the pin (Q1-1) of the field-effect transistor (Q1); the positive terminal of the diode (D1) is connected to the third resistor (R3) and the pin (Q1-3) of the field-effect transistor (Q1), and together they are connected to the ground terminal (GND); the first optocoupler (U1) has its pin (U1-4) connected to the third resistor (R3) and the pin (Q1-2) of the field-effect transistor (Q1); The pin (U3-1) of the third optocoupler (U3) is connected to the power input terminal (VCC); the pin (U3-3) of the third optocoupler (U3) is connected to the power input terminal (VCC3); the pin (U3-4) of the third optocoupler (U3) is connected to the pin of the third control interface (J3). Preferably, the switching circuit unit is used to select different camera and lighting device channels to realize the timing switching of the camera and lighting device. Preferably, the image acquisition unit further includes a timer, which is used to record the time information of each image acquisition, realize the acquisition of time-series images, and perform reference time alignment and storage. Preferably, the image acquisition unit further includes a camera calibration module, which is used to calibrate the camera system, estimate the camera intrinsic parameter matrix and lens distortion parameters, correct radial and tangential distortion, and ensure the geometric accuracy and scale consistency of the image.
4. The system according to claim 1, characterized in that, The preprocessing module is used to preprocess image information, including distortion correction, multi-scale feature space transformation and denoising, to obtain preprocessed data. Furthermore, the multi-scale feature space transformation includes resampling and cropping the image information at different resolutions to construct a multi-scale image containing global and local features. Preferably, the preprocessing module is further configured to associate the preprocessing information of all training samples with the corresponding state information and quantity information to form a training database, and randomly divide the training database into a training set, a validation set and a test set. The training set accounts for 60% to 80% of the total dataset (i.e., including the training set, validation set and test set), the validation set accounts for 10% to 30% of the total dataset, and the test set accounts for 10% to 30% of the total dataset, and the sum of the three percentages is 100%.
5. The system according to claim 1, characterized in that, The preprocessing module includes a preprocessing unit, a classification unit, and a balancing unit; The preprocessing unit is used to adjust the format of the image information to be the same, preferably to perform color correction and contrast enhancement on the image information, and preferably to use bicubic interpolation scaling to obtain images of the same size. Preferably, the preprocessing unit is also used to perform distortion correction and noise reduction on the image. The distortion correction includes correcting lens distortion and cropping out the actual detection area. The denoising process includes Gaussian filtering and median filtering of the image information. Preferably, a fluid adaptive morphological filter is used to filter and denoise the dynamic scattering noise generated by suspended particles, bubbles, and microalgae in seawater to obtain preprocessed data. Preferably, the denoising process includes Gaussian filtering of the image using a 5×5 Gaussian kernel and median filtering using a 3×3 pixel window; for the dynamic scattering noise generated by suspended particles, bubbles, and microalgae in seawater, a fluid adaptive morphological filter is used, and the binary image is dilated three times using a 5×5 diamond pixel window, followed by three erosion operations using a 3×3 square pixel window. Preferably, the preprocessing unit is also used for underwater image quality assessment. Preferably, the image sharpness is classified based on underwater color image quality assessment indicators and underwater image quality measurement indicators, and the images are divided into three levels: high sharpness (UCIQE≥0.6), medium sharpness (0.3≤UCIQE<0.6), and low sharpness (UCIQE<0.3). Preferably, the classification unit is used to classify the number of population states in the data information processed by the preprocessing unit based on the aggregation characteristics of the population states of the samples to be detected in the image. The population states include: discrete movement, high-density aggregation, multi-contour dispersion, and anomalous bottoming. Preferably, the balancing unit is used to adjust the amount of image data information of different group states to a balance, and the amount of image data information of the four group states is adjusted by an algorithm to 1:(0.8 ~1.2):(0.8 ~1.2):(0.8 ~1.2). Preferably, the balancing unit adjusts its quantity using synthetic minority oversampling technology to increase the number of samples of "abnormal bottoming" data in real aquaculture, reduce sample imbalance between different group images, and obtain a preprocessed training database with a balanced number of data from different group states, thereby improving the model's sensitivity to detecting abnormal states such as diseased fish and dead fish.
6. The system according to claim 1, characterized in that, The state monitoring and quantity identification module is used to perform state monitoring and quantity identification on the samples to be tested based on the training database constructed by the preprocessing module. The state monitoring includes the health status and growth status of the samples to be tested, and the quantity identification includes the individual quantity statistics and biomass assessment of deep-sea farmed fish. Preferably, the state monitoring and quantity recognition module includes a convolutional neural network model training unit and a support vector machine model training unit. The convolutional neural model training unit is used to train the convolutional network model based on the preprocessed data, state information, and quantity information of the training samples. The SVM model training unit is used to train the SVM model based on the preprocessed data, state information, and quantity information of the training samples. Furthermore, the convolutional network model is used to predict the state classification category of the sample to be detected based on the preprocessed data of the sample to be detected, and output the corresponding classification probability; The SVM model is used to perform regression prediction based on the preprocessed data, state classification category, and classification probability of the sample to be tested, so as to obtain the statistical results of the number of samples to be tested and the biomass assessment results. Preferably, both the convolutional neural model training unit and the convolutional network model adopt a convolutional neural network architecture based on deep residual networks or multi-scale attention mechanisms. The convolutional neural network architecture includes a backbone feature extraction network module from low to high level, a dynamic multi-scale feature fusion module, and an attention enhancement module. The backbone feature extraction network module employs a deep residual network and / or a multi-scale attention mechanism. The backbone feature extraction network module includes multiple Bottleneck residual blocks, each of which embeds a convolutional dynamically gated linear unit for adaptive feature modulation. The dynamic multi-scale feature fusion module adopts the intelligent cross-attention fusion module ACAF to effectively connect semantic features at different scales. The attention enhancement module employs the pooled channel spatial attention module PCSA, which is used to collaboratively utilize statistical pooling and grouped axial attention to enhance feature representation. The state monitoring and quantity identification module also includes a global average pooling module and a Softmax classification output layer; The global average pooling module is a spatial feature dimensionality reduction and aggregation unit that connects the previous level module (such as the attention enhancement module or the dynamic multi-scale feature fusion module) with the Softmax classification output layer. The Softmax classification output layer is the decision classification unit located at the very end of the state monitoring and quantity recognition module, used to realize multi-objective probabilistic mapping and state discrimination. The multi-scale images are image information preprocessed by the preprocessing module and input into the state monitoring and quantity recognition module. The input of the multi-scale images adopts a dual-branch parallel input strategy: small-scale image patches and large-scale image patches are adjusted to 224 pixels × 224 pixels by bilinear interpolation and then input into two parallel backbone feature extraction network modules, which include small-scale branches and large-scale branches. The small-scale branch focuses on extracting local features of individual deep-sea farmed fish (including local features such as the outline of the fish's eyes, the edge of the gill cover, and the texture of the fish scales), while the large-scale branch focuses on extracting global features of the fish school. The feature outputs of the two branches are fused through the intelligent cross-attention fusion module (ACAF) in the dynamic multi-scale feature fusion module to achieve an effective combination of local and global features. The fused features are further input into the attention enhancement module for feature enhancement. Then, they are input into the global average pooling module to aggregate into a one-dimensional global feature vector. Finally, they are input into the Softmax classification output layer to calculate the classification category and probability. The SVM model is obtained by training a support vector machine model training unit based on a training dataset. Specifically, the state classification category and corresponding probability of the training samples output by the convolutional network model are used as prior feature data for each image and added to the training database to obtain an expanded database. The data in the expanded database is then used as the training set and input into the SVM model training unit. The features are mapped to a high-dimensional space using a radial basis function (RBF) for nonlinear quantitative regression training. The kernel function parameter γ = 1 / 2048 and the penalty coefficient C = 10 are used. The model parameters are dynamically adjusted based on the prediction error to finally obtain the SVM model. Preferably, the data output module is used to output the state classification results, quantity statistics results, and biomass assessment results of deep-sea farmed fish predicted by the state monitoring and quantity identification module.
7. A method for state monitoring and quantity identification of the system according to any one of claims 1-6, comprising the following steps: Step 1: Use the image acquisition and storage module (specifically the image acquisition unit of the image acquisition and storage module) to acquire the image information, state information, and quantity information of the training samples, and acquire the image information of the samples to be detected; Step 2: Input the acquired image information into the preprocessing module for correction, noise reduction, and multi-scale feature space transformation. The preprocessing module further associates the image information with the corresponding state information and quantity information to form a training database. Step 3: Import the data from the training database into the state monitoring and quantity recognition module for training to obtain the convolutional network model; Input image information into the convolutional network model, and output the state classification category and corresponding classification probability of the sample to be detected. Step 4: Use the image information, state classification categories, and corresponding classification probabilities of the training samples as training data for the Support Vector Machine (SVM) model. Import the training data into the SVM model training unit for training to obtain the SVM model. Step 5: Import the image information of the sample to be detected into the convolutional network model and the SVM model to obtain the predicted state classification results, quantity statistics results and biomass assessment results of the sample to be detected. Preferably, after step 1 and before step 2, the following step is further included: preprocessing the image information using a preprocessing module; the preprocessing includes the following steps: Step a: Use the preprocessing module to perform distortion correction and noise reduction on the image information, and crop out the actual detection area; Step b: The image of the actual detection area in step a is subjected to color correction and contrast enhancement by the preprocessing unit of the preprocessing module, and scaled using bicubic interpolation to obtain image information of consistent size; Step c: The image information obtained in step b is subjected to Gaussian filtering, median filtering, and fluid adaptive morphological filtering to remove noise and obtain preprocessed data. Step d: The preprocessing unit classifies the image sharpness based on the underwater color image quality assessment index and the underwater image quality measurement index, and divides the images into three levels: high resolution, medium resolution and low resolution. Step e: Perform multi-scale image processing to extract sub-images with different spatial spans to form multi-scale input image data. Preferably, the preprocessing further includes the following steps: increasing the number of minority group data in the preprocessed data so that the ratio of the number of image data information of the four group states—discrete swimming (normal state), high-density aggregation (feeding state), multi-outline dispersion (night resting state), and abnormal bottom sinking (sick fish / dead fish state)—is within a balanced range of 1:(0.8~1.2):(0.8~1.2):(0.8~1.2). Preferably, the step of increasing the number of minority class data in the preprocessed data is as follows: determine the number of each type of preprocessed data, use the synthetic minority class oversampling technique in the balancing unit to adjust the number of each type of preprocessed group state data, reduce the imbalance between different types of preprocessing, and thus increase the sensitivity to the minority class. Preferably, step 2 further includes the following steps: randomly dividing the training database into a training set, a validation set, and a test set, wherein the training set accounts for 60% to 80% of the total dataset, the validation set accounts for 10% to 30% of the total dataset, and the test set accounts for 10% to 30% of the total dataset, and the sum of the three percentages is 100%.
8. The method according to claim 7, characterized in that, In step 3, the associated data in the training database is input into the state monitoring and quantity recognition module for training to obtain a convolutional network model. The output layer of the convolutional network model outputs the output state classification category of the sample to be detected, as well as the probability corresponding to each classification category. Preferably, in step 3, the specific steps for training the convolutional neural model training unit to obtain the convolutional network model are as follows: Step 311: Input multi-scale images from the training database into the backbone feature extraction network module to extract local features (including the outline of the fish's eyes, the edge of the gill cover, and the texture of the fish scales) and global features (i.e., the overall morphology) of the sample to be detected in the underwater low-contrast environment; the convolutional dynamic gating linear unit in the backbone feature extraction network module introduces group normalization and dynamic gating mechanism to adaptively modulate the features of each residual block; Step 312: Input the local features and global features into the intelligent cross-attention fusion module within the dynamic multi-scale feature fusion module to achieve effective interaction between shallow detail information and deep semantic information, improve the multi-scale feature expression capability, and achieve effective combination of local features and global features; Step 313: Input the fused features into the attention enhancement module for feature enhancement, and use statistical pooling and grouped axial attention in a coordinated manner to enhance the feature representation in order to cope with underwater degradation; Step 314: After passing through the global average pooling module, the fused features are globally aggregated to obtain a one-dimensional global feature vector; Step 315: Input the one-dimensional global feature vector into the Softmax classification output layer. Use the Softmax layer to convert the one-dimensional global feature vector into the probability of each state classification category. The category with the largest response has the highest probability, and the sum of the probabilities of all categories is equal to 1. Preferably, in step 3, high-precision feature extraction and classification of small sample images are achieved by using multi-scale image input and combining it with a transfer learning mechanism, and utilizing pre-trained weights. Specifically, the convolutional neural model training unit adopts a two-stage fine-tuning training strategy of freezing and unfreezing to obtain the convolutional network model, and its specific steps are as follows: (3a) Backbone feature extraction network frozen training phase; the parameters of each convolutional layer of the backbone feature extraction network module are frozen and defined as untrainable state, preventing gradient updates of pre-trained weights, and only the newly added classifier layer (specifically including fully connected layer (FC layer) and Softmax classification output layer) is defined as trainable state; the fully connected layer is a high-dimensional feature integration and nonlinear linear transformation unit located between the backbone feature extraction network module and the classification output layer (Softmax layer). The training set data is input into the backbone feature extraction network module, and then flows sequentially through the backbone feature extraction network module, the dynamic multi-scale feature fusion module, the attention enhancement module, and the global average pooling module. The classifier layer calculates the loss and updates the classifier layer weights to complete the frozen training and obtain the frozen model. (3b) Full-network unfreezing and fine-tuning training stage; Unfreeze each convolutional layer of the backbone feature extraction network module in the frozen model and redefine it as a trainable state, which is the unfrozen model; Input multi-scale image data from the training database into the unfrozen model so that all network parameters, including the backbone feature extraction network module, dynamic multi-scale feature fusion module, attention enhancement module, global average pooling module and classifier layer, participate in gradient update and full-network fine-tuning training; After training converges, the convolutional network model is finally obtained. Preferably, step 4 specifically includes the following steps: Step 41: Take the state classification category and corresponding classification probability of the training samples output by the convolutional network model in Step 3 as the prior feature data of each image and add them to the image data of the training database to obtain the expanded database. Step 42: Input the data from the extended database as the training set into the support vector machine model; given the distribution pattern of nonlinear occlusion of underwater samples to be detected, the support vector machine model uses the classification category and classification probability as input variables, and performs nonlinear quantitative regression training by mapping the features to a high-dimensional space through the radial basis kernel function; based on the support vector machine model, predict the error value between the number of deep-sea farmed fish and the corresponding actual verification number in the extended database, dynamically adjust the support vector machine model parameters, and finally obtain an SVM model that can accurately invert the number of deep-sea farmed fish in a high-density overlapping underwater environment.
9. A computer-readable storage medium storing a computer program that, when executed by a processor, implements the method of claim 7 or 8.
10. An apparatus comprising the storage medium and a processor, wherein the processor implements the method of claim 7 or 8 when executing a computer program on the storage medium.