Underwater obstacle recognition and avoidance method for bionic robotic fish
By integrating the algorithm of convolutional neural network and impulse neural network, combined with the virtual environment and artificial potential field algorithm, the bionic robot fish can achieve fine classification of obstacles and real-time obstacle avoidance, solving the problem of obstacle recognition and obstacle avoidance in underwater operations. difficulty, improving work efficiency and stability.
Patent Information
- Application Number
- CN202411092453.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-09
- Publication Date
- 2024-10-29
AI Technical Summary
Due to the complex environment of bionic robotic fish in underwater operations, it is difficult to identify and avoid obstacles, and misjudgments and collisions are frequent. It is difficult for existing technology to achieve fast and accurate response and stable classification.
An algorithm that combines convolutional neural networks and impulse neural networks is used for obstacle training and identification. A deep convolutional impulse neural network is constructed by combining the virtual environment and artificial potential field algorithms to achieve fine classification of obstacles and real-time obstacle avoidance.
It improves the visual recognition accuracy and obstacle avoidance efficiency of the robotic fish, enhances the stability and real-time performance of underwater work, and enables more detailed observation and avoidance of underwater obstacles.
Smart Images

Figure CN118865327A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of bionic fish, and in particular relates to a visual classification method based on a neural network and a bionic robot fish obstacle avoidance method. Background Art
[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.
[0003] In recent years, the strategic position of marine resources has become increasingly important, and humans have also accelerated the pace of exploring the ocean. Various types of underwater robots have emerged. Fish can adapt to the ever-changing underwater environment through long-term genetic evolution and natural selection. Compared with traditional underwater thrusters, it has significant advantages in propulsion efficiency, maneuverability and stealth. In addition, with the development of science and technology, bionic robot fish plays a huge role in underwater detection, sampling, rescue, water quality testing, etc.
[0004] The inventors found that the current bionic robot fish still faces many problems in practical applications in terms of obstacle recognition and obstacle avoidance technology underwater. In the process of underwater operations, robot fish need to use vision to meet the task requirements of complex situations. When working in complex waters, robot fish are affected by underwater lighting, environment, water quality and complex and diverse environment, and cannot reasonably classify the collected images like fish. Obstacles are likely to be mistaken for traversable spaces, increasing the difficulty of identification and obstacle avoidance, which will cause the robot fish to collide with underwater obstacles during the task, causing damage to the equipment. Secondly, underwater operations require robot fish to respond quickly and accurately, which is also a big test for the real-time and stability of classification algorithms and equipment. The above problems cause the bionic robot fish to be unable to classify obstacles captured by the camera and avoid obstacles when swimming underwater. Summary of the invention
[0005] The present invention starts with the reasons for the underwater obstacle recognition and obstacle avoidance strategy of the robot fish:
[0006] In order to solve the above problems, the present invention provides a bionic robot fish underwater visual classification and obstacle avoidance method. The present invention randomly arranges obstacles in a constructed virtual environment, obtains obstacle data by using an image acquisition plug-in, trains and learns the obstacles using an algorithm that integrates a convolutional neural network and a pulse neural network, and reclassifies whether the obstacles are traversable. The trained network is embedded in the robot fish in the simulation environment. After the obstacles are identified, the obstacles can be avoided by constructing an artificial potential field, so that the robot fish can visually identify obstacles and avoid obstacles, thereby improving the efficiency of underwater work.
[0007] In order to achieve the above object, the present invention adopts the following technical solution:
[0008] A method for identifying underwater visual obstacles of a bionic robotic fish comprises the following steps:
[0009] Use Unreal Engine to build a simulated virtual environment. In the virtual environment, there must be no less than five types of obstacles, and each type must have three or more different obstacles;
[0010] Through the blueprint function, write random generation properties for each obstacle. The randomly generated content needs to include properties such as size, rotation angle, generation area, flip, etc.
[0011] Obtain obstacle data information in the environment through the Recording function in the simulation environment, assign initial weights to different types of obstacles, and obtain a weighted prediction training sample set;
[0012] Construct a neural network algorithm, use the neural network algorithm to classify the collected data, and use the optimization algorithm to optimize the network to reduce the complexity of the network and classify whether the obstacle type is traversable;
[0013] Construct an artificial potential field according to the environment, set the starting point and end point, and calculate the potential field force during the movement of the robot fish
[0014] After the calculation is completed, action planning is carried out according to the traversability classified by the neural network algorithm until the end point is reached.
[0015] As an optional implementation, the constructed simulated virtual environment is based on the ocean and has a size of 842×829×3635m 3 , obstacles can be randomly distributed and generated in this area.
[0016] As an optional implementation, the data set needs to be collected from various directions of the obstacle. The main obstacle should be placed in the image during collection. The collection process needs to be carried out from four directions respectively, and then a circular motion is performed around the obstacle.
[0017] As an optional implementation, in the present invention, the data set described is Q={a1,a2,…, b1,b2,…c1,c2}, and weights λ={A i ;B i ;C i}, and then add whether it is a traversable obstacle to the classification result.
[0018] As an optional implementation, the neural network algorithm is a deep convolutional spike neural network that combines the advantages of a convolutional neural network and a spike neural network. The model introduces a spike coding mechanism to improve the processing capability of spatial features while maintaining the feature extraction capability of the convolution layer. The model mainly includes a spike coding layer, a convolution layer, a spike neuron layer, a pooling layer, and a fully connected layer.
[0019] As an optional implementation, the obstacle avoidance algorithm is a vision-based artificial potential field obstacle avoidance algorithm. The model trained by the neural network is applied to the robot fish. The obstacles are classified through the real-time image capture function of the AirSim plug-in. Based on the classification results, the potential field model is updated to adapt to different types of obstacles.
[0020] As a further limitation, the implementation process of the neural network classification model is:
[0021] Step 101: Select an appropriate spiking neuron model, initialize the weights of the classification sample set, and initialize the hyperparameters of the model;
[0022] As an optional implementation, the spiking neuron model may use the LIF (Leaky Integrate-and-Fire) neuron model to construct a network, and its mathematical model is:
[0023]
[0024] In the formula, τ m is the time constant, V is the membrane potential of the current, V rest is the set resting membrane potential, V th is the set membrane potential threshold. When the input of the presynaptic neuron does not exceed the threshold, the potential obtained will return to the resting state; if the pulse received by the presynaptic neuron reaches the threshold after integration, a pulse signal will be issued to stimulate the postsynaptic neuron. After the excitation pulse, it enters the refractory period and will not give a corresponding response even if stimulated. Figure 1 shown.
[0025] Step 102: Pulse encoding the data set, then inputting the data into a neural network for training, and optimizing the network using an optimization algorithm to reduce the complexity of the network;
[0026] As an optional implementation, the pulse coding method can use Poisson coding. Poisson coding generates a random pulse sequence at a fixed rate and passes it to the network as input. When the input signal reaches a certain intensity, the neuron will generate a pulse discharge and pass the pulse signal to subsequent neurons for information processing.
[0027]
[0028] Where k is the number of excitation pulses, the average number of pulses emitted in the time step T is λ, also known as the excitation frequency which is proportional to the pixel value, and the probability of no pulses being generated within time t is e -λ .
[0029] Step 103: After the classification training is completed, sort and classify all current categories, select the groups with the lowest classification accuracy, train again, and adjust the pulse neurons
[0030] Step 104: After the classification training is completed, a binary classification network with the same structure is constructed again to classify whether the classification result is traversable;
[0031] As an optional implementation, the objective function of the spiking neural network optimization algorithm is a minimum loss function, which can be determined using synaptic time-dependent plasticity (STDP). The specific mathematical model is:
[0032]
[0033] Among them, ω ij is the weight change from synapse i to j, A + and A - is the magnitude constant of gain and loss, Δt ij is the time difference between the presynaptic neuron spike and the postsynaptic neuron spike, and η is the learning rate. τ + and τ - are the time constants of the forward and backward effects, respectively.
[0034] As an optional implementation, the optimization algorithm is specifically one of the algorithms of synaptic time-dependent plasticity, synaptic delayed plasticity, dopamine modulation optimization, weight sharing and sparsification, etc.
[0035] The optional network models and strategies include pulse coding strategies, pulse neuron models, synaptic models between pulse neurons, etc.
[0036] As an optional implementation, the specific process of the vision-based artificial potential field obstacle avoidance algorithm is as follows:
[0037] Step 201: Based on the classification results, the potential field model is updated, and different repulsive potential field functions are set for different types of obstacles:
[0038]
[0039] Among them, k obs,i and ρ i It is for The repulsive potential field coefficient and influence range of such obstacles.
[0040] Step 202: Obtain the image of the obstacle in real time through the AirSim plug-in, adjust the potential field model according to the classification result of the neural network, and generate a combined potential field.
[0041]
[0042] Among them, U goal (x) is the gravitational force of the target point, ∑U oks,i (x) is the combined repulsive force of all obstacles.
[0043] Step 203: Calculate the force on the robot fish in the resultant potential field to achieve reaching the designated target point while avoiding obstacles:
[0044]
[0045] Step 204: Use the calculated resultant force to update the speed and movement direction of the robot fish:
[0046]
[0047] Where v = F(x) is the current speed of the robot fish. This realizes the obstacle avoidance function when swimming to the target point.
[0048] The present invention uses a deep convolutional pulse neural network to classify and identify obstacles in complex waters. The network model combines the advantages of convolutional neural networks and pulse neural networks, extracts the features of image data through convolution, and converts them into pulse signals, and then uses pulse coding to transmit the pulse signals to subsequent neuron layers for classification tasks. Due to the sparsity of the deep convolutional pulse neural network, it can effectively process complex data and enhance the visual bionics of the robot fish. Secondly, a vision-based artificial potential field obstacle avoidance algorithm is proposed. On the basis of the artificial potential field algorithm, a visual module is added to provide real-time environmental information, so that the robot fish can perceive the position, shape and distance of obstacles in time, adjust the obstacle avoidance path of the robot fish more finely, update the obstacle avoidance strategy in real time, realize the use of vision to detect obstacles, and update the data between obstacles in real time, and then calculate the gravity and repulsion in real time, guide the movement and obstacle avoidance behavior of the robot fish. In addition, by using the Unreal Engine, an underwater virtual environment is constructed, in which there are obstacles such as corals, reefs, water plants and sharks. Randomly generated attributes are added to each obstacle to construct a complex and random water model.
[0049] The beneficial effects of the present invention are:
[0050] The present invention provides a method for underwater obstacle recognition and avoidance of a bionic robot fish. The method utilizes the fusion of a convolutional neural network and a pulse neural network, and by using the ability of the convolutional neural network to extract features and the biological rationality, sparsity and time coding characteristics of the pulse neural network, the network maintains biological authenticity while maintaining a better learning effect. The constructed network can accurately and precisely identify the visual information currently acquired by the robot fish, thereby improving the reliability and applicability of the robot fish's visual system, so that the robot fish can better observe the underwater environment. After identifying an obstacle, the robot fish can achieve obstacle avoidance through an artificial potential field algorithm combined with vision. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0053] Figure 1 Building a simulated water environment scene for at least one embodiment of the present invention;
[0054] Figure 2 A blueprint used for random generation of obstacles in a simulation environment of at least one embodiment of the present invention;
[0055] Figure 3 The working principle of the spiking neuron of at least one embodiment of the present invention;
[0056] Figure 4 A neural network structure diagram of at least one embodiment of the present invention;
[0057] Figure 5 The present invention is a system working flow chart of at least one embodiment of the present invention. DETAILED DESCRIPTION
[0059] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0060] It should be noted that the following detailed descriptions are all illustrative and intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.
[0061] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.
[0062] A bionic robot fish underwater obstacle recognition and obstacle avoidance method comprises the following steps:
[0063] S1: Use Unreal Engine to build a simulated virtual environment. In the virtual environment, there must be no less than five types of obstacles, and each type must have three or more different obstacles;
[0064] S2: Use the blueprint function to write random generation properties for each obstacle. The randomly generated content needs to include properties such as size, rotation angle, generation area, flip, etc.
[0065] S3: Obtain obstacle data information in the environment through the Recording function in the simulation environment, assign initial weights to different types of obstacles, and obtain a weighted prediction training sample set;
[0066] S4: Use a neural network algorithm to classify the collected data, and use an optimization algorithm to optimize the network to reduce the complexity of the network and classify whether the obstacle type is traversable;
[0067] S5: Construct an artificial potential field according to the environment, set the starting point and the end point, and realize the potential field force calculation during the swimming process of the robot fish;
[0068] S6: After the calculation is completed, action planning is performed according to the traversability classified by the neural network algorithm until the end point is reached.
[0069] Specifically, the simulated virtual environment described in step S1 is built by the Unreal Engine, and five major types of obstacles are set, namely reefs, corals, aquatic plants, fish, sunken ships and trees, etc. For each type of obstacle, more than three different models are set.
[0070] Specifically, the random generation of attributes described in step S2 is implemented by the blueprint function. It mainly adds four attributes to the obstacle: quantity, rotation, range, and scale. The quantity is set through a loop, and then the range, rotation, and scale attributes are added with random floating point numbers and passed to the obstacle using a vector.
[0071] Specifically, the Recording function described in step S3 can be implemented by setting the SubWindows property in the setting.json file. In addition to the basic color scene graph, Recording can also obtain various image types such as depth map, segmentation map, surface normal map, infrared map, etc., thereby realizing the fusion of different image data and various obstacle avoidance algorithms.
[0072] Specifically, the neural network algorithm described in step S4 is a deep convolutional spike neural network, which integrates the convolutional neural network and the spike neural network, including a spike coding layer, a convolution layer, a spike neuron layer, a pooling layer and a fully connected layer.
[0073] Specifically, the optimization method described in step S4 takes the minimum loss function as the objective function and uses synaptic time-dependent plasticity (STDP) to determine. After the network output, the loss function is calculated, and STDP updates the weights between synapses according to the firing time difference of neurons.
[0074] The mathematical model of synaptic plasticity used is as follows:
[0075]
[0076] Among them, ω ij is the weight change from synapse i to j, A + and A - is the magnitude constant of gain and loss, Δt ij is the time difference between the presynaptic neuron spike and the postsynaptic neuron spike, and η is the learning rate. τ + and τ - are the time constants of the forward and backward effects, respectively.
[0077] Specifically, the implementation process of the neural network classification model described in step S4 is:
[0078] Step 101: Select an appropriate spiking neuron model, initialize the weights of the classification sample set, and initialize the hyperparameters of the model;
[0079] Step 102: Pulse coding is performed on the data set, and Poisson coding is selected in the coding process. The data is then input into the neural network for training, and the network is optimized using an optimization algorithm to reduce the complexity of the network;
[0080] Step 103: After the classification training is completed, sort and classify all current categories, select the groups with the lowest classification accuracy, train again, and adjust the pulse neurons
[0081] Step 104: After the classification training is completed, a binary classification network with the same structure is constructed again to classify whether the classification result is traversable;
[0082] As an optional embodiment, the objective function of the spiking neural network optimization algorithm is a minimum loss function, which can be determined using synaptic time-dependent plasticity (STDP).
[0083] Specifically, the implementation process of the potential field construction and resultant force calculation described in step S5 is:
[0084] Step 201: Based on the classification results, the potential field model is updated, and different repulsive potential field functions are set for different types of obstacles:
[0085]
[0086] Among them, k obs,i and ρ i It is for The repulsive potential field coefficient and influence range of such obstacles.
[0087] Step 202: Obtain the image of the obstacle in real time through the AirSim plug-in, adjust the potential field model according to the classification result of the neural network, and generate a combined potential field.
[0088]
[0089] Among them, U goal (x) is the gravitational force of the target point, ∑U oks,i (x) is the combined repulsive force of all obstacles.
[0090] Step 203: Calculate the force on the robot fish in the resultant potential field to achieve reaching the designated target point while avoiding obstacles:
[0091]
[0092] Step 204: Use the calculated resultant force to update the speed and movement direction of the robot fish:
[0093]
[0094] Where v = F(x) is the current speed of the robot fish. This realizes the obstacle avoidance function when swimming to the target point.
Claims
1. A method for identifying underwater visual obstacles of a bionic robotic fish. Its characteristics are: The following steps are involved: Step 101: Use Unreal Engine to build a simulated virtual environment. In the virtual environment, there must be no less than five types of obstacles, and each type must have three or more different obstacles; Step 102: Use the blueprint function to write random generation properties for each obstacle. The randomly generated content needs to include properties such as size, rotation angle, generation area, flip, etc. Step 103: Obtain obstacle data information in the environment through the Recording function in the simulation environment, and assign initial weights to different types of obstacles to obtain a weighted prediction training sample set; Step 104: construct a neural network algorithm, use the neural network algorithm to classify the collected data, and use the optimization algorithm to optimize the network to reduce the complexity of the network and classify whether the obstacle type is traversable; Step 105: Construct an artificial potential field for the environment, set the starting point and the end point, and calculate the potential field force during the movement of the robot fish Step 106: After the calculation is completed, action planning is performed according to the traversability classified by the neural network algorithm until the end point is reached.
2. A method for identifying underwater visual impairments of a bionic robotic fish as claimed in claim 1, Its characteristics are: In order to simulate complex waters, the Unreal Engine was used to build a simulated ocean environment, set up a variety of different types of obstacles, and add random generation attributes to each obstacle to simulate the real complex water environment.
3. A method for identifying underwater visual obstacles of a bionic robotic fish as claimed in claim 1, Its characteristics are: The neural network algorithm is a deep convolutional spike neural network, which integrates convolutional neural network and spike neural network, including spike coding layer, convolution layer, spike neuron layer, pooling layer and fully connected layer.
4. A method for identifying underwater visual impairments of a bionic robotic fish as claimed in claim 1, Its characteristics are: The implementation process of the neural network classification model is as follows: Step 201: Select an appropriate spiking neuron model, initialize the weights of the classification sample set, and initialize the hyperparameters of the model; Step 202: Pulse coding is performed on the data set, and Poisson coding is selected in the coding process. The data is then input into the neural network for training, and the network is optimized using an optimization algorithm to reduce the complexity of the network; Step 203: After the classification training is completed, sort and classify all current categories, select the groups with the lowest classification accuracy, train again, and adjust the pulse neurons Step 204: After the classification training is completed, a binary classification network with the same structure is constructed again to reclassify whether the classification results are traversable.
5. The method for recognizing underwater visual impairment of a bionic robotic fish according to claim 1, Its characteristics are: The neural network classifies the collected data set with the goal of quickly and accurately identifying each type of obstacle, and uses synaptic time-dependent plasticity to optimize to ensure the minimum loss function; the optimization method is determined using synaptic time-dependent plasticity (STDP). After the network output, the loss function is calculated, and STDP updates the weights between synapses based on the firing time difference of neurons.
6. The mathematical model of synaptic plasticity used is as follows: ; in, It's synapse arrive The weight change of and is the magnitude constant of gain and loss, is the time difference between the presynaptic neuron spike and the postsynaptic neuron spike, is the learning rate. and are the time constants of forward and backward aging, respectively.
7. The method for recognizing underwater visual obstacles of a bionic robotic fish as claimed in claim 1, Its characteristics are: The obstacle avoidance algorithm is a vision-based artificial potential field obstacle avoidance algorithm. The model trained by the neural network is applied to the robotic fish. The obstacles are classified through the real-time image capture function of the AirSim plug-in. Based on the classification results, the potential field model is updated to adapt to different types of obstacles.
8. The method for recognizing underwater visual obstacles of a bionic robotic fish as claimed in claim 1, Its characteristics are: The specific process of the vision-based artificial potential field obstacle avoidance algorithm is as follows: Step 301: Based on the classification results, the potential field model is updated, and different repulsive potential field functions are set for different types of obstacles: ; in, and It is for The repulsive potential field coefficient and influence range of similar obstacles; Step 302: Obtain the image of the obstacle in real time through the AirSim plug-in, adjust the potential field model according to the classification result of the neural network, and generate a combined potential field; ; in, is the gravitational force of the target point, is the combined repulsive force of all obstacles; Step 303: Calculate the force on the robot fish in the resultant potential field to achieve reaching the designated target point while avoiding obstacles: ; Step 304: Use the calculated resultant force to update the speed and movement direction of the robotic fish: ; in, is the current speed of the robot fish. It realizes the obstacle avoidance function when swimming to the target point.
Citation Information
Cited By
Control optimization method for bionic underwater robot
CN119861724A
