Trajectory tracking control method for autonomous underwater robot based on semantic reinforcement learning
Through methods based on semantic reinforcement learning, autonomous underwater robots achieve higher safety and tracking efficiency in dynamic ocean environments, solving the problems of insufficient safety and low training efficiency in existing technologies. Through semantic understanding and safety constraints Efficient inspection of submarine optical cables and pipelines is achieved.
Patent Information
- Application Number
- CN202410764660.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-14
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2044-06-14
AI Technical Summary
Existing autonomous underwater robot trajectory tracking based on reinforcement learning is difficult to accurately predict potential hazards in a dynamic ocean environment, resulting in insufficient safety and low training efficiency. It cannot effectively utilize existing experience and is difficult to complete inspections of submarine optical cables and pipelines.
A method based on semantic reinforcement learning is used to obtain ocean environment images through visual sensors, and a semantic understander is used to extract environmental feature points and semantic information. It is combined with a safety checker and a state recovery mechanism to perform motion decision-making and retraining under safety constraints to ensure autonomy. Underwater robots can safely track trajectories in dynamic environments.
It improves the safety and tracking efficiency of autonomous underwater robots in dynamic environments. It can better understand environmental changes, predict potential dangers, and automatically restore to the previous safe state after a collision, improving training efficiency.
Smart Images

Figure CN118331288B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of underwater robot control, and in particular relates to an autonomous underwater robot trajectory tracking control method based on semantic reinforcement learning. Background Art
[0002] With the development of society and economy, the laying distance of submarine optical cables and pipelines is getting longer and longer. The problem that follows is the increasing daily maintenance and inspection work. At the same time, the light in the marine environment is weak, the visibility is low, and there are dynamic obstacles and the influence of changing ocean currents, which increases the difficulty of maintenance and inspection. In recent years, with the rapid development of new generation information technologies such as sensor technology, intelligent manufacturing and artificial intelligence, robots have gradually replaced people to complete work in high-risk environments. As a typical intelligent unmanned system, autonomous underwater robots have become an important carrier for inspecting submarine optical cables and pipelines because of their own energy, flexible control, wide and deep navigation range, and rich operation types.
[0003] Tracking of submarine optical cables and pipelines is an important part of submarine optical cable and pipeline maintenance and inspection. Reinforcement learning can make optimal decisions by interacting with the environment and learning, and is a common method for autonomous underwater robots to achieve trajectory tracking. However, there are the following difficulties in autonomous underwater robot trajectory tracking based on reinforcement learning: (1) The dynamic ocean environment makes it difficult for autonomous underwater robots to perceive, especially dynamic obstacles and other inspection underwater robots increase the probability of collision. It is difficult to accurately predict potential dangers and achieve precise obstacle avoidance by only perceiving information through the visual sensors carried by autonomous underwater robots. (2) Reinforcement learning uses trial and error to find the optimal decision. Obstacles may suddenly appear in the dynamic environment, making it impossible for autonomous underwater robots to avoid them during training. Their safety cannot be guaranteed, making it difficult to complete submarine optical cable and pipeline inspections. (3) Ocean currents in the ocean environment are one of the factors that affect the navigation of autonomous underwater robots. Once the ocean current causes the autonomous underwater robot to deviate from the trajectory during the tracking process, the previously trained model cannot be applied to the trajectory tracking after the deviation. At the same time, once the environment changes, the optimal strategy learned previously is no longer applicable and needs to be recalculated to obtain a new optimal strategy. Reinforcement learning usually abandons the original strategy and starts learning from the initial state. This method has low tracking efficiency and does not make full use of existing experience, which is inconsistent with actual needs.
[0004] Therefore, based on the above three difficulties, it is necessary to design a more effective trajectory tracking method so that the autonomous underwater robot has higher inspection efficiency and better safety protection, so that it can meet the needs of actual engineering. Summary of the invention
[0005] The technical problem to be solved by the present invention is to provide an autonomous underwater robot trajectory tracking control method based on semantic reinforcement learning in view of the deficiencies of the above-mentioned prior art.
[0006] In order to achieve the above technical objectives, the technical solution adopted by the present invention is:
[0007] The trajectory tracking control method of an autonomous underwater robot based on semantic reinforcement learning includes:
[0008] S1: Autonomous underwater robots obtain image information of the ocean environment through visual sensors;
[0009] S2: Based on the image information of the ocean environment, a reinforcement learning-based trajectory tracking controller is used for reinforcement learning training to obtain the optimal motion decision;
[0010] S3: Use the semantic understander to extract marine environment feature points and understand the semantics of the marine environment image information to obtain the marine environment semantics;
[0011] S4: Use the safety checker to determine whether the motion decision of the autonomous underwater vehicle is safe based on the optimal motion decision, ocean environment semantics, and historical unsafe event information. If it is safe, the autonomous underwater vehicle executes the motion decision and returns to S1, otherwise execute S5;
[0012] S5: For unsafe actions, the autonomous underwater robot uses reinforcement learning to make new motion decisions under safety constraints, and then executes the safety judgment of S4. If it is still unsafe, it means that the autonomous underwater robot cannot avoid collision. The current unsafe event is stored in the safety checker and retrained based on the state recovery mechanism.
[0013] To optimize the above technical solutions, the specific measures taken also include:
[0014] The above S3 uses a semantic understander to extract marine environment feature points and semantically understand the marine environment image information to obtain marine environment semantics, including:
[0015] S31: inputting the ocean environment image information into a semantic encoder, and the semantic encoder inputting the ocean environment image information into a semantic segmentation network to obtain a pixel-level semantic image;
[0016] S32: The semantic encoder performs optical flow tracking on the marine environment image information, distinguishes the feature points of static pipelines, cables and dynamic obstacles by comparing the difference between the current image and the previous image, and removes the feature points of dynamic obstacles to obtain an image without the feature points of dynamic obstacles;
[0017] S33: fusing semantic information of the image with dynamic obstacle feature points removed and the pixel-level semantic image;
[0018] S34: setting a uniform distribution mask of feature points in the fused semantic information according to the minimum distance of the feature points, thereby separating the static semantic coding information of the pipeline and cable to be tracked, and realizing the separation of the static tracking object from the fused semantic information;
[0019] S35: setting a region of interest, that is, a region of dynamic obstacles, in the fused semantic information from which the static tracking object is separated;
[0020] S36: re-extracting feature points in the area of interest to obtain semantic coding information of dynamic obstacles.
[0021] S37: Input the semantic coding information into the semantic decoder to obtain the ocean environment semantic information.
[0022] The above semantic decoder adopts LSTM decoder.
[0023] In the above S5, for unsafe actions, the autonomous underwater robot uses reinforcement learning to make new motion decisions under safety constraints, including:
[0024] S51: Define a critical state set and an unsafe action set, as shown in formulas (7) and (8):
[0025] ; (7)
[0026] ; (8)
[0027] in, represents the critical state set of the autonomous underwater robot, , It is t Moment and t +1 The state of the autonomous underwater robot at the moment, is the state set of the autonomous underwater robot, is the set of dangerous states of the autonomous underwater robot, is the set of unsafe actions for autonomous underwater robots, It is t The actions of the autonomous underwater robot at all times, It is the action set of the autonomous underwater robot;
[0028] S52: Based on the critical state set and the unsafe action set, the dangerous state around the obstacle and the dangerous action corresponding to each state are predicted as follows:
[0029] ; (9)
[0030] in, Dangerous state set A specific dangerous state in , Represents the predicted dangerous state and the predicted dangerous action corresponding to the state, Indicates that according to the dangerous state The set of predicted dangerous states, represents the set of dangerous actions predicted based on the predicted dangerous state;
[0031] S53: adding the predicted dangerous state and dangerous action to the training set to train the reinforcement learning;
[0032] S54: After the training in step S53, the autonomous underwater robot adopts Select a strategy and choose different actions according to different probabilities. When the probability is , the action and state selection strategies are:
[0033] ; (10)
[0034] When the probability is When , the action and state strategy selection of the autonomous underwater robot is:
[0035] (11)
[0036] in, Indicates that the status is , action is The optimal action strategy in the case of The status is , action is In this case, the cumulative reward value of all actions is is the cumulative reward value of all actions except unsafe actions, To explore the probability, represents the probability of utilization;
[0037] S55: the action and state of the autonomous underwater robot selected according to the strategy of step S54 is such that the trajectory tracking of the pipeline and the cable by the autonomous underwater robot is expressed as finding a maximized action cost function under the safety constraints based on the safety checker;
[0038] S56: After the autonomous underwater robot completes an action, the maximum action cost function is updated;
[0039] S57: The autonomous underwater robot makes new motion decisions based on the maximized action cost function and its update.
[0040] The maximum action cost function described in S55 above is:
[0041] ; (12)
[0042] At the same time, the safety constraints are met:
[0043] ; (13)
[0044] in, Indicates the action decision The rewards that can be accumulated in the case of represents the discount factor of the reward, Indicates in status Take Action The reward value that can be obtained after Indicates decision making in action The mathematical expectation of the case is Indicates time.
[0045] The above S56 updates the maximum action cost function, which is expressed as:
[0046] ; (14)
[0047] in, Indicates the status is , action is In this case, the cumulative reward value of all actions is Indicates the status is , action is In this case, the cumulative reward value of all actions is represents the learning efficiency of reinforcement learning, Status is , action is Rewards received under the circumstances.
[0048] The above S5 stores the current unsafe event in the safety checker and retrains based on the state recovery mechanism, including:
[0049] Step a) sampling and recording the motion strategy of the autonomous underwater robot for pipeline and cable tracking inspection and the safety state caused by the motion strategy, as shown in formula (15):
[0050] ; (15)
[0051] in, represents a sequence of safe states and motion strategies, , , Indicates the first moment, the second moment, the t Security status at all times, , , Indicates the first moment, the second moment, the t Moment-by-moment movement strategy;
[0052] Step b) assigning a credibility factor to each sampled safety state taking into account the time coefficient, safety state correlation coefficient, and safety coefficient;
[0053] Step c) When an unavoidable security incident occurs, the state recovery mechanism selects the security state corresponding to the maximum credibility factor from the assigned security states as the starting state for retraining and returning;
[0054] Step d) Safety reinforcement learning returns to the last safe state, adds the unsafe events to the training set, and restarts the training.
[0055] The credibility factors mentioned above are:
[0056] ; (16)
[0057] ; (17)
[0058] ; (18)
[0059] ; (19)
[0060] The sequence of credibility factors and corresponding states is shown in formula (20):
[0061] ; (20)
[0062] in, , , Indicates the first moment, the second moment, the t The credibility factor corresponding to the security status at the moment, represents the time coefficient, Indicates safe status and The correlation coefficient of represents the safety factor, Indicates the weight of time, correlation coefficient and safety coefficient in the credibility factor, represents the sequence of credibility factors and corresponding states, , , Indicates the first moment, the second moment, the t Security status at all times, Represents the time interval between two safe states, Indicates safe status and The covariance of , Indicates safe status and The autocorrelation of , is a constant, Indicates the safety value of the adjacent safety state.
[0063] In step c) above, when an unavoidable security incident occurs, the state recovery mechanism selects the security state corresponding to the largest credibility factor from the assigned security state as the starting state for retraining and return, as shown in formula (21):
[0064] (twenty one)
[0065] in, Indicates the starting state returned by the safety reinforcement learning retraining after an unsafe incident occurs. Indicates the safety status corresponding to the credibility factor with the largest value.
[0066] The present invention has the following beneficial effects:
[0067] First, visual semantic understanding is added to the environmental perception link, so that the autonomous underwater robot can better understand environmental information and changes and predict potential dangers. Then, the strong adaptability of reinforcement learning is fully utilized to add safety constraints in the training link to ensure the safety of the autonomous underwater robot. Finally, a state recovery mechanism is designed. Once the autonomous underwater robot collides, it can automatically recover to the previous optimal safety state, rather than recovering to the initial state and restarting training, thereby improving training efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] Figure 1 The block diagram of the trajectory tracking control of the autonomous underwater robot based on semantic safety reinforcement learning provided by the present invention;
[0069] Figure 2 A block diagram of the marine environment semantic understander provided by the present invention;
[0070] Figure 3 A block diagram of a semantic encoder provided by the present invention;
[0071] Figure 4 A block diagram of a semantic decoder provided by the present invention;
[0072] Figure 5 A block diagram of the safety checker provided by the present invention;
[0073] Figure 6 This is a block diagram of the retraining initial state selection provided by the present invention. DETAILED DESCRIPTION
[0074] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0075] Although the steps in the present invention are arranged with numbers, they are not used to limit the order of the steps. Unless the order of the steps is clearly stated or the execution of a certain step requires other steps as a basis, the relative order of the steps can be adjusted. It is understood that the term "and / or" used in this article involves and covers any and all possible combinations of one or more of the associated listed items.
[0076] like Figure 1-6 As shown, the trajectory tracking control method of an autonomous underwater robot based on semantic safety reinforcement learning of the present invention has the following specific steps:
[0077] S1: Autonomous underwater robots obtain image information of the ocean environment through visual sensors;
[0078] In this step, the autonomous underwater robot obtains image information of the ocean environment through the visual sensor it carries.
[0079] S2: Based on the image information of the ocean environment, a reinforcement learning-based trajectory tracking controller is used for reinforcement learning training to obtain the optimal motion decision;
[0080] In this step, the autonomous underwater robot uses a reinforcement learning-based trajectory tracking controller to perform reinforcement learning training based on visual environment information to find the optimal motion decision for the trajectory tracking of the autonomous underwater robot.
[0081] S3: Use the semantic understander to extract marine environment feature points and understand the semantics of the marine environment image information to obtain the marine environment semantics;
[0082] Because the ocean environment is complex and changeable, it is difficult to predict potential dangers by simply judging the environment through visual images. This step introduces visual environment information into the semantic understander to gain a deeper understanding of the environment information. Specifically, the visual sensor carried by the autonomous underwater robot obtains images of the dynamic ocean environment, and the images are input into the ocean environment semantic understanding module and the reinforcement learning module, such as Figure 1 The semantic understanding module contains a semantic encoder and a semantic decoder, as shown in Figure 2 The semantic encoder uses a fusion semantic information algorithm to divide the environment image into two paths: one path performs optical flow tracking and dynamic feature points, and the other path performs semantic segmentation to generate a semantic image, and then extracts the feature points in the set area, as shown in Figure 3As shown. The optical flow tracking is to optimize the reprojection error in the image and improve the accuracy and robustness of the autonomous underwater robot's perception of static and dynamic environments. Semantic segmentation screens and extracts feature points to avoid dynamic feature points from participating in back-end optimization. After semantic coding and extracting feature points, feature decoding is used to obtain semantic understanding of the dynamic ocean environment. The semantic decoder in the present invention adopts the LSTM algorithm, such as Figure 4 As shown in the figure, LSTM has advantages in modeling and predicting information due to the implicit contextual dependencies in the sequence. The understood semantics is used as the input of the safety checker to carry out safety research and provide decision recommendations for autonomous trajectory tracking.
[0083] S4: Use the safety checker to determine whether the motion decision of the autonomous underwater vehicle is safe based on the optimal motion decision, ocean environment semantics, and historical unsafe event information. If it is safe, the autonomous underwater vehicle executes the motion decision and returns to S1, otherwise execute S5;
[0084] In this step, the information output by the semantic understander is input into the safety checker. The safety checker combines the semantic information, the previously stored unsafe events, and the motion decision made by the autonomous underwater robot in the second step to determine whether the motion of the autonomous underwater vehicle is safe. If the current action is safe, it returns to the ocean environment, and the autonomous underwater robot follows the trajectory of the current action. If the current action is unsafe, it returns to the autonomous underwater robot trajectory tracking control system to impose safety constraints on the action of the autonomous underwater robot.
[0085] S5: For unsafe actions, the autonomous underwater robot uses reinforcement learning to make new motion decisions under safety constraints, and then executes the safety judgment of S4. If it is still unsafe, it means that the autonomous underwater robot cannot avoid collision. The current unsafe event is stored in the safety checker and retrained based on the state recovery mechanism.
[0086] The trajectory tracking algorithm in the present invention includes two steps: the first step is that the autonomous underwater robot uses reinforcement learning to learn based on environmental information and make motion decisions. The second step is to improve the safety of the autonomous underwater robot's operation by sending the understanding of environmental semantics to the safety detection module. In the safety detection module, the semantic understanding and the stored previously occurring unsafe events jointly determine whether the motion decision in the first step is safe. If it is unsafe, the autonomous underwater robot will further revise the motion decision to ensure its own safety, such as Figure 5As shown. In the first step, the present invention uses a traditional reinforcement learning method. The autonomous underwater robot selects an action, the environment changes as the action is executed, and the observed value of its state and the reward associated with the potential transition are sent to the autonomous underwater robot. The goal of the autonomous underwater robot is to optimize the rewards accumulated in this evolutionary process. The second step is to set the unsafe actions of the autonomous underwater robot as negative rewards and set a threshold for the negative rewards. When the negative reward is greater than the threshold, it is regarded as a dangerous event to stop the action of the autonomous underwater robot and record the unsafe information. The unsafe information will update the safety detection so that the autonomous underwater robot can correct the tracking trajectory.
[0087] The present invention also proposes retraining based on a state recovery mechanism. Due to the motion performance of the autonomous underwater robot, it cannot be guaranteed that all unsafe events can be avoided. When a collision occurs, reinforcement learning needs to be retrained. Traditional reinforcement learning will directly return to the initial state and restart learning. By replacing the support set images in the actual category with obstacle images in the environment, the reasoning ability for such obstacles is improved and the occurrence of errors is reduced. However, this method is inefficient. The present invention aims at the problem of retraining efficiency in actual navigation applications of reinforcement learning, and proposes a state recovery mechanism based on a credibility factor, such as Figure 6 As shown. The state of the autonomous underwater robot is sampled, and each sampled safety state is recorded. At the same time, a credibility factor is assigned to each safe sampled state. The credibility factor takes into account the time interval, correlation, and safety coefficients between the current state and the previous state. And the weight is designed for each factor according to the actual influence. The credibility factor of each sampled safety state is the sum of the product of each coefficient and the weight. When an unsafe state occurs, the autonomous underwater robot selects the safe state with the largest credibility factor as the starting state for retraining, thereby improving the training efficiency and achieving the purpose of rapid learning.
[0088] In the embodiment, the marine environment semantic understander designed by the present invention includes two parts, one part is a semantic encoder, whose main function is to extract information features of the marine environment; the other part is a semantic decoder, whose main function is to compile features in the environment into semantic information that can be understood by the security inspection module.
[0089] The encoder uses a fusion semantic information algorithm, which focuses on the extraction of feature points of pipelines, cables and dynamic obstacles that need to be tracked. In order to more accurately distinguish these two types of features, a semantic mask is set when extracting the feature points of tracking pipelines and cables to avoid extracting feature points on dynamic obstacles, and the dynamic obstacle feature point matching pairs are eliminated according to the semantic segmentation results during the tracking process, so that the autonomous underwater robot can accurately find the required tracking trajectory. The feature point extraction of dynamic obstacles is to semantically segment the image information of the marine environment image information, obtain the semantic image, and then fuse it with the image that proposes the dynamic obstacle features to obtain the feature information of the dynamic obstacle, which is used for dynamic obstacle safety prediction after semantic decoding.
[0090] The present invention adopts LSTM (Long Short-Term Memory) recurrent neural network for decoding. The features extracted by the encoder are sent to the LSTM network for decoding, and the generated image content is described. Due to the implicit contextual dependencies in the sequence, LSTM has great advantages in modeling and predicting information, and is suitable for decoding dynamic information.
[0091] The specific workflow of the semantic understander of the present invention is as follows:
[0092] S31: inputting the ocean environment image information into a semantic encoder, and the semantic encoder inputting the ocean environment image information into a semantic segmentation network to obtain a pixel-level semantic image;
[0093] In this step, the visual image collected by the autonomous underwater robot's visual sensor is input into the semantic encoder, and the semantic encoder sends the visual image into the semantic segmentation network to obtain a pixel-level semantic image.
[0094] S32: The semantic encoder performs optical flow tracking on the marine environment image information, distinguishes the feature points of static pipelines, cables and dynamic obstacles by comparing the difference between the current image and the previous image, and removes the feature points of dynamic obstacles to obtain an image without the feature points of dynamic obstacles;
[0095] In this step, the semantic encoder simultaneously performs optical flow tracking on the visual image, and distinguishes the feature points of static pipes, cables, and dynamic obstacles by comparing the difference between the current image and the previous image.
[0096] Eliminate feature points of dynamic obstacles from optical flow tracking images.
[0097] S33: fusing semantic information of the image with dynamic obstacle feature points removed and the pixel-level semantic image;
[0098] S34: setting a uniform distribution mask of feature points in the fused semantic information according to the minimum distance of the feature points, thereby separating the static semantic coding information of the pipeline and cable to be tracked, and realizing the separation of the static tracking object from the fused semantic information;
[0099] S35: setting a region of interest, that is, a region of dynamic obstacles, in the fused semantic information after the static tracking object is separated, that is, finding semantic information of dynamic obstacles in the semantic information after the static tracking object is removed;
[0100] S36: Re-extract feature points in the area of interest to obtain semantic coding information of dynamic obstacles.
[0101] S37: After completing the semantic coding, the semantic coding information is input into the semantic decoder.
[0102] The semantic decoder adopts LSTM decoder, whose core is a memory unit that can store the input signal observed until that step at each time step.
[0103] The three control gates of LSTM are shown in formulas (1) to (3):
[0104] ; (1)
[0105] ; (2)
[0106] ; (3)
[0107] The memory units of LSTM are shown in the following formulas (4) to (6):
[0108] ; (4)
[0109] ; (5)
[0110] ; (6)
[0111] in , , , , , Respectively t The output of the input gate, the output of the forget gate, the output of the output gate, the temporary memory, the memory, and the hidden state at each moment. is the activation function. As the input of the three control gates, the machine semantics encodes information. , express t-1 memory and hidden state. represents the weight matrix of the input gate, represents the bias vector of the input gate; represents the weight matrix of the forget gate, Represents the bias vector of the forget gate; represents the weight matrix of the output gate, represents the bias vector of the output gate; represents the weight matrix of the memory unit, Represents the bias vector of the memory unit.
[0112] LSTM in time t The output of -1 is , at time t is fed into the LSTM, during which all recurrent connections are converted into feed-forward connections and pass the image content to the LSTM.
[0113] The LSTM decoder outputs semantic information about the ocean environment that helps reinforcement learning make safe decisions.
[0114] In the embodiment, in the traditional reinforcement learning setting, the autonomous underwater robot selects a tracking motion action through training. The environment will change accordingly as the autonomous underwater robot performs the action. Reinforcement learning converts the results of its own state change and environmental change into corresponding rewards. A positive reward is given to positive actions, a negative reward is given to unsafe actions, and the results of each action are accumulated. The goal of the autonomous underwater robot through reinforcement learning is to optimize the reward in this process to maximize it. However, in the reinforcement learning method, even if a large negative reward is given to unsafe actions, as the training deepens, the sampling frequency will decrease, and these unsafe actions may not be collected. At the same time, the autonomous underwater robot needs to make a large number of actions in the actual inspection task. Even if the sampling frequency is high, unsafe movements may be missed, which poses a great threat to the safe operation of the autonomous underwater robot. The present invention designs a reinforcement learning algorithm under safety constraints to enable the autonomous underwater robot to avoid obstacles when identifying underwater dangers without selecting dangerous motion actions. At the same time, the autonomous underwater robot will no longer select the same unsafe action after a collision. The specific steps are as follows:
[0115] S51: In order to ensure the safety of the autonomous water robot during operation, a critical state set and an unsafe action set are first defined, as shown in formulas (7) and (8):
[0116] ; (7)
[0117] ; (8)
[0118] in, represents the critical state set of the autonomous underwater robot, , It is t Moment and t +1 The state of the autonomous underwater robot at the moment, is the state set of the autonomous underwater robot, is the set of dangerous states of the autonomous underwater robot, is the set of unsafe actions for autonomous underwater robots, It is t The actions of the autonomous underwater robot at all times, is the action set of the autonomous underwater robot.
[0119] S52: When the autonomous underwater robot performs a dangerous action in a certain state, the safety detector can calculate other critical positions around the specific obstacle corresponding to the critical state, and use this to predict more unsafe actions. t The predicted surrounding states around a specific obstacle and the dangerous actions corresponding to each state can be expressed as:
[0120] ; (9)
[0121] in, Dangerous state set A specific dangerous state in , Represents the predicted dangerous state and the predicted dangerous action corresponding to the state, Indicates that according to the dangerous state The set of predicted dangerous states, Represents the set of dangerous actions predicted based on the predicted dangerous state.
[0122] S53: Add the predicted dangerous states and dangerous actions to the training set, train the reinforcement learning, and enable the autonomous underwater robot to make safer decisions based on the training results to avoid collisions and other incidents. All safety information is obtained during the training process rather than known a priori. The safety assurance module gradually expands its understanding of safety regulations in the environment by continuously adding pairs of predicted dangerous states and dangerous actions data sets.
[0123] S54: After the training in step S53, the autonomous underwater robot adopts Select a strategy and choose different actions according to different probabilities. When the probability is , the action and state selection strategies are:
[0124] ; (10)
[0125] When the probability is When , the action and state strategy selection of the autonomous underwater robot is:
[0126] (11)
[0127] in, Indicates that the status is , action is The optimal action strategy in the case of The status is , action is In this case, the cumulative reward value of all actions is is the cumulative reward value of all actions except unsafe actions, To explore the probability, Indicates the probability of utilization.
[0128] S55: According to the action and state of the autonomous underwater robot selected by the strategy of step S54, the trajectory tracking of the pipeline and cable by the autonomous underwater robot is expressed as finding the maximum action cost function under the safety constraint based on the safety checker, as shown in formulas (12) and (13):
[0129] ; (12)
[0130] At the same time, the safety constraints are met:
[0131] ; (13)
[0132] in, Indicates the action decision The rewards that can be accumulated in the case of represents the discount factor of the reward, Indicates in status Take Action The reward value that can be obtained after Indicates decision making in action The mathematical expectation of the case is Indicates time.
[0133] S56: Finally, after the autonomous underwater robot completes an action, the maximum action cost function is updated using the Bellman equation, which is expressed as:
[0134] ; (14)
[0135] in, Indicates the status is , action is In this case, the cumulative reward value of all actions is represents the learning efficiency of reinforcement learning, Status is , action is Rewards received under the circumstances.
[0136] S57: The autonomous underwater robot makes new motion decisions based on the maximized action cost function and its update.
[0137] In the embodiment, when unsafe events such as collisions are unavoidable, safety reinforcement learning needs to put the unsafe events into the training set for retraining. In order to improve the efficiency of training, the present invention proposes a state recovery mechanism, which enables reinforcement learning to start learning in a state close to safety, thereby reducing training time. The specific scheme is as follows:
[0138] Step a) When the pipeline and cable tracking inspection begins, the motion strategy of the autonomous underwater robot and the state caused by the motion strategy are sampled and recorded, as shown in formula (15):
[0139] ; (15)
[0140] in, represents a sequence of safe states and motion strategies, , , Indicates the first moment, the second moment, the t Security status at all times, , , Indicates the first moment, the second moment, the t Moment-by-moment movement strategy;
[0141] Step b) assigns a credibility factor to each sampled safety state. The credibility factor takes into account the time interval, correlation and safety coefficients between the current state and the previous state. And design a weight for each factor based on the actual influence. The credibility factor of each sampled state is the sum of the product of each factor and the weight, as shown in formula (16). The characteristic of the time coefficient is that the time coefficient of the state with a long time interval with the current state is small; the time coefficient of the safe state with a short time interval with the current state is large. The expression of the time coefficient is shown in formula (17). The characteristic of the correlation is that the closer the distance to the unsafe state, the larger the distance coefficient, and the farther the distance to the unsafe state, the smaller the distance coefficient. The expression of the correlation coefficient is shown in formula (18). The safety factor represents the safety of the state. If the state is a safe state, the safety factor is 1; if the state is an unsafe state, the safety factor is 0; and the closer the distance between the state and the unsafe state, the smaller the safety factor. The expression of the safety factor is shown in formula (19). The sequence of credibility factors and corresponding states is shown in formula (20):
[0142] ; (16)
[0143] ; (17)
[0144] ; (18)
[0145] ; (19)
[0146] ; (20)
[0147] in, , , Indicates the first moment, the second moment, the t The credibility factor corresponding to the security status at the moment, represents the time coefficient, Indicates safe status and The correlation coefficient of represents the safety factor, Indicates the weight of time, correlation coefficient and safety coefficient in the credibility factor, represents the sequence of credibility factors and corresponding states, , , Indicates the first moment, the second moment, the t Security status at all times, Represents the time interval between two safe states, Indicates safe status and The covariance of , Indicates safe status and The autocorrelation of , is a constant, Indicates the safety value of the adjacent safety state.
[0148] Step c) When an unavoidable safety event occurs, such as a collision, the state recovery mechanism selects the safety state corresponding to the largest credibility factor from the assigned safety states as the starting state for retraining and return, as shown in formula (21):
[0149] (twenty one)
[0150] in, Indicates the starting state returned by the safety reinforcement learning retraining after an unsafe incident occurs. Indicates the safety status corresponding to the credibility factor with the largest value.
[0151] Step d) Safety reinforcement learning returns to the last safe state, adds the unsafe events to the training set, and restarts the training.
[0152] It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above and that the invention can be implemented in other specific forms without departing from the spirit or essential features of the invention. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description, and it is intended that all variations falling within the meaning and scope of the equivalent elements of the claims be included in the invention. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.
[0153] In addition, it should be understood that although the present specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.
Claims
1. An autonomous underwater robot trajectory tracking control method based on semantic reinforcement learning, characterized in that: include: S1: Autonomous underwater robots obtain marine environment image information through visual sensors; S2: Based on the image information of the ocean environment, a reinforcement learning-based trajectory tracking controller is used for reinforcement learning training to obtain the optimal motion decision; S3: Use the semantic understander to extract marine environment feature points and understand the semantics of the marine environment image information to obtain the marine environment semantics; S4: Use the safety checker to determine whether the motion decision of the autonomous underwater vehicle is safe based on the optimal motion decision, ocean environment semantics, and historical unsafe event information. If it is safe, the autonomous underwater vehicle executes the motion decision and returns to S1, otherwise execute S5; S5: For unsafe actions, the autonomous underwater robot uses reinforcement learning to make new motion decisions under safety constraints, and then executes the safety judgment of S4. If it is still unsafe, it means that the autonomous underwater robot cannot avoid collision, then the current unsafe event is stored in the safety checker and retrained based on the state recovery mechanism; In S5, for unsafe actions, the autonomous underwater robot uses reinforcement learning to make new motion decisions under safety constraints, including: S51: Define a critical state set and an unsafe action set, as shown in formulas (7) and (8): Among them, S crisis represents the critical state set of the autonomous underwater robot, s t 、s t+1 is the state of the autonomous underwater robot at time t and time t+1, S is the state set of the autonomous underwater robot, S risk is the dangerous state set of the autonomous underwater robot, M risk is the set of unsafe actions of the autonomous underwater robot, m t is the action of the autonomous underwater robot at time t, M is the action set of the autonomous underwater robot; S52: Based on the critical state set and the unsafe action set, the dangerous state around the obstacle and the dangerous action corresponding to each state are predicted as follows: Among them, s risk is the dangerous state set S risk A specific dangerous state in avoid , m preject represents the predicted dangerous state and the predicted dangerous action corresponding to the state, S avoid Indicates that according to the dangerous state s risk The predicted dangerous state set, M preject represents the set of dangerous actions predicted based on the predicted dangerous state; S53: adding the predicted dangerous state and dangerous action to the training set to train the reinforcement learning; S54: After the training in step S53, the autonomous underwater robot adopts the ε-greedy selection strategy to select different actions according to different probabilities. When the probability is 1-ε, the action and state selection strategy is: When the probability is ε, the action and state strategy selection of the autonomous underwater robot is: Among them, θ(m t |s t ) means that in state s t 、Action is m t The optimal action strategy in the case, Q(s t ,m t ) is the state s t 、Action is m t In this case, the cumulative reward value of all actions, Q'(s t ,a t ) is the cumulative reward value of all actions except unsafe actions, ε is the exploration probability, and 1-ε represents the utilization probability; S55: the action and state of the autonomous underwater robot selected according to the strategy of step S54 is such that the trajectory tracking of the pipeline and the cable by the autonomous underwater robot is expressed as finding a maximized action cost function under the safety constraints based on the safety checker; S56: After the autonomous underwater robot completes an action, the maximum action cost function is updated; S57: The autonomous underwater robot makes new motion decisions based on the maximized action cost function and its update.
2. The trajectory tracking control method of an autonomous underwater robot based on semantic reinforcement learning according to claim 1 is characterized in that: The S3 uses a semantic understander to extract marine environment feature points and perform semantic understanding on the marine environment image information to obtain marine environment semantics, including: S31: inputting the ocean environment image information into a semantic encoder, and the semantic encoder inputting the ocean environment image information into a semantic segmentation network to obtain a pixel-level semantic image; S32: The semantic encoder performs optical flow tracking on the marine environment image information, distinguishes the feature points of static pipelines, cables and dynamic obstacles by comparing the difference between the current image and the previous image, and removes the feature points of dynamic obstacles to obtain an image without the feature points of dynamic obstacles; S33: fusing semantic information of the image with dynamic obstacle feature points removed and the pixel-level semantic image; S34: setting a uniform distribution mask of feature points in the fused semantic information according to the minimum distance of the feature points, thereby separating the static semantic coding information of the pipeline and cable to be tracked, and realizing the separation of the static tracking object from the fused semantic information; S35: setting a region of interest, that is, a region of dynamic obstacles, in the fused semantic information from which the static tracking object is separated; S36: re-extracting feature points in the area of interest to obtain semantic coding information of dynamic obstacles. S37: Input the semantic coding information into the semantic decoder to obtain the ocean environment semantic information.
3. The trajectory tracking control method of an autonomous underwater robot based on semantic reinforcement learning according to claim 2 is characterized in that: The semantic decoder adopts LSTM decoder.
4. The trajectory tracking control method of an autonomous underwater robot based on semantic reinforcement learning according to claim 1 is characterized in that: The maximization action cost function described in S55 is: At the same time, the safety constraints are met: Among them, Q θ (s,m) represents the reward that can be accumulated when the action decision is θ, γ represents the discount factor of the reward, g represents the reward value that can be obtained after taking action m in state s, and E θ represents the mathematical expectation under action decision θ, and k represents the moment.
5. The trajectory tracking control method of an autonomous underwater robot based on semantic reinforcement learning according to claim 4 is characterized in that: The S56 updates the maximum action cost function, which is expressed as: Among them, Q t+1 (s t+1 ,m t+1 ) indicates the state is s t+1 、Action is m t+1 The cumulative reward value of all actions in this case, Q t (s t ,m t ) indicates the state is s t 、Action is m t The cumulative reward value of all actions in this case, α represents the learning efficiency of reinforcement learning, and r t Status is s t 、Action is m t Rewards received under the circumstances.
6. The trajectory tracking control method of an autonomous underwater robot based on semantic reinforcement learning according to claim 1 is characterized in that: The S5 stores the current unsafe event in the safety checker and retrains based on the state recovery mechanism, including: Step a) sampling and recording the motion strategy of the autonomous underwater robot for pipeline and cable tracking inspection and the safety state caused by the motion strategy, as shown in formula (15): T={s safe1 ,m1,s safe2 ,m2,...,s safet ,m t } (15) Where T represents the sequence of safety states and motion strategies, s safe1 ,s safe2 ,s safet Indicates the safety status at the first moment, the second moment, and the tth moment, m1, m2, m t represents the movement strategy at the first moment, the second moment, and the tth moment; Step b) assigning a credibility factor taking into account a time coefficient, a safety state correlation coefficient, and a safety coefficient to each sampled safety state; Step c) when an unavoidable security incident occurs, the state recovery mechanism selects the security state corresponding to the maximum credibility factor from the assigned security states as the starting state for retraining and returning; Step d) Safety reinforcement learning returns to the last safe state, adds the unsafe events that trigger it to the training set, and restarts the training.
7. The trajectory tracking control method of an autonomous underwater robot based on semantic reinforcement learning according to claim 6 is characterized in that: The credibility factor is: The sequence of credibility factors and corresponding states is shown in formula (20); R={s safe1 ,λ1,s safe2 ,λ2,...,s safet ,l t } (20) Among them, λ1, λ2, λ t represents the credibility factor corresponding to the safety status at the first moment, the second moment, and the tth moment, ζ i represents the time coefficient, ψ ij Indicates safe status safei and safej The correlation coefficient of represents the safety factor, a, b, c represent the weight of time, correlation coefficient and safety factor in the credibility factor, R represents the sequence of credibility factor and corresponding state, s safe1 ,s safe2 ,s safet represents the safety status at the first moment, the second moment, and the tth moment, t * Indicates the time interval between two safe states, COV(s safei ,s safej ) indicates safe state s safei and safej The covariance of safei ), D(s safej ) indicates safe state s safei and safej The autocorrelation of A and B is constant. Indicates the safety value of the adjacent safety state.
8. The trajectory tracking control method of an autonomous underwater robot based on semantic reinforcement learning according to claim 7 is characterized in that: Step c) When an unavoidable security incident occurs, the state recovery mechanism selects the security state corresponding to the maximum credibility factor from the assigned security state as the starting state for retraining and return, as shown in formula (21): Among them, s back represents the starting state returned by the safety reinforcement learning retraining after an unsafe event occurs, s safei Indicates the safety status corresponding to the credibility factor with the largest value.
