Aquaculture water quality prediction and adjustment method and system combined with large model

Through the BiTCN-RNN neural network combining large models and multi-head attention mechanism, efficient and accurate prediction and automatic regulation of aquaculture water quality are achieved, and the problem of poor timeliness of water quality prediction in the existing technology is solved, and the benefits and capabilities of the aquaculture industry are improved. Continuity.

CN119272915APending Publication Date: 2025-01-07HUZHOU UNIVERSITY
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411269049.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-11
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

The existing aquaculture water quality prediction technology has poor timeliness and low reliability, and it is impossible to predict and prevent water quality deterioration in a timely manner, resulting in economic losses.

Method used

Using aquaculture water quality prediction and regulation method combined with large models, the BiTCN-RNN neural network model with multi-head attention mechanism is used to predict time series by monitoring parameters such as dissolved oxygen, pH, and water temperature, and pre-processing is carried out by using the BiTCN-RNN neural network model with multi-head attention mechanism, and the knowledge of external experts is used for pre-processing. , realize efficient and accurate prediction and automatic regulation of water quality.

Benefits of technology

Accurate prediction and timely regulation of water quality have been achieved, manual intervention has been reduced, decision-making accuracy has been improved, aquaculture costs have been reduced, and the modernization and sustainable development of the aquaculture industry has been promoted.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119272915A_ABST
    Figure CN119272915A_ABST
Patent Text Reader

Abstract

The embodiment of the invention aims to provide an aquaculture water quality prediction and adjustment method and system combined with a large model. The system mainly comprises the following modules: a data acquisition module, a hardware implementation module, a neural network module, a user side module and a cloud service module, in a specific implementation aspect, the method comprises the following steps: selecting dissolved oxygen, PH value and water temperature of a target water body and weather, environment temperature and environment humidity of an external environment as monitoring and prediction objects, collecting variables through external hardware, preprocessing data by using a large model, and obtaining a prediction result based on preprocessed water body time sequence data. A BiTCN-RNN time sequence neural network model combined with a multi-head attention mechanism is established, a prediction result is obtained, display and early warning can be carried out at the front end, and reasonable regulation and control can be carried out in a system processable range.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of aquaculture water quality prediction, and in particular to an aquaculture water quality prediction and regulation method and system combined with a large model. Background Art

[0002] At present, the most widely used breeding model is still the traditional extensive centralized breeding. This traditional breeding model lacks scientific guidance. Farmers often rely on experience and feelings for management, and lack scientific and reasonable control over water quality, feed, and medication, resulting in great uncertainty and risk in the breeding process. Among them, the deterioration of breeding water quality is the most direct and primary factor causing aquatic diseases. In the past, the technical means of monitoring and identifying water quality changes in aquaculture were relatively backward, and were limited by complex mechanisms, multiple variables, nonlinearity, and fuzzy uncertainties. The traditional method of observing water color with the naked eye or taking aquaculture water to the laboratory for testing to judge the quality of water has the disadvantages of poor timeliness and low reliability. Once water quality problems are found, it is often too late, which may cause huge economic losses.

[0003] With the rise of big models, it has become a trend to use big models for time series prediction. However, in the water quality prediction of the aquaculture industry, the effect of using only the sample-free prediction of big models is not ideal due to the lack of prior knowledge of professional industries.

[0004] To help aquaculture move towards "digital fisheries", intelligent regulation of water quality is a very important link. Therefore, how to efficiently and accurately predict the aquaculture water quality and regulate it in a timely and reasonable manner has become a problem that technical personnel in this field need to solve urgently. Summary of the invention

[0005] In view of the above, the implementation of the present invention aims to provide a method and system for predicting and regulating water quality in aquaculture combined with a large model, so as to solve the technical problem in the existing field of aquaculture water quality prediction that once water quality problems are discovered, it is too late and it is impossible to dynamically predict future water quality and prevent problems before they occur.

[0006] The technical solution provided by the present invention mainly includes the following steps: Select the dissolved oxygen content, pH value, water temperature of the target water body and the weather, ambient temperature and ambient humidity of the external environment as the monitoring and prediction objects, collect each variable through external hardware, and generate the required time series; Model the data of some different variables in the time series and explore the different feedback mechanisms between the variables to obtain the prior weight influence; To preprocess the data using a large model, the sequence should first be processed into an input that the large model can understand, that is, each column of time series data is converted into a discrete identifier, and different types of data in the same group of series are separated by commas. The series of data that can be recognized by the large language model obtained in this way is called the first vector. At the same time, since the large model has a limit on the maximum length of the input sequence, the sliding window method is used for the input of the first vector to the large model. The window slides on the sequence, moving a certain step size (which may be less than the window length) each time, thereby generating overlapping subsequences. This helps the model capture continuous time dependencies. These overlapping subsequences are input into the large language model, and the anomalies and missing values ​​in the sequence are judged and corrected, and the second vector corresponding to the first vector data is output; Reprocess the second vector into the general form of a time series, and generate a third vector that has been preprocessed by a large model and can be predicted by a neural network according to the format of a traditional deep learning time series prediction method; Based on the preprocessed water body time series data, a BiTCN-RNN time series neural network model combined with a multi-head attention mechanism is established to predict the data of the next time node in the third vector; The obtained prediction results can be displayed and warned on the front end. When the predicted data will become severe in the short term, the management personnel will be warned through the system display page, and the water body can be reasonably regulated within the system's processing range (such as temperature and oxygen content).

[0007] In terms of specific implementation, it mainly includes the following modules: Data acquisition and processing module: collect fish pond information through water quality sensors, which should at least include temperature, dissolved oxygen content, and pH value, and obtain data information including at least the temperature and humidity of the fish pond location through the API interface connected to the weather forecast of the Meteorological Bureau, store the collected water quality time series data, and convert the time series into a format that can be recognized by the large model before transmitting it to the language large model; and after the preprocessing of the large model is completed, construct the sequence into a data sequence matrix; change the above matrix into a standard sequence matrix with a dimension that matches the number of heads of the multi-head attention mechanism; Neural network module, builds a BiTCN-RNN network combined with a multi-head attention mechanism to perform prediction analysis on the standard sequence matrix, obtains prediction results, makes judgments and anomaly analysis on the prediction results, and transmits the prediction results to the cloud; The cloud service module uses a soft gateway to link the IoT device and the software end. The IoT uses the soft gateway as the client of the MQTT protocol. By subscribing and publishing topics, the collected data is sent to the cloud, or instructions are received from the cloud. The software end interacts with the cloud through the HTTP / HTTPS protocol to transmit data.

[0008] Furthermore, in the neural network module, the constructed BiTCN-RNN network prediction model combined with the multi-head attention mechanism is used to extract the standard sequence matrix features, including: Use multi-channel RNN to extract information from the sequence, extract the trend feature matrix, position feature matrix, and dependency feature matrix from the sequence matrix in turn and connect them into a new feature matrix; Finally, the outputs of the BiTCN model and the RNN model are integrated through a merging layer connection, so that the long-term dependency information provided by BiTCN and the short-term local features captured by RNN can be used in the final decision layer for the final prediction.

[0009] Furthermore, the main purpose of weighing and selecting appropriate attention heads is to capture the complex associations between different variables. When determining the standard sequence matrix of the input, the query, key, and value of the original input are three-dimensional tensors, and the number of matrices corresponds to the number of multi-head attention heads.

[0010] Furthermore, the convolutional layer of the neural prediction network should be: , When the convolution kernel size is K×K, the weight parameter matrix of the convolution layer should be , in, is the input dimension, is the output dimension, for height and width; Then the weight parameters of the fully connected layer are: , in, is the input dimension, is the output dimension.

[0011] The beneficial effect of adopting the above measures is that, first of all, large models are applied to the preprocessing stage, which can make full use of their generalization ability in different fields. In addition, the introduction of external expert knowledge and specific task descriptions in the form of prompts further improves the effect of large language models on time series tasks, while avoiding the problem of biased prediction results due to insufficient prior knowledge when facing few samples and long sequence prediction tasks; the neural network layer combines BiTCN and RNN into a two-stream model, and integrates the outputs of the two networks through the merging layer, so that the long-term dependency information provided by BiTCN and the short-term local features captured by RNN can be used simultaneously in the final decision layer. Usually, this decision layer consists of one or more fully connected layers for final prediction; the model also inserts a multi-head attention mechanism, which calculates attention weights through multiple heads, and the weight of each head is determined by its corresponding weight matrix, which is learned during the training process. This enables the model to adaptively distribute the importance between different heads. The weights between different heads can be different, allowing the model to focus on different aspects of the input data. The characteristics of multi-head attention help capture the correlation and importance between elements, thereby improving the model's ability to extract important features in time series. And through the attention calculation of multiple heads, the model can be processed in parallel, thereby improving computational efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] In order to more clearly describe the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can also be obtained based on these drawings without creative work.

[0013] Figure 1 A logical architecture diagram of an embodiment of an aquaculture water quality prediction and regulation system combined with a large model provided by the present invention; Figure 2 An algorithm logic schematic diagram of an aquaculture water quality prediction and regulation system combined with a large model provided by the present invention. DETAILED DESCRIPTION

[0014] The following is a clear and complete description of the technical solution of the present invention in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the present invention, not all embodiments. According to the embodiments of the present invention, those skilled in the art can obtain all other embodiments without paying creative work, and these embodiments all belong to the protection scope of the present invention.

[0015] See also Figure 1The logical architecture diagram of the aquaculture water quality prediction and regulation system combined with a large model provided in an embodiment of the present invention, the system should include a data acquisition module, a hardware implementation module, a neural network module, a user terminal module and a cloud service module, wherein: Data acquisition and processing module: Collect fish pond information through water quality sensors, which should at least include temperature, dissolved oxygen content, and pH value, and obtain data information including at least the temperature and humidity of the fish pond location through an API interface connected to the weather forecast of the Meteorological Bureau, store the collected water quality time series data, and convert the time series into a format that the large model can recognize before transmitting it to the language large model; and after the preprocessing of the large model is completed, construct the sequence into a data sequence matrix; change the above matrix into a standard sequence matrix with a dimension that matches the number of heads of the multi-head attention mechanism.

[0016] The neural network module constructs a BiTCN-RNN network combined with a multi-head attention mechanism to perform predictive analysis on the standard sequence matrix, obtain the prediction results, make judgments and abnormal analysis on the prediction results, and judge whether the current water quality needs warning or adjustment based on the analysis results. If the water quality will deteriorate in a short period of time in the future, the warning information will be sent to the cloud. If the warning information is not processed in time and the water quality is poor, the corresponding measures will be intelligently selected for regulation according to the water quality conditions.

[0017] The cloud service module uses a soft gateway to link the IoT device and the software end. The IoT uses the soft gateway as the client of the MQTT protocol. By subscribing and publishing topics, the collected data is sent to the cloud, or instructions from the cloud are received. The software end interacts with the cloud through the HTTP / HTTPS protocol to transmit data. After receiving the water quality warning information, the warning information will be displayed on the administrator's front-end page to prompt the management staff to deal with it as soon as possible. If the hardware has been automatically regulated by the algorithm, the regulation status will be saved in the log.

[0018] The hardware implementation module should at least include a heating rod that can adjust the water temperature, a water quality sensor that detects pH, water temperature, and dissolved oxygen, an aerator that increases the oxygen content in the water, and an industrial computer that controls the heating rod and the aerator. It should be responsible for turning on the control equipment when the cloud server sends a water quality control instruction, and sending a feedback signal when the water quality tends to be within the normal range, requesting to shut down the equipment and stop the water quality control measures.

[0019] In the user-side module, users can monitor and control water quality by logging into their accounts. The data between different accounts are independent of each other. After entering the account, it is divided into the user management part and the large-screen display part. The user management part can add, modify, and delete different fish ponds to be managed. When different fish ponds are selected to enter their pages, their current data will be displayed in a table on the front-end web page. When the data is within the abnormal range, the data will be marked in red to prompt the management personnel to handle it. There are switch buttons for different control methods above the table. When the button of the control device is manually turned on, the operation time and the operation device number will be stored in the log file for archiving; the large-screen display part can select different fish ponds to display their data. In the large-screen state, the data will be displayed in the form of charts in a more intuitive and elegant manner. The large screen can directly receive real-time data from sensors and draw data curves to help users analyze trends and improve decision-making capabilities.

[0020] The data collection and processing module is arranged in chronological order, with each time node 5 minutes apart. After the data collection is completed, the data is preprocessed. To preprocess the data using the big model, the sequence should first be processed into an input that the big model can understand, that is, each column of time series data is converted into a discrete identifier, and different types of data in the same group of series are separated by commas. The series of data that can be recognized by the language big model obtained in this way is called the first vector. At the same time, because the big model has a limit on the maximum length of the input sequence, the sliding window method is used for the input of the first vector to the big model. The window slides on the sequence. Move a certain step size (which may be less than the window length) each time to generate overlapping subsequences, which helps the model capture continuous time dependencies. These overlapping subsequences are input into the language model, and the anomalies and missing values ​​in the sequence are judged and corrected, and the second vector corresponding to the first vector data is output; the second vector is reprocessed into the general form of a time series, and a third vector that has been preprocessed by the large model and can be predicted by a neural network is generated according to the format of the traditional deep learning time series prediction method. At the same time, the input data features are analyzed, which should at least include seasonality, trend, and periodicity.

[0021] Neural Network Module, see Figure 2 The algorithm structure diagram of the aquaculture water quality prediction system combined with a large model provided by the present invention, the input data is predicted by the BiTCN model and the RNN model respectively, and the outputs of the two models are connected and integrated through the merging layer after the prediction is completed, so as to achieve the purpose of using the long-term dependency information provided by BiTCN and the short-term local features captured by RNN in the final decision layer at the same time, so as to output the final prediction result; In the BiTCN model, the network structure consists of two TCNs. One TCN learns the time information in the data to capture past patterns and dependencies. The other TCN encodes future covariates to help the model predict future trends and changes. In order to better capture the global dependencies in time series data, a multi-head attention mechanism is embedded in the residual block at the top of the TCN in the past layer. In multi-head attention, the input vector is represented as X=[{x}_{1}{,x}_{2}{,...,x}_{n}] , Where n is the length of the sequence; When linearly transforming the input vector to obtain vector representations of queries, keys, and values, a different weight matrix is ​​used for each head: , , , Among them are , , They are query vector, key vector, and value vector respectively. , , is a learnable weight matrix; Next, we use the dot product to calculate the similarity between the query vector and the key vector , Use the Softmax function to normalize the similarity , The output of each head is concatenated together to form the final multi-head attention output: Multi-head output = [{output}_{1}{, output}_{2}, {output}_{h}] , Finally, the multi-head output is linearly transformed to obtain the final output , Here is another learnable weight matrix; At the same time, in order to make multiple heads compute in parallel, the number of outputs of the linear transformation of queries, keys, and values ​​is set to , Where h is the number of heads and p is the output dimension of the linear transformation in each head, so that each head can focus on a different part of the input, thus representing more complex functions than a simple weighted average; Benefiting from the advantages of RNN in processing time series prediction, the time series data of each parameter can be used as feature input. The size of the input layer should match the number of input features. Multiple RNN layers are used to process different input channels in parallel. Each channel's input layer to hidden layer and hidden layer to output layer must set its own weights and bias items. These weights and bias items refer to the weights and bias items at the beginning of training. , And so on to the Nth variable: Modeling, in, represents the value of the (i)th variable at time (t), is a constant term, is the weight influence coefficient of the (i)th variable on the (j)th variable, is the error term. It is set and updated through the back propagation algorithm and optimization algorithm during the training process.

[0022] In the hidden layer of the model, RNN will gradually extract the deep features of these time series data, which will be used for the final prediction task; The final output layer combines the long-term dependency information provided by BiTCN with the multi-head attention mechanism and the short-term local features captured by RNN, and is used in the final decision layer to output the final prediction results.

[0023] According to the different requirements of different aquaculture species for water quality, different normal thresholds of water quality data should be designed for different fish ponds managed by the local system according to the aquaculture species. The specific characteristics and prediction targets of different fish ponds may be different. Each fish pond should be trained separately with its own unique time series prediction model, so as to select the matching model in the prediction task of different fish ponds, and improve the specific prediction and personalized decision support capabilities for different fish ponds.

[0024] In the embodiment of the present invention, in the hardware implementation part, the aerator, the heating rod, and the water quality sensor are connected to the industrial computer and placed in the fish pond. The industrial computer is placed at a suitable position beside the fish pond. First, data collection is performed, and the collected data is pre-processed to be made into an input form that can be received by the algorithm model. After the algorithm model makes a prediction, taking the processing of dissolved oxygen as an example, if the result shows that the dissolved oxygen content will be in a relatively low range for the aquaculture in a short time in the future, the dissolved oxygen in the current fish pond is marked in red on the front-end page, and a "pending" label is marked, and relevant data such as equipment number, date and time are saved, waiting for relevant management personnel to process. If it has not been properly processed for a long time, the current dissolved oxygen index no longer meets the suitable living conditions of the aquaculture, then the system automatically turns on the dissolved oxygen machine until the index is in a suitable position, and the operation is recorded in the equipment log. User-side module, enter the homepage by entering the account and password on the login page. The homepage is divided into the fish pond operation interface managed by the current user and the large-screen display interface. The operation page lists all the fish ponds managed by the user. Enter the fish pond page. The device number and working status bound to the current fish pond are displayed on the top, and the water quality data of the current fish pond at the current time node is displayed in a table at the bottom. There is a prediction button in the upper right corner. After clicking the prediction, the water quality of the current fish pond in the future will be predicted, and the predicted data of the next six time nodes will be displayed in sequence behind the current data. More time node data can be viewed in the prediction details interface, with every 5 minutes as a time node; if the algorithm is abnormal, you can also click the device to enter the device interface, click the start button for manual adjustment, and the device usage record will be written into the device log.

[0025] In summary, this implementation adopts the combination of manual control and algorithm detection to realize intelligent prediction and regulation of water quality. When water quality problems have not been dealt with after they occur, a neural network algorithm model is used to intervene, and the prediction results are uploaded to the server. The server displays the warning information on the front-end page. The data directly fed back by the sensor to the server is in an unsuitable growth range, and the server directly controls the relevant hardware facilities for regulation, thereby realizing automatic regulation. Compared with manual detection, automatic prediction and regulation technology can provide more accurate data, reduce errors, and improve the accuracy of decision-making. These accurate data not only help farmers to understand the water quality of fish ponds in a timely manner, but also provide a basis for formulating scientific breeding strategies. It is an important symbol of the modernization and intelligence of the aquaculture industry, and an important means to improve the efficiency of aquaculture and promote the sustainable development of the industry.

[0026] The basic principle of the present invention is to realize the automatic prediction and regulation of the water quality of the fish pond, so as to optimize the breeding environment and improve the breeding efficiency. The main feature of the present invention is to realize the real-time monitoring, data analysis and predictive regulation of the water quality of the fish pond by integrating a large model and a neural network algorithm. The advantage of the present invention is that it can accurately monitor water quality parameters, provide timely warnings, and reduce manual intervention and reduce breeding costs through an automated control system. For technicians in this industry, it should be understood that the present invention is not limited to the embodiments described above. The descriptions in these embodiments and the specification are only examples of the present invention, not limitations. Without violating the core idea and protection scope of the present invention, the present invention can be variously changed and improved according to actual needs. These changes and improvements should be deemed to be included in the protection scope of the present invention. Finally, the protection scope of the present invention will be defined by the attached claims and their equivalents, and is intended to cover all technical solutions that conform to the principles, features and advantages of the present invention.

Claims

1. A method and system for predicting and regulating aquaculture water quality combined with a large model, characterized in that: The following steps are involved: Obtain water quality data in water areas, including dissolved oxygen, pH value, and water temperature; Obtain external environmental information including weather, ambient temperature, and ambient humidity; Use a large model to preprocess the acquired data; A water quality prediction model was built, which uses a neural network to extract key features from the training set, and then these features are fed into a prediction model that integrates a multi-head attention mechanism. Through this combination, the model can accurately capture the complex patterns, long-term trends, and correlations between variables in the water quality data series; Predict water quality data and obtain final data based on water quality test results; Upload the data to the system platform and include it in the historical data set; Combined with the growth curve of the cultured species, the model output is fed back to the big model to analyze the water quality data; When the predicted water quality indicators are not suitable for the growth of aquatic organisms, the water quality is regulated in advance to ensure that it maintains dynamic fluctuations within a range suitable for the growth of farmed organisms.

2. The water quality prediction method according to claim 1, characterized in that: The big model preprocesses the data; before the time series data is input into the model, the big model is used to preprocess the data, and the big model is used to identify the patterns and trends in the time series data, and learn its periodicity, seasonality, trend and other characteristics.

3. The water quality prediction method according to claim 2, characterized in that: Considering the mutual influence between different variables in the multivariate time series, we explore different feedback mechanisms between variables to obtain the prior weight influence: Modeling different sequence data: , And so on to the Nth variable: , in, represents the value of the (i)th variable at time (t), is a constant term, is the weight influence coefficient of the (i)th variable on the (j)th variable, is the error term.

4. The water quality prediction method according to claim 3, characterized in that: The features of the sequence data are input into the prediction model of the time series prediction network that introduces the multi-head attention mechanism. Different parameter sets are set for different heads in the multi-head attention mechanism through the feedback weights between different variables to calculate the attention. Each head focuses on different aspects of the data. The multi-head attention mechanism is added to the neural network model. The data is dynamically weighted and the weights are readjusted through the impact of different water quality data on the prediction results.

5. A method and system for predicting and regulating water quality in aquaculture combined with a large model, applied to the water quality prediction method as described in any one of claims 1 to 4 above, characterized in that: The large model is integrated into the system through the API interface to pre-process the input data, analyze the output data for different aquaculture species, and use auxiliary hardware to control water quality.

6. A method and system for predicting and regulating aquaculture water quality in combination with a large model according to claim 5, characterized in that: The microservice architecture is used to cope with the diverse device environment in the IoT system. Its system units include: Data collection unit: water quality data is collected using various sensors, and external weather data such as temperature and humidity are directly obtained by calling relevant API interfaces; The data interaction unit adopts a soft gateway design and automatically adapts to multiple protocols according to the device type; The data preprocessing unit cleans, normalizes, and extracts features of the data to be predicted in advance through the large model interface, and analyzes its patterns and trends; The parameter setting unit calculates the influence weights between different types of data by parameterizing a small part of the data in advance, and uses this prior knowledge to initialize the weights, helping the model converge faster in the early stages; The network training unit divides the training set in the data to train the neural network and saves different models trained by different training sets; Sequence prediction unit, selects appropriate network model to predict water quality data; The water quality control unit includes an aerator and a heating rod. The system combines a large model to predict the best growth environment for the aquaculture species associated with the water quality. When the data will become bad in the short term, the system automatically warns the management personnel and intelligently controls the above equipment.

7. The method and system for predicting and regulating aquaculture water quality combined with a large model according to claim 5, characterized in that: The input data is predicted by the BiTCN model and the RNN model respectively. After the prediction is completed, the outputs of the two models are integrated through the merging layer to achieve the purpose of using the long-term dependency information provided by BiTCN and the short-term local features captured by RNN for the final decision layer at the same time to output the final prediction result. In the BiTCN model part, the network structure consists of two TCNs. One TCN learns the time information in the data to capture past patterns and dependencies; the other TCN encodes future covariates to help the model predict future trends and changes. At the same time, in order to better capture the global dependencies in time series data, a multi-head attention mechanism is embedded in the top residual block of the TCN in the past layer.

Citation Information

Cited By

  • Common animal disease early warning method and system based on breeding environment detection data

    CN120853889A

  • Common animal disease early warning method and system based on breeding environment detection data

    CN120853889B