Robotic fish motion state prediction method and device based on library network
Through a library network-based method, using extended dynamic modal decomposition and parameter iterative optimization, the difficult problem of modeling a bionic underwater robotic fish with a fusion propulsion mode was solved, and high-precision prediction of the robotic fish's motion state was achieved.
Patent Information
- Application Number
- CN202510517310.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-23
- Publication Date
- 2025-09-19
AI Technical Summary
In the existing technology, it is difficult to model and predict the motion state of bionic underwater robotic fish that integrates propulsion mode, resulting in the inability to establish an accurate dynamic model through theoretical deduction.
A library network-based method is used to obtain the sample state data and label motion state of the robotic fish, perform extended dynamic modal decomposition, determine the leakage rate, and build an initial robotic fish state prediction model based on the leakage rate. The model parameters are optimized through parameter iteration to improve the prediction accuracy.
The prediction accuracy of the motion state of the robotic fish has been significantly improved, which can better adapt to multimodal motion and different working conditions, reduce the cumulative prediction error, and realize the dynamic modeling of the bionic underwater robotic fish.
Smart Images

Figure CN120669573A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a method and device for predicting the motion state of a robotic fish based on a library network. Background Art
[0002] As an emerging means of performing underwater tasks, bionic underwater robots have the advantages of low environmental interference, high maneuverability and high propulsion efficiency. They have received widespread attention from the academic community in recent years. However, due to their complex shape, numerous actuators, and the nonlinear and strong interference characteristics of the underwater environment, the modeling and control of bionic underwater robots have become relatively difficult.
[0003] Based on their propulsion methods, biomimetic underwater robots can be categorized as BCF (Body-Caudal Fin), MPF (Medial-Paired Fin), and fusion propulsion. Currently, both BCF and MPF robotic fish have relatively mature modeling frameworks. However, fusion propulsion robotic fish are difficult to model and predict due to the constant morphological changes of the undulating fins attached to the fish's body during movement. Therefore, it is currently impossible to establish an accurate dynamic model for fusion propulsion robotic fish through theoretical derivation. Summary of the Invention
[0004] The present invention provides a method and device for predicting the motion state of a robotic fish based on a library network, which are used to solve the defect in the prior art that the bionic underwater robotic fish with a fusion propulsion mode is difficult to model and predict the motion state.
[0005] The present invention provides a training method for a robotic fish state prediction model, comprising the following steps: Acquire sample state data of the robotic fish and a tag motion state of the sample state data; Performing extended dynamic modal decomposition with control terms on the sample state data to obtain a system matrix, solving eigenvalues of the system matrix, and determining a leakage rate of a library network model based on the solved eigenvalues; Determining an initial robotic fish state prediction model based on the leakage rate, and determining a robotic fish motion state corresponding to a hidden layer state in a library network model of the initial robotic fish state prediction model; Based on the difference between the tag motion state and the robotic fish motion state, parameter iteration is performed on the initial robotic fish state prediction model to obtain the robotic fish state prediction model.
[0006] According to a training method for a robotic fish state prediction model provided by the present invention, the sample state data includes sample motion state data and sample motion modal data; The sample state data includes a sample longitudinal speed, a sample lateral speed and a sample turning speed; The sample motion modal data includes a frequency corresponding to the left pectoral fin, a frequency corresponding to the right pectoral fin, a frequency corresponding to the tail fin, and a tail fin offset angle of the robotic fish.
[0007] According to a training method for a robotic fish state prediction model provided by the present invention, performing extended dynamic modal decomposition with control terms on the sample state data to obtain a system matrix includes: Based on the following formula, the extended dynamic modal decomposition with control terms is performed on the sample state data to obtain the system matrix: in, Represents the state at time t A set of characteristic functions under Includes the values of N characteristic functions, namely , these characteristic functions are used to represent the dynamic behavior of the system in a high-dimensional feature space, Represents the sample motion state data, Represents sample motion modal data; represents the longitudinal velocity of the sample, represents the sample lateral velocity, represents the sample turning speed, Indicates the frequency corresponding to the left pectoral fin of the robotic fish, represents the frequency corresponding to the right pectoral fin, represents the frequency corresponding to the tail fin, represents the tail fin offset angle, The matrix is composed of to The system state at the moment is composed of, The matrix is composed of to The system state consists of: Represents the system matrix, which describes the impact of the current system state on the next system state. represents the control input matrix, which describes the impact of the current control input on the system state at the next moment; The matrix representing the control inputs contains the control signals applied to the system at each time step.
[0008] According to a training method for a robotic fish state prediction model provided by the present invention, determining the leakage rate of the library network model based on the solved characteristic value includes: Clustering is performed on the solved eigenvalues, and based on the mean value of each cluster center obtained by clustering, a leakage rate corresponding to the reservoir network in the reservoir network model is determined.
[0009] According to a method for training a robotic fish state prediction model provided by the present invention, determining an initial robotic fish state prediction model based on the leakage rate includes: The initial robotic fish state prediction model is determined based on the leakage rate corresponding to the reservoir network in the reservoir network model.
[0010] According to a training method for a robotic fish state prediction model provided by the present invention, determining the robotic fish motion state corresponding to the hidden layer state in the library network model of the initial robotic fish state prediction model includes: Determining a hidden layer state in a library network model of the initial robotic fish state prediction model; The motion state of the robotic fish is determined based on the weight matrix of the readout model in the initial robotic fish state prediction model and the hidden layer state.
[0011] The present invention also provides a method for predicting the state of a robotic fish, comprising: Get the status data of the robotic fish; Inputting the state data into a robotic fish state prediction model to obtain a target action state output by the robotic fish state prediction model; The robotic fish state prediction model is obtained based on the training method of the robotic fish state prediction model.
[0012] The present invention also provides a training device for a robotic fish state prediction model, comprising the following units: A first acquisition unit is used to acquire sample state data of the robotic fish and a tag motion state of the sample state data; a leakage rate determination unit, configured to perform extended dynamic modal decomposition with control terms on the sample state data to obtain a system matrix, perform eigenvalue solution on the system matrix, and determine the leakage rate of the library network model based on the eigenvalue obtained by the solution; a predicted motion state determination unit, configured to determine an initial robotic fish state prediction model based on the leakage rate, and determine a robotic fish motion state corresponding to a hidden layer state in a library network model of the initial robotic fish state prediction model; A parameter iteration unit is configured to perform parameter iteration on the initial robotic fish state prediction model based on a difference between the tag motion state and the robotic fish motion state to obtain the robotic fish state prediction model.
[0013] The present invention also provides a robot fish state prediction device, comprising the following units: A second acquisition unit is used to acquire status data of the robotic fish; a prediction unit, configured to input the state data into a robotic fish state prediction model to obtain a target action state output by the robotic fish state prediction model; The robotic fish state prediction model is obtained based on the training method of the robotic fish state prediction model.
[0014] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the processor implements any of the above-described methods for training a robotic fish state prediction model or the robotic fish state prediction method.
[0015] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it implements any of the above-mentioned training methods for the robotic fish state prediction model, or implements the robotic fish state prediction method.
[0016] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned methods for training a robotic fish state prediction model, or implements the robotic fish state prediction method.
[0017] The present invention provides a method and device for predicting the motion state of a robotic fish based on a library network. The method obtains sample state data of the robotic fish and the labeled motion state of the sample state data, then performs extended dynamic modal decomposition with control terms on the sample state data to obtain a system matrix, solves the system matrix for eigenvalues, and determines the leakage rate of the library network model based on the solved eigenvalues. Then, based on the leakage rate, an initial robotic fish state prediction model is determined, and the robotic fish motion state corresponding to the hidden layer state in the library network model of the initial robotic fish state prediction model is determined. Finally, based on the difference between the labeled motion state and the robotic fish motion state, the initial robotic fish state prediction model is iterated to obtain the robotic fish state prediction model. In this method, the initial robotic fish state prediction model determined based on the leakage rate can preliminarily predict the motion state of the robotic fish. Further, by comparing the difference between the labeled motion state and the robotic fish motion state predicted by the model, the initial robotic fish state prediction model is iteratively optimized. This iterative process based on error feedback can continuously adjust the model parameters to make it more consistent with the actual motion law, thereby significantly improving the model's prediction accuracy for the motion state. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the present invention or the prior art, a brief introduction is given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0019] Figure 1 This is one of the flow charts of the training method of the robotic fish state prediction model provided by the present invention.
[0020] Figure 2 This is the second flow chart of the training method of the robotic fish state prediction model provided by the present invention.
[0021] Figure 3 It is a schematic diagram of the world coordinate system velocity and the body coordinate system velocity of the robotic fish provided by the present invention.
[0022] Figure 4 It is a schematic diagram of the multi-leakage rate library network model with a parallel structure provided by the present invention.
[0023] Figure 5 It is a flow chart of the method for predicting the state of a robotic fish provided by the present invention.
[0024] Figure 6 It is a structural schematic diagram of the training device of the robotic fish state prediction model provided by the present invention.
[0025] Figure 7 It is a structural schematic diagram of the robotic fish state prediction device provided by the present invention.
[0026] Figure 8 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0027] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0028] Although real fish lack the theoretical knowledge of flow fields that humans possess, they can, through continuous interaction with the aquatic environment and accumulated experience, make relatively accurate predictions of their own underwater motion. Neuroscience research has confirmed that this learning and prediction ability is associated with the cerebellum of fish. This region, by collecting information about the body's movements, can output a real-time estimate of the current motion state. This capability is currently lacking in bionic underwater robotic fish.
[0029] As a method for modeling the dynamics of nonlinear systems, the library network uses its rich hidden layer neuron dynamic characteristics to fit the input and output of the system in a data-driven manner. Unlike the traditional modeling process, this method does not require feedback of the actual speed, thereby greatly reducing the impact of cumulative prediction errors. It is suitable for the dynamic modeling problem of bionic underwater robotic fish.
[0030] Figure 1 This is one of the flow charts of the training method of the robotic fish state prediction model provided by the present invention. Figure 2 This is the second flow chart of the training method of the robot fish state prediction model provided by the present invention. Figure 1 、 Figure 2 As shown, the method includes step 110 , step 120 , step 130 and step 140 .
[0031] Step 110: Acquire sample state data of the robotic fish and the tag motion state of the sample state data.
[0032] Specifically, the sample state data of the robotic fish and the label motion state of the sample state data can be obtained. The sample state data includes sample motion state data and sample motion modal data. The sample motion state data includes sample longitudinal speed, sample lateral speed and sample turning speed. The sample state data can be expressed as , represents the longitudinal velocity of the sample, represents the sample lateral velocity, Indicates the sample steering speed.
[0033] Here, the sample motion modal data includes the frequency corresponding to the left pectoral fin, the frequency corresponding to the right pectoral fin, the frequency corresponding to the tail fin, and the tail fin offset angle of the robot fish. The sample motion modal data can be expressed as , Indicates the frequency corresponding to the left pectoral fin of the robotic fish, represents the frequency corresponding to the right pectoral fin, represents the frequency corresponding to the tail fin, Indicates the tail fin offset angle.
[0034] For ease of explanation, in the embodiment of the present invention, taking the fusion propulsion mode robot fish RoboDact as an example, the control task is divided into a multimodal motion task and a reference point arrival task based on PID (Proportional-Integral-Derivative, proportional-integral-differential controller). Among them, multimodal motion means that the robot fish starts different driving mechanisms (pectoral fins, caudal fins) by transferring parameters to a pre-defined CPG (Central Pattern Generator) model. The embodiment of the present invention mainly involves seven motion modes: pectoral fin propulsion, pectoral fin differential left turn, pectoral fin differential right turn, in-place left turn, in-place right turn, caudal fin propulsion and caudal fin steering. Assume that in the CPG model, the frequency corresponding to the left pectoral fin is , the frequency corresponding to the right pectoral fin is , the frequency corresponding to the tail fin is , the tail fin offset angle is , then corresponding to each motion mode, the above parameters are set as: Table 1 In Table 1, The value range is 0Hz-1.5Hz, The value range is 0Hz-2Hz, The value range is -30 degrees to 30 degrees (if A negative number applies a bias in the opposite direction).
[0035] The PID-based reference point arrival task is to set up several reference points in the robot fish's work area, randomly initialize the arrival order of each reference point before each task starts, and use the PID controller to drive the robot fish to each reference point in turn. Given the current reference point position Position of the robot fish , then PID is The control law is: in, Indicates the position of the robot fish With the current reference point position The azimuth angle difference between them is obtained by calculating the arc tangent of the two position vectors (atan2 function) and is used to determine the direction in which the robot fish needs to adjust. Indicates the position of the robot fish With the current reference point position The Euclidean distance between them is used to measure the straight-line distance between the robot fish and the target position; Indicates the frequency corresponding to the left pectoral fin of the robotic fish, represents the frequency corresponding to the right pectoral fin, represents the frequency corresponding to the tail fin, represents the tail fin offset angle; 、 、 and The value range of parameter is consistent with that in multimodal motion tasks. The robot fish is adjusted according to its actual maneuverability so that it can continuously and stably complete the specified control task. During the execution of the control task, the sample state data of the robot fish is obtained through external observation means.
[0036] Figure 3 Schematic diagram of the world coordinate system velocity and the body coordinate system velocity of the robotic fish provided by the present invention, as shown in FIG. Figure 3 As shown, the sample motion state refers to the longitudinal velocity of the robot fish in the body coordinate system. , lateral velocity , steering speed , which is calculated as Figure 3 As shown. Let its 2D coordinates in the global coordinate system be , the heading angle is , then the calculation method of the body velocity is: Based on the above definition, this framework collects CPG parameters and motion state of each time step synchronously during the process of the upper computer controlling the movement of the robotic fish, and obtains sample state data. Assume that the entire acquisition process lasts time steps, then this framework finally collects the data set .
[0037] like Figure 2 As shown in the figure, through a pre-defined control task for the robotic fish, the host computer controls the various parameters of the robotic fish's central pattern generator, controlling the robotic fish's continuous movement in the aquatic environment. External observation is then used to obtain the robotic fish's motion state at each moment. The host computer's control instructions and the robotic fish's motion state are aligned and recorded at each moment. This data is continuously collected over a period of time to form a dynamic data set (sample state data) used for model training.
[0038] Step 120 , performing extended dynamic modal decomposition with control terms on the sample state data to obtain a system matrix, solving eigenvalues of the system matrix, and determining the leakage rate of the library network model based on the solved eigenvalues.
[0039] Specifically, the extended dynamic mode decomposition with control (EDMD-c) is performed on the sample state data to obtain the system matrix.
[0040] For the convenience of explanation, let The state of the robot fish at this moment is , EDMD-c constructs an approximate model that can capture the system dynamics and input-output relationship by mapping the system state and control input into a high-dimensional feature space through nonlinear basis functions. Its mathematical expression is: In the above formula, and is the parameter matrix to be fitted; is a set of nonlinear basis functions (N in number). In the embodiment of the present invention, Gaussian radial basis functions are selected, which are in the form of: in, is the center point of the i-th basis function, Indicates the input basis function independent variable, express and The distance between Represents a constant.
[0041] Based on the following formula, the extended dynamic modal decomposition with control terms can be performed on the sample state data to obtain the system matrix (EDMD-c fitting process): in, Represents the state at time t A set of characteristic functions under Includes the values of N characteristic functions, namely , these characteristic functions are used to represent the dynamic behavior of the system in a high-dimensional feature space, Represents the sample motion state data, Represents sample motion modal data; represents the longitudinal velocity of the sample, represents the sample lateral velocity, represents the sample turning speed, Indicates the frequency corresponding to the left pectoral fin of the robotic fish, represents the frequency corresponding to the right pectoral fin, represents the frequency corresponding to the tail fin, represents the tail fin offset angle, The matrix is composed of to The system state at the moment is composed of, The matrix is composed of to The system state consists of: Represents the system matrix, which describes the impact of the current system state on the next system state. represents the control input matrix, which describes the impact of the current control input on the system state at the next moment; The matrix representing the control inputs contains the control signals applied to the system at each time step.
[0042] In the embodiment of the present invention, the number of nonlinear basis functions N It is obtained by grid search within a certain range, with a search range of 5 to 20 and a search step of 1. The indicator is the prediction performance of the corresponding EDMD-c model on the test dataset.
[0043] In the system matrix Then, the system matrix Perform eigenvalue solution and based on the eigenvalue obtained , determine the leakage rate of the library network model.
[0044] Step 130: Determine an initial robotic fish state prediction model based on the leakage rate, and determine the robotic fish motion state corresponding to the hidden layer state in the library network model of the initial robotic fish state prediction model.
[0045] Specifically, the initial robot fish state prediction model can be determined based on the leakage rate. For example, the initial robot fish state prediction model can be determined based on the leakage rate corresponding to the reservoir network in the reservoir network model. Then, the robot fish motion state corresponding to the hidden layer state in the reservoir network model of the initial robot fish state prediction model can be determined. Here, the robot fish motion state can be expressed as Indicates that the tag motion state can be used express.
[0046] Step 140 : Based on the difference between the tag motion state and the robotic fish motion state, perform parameter iteration on the initial robotic fish state prediction model to obtain the robotic fish state prediction model.
[0047] Specifically, after obtaining the motion state of the robotic fish, the target loss can be determined based on the difference between the label motion state and the robotic fish motion state, and based on the target loss, the parameters of the initial robotic fish state prediction model are iterated, and the initial robotic fish state prediction model after the parameter iteration is completed is used as the robotic fish state prediction model.
[0048] It can be understood that the greater the difference between the tag motion state and the robot fish motion state, the greater the target loss; the smaller the difference between the tag motion state and the robot fish motion state, the smaller the target loss.
[0049] The method provided by an embodiment of the present invention obtains sample state data of a robotic fish and a labeled motion state of the sample state data, then performs extended dynamic modal decomposition with control terms on the sample state data to obtain a system matrix, solves the system matrix for eigenvalues, and determines the leakage rate of a library network model based on the solved eigenvalues. Then, based on the leakage rate, an initial robotic fish state prediction model is determined, and the robotic fish motion state corresponding to the hidden layer state in the library network model of the initial robotic fish state prediction model is determined. Finally, based on the difference between the labeled motion state and the robotic fish motion state, the initial robotic fish state prediction model is iterated to obtain the robotic fish state prediction model. In this method, the initial robotic fish state prediction model determined based on the leakage rate can preliminarily predict the motion state of the robotic fish. Further, by comparing the difference between the labeled motion state and the model-predicted robotic fish motion state, the initial robotic fish state prediction model is iteratively optimized. This iterative process based on error feedback can continuously adjust the model parameters to make it more consistent with the actual motion law, thereby significantly improving the model's prediction accuracy for the motion state.
[0050] Based on the above embodiment, determining the leakage rate of the library network model based on the solved characteristic value in step 120 includes: Step 121 : clustering the solved eigenvalues, and determining the leakage rate corresponding to the reservoir network in the reservoir network model based on the mean value of each cluster center obtained by clustering.
[0051] Specifically, the obtained eigenvalues can be clustered. Here, the k-NN method can be used as a clustering algorithm to cluster the obtained eigenvalues to remove redundant information, and based on the mean of each cluster center obtained by clustering, the leakage rate corresponding to the library network in the library network model is determined. Assume that there are Cluster centers, each group corresponds to a characteristic value of , then we get the library network model The leakage rate corresponding to the network : .
[0052] Based on the above embodiment, determining the initial robotic fish state prediction model based on the leakage rate in step 130 includes: Step 131: Determine the initial robotic fish state prediction model based on the leakage rate corresponding to the reservoir network in the reservoir network model.
[0053] Specifically, Figure 4 Schematic diagram of the multi-leakage rate library network model with parallel structure provided by the present invention, such as Figure 4 As shown in Figure 2, based on the leakage rate obtained, a parallel structure multi-leakage rate library network model is designed. The original dynamic equation of the library network model with leakage rate is: In the above formula, represents the hidden layer state vector of the library network at time step t, represents the input vector received by the network at time step t, is the network interconnection matrix, is the input matrix. is the leakage rate, is a nonlinear activation function. In this example, the hyperbolic tangent function tanh() is used. Based on this, the parallel structure of the multiple leaky-rate reservoir network model (MLRN) is defined as a network model composed of multiple small reservoir network modules (Reservoir Blocks) with different leaky rates: In MLRN, each According to the corresponding formula in the second step, and No training is done after initialization. At each time step, the model is read out The hidden layer state Mapped into output: in, represents the motion state of the robotic fish predicted by the initial robotic fish state prediction model, Represents the hidden layer state.
[0054] Based on the above embodiment, determining the robotic fish motion state corresponding to the hidden layer state in the library network model of the initial robotic fish state prediction model in step 130 includes: Step 210, determining the hidden layer state in the library network model of the initial robotic fish state prediction model; Step 220 : Determine the motion state of the robotic fish based on the weight matrix of the model read out in the initial robotic fish state prediction model and the hidden layer state.
[0055] Specifically, the hidden layer state in the library network model of the initial robotic fish state prediction model is determined. The hidden layer state can be expressed as .
[0056] Furthermore, the motion state of the robotic fish is determined based on the weight matrix of the readout model and the hidden layer state in the initial robotic fish state prediction model. , the formula is as follows: The readout model uses a linear model, and the training process uses Ridge-regression: Where, Indicates that all The matrix composed of the hidden layer states, Corresponding to all expected outputs in the training data set (i.e., the real motion state ) corresponding matrix, I Represents the identity matrix, which is the same size as The matrices are the same, is the regularization coefficient, which is set to 0.1 in this example.
[0057] The method provided by the embodiment of the present invention, on the one hand, the hidden layer state can capture the intrinsic dynamic characteristics of the robot fish's movement. These characteristics are obtained through complex nonlinear mapping and can more comprehensively reflect the actual movement state of the robot fish; on the other hand, the weight matrix of the readout model is used to map the hidden layer state to a specific movement state output. By reasonably setting the weight matrix, it can be ensured that the model output is highly consistent with the actual movement state. In addition, the introduction of the hidden layer state enables the model to better adapt to the multimodal movement of the robot fish, such as different movement states such as straight swimming and turning. This design can effectively improve the generalization ability of the model under different working conditions; through the dynamic adjustment of the hidden layer state and the optimization of the weight matrix, the overfitting of the model to the training data can be avoided, so that good prediction performance can also be shown on new test data.
[0058] In summary, the present embodiment first constructs a bionic underwater robotic fish dynamics data collection framework. Then, based on an extended dynamic modal decomposition (DDM) leakage rate determination method and a parallel multi-leakage rate library network model design, the robotic fish state prediction model is trained. This example provides a bionic underwater robotic fish dynamics modeling process based on multimodal motion tasks and PID control tasks, enabling accurate prediction of the robot's motion state (body velocity in planar motion).
[0059] To verify the effectiveness of MLRN for modeling the dynamics of the robotic fish, an experiment was conducted in a 5m×4m×1.2m indoor pool. During the experiment, a PID controller drove the robotic fish to the target point in sequence. The MLRN model predicted the robotic fish's body velocity at each moment based on the control variable output by the PID controller. After comparison with the true value, the MLRN-predicted longitudinal velocity error (Root Mean Squared Error, RMSE) was 0.0197 m / s, the lateral velocity error (RMSE) was 0.0408 m / s, and the steering angular velocity was 0.0440 rad / s, demonstrating good prediction accuracy.
[0060] Based on any of the above embodiments, the present invention provides a method for predicting the state of a robotic fish. Figure 5 FIG. 1 is a flow chart of the method for predicting the state of a robotic fish provided by the present invention. Figure 5 As shown, the method includes: Step 510, obtaining status data of the robotic fish; Step 520: input the state data into a robotic fish state prediction model to obtain a target action state output by the robotic fish state prediction model; The robotic fish state prediction model is obtained based on the training method of the robotic fish state prediction model.
[0061] Specifically, the status data of the robot fish can be obtained, and the status data may include real-time motion status data and real-time motion modal data, wherein the real-time status data may include real-time longitudinal speed, real-time lateral speed and real-time turning speed; the real-time motion modal data packet includes the real-time frequency corresponding to the left pectoral fin of the robot fish, the real-time frequency corresponding to the right pectoral fin, the real-time frequency corresponding to the tail fin and the real-time tail fin offset angle.
[0062] After obtaining the state data of the robotic fish, the state data can be input into the robotic fish state prediction model to obtain the target action state output by the robotic fish state prediction model, that is, the action state of the robotic fish at the next moment.
[0063] The method provided in an embodiment of the present invention obtains the state data of the robotic fish, and then inputs the state data into the robotic fish state prediction model to obtain the target action state output by the robotic fish state prediction model, thereby improving the accuracy and reliability of the robotic fish state prediction.
[0064] The training device for the robotic fish state prediction model provided by the present invention is described below. The training device for the robotic fish state prediction model described below and the training method for the robotic fish state prediction model described above can be referenced to each other.
[0065] Based on any of the above embodiments, the present invention provides a training device for a robot fish state prediction model. Figure 6 FIG. 1 is a structural diagram of a training device for a robotic fish state prediction model provided by the present invention. Figure 6 As shown, the device includes: A first acquiring unit 610 is configured to acquire sample state data of the robotic fish and a tag motion state of the sample state data; a leakage rate determination unit 620 configured to perform extended dynamic modal decomposition with control terms on the sample state data to obtain a system matrix, perform eigenvalue solution on the system matrix, and determine the leakage rate of the library network model based on the solved eigenvalue; A predicted motion state determination unit 630 is configured to determine an initial robotic fish state prediction model based on the leakage rate, and determine a robotic fish motion state corresponding to a hidden layer state in a library network model of the initial robotic fish state prediction model; The parameter iteration unit 640 is configured to perform parameter iteration on the initial robotic fish state prediction model based on the difference between the tag motion state and the robotic fish motion state to obtain the robotic fish state prediction model.
[0066] The device provided by an embodiment of the present invention obtains sample state data of a robotic fish and the labeled motion state of the sample state data, then performs extended dynamic modal decomposition with control terms on the sample state data to obtain a system matrix, solves the system matrix for eigenvalues, and determines the leakage rate of a library network model based on the solved eigenvalues. Then, based on the leakage rate, an initial robotic fish state prediction model is determined, and the robotic fish motion state corresponding to the hidden layer state in the library network model of the initial robotic fish state prediction model is determined. Finally, based on the difference between the labeled motion state and the robotic fish motion state, the initial robotic fish state prediction model is iterated to obtain the robotic fish state prediction model. In this method, the initial robotic fish state prediction model determined based on the leakage rate can preliminarily predict the motion state of the robotic fish. Further, by comparing the difference between the labeled motion state and the model-predicted robotic fish motion state, the initial robotic fish state prediction model is iteratively optimized. This iterative process based on error feedback can continuously adjust the model parameters to make it more consistent with the actual motion patterns, thereby significantly improving the model's prediction accuracy for the motion state.
[0067] Based on any of the above embodiments, the sample state data includes sample motion state data and sample motion modal data; The sample state data includes a sample longitudinal speed, a sample lateral speed and a sample turning speed; The sample motion modal data includes a frequency corresponding to the left pectoral fin, a frequency corresponding to the right pectoral fin, a frequency corresponding to the tail fin, and a tail fin offset angle of the robotic fish.
[0068] Based on any of the above embodiments, the leakage rate determining unit 620 is specifically configured to: Based on the following formula, the extended dynamic modal decomposition with control terms is performed on the sample state data to obtain the system matrix: in, Represents the state at time t A set of characteristic functions under Includes the values of N characteristic functions, namely , these characteristic functions are used to represent the dynamic behavior of the system in a high-dimensional feature space, Represents the sample motion state data, Represents sample motion modal data; represents the longitudinal velocity of the sample, represents the sample lateral velocity, represents the sample turning speed, Indicates the frequency corresponding to the left pectoral fin of the robotic fish, represents the frequency corresponding to the right pectoral fin, represents the frequency corresponding to the tail fin, represents the tail fin offset angle, The matrix is composed of to The system state at the moment is composed of, The matrix is composed of to The system state consists of: Represents the system matrix, which describes the impact of the current system state on the next system state. represents the control input matrix, which describes the impact of the current control input on the system state at the next moment; The matrix representing the control inputs contains the control signals applied to the system at each time step.
[0069] Based on any of the above embodiments, the leakage rate determining unit 620 is specifically configured to: Clustering is performed on the solved eigenvalues, and based on the mean value of each cluster center obtained by clustering, a leakage rate corresponding to the reservoir network in the reservoir network model is determined.
[0070] Based on any of the above embodiments, the predicted motion state determination unit 630 is specifically configured to: The initial robotic fish state prediction model is determined based on the leakage rate corresponding to the reservoir network in the reservoir network model.
[0071] Based on any of the above embodiments, the predicted motion state determination unit 630 is specifically configured to: Determining a hidden layer state in a library network model of the initial robotic fish state prediction model; The motion state of the robotic fish is determined based on the weight matrix of the readout model in the initial robotic fish state prediction model and the hidden layer state.
[0072] The following describes the robotic fish state prediction device provided by the present invention. The robotic fish state prediction device described below and the robotic fish state prediction method described above can be referenced to each other.
[0073] Based on any of the above embodiments, the present invention provides a robot fish state prediction device, Figure 7 FIG. 1 is a schematic diagram of the structure of the robot fish state prediction device provided by the present invention. Figure 7 As shown, the device includes: A second acquiring unit 710 is configured to acquire status data of the robotic fish; A prediction unit 720 is configured to input the state data into a robotic fish state prediction model to obtain a target action state output by the robotic fish state prediction model; The robotic fish state prediction model is obtained based on the training method of the robotic fish state prediction model.
[0074] The device provided by the embodiment of the present invention obtains the state data of the robotic fish, and then inputs the state data into the robotic fish state prediction model to obtain the target action state output by the robotic fish state prediction model, thereby improving the accuracy and reliability of the robotic fish state prediction.
[0075] Figure 8 Schematic diagram of the structure of the electronic device provided by the present invention, such as Figure 8As shown, the electronic device may include: a processor 810, a communications interface 820, a memory 830, and a communications bus 840, wherein the processor 810, the communications interface 820, and the memory 830 communicate with each other via the communications bus 840. The processor 810 may call logic instructions in the memory 830 to execute a method for training a robotic fish state prediction model. The method includes: obtaining sample state data of the robotic fish and a labeled motion state of the sample state data; performing extended dynamic mode decomposition with control terms on the sample state data to obtain a system matrix; performing eigenvalue calculation on the system matrix; and determining a leakage rate of a library network model based on the obtained eigenvalues; determining an initial robotic fish state prediction model based on the leakage rate, and determining the robotic fish motion state corresponding to the hidden layer state in the library network model of the initial robotic fish state prediction model; and performing parameter iteration on the initial robotic fish state prediction model based on the difference between the labeled motion state and the robotic fish motion state to obtain the robotic fish state prediction model.
[0076] The processor 810 can also call the logic instructions in the memory 830 to execute the robot fish state prediction method, which includes: obtaining the state data of the robot fish; inputting the state data into the robot fish state prediction model to obtain the target action state output by the robot fish state prediction model; the robot fish state prediction model is obtained based on the training method of the above-mentioned robot fish state prediction model.
[0077] Furthermore, the logic instructions in the aforementioned memory 830 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product, stored in a storage medium, includes instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, mobile hard drives, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical disks.
[0078] On the other hand, the present invention also provides a computer program product, which includes a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the training method of the robotic fish state prediction model provided by the above methods, the method including: obtaining sample state data of the robotic fish and the label motion state of the sample state data; performing extended dynamic modal decomposition with control terms on the sample state data to obtain a system matrix, performing eigenvalue solution on the system matrix, and determining the leakage rate of the library network model based on the eigenvalue obtained by the solution; determining an initial robotic fish state prediction model based on the leakage rate, and determining the robotic fish motion state corresponding to the hidden layer state in the library network model of the initial robotic fish state prediction model; performing parameter iteration on the initial robotic fish state prediction model based on the difference between the label motion state and the robotic fish motion state to obtain the robotic fish state prediction model.
[0079] When the computer program is executed by a processor, the computer can execute the robotic fish state prediction method provided by the above methods, which includes: obtaining state data of the robotic fish; inputting the state data into a robotic fish state prediction model to obtain a target action state output by the robotic fish state prediction model; the robotic fish state prediction model is obtained by executing the training method based on the above robotic fish state prediction model.
[0080] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it is implemented to perform the training method of the robotic fish state prediction model provided by the above-mentioned methods, the method comprising: obtaining sample state data of the robotic fish and the label motion state of the sample state data; performing extended dynamic mode decomposition with control terms on the sample state data to obtain a system matrix, performing eigenvalue solution on the system matrix, and determining the leakage rate of the library network model based on the eigenvalue obtained by the solution; determining an initial robotic fish state prediction model based on the leakage rate, and determining the robotic fish motion state corresponding to the hidden layer state in the library network model of the initial robotic fish state prediction model; and performing parameter iteration on the initial robotic fish state prediction model based on the difference between the label motion state and the robotic fish motion state to obtain the robotic fish state prediction model.
[0081] When executed by a processor, the computer program is implemented to perform the robotic fish state prediction method provided by the above methods, which includes: obtaining state data of the robotic fish; inputting the state data into a robotic fish state prediction model to obtain a target action state output by the robotic fish state prediction model; the robotic fish state prediction model is obtained by executing the training method based on the above robotic fish state prediction model.
[0082] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.
[0083] Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented using software plus a necessary general-purpose hardware platform, or of course, hardware. Based on this understanding, the essence of the above technical solution, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, or an optical disk, and includes a number of instructions for causing a computer device (such as a personal computer, server, or network device) to execute the methods described in each embodiment or certain portions of the embodiments.
[0084] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A training method for a robotic fish state prediction model, characterized in that: include: Acquire sample state data of the robotic fish and a tag motion state of the sample state data; Performing extended dynamic modal decomposition with control terms on the sample state data to obtain a system matrix, solving eigenvalues of the system matrix, and determining a leakage rate of a library network model based on the solved eigenvalues; Determining an initial robotic fish state prediction model based on the leakage rate, and determining a robotic fish motion state corresponding to a hidden layer state in a library network model of the initial robotic fish state prediction model; Based on the difference between the tag motion state and the robotic fish motion state, parameter iteration is performed on the initial robotic fish state prediction model to obtain the robotic fish state prediction model.
2. The method for training a robotic fish state prediction model according to claim 1, wherein: The sample state data includes sample motion state data and sample motion modal data; The sample state data includes a sample longitudinal speed, a sample lateral speed and a sample turning speed; The sample motion modal data includes a frequency corresponding to the left pectoral fin, a frequency corresponding to the right pectoral fin, a frequency corresponding to the tail fin, and a tail fin offset angle of the robotic fish.
3. The method for training a robotic fish state prediction model according to claim 2, wherein: The extended dynamic modal decomposition with control items is performed on the sample state data to obtain a system matrix, including: Based on the following formula, the extended dynamic modal decomposition with control terms is performed on the sample state data to obtain the system matrix: in, Represents the state at time t A set of characteristic functions under Includes the values of N characteristic functions, namely , these characteristic functions are used to represent the dynamic behavior of the system in a high-dimensional feature space, Represents the sample motion state data, Represents sample motion modal data; represents the longitudinal velocity of the sample, represents the sample lateral velocity, represents the sample turning speed, Indicates the frequency corresponding to the left pectoral fin of the robotic fish, represents the frequency corresponding to the right pectoral fin, represents the frequency corresponding to the tail fin, represents the tail fin offset angle, The matrix is composed of to The system state at the moment is composed of, The matrix is composed of to The system state consists of: Represents the system matrix, which describes the impact of the current system state on the next system state. represents the control input matrix, which describes the impact of the current control input on the system state at the next moment; The matrix representing the control inputs contains the control signals applied to the system at each time step.
4. The method for training a robotic fish state prediction model according to any one of claims 1 to 3, characterized in that: The step of determining the leakage rate of the library network model based on the solved characteristic value includes: Clustering is performed on the solved eigenvalues, and based on the mean value of each cluster center obtained by clustering, a leakage rate corresponding to the reservoir network in the reservoir network model is determined.
5. The method for training a robotic fish state prediction model according to claim 4, wherein: Determining an initial robotic fish state prediction model based on the leakage rate includes: The initial robotic fish state prediction model is determined based on the leakage rate corresponding to the reservoir network in the reservoir network model.
6. The method for training a robotic fish state prediction model according to any one of claims 1 to 3, characterized in that: Determining the motion state of the robotic fish corresponding to the hidden layer state in the library network model of the initial robotic fish state prediction model includes: Determining a hidden layer state in a library network model of the initial robotic fish state prediction model; The motion state of the robotic fish is determined based on the weight matrix of the readout model in the initial robotic fish state prediction model and the hidden layer state.
7. A method for predicting the state of a robotic fish, characterized in that: include: Get the status data of the robotic fish; Inputting the state data into a robotic fish state prediction model to obtain a target action state output by the robotic fish state prediction model; The robotic fish state prediction model is obtained by executing the training method of the robotic fish state prediction model according to any one of claims 1 to 6.
8. A training device for a robot fish state prediction model, characterized in that: include: A first acquisition unit is used to acquire sample state data of the robotic fish and a tag motion state of the sample state data; a leakage rate determination unit, configured to perform extended dynamic modal decomposition with control terms on the sample state data to obtain a system matrix, perform eigenvalue solution on the system matrix, and determine the leakage rate of the library network model based on the eigenvalue obtained by the solution; a predicted motion state determination unit, configured to determine an initial robotic fish state prediction model based on the leakage rate, and determine a motion state of the robotic fish corresponding to a hidden layer state in a library network model of the initial robotic fish state prediction model; A parameter iteration unit is configured to perform parameter iteration on the initial robotic fish state prediction model based on a difference between the tag motion state and the robotic fish motion state to obtain the robotic fish state prediction model.
9. A robot fish state prediction device, characterized in that: include: A second acquisition unit is used to acquire status data of the robotic fish; a prediction unit, configured to input the state data into a robotic fish state prediction model to obtain a target action state output by the robotic fish state prediction model; The robotic fish state prediction model is obtained by executing the training method of the robotic fish state prediction model according to any one of claims 1 to 6.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, it implements the training method of the robotic fish state prediction model according to any one of claims 1 to 6, or implements the robotic fish state prediction method according to claim 7.
Citation Information
Cited By
Bionic duty ratio gait control method for elastic robotic fish, program, equipment and storage medium
CN121541451A