Water quality prediction model training method, water quality prediction method, device and related equipment
By combining multi-resolution multi-channel remote sensing images and timing water quality parameters, and using neural network models to extract and fusion features, the accuracy of existing water quality prediction methods when data is insufficient or environment is complex, achieving more efficient water quality prediction.
Patent Information
- Application Number
- CN202411242502.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-05
- Publication Date
- 2024-11-26
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
When the existing water quality prediction methods are insufficient in data volume or complex environment, the prediction accuracy is not high, and it is difficult to effectively utilize various geographical and environmental factors, making it difficult to accurately predict water quality data with complex spatiotemporal distribution.
Using multi-resolution multi-channel remote sensing images and timing water quality parameters, the image and timing modal features are extracted through neural network models, and a variety of environmental information is fused. The codec model is used to fusion and prediction, and the model parameters are updated until the preset is reached. Conditions to form a trained water quality prediction model.
The accuracy of water quality prediction is improved, and through the complementary multimodal information, the prediction ability of the model is enhanced to adapt to changes in complex water quality environments.
Smart Images

Figure CN119027831A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular to a water quality prediction model training method, a water quality prediction method, a device and related equipment. Background Art
[0002] Water quality prediction is an important research direction in the field of water environment science and engineering, which aims to predict the water quality in the future based on the observed values of relevant parameters in the water body. The existing methods mainly use statistical methods to combine historical observation data to predict and evaluate water quality data.
[0003] In the process of realizing the present invention, the inventors found that water quality data has the characteristics of strong spatiotemporal variability, complex nonlinear relationships, data scarcity, and difficulty in obtaining. Factors such as climate change, topography, and water body characteristics will further affect the physical, chemical, and biological processes of the water body, resulting in a more complex spatiotemporal distribution of water quality data. Affected by various geographical environmental factors, existing prediction methods require a large amount of data support and are highly dependent on data. When the amount of data is insufficient or the environment is more complex, there is a problem of low prediction accuracy. Summary of the invention
[0004] The embodiments of the present invention provide a water quality prediction model training method, a water quality prediction method, an apparatus, a computer device and a storage medium to improve the accuracy of water quality prediction.
[0005] In order to solve the above technical problems, the present application embodiment provides a water quality prediction model training method, including:
[0006] Acquire historical remote sensing images and time-series water quality parameters, wherein the historical remote sensing images are multi-resolution multi-channel remote sensing images of the water quality area to be monitored that were collected historically, and the time-series water quality parameters are water quality parameters collected at different times;
[0007] Inputting the historical remote sensing image and the time series water quality parameter into an initial water quality prediction model for prediction to obtain a first prediction result, wherein the initial water quality prediction model includes a first sub-model and a second sub-model, wherein the first sub-model is a neural network model for extracting remote sensing features of an image modality, and the second sub-model is a codec for extracting sequence features of a time series modality;
[0008] Based on the first prediction result, the loss function is calculated and back-propagated, the gradient is calculated according to the result of the back-propagation, and the model parameters are updated based on the gradient until the preset conditions are met to obtain a trained water quality prediction model.
[0009] Optionally, the step of inputting the historical remote sensing image and the time series water quality parameter into an initial water quality prediction model for prediction to obtain a first prediction result includes:
[0010] Using the first sub-model to extract image modality features from the historical remote sensing image to obtain multimodal features;
[0011] Using the encoder in the second sub-model to encode and calculate attention on the time series water quality parameter to obtain an attention tensor;
[0012] The decoder of the second sub-model is used to perform feature fusion on the attention tensor and the multimodal feature to obtain a target fusion feature, and prediction is performed based on the target fusion feature to obtain a target prediction result.
[0013] Optionally, the extracting image modality features of the historical remote sensing image using the first sub-model to obtain multimodal features includes:
[0014] Using the convolutional layer in the first sub-model, information fusion is performed on historical remote sensing images with different resolutions during downsampling to obtain a first fusion feature;
[0015] Using the first sub-model to extract and fuse features of historical remote sensing images of different channels to obtain second fusion features, and constructing a channel weight table based on the second fusion features;
[0016] The multimodal feature is determined based on the first fusion feature, the second fusion feature and the channel weight table.
[0017] Optionally, the time series water quality parameter consists of three parts, including: real water quality y, spatial factor g and random factor ω;
[0018] There is a nonlinear relationship between the real water quality change and the spatial factor. The spatial factor is expressed as g = f(Δy). The real water quality at the last moment is y {k,(t-1)} , the true value at the current moment is y {k,t} , where the difference is Δy, k is the kth parameter, and t is the tth moment.
[0019] Optionally, the water quality prediction model training method further includes:
[0020] The two detected water qualities at time 1 and time 2 are recorded as w1 and w2, and the real water qualities are y1 and y2, where y0 is the real water quality at the previous moment of y1, and the random factors are ω1 and ω2, then:
[0021] w1=y1+f(y1-y0)+ω1
[0022] w2=y2+f(y2-y1)+ω2
[0023] When the water body is relatively stable, the difference in the impact of human activities on water quality between two time periods is defined as Δg, where y2 = y1 + Δg;
[0024] The relationship between w1 and w2 is:
[0025] w2=y1+Δh+f(Δh)+ω1+Δω
[0026] The learning parameters of the second sub-model are determined to be h and ω.
[0027] In order to solve the above technical problems, the present application provides a water quality prediction method, including:
[0028] Obtain real-time remote sensing images and real-time water quality parameters;
[0029] The real-time remote sensing image and the real-time water quality parameters are input into a trained water quality prediction model for identification to obtain a water quality prediction result.
[0030] In order to solve the above technical problems, the present application also provides a water quality prediction model training device, including:
[0031] A first acquisition module is used to acquire historical remote sensing images and time-series water quality parameters, wherein the historical remote sensing images are multi-resolution multi-channel remote sensing images of the water quality area to be monitored that were collected historically, and the time-series water quality parameters are water quality parameters collected at different times;
[0032] A first prediction module, used for inputting the historical remote sensing image and the time series water quality parameter into an initial water quality prediction model for prediction to obtain a first prediction result, wherein the initial water quality prediction model includes a first sub-model and a second sub-model, wherein the first sub-model is a neural network model for extracting remote sensing features of image modality, and the second sub-model is a codec for extracting sequence features of time series modality;
[0033] The iterative training module is used to calculate the loss function based on the first prediction result and back-propagate, calculate the gradient according to the result of back-propagation, and update the model parameters based on the gradient until the preset conditions are met to obtain a trained water quality prediction model.
[0034] In order to solve the above technical problems, the present application also provides a water quality prediction device, including:
[0035] The second acquisition module is used to acquire real-time remote sensing images and real-time water quality parameters;
[0036] The second prediction module is used to input the real-time remote sensing image and the real-time water quality parameters into the trained water quality prediction model for identification to obtain a water quality prediction result.
[0037] In order to solve the above technical problems, an embodiment of the present application also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above water quality prediction model training method when executing the computer program, or implements the steps of the above water quality prediction method when executing the computer program.
[0038] In order to solve the above technical problems, an embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the steps of the above-mentioned water quality prediction model training method, or when the computer program is executed by a processor, it implements the steps of the above-mentioned water quality prediction method.
[0039] The water quality prediction model training method, water quality prediction method, device, computer equipment and storage medium provided by the embodiment of the present invention obtain historical remote sensing images and time-series water quality parameters, wherein the historical remote sensing images are multi-resolution multi-channel remote sensing images of the water quality area to be monitored that have been collected historically, and the time-series water quality parameters are water quality parameters collected at different times; the historical remote sensing images and time-series water quality parameters are input into the initial water quality prediction model for prediction to obtain a first prediction result, wherein the initial water quality prediction model includes a first sub-model and a second sub-model, wherein the first sub-model is a neural network model for extracting remote sensing features of image modalities, and the second sub-model is a codec for extracting features of time-series modal sequences; based on the first prediction result, the loss function is calculated and back-propagated, the gradient is calculated according to the result of back-propagation, and the model parameters are updated based on the gradient until the preset conditions are met to obtain a trained water quality prediction model. The environmental information of multiple modalities is integrated and the information complementarity between different modalities is fully utilized, thereby improving the accuracy of the water quality prediction of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0041] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;
[0042] Figure 2 is a flow chart of an embodiment of the water quality prediction model training method of the present application;
[0043] Figure 3 is a flow chart of an embodiment of the water quality prediction method of the present application;
[0044] Figure 4 is a structural schematic diagram of an embodiment of a water quality prediction model training device according to the present application;
[0045] Figure 5 is a schematic structural diagram of an embodiment of a water quality prediction device according to the present application;
[0046] Figure 6 It is a structural diagram of an embodiment of a computer device according to the present application. DETAILED DESCRIPTION
[0047] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.
[0048] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0049] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0050] See also Figure 1 ,like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0051] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc.
[0052] Terminal devices 101, 102, 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 (Moving Picture Experts Group Audio Layer IV) players, laptop computers, desktop computers, etc.
[0053] The server 105 may be a server that provides various services, such as a background server that provides support for web pages displayed on the terminal devices 101 , 102 , and 103 .
[0054] It should be noted that the water quality prediction model training method provided in the embodiment of the present application is executed by a server, and accordingly, the water quality prediction model training device is arranged in the server.
[0055] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. According to the implementation requirements, there may be any number of terminal devices, networks and servers. The terminal devices 101, 102, 103 in the embodiment of the present application may specifically correspond to application systems in actual production.
[0056] See also Figure 2 , Figure 2 A water quality prediction model training method provided by an embodiment of the present invention is shown, and the method is applied in Figure 1 The server in is used as an example to illustrate the details as follows:
[0057] S201: Acquire historical remote sensing images and time-series water quality parameters. The historical remote sensing images are multi-resolution multi-channel remote sensing images of the water quality area to be monitored that were collected historically, and the time-series water quality parameters are water quality parameters collected at different times.
[0058] In a specific optional implementation, the time series water quality parameter consists of three parts, including: real water quality y, spatial factor g and random factor ω;
[0059] There is a nonlinear relationship between the real water quality change and the spatial factor. The spatial factor is expressed as g = f(Δy). The real water quality at the last moment is y {k,(t-1)} , the true value at the current moment is y {k,t}, where the difference is Δy, k is the kth parameter, and t is the tth moment.
[0060] S202: Input historical remote sensing images and time series water quality parameters into the initial water quality prediction model for prediction to obtain a first prediction result. The initial water quality prediction model includes a first sub-model and a second sub-model. The first sub-model is a neural network model for extracting remote sensing features of image modality, and the second sub-model is a codec for extracting sequence features of time series modality.
[0061] Specifically, the initial water quality prediction model of this embodiment is an MFP model including two main sub-models, the first sub-model is an NCRW model for extracting remote sensing image features of image modality, and the second sub-model is an encoder-decoder structure EDWP for extracting sequence features of time series modality.
[0062] The first sub-model receives remote sensing images of multiple frequencies and different channels, and the input is R {res,band} The corresponding output feature is C {k,q} , k is the corresponding water quality parameter serial number, and q is the classification fine-grained control parameter.
[0063] The second sub-model input is the time series water quality parameter W =
[0064] [w {t-g} ,w {t-g+1} ,…,w {t} ], using the LSTM model as its substructure and adding an attention mechanism to focus on long sequence data and predict water quality data for a period of time in the future.
[0065] Finally, the second sub-model fuses the output features C of the first sub-model {k,q} , and map it to the same parameter space as a supervisory signal for water quality prediction.
[0066] C {k,q} =NCRW(R {res,band} )
[0067] [w {t+1} ,w {t+2} ,…]=EDWP(W,C)
[0068] Therefore, the model can combine remote sensing images and water quality monitoring sequences, fuse environmental information of multiple modalities and make full use of the information complementarity between different modalities, thereby improving the water quality prediction ability of the model.
[0069] In a specific optional implementation, historical remote sensing images and time series water quality parameters are input into an initial water quality prediction model for prediction, and the first prediction result is obtained including:
[0070] The first sub-model is used to extract image modality features from historical remote sensing images to obtain multi-modal features;
[0071] The encoder in the second sub-model is used to encode and calculate the attention of the time series water quality parameters to obtain the attention tensor;
[0072] The decoder of the second sub-model is used to fuse the attention tensor and the multimodal features to obtain the target fusion features, and prediction is performed based on the target fusion features to obtain the target prediction results.
[0073] In a specific optional implementation, the first sub-model is used to extract image modality features from historical remote sensing images, and the obtained multimodal features include:
[0074] The convolutional layer in the first sub-model is used to fuse information of historical remote sensing images with different resolutions during downsampling to obtain the first fusion feature;
[0075] The first sub-model is used to extract and fuse the features of the historical remote sensing images of different channels to obtain the second fusion features, and based on the second fusion features, a channel weight table is constructed;
[0076] A multimodal feature is determined based on the first fusion feature, the second fusion feature, and the channel weight table.
[0077] In a specific example, the remote sensing image contains three resolutions: 10m, 20m, and 60m. The 10m resolution image is used as input, and then different convolutional layers are used to fuse the 20m and 60m resolution images in turn. Information fusion is performed while downsampling, ensuring the stable flow of information when downsampling at different frequencies.
[0078] Out1=Max(Downsample(R {10m} ),R {20m} )
[0079] Out2=Max(Downsample(R {20m} ),R {60m} )
[0080] The remote sensing image used in this embodiment contains 13 bands, of which band 1 is natural light, bands 2 to 4 are blue light, green light and red light, bands 5 to 7 are plant red edges, bands 8 and 8A are near-infrared bands, band 9 is a water vapor absorption band, and bands 10 to 12 are short infrared bands. These bands reflect the topography and geomorphology around the basin, water body characteristics and other geographical features, and can provide sufficient information sources for constructing spatial water quality mapping relationships.
[0081] The band corresponding to each water quality parameter has different parameters, which are grouped at the bottom. The weight of the group with large dependency is increased, and the weight of the group with small dependency is reduced to construct the final channel weight table.
[0082]
[0083] Furthermore, in order to explore the mapping relationship between spatial factors and water quality parameters: g = f(Δy), this study established a mapping relationship from images to water quality based on the characteristics reflected in remote sensing images, and further explored the nonlinear characteristic relationship of spatial water quality. Among them, R contains the domain water quality parameter y that can be represented by optical information optic , and its information is reflected in the variable R.
[0084] R = σ(y optic ,ω r )
[0085] The final mapping relationship is as follows:
[0086]
[0087] In a specific optional implementation, the water quality prediction model training method further includes:
[0088] The two detected water qualities at time 1 and time 2 are recorded as w1 and w2, and the real water qualities are y1 and y2, where y0 is the real water quality at the previous moment of y1, and the random factors are ω1 and ω2, then:
[0089] w1=y1+f(y1-y0)+ω1
[0090] w2=y2+f(y2-y1)+ω2
[0091] When the water body is relatively stable, the difference in the impact of human activities on water quality between two time periods is defined as Δh, where y2 = y1 + Δh;
[0092] The relationship between w1 and w2 is:
[0093] w2=y1+Δh+f(Δh)+ω1+Δω
[0094] The learning parameters of the second sub-model are determined to be h and ω.
[0095] Furthermore, using the hidden layer parameters s of LSTM t-1 Calculate the hidden layer attention with the encoder input H:
[0096] E t =tanh(σ(s t-1 ,H))
[0097] The obtained attention scores are then input into a fully connected layer v, and finally a softmax operation is performed to obtain the attention weight matrix:
[0098]
[0099] Furthermore, the fusion process is expressed as:
[0100] c=a t H
[0101] s t =LSTM(y t │y {NCRW} ,c,s {t-1}
[0102]
[0103] The hidden layer is calculated by the attention layer to obtain the tensor c, which is then input into the decoder composed of LSTM. At the same time, the result y obtained by the NCRW network is {NCRW} Carry out fusion training together and finally get the predicted value
[0104] S203: Calculate the loss function based on the first prediction result and perform back propagation, calculate the gradient according to the result of back propagation, and update the model parameters based on the gradient until the preset conditions are met to obtain a trained water quality prediction model.
[0105] Specifically, the first sub-model NCRW training process includes:
[0106] Acquire remote sensing images at the most recent time point;
[0107] Input images of different bands into the neural network for training, calculate the loss function and perform back propagation;
[0108] Calculate the gradient of the back-propagation result and update the model parameters;
[0109] Repeat the above steps until the iteration ends.
[0110] Specifically, the second sub-model EDWP training process includes:
[0111] Initialize EDWP network parameters using Xavier method;
[0112] Input the time series data into the neural network for training, calculate the loss function and perform back propagation;
[0113] Calculate attention scores for hidden layer data;
[0114] Calculate the gradient of the back-propagation result and update the model parameters;
[0115] Repeat the above steps until the iteration ends.
[0116] Specifically, the initial water quality prediction model MFP training process includes:
[0117] Obtain the training results of the NCRW network and input them into the decoder of the EDWP as the intermediate layer data for supervised learning;
[0118] The decoder calculates the loss function and performs backpropagation;
[0119] Calculate the gradient of the back-propagation result and update the model parameters;
[0120] Repeat the above steps until the iteration ends.
[0121] In this embodiment, historical remote sensing images and time-series water quality parameters are obtained, the historical remote sensing images are multi-resolution multi-channel remote sensing images of the water quality area to be monitored that have been collected historically, and the time-series water quality parameters are water quality parameters collected at different times; the historical remote sensing images and time-series water quality parameters are input into the initial water quality prediction model for prediction to obtain a first prediction result, the initial water quality prediction model includes a first sub-model and a second sub-model, the first sub-model is a neural network model for extracting remote sensing features of the image modality, and the second sub-model is a codec for extracting sequence features of the time-series modality; the loss function is calculated based on the first prediction result and back-propagated, the gradient is calculated based on the result of back-propagation, and the model parameters are updated based on the gradient until the preset conditions are met to obtain a trained water quality prediction model. This realizes the fusion of environmental information of multiple modalities and makes full use of the information complementarity between different modalities, thereby improving the accuracy of the model's water quality prediction.
[0122] See also Figure 3 , Figure 3 A water quality prediction method provided by an embodiment of the present invention is shown. Figure 1 The server in is used as an example to illustrate the details as follows:
[0123] S204: Acquire real-time remote sensing images and real-time water quality parameters;
[0124] S205: Input the real-time remote sensing image and the real-time water quality parameters into the trained water quality prediction model for identification to obtain a water quality prediction result.
[0125] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0126] Figure 4The principle block diagram of the water quality prediction model training device corresponding to the water quality prediction model training method in the above embodiment is shown. Figure 4 As shown, the water quality prediction model training device includes a first acquisition module 31, a first prediction module 32 and an iterative training module 33. Each functional module is described in detail as follows:
[0127] The first acquisition module 31 is used to acquire historical remote sensing images and time-series water quality parameters, wherein the historical remote sensing images are multi-resolution multi-channel remote sensing images of the water quality area to be monitored that have been collected historically, and the time-series water quality parameters are water quality parameters collected at different times;
[0128] A first prediction module 32 is used to input the historical remote sensing images and the time series water quality parameters into the initial water quality prediction model for prediction to obtain a first prediction result, wherein the initial water quality prediction model includes a first sub-model and a second sub-model, wherein the first sub-model is a neural network model for extracting remote sensing features of image modality, and the second sub-model is a codec for extracting sequence features of time series modality;
[0129] The iterative training module 33 is used to calculate the loss function based on the first prediction result and perform back propagation, calculate the gradient according to the result of back propagation, and update the model parameters based on the gradient until the preset conditions are met to obtain a trained water quality prediction model.
[0130] Optionally, the first prediction module 32 includes:
[0131] A feature extraction unit, used for extracting image modality features from historical remote sensing images using the first sub-model to obtain multi-modal features;
[0132] An encoding calculation unit, used to use the encoder in the second sub-model to encode and calculate the attention of the time series water quality parameters to obtain an attention tensor;
[0133] The feature fusion unit is used to use the decoder of the second sub-model to perform feature fusion on the attention tensor and the multimodal feature to obtain a target fusion feature, and perform prediction based on the target fusion feature to obtain a target prediction result.
[0134] Optionally, the feature extraction unit includes:
[0135] An information fusion subunit, used to use the convolution layer in the first sub-model to perform information fusion on historical remote sensing images of different resolutions during downsampling to obtain a first fusion feature;
[0136] The channel fusion subunit is used to extract and fuse the features of the historical remote sensing images of different channels by using the first submodel to obtain the second fusion features, and construct a channel weight table based on the second fusion features;
[0137] The multimodal feature determination subunit is used to determine the multimodal feature based on the first fusion feature, the second fusion feature and the channel weight table.
[0138] Figure 5 The principle block diagram of the water quality prediction device corresponding to the water quality prediction method in the above embodiment is shown. Figure 5 As shown, the water quality prediction device includes a second acquisition module 34 and a second prediction module 35. The functional modules are described in detail as follows:
[0139] The second acquisition module 34 is used to acquire real-time remote sensing images and real-time water quality parameters;
[0140] The second prediction module 35 is used to input the real-time remote sensing image and the real-time water quality parameters into the trained water quality prediction model for identification to obtain the water quality prediction result.
[0141] For the specific limitations of the water quality prediction model training device / water quality prediction device, please refer to the limitations of the water quality prediction model training method / water quality prediction method above, which will not be repeated here. The various modules in the above-mentioned water quality prediction model training device / water quality prediction device can be implemented in whole or in part through software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0142] To solve the above technical problems, the present application also provides a computer device. Figure 6 , Figure 6 This is a basic structural block diagram of the computer device in this embodiment.
[0143] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 4 with components connected to the memory 41, the processor 42, and the network interface 43, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.
[0144] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.
[0145] The memory 41 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or D interface display memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 41 can be an internal storage unit of the computer device 4, such as a hard disk or memory of the computer device 4. In other embodiments, the memory 41 can also be an external storage device of the computer device 4, such as a plug-in hard disk equipped on the computer device 4, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Of course, the memory 41 can also include both the internal storage unit of the computer device 4 and its external storage device. In this embodiment, the memory 41 is generally used to store the operating system and various application software installed on the computer device 4, such as the program code of the water quality prediction model training method, etc. In addition, the memory 41 can also be used to temporarily store various types of data that have been output or are to be output.
[0146] The processor 42 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 42 is generally used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to run the program code stored in the memory 41 or process data, such as running the program code of the water quality prediction model training method.
[0147] The network interface 43 may include a wireless network interface or a wired network interface. The network interface 43 is generally used to establish a communication connection between the computer device 4 and other electronic devices.
[0148] The present application also provides another embodiment, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores an interface display program, and the interface display program can be executed by at least one processor so that the at least one processor performs the steps of the water quality prediction model training method as described above.
[0149] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0150] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.
Claims
1. A water quality prediction model training method, characterized in that: include: Acquire historical remote sensing images and time-series water quality parameters, wherein the historical remote sensing images are multi-resolution multi-channel remote sensing images of the water quality area to be monitored that were collected historically, and the time-series water quality parameters are water quality parameters collected at different times; Inputting the historical remote sensing image and the time series water quality parameter into an initial water quality prediction model for prediction to obtain a first prediction result, wherein the initial water quality prediction model includes a first sub-model and a second sub-model, wherein the first sub-model is a neural network model for extracting remote sensing features of an image modality, and the second sub-model is a codec for extracting sequence features of a time series modality; Based on the first prediction result, the loss function is calculated and back-propagated, the gradient is calculated according to the result of the back-propagation, and the model parameters are updated based on the gradient until the preset conditions are met to obtain a trained water quality prediction model.
2. The water quality prediction model training method according to claim 1, characterized in that: The inputting the historical remote sensing image and the time series water quality parameter into the initial water quality prediction model for prediction to obtain the first prediction result comprises: Using the first sub-model to extract image modality features from the historical remote sensing image to obtain multimodal features; Using the encoder in the second sub-model to encode and calculate attention on the time series water quality parameter to obtain an attention tensor; The decoder of the second sub-model is used to perform feature fusion on the attention tensor and the multimodal feature to obtain a target fusion feature, and prediction is performed based on the target fusion feature to obtain a target prediction result.
3. The water quality prediction model training method according to claim 2, characterized in that: The first sub-model is used to extract image modality features from the historical remote sensing image to obtain multimodal features including: Using the convolutional layer in the first sub-model, information fusion is performed on historical remote sensing images with different resolutions during downsampling to obtain a first fusion feature; Using the first sub-model to extract and fuse features of historical remote sensing images of different channels to obtain second fusion features, and constructing a channel weight table based on the second fusion features; The multimodal feature is determined based on the first fusion feature, the second fusion feature and the channel weight table.
4. The water quality prediction model training method according to claim 2, characterized in that: The time series water quality parameters consist of three parts, including: real water quality y, spatial factor g and random factor ω; There is a nonlinear relationship between the real water quality change and the spatial factor. The spatial factor is expressed as g = f(Δy). The real water quality at the last moment is y {k,(t-1)} , the true value at the current moment is y {k,t} , where the difference is Δy, k is the kth parameter, and t is the tth moment.
5. The water quality prediction model training method according to claim 2, characterized in that: The water quality prediction model training method also includes: The two detected water qualities at time 1 and time 2 are recorded as w1 and w2, and the real water qualities are y1 and y2, where y0 is the real water quality at the previous moment of y1, and the random factors are ω1 and ω2, then: w1=y1+f(y1-y0)+ω1 w2=y2+f(y2-y1)+ω2 When the water body is relatively stable, the difference in the impact of human activities on water quality between two time periods is defined as Δg, where y2 = y1 + Δg; The relationship between w1 and w2 is: w2=y1+Δg+f(Δg)+ω1+Δω The learning parameters of the second sub-model are determined to be g and ω.
6. A water quality prediction method, characterized in that: include: Obtain real-time remote sensing images and real-time water quality parameters; The real-time remote sensing image and the real-time water quality parameters are input into a trained water quality prediction model for identification to obtain a water quality prediction result, wherein the trained water quality prediction model is trained according to the water quality prediction model training method according to any one of claims 1 to 5.
7. A water quality prediction model training device, characterized in that: include: A first acquisition module is used to acquire historical remote sensing images and time-series water quality parameters, wherein the historical remote sensing images are multi-resolution multi-channel remote sensing images of the water quality area to be monitored that were collected historically, and the time-series water quality parameters are water quality parameters collected at different times; A first prediction module, used for inputting the historical remote sensing image and the time series water quality parameter into an initial water quality prediction model for prediction to obtain a first prediction result, wherein the initial water quality prediction model includes a first sub-model and a second sub-model, wherein the first sub-model is a neural network model for extracting remote sensing features of image modality, and the second sub-model is a codec for extracting sequence features of time series modality; The iterative training module is used to calculate the loss function based on the first prediction result and back-propagate, calculate the gradient according to the result of back-propagation, and update the model parameters based on the gradient until the preset conditions are met to obtain a trained water quality prediction model.
8. A water quality prediction device, characterized in that: include: The second acquisition module is used to acquire real-time remote sensing images and real-time water quality parameters; The second prediction module is used to input the real-time remote sensing image and the real-time water quality parameters into a trained water quality prediction model for identification to obtain a water quality prediction result, wherein the trained water quality prediction model is trained according to the water quality prediction model training method according to any one of claims 1 to 5.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the water quality prediction model training method according to any one of claims 1 to 5 is implemented, or when the processor executes the computer program, the water quality prediction model training method according to claim 6 is implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by the processor, it implements the water quality prediction model training method as described in any one of claims 1 to 5, or, when the computer program is executed by the processor, it implements the water quality prediction method as described in claim 6.
Citation Information
Patent Citations
Water quality degradation event detection method based on multi-modal data fusion
CN116166966A
Agricultural disaster prediction method based on remote sensing image space-time fusion and related equipment
CN116310883A
Multi-mode-based sewage purification analysis method and system
CN117237773A
Method for predicting effluent quality of sewage treatment system
CN117273540A
Multi-scale remote sensing image semantic segmentation method and system fusing multiple attention mechanisms
CN117475145A
