A method for modeling and optimizing rolling motion of drosophila larvae based on material point method

By using a modeling method for the rolling motion of fruit fly larvae based on the material point method and neural networks, the problems of computational resource limitations and training time in traditional methods are solved. This method enables efficient simulation and multi-mode generation of the rolling behavior of fruit fly larvae, thereby improving the task execution efficiency of soft biomimetic robots.

CN119647227BActive Publication Date: 2025-11-25ZHEJIANG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411798507.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-09
Publication Date
2025-11-25
Estimated Expiration
2044-12-09

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively simulate the tumbling motion behavior of fruit fly larvae, especially with limited computing resources. Furthermore, traditional methods rely on manual measurement data and time-consuming training, lacking versatility and flexibility.

Method used

A neuromechanical model based on the material point method, combined with an improved multilayer perceptron (MLP) and gradient optimization algorithm, is used to construct a model of the tumbling motion of fruit fly larvae. Control signals are generated through neural networks and the model hyperparameters are optimized to achieve generalizable simulation of the tumbling behavior of fruit fly larvae.

Benefits of technology

It achieves accurate simulation of the tumbling behavior of fruit fly larvae under limited computing resources, avoids large deformation and breakage of soft models, improves simulation efficiency and generalization ability, and can generate a variety of tumbling patterns to assist in biological behavior research and the design of soft biomimetic robots.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119647227B_ABST
    Figure CN119647227B_ABST
Patent Text Reader

Abstract

The application discloses a kind of fruit fly larva tumbling movement modeling and optimization method based on material point method.For the collaborative design challenge of larva tumbling movement model and the problem that traditional method relies on manual measurement data and training time-consuming, a neuro-mechanical model is designed combined with the biological characteristics of fruit fly larvae, and an artificial neural network based on deep learning is constructed as a model controller for training, and a hyperparameter optimization method based on TPE algorithm is designed.The above method is embedded into the differentiable programming framework, realizing the high integration and efficiency optimization of the method.The method can effectively simulate the tumbling movement behavior of fruit fly larvae and optimize it under limited computing resources.The soft body model with the biological characteristics of fruit fly larvae has the advantages of flexible movement and adaptation to complex environment.The application explores the optimal control strategy of fruit fly larvae tumbling process, simulates its interaction with complex environment, and provides an important reference for the design of fruit fly larvae-like soft robot in reality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of soft biomimetic robots, specifically to a method for modeling and optimizing the tumbling motion of fruit fly larvae based on the Material Point Method (MPM). This invention achieves tumbling modeling and motion control of fruit fly larvae, enabling the simulation of their tumbling behavior and interaction with the environment in complex environments under limited computational resources, and allows for corresponding optimization. This research provides important reference for the design of real-world soft biomimetic robots, improving the task execution and environmental exploration efficiency of fruit fly larva-inspired soft robots under limited computational resources. Background Technology

[0002] Soft biomimetic robots are biologically inspired robots that mimic the structure, morphology, and movement of living organisms. They are typically made of flexible materials, possessing excellent flexibility and deformability, enabling them to adapt to various operations and environments. Their design is inspired by organisms such as fruit fly larvae and sea cucumbers. Compared to traditional rigid robots, soft robots offer greater flexibility and are well-suited for handling complex tasks. Their applications are wide-ranging, including healthcare (such as endoscopic surgery and rehabilitation assistance), rescue and search and rescue (for rescuing trapped individuals and detecting disaster sites), and marine exploration. Furthermore, soft biomimetic robots exhibit excellent interactivity, allowing them to collaborate closely with humans or other robots, improving work efficiency. In recent years, the field of soft biomimetic robots has made significant research progress, but unique challenges have also emerged. The design of soft robots rarely considers the coordination of their behavior and morphology. Unlike purely manual control or physical design optimization, collaborative design algorithms require simultaneous optimization of both the robot's "brain" and "body" to find more efficient solutions.

[0003] The integration of neural circuits and body mechanics, known as neuromechanics, is one of the fundamental methods for revealing the mechanisms of motor control. Establishing neuromechanical models can link neural mechanisms with motor behavior, simulate the interaction between organisms and their environment in complex settings, and provide a reference for the collaborative design of soft robots in reality. Drosophila larvae, as a common model organism, have a clear anatomical structure and offer abundant methods for observing neuromuscular and behavioral changes, making them ideal models. Their tumbling movements allow larvae to quickly reposition themselves to avoid predators, which has significant research value.

[0004] Modeling the tumbling motion of fruit fly larvae presents numerous challenges, including the high degrees of freedom of the soft model, the significant deformation caused by tumbling, and the interactions of multiple materials. These factors complicate the modeling and optimization process. The material point method, which can adapt to large deformations, automatically handle self-collisions and fractures, and easily realize multi-material interactions, is well-suited for modeling the motion of soft organisms.

[0005] In recent years, researchers worldwide have proposed a series of methods for modeling the movement of fruit fly larvae. Sun et al. designed a model based on a series of measured physical parameters of the larvae, achieving a new breakthrough in the biological interpretability of the model. Shruti et al. introduced reinforcement learning (RL) into the model, further investigating the connection between neural mechanisms and motor behavior. While these methods have achieved preliminary modeling of fruit fly larvae movement, they still have shortcomings. Using physical measurement data to construct a neuromechanical model typically relies on a complex set of parameters, which is time-consuming and lacks generality. Early reinforcement learning methods often explored excessively large spaces, failing to achieve complex target movements. Later, some researchers proposed early termination strategies and adversarial reinforcement learning schemes based on this method, enabling RL-based methods to achieve richer behaviors. However, training effective reinforcement learning models for complex tasks such as soft robot control remains time-consuming.

[0006] The input of control signals is crucial in building effective neuromechanical models. Traditional methods typically rely on expert knowledge, manually setting a set of control signals. However, this approach is often experience-based and lacks versatility and flexibility. To overcome this limitation, an increasing number of studies are employing trained neural networks to generate control signals, thereby enabling more precise control of the neuromechanical model's behavior. Summary of the Invention

[0007] To address the difficulties in modeling and optimizing the tumbling motion of fruit fly larvae, as well as the problems of traditional methods relying on manual measurement data and time-consuming training, this invention aims to provide a method for modeling and optimizing the tumbling motion of fruit fly larvae based on the material point method. This method combines neuromechanics, motion control, and deep learning, and comprises three modules: the first module is a neuromechanical model construction module for fruit fly larvae based on the material point method, constructing a simulator based on the larval biological structure; the second module is a model controller construction module based on artificial neural networks, using an improved multilayer perceptron (MLP) as the model controller; the third module is a model optimization module based on gradient and TPE algorithms. By training the controller using a gradient-based method within the framework of differentiable physics and optimizing the model hyperparameters using a TPE algorithm, the expected motion control effect is effectively achieved. Through the cascading of these three modules, generalizable simulation modeling of the tumbling behavior of fruit fly larvae is achieved, generating tumbling behaviors containing multiple tumbling modes.

[0008] The method of the present invention is implemented through the following steps:

[0009] (S1) Construction Module of Neuromechanical Model of Fruit Fly Larva Based on Material Point Method: Based on the physical simulation mechanism of the material point method, a neuromechanical model is established with reference to the biological structure of the fruit fly larva. The model can control the corresponding muscle contraction according to the received signal based on the current state and output the simulation result of the next moment;

[0010] (S2) Model controller construction module based on artificial neural network: Based on the neuromechanical model of fruit fly larvae established by module (S1), the improved MLP is used as the controller of the model to process the input sine wave signal and generate the driving signal of the model.

[0011] (S3) Model Optimization Module Based on Gradient and TPE Algorithm: Based on the Drosophila larvae neuromechanical model and artificial neural network controller, a customized loss function and Adam optimizer are used to train the model using gradient information. The trained model can simulate the tumbling motion of Drosophila larvae and store the position information at each moment during the simulation. After the simulation, the stored data is used for rendering to generate a visualization file. Based on the Bayesian optimization principle and combined with the TPE algorithm, a hyperparameter optimization method for the Drosophila larvae tumbling motion model is designed to explore the optimal hyperparameters of the model.

[0012] Preferably, the specific content of the construction module for the Drosophila larvae neuromechanical model based on the material point method constructed in (S1) is as follows:

[0013] (1-1) Based on the real biological structure of fruit fly larvae, a fruit fly larvae model was constructed. Spatially, the fruit fly larvae were divided into a series of small blocks of the same size, each block represented by a spherical particle deployed in a three-dimensional coordinate system. In the constructed fruit fly larvae model, the outer layer was composed of a hyperelastic material, the bottom layer was muscle tissue, and the innermost layer was fluid. By setting different Young's moduli (E), the outer layer was divided into nine regions, corresponding to the nine segments of the fruit fly larvae. A total of eight muscles were established in the model, and different sequence numbers were assigned to the muscles in different regions. These muscles can be represented by the following formula:

[0014] Tri = [Tri1, Tri2, ..., Tri8]

[0015] When setting up muscles, you need to set the particles around the muscle particles as muscle anchor points according to the direction of muscle contraction.

[0016] (1-2) Based on the material point method, a model update method is established. The material point method involves the transformation between the Eulerian perspective (grid method) and the Lagrange perspective (particle method). The operation of constructing the fruit fly larva model using particles as the basic unit corresponds to the Lagrange perspective. The operations performed by MPM at each time step start from the Lagrange perspective and end from the Lagrange perspective. The whole process is divided into two parts: Particle to Grid (P2G) and Grid to Particle (G2P).

[0017] In P2G, this step interpolates particle physical quantities onto the mesh and solves the momentum conservation formula to obtain the new momentum on the mesh at the next time step. In this step, the model first receives muscle activation signals from the controller to control the contraction of different numbered muscles, and then handles collisions based on boundary conditions. Specifically, the model calculates muscle contraction force on a particle-by-particle basis; only particles designated as muscles undergo this calculation. The entire process involves calculating the magnitude and direction of the force. The formula for calculating the magnitude of the muscle contraction force is shown below:

[0018] Act = Signal Strength

[0019] Where Signal is the magnitude of the control signal corresponding to the muscle where the muscle particle resides, Strength is a parameter representing the magnitude of the control force, and Act is the muscle contraction force applied to the particle; the direction of the muscle force on the particle is determined by the relative position of the particle and the anchor particle. First, the vector between the particle and the anchor particle is calculated:

[0020] vec A =xx anchor

[0021] Where x and x anchor These are the position coordinates of the particle and the anchor particle, respectively. A It is a three-dimensional vector. Then, this vector is converted into a unit vector:

[0022]

[0023] Then the obtained unit vector norm A By performing an outer product operation, a matrix is ​​created that represents the tensor representation of the muscle force direction:

[0024]

[0025] Where tmp is a 3×3 matrix. It is norm A The transpose of the matrix is ​​then used; the matrix used for the muscle force direction tensor is then multiplied by the magnitude of the muscle force. The force A exerted by the muscle is calculated as follows:

[0026] A = tmp·Act

[0027] After obtaining the force A applied by the muscle, it needs to be combined with the deformation gradient matrix to correctly transfer the muscle force to the current deformation state and accumulate it onto the stress of the particle, as shown in the following formula:

[0028] cauchy+=new_F·A·new_F T

[0029] Where cauchy is the stress matrix of the particle, and new_F is the deformation gradient matrix of the particle obtained during the MPM calculation.

[0030] In G2P, this step recalculates the physical quantities of each particle through interpolation based on the new physical quantities obtained on the mesh, and then updates the state of the particles based on these new physical quantities.

[0031] By repeating the P2G and G2P steps, a simulator that produces different effects based on the signal can be obtained.

[0032] Preferably, the specific content of the model control weight construction module based on artificial neural networks constructed in (S2) is as follows:

[0033] (2-1) To set the input signal for the motion controller of the fruit fly larva tumbling motion model, a set of sine functions with different frequencies, phases, and deviations at different time steps are used as the controller input, as shown in the following formula:

[0034] Where t is the simulation time step number, dt is the simulation time step size, ω is the activation frequency, and n sw U is the total number of sine waves used for fitting, o is the offset value used to adjust the waveform at the start of the simulation, U is the signal generated for each time step as the input to the controller, and U is a multidimensional vector. j This represents the j-th element in the vector.

[0035] (2-2) An artificial neural network controller for constructing a model of the tumbling motion of fruit fly larvae is used, with an improved MLP as the model controller. Compared to a general MLP, this invention uses Xavier to initialize the neural network weights, uses the sine function as the activation function, and further processes the output using the ReLU function to limit the value range to [0,1]. The formula for the ReLU function is shown below:

[0036]

[0037] The controller can be represented by the following formula:

[0038] M = ReLU(MLP(U))

[0039] Where M = [m1, m2, ..., m k ] represents the signal output by the control authority, and k is the total number of muscles in the model.

[0040] Preferably, the specific content of the model optimization module based on gradient and TPE algorithm constructed in (S3) is as follows:

[0041] (3-1) The motion of fruit fly larvae can be simulated based on the neuromechanical model (simulator) of fruit fly larvae in module (S1) and the artificial neural network (controller) in module (S2). The simulation process sets two different motion targets: linear tumbling and offset tumbling, and custom loss functions are designed according to different evaluation metrics. The completion of the target is evaluated from three metrics: position, velocity, and angular velocity. Only solid particles in the model are considered during the evaluation process. The average position of the solid particles in the model is set as the centroid c, where c is a three-dimensional vector. Evaluating the target from the position metrics requires uniform sampling of the position at different time steps during the simulation process, specifically:

[0042] S(t) = c(t), t % p = 0, t ∈ [0, s max ]

[0043] Where s max The total number of time steps in the simulation is represented by , p represents the sampling time interval, and the resulting S is a three-dimensional vector. When evaluating the target from the velocity index, it is necessary to calculate the average velocity within a specified time step during the simulation, thus obtaining a three-dimensional vector V, specifically:

[0044]

[0045] To evaluate the target's angular velocity, it is necessary to calculate the cumulative distances of each point in the model relative to the centroid position within a certain time step during the simulation. In this calculation, the influence of global translation is eliminated by subtracting the position of the centroid. Specifically:

[0046] Where L represents the set of positions of solid particles in the model, l represents the position of a single particle, and is a three-dimensional vector. The calculated result A is also a three-dimensional vector.

[0047] (3-2) For the straight-line roll target, a customized loss function is defined based on the above evaluation index; the initial position of the model is set near the origin of the coordinate system, and the positive direction of the x-axis is set as the direction of the straight-line roll target. The design of the subsequent loss function is based on this premise; the loss of performing the straight-line roll target can be defined as follows: During the simulation, the target completion status is cumulatively evaluated from three perspectives. The entire loss calculation process can be expressed by the following formula:

[0048]

[0049] λs, λv, and λa are the weights used to calculate the target loss from different viewpoints. s1 represents the x-component of S along the x-axis; subsequent subscripts 1 and 2 indicate the x-component of the corresponding vector, respectively, and y-component. The L function calculates the squared norm of the vector, specifically:

[0050] V = [v1, v2, ..., v n ]

[0051] f x The (t) function is used to correctly calculate the loss. If the model rolls in the opposite direction of the preset direction, the loss of the corresponding part should be set to a positive value. When calculating the speed-related loss, the "sliding window" method is used to accumulate the contribution of all steps.

[0052] (3-3) For offset and rolling targets, when defining the custom loss function, the offset in the y-axis direction should be considered. For ease of calculation, the positive y-axis direction is also set as the rolling offset direction. The loss calculation process is expressed by the following formula:

[0053]

[0054] function f y The role of (t) and f x(t) Similarly, the goal is to make the model shift in a preset direction during the tumbling process; this method incorporates a differentiable programming framework in its design to support automatic differentiation. This invention uses gradient information obtained from backpropagation automatic differentiation to train an artificial neural network. During training, a simulation is run once per iteration. In each time step of the simulation, the artificial neural network generates muscle-driven signals, which are input into the neuromechanical model along with the current model state to generate the state for the next time step. After thousands of time steps, the loss is calculated using a customized loss function. Then, the Adam optimizer uses the gradient calculated by the automatic differentiation system to update the weights of the neural network. After multiple iterations, the model learns how to perform tumbling motion. Using the trained model, the tumbling motion of fruit fly larvae is simulated, and the position information at each moment in the process is stored. Finally, the obtained data is used to render the simulation process and generate a visualization file.

[0055] (3-4) Select the learning rate of training, Young's modulus of the elastic material on the surface of fruit fly larvae, and number of sine waves as hyperparameters as optimization objects. Use expert knowledge to set upper and lower bounds for the range of values ​​of these hyperparameters, and use this range as the parameter space.

[0056] (3-5) In each experiment, for each hyperparameter, a Gaussian mixture model b(x) is maintained for the hyperparameters that are related to the optimal target value (in this method, it refers to the model's rolling motion having a high degree of completion, i.e., the Loss is small), and another Gaussian mixture model o(x) is maintained for the remaining hyperparameters. Within the set parameter space, the hyperparameters corresponding to the maximization of b(x) / o(x) are selected as the next set of search values. In this way, this method can adaptively adjust the size of the parameter search space and find the global optimum in as few iterations as possible.

[0057] Thus, the construction of a modeling and optimization method for the tumbling motion of fruit fly larvae based on the material point method is completed.

[0058] The beneficial effects of this invention are:

[0059] (1) Inspired by the biological structure of fruit fly larvae, this invention proposes a neuromechanical model construction module for fruit fly larvae based on the material point method, which models the rolling movement behavior of fruit fly larvae and can well simulate the real biological structure of fruit fly larvae and the characteristics of the real escape behavior of larvae.

[0060] (2) Based on the neural signal characteristics of the tumbling behavior of fruit fly larvae, this invention proposes a fruit fly larvae tumbling motion control module based on artificial neural networks. Different loss functions are formulated according to the tumbling characteristics of fruit fly larvae, enabling fruit flies to complete different motion tasks in a three-dimensional environment. At the same time, Xavier is used to initialize the neural network weights, the sin function is used as the activation function of the neural network, and the ReLU function is introduced to limit the output, so as to achieve fast and stable convergence of the network training process;

[0061] (3) This invention avoids the problems of time-consuming data acquisition and training, reliance on manually designed features and rules, and poor generalization ability in traditional simulation modeling methods for fruit fly larvae. By introducing the material point method, it solves the problem of easy breakage of soft models under large deformation, and can easily realize multi-material interaction. Under limited computing resources, it can generate fruit fly larvae rolling behavior with multiple modes according to the configuration.

[0062] (4) This invention can assist in experimental research on biological behavior and provide an effective simulated experimental environment for the perception, decision-making and movement of soft organisms; at the same time, it can be applied to the design and research of biomimetic robots to improve the task execution and environmental exploration efficiency of soft robots inspired by fruit fly larvae under limited computing resources. Attached Figure Description

[0063] Figure 1 This is a schematic diagram of the body structure of a fruit fly larva in this invention.

[0064] Figure 2 This is a schematic diagram of the cross-sectional structure of the fruit fly larva in this invention.

[0065] Figure 3 This is a schematic diagram of the muscle distribution direction in the fruit fly larvae model of the present invention.

[0066] Figure 4 This is a schematic diagram of the fruit fly neuromechanical model in this invention.

[0067] Figure 5 This is a flowchart illustrating the overall framework of the present invention.

[0068] Figure 6 This is a statistical chart showing the simulated straight-line roll posture and data of the model in this invention.

[0069] Figure 7 This is a statistical chart showing the simulated attitude and data of the model's offset and roll in this invention. Detailed Implementation

[0070] To better understand the technical solution of the present invention, the embodiments of the present invention will be further described below in conjunction with the accompanying drawings and specific examples. Note that the aspects described below in conjunction with the accompanying drawings and specific examples are merely exemplary and should not be construed as limiting the scope of protection of the present invention in any way.

[0071] Example 1

[0072] This example was conducted on a computer equipped with an Intel 13th Gen Intel(R) Core(TM) i5-13600K CPU and an NVIDIA GeForce RTX 3080 GPU. The operating system version was Windows 11 Professional 23H2, the Python version was 3.10.11, and the Taichi version was 1.7.0.

[0073] This invention provides a method for modeling and optimizing the tumbling motion of fruit fly larvae based on the material point method, comprising the following steps:

[0074] Step 1: Establish a fruit fly larva model using particles as the basic unit. In a three-dimensional coordinate system, take a cube with a side length of 1 from the origin along the positive x, y, and z axes. Divide this area into units of 1 / 64 to obtain a set of coordinates. Each coordinate can represent a particle centered at that coordinate. The coordinate Pos can be expressed by the following formula:

[0075]

[0076] The body of a fruit fly larva can be viewed as a cylinder and two hemispheres joined together, such as... Figure 1 As shown. The body of a fruit fly larva consists of an outermost layer of superelastic material, a middle layer of muscle, and an innermost layer of fluid, such as... Figure 2 As shown. The body length of the fruit fly larva model was set to 0.5, the outer diameter to 0.1, the inner diameter to 0.08, and the muscle thickness to 0.03. When building the body, the centers of the cylinder and two spheres were first determined. Then, the Euclidean distance was used to calculate whether a particle belonged to the fruit fly larva body and to which part it belonged, and the result for each particle was recorded. The fruit fly larva model had eight muscles, evenly distributed in eight directions, as shown. Figure 3 As shown. These 8 directions can be represented as:

[0077]

[0078] When setting up muscles, calculate the vector perpendicular to the midline formed by particles within the region that can be set as muscles and points on the midline of the cylinder representing the larva's body. Then, calculate the angles between this vector and eight directional vectors. If the angle is less than a set value, set the particle as a muscle and assign different numbers to muscle particles at different locations. When setting up muscles, surrounding particles need to be set as muscle anchor points according to the direction of muscle contraction. By setting different Young's moduli (E), the outer layer of the fruit fly larva model is divided into nine regions corresponding to the nine segments of the fruit fly larva. Completing this step yields the initial fruit fly larva body model, such as... Figure 1 As shown.

[0079] Step 2: Establish a model update method based on the material point method. Particle physical quantities are interpolated onto the mesh (P2G), and the deformation gradient of each particle is calculated. The deformation gradient is constrained according to material properties, limiting it to a certain range. Muscle forces are controlled based on signals generated by the controller, and a prestress is applied to the internal fluid before the tumbling begins, referencing the actual structure of a fruit fly larva. Based on the deformation gradient and the obtained muscle forces, internal fluid prestress, and other forces, Cauchy stress is calculated (stress multiplied by the direction yields the force at each mesh point). Based on particle mass, velocity, stress, and other physical quantities, the mass, momentum, and force on the mesh are interpolated.

[0080] Step 3: Calculate the change in momentum on the mesh using the explicit integration of force over time, complete the calculation of the momentum conservation formula, calculate the new momentum on the mesh at the next moment, and handle collisions according to the boundary conditions.

[0081] Step 4: Based on the mesh velocity and displacement obtained in Step 3, recalculate the velocity and displacement of each particle (G2P) using interpolation or other methods. Control each particle to move according to its velocity and displacement, and update the particle's position and orientation information. Repeating the P2G and G2P steps yields a simulator that produces different effects based on the signal, such as... Figure 4 As shown.

[0082] Step 5: Construct the improved MLP as the artificial neural network controller for the fruit fly larvae tumbling motion model, and initialize the neural network weights using the Xavier initialization method. All of the above system frameworks incorporate differentiability programming, supporting automatic differentiation.

[0083] Step 6: Based on the fruit fly larvae neuromechanical model and artificial neural network controller, training is performed using a customized loss function and the Adam optimizer. The number of training iterations is set to 500, with each training iteration including a simulation of 2000 time steps and a neural network weight update. After training, the obtained model is used to simulate the tumbling motion of the fruit fly larvae, and the model's position information at each time point during the simulation is stored. After the simulation, the stored data is used for rendering to generate a visualization file. This completes the design of the entire fruit fly larvae tumbling motion model, and the overall system framework is as follows: Figure 5 As shown.

[0084] Step 7: Based on the Bayesian optimization principle, the TPE algorithm is used to optimize the tumbling motion model of fruit fly larvae and explore the optimal hyperparameters of the model.

[0085] Step 8: Simulate and verify the effectiveness of the designed model and control method: Based on the modeling and optimization framework of the invention, the controller is used to process the sine wave function to generate muscle drive signals. These signals are then fed into the trained and optimized tumbling motion model of the fruit fly larva to generate the corresponding motion state. Figure 6 and Figure 7 Subgraphs A and B in the figure show the changes in the motion trend of the model in the x-axis and y-axis directions during the motion process. It can be seen from the figure that when the model performs the two tasks of straight roll and offset roll, in the x-axis direction, it starts with a low speed, accelerates and then maintains a high speed until the end of the simulation, and the entire displacement curve is very smooth; in the y-axis direction, offset roll has a clear offset trend compared with straight roll. Figure 6 and Figure 7 Subgraph C in the figure shows the attitude changes of the model when performing two tasks: straight roll and offset roll. It can be seen from the figure that the model does not break or collapse during the rolling process and can handle the collision with the ground normally.

[0086] The simulation results show that the fruit fly larvae soft robot can perform multi-modal tumbling movements quickly and stably in a virtual environment, handling boundary conditions and maintaining body stability. This method solves the problems of time-consuming data acquisition and training, reliance on manually designed features and rules, and poor generalization ability in traditional fruit fly larvae simulation modeling methods. By introducing the material point method, the fracture problem during large deformations of the soft model is avoided, and multi-material interactions can be easily realized. This method can generate multi-modal fruit fly larvae tumbling behavior with limited computational resources, which not only contributes to biological behavioral research but also provides a reference for the collaborative design of soft biomimetic robots.

Claims

1. A method for modeling and optimizing the tumbling motion of fruit fly larvae based on the material point method, characterized in that, This method consists of three modules: (S1) Construction module of neuromechanical model of fruit fly larva based on material point method. Based on the physical simulation mechanism of material point method, the neuromechanical model is established with reference to the biological structure of fruit fly larva. The model can control the corresponding muscle contraction according to the received signal based on the current state and output the simulation result of the next moment. (S2) Model controller construction module based on artificial neural network: Based on the neuromechanical model of fruit fly larvae established by module (S1), the improved multilayer perceptron is used as the controller of the model to process the input sine wave signal and generate the driving signal of the model. (S3) The model optimization module based on gradient and TPE algorithm is based on the neuromechanical model of fruit fly larvae and artificial neural network controller. It uses a customized loss function and Adam optimizer to train the model using gradient information. The trained model can simulate the rolling motion of fruit fly larvae and store the position information at each moment during the simulation. After the simulation is completed, the stored data is used for rendering to generate a visualization file. Based on the Bayesian optimization principle and combined with the TPE algorithm, a hyperparameter optimization method for a fruit fly larva tumbling motion model was designed to explore the optimal hyperparameters of the model. In module (S1), a fruit fly larva model is constructed based on the real biological structure of fruit fly larvae. Spatially, the fruit fly larva is divided into a series of small blocks of the same size, each block is represented by a spherical particle, which is deployed on a three-dimensional coordinate system. In the constructed fruit fly larva model, the outer layer is composed of a hyperelastic material, the middle layer is muscle tissue, and the innermost layer is a hydrostatic skeleton. When setting the muscles, the muscles in different regions are represented by different numbers, and the particles around the muscle particles are set as muscle anchor points according to the direction of muscle contraction. In module (S1), based on the material point method, a model update method is established on the constructed neuromechanical model. The matter point method involves the transformation between the Eulerian and Lagrange perspectives; The operation of using particles as the basic unit to construct a model of fruit fly larvae corresponds to the Lagrange perspective. The operations performed in the matter point method at each time step start from the Lagrange perspective and end from the Lagrange perspective. The whole process is divided into two parts: particle to mesh and mesh to particle. The particle-to-mesh step interpolates the particle's physical quantities onto the mesh and solves the momentum conservation formula to obtain the new momentum on the mesh at the next time step. In this step, the model first receives muscle activation signals from the controller to control the contraction of different numbered muscles, and then handles collisions according to boundary conditions. In practice, the model calculates muscle contraction force on a particle-by-particle basis, and only particles that are set as muscles will perform this calculation. In module (S3), based on the experimental data from the model building and training process, a parameter space is set for the hyperparameters; the learning rate of training, Young's modulus of the elastic material on the surface of fruit fly larvae, and the number of sine waves are selected as hyperparameters as optimization objects, and upper and lower bounds are set for the value range of these hyperparameters through expert knowledge.

2. The method according to claim 1, characterized in that, In module (S1), the entire process is divided into calculating the magnitude and direction of the force. The formula for calculating the magnitude of muscle contraction force is shown below: Act = Signal Strength Where Signal is the magnitude of the control signal corresponding to the muscle where the muscle particle is located, Strength is a parameter for the magnitude of the control force, and Act is the muscle contraction force applied to the particle; the direction of the muscle force on the particle is determined by the relative position of the particle and the anchor particle. First, the vector between the particle and the anchor particle is calculated: thing A =xx anchor Where x and x anchor These are the position coordinates of the particle and the anchor particle, respectively. A It is a three-dimensional vector; then the vector is converted into a unit vector: Then the obtained unit vector norm A By performing an outer product operation, a matrix is ​​created that represents the tensor representation of the muscle force direction: Where tmp is a 3×3 matrix. It is norm A The transpose of the matrix is ​​then used; the matrix used for the muscle force direction tensor representation is multiplied by the magnitude of the muscle force to calculate the force A exerted by the muscle, as shown in the following formula: A = tmp·Act After obtaining the force A applied by the muscle, it needs to be combined with the deformation gradient matrix to correctly transfer the muscle force to the current deformation state and accumulate it onto the stress of the particle, as shown in the following formula: cauchy+=new_F·A·new_F T Where cauchy is the stress matrix of the particle, and new_F is the deformation gradient matrix of the particle obtained during the MPM calculation; in the mesh-to-particle step, the physical quantities of each particle are recalculated by interpolation based on the new physical quantities on the obtained mesh, and then the state of the particle is updated based on these new physical quantities.

3. The method according to claim 1, characterized in that, In module (S2), the controller of the fruit fly larvae tumbling motion model consists of an artificial neural network and input signals. The input signals are a set of sine functions with different frequencies, phases, and deviations at different time steps, as shown in the following formula: Where t is the simulation time step, dt is the simulation time step size, ω is the activation frequency, and n sw U is the total number of sine waves used for fitting, o is the offset value used to adjust the waveform at the start of the simulation, U is the signal generated for each time step as the input to the controller, and U is a multidimensional vector. j This represents the j-th element in the vector.

4. The method according to claim 1, characterized in that, In module (S2), the controller of the fruit fly larva tumbling motion model consists of an artificial neural network and input signals, where the artificial neural network is an improved multilayer perceptron. Compared to a general multilayer perceptron, this method uses Xavier to initialize the neural network weights, uses the sine function as the activation function, and further processes the output using the ReLU function to limit the value range to [0,1]. The formula for the ReLU function is shown below: The controller can be represented by the following formula: M = ReLU(MLP(U)) Where M = [m1, m2, ..., m k ] represents the signal output by the control authority, and k is the total number of muscles in the model.

5. The method according to claim 1, characterized in that, In module (S3), the motion of the fruit fly larvae is simulated based on the neuromechanical model of the fruit fly larvae in module (S1) and the artificial neural network in module (S2). The simulation process sets two different motion targets: linear tumbling and offset tumbling, and custom loss functions are designed according to different evaluation metrics. The achievement of the target is evaluated based on three metrics: position, velocity, and angular velocity. Only solid particles in the model are considered during the evaluation process. The average position of the solid particles in the model is set as the centroid c, where c is a three-dimensional vector. Evaluating the target based on the position metric requires uniform sampling of the position at different time steps during the simulation process, specifically: S(t)=c(t),t%p=0t∈[0,s max ] Where s max The total number of time steps in the simulation is represented by , p represents the sampling time interval, and the resulting S is a three-dimensional vector. When evaluating the target from the velocity index, it is necessary to calculate the average velocity within a specified time step during the simulation, thus obtaining a three-dimensional vector V, specifically: To evaluate the target's angular velocity, it is necessary to calculate the cumulative distances of each point in the model relative to the centroid position within a certain time step during the simulation. In this calculation, the influence of global translation is eliminated by subtracting the position of the centroid. Specifically: Where L represents the set of positions of solid particles in the model, l represents the position of a single particle, and is a three-dimensional vector. The calculated result A is also a three-dimensional vector.

6. The method according to claim 5, characterized in that, In module (S3), for the straight-line roll target, a customized loss function is defined based on the aforementioned evaluation metrics. The initial model position is set near the origin of the coordinate system, and the positive x-axis direction is set as the direction of the straight-line roll target. Subsequent loss function designs are all based on this premise. The loss for performing the straight-line roll target can be defined as follows: During the simulation, the target completion status is cumulatively evaluated from three perspectives. The entire loss calculation process can be expressed by the following formula: λs, λv, and λa are the weights for calculating the target loss under different metrics. s1 represents the component of S along the x-axis. Subsequent subscripts 1 and 2 indicate the component of the corresponding vector along the x-axis and y-axis, respectively. The L function calculates the square norm of the vector, specifically: f x The (t) function is used to correctly calculate the loss. If the model rolls in the opposite direction of the preset direction, the loss of the corresponding part should be set to a positive value. When calculating the speed-related loss, the "sliding window" method is used to accumulate the contribution of all steps.

7. The method according to claim 5, characterized in that, In module (S3), for the offset and roll target, when defining the custom loss function, the offset in the y-axis direction must be considered. For ease of calculation, the positive y-axis direction is also set as the roll offset direction. The loss calculation process is expressed by the following formula: function f y The role of (t) and f x (t) Similarly, the goal is to make the model shift in a preset direction during the tumbling process. This method incorporates a differentiable programming framework in its design, supporting automatic differentiation. It uses gradient information obtained from back-side automatic differentiation to train the artificial neural network. During training, the simulation is run once for each iteration. In each time step of the simulation, the artificial neural network generates muscle drive signals, which are input into the neuromechanical model along with the current model state to generate the state for the next time step. After thousands of time steps, the loss is calculated using a custom loss function, and the neural network weights are updated based on the gradient calculated by the Adam optimizer using the automatic differentiation system. After multiple iterations, the model can learn how to perform tumbling movements. Using the trained model, the rolling motion of fruit fly larvae is simulated, and the position information at each moment in the process is stored. Finally, the simulation process is rendered using the obtained data to generate a visualization file.

8. The method according to claim 1, characterized in that, In module (S3), a hyperparameter optimization method for the tumbling motion model of fruit fly larvae is designed based on the Bayesian optimization principle and combined with the TPE algorithm. In each experiment, for each hyperparameter, a Gaussian mixture model b(x) is maintained for the hyperparameters related to the optimal target value, and another Gaussian mixture model o(x) is maintained for the remaining hyperparameters. Within the set parameter space, the hyperparameters corresponding to the maximization of b(x) / o(x) are selected as the next set of search values. In this way, the method can adaptively adjust the size of the parameter search space and find the global optimum in as few iterations as possible.

Citation Information

Patent Citations

  • Bee poiser-based bionic three-dimensional angular velocity sensor

    CN102539815A

  • Bionic motion control method based on caenorhabditis elegans neural network

    CN114897125A