Fishery water quality risk prediction method and system based on fusion mechanism inversion and time delay constraint
Patent Information
- Application Number
- CN202611005410.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-07
- Publication Date
- 2026-10-02
AI Technical Summary
[0007]本发明实施例的目的是提供一种融合机理反演与时滞知识约束的设施渔业水质风险预测方法及系统,以解决现有渔业水质预测中,难获取指标趋势反演困难、纯数据驱动模型依赖大样本且缺乏机理约束、无法显式表达氨氮向亚硝酸盐转化的时滞逻辑,以及在极端工况与样本稀缺条件下预测稳定性与可解释性不足的问题
本发明通过实时采集基础监测数据和生产操作数据,并据此获取当前机理反演特征,以基础易测指标-机理反演的方式补充难监测指标的隐状态,有效降低了对高成本在线传感器的依赖。利用当前机理反演特征和训练后的隐状态预测模型获取当前隐状态特征,并将二者共同作为带时滞知识约束的时序预测模型的输入,获取氨氮趋势预测曲线和亚硝酸盐趋势预测曲线,能够将风险识别时间窗口前移,实现对未来风险的提前预测。最终基于氨氮和亚硝酸盐的趋势预测曲线获取综合风险等级,技术定位更加前置,为渔业生产管理提供更及时的决策支持。
Smart Images

Figure CN122865175A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent monitoring and time-series modeling of aquatic environment in facility fisheries, and specifically to a method and system for predicting water quality risks in facility fisheries that integrates mechanism inversion and time-delay knowledge constraints. Background Technology
[0002] Facility-based fisheries are highly sensitive to key indicators such as dissolved oxygen, temperature, pH, ammonia nitrogen, and nitrite. However, in actual production, truly high-frequency, stable, and low-cost online monitoring indicators are usually limited to a few basic indicators such as dissolved oxygen, temperature, and pH. Ammonia nitrogen and nitrite sensors are expensive, complex to maintain, and susceptible to contamination, drift, and calibration cycles, making them difficult to operate continuously for extended periods in high-density production environments. Therefore, how to use readily available indicators to infer difficult-to-obtain indicators and predict water quality deterioration trends in advance has become a key technical challenge in the intelligent monitoring of facility-based fisheries.
[0003] Existing technologies propose a neural network-based method for predicting aquaculture water quality, using sensor sampling, water quality data correction, and a backpropagation (BP) neural network to predict water quality parameters. This type of technology can fit and predict existing historical water quality sequences, but its basic approach remains purely data-driven, relying heavily on a large number of historical samples of existing target indicators. This makes it difficult to maintain robust performance in scenarios where high-quality labels for ammonia nitrogen and nitrite are scarce or online sampling is unstable. Existing technologies also disclose ammonia removal systems based on upstream and downstream ammonia sensors and controllers in recirculating aquaculture systems. This type of technology focuses on directly detecting ammonia and controlling the treatment unit to perform removal. Its advantage is a clear control chain, but it relies on the target indicator itself being measurable online, failing to address the fundamental problems of expensive sampling, significant drift, and numerous monitoring blind spots.
[0004] Meanwhile, existing technologies disclose ammonia control systems that coordinate the operation of controllers, pumps, airlift devices, and biofilters. This approach leans more towards water treatment device control logic and has practical value for maintaining system operation; however, its core remains processing observed ammonia levels rather than using fish metabolism, water chemical balance, and time lag relationships to predict future risks. Some facility-based fisheries systems also employ simple threshold alarms or conventional time-series regression models, triggering alarms when dissolved oxygen, temperature, and pH reach abnormal thresholds. However, ammonia nitrogen accumulation, nitrite formation, and non-ionic ammonia risks often involve significant time lags and mechanistic constraints; simple threshold alarms typically occur after the risk has already formed, failing to provide sufficient lead time.
[0005] Based on the existing technologies described above, at least the following technical shortcomings exist: First, most schemes treat various water quality indicators as parallel time series, lacking explicit modeling of the chain-causal process of fish metabolism—oxygen consumption changes—nitrogenous waste release—nitrification conversion. Second, existing schemes generally require the target indicators themselves to be continuously measurable, or require a large number of high-quality historical tags, which is difficult to adapt to the production reality of sparse ammonia nitrogen and nitrite tags and easy sensor drift. Third, existing models usually do not provide structured constraints on the time lag of ammonia nitrogen to nitrite conversion, thus lacking the ability to predict nitrite risk in advance. Fourth, existing methods usually do not incorporate the dissociation equilibrium relationship between NH3, pH, and Temperature into the model training process, resulting in insufficient extrapolation ability of the model under extreme operating conditions and missing data.
[0006] Therefore, it is necessary to propose a water quality risk prediction scheme for facility fisheries that integrates mechanism inversion, time-delay knowledge constraints, and physical-guided self-supervised learning, so as to achieve early judgment of difficult-to-monitor indicators and future risks under basic sensor conditions. Summary of the Invention
[0007] The purpose of this invention is to provide a method and system for predicting water quality risks in facility-based fisheries that integrates mechanism inversion and time-delay knowledge constraints. This addresses the problems in existing fisheries water quality prediction, such as difficulty in obtaining indicator trends, reliance on large samples and lack of mechanism constraints in pure data-driven models, inability to explicitly express the time-delay logic of ammonia nitrogen to nitrite conversion, and insufficient prediction stability and interpretability under extreme operating conditions and sample scarcity.
[0008] To achieve the above objectives, embodiments of the present invention provide a method for predicting fishery water quality risk that integrates mechanism inversion and time-delay constraints, comprising: Real-time collection of basic monitoring data and production operation data from facility-based fisheries systems; The current mechanism inversion characteristics are obtained based on the aforementioned basic monitoring data and production operation data; Construct and train a hidden state prediction model; Based on the current mechanism inversion features, the trained hidden state prediction model is used to obtain the current hidden state features. A time-series prediction model with time-delay knowledge constraints is constructed, and the ammonia nitrogen trend prediction curve and nitrite trend prediction curve are obtained. The input of the time-series prediction model with time-delay knowledge constraints includes the current mechanism inversion feature and the current hidden state feature. Based on the ammonia nitrogen trend prediction curve and the nitrite trend prediction curve, the comprehensive risk level is obtained.
[0009] Optionally, obtaining the current mechanism inversion features based on the basic monitoring data and production operation data includes: The oxygen consumption rate of the fish population was calculated based on the dissolved oxygen time series to obtain the dissolved oxygen consumption rate. The feeding amount, fish biomass and water exchange volume are mapped to organic load per unit time to obtain the feeding load per unit biomass. The non-ionic ammonia ratio factor was calculated based on pH and temperature to obtain the pH-temperature coupling factor. The ammonia nitrogen generation and accumulation trend is estimated by combining the oxygen consumption rate, feeding load and circulating water renewal rate to obtain the estimated nitrogen load per unit time.
[0010] Optionally, constructing and training the hidden state prediction model includes: During the model training phase, a physical-guided self-supervised task is introduced, which includes at least one or more of the following: multivariate mask recovery task, sequence fragment order discrimination task, and cross-condition comparative learning task.
[0011] Optionally, constructing and training the hidden state prediction model includes: The training loss function of the hidden state prediction model includes a chemical equilibrium consistency constraint, which is as follows: ; in, This is the predicted risk value for non-ionic ammonia. This represents the non-ionic ammonia ratio factor obtained based on pH and temperature. For the total ammonia nitrogen estimate, For weight hyperparameters.
[0012] Optionally, constructing and training the hidden state prediction model includes: The training loss function of the hidden state prediction model includes a nitrogen cycle consistency constraint, which is as follows: ; in, For nitrogen load increment, The rate of ammonia nitrogen accumulation. For weight hyperparameters.
[0013] Optionally, constructing a time-series prediction model with time-delay knowledge constraints and obtaining ammonia nitrogen trend prediction curves and nitrite trend prediction curves includes: The time series prediction model adopts a time series modeling structure based on the attention mechanism. When calculating the attention weight of the future trend of nitrite on the historical ammonia nitrogen accumulation rate time series, a time delay bias matrix B is superimposed on the original attention score matrix to obtain the corrected attention score matrix. The element B(i,j) in the i-th row and j-th column of the time delay bias matrix B represents the time delay bias value of the future prediction time i on the historical input time j.
[0014] Optionally, in the time delay bias matrix B, the element value corresponding to the ammonia nitrogen input at a specific lag period is set to a positive value to enhance the model's attention to the lag signal; the element value corresponding to the ammonia nitrogen input at the current time and the historical time within the preset time window is set to a value lower than the positive value or a negative value to suppress the model's attention to the ammonia nitrogen signal that has not yet completed nitrification.
[0015] Optionally, the time-delay bias matrix is a dynamic matrix, and its bias value distribution is adaptively adjusted according to the aquaculture operating parameters, including: When the water temperature rises, the nitrification rate accelerates, and the peak bias position in the time-delay bias matrix shifts towards the current time. When the circulation efficiency decreases or the biological filter is in the recovery period, the nitrification rate slows down, and the peak bias position in the time-delay bias matrix shifts towards the historical time.
[0016] Optionally, based on the ammonia nitrogen trend prediction curve and the nitrite trend prediction curve, the comprehensive risk level is obtained, including: Based on the deviation score of basic indicators, the accumulation rate of ammonia nitrogen and the risk value of non-ionized ammonia, the probability of the peak of the ammonia nitrogen trend prediction curve and the nitrite trend prediction curve exceeding the safe threshold within the future time window, the prediction confidence level, and the context of recent operational events, a discrete comprehensive risk level is generated by fusing the data through preset weighting rules or a learned risk mapping function.
[0017] On the other hand, the present invention also provides a fishery water quality risk prediction system that integrates mechanism inversion and time-delay constraints, implementing the fishery water quality risk prediction method that integrates mechanism inversion and time-delay constraints as described above, wherein the system includes: The data acquisition module is used to collect basic monitoring data and production operation data in the facility fishery system in real time; The mechanism inversion module is used to obtain the current mechanism inversion characteristics based on the basic monitoring data and production operation data, and generate the hidden state characteristics of difficult-to-monitor indicators. The physics-guided training module is used to perform self-supervised tasks and consistency constraint training. The time series forecasting module is used to construct a time series forecasting model with time delay knowledge constraints and obtain the ammonia nitrogen trend forecasting curve and the nitrite trend forecasting curve. The risk assessment module is used to obtain a comprehensive risk level based on the ammonia nitrogen trend prediction curve and the nitrite trend prediction curve.
[0018] The beneficial effects of this invention are: This invention acquires real-time basic monitoring data and production operation data, and obtains current mechanism inversion features based on this data. It supplements the latent states of difficult-to-monitor indicators with a basic, easily measurable indicator-mechanism inversion approach, effectively reducing reliance on high-cost online sensors. Using the current mechanism inversion features and a trained latent state prediction model, it obtains current latent state features and uses both as input to a time-series prediction model with time-delay knowledge constraints to obtain ammonia nitrogen and nitrite trend prediction curves. This allows for an earlier risk identification window, enabling advance prediction of future risks. Finally, based on the ammonia nitrogen and nitrite trend prediction curves, a comprehensive risk level is obtained, providing more proactive technical positioning and timely decision support for fisheries production management.
[0019] Other features and advantages of the embodiments of the present invention will be described in detail in the following detailed description section. Attached Figure Description
[0020] The accompanying drawings are provided to further illustrate embodiments of the present invention and form part of the specification. They are used together with the following detailed description to explain the embodiments of the present invention, but do not constitute a limitation thereof. In the drawings: Figure 1 A flowchart of a fishery water quality risk prediction method based on fusion mechanism inversion and time-delay constraints according to an embodiment of the present invention; Figure 2 This is a framework diagram of a fishery water quality risk prediction system that integrates mechanism inversion and time-delay constraints according to one embodiment of the present invention. Detailed Implementation
[0021] The specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit the scope of the present invention.
[0022] It should be noted that the acquisition, transmission, storage, use, and processing of data in the technical solution of this application all comply with relevant laws and regulations. In the embodiments of this application, certain existing industry solutions such as software, components, and models may be mentioned. These should be considered exemplary, intended only to illustrate the feasibility of implementing the technical solution of this application, and do not imply that the applicant has already used or necessarily used such solutions.
[0023] like Figure 1 The diagram shows a flowchart of a fishery water quality risk prediction method based on a fusion mechanism inversion and time-delay constraints according to an embodiment of the present invention. Figure 1 In this context, the prediction method may include the following steps: In step S10, basic monitoring data and production operation data of the facility fishery system are collected in real time; In step S11, the current mechanism inversion characteristics are obtained based on the basic monitoring data and production operation data; In step S12, a hidden state prediction model is constructed and trained; In step S13, based on the current mechanism inversion features, the trained hidden state prediction model is used to obtain the current hidden state features; In step S14, a time series prediction model with time delay knowledge constraints is constructed and the ammonia nitrogen trend prediction curve and nitrite trend prediction curve are obtained. The input of the time series prediction model with time delay knowledge constraints includes the current mechanism inversion features and the current hidden state features. In step S15, the comprehensive risk level is obtained based on the ammonia nitrogen trend prediction curve and the nitrite trend prediction curve.
[0024] In such Figure 1 In the fishery water quality risk prediction method based on fusion mechanism inversion and time-delay constraints, step S10 is used to collect basic monitoring data and production operation data in the facility fishery system in real time. In this embodiment, the basic monitoring data includes at least one or more of dissolved oxygen, temperature, pH, and circulation flow rate, and the production operation data includes at least one or more of feeding records, fish biomass estimates, aeration status, and water exchange status.
[0025] Furthermore, time synchronization, outlier removal, drift detection, and missing segment labeling are performed on the basic monitoring data to form a multivariate time series with data quality labels.
[0026] Step S11 is used to obtain the current mechanism inversion characteristics based on the basic monitoring data and production operation data. In this embodiment, the mechanism inversion characteristics include at least one or more of the following: dissolved oxygen consumption rate, feed loading per unit biomass, pH-temperature coupling factor, circulating water renewal rate, and estimated nitrogen load per unit time.
[0027] One method for obtaining the dissolved oxygen consumption rate is to calculate the change in oxygen consumption rate of the fish population based on dissolved oxygen time series data. Specifically, in this example, the difference between dissolved oxygen sensor readings is calculated within a preset sliding time window for the collected dissolved oxygen time series data. The mechanical oxygenation amount for the corresponding period in the aeration equipment operation log is deducted. The aeration contribution of the equipment is estimated based on the aerator power, circulation flow rate, aeration flow rate, and gas solubility coefficient. At the same time, the natural reoxygenation amount at the water surface is deducted. The dissolved oxygen saturation difference is obtained by looking up tables based on water temperature and salinity. The oxygenation amount from the external environment is estimated in conjunction with the water surface flow state. The net reduction in dissolved oxygen is divided by the length of the time window to obtain the oxygen consumption rate per unit time of the fish population within the current time window, which is recorded as the oxygen consumption rate time series. This series reflects the current stocking density and the metabolic level of the fish.
[0028] The method for obtaining the unit biomass feeding load can be to map the feeding amount, fish biomass, and water exchange volume to the organic load per unit time. Specifically, in this example, the unit biomass feeding amount is obtained by dividing the cumulative feeding amount recorded in the current time window (from the feeding log) by the current estimated fish biomass value (from the biomass monitoring module or manual recording); the water exchange volume is obtained by multiplying the circulating water pump flow rate by the time window length, and the dilution rate of dissolved organic matter in the water is calculated accordingly; the difference between the unit biomass feeding amount and the dilution rate is mapped to a proxy index of the net increase in organic matter in the current time window, i.e., the unit time organic load. This index reflects the net accumulation trend of organic matter in the water under the current conditions and is a key driving variable for subsequent ammonia nitrogen generation rate inversion.
[0029] The pH-temperature coupling factor can be obtained by calculating the non-ionic ammonia ratio factor based on pH and temperature. Specifically, in this example, it is determined based on the ratio of NH3 to NH4 in the water. + The chemical dissociation equilibrium between pH and temperature is crucial. The proportion α of non-ionic ammonia (NH3) in total ammonia nitrogen is a function of pH and water temperature. α increases with rising pH or water temperature, indicating increased toxicity, and vice versa. α, the pH-temperature coupled non-ionic ammonia proportion factor, is calculated based on current measured pH and temperature sensor readings using tables or empirical formulas (e.g., approximate formulas based on the Henderson-Hasselbalch equation). This factor is used to convert subsequent predicted trends in total ammonia nitrogen into a more direct risk value for non-ionic ammonia toxicity.
[0030] The circulating water renewal rate can be obtained by collecting circulating flow data, multiplying the circulating flow by the time window length to calculate the water exchange volume, and finally dividing by the rated total water volume to obtain the circulating water renewal rate.
[0031] The method for obtaining the nitrogen load estimate per unit time can be to jointly estimate the ammonia nitrogen generation and accumulation trend based on the oxygen consumption rate, feeding load, and water turnover rate. Specifically, in this example, the ammonia nitrogen excretion per unit time is estimated using the oxygen consumption rate per unit time through the fish respiratory quotient (i.e., the physiological ratio between ammonia excretion and oxygen consumption). This respiratory quotient ratio coefficient can be obtained from empirical values in literature or calibration experiments to estimate the ammonia nitrogen excretion rate generated by fish metabolism. At the same time, the ammonia nitrogen rate generated by organic matter decomposition is estimated using the organic load per unit time (i.e., a proxy index for the net accumulation trend of organic matter), which is the amount of ammonia nitrogen produced by bacterial heterotrophic metabolism. Then, the ammonia nitrogen dilution corresponding to the circulating water turnover rate is subtracted, which is the ammonia nitrogen dilution rate corresponding to the circulating flow rate multiplied by the time window length. The sum of the three is the net estimate of the nitrogen load per unit time within the current time window. This estimate reflects the net change trend of ammonia nitrogen concentration in the water within the current time window and serves as one of the core driving input features for the subsequent latent state estimation model.
[0032] Step S12 is used to construct and train the latent state prediction model. In this embodiment, the latent state estimation model takes the mechanism inversion features obtained in step S11 as input and outputs at least one of the following: ammonia nitrogen accumulation rate, non-ionic ammonia risk value, and nitrite precursor state value. This is used to supplement target indicator information when the target sensor is missing or sampling is low-frequency. Specifically, the ammonia nitrogen accumulation rate characterizes the net change trend of ammonia nitrogen concentration in the water body within the current time window; the non-ionic ammonia risk value comprehensively reflects the toxicity risk level corresponding to the product of the current total ammonia nitrogen concentration and the non-ionic ammonia proportion factor; and the nitrite precursor state value characterizes the degree of ammonia nitrogen accumulation as a precursor to nitrite formation and subsequent nitrification efficiency.
[0033] Specifically, the hidden state prediction model employs a multi-input multi-output sequence modeling structure. The input is a multi-dimensional time-series vector consisting of dissolved oxygen consumption rate, feed load per unit biomass, pH-temperature coupling factor, circulating water renewal rate, and estimated nitrogen load per unit time. Dynamic hidden state representations are extracted using a deep network capable of modeling temporal dependencies. In this example, the deep network can employ structures such as gated recurrent unit networks, temporal Transformers, or state-space models. For the three output types—ammonia nitrogen accumulation rate, non-ionic ammonia risk value, and nitrite pre-state value—a shared encoder is used to extract the common hidden state representation, along with an independent decoder head structure. The encoder is responsible for extracting the common hidden state vector reflecting the water quality evolution trend within the current time window from the time series of mechanistic inversion features. The ammonia nitrogen accumulation rate decoder head, the non-ionic ammonia risk value decoder head, and the nitrite pre-state value decoder head each map the common hidden state vector to the corresponding output space through independent fully connected layers. Since the three output types share the same set of mechanistic driving factors, including fish metabolism, organic load changes, and water nitrogen cycle, the shared encoder design helps to achieve multi-objective collaborative supervised training under conditions of limited labeled samples. For scenarios where decoupling through physical constraints is difficult, independent sub-models can also be established for the three output types, and the outputs of the three sub-models can be aggregated during the risk assessment stage.
[0034] In this example, a physical-guided self-supervised task is introduced in the model training phase of step S12. The physical-guided self-supervised task includes at least one or more of the following: multivariate mask recovery task, sequence fragment order discrimination task, and cross-condition comparative learning task.
[0035] In the multivariate masking recovery task, multivariate refers to the mechanistic inversion features obtained in step S11, including dissolved oxygen consumption rate, feed load per unit biomass, pH-temperature coupling factor, circulating water renewal rate, and estimated nitrogen load per unit time, as well as the latent target variables output by the model, namely, ammonia nitrogen accumulation rate, non-ionized ammonia risk value, and nitrite pre-state value. The masking method involves randomly marking the value of a variable in the input feature time series as missing within a specific time period. The recovery task requires the model to predict the value of the masked variable during the missing time period based on the remaining visible variables and the time series context, thereby enabling the model to learn the physical correlation structure between variables and enhancing its generalization ability when some sensors are missing.
[0036] The sequence fragment order discrimination task divides the time series of mechanism inversion features during normal aquaculture into several segments in chronological order. After randomly shuffling the order of the segments, the model is required to determine the correct temporal position of each segment. Through this task, the model is trained to implicitly model the temporal patterns of water quality evolution, such as the increase in oxygen consumption rate after feeding and the delayed accumulation of ammonia nitrogen after high load.
[0037] In the cross-condition comparative learning task, a condition is defined as a classification label of time periods based on key operational events in aquaculture, including large-scale feeding, water changes, power outage recovery, and cleaning of biological filters, along with water quality status. The sample construction for comparative learning involves using feature sequences from different time periods within the same condition category as positive sample pairs and feature sequences from different condition categories as negative sample pairs. The purpose of cross-condition comparative learning is to enable the model to distinguish water quality evolution patterns under different conditions in the representation space, thereby allowing for more accurate assessment of risk states under new conditions during testing. In this example, chemical equilibrium consistency constraints and nitrogen cycle consistency constraints are added to the loss function to ensure that the model output satisfies the dissociation equilibrium relationship between NH3, pH and temperature, and the basic monotonic constraint between nitrogen load change and target index change.
[0038] Among them, the chemical equilibrium consistency constraint imposes a constraint on the non-ionic ammonia risk value output by the model, requiring that the risk value maintain monotonic consistency with the theoretical reference value obtained by multiplying the theoretical scaling factor determined by the NH3 equilibrium dissociation equation based on the simultaneously input pH value and water temperature by the ammonia nitrogen accumulation rate; that is, the non-ionic ammonia risk value should increase accordingly with the increase of pH or temperature, and decrease accordingly with the decrease of total ammonia nitrogen. Predictions that violate the above monotonic relationship will be subject to additional penalties.
[0039] Furthermore, the chemical equilibrium consistency constraint term is expressed as: ; in, This represents the risk value of non-ionic ammonia predicted by the model. The non-ionic ammonia proportion factor is calculated from tables based on pH and temperature or by the Henderson-Hasselbalch equation. For the total ammonia nitrogen estimate, For weight hyperparameters.
[0040] By constraining chemical equilibrium consistency, the relationship between the non-ionic ammonia risk value output by the model and pH and temperature can be limited, enabling the model to learn a latent state representation that conforms to the laws of water chemistry even during the training phase when direct ammonia nitrogen labels are lacking.
[0041] The nitrogen cycle consistency constraint imposes constraints on the ammonia nitrogen accumulation rate and nitrite pre-state value output by the model. It requires that the ammonia nitrogen accumulation rate should not decrease when the estimated nitrogen load per unit time increases, and that the ammonia nitrogen accumulation rate should remain positively correlated with the trend of nitrite pre-state value after the time lag period, so as to ensure that the model output does not violate the basic mass conservation and monotonic relationship of the nitrogen cycle as a whole.
[0042] Furthermore, the nitrogen cycle consistency constraint term is expressed as: ; in, For nitrogen load increment, The rate of ammonia nitrogen accumulation. As a weighted hyperparameter, it is required that the increment of nitrogen load and the increment of ammonia nitrogen accumulation rate have the same sign.
[0043] Step S13 is used to retrieve the current hidden state features based on the current mechanism inversion features and to obtain the current hidden state features using the trained hidden state prediction model.
[0044] Step S14 is used to construct a time-series prediction model with time-delay knowledge constraints and obtain the ammonia nitrogen trend prediction curve and the nitrite trend prediction curve. The input of the time-series prediction model with time-delay knowledge constraints includes the current mechanism inversion features and the current hidden state features. In this embodiment, the time-series prediction model introduces a time-delay bias matrix during attention calculation or state transition. This time-delay bias matrix is used to represent the delay, action time window, and decay relationship of the impact of ammonia nitrogen fluctuations on future nitrite changes.
[0045] Specifically, in this example, the time delay bias matrix is introduced into the attention calculation process as follows: the time series prediction model adopts a time series modeling structure based on the attention mechanism, such as Transformer or a linear attention variant. When calculating the attention weight of the current prediction target, i.e., the future trend of nitrite, on the historical input feature, i.e., the ammonia nitrogen accumulation rate time series, the corresponding element value of the time delay bias matrix is superimposed on the original attention score. That is, the corrected attention score is equal to the sum of the original attention score and the element in the i-th row and j-th column of B, where the element in the i-th row and j-th column of B is the element in the i-th row and j-th column of the time delay bias matrix, corresponding to the time delay bias value of the future prediction time i on the historical input time j. The bias values of the rows and columns related to the ammonia nitrogen input in the time delay bias matrix are positive, which are used to enhance attention to the ammonia nitrogen signal at a specific lag period. The bias values corresponding to the ammonia nitrogen input at the current time and the time too close to the historical time are set to positive numbers lower than the above positive values, which are used to reduce attention to the ammonia nitrogen signal that has not yet completed the nitrification conversion. In this way, the prior knowledge of the domain that there is a time delay in the conversion of ammonia nitrogen to nitrite is structurally embedded into the attention weight.
[0046] Furthermore, the time-lag bias matrix is not a fixed constant, but dynamically adjusted based on current aquaculture parameters, including water temperature, circulation efficiency, and the operating status of the biofilter. This allows the model to adapt to the time differences in the rise of ammonia nitrogen followed by a delayed rise of nitrite under different aquaculture conditions. When the water temperature is high, the metabolic rate of nitrifying bacteria accelerates, shortening the lag period for the conversion of ammonia nitrogen to nitrite, and the peak bias position in the time-lag bias matrix shifts accordingly towards the current time. When the circulation efficiency is low or the biofilter is in the recovery period, the nitrification process slows down, the lag period lengthens, and the peak bias position in the time-lag bias matrix shifts accordingly towards more distant historical times. Historical nitrification efficiency can be estimated by the residual between periodically manually measured nitrite data and the model-predicted nitrite pre-state value, and the adjustment rules of the time-lag bias matrix are dynamically corrected based on the estimation results.
[0047] Step S15 is used to obtain the comprehensive risk level based on the ammonia nitrogen trend prediction curve and the nitrite trend prediction curve. Specifically, the time-series prediction model outputs the predicted ammonia nitrogen trend and nitrite trend values for each moment in the next few hours based on the current and historical mechanism inversion characteristics and latent state characteristics, forming the ammonia nitrogen prediction curve and the nitrite prediction curve. Then, the comprehensive risk level is jointly determined based on the following information: First, the deviation scores of the current basic indicators, namely dissolved oxygen, pH, temperature, and circulation flow rate, from the normal range; Second, the ammonia nitrogen accumulation rate and non-ionized ammonia risk value in the latent state estimation results; Third, the predicted probability that the peak values of the ammonia nitrogen prediction curve and the nitrite prediction curve will exceed the safety threshold within the future time window; Fourth, the prediction confidence level; Fifth, the context of recent operational events, such as records of operations that may exacerbate the risk, such as large-scale feeding, power outage recovery, water change, and cleaning of the biological filter. The above five types of information are summarized through preset weighting rules or learned risk mapping functions to obtain the comprehensive risk level, which can be discretized into several levels such as low, medium, high, and emergency. When the overall risk level exceeds the preset threshold, the system triggers an early warning and generates corresponding treatment suggestions based on the current risk type, including the risk of ammonia nitrogen exceeding the standard, the risk of non-ionic ammonia toxicity, and the risk of nitrite exceeding the standard, as well as the context of the most recent operation event. These suggestions include increasing oxygen in advance, adjusting the feeding amount, arranging water exchange, or prompting manual retesting.
[0048] Furthermore, the prediction confidence score is calculated based on the data quality labels and model output residuals. When the confidence score is lower than a threshold, a notification is sent to the management end for manual review or enhanced sampling to reduce the risk caused by a single abnormal data point. Specifically, the prediction confidence score calculation process includes: the data quality score is calculated based on the data quality labels formed in the aforementioned steps, and the proportion of data quality labels of each basic sensor within the current prediction time window, namely drift markers, outlier markers, and missing markers, is statistically analyzed. The higher the proportion, the lower the data quality score. The model output residual score is calculated based on the prediction results of the time series prediction model for recent historical periods and the actual observed values for that period. When low-frequency manual measurements are available for comparison, the mean square error between them is calculated. The larger the residual, the lower the model output residual score. The data quality score and the model output residual score are weighted according to preset weights to obtain the comprehensive prediction confidence score. When the overall prediction confidence level falls below the preset confidence threshold, the system sends a manual review prompt to the management end. The prompt includes the reason for the low confidence level, such as data quality issues or large model residuals, the current confidence level value, and suggested handling methods, such as arranging manual verification of relevant sensors or arranging manual sampling to measure ammonia nitrogen and nitrite in key pools. For pools with persistently low confidence levels, the system may also suggest increasing the frequency of manual sampling for ammonia nitrogen or nitrite to supplement more measured monitoring data for dynamic model correction.
[0049] Example 1: Early warning of ammonia nitrogen and nitrite in recirculating aquaculture systems First, hardware configuration is carried out: dissolved oxygen, temperature, pH and circulation flow sensors are deployed in the circulating water workshop, while ammonia nitrogen and nitrite are only sampled manually at low frequency; the acquisition system is connected to the edge gateway to complete data synchronization and preliminary quality screening.
[0050] The software parameters include: the mechanism inversion module estimates the ammonia nitrogen accumulation trend based on feeding records, fish biomass, and oxygen consumption rate; the time series prediction module adopts a neural network structure with time delay bias; and the training phase combines mask recovery and consistency constraints for joint optimization.
[0051] Next, follow these steps: Step 1: Continuously collect basic indicators and operation logs.
[0052] Specifically, dissolved oxygen sensors, pH sensors, water temperature sensors, and circulating flow meters in the aquaculture workshop continuously collect basic indicators at a preset sampling frequency, such as once per minute, and write the readings into the data access module; feeding logs, including the time and amount of each feeding, and equipment operation logs, including aerator start-up and shutdown records and water pump flow setpoint change records, are synchronously written by the aquaculture management system; the data access module aligns the above multiple data sources to a unified time axis and then outputs them to subsequent modules.
[0053] Step 2: Identify and quality-label the basic sensor drift segments.
[0054] Specifically, the data quality management module performs frame-by-frame quality assessment on the time-series data from each sensor collected in step 1: For dissolved oxygen sensors, it checks whether the readings are within the theoretical dissolved oxygen saturation range under the current water temperature and salinity conditions, and whether there is monotonous slow drift across multiple sampling points, used to characterize reading deviations caused by sensor contamination; for pH sensors, it checks whether the readings exceed the normal pH range of the aquaculture water, such as the reasonable range for a certain species of freshwater aquaculture, and whether there are slow fluctuation characteristics consistent with the water temperature and carbonate system; for water temperature sensors, it checks whether the readings exceed the reasonable range of the current season, and whether there are abnormal jumps in a short period of time; for identified drift segments or outliers, quality labels are added to the data in the corresponding time window, namely drift labels, outlier labels, or missing value labels, for use in confidence calculation; before the labeled data enters the mechanism inversion feature calculation, the effective observation values of adjacent times or the estimated values corrected by the calibration formula are used to replace them, so as to reduce the interference of low-quality data on subsequent feature calculations.
[0055] Step 3: Generate latent state estimation features based on oxygen consumption rate, feeding load, and circulation flow rate.
[0056] Specifically, the mechanism inversion module, following the method described in step S11, calculates the changes in oxygen consumption rate, organic load per unit time, pH-temperature coupled non-ionic ammonia ratio factor, circulating water renewal rate, and estimated nitrogen load per unit time within the current sliding time window, organizing them into a mechanism inversion feature vector for the current moment. Simultaneously, the latent state estimation model, a deep sequence model that has undergone physical-guided self-supervised pre-training and fine-tuning with a small number of labeled samples, takes the time series of mechanism inversion features from several historical time windows as input and outputs the estimated ammonia nitrogen accumulation rate, estimated non-ionic ammonia risk value, and estimated nitrite pre-state value for the current moment, supplementing the latent state information of water quality not directly measured by sensors.
[0057] Step 4: Output the ammonia nitrogen trend and nitrite trend for the next few hours.
[0058] Specifically, the time-series prediction model with time-delay knowledge constraints takes the current and historical mechanism inversion feature time series, hidden state estimation results, and current operation event context as input. In this embodiment, the operation event context is a record of high-density feeding over several consecutive days. This context triggers the model to model the time-delay effect of nitrogen accumulation risk after high load as input. Through the time-delay bias matrix, which has been automatically adjusted according to the current water temperature to adjust the peak bias position to correspond to the expected nitrification lag period at the current water temperature, the attention weight is corrected, and the model outputs the future preset time window, such as the ammonia nitrogen trend prediction curve and nitrite trend prediction curve for each moment in the next few to tens of hours. The system also marks the time periods in the prediction curve that exceed the safety threshold for use in the next risk level assessment.
[0059] Step 5: When the risk level exceeds the threshold, prompt the user to increase oxygenation, adjust feeding, or arrange for water change in advance.
[0060] Specifically, in this embodiment, the risk level assessment module determines that there are periods in the nitrite trend prediction curve that exceed the safety threshold within a preset time window, and the non-ionic ammonia risk value is estimated to be on an upward trend. The overall risk level is rated as a high risk level. Based on this, the system triggers an early warning and generates disposal suggestions based on the context of continuous high-density feeding in the current operation log: prioritize partial water exchange to reduce the accumulated ammonia nitrogen and organic load in the water; temporarily increase the oxygenation output before water exchange to avoid the risk of short-term fluctuations in dissolved oxygen caused by water agitation during water exchange; and appropriately reduce the feeding amount in the next few days to alleviate the peak of organic load. The disposal suggestions are pushed to the aquaculture management terminal in the form of a message, and the corresponding prediction confidence level is marked for the aquaculture personnel to refer to for decision-making.
[0061] Expected results: This embodiment helps to provide risk signals before significant nitrite exceedances occur, allowing farmers time to take action.
[0062] Compared to existing water quality prediction schemes based on threshold alarms or relying solely on direct sensor readings, the method described in this embodiment has at least the following differences in recirculating aquaculture systems: First, existing threshold alarm schemes only trigger when the measured values of nitrite or ammonia nitrogen reach the alarm threshold, at which point the water quality is already in an excessive state. This embodiment, through latent state estimation and time-delay knowledge constraints, can predict the risk of exceeding the standard within the next few hours while ammonia nitrogen and nitrite are still within safe ranges, providing aquaculture personnel with a window of opportunity for early intervention. Second, existing machine learning-based water quality prediction schemes typically use sensor readings directly as input, and the prediction error increases significantly when sensors drift or are missing. This embodiment, through mechanistic inversion features, including indicators such as oxygen consumption rate and organic load as intermediate feature layers, has strong tolerance to short-term drift of a single sensor. Third, existing time-series forecasting schemes typically do not distinguish between causal time-delay relationships between different indicators, but instead apply uniform attention weights to all historical moments. This embodiment uses a time-delay bias matrix to structurally embed the time delay of ammonia nitrogen to nitrite conversion into the forecasting model, which ensures greater accuracy in predicting nitrite levels at specific times after high-density feeding.
[0063] Example 2: Sensor Missing Tolerance Prediction in Seedling Workshop First, hardware configuration was carried out. Basic water quality sensors were installed in the seedling workshop. Online ammonia nitrogen sensors were only installed in some ponds, resulting in data loss during certain periods.
[0064] The software parameters include: the physical-guided training module uses a large number of unlabeled basic water quality sequences to learn the general state representation during the pre-training phase, and then uses a small amount of manually measured ammonia nitrogen and nitrite data for fine-tuning.
[0065] Next, follow these steps: Step 1: Perform unified preprocessing on multi-pool data.
[0066] Specifically, in this embodiment, the seedling workshop contains multiple seedling ponds. The sensor configurations of each pond vary due to differences in construction period and cost: some ponds are only equipped with dissolved oxygen and water temperature sensors, lacking direct ammonia nitrogen measurement devices and pH sensors. The data access module integrates and aligns the sensor data from all ponds to the same timeline. For missing pH data in some ponds, the data quality management module first attempts to find the pH reference value for that pond under similar breeding stages and feeding loads from historical data of the same period, filling the missing field with the reference value and marking the field with an "estimated filling" quality label. For ponds with both dissolved oxygen and water temperature data, the data quality management module also performs cross-pond consistency verification on the dissolved oxygen time series of each pond. When there is a significant discrepancy in the dissolved oxygen change trend of adjacent ponds in the same batch of seedlings, the pond is marked as abnormal and made available for manual verification to improve the reliability of the unified pretreatment results across multiple ponds.
[0067] Step 2: In the pool of missing target sensor data, the hidden state is estimated through the mechanism inversion module.
[0068] Specifically, for nursery ponds lacking pH sensors, the mechanism inversion module calculates the pH-temperature coupled non-ionic ammonia ratio factor using the estimated filling pH reference value from step 1 when generating the mechanism inversion feature vector. It also includes the estimated filling quality label of this field in the data quality score during confidence calculation, thereby reducing the confidence contribution of this item. For nursery ponds with only dissolved oxygen and water temperature data, the mechanism inversion module can still calculate the oxygen consumption rate change based on dissolved oxygen time series, calculate the organic load per unit time and circulating water renewal rate based on the feeding log, and combine the estimated filling pH with the above three items to jointly organize the mechanism inversion feature vector. The latent state estimation model uses this incomplete feature vector, which includes the estimated filling field, as input, and outputs the estimated results of ammonia nitrogen accumulation rate, non-ionic ammonia risk value, and nitrite pre-state value. Since some fields of the input features are derived from estimation rather than actual measurement, the uncertainty of the latent state estimation is higher than that of ponds with complete sensor configuration. This uncertainty will be reflected in the prediction confidence of subsequent steps.
[0069] Step 3: Generate future trends based on the time-delay knowledge prediction module and output the confidence level.
[0070] Specifically, for each nursery pond, the time-series prediction model with time-delay knowledge constraints receives the time-series of mechanism inversion features and the estimation results of latent states output from step 2. It dynamically adjusts the peak bias position of the time-delay bias matrix based on the current water temperature. Since the water temperature in the nursery is usually lower than that in the adult fish farming area, the nitrification lag period is correspondingly extended. Therefore, the peak position of the time-delay bias matrix shifts towards more distant historical moments, outputting the ammonia nitrogen trend prediction curve and nitrite trend prediction curve within the future preset time window. Simultaneously, the prediction confidence calculation module outputs confidence for each nursery pond: a data quality score derived from the statistics of the estimated fill field ratio and sensor quality labels from step 1, and a model output residual score. This residual score is derived from a comparison with a small number of historical manually measured ammonia nitrogen values. If the most recent manually measured record for a pond is far from the current time, the residual score weight is reduced to obtain a comprehensive confidence score, which is then graded according to the confidence level of each pond. The prediction results for high-confidence ponds can be directly used for risk assessment, while the prediction results for low-confidence ponds include obvious uncertainty warnings.
[0071] Step 4: Prompt manual retesting for pools with low confidence, and push key inspections to pools with high risk.
[0072] Specifically, the comprehensive risk level assessment module classifies all seedling ponds according to the prediction curves and confidence levels output in step 3: For seedling ponds with a comprehensive confidence level lower than the preset confidence threshold, the system pushes a manual retest prompt to the aquaculture management end. The prompt includes the specific reasons for the low confidence level, such as the pH field being filled with an estimate, the historical manual measurement record being too far from the current time, the currently estimated latent risk level, and the recommended testing items, namely, manual sampling to measure ammonia nitrogen or nitrite concentration; For seedling ponds with a qualified confidence level but a comprehensive risk level exceeding the preset risk threshold, the system pushes a key inspection reminder. The reminder includes the specific indicators predicted to exceed the standard, namely, the ammonia nitrogen trend or nitrite trend, the expected time of exceeding the standard, and the current latent state estimate; If a seedling pond meets both the low confidence level and the high risk level, both types of prompts are pushed and marked as high priority, and it is recommended to arrange manual sampling for confirmation first. The system also records the results of this multi-pool scan, including the confidence level, risk level, and prediction curve summary of each pool, as a batch inspection snapshot at the current moment for managers to review.
[0073] Expected results: This embodiment is beneficial for deploying sensors in incomplete production environments, maintaining a relatively continuous risk assessment capability.
[0074] On the other hand, the present invention also includes a fishery water quality risk prediction system that integrates mechanism inversion and time-delay constraints, such as... Figure 2As shown, the system includes a data acquisition module, a mechanism inversion module, a physical-guided training module, a time-series prediction module, and a risk assessment module. The data acquisition module collects basic monitoring data and production operation data from the facility-based fisheries system in real time. The mechanism inversion module obtains current mechanism inversion characteristics based on the basic monitoring data and production operation data, and generates latent state characteristics of difficult-to-monitor indicators. The physical-guided training module performs self-supervised tasks and consistency constraint training. The time-series prediction module constructs a time-series prediction model with time-delay knowledge constraints and obtains ammonia nitrogen trend prediction curves and nitrite trend prediction curves. The risk assessment module obtains a comprehensive risk level based on the ammonia nitrogen trend prediction curves and nitrite trend prediction curves.
[0075] The beneficial effects of this invention are: This invention employs a strategy of using readily measurable basic indicators and mechanism inversion to supplement the latent states of difficult-to-monitor indicators such as ammonia nitrogen and nitrite, thereby effectively reducing the system's reliance on high-cost online sensors. In the feature construction process, the relationships between fish oxygen consumption, feeding load, and water balance are introduced, which, compared to purely data-driven prediction schemes, better reflects the physiological mechanism constraints under facility-based aquaculture scenarios. By explicitly incorporating the time-lag bias matrix from ammonia nitrogen to nitrite into the time-series prediction model, the time window for risk identification is shifted from when nitrite anomalies have already appeared to the early stage of ammonia nitrogen anomaly fluctuations. Simultaneously, the model integrates chemical equilibrium consistency constraints between NH3, pH, and temperature, as well as nitrogen cycle consistency constraints, enabling the invention to maintain good extrapolation robustness even under sensor deficiencies, insufficient samples, or extreme operating conditions. The prediction confidence level is simultaneously provided when outputting the risk level, prompting manual verification under low-confidence conditions, thereby reducing the risk of erroneous decisions based solely on a single prediction result. Compared to the traditional approach of direct measurement and post-processing, the core innovation of this invention lies in first reversing the invisible indicators and then predicting their future evolution in advance, thus positioning the technology more proactively.
[0076] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0077] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0078] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0079] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0080] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0081] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0082] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0083] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0084] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A method for predicting fishery water quality risk that integrates mechanism inversion and time-delay constraints, characterized in that, The method includes: Real-time collection of basic monitoring data and production operation data from facility-based fisheries systems; The current mechanism inversion characteristics are obtained based on the aforementioned basic monitoring data and production operation data; Construct and train a hidden state prediction model; Based on the current mechanism inversion features, the trained hidden state prediction model is used to obtain the current hidden state features. A time-series prediction model with time-delay knowledge constraints is constructed, and the ammonia nitrogen trend prediction curve and nitrite trend prediction curve are obtained. The input of the time-series prediction model with time-delay knowledge constraints includes the current mechanism inversion feature and the current hidden state feature. Based on the ammonia nitrogen trend prediction curve and the nitrite trend prediction curve, the comprehensive risk level is obtained.
2. The method according to claim 1, characterized in that, The current mechanism inversion characteristics obtained based on the aforementioned basic monitoring data and production operation data include: The oxygen consumption rate of the fish population was calculated based on the dissolved oxygen time series to obtain the dissolved oxygen consumption rate. The feeding amount, fish biomass and water exchange volume are mapped to organic load per unit time to obtain the feeding load per unit biomass. The non-ionic ammonia ratio factor was calculated based on pH and temperature to obtain the pH-temperature coupling factor. The ammonia nitrogen generation and accumulation trend is estimated by combining the oxygen consumption rate, feeding load and circulating water renewal rate to obtain the estimated nitrogen load per unit time.
3. The method according to claim 1, characterized in that, Building and training a hidden state prediction model includes: During the model training phase, a physical-guided self-supervised task is introduced, which includes at least one or more of the following: multivariate mask recovery task, sequence fragment order discrimination task, and cross-condition comparative learning task.
4. The method according to claim 1, characterized in that, Building and training a hidden state prediction model includes: The training loss function of the hidden state prediction model includes a chemical equilibrium consistency constraint, which is as follows: ; in, This is the predicted risk value for non-ionic ammonia. This represents the non-ionic ammonia ratio factor obtained based on pH and temperature. For the total ammonia nitrogen estimate, For weight hyperparameters.
5. The method according to claim 1, characterized in that, Building and training a hidden state prediction model includes: The training loss function of the hidden state prediction model includes a nitrogen cycle consistency constraint, which is as follows: ; in, For nitrogen load increment, The rate of ammonia nitrogen accumulation. For weight hyperparameters.
6. The method according to claim 1, characterized in that, The construction of a time-series prediction model with time-delay knowledge constraints and the acquisition of ammonia nitrogen and nitrite trend prediction curves include: The time series prediction model adopts a time series modeling structure based on the attention mechanism. When calculating the attention weight of the future trend of nitrite on the historical ammonia nitrogen accumulation rate time series, a time delay bias matrix B is superimposed on the original attention score matrix to obtain the corrected attention score matrix. The element B(i,j) in the i-th row and j-th column of the time delay bias matrix B represents the time delay bias value of the future prediction time i on the historical input time j.
7. The method according to claim 6, characterized in that, In the time-delay bias matrix B, the element values corresponding to the ammonia nitrogen input at a specific lag period are set to positive values to enhance the model's attention to the lag signal; the element values corresponding to the ammonia nitrogen input at the current time and the historical time within the preset time window are set to positive numbers lower than the positive values to suppress the model's attention to ammonia nitrogen signals that have not yet completed nitrification.
8. The method according to claim 6, characterized in that, The time-delay bias matrix is a dynamic matrix, and its bias value distribution is adaptively adjusted according to the aquaculture operating parameters, including: When the water temperature rises, the nitrification rate accelerates, and the peak bias position in the time-delay bias matrix shifts towards the current time. When the circulation efficiency decreases or the biological filter is in the recovery period, the nitrification rate slows down, and the peak bias position in the time-delay bias matrix shifts towards the historical time.
9. The method according to claim 1, characterized in that, Based on the aforementioned ammonia nitrogen trend prediction curve and nitrite trend prediction curve, the comprehensive risk level is obtained as follows: Based on the deviation score of basic indicators, the accumulation rate of ammonia nitrogen and the risk value of non-ionized ammonia, the probability of the peak of the ammonia nitrogen trend prediction curve and the nitrite trend prediction curve exceeding the safe threshold within the future time window, the prediction confidence level, and the context of recent operational events, a discrete comprehensive risk level is generated by fusing the data through preset weighting rules or a learned risk mapping function.
10. A fishery water quality risk prediction system integrating mechanism inversion and time-delay constraints, implementing the fishery water quality risk prediction method integrating mechanism inversion and time-delay constraints as described in any one of claims 1-8, characterized in that, The system includes: The data acquisition module is used to collect basic monitoring data and production operation data in the facility fishery system in real time; The mechanism inversion module is used to obtain the current mechanism inversion characteristics based on the basic monitoring data and production operation data, and generate the hidden state characteristics of difficult-to-monitor indicators. The physics-guided training module is used to perform self-supervised tasks and consistency constraint training. The time series forecasting module is used to construct a time series forecasting model with time delay knowledge constraints and obtain the ammonia nitrogen trend forecasting curve and the nitrite trend forecasting curve. The risk assessment module is used to obtain a comprehensive risk level based on the ammonia nitrogen trend prediction curve and the nitrite trend prediction curve.