Aquaculture water quality prediction method and device

By pretreating and classifying water quality data, a multi-dimensional prediction model is constructed, which solves the shortcomings of traditional water quality prediction methods in capturing the interaction of complex factors and achieves higher prediction accuracy and efficiency.

CN119441875APending Publication Date: 2025-02-14汉唐和元(武汉)科技有限公司 +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411485803.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-23
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

Traditional water quality prediction methods are difficult to capture the complex interactions between factors when describing quantitative relationships of water quality changes, resulting in low accuracy and efficiency.

Method used

By obtaining the original water quality data set, missing data completion, outlier value processing and normalization processing are performed to obtain the sample water quality data set. The dataset is then divided into training, validation and test datasets, and model training is performed based on the classified dataset, including model training using BiLSTM and model training for scale feature fusion structures. Finally, the trained model is used to predict the current water quality data, and the target water quality prediction results are determined through the fusion of the results.

Benefits of technology

By constructing a multi-dimensional prediction model, the accuracy and efficiency of water quality prediction are improved, and the interaction between complex factors in water quality changes can be more effectively captured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119441875A_ABST
    Figure CN119441875A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of water quality monitoring, and discloses an aquaculture water quality prediction method and device. The method comprises the following steps: processing an obtained original water quality data set to obtain a sample water quality data set; dividing the sample water quality data set into a training data set, a verification data set and a test data set according to a preset proportion, and classifying the training data set and the verification data set; and performing model training based on the classified training data set and the classified verification data set, evaluating model performance through the test data set to obtain a first water quality prediction model and a second water quality prediction model, and inputting the current water quality data set into the first water quality prediction model and the second water quality prediction model respectively to obtain a water quality prediction result. Obtaining a first water quality prediction result and a second water quality prediction result; and the target water quality prediction result is determined according to the first water quality prediction result and the second water quality prediction result, and multi-dimensional prediction is performed through the constructed model, so that the prediction accuracy and efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of water quality monitoring, and in particular to a method and a device for predicting water quality in aquaculture. Background Art

[0002] Water quality prediction is of great significance in aquaculture. First, water quality prediction can help aquaculture operators to find and solve water quality problems in time. Water quality prediction can warn of water quality changes in advance to avoid the death of aquaculture and production losses caused by water quality deterioration. Secondly, water quality prediction can improve the production efficiency and economic benefits of aquaculture. Accurate water quality prediction can help aquaculture operators adjust aquaculture management measures in time, improve the growth rate and survival rate of aquaculture, and thus increase production and revenue. Finally, water quality prediction can reduce environmental pollution and protect the ecological environment.

[0003] Traditional water quality prediction methods can describe the quantitative relationship of water quality changes, but it is difficult to describe the complex interactions between factors. Due to the complexity of the water environment and the influence of dissolved oxygen and pH on water temperature, ammonia nitrogen, salinity and other factors, there are complex interactions between these factors, and water quality parameters are unstable and nonlinear, which makes the accuracy and efficiency of traditional water quality prediction methods very low.

[0004] The above contents are only used to assist in understanding the technical solution of the present invention and do not constitute an admission that the above contents are prior art. Summary of the invention

[0005] The main purpose of the present invention is to provide a method and device for predicting water quality in aquaculture, aiming to solve the technical problem that the accuracy and efficiency of traditional water quality prediction methods are very low.

[0006] To achieve the above object, the present invention provides a method for predicting water quality in aquaculture, the method comprising the following steps:

[0007] Acquire an original water quality data set, and process the original water quality data set to obtain a sample water quality data set;

[0008] Dividing the sample water quality data set into a training data set, a verification data set and a test data set according to a preset ratio, and classifying the training data set and the verification data set;

[0009] Performing model training based on the classified training data set and the classified verification data set, evaluating the model performance through the test data set, and obtaining a first water quality prediction model and a second water quality prediction model;

[0010] Acquire a current water quality data set, and input the current water quality data set into the first water quality prediction model and the second water quality prediction model respectively to obtain a first water quality prediction result and a second water quality prediction result;

[0011] A target water quality prediction result is determined according to the first water quality prediction result and the second water quality prediction result.

[0012] In some embodiments, the processing of the original water quality dataset to obtain a sample water quality dataset includes:

[0013] identifying missing data in said original water quality dataset;

[0014] Completing the missing data based on the adjacent data before and after the missing data;

[0015] Calculating the mean square error of the original water quality data set;

[0016] identifying outliers in the raw water quality data based on the mean square error;

[0017] Smoothing the missing data based on the adjacent data before and after the outlier;

[0018] The water quality data set after missing data processing and outlier processing is normalized to obtain a sample water quality data set.

[0019] In some embodiments, the calculation formula for missing data completion is: Among them, X k X is the missing data that needs to be filled. w With X r are the data before and after the missing data, respectively, k, r, w are preset parameters;

[0020] The calculation formula for smoothing is: Among them, X v ' represents the value after smoothing, X v-1 With X v+1 The outliers X v The adjacent data.

[0021] In some embodiments, the classifying the training data set and the validation data set includes:

[0022] Determine the average Euclidean distance between each sample in the training data set and the validation data set and other samples;

[0023] Determine the number of samples within the mean Euclidean distance of each sample;

[0024] According to the sample quantity, the sample corresponding to the maximum sample quantity is used as the cluster center;

[0025] Clustering is performed based on the cluster centers of the training data set and the validation data set, and several samples corresponding to the same cluster center are classified as one class.

[0026] In some embodiments, the model training is performed based on the classified training data set and the classified validation data set, and the model performance is evaluated through the test data set to obtain the first water quality prediction model and the second water quality prediction model, including:

[0027] Taking BiLSTM as the basic model, adding a BiLSTM layer and a plurality of residual units to the BiLSTM, and adding a self-attention mechanism ATTN to perform model training based on the classified training data set and the classified verification data set to obtain a first reference model, and when the first reference model is determined to meet the requirements through the test data set, a first water quality prediction model is obtained;

[0028] The scale feature fusion structure is trained based on the classified training data set and the classified verification data set to obtain a second reference model, and when the second reference model is determined to meet the requirements through the test data set, a second water quality prediction model is obtained.

[0029] In some embodiments, the evaluating the model performance by the test data set includes:

[0030] Based on the results output by each model training and the test data set, the mean absolute error, the root mean square error and the mean absolute percentage error are calculated respectively;

[0031] If the mean absolute error, the root mean square error, and the mean absolute percentage error are all within the preset error range, it is determined that the trained model meets the requirements.

[0032] In some embodiments, determining a target water quality prediction result according to the first water quality prediction result and the second water quality prediction result includes:

[0033] Extracting a first water quality prediction value from the first water quality prediction result, and extracting a second water quality prediction value from the second prediction result, wherein the first water quality prediction value and the second water quality prediction value correspond to different water quality parameter types;

[0034] The first water quality prediction value and the second water quality prediction value are combined to obtain a target water quality prediction value;

[0035] A target water quality prediction result is obtained based on the target water quality prediction value.

[0036] In addition, to achieve the above-mentioned purpose, the present invention also proposes an aquaculture water quality prediction device, the aquaculture water quality prediction device comprising:

[0037] A processing module, used to obtain an original water quality data set, and process the original water quality data set to obtain a sample water quality data set;

[0038] A classification module, used to divide the sample water quality data set into a training data set, a verification data set and a test data set according to a preset ratio, and classify the training data set and the verification data set;

[0039] A training module, used for performing model training based on the classified training data set and the classified verification data set, evaluating the model performance through the test data set, and obtaining a first water quality prediction model and a second water quality prediction model;

[0040] A prediction module, used for acquiring a current water quality data set, inputting the current water quality data set into the first water quality prediction model and the second water quality prediction model respectively, to obtain a first water quality prediction result and a second water quality prediction result;

[0041] A fusion module is used to determine a target water quality prediction result based on the first water quality prediction result and the second water quality prediction result.

[0042] In some embodiments, the processing module is used to identify missing data in the original water quality dataset;

[0043] Completing the missing data based on the adjacent data before and after the missing data;

[0044] Calculating the mean square error of the original water quality data set;

[0045] identifying outliers in the raw water quality data based on the mean square error;

[0046] Smoothing the missing data based on the adjacent data before and after the outlier;

[0047] The water quality data set after missing data processing and outlier processing is normalized to obtain a sample water quality data set.

[0048] In some embodiments, the calculation formula for missing data completion is: Among them, X k X is the missing data that needs to be filled. w With X r are the adjacent data before and after the missing data, k, r, w are preset parameters; the calculation formula for smoothing is: Among them, X v ' represents the value after smoothing, Xv-1 With X v+1 The outliers X v The adjacent data.

[0049] The present invention obtains a sample water quality data set by acquiring an original water quality data set and processing the original water quality data set; divides the sample water quality data set into a training data set, a verification data set and a test data set according to a preset ratio, and classifies the training data set and the verification data set; performs model training based on the classified training data set and the classified verification data set, and evaluates the model performance through the test data set to obtain a first water quality prediction model and a second water quality prediction model; obtains a current water quality data set, and inputs the current water quality data set into the first water quality prediction model and the second water quality prediction model, respectively, to obtain a first water quality prediction result and a second water quality prediction result; determines a target water quality prediction result based on the first water quality prediction result and the second water quality prediction result. In the above manner, by using the constructed model to perform predictions in multiple dimensions, the prediction accuracy and efficiency can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 It is a schematic diagram of the flow chart of the first embodiment of the method for predicting water quality in aquaculture of the present invention;

[0051] Figure 2 A schematic diagram of the BiLSTM network structure based on residual and BN in the aquaculture water quality prediction method of the present invention;

[0052] Figure 3 It is a schematic diagram of the structure of the temporal attention mechanism in the aquaculture water quality prediction method of the present invention;

[0053] Figure 4 It is a schematic diagram of the multi-scale feature fusion structure in the aquaculture water quality prediction method of the present invention;

[0054] Figure 5 This is a structural block diagram of the first embodiment of the aquaculture water quality prediction device of the present invention.

[0055] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0056] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0057] The present invention provides a method for predicting water quality in aquaculture. Figure 1 , Figure 1 The figure is a flow chart of a first embodiment of a method for predicting water quality in aquaculture according to the present invention.

[0058] In this embodiment, the aquaculture water quality prediction method comprises the following steps:

[0059] Step S10: Acquire an original water quality data set, and process the original water quality data set to obtain a sample water quality data set.

[0060] In this embodiment, the executor of this embodiment is an aquaculture water quality prediction device, wherein the aquaculture water quality prediction device has functions such as data processing, data communication and program running. The aquaculture water quality prediction device can be a computer terminal device or other network device, and of course it can also be other devices with similar functions, and this embodiment does not limit this.

[0061] It should be noted that traditional water quality prediction methods can describe the quantitative relationship of water quality changes, but it is difficult to describe the complex interactions between factors. Due to the complexity of the water environment and the influence of dissolved oxygen and pH on water temperature, ammonia nitrogen, salinity and other factors, there are complex interactions between these factors, and water quality parameters have the characteristics of instability and nonlinearity, which makes the accuracy and efficiency of traditional water quality prediction methods very low.

[0062] In order to solve the above technical problems, this embodiment obtains an original water quality data set, processes the original water quality data set, and obtains a sample water quality data set; divides the sample water quality data set into a training data set, a verification data set, and a test data set according to a preset ratio, and classifies the training data set and the verification data set; performs model training based on the classified training data set and the classified verification data set, and evaluates the model performance through the test data set to obtain a first water quality prediction model and a second water quality prediction model; obtains a current water quality data set, and inputs the current water quality data set into the first water quality prediction model and the second water quality prediction model, respectively, to obtain a first water quality prediction result and a second water quality prediction result; determines a target water quality prediction result based on the first water quality prediction result and the second water quality prediction result. In the above manner, by using the constructed model to perform predictions in multiple dimensions, the prediction accuracy and efficiency can be improved, and specifically, it can be achieved in the following manner.

[0063] In a specific implementation, it is necessary to first perform model training, and then use the prediction model obtained through the training to predict water quality. The training of the model requires sample data. The sample data set in this embodiment can be obtained by preprocessing the original water quality data set. The specific preprocessing process is to identify missing data in the original water quality data set; to complete the missing data based on the adjacent data before and after the missing data; to calculate the mean square error of the original water quality data set; to identify outliers in the original water quality data based on the mean square error; to smooth the missing data based on the adjacent data before and after the outliers; and to normalize the water quality data set after the missing data processing and the outlier processing to obtain a sample water quality data set.

[0064] It should be noted that the calculation formula for missing data completion is Among them, X k X is the missing data that needs to be filled. w With X r are the adjacent data before and after the missing data, respectively, k, r, w are preset parameters. The calculation formula for smoothing is: Among them, X v ' represents the value after smoothing, X v-1 With X v+1 The outliers X v The adjacent data.

[0065] Step S20: Divide the sample water quality data set into a training data set, a verification data set and a test data set according to a preset ratio, and classify the training data set and the verification data set.

[0066] After obtaining the sample water quality data, the training data set, validation data set and test data set can be divided according to the preset ratio. Assuming the preset ratio is 6:2:2, 60% of the data will be extracted from the sample water quality data as the training data set, and 20% of the remaining data will be extracted as the validation data set, and finally the remaining 20% ​​of the data will be used as the test data set.

[0067] In order to avoid the influence of bad samples on the model training effect, such as slow convergence speed and low prediction accuracy, the training data set and the verification data set are further classified in this embodiment. The specific classification process is to determine the average Euclidean distance between each sample in the training data set and the verification data set and other samples; determine the number of samples within the average Euclidean distance of each sample; according to the number of samples, the samples corresponding to the maximum number of samples are used as cluster centers; clustering is performed based on the cluster centers of the training data set and the verification data set, and several samples corresponding to the same cluster center are classified as one class.

[0068] It should be noted that the average Euclidean distance is obtained by dividing the sum of the Euclidean distances between each sample and other samples by the number of samples. The number of samples is the same as the number of Euclidean distances obtained. For example, when the Euclidean distances d between sample A and samples B and C are obtained, AB and d AC After that, the average Euclidean distance is d AB +d AC / 2. Compare the average Euclidean distance with the Euclidean distance between samples, that is, other samples within the average Euclidean distance of each sample. In this embodiment, the sample with the largest number of samples is used as the cluster center. Finally, clustering can be performed based on the determined cluster center.

[0069] Step S30: Perform model training based on the classified training data set and the classified verification data set, evaluate the model performance through the test data set, and obtain a first water quality prediction model and a second water quality prediction model.

[0070] It should be noted that the training of the first water quality prediction model is based on BiLSTM. On the basis of BiLSTM, BiLSTM layers and multiple residual units are added, and the self-attention mechanism ATTN is added. The structure of the improved BiLSTM can be referred to Figure 2 As shown in the figure, the model includes BiLSTM layers and multiple residual units, which together complete the feature extraction of dissolved oxygen related environmental data, and then send the features to batch normalization (BN) and random dropout to further improve the model training efficiency and generalization ability. The self-attention mechanism adopts the temporal attention mechanism. The specific structure can be referred to Figure 3 As shown in the figure, the historical state information is processed adaptively and the influence of the state information at the relevant moment on the current prediction result is enhanced. This mechanism can effectively integrate the influence of the state information at each historical moment on the current prediction result. First, the input features are convolved, and then the average pooling and maximum pooling layers are used to reduce the dimension of the features and generate two new sets of features; then the two sets of features are concatenated, and the features are first convoluted and compressed to reduce the dimension to a single channel; then, the sigmoid activation function is used to generate the temporal attention weights and normalize them; finally, the temporal attention weights are multiplied by the corresponding elements of the input features to generate temporal features with different weights.

[0071] Furthermore, the training of the second water quality prediction model uses the scale feature fusion structure. The specific structure can be referred to Figure 4As shown in the figure, Conv represents convolution operation, 1-DConv represents one-dimensional dilated convolution, GroupPool represents global average pooling in both variable and time series dimensions, and the scale feature fusion structure consists of three parts: multi-scale feature extraction, multi-scale feature selection and multi-scale feature fusion. Multi-scale feature extraction refers to extracting different scale features of water quality data from time series granularity, time series fragment length or feature dimension. The model in this paper chooses to use multi-scale time series features; multi-scale feature selection refers to selecting effective features from the extracted multi-scale time series features according to the specific situation of water quality data, and combining features in the feature dimension to construct higher-dimensional features; multi-scale feature fusion refers to the global features constructed using multiple scale features, adaptively calculating the multi-scale feature weights and fusing the multi-scale features to construct the final second water quality prediction model.

[0072] Furthermore, in order to improve the accuracy of the model, the performance of the trained model needs to be evaluated through a test data set. The specific process is to calculate the mean absolute error, root mean square error and mean absolute percentage error based on the results output by each model training and the test data set; if the mean absolute error, the root mean square error and the mean absolute percentage error are all within the preset error range, the trained model is judged to meet the requirements.

[0073] It should be noted that the calculation formula for the mean absolute error is: The formula for calculating the root mean square error is: The mean absolute percentage error is calculated as Among them, y i and They represent the predicted value and the true value respectively. The predicted value is obtained through the model output, and the true value can be obtained from the test data set.

[0074] Step S40: obtaining a current water quality data set, and inputting the current water quality data set into the first water quality prediction model and the second water quality prediction model respectively to obtain a first water quality prediction result and a second water quality prediction result.

[0075] After completing the model training, for the aquaculture environment that needs to predict water quality, its current water quality data set can be obtained, and then the current water quality data set can be input into the first water quality prediction model and the second water quality prediction model obtained by the above training to obtain the water quality prediction result. Specifically, since the first water quality prediction model and the second water quality prediction model are aimed at different water quality parameters, two prediction results are finally obtained, namely the first water quality prediction result and the second water quality prediction result. In this embodiment, the first water quality prediction result is aimed at the dissolved oxygen content in the water, and the second water quality prediction result is aimed at the pH value in the water.

[0076] Step S50: determining a target water quality prediction result according to the first water quality prediction result and the second water quality prediction result.

[0077] After obtaining the above-mentioned first water quality prediction result and the second water quality prediction result, the first water quality prediction value and the second water quality prediction value can be respectively extracted therefrom in this embodiment. According to the different types targeted by the above-mentioned first water quality prediction result and the second water quality prediction result, the first water quality prediction value and the second water quality prediction value extracted in this embodiment also correspond to different water quality parameter types respectively. Finally, the first water quality prediction value and the second water quality prediction value are merged to obtain the target water quality prediction value. The target water quality prediction value is a dynamically changing value like the first water quality prediction value and the second water quality prediction value. The target water quality prediction result can be determined according to the changing trend of the target water quality prediction value. For example, the dissolved oxygen content included in the target water quality prediction value shows a downward trend and the pH shows an acidic change trend.

[0078] This embodiment obtains a sample water quality data set by obtaining an original water quality data set and processing the original water quality data set; divides the sample water quality data set into a training data set, a verification data set and a test data set according to a preset ratio, and classifies the training data set and the verification data set; performs model training based on the classified training data set and the classified verification data set, and evaluates the model performance through the test data set to obtain a first water quality prediction model and a second water quality prediction model; obtains a current water quality data set, and inputs the current water quality data set into the first water quality prediction model and the second water quality prediction model, respectively, to obtain a first water quality prediction result and a second water quality prediction result; determines a target water quality prediction result based on the first water quality prediction result and the second water quality prediction result. In the above manner, by using the constructed model to perform predictions in multiple dimensions, the prediction accuracy and efficiency can be improved.

[0079] Reference Figure 5 , Figure 5 This is a structural block diagram of the first embodiment of the aquaculture water quality prediction device of the present invention.

[0080] like Figure 5 As shown, the aquaculture water quality prediction device proposed in the embodiment of the present invention includes:

[0081] The processing module 10 is used to obtain an original water quality data set and process the original water quality data set to obtain a sample water quality data set.

[0082] The classification module 20 is used to divide the sample water quality data set into a training data set, a verification data set and a test data set according to a preset ratio, and classify the training data set and the verification data set.

[0083] The training module 30 is used to perform model training based on the classified training data set and the classified verification data set, evaluate the model performance through the test data set, and obtain the first water quality prediction model and the second water quality prediction model.

[0084] The prediction module 40 is used to obtain a current water quality data set, and input the current water quality data set into the first water quality prediction model and the second water quality prediction model respectively to obtain a first water quality prediction result and a second water quality prediction result.

[0085] The fusion module 50 is used to determine a target water quality prediction result according to the first water quality prediction result and the second water quality prediction result.

[0086] This embodiment obtains a sample water quality data set by obtaining an original water quality data set and processing the original water quality data set; divides the sample water quality data set into a training data set, a verification data set and a test data set according to a preset ratio, and classifies the training data set and the verification data set; performs model training based on the classified training data set and the classified verification data set, and evaluates the model performance through the test data set to obtain a first water quality prediction model and a second water quality prediction model; obtains a current water quality data set, and inputs the current water quality data set into the first water quality prediction model and the second water quality prediction model, respectively, to obtain a first water quality prediction result and a second water quality prediction result; determines a target water quality prediction result based on the first water quality prediction result and the second water quality prediction result. In the above manner, by using the constructed model to perform predictions in multiple dimensions, the prediction accuracy and efficiency can be improved.

[0087] In some embodiments, the processing module 10 is used to identify missing data in the original water quality data set;

[0088] Completing the missing data based on the adjacent data before and after the missing data;

[0089] Calculating the mean square error of the original water quality data set;

[0090] identifying outliers in the raw water quality data based on the mean square error;

[0091] Smoothing the missing data based on the adjacent data before and after the outlier;

[0092] The water quality data set after missing data processing and outlier processing is normalized to obtain a sample water quality data set.

[0093] In some embodiments, the calculation formula for missing data completion is: Among them, X k X is the missing data that needs to be filled.w With X r are the data before and after the missing data, respectively, k, r, w are preset parameters;

[0094] The calculation formula for smoothing is: Among them, X v ' represents the value after smoothing, X v-1 With X v+1 The outliers X v The adjacent data.

[0095] In some embodiments, the classification module 20 is used to determine the average Euclidean distance between each sample in the training data set and the validation data set and other samples;

[0096] Determine the number of samples within the mean Euclidean distance of each sample;

[0097] According to the sample quantity, the sample corresponding to the maximum sample quantity is used as the cluster center;

[0098] Clustering is performed based on the cluster centers of the training data set and the validation data set, and several samples corresponding to the same cluster center are classified as one class.

[0099] In some embodiments, the training module 30 is used to take BiLSTM as a basic model, add a BiLSTM layer and multiple residual units on the basis of the BiLSTM, and add a self-attention mechanism ATTN to perform model training based on the classified training data set and the classified verification data set to obtain a first reference model, and when the first reference model is determined to meet the requirements through the test data set, a first water quality prediction model is obtained;

[0100] The scale feature fusion structure is trained based on the classified training data set and the classified verification data set to obtain a second reference model, and when the second reference model is determined to meet the requirements through the test data set, a second water quality prediction model is obtained.

[0101] In some embodiments, the training module 30 is used to calculate the mean absolute error, the root mean square error and the mean absolute percentage error based on the results output by each model training and the test data set;

[0102] If the mean absolute error, the root mean square error, and the mean absolute percentage error are all within the preset error range, it is determined that the trained model meets the requirements.

[0103] In some embodiments, the fusion module 50 is used to extract a first water quality prediction value from the first water quality prediction result, and to extract a second water quality prediction value from the second prediction result, wherein the first water quality prediction value and the second water quality prediction value correspond to different water quality parameter types;

[0104] The first water quality prediction value and the second water quality prediction value are combined to obtain a target water quality prediction value;

[0105] A target water quality prediction result is obtained based on the target water quality prediction value.

[0106] An embodiment of the present application also provides an aquaculture water quality prediction device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus, and the memory is used to store an aquaculture water quality prediction program; the processor is used to implement the above-mentioned aquaculture water quality prediction method when executing the program stored in the memory.

[0107] The communication bus mentioned in the above-mentioned aquaculture water quality prediction device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc.

[0108] The communication interface is used for communication between the above-mentioned aquaculture water quality prediction device and other devices.

[0109] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0110] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, and discrete hardware components.

[0111] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.

[0112] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0113] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0114] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

[0115] It should be understood that the above is only an example and does not constitute any limitation on the technical solution of the present invention. In specific applications, technicians in this field can make settings as needed, and the present invention does not limit this.

[0116] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of the present invention. In practical applications, technicians in this field can select part or all of them according to actual needs to achieve the purpose of the present embodiment, and no limitation is made here.

[0117] In addition, for technical details not fully described in this embodiment, reference can be made to the aquaculture water quality prediction method provided in any embodiment of the present invention, and will not be repeated here.

[0118] In addition, it should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.

[0119] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0120] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory (ROM) / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0121] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

[0122] It is understandable that the system provided by the embodiment of the present invention corresponds to the method provided by the embodiment of the present invention, and the explanation, examples and beneficial effects of the relevant contents can refer to the corresponding parts in the above method.

Claims

1. A method for predicting water quality in aquaculture, characterized in that: The aquaculture water quality prediction method comprises: Acquire an original water quality data set, and process the original water quality data set to obtain a sample water quality data set; Dividing the sample water quality data set into a training data set, a verification data set and a test data set according to a preset ratio, and classifying the training data set and the verification data set; Performing model training based on the classified training data set and the classified verification data set, evaluating the model performance through the test data set, and obtaining a first water quality prediction model and a second water quality prediction model; Acquire a current water quality data set, and input the current water quality data set into the first water quality prediction model and the second water quality prediction model respectively to obtain a first water quality prediction result and a second water quality prediction result; A target water quality prediction result is determined according to the first water quality prediction result and the second water quality prediction result.

2. The method for predicting aquaculture water quality according to claim 1, characterized in that: The processing of the original water quality data set to obtain a sample water quality data set includes: identifying missing data in said original water quality dataset; Completing the missing data based on the adjacent data before and after the missing data; Calculating the mean square error of the original water quality data set; identifying outliers in the raw water quality data based on the mean square error; Smoothing the missing data based on the adjacent data before and after the outlier; The water quality data set after missing data processing and outlier processing is normalized to obtain a sample water quality data set.

3. The aquaculture water quality prediction method according to claim 2, characterized in that: The calculation formula for missing data completion is: Among them, X k X is the missing data that needs to be filled. w With X r are the data before and after the missing data, respectively, k, r, w are preset parameters; The calculation formula for smoothing is: Among them, X v ' represents the value after smoothing, X v-1 With X v+1 The outliers X v The adjacent data.

4. The method for predicting aquaculture water quality according to claim 1, characterized in that: The classifying the training data set and the verification data set includes: Determine the average Euclidean distance between each sample in the training data set and the validation data set and other samples; Determine the number of samples within the mean Euclidean distance of each sample; According to the sample quantity, the sample corresponding to the maximum sample quantity is used as the cluster center; Clustering is performed based on the cluster centers of the training data set and the validation data set, and several samples corresponding to the same cluster center are classified as one class.

5. The method for predicting aquaculture water quality according to claim 1, characterized in that: The model training is performed based on the classified training data set and the classified verification data set, and the model performance is evaluated through the test data set to obtain the first water quality prediction model and the second water quality prediction model, including: Taking BiLSTM as the basic model, adding a BiLSTM layer and a plurality of residual units to the BiLSTM, and adding a self-attention mechanism ATTN to perform model training based on the classified training data set and the classified verification data set to obtain a first reference model, and when the first reference model is determined to meet the requirements through the test data set, a first water quality prediction model is obtained; The scale feature fusion structure is trained based on the classified training data set and the classified verification data set to obtain a second reference model, and when the second reference model is determined to meet the requirements through the test data set, a second water quality prediction model is obtained.

6. The method for predicting aquaculture water quality according to claim 5, characterized in that: The evaluating the model performance by using the test data set includes: Based on the results output by each model training and the test data set, the mean absolute error, the root mean square error and the mean absolute percentage error are calculated respectively; If the mean absolute error, the root mean square error, and the mean absolute percentage error are all within the preset error range, it is determined that the trained model meets the requirements.

7. The method for predicting aquaculture water quality according to any one of claims 1 to 6, characterized in that: The determining of the target water quality prediction result according to the first water quality prediction result and the second water quality prediction result includes: Extracting a first water quality prediction value from the first water quality prediction result, and extracting a second water quality prediction value from the second prediction result, wherein the first water quality prediction value and the second water quality prediction value correspond to different water quality parameter types; The first water quality prediction value and the second water quality prediction value are combined to obtain a target water quality prediction value; A target water quality prediction result is obtained based on the target water quality prediction value.

8. An aquaculture water quality prediction device, characterized in that: The aquaculture water quality prediction device comprises: A processing module, used to obtain an original water quality data set, and process the original water quality data set to obtain a sample water quality data set; A classification module, used to divide the sample water quality data set into a training data set, a verification data set and a test data set according to a preset ratio, and classify the training data set and the verification data set; A training module, used for performing model training based on the classified training data set and the classified verification data set, evaluating the model performance through the test data set, and obtaining a first water quality prediction model and a second water quality prediction model; A prediction module, used for acquiring a current water quality data set, inputting the current water quality data set into the first water quality prediction model and the second water quality prediction model respectively, to obtain a first water quality prediction result and a second water quality prediction result; A fusion module is used to determine a target water quality prediction result based on the first water quality prediction result and the second water quality prediction result.

9. The aquaculture water quality prediction device according to claim 8, characterized in that: The processing module is used to identify missing data in the original water quality data set; Completing the missing data based on the adjacent data before and after the missing data; Calculating the mean square error of the original water quality data set; identifying outliers in the raw water quality data based on the mean square error; Smoothing the missing data based on the adjacent data before and after the outlier; The water quality data set after missing data processing and outlier processing is normalized to obtain a sample water quality data set.

10. The aquaculture water quality prediction device according to claim 9, characterized in that: The calculation formula for missing data completion is: Among them, X k X is the missing data that needs to be filled. w With X r are the adjacent data before and after the missing data, k, r, w are preset parameters; the calculation formula for smoothing is: Among them, X v ' represents the value after smoothing, X v-1 With X v+1 The outliers X v The adjacent data.