ANS-based aquaculture dynamic water quality monitoring method and system
By combining artificial neural networks and long-term memory networks in aquaculture, a dynamic water quality monitoring model is constructed, which solves the problem that traditional water quality monitoring methods cannot predict water quality changes in a timely and accurate manner, and achieves high-precision water quality prediction and rapid response.
Patent Information
- Application Number
- CN202411277720.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-12
- Publication Date
- 2025-03-14
AI Technical Summary
In aquaculture, traditional water quality monitoring methods cannot grasp the trend of water quality changes in a timely and accurate manner, and it is difficult to accurately predict water quality parameters, which affects the growth and development of farmed fish.
Artificial neural network (ANN) and long-term memory network (LSTM) are used to fusion to construct a dynamic water quality monitoring model and combine water quality time characteristics to predict water quality. This model extracts different frequency components of the time series through wavelet transformation, uses the LSTM layer to extract the correlation features, and uses a hybrid kernel function to perform high-dimensional mapping and dimensionality reduction.
It realizes high-precision prediction of water quality parameters, significantly improves data processing speed and system response speed, can respond to water quality changes in time, and solves the problems of fixed detection and data changes in traditional monitoring methods that are difficult to predict.
Smart Images

Figure CN119623680A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of aquaculture water quality monitoring, and in particular relates to an ANS-based aquaculture dynamic water quality monitoring method and system. Background Art
[0002] In smart aquaculture, it is an inevitable trend for aquaculture to become smarter, more accurate and more ecological. In traditional aquaculture, water quality monitoring is fixed in position and cumbersome, and it is often impossible to accurately grasp the changing trend of water quality in a timely manner. Accurate prediction of water quality parameters can help farmers grasp the changing trend of water quality parameters in the future, so as to take corresponding countermeasures. At the same time, for water quality parameters in aquaculture waters, the time characteristics associated with different times and seasons will affect the water quality parameters, thereby affecting the growth and development of farmed fish, so it is important to predict water quality based on the associated time characteristics.
[0003] How to use the time data of water quality to predict water quality is a technical problem that needs to be solved urgently. Summary of the invention
[0004] In view of the defects in the prior art, the present invention proposes to use artificial neural network and LSTM to fuse to construct a water quality prediction model, and combine the time characteristics of water quality to accurately predict water quality.
[0005] The technical solution provided by the present invention is as follows:
[0006] On the one hand, a method for dynamic water quality monitoring of aquaculture based on ANS, comprising:
[0007] Data collection: First, the collected water quality data is standardized;
[0008] The data include: pH value, water temperature, dissolved oxygen, ammonia nitrogen, conductivity, chlorophyll concentration, etc. Water quality parameters are monitored in real time by installing fixed water quality parameter sensors on the riverside and various sensors on patrol fish. Sensors include pH sensors, temperature sensors, dissolved oxygen sensors, ammonia nitrogen sensors, etc.
[0009] Model construction: Construct ANS water quality prediction model: adopt ANN network architecture, and add LSTM layer in ANN network to connect between input layer and hidden layer. The added LSTM layer is used to extract water quality time series correlation features;
[0010] Model training: After the training data is standardized, it is input into the ANS water quality prediction model, and the error between the predicted value and the true value is back-propagated to the ANS water quality prediction model, and the set number of training times is reached to obtain the trained ANS water quality prediction model;
[0011] Water quality prediction: The water quality data collected in real time is input into the trained ANS water quality prediction model to perform water quality prediction and obtain the predicted values of various water quality indicators within the future set time period.
[0012] ANS is an adaptive artificial neural network obtained by combining artificial neural network (ANN) and long short-term memory network (LSTM) technology. By constructing the ANS water quality prediction model, it can quickly integrate and analyze a large amount of water quality data and make accurate predictions of water quality data.
[0013] Furthermore, the data transmitted from the input layer is first subjected to wavelet transformation to separate the different frequency components in the time series, and then the LSTM layer is used to extract the water quality time series correlation features. Then, the Tansing function is used to perform nonlinear transformation and activation processing on the water quality time series correlation features, and the processed data is input into the next layer;
[0014] The wavelet transform uses the following formula:
[0015]
[0016]
[0017] in, represents the wavelet transform formula, α represents the scale factor used for dilation, and α>1; β represents the translation factor used for time translation or shift; |α| -1 / 2 represents the normalization factor; is the value of the time variable at time t, indicating the water quality data value collected at time t after being processed by the input layer; e represents a natural number, and Q represents the variable of the mother wavelet function f;
[0018] α is used to control the width coefficient of the sub-wavelet. When α>1, the sub-wavelet is compressed, that is, it covers a shorter time interval and is suitable for capturing low-frequency changes. β represents the displacement of the sub-wavelet relative to the original signal and determines the position of the sub-wavelet. |α| -1 / 2 is a normalization factor that ensures that the energy of the sub-wavelet transform remains consistent. Whether the sub-wavelet is compressed or expanded, its overall energy remains the same. is the value of the time variable at time t.
[0019] Used to extract local features and change patterns of signals in signal processing and time series analysis. Similar to the continuous wavelet transform, both are used to integrate the time series, but The normalization factor is clarified to ensure the consistency of the transformed energy. It is optimized specifically for the nonlinear stationary time series of water quality data, separating the different frequency components in the time series so that LSTM can focus on processing these components and capture the characteristics of time data, emphasizing the combination of feature extraction and the importance of water quality data prediction time.
[0020] f(Q) combines the characteristics of Gaussian function and cosine function to perform localized time-frequency analysis on the signal to capture nonlinear characteristics and periodic changes. The signal is scaled and translated to extract the local features and change patterns of the signal, and then fused to obtain the wavelet coefficient calculation output at different scales and positions. It can effectively process and analyze water quality data, capture the nonlinear and local features, realize multi-scale analysis and denoising, and extract important features for water quality prediction.
[0021] The formula after substitution is as follows:
[0022]
[0023] It can effectively process and analyze water quality data, capture nonlinear and local characteristics, realize multi-scale analysis and denoising, and extract important features for water quality prediction.
[0024] Furthermore, the kernel function is used in the hidden layer to perform high-dimensional mapping of the data input into the hidden layer, and then the phi(x) function is used to reduce the dimension of the high-dimensional data;
[0025] The kernel function is a hybrid kernel function, using the following formula:
[0026]
[0027] in, represents the mixed kernel function, x and x' represent the vector expressions of two water quality data collected at the same time, represents the transpose of x, represents the vector inner product; c and d represent the constant term and complexity in the polynomial kernel, both of which are constants; γ represents the width parameter of the hybrid kernel function; ||x-x'|| 2 represents the square of the Euclidean distance between x and x'; ∈ represents the weight of the kernel function.
[0028] Represents the vector inner product, which measures the similarity between two vectors.
[0029] ∈ is used to control the relative weights of the polynomial kernel and the RBF kernel. By adjusting ∈, the best balance can be found between the two to adapt to different data distributions and characteristics. Cross-Validation is used to select the optimal ∈ value through adaptive adjustment. By splitting and validating the training data set multiple times, the parameter value that makes the model perform best is found.
[0030] c represents the constant term in the polynomial kernel, which controls the offset of the kernel function. A larger c value can increase the complexity of the kernel function, making it more suitable for processing complex patterns.
[0031] The value of d determines the complexity of the polynomial kernel, which allows the kernel function to handle complex relationships but also increases the risk of overfitting. 2 or 3 are usually used.
[0032] γ controls the width of the RBF kernel. A larger γ value makes the kernel function more sensitive to local changes in the input vector and suitable for capturing details; a smaller γ value makes the kernel function smoother and suitable for capturing global patterns.
[0033] The grid search (GridSearch) optimization method is used to automatically search for the optimal c value, d value and γ value.
[0034] ∈ is a weight parameter used to balance the hybrid kernel function. The introduction of constants c and d can control the complexity of the kernel function. When c is larger, the output value will increase, and when d is larger, the nonlinearity will be stronger. γ represents the width parameter of the kernel function. The larger the γ value, the faster the kernel function value decays, indicating stronger locality. The smaller the γ value, the slower the kernel function value decays, indicating stronger globality. ||x-x'|| represents the Euclidean distance. Two data points are usually calculated in the form of vectors. The Euclidean distance is used to measure the similarity or distance between two data points (vectors). The smaller the distance, the larger the kernel function value, indicating that the two data points are more similar.
[0035] The formula of the phi(x) function is as follows:
[0036]
[0037] Among them, β i is the parameter of the ANS water quality prediction model. By optimizing the weight parameter, the generalization ability of the ANS water quality prediction model can be improved and overfitting can be reduced. i ) is the kernel function value, which helps the model capture the nonlinear characteristics of the data by calculating the similarity between the input data and the training data. b is the bias term, n represents the number of data points in the training data set. x represents the water quality data as the input vector, x i Represents the i-th water quality data in the training data set.
[0038] The hybrid kernel function maps the input hidden layer data to a high-dimensional space to capture nonlinear relationships in the data; the phi(x) function is used to reduce high-dimensional data to low dimensions to gain a deeper understanding of the data;
[0039] The hybrid kernel function combines the advantages of the polynomial kernel and the Gaussian kernel, and achieves the best balance between the two by adjusting the weight ∈ parameter. Compared with the limitations of the previous single kernel function, the hybrid kernel function can more flexibly capture the global and local nonlinear relationships in water quality data, enhance the robustness of the model, and adapt to multi-scale feature changes.
[0040] By mixing the polynomial kernel to process global features and the Gaussian kernel to process local features, the model's adaptability to complex data distribution is improved; by adjusting the balanced parameters, the model's resistance to noise and outliers is enhanced, and the prediction accuracy and model stability are improved. The mixed kernel function shows higher flexibility and reliability in water quality monitoring.
[0041] Furthermore, the hidden layer uses z(l) j After weighted adjustment of the data after dimension reduction by the phi(x) function, the activation function is input to obtain the output of each node on the hidden layer;
[0042] The z(l) j The formula is as follows:
[0043]
[0044] Among them, z(l) j represents the weighted value of the jth node in the lth layer, ω(l-1) ij represents the connection weight between the i-th node in the l-1th layer and the j-th node in the lth layer, a(l-1) i is the output of the ith node in the l-1th layer, b(l) j is the bias of the jth node in the lth layer, and m represents the number of nodes in the lth layer.
[0045] The hierarchical structure of traditional neural networks usually only considers simple weighted sums and activations between single layers. The improved z(l) j It explicitly expresses the relationship between layer l and layer l-1, and considers feature maps when calculating weighted sums. Can better handle complex nonlinear relationships in water quality data.
[0046] First pass To map the data to high dimensions, capture the relationship between linear and nonlinear in the data, and use the phi(x) function to reduce high-dimensional data to low dimensions to gain a deeper understanding of the data. j Calculate the value of the weighted sum, δ(l) jCalculate the error term through the activation function a(l) j To calculate the output value of the neuron.
[0047] Furthermore, the activation function is a Tansing function.
[0048] Furthermore, the output layer of the ANS water quality prediction model uses the A function to process the data transmitted from the hidden layer to obtain the output value of the node on the output layer;
[0049] The calculation formula of the A function is as follows:
[0050]
[0051] Among them, Q nm represents the weighted sum between the nth node and the mth node in the hidden layer, D represents the activation function, α n and β n They represent the expansion factor and translation factor, respectively, which are used to scale and translate the input signal, and their values are normalized to the interval (0, 1) in the formula; k It represents the characteristic value of the output of the kth previous hidden layer received by the output layer, which represents the value of a specific dimension of the input data; h represents the number of neurons in the hidden layer, α in Indicates the expansion factor for matching the i-th eigenvalue from the hidden layer, and its value range is [1,2].
[0052] The main purpose of the activation function D is to introduce nonlinearity so that the model can better capture the complex patterns and relationships in the input data. The activation function can use the wavelet basis function or other activation functions, such as the tansing activation function.
[0053] In traditional neural networks, simple activation functions are usually used for activation. The A function combines wavelet basis functions for nonlinear changes, and can be analyzed simultaneously in the time domain and frequency domain. The expansion factor and translation factor are used for scaling and translation, which can enable the model to better capture the nonlinear relationships and interactions between features in water quality data, and improve the expressive power of water quality prediction models.
[0054] Furthermore, the smoothing method is used to standardize the data error:
[0055]
[0056] in, represents the data after standardization, θ represents the data error threshold, They respectively represent the water quality data collected at the current moment, the previous moment, and the next moment.
[0057] If the maximum difference between the current data value and the previous and next data values exceeds the comprehensive threshold θ, the current data value is considered an outlier and must be updated to the average of the previous and next values;
[0058] In a second aspect, an ANS-based aquaculture dynamic water quality monitoring system using the above-mentioned ANS-based aquaculture dynamic water quality monitoring method comprises:
[0059] Data collection and processing module: standardize the collected water quality data;
[0060] Model building module: adopt ANN network architecture, and add LSTM layer in ANN network to connect between input layer and hidden layer. The added LSTM hidden layer is used to extract the correlation characteristics of water quality time series and build ANS water quality prediction model;
[0061] Model training module: After the training data is standardized, it is input into the ANS water quality prediction model, and the error between the predicted value and the true value is back-propagated to the ANS water quality prediction model, and the set number of training times is reached to obtain the trained ANS water quality prediction model;
[0062] Water quality prediction module: input the real-time collected water quality data into the trained ANS water quality prediction model to perform water quality prediction.
[0063] In a third aspect, a dynamic water quality monitoring device for aquaculture based on ANS includes: a dynamic monitoring device for inspecting fish and an intelligent terminal connected thereto;
[0064] When the dynamic monitoring equipment inspects fish in the aquaculture waters, it collects water quality information in real time and transmits it to the smart terminal;
[0065] The intelligent terminal uses the above-mentioned ANS-based aquaculture dynamic water quality monitoring method to predict water quality.
[0066] Water quality information includes image information and data information; the preset cruise route and cruise ratio for autonomous cruise operation all adopt existing technology, and the cruise route is set manually;
[0067] Furthermore, the dynamic monitoring equipment inspection fish includes a water quality detection sensor module, a Beidou communication positioning module, an inspection motion control module, an inspection fish overall function control module, a parameter information display module, an underwater pollution detection alarm module and a power supply module;
[0068] The water quality detection sensor module, Beidou communication positioning module, underwater pollution detection alarm module, patrol motion control module, and parameter information display module are all connected to the patrol fish overall function control module for communication, and the power supply module supplies power to the water quality detection sensor module, Beidou communication positioning module, underwater pollution detection alarm module, patrol motion control module, and parameter information display module, all of which are connected to the patrol fish overall function control module;
[0069] The Beidou communication positioning system adopts long-distance radio frequency communication, and sets GPS positioning at the tail of the fish inspected by the dynamic monitoring equipment. The main cabin of the dynamic monitoring equipment for inspecting fish is equipped with a high-power WIFI module, and real-time monitoring information is transmitted to the smart terminal.
[0070] The motion control system uses a bionic tail and high-speed propeller to support inspection and movement;
[0071] The data analysis system determines whether there are abnormal water quality parameters based on the preset standard water quality parameter range and transmits the information to the smart terminal;
[0072] Autonomous cruise performs autonomous cruise operations according to the preset cruise route and cruise ratio, including initial startup and setting, data collection and communication, cruise mission execution, manual control, and exception handling.
[0073] Beneficial Effects
[0074] The present invention provides a method and system for dynamic water quality monitoring of aquaculture based on ANS. Compared with the prior art, the present invention has the following advantages: the existing aquaculture lakes are all fixed-point detection mechanisms, while the technical solution of the present invention establishes a high-precision water quality prediction model by analyzing the correlation between various water qualities, and can provide accurate water quality prediction results; the ANS water quality prediction model uses efficient data analysis technology to quickly integrate and analyze a large amount of water quality data, and accurately predicts water quality data, thereby significantly improving the data processing speed and system response speed, solving the technical problems of the prior art in the field of aquaculture lakes, such as fixed monitoring equipment, difficult to predict changes in water quality data, and difficulty in handling emergencies. Through real-time data transmission and the application of the ANS model, the present invention greatly improves the system's response speed and data processing efficiency, ensures the timeliness and accuracy of water quality monitoring, and effectively responds to the demand for rapid response to water quality changes. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] Figure 1 A flow chart for water quality analysis and prediction for the technical solution of the present invention;
[0076] Figure 2 It is a schematic diagram of the structure of the ANS water quality prediction model in the technical solution of the present invention;
[0077] Figure 3This is the Ca ion prediction diagram of the ANS water quality prediction model. DETAILED DESCRIPTION
[0078] The present invention is further described in detail below with reference to the accompanying drawings and embodiments:
[0079] Example 1
[0080] like Figure 1 and Figure 2 As shown, a method for dynamic water quality monitoring of aquaculture based on ANS comprises:
[0081] Data collection: First, the collected water quality data is standardized;
[0082] The data include: pH value, water temperature, dissolved oxygen, ammonia nitrogen, conductivity, chlorophyll concentration, etc. Water quality parameters are monitored in real time by installing fixed water quality parameter sensors on the riverside and various sensors on patrol fish. Sensors include pH sensors, temperature sensors, dissolved oxygen sensors, ammonia nitrogen sensors, etc.
[0083] The smoothing method is used to standardize the data error:
[0084]
[0085] in, represents the data after standardization, θ represents the data error threshold, They respectively represent the water quality data collected at the current moment, the previous moment, and the next moment.
[0086] If the maximum difference between the current data value and the previous and next data values exceeds the comprehensive threshold θ, the current data value is considered an outlier and must be updated to the average of the previous and next values;
[0087] Model construction: Construct ANS water quality prediction model: adopt ANN network architecture, and add LSTM layer in ANN network to connect between input layer and hidden layer. The added LSTM hidden layer is used to extract water quality time series correlation features;
[0088] The data transmitted from the input layer is first subjected to wavelet transformation to separate the different frequency components in the time series, and then the LSTM layer is used to extract the water quality time series correlation features. Then, the Tansing function is used to perform nonlinear transformation and activation processing on the water quality time series correlation features, and the processed data is input into the next layer;
[0089] The wavelet transform uses the following formula:
[0090]
[0091] in, represents the wavelet transform formula, α represents the scale factor used for dilation, and α>1; β represents the translation factor used for time translation or shift; |α| -1 / 2 represents the normalization factor; is the value of the time variable at time t, indicating the water quality data value collected at time t after being processed by the input layer; e represents a natural number, and Q represents the variable of the mother wavelet function f;
[0092] α is used to control the width coefficient of the sub-wavelet. When α>1, the sub-wavelet is compressed, that is, it covers a shorter time interval and is suitable for capturing low-frequency changes. β represents the displacement of the sub-wavelet relative to the original signal and determines the position of the sub-wavelet. |α| -1 / 2 is a normalization factor that ensures that the energy of the sub-wavelet transform remains consistent. Whether the sub-wavelet is compressed or expanded, its overall energy remains the same. is the value of the time variable at time t.
[0093] Used to extract local features and change patterns of signals in signal processing and time series analysis. Similar to the continuous wavelet transform, both are used to integrate the time series, but The normalization factor is clarified to ensure the consistency of the transformed energy. It is optimized specifically for the nonlinear stationary time series of water quality data, separating the different frequency components in the time series so that LSTM can focus on processing these components and capture the characteristics of time data, emphasizing the combination of feature extraction and the importance of water quality data prediction time.
[0094] f(Q) combines the characteristics of Gaussian function and cosine function to perform localized time-frequency analysis on the signal to capture nonlinear characteristics and periodic changes. The signal is scaled and translated to extract the local features and change patterns of the signal, and then fused to obtain the wavelet coefficient calculation output at different scales and positions. It can effectively process and analyze water quality data, capture the nonlinear and local features, realize multi-scale analysis and denoising, and extract important features for water quality prediction.
[0095] The formula after substitution is as follows:
[0096]
[0097] It can effectively process and analyze water quality data, capture nonlinear and local characteristics, realize multi-scale analysis and denoising, and extract important features for water quality prediction.
[0098] In the hidden layer, the kernel function is used to map the input hidden layer data to high dimensions, and then the phi(x) function is used to reduce the dimension of the high-dimensional data.
[0099] The kernel function is a hybrid kernel function, using the following formula:
[0100]
[0101] in, represents the mixed kernel function, x and x' represent the vector expressions of two water quality data collected at the same time, represents the transpose of x, represents the vector inner product; c and d represent the constant term and complexity in the polynomial kernel, both of which are constants; γ represents the width parameter of the hybrid kernel function; ||x-x'|| 2 represents the square of the Euclidean distance between x and x'; ∈ represents the weight of the kernel function.
[0102] Represents the vector inner product, which measures the similarity between two vectors.
[0103] ∈ is used to control the relative weights of the polynomial kernel and the RBF kernel. By adjusting ∈, the best balance can be found between the two to adapt to different data distributions and characteristics. Cross-Validation is used to select the optimal ∈ value through adaptive adjustment. By splitting and validating the training data set multiple times, the parameter value that makes the model perform best is found.
[0104] c represents the constant term in the polynomial kernel, which controls the offset of the kernel function. A larger c value can increase the complexity of the kernel function, making it more suitable for processing complex patterns.
[0105] The value of d determines the complexity of the polynomial kernel, which allows the kernel function to handle complex relationships but also increases the risk of overfitting. 2 or 3 are usually used.
[0106] γ controls the width of the RBF kernel. A larger γ value makes the kernel function more sensitive to local changes in the input vector and suitable for capturing details; a smaller γ value makes the kernel function smoother and suitable for capturing global patterns.
[0107] The grid search optimization method is used to automatically search for the optimal c value, d value, and γ value.
[0108] ∈ is a weight parameter used to balance the hybrid kernel function. The introduction of constants c and d can control the complexity of the kernel function. When c is larger, the output value will increase, and when d is larger, the nonlinearity will be stronger. γ represents the width parameter of the kernel function. The larger the γ value, the faster the kernel function value decays, indicating stronger locality. The smaller the γ value, the slower the kernel function value decays, indicating stronger globality. ||X-x'|| represents the Euclidean distance. Two data points are usually calculated in the form of vectors. The Euclidean distance is used to measure the similarity or distance between two data points (vectors). The smaller the distance, the larger the kernel function value, indicating that the two data points are more similar.
[0109] The formula of the phi(x) function is as follows:
[0110]
[0111] Among them, β i is the parameter of the ANS water quality prediction model. By optimizing the weight parameter, the generalization ability of the ANS water quality prediction model can be improved and overfitting can be reduced. i ) is the kernel function value, which helps the model capture the nonlinear characteristics of the data by calculating the similarity between the input data and the training data. b is the bias term, and n represents the number of data points in the training data set. i Represents the i-th water quality data in the training data set.
[0112] The hybrid kernel function maps the input hidden layer data to a high-dimensional space to capture nonlinear relationships in the data; the phi(x) function is used to reduce high-dimensional data to low dimensions to gain a deeper understanding of the data;
[0113] The hybrid kernel function combines the advantages of the polynomial kernel and the Gaussian kernel, and achieves the best balance between the two by adjusting the weight ∈ parameter. Compared with the limitations of the previous single kernel function, the hybrid kernel function can more flexibly capture the global and local nonlinear relationships in water quality data, enhance the robustness of the model, and adapt to multi-scale feature changes.
[0114] By mixing the polynomial kernel to process global features and the Gaussian kernel to process local features, the model's adaptability to complex data distribution is improved; by adjusting the balanced parameters, the model's resistance to noise and outliers is enhanced, and the prediction accuracy and model stability are improved. The mixed kernel function shows higher flexibility and reliability in water quality monitoring.
[0115] The hidden layer uses z(l) j After weighted adjustment of the data after dimension reduction by the phi(x) function, the activation function is input to obtain the output of each node on the hidden layer;
[0116] The z(l) j The formula is as follows:
[0117]
[0118] Among them, z(l) j represents the weighted value of the jth node in the lth layer, ω(l-1) ij represents the connection weight between the i-th node in the l-1th layer and the j-th node in the lth layer, a(l-1) i is the output of the ith node in the l-1th layer, b(l) j is the bias of the jth node in the lth layer, and m represents the number of nodes in the lth layer.
[0119] The hierarchical structure of traditional neural networks usually only considers simple weighted sums and activations between single layers. The improved z(l) j It explicitly expresses the relationship between layer l and layer l-1, and considers feature maps when calculating weighted sums. Can better handle complex nonlinear relationships in water quality data.
[0120] First pass To map the data to high dimensions, capture the relationship between linear and nonlinear in the data, and use the phi(x) function to reduce high-dimensional data to low dimensions to gain a deeper understanding of the data. j Calculate the value of the weighted sum, δ(l) j Calculate the error term through the activation function a(l) j To calculate the output value of the neuron.
[0121] In this example, the preferred activation function is the Tansing function.
[0122] The output layer of the ANS water quality prediction model uses the A function to process the data from the hidden layer to obtain the output value of the node on the output layer;
[0123] The calculation formula of the A function is as follows:
[0124]
[0125] Among them, Q nm represents the weighted sum between the nth node and the mth node in the hidden layer, D represents the activation function, α n and β n They represent the expansion factor and translation factor, respectively, which are used to scale and translate the input signal, and their values are normalized to the interval (0, 1) in the formula; k represents the kth eigenvalue received on the output layer, which represents the value of a specific dimension of the input data; h represents the number of neurons in the hidden layer, α in Indicates the expansion factor for matching the i-th eigenvalue from the hidden layer, and its value range is [1,2].
[0126] The main purpose of the activation function D is to introduce nonlinearity so that the model can better capture the complex patterns and relationships in the input data. The activation function can use the wavelet basis function or other activation functions, such as the tansing activation function.
[0127] In traditional neural networks, simple activation functions are usually used for activation. The A function combines wavelet basis functions for nonlinear changes, and can be analyzed simultaneously in the time domain and frequency domain. The expansion factor and translation factor are used for scaling and translation, which can enable the model to better capture the nonlinear relationships and interactions between features in water quality data, and improve the expressive power of water quality prediction models.
[0128] Model training: After the training data is standardized, it is input into the ANS water quality prediction model, and the error between the predicted value and the true value is back-propagated to the ANS water quality prediction model, and the set number of training times is reached to obtain the trained ANS water quality prediction model;
[0129] Water quality prediction: The water quality data collected in real time is input into the trained ANS water quality prediction model to perform water quality prediction and obtain the predicted values of various water quality indicators within the future set time period.
[0130] The collected datasets are divided into two groups: training and testing. The training and testing datasets are used for calibration and validation of the ANS water quality prediction model, respectively. About 70%-80% of the dataset is allocated for calibration, and the remaining 20%-30% is used for validation. Randomly initialized initial parameters are used, and the parameters are updated through forward propagation and back propagation algorithms. In order to find the best model parameters and function curves, the The hyperparameters of the model are adjusted using methods such as function and cross-validation. In the code, the time step is set to 12 and the number of neurons is 40. During the training of the model, the batch size is set to 10 and the number of iterations is set to 10. These values affect the training speed and convergence of the model. Generally speaking, a larger batch size can increase the training speed, but may cause the model to converge to a local optimal solution; a smaller batch size can improve the generalization ability of the model, but the training speed is slower. The number of iterations determines the number of training rounds of the model to achieve good performance on the training set and the validation set.
[0131] like Figure 3 As shown, the input layer receives a variety of water quality parameters as input, including pH, Na + 、HCO3 - 、SO4 2-, Mg, Cl, Ec and TDS, etc., which are important indicators affecting water quality. The hidden layer processes the input data by connecting weights and enhances the expression ability of the model through nonlinear transformation. The ANS water quality prediction model described in the technical solution of the present invention specifically adds an LSTM layer to extract the time series characteristics of water quality data, helping the ANS water quality prediction model to better understand the time dependence and dynamic changes in the data. The output layer finally generates the predicted value of the Ca ion water quality indicator.
[0132] By combining artificial neural network (ANN) and long short-term memory network (LSTM) technology, it has demonstrated excellent high-precision prediction capabilities, especially in the prediction of calcium (Ca) ions, a key water quality indicator. The ANS water quality prediction model uses the processing power of time series data to dynamically monitor and predict water quality changes, which is of great significance for real-time water quality management. In addition, the model can handle multiple input variables and effectively capture the complex relationships between these variables, greatly improving the accuracy and reliability of the prediction.
[0133] Example 2
[0134] Corresponding to the aforementioned method of this embodiment, this example also provides an ANS-based aquaculture dynamic water quality monitoring system using an ANS-based aquaculture dynamic water quality monitoring method, comprising:
[0135] Data collection and processing module: standardize the collected water quality data;
[0136] Model building module: adopt ANN network architecture, and add LSTM layer in ANN network to connect between input layer and hidden layer. The added LSTM hidden layer is used to extract the correlation characteristics of water quality time series and build ANS water quality prediction model;
[0137] Model training module: After the training data is standardized, it is input into the ANS water quality prediction model, and the error between the predicted value and the true value is back-propagated to the ANS water quality prediction model, and the set number of training times is reached to obtain the trained ANS water quality prediction model;
[0138] Water quality prediction module: input the real-time collected water quality data into the trained ANS water quality prediction model to perform water quality prediction.
[0139] Example 3
[0140] Corresponding to the aforementioned method of this embodiment, this example also provides a dynamic water quality monitoring device for aquaculture based on ANS, including: a dynamic monitoring device for inspecting fish and an intelligent terminal connected thereto;
[0141] When the dynamic monitoring equipment inspects fish in the aquaculture waters, it collects water quality information in real time and transmits it to the smart terminal;
[0142] The intelligent terminal uses an ANS-based aquaculture dynamic water quality monitoring method to predict water quality.
[0143] Water quality information includes image information and data information; the preset cruise route and cruise ratio for autonomous cruise operation all adopt existing technology, and the cruise route is set manually;
[0144] The dynamic monitoring equipment inspection fish includes a water quality detection sensor module, a Beidou communication positioning module, an inspection motion control module, an inspection fish overall function control module, a parameter information display module, an underwater pollution detection alarm module and a power supply module;
[0145] The water quality detection sensor module, Beidou communication positioning module, underwater pollution detection alarm module, patrol motion control module, and parameter information display module are all connected to the patrol fish overall function control module for communication, and the power supply module supplies power to the water quality detection sensor module, Beidou communication positioning module, underwater pollution detection alarm module, patrol motion control module, and parameter information display module, all of which are connected to the patrol fish overall function control module;
[0146] The Beidou communication positioning system adopts long-distance radio frequency communication, and sets GPS positioning at the tail of the fish inspected by the dynamic monitoring equipment. The main cabin of the dynamic monitoring equipment for inspecting fish is equipped with a high-power WIFI module, and real-time monitoring information is transmitted to the smart terminal.
[0147] The motion control system uses a bionic tail and high-speed propeller to support inspection and movement;
[0148] The data analysis system determines whether there are abnormal water quality parameters based on the preset standard water quality parameter range and transmits the information to the smart terminal;
[0149] Autonomous cruise performs autonomous cruise operations according to the preset cruise route and cruise ratio, including initial startup and setting, data collection and communication, cruise mission execution, manual control, and exception handling.
[0150] The autonomous cruise performs autonomous cruise operations according to a preset cruise route and cruise ratio.
[0151] S1: Initial startup and settings: After the patrol fish is started, set the autonomous cruise function, calibrate the origin of the device, and set the cruise path, which can be represented by polygons (such as triangles, rectangles, etc.). At the same time, enter the cruise ratio, for example, set it to 20 meters, which is used to determine the spacing between each position on the cruise path.
[0152] S2: Data collection and communication: The patrol fish performs data collection and floats up after the collection is completed to re-establish the Beidou satellite communication connection. After the initial point calibration is completed, the GPS longitude and latitude data of the next point is generated. The upper computer sends the generated data to the lower computer to realize data transmission.
[0153] S3: Patrol mission execution: The patrol fish performs the patrol mission according to the received Beidou satellite coordinate data. It moves along the preset patrol path and takes water quality samples after reaching each predetermined point. This process will continue until the entire patrol path is completed.
[0154] S4: Manual control: After the autonomous cruising operation is completed, if manual control is required, the robot fish can be operated through the corresponding control method.
[0155] S5: Exception handling: If a communication exception occurs, causing the robot fish to be unable to generate the coordinate data of the next point, the system will terminate the current program execution and perform corresponding exception handling.
[0156] It should be understood that the above module division is only an example. In some embodiments, the above functional modules are implemented in the form of hardware, and in other embodiments, the above functional modules are implemented in the form of software. The present invention does not make specific limitations on this.
[0157] Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned readable storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), disk or optical disk, etc. Various media that can store program codes.
[0158] It should be understood that in the embodiments of the present invention, the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The memory may include a read-only memory and a random access memory, and provide instructions and data to the processor. A portion of the memory may also include a non-volatile random access memory. For example, the memory may also store information about the type of device.
[0159] It should be emphasized that the examples described in the present invention are illustrative rather than restrictive, and therefore the present invention is not limited to the examples described in the specific embodiments. Any other embodiments derived by those skilled in the art based on the technical solution of the present invention that do not depart from the purpose and scope of the present invention, whether modified or replaced, also fall within the scope of protection of the present invention.
Claims
1. A dynamic water quality monitoring method for aquaculture based on ANS, characterized in that: include: Data collection: First, the collected water quality data is standardized; Model construction: Build the ANS water quality prediction model, adopt the ANN network architecture, and add an LSTM layer in the ANN network to connect between the input layer and the hidden layer. The added LSTM layer is used to extract the correlation characteristics of the water quality time series; Model training: After the training data is standardized, it is input into the ANS water quality prediction model, and the error between the predicted value and the true value is back-propagated to the ANS water quality prediction model, and the set number of training times is reached to obtain the trained ANS water quality prediction model; Water quality prediction: The water quality data collected in real time is input into the trained ANS water quality prediction model to perform water quality prediction and obtain the predicted values of various water quality indicators within the future set time period.
2. The method according to claim 1, characterized in that The data transmitted from the input layer is first subjected to wavelet transformation to separate the different frequency components in the time series, and then the LSTM layer is used to extract the water quality time series correlation features. Then, the Tansing function is used to perform nonlinear transformation and activation processing on the water quality time series correlation features, and the processed data is input into the next layer; The wavelet transform uses the following formula: in, represents the wavelet transform formula, α represents the scale factor used for dilation, and α>1; β represents the translation factor used for time translation or shift; |α| -1 / 2 represents the normalization factor; It is the value of the time variable at time t, which represents the water quality data value collected at time t after being processed by the input layer; e represents a natural number, and Q represents the variable of the mother wavelet function f.
3. The method according to claim 1, characterized in that In the hidden layer, the kernel function is used to map the input hidden layer data to high dimensions, and then the phi(x) function is used to reduce the dimension of the high-dimensional data. The kernel function is a hybrid kernel function, using the following formula: in, represents the mixed kernel function, x and x' represent the vector expressions of two water quality data collected at the same time, represents the transpose of x, represents the vector inner product; c and d represent the constant term and complexity in the polynomial kernel, both of which are constants; γ represents the width parameter of the hybrid kernel function; ||x-x'|| 2 represents the square of the Euclidean distance between x and x'; ∈ represents the weight of the kernel function.
4. The method according to claim 3, characterized in that: The hidden layer uses z(l) j After weighted adjustment of the data after dimension reduction by the phi(x) function, the activation function is input to obtain the output of each node on the hidden layer; The z(l) j The formula is as follows: Among them, z(l) j represents the weighted value of the jth node in the lth layer, ω(l-1) ij represents the connection weight between the i-th node in the l-1th layer and the j-th node in the lth layer, a(l-1) i is the output of the ith node in the l-1th layer, b(l) j is the bias of the jth node in the lth layer, and m represents the number of nodes in the lth layer.
5. The method according to claim 4, characterized in that The activation function is the Tansing function.
6. The method according to claim 1, characterized in that The output layer of the ANS water quality prediction model uses the A function to process the data transmitted from the hidden layer to obtain the output value of the node on the output layer; The calculation formula of the A function is as follows: Among them, Q nm represents the weighted sum between the nth node and the mth node in the hidden layer, D represents the activation function, α n and β n They represent the expansion factor and translation factor, respectively, which are used to scale and translate the input signal, and their values are normalized to the interval (0, 1) in the formula; k represents the kth eigenvalue received on the output layer, which represents the value of a specific dimension of the input data; h represents the number of neurons in the hidden layer, α in Indicates the expansion factor for matching the i-th eigenvalue from the hidden layer, and its value range is [1,2].
7. The method according to any one of claims 1 to 6, characterized in that: The smoothing method is used to standardize the data error: in, represents the data after standardization, θ represents the data error threshold, They respectively represent the water quality data collected at the current moment, the previous moment, and the next moment.
8. An ANS-based aquaculture dynamic water quality monitoring system using the method according to any one of claims 1 to 7, characterized in that: include: Data collection and processing module: standardize the collected water quality data; Model building module: adopt ANN network architecture, and add LSTM layer in ANN network to connect between input layer and hidden layer. The added LSTM hidden layer is used to extract the correlation characteristics of water quality time series and build ANS water quality prediction model; Model training module: After the training data is standardized, it is input into the ANS water quality prediction model, and the error between the predicted value and the true value is back-propagated to the ANS water quality prediction model, and the set number of training times is reached to obtain the trained ANS water quality prediction model; Water quality prediction module: input the real-time collected water quality data into the trained ANS water quality prediction model to perform water quality prediction.
9. An ANS-based aquaculture dynamic water quality monitoring device, characterized in that: include: Dynamic monitoring equipment inspects fish and the smart terminals connected to it; When the dynamic monitoring equipment inspects fish in the aquaculture waters, it collects water quality information in real time and transmits it to the smart terminal; The smart terminal uses the method described in any one of claims 1 to 7 to predict water quality.
10. The device according to claim 9, characterized in that The dynamic monitoring equipment inspection fish includes a water quality detection sensor module, a Beidou communication positioning module, an inspection motion control module, an inspection fish overall function control module, a parameter information display module, an underwater pollution detection alarm module and a power supply module; The water quality detection sensor module, Beidou communication positioning module, underwater pollution detection alarm module, patrol motion control module, and parameter information display module are all connected to the patrol fish overall function control module for communication, and the power supply module supplies power to the water quality detection sensor module, Beidou communication positioning module, underwater pollution detection alarm module, patrol motion control module, and parameter information display module, all of which are connected to the patrol fish overall function control module; The Beidou communication positioning system adopts long-distance radio frequency communication, and sets GPS positioning at the tail of the fish inspected by the dynamic monitoring equipment. The main cabin of the dynamic monitoring equipment for inspecting fish is equipped with a high-power WIFI module, and real-time monitoring information is transmitted to the smart terminal.
Citation Information
Patent Citations
Water quality prediction method, device and equipment based on space-time fusion and storage medium
CN111882138A
Autonomous inspection early warning bionic robotic dolphin system and control method
CN114954863A
Water quality monitoring and purifying integrated underwater bionic fish robot equipment and fish school system
CN115031782A
Waterfowl breeding water quality prediction method
CN117171624A
Water quality prediction method and device and computer readable storage medium
CN117851802A
Cited By
Method for treating desulfurization wastewater by adding chemicals, electronic equipment, medium and product
CN120717533A