Intelligent ship navigation path generation method based on navigation mark vision and spatial semantic enhancement
Through the intelligent ship navigation method based on navigation mark visual and spatial semantic enhancement, the navigation mark is identified and the navigation path is optimized, which solves the navigation problem under signal interference and complex sea conditions, and improves the safety and navigation performance of the ship.
Patent Information
- Application Number
- CN202410850996.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2044-06-28
AI Technical Summary
Existing ship navigation systems are unable to accurately locate the ship's position under signal interference or complex sea conditions, and lack in-depth understanding and prediction capabilities of the surrounding environment, which limits navigation performance.
A smart ship navigation path generation method based on beacon visual and spatial semantic enhancement is adopted to identify beacons through deep neural networks, combine the semantic information of beacons, determine the ship's position, exclude dangerous areas, assess collision risks, and optimize navigation paths based on historical arrival frequencies.
It achieves accurate positioning and safe navigation under signal interference or complex sea conditions, improves navigation safety and navigation performance, and can better understand the surrounding environment and make reasonable decisions.
Smart Images

Figure CN118392192B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of ship navigation and space semantic enhancement, and in particular to a method for generating a navigation path for an intelligent ship based on navigation mark vision and space semantic enhancement. Background Art
[0002] Ship navigation technology uses advanced technology and equipment to guide ships to navigate safely in vast waters such as oceans, rivers, and lakes. The core mission of this technology is to help ships avoid obstacles, other ships, and potential dangerous areas, ensure that they can move smoothly along the planned route, and accurately locate the ship's position when necessary. It is crucial to ensure navigation safety and improve navigation efficiency.
[0003] At present, most ship navigation systems rely on absolute position systems to provide accurate navigation coordinates. Absolute position systems are usually based on satellite navigation technologies such as the Global Positioning System (GPS), which can provide continuous, real-time three-dimensional position and speed information on a global scale. However, this system that relies on satellite signals has certain limitations. For example, when the signal is interfered with, blocked or the system fails, it may not be able to obtain accurate ship position information, which undoubtedly poses a risk to navigation safety. In addition, traditional navigation systems often lack in-depth understanding and prediction capabilities of the surrounding environment, which limits their navigation performance in complex sea conditions.
[0004] With the development of intelligent ship technology, modern ships have begun to use visual perception devices to assist navigation. These devices can identify navigation marks from continuously collected images and use these navigation marks to infer the relative position of the ship, thus compensating for the inaccuracy of traditional AIS system positioning to a certain extent. However, current visual perception devices mainly recognize the shape and position of navigation marks, but lack the recognition and utilization of the semantic information contained in the navigation marks, which limits their application in automatically generating ship navigation paths. Summary of the invention
[0005] The present invention proposes a method for generating a navigation path for an intelligent ship based on navigation mark vision and spatial semantic enhancement, which solves the problem that the prior art cannot accurately locate the position of the ship when the signal is interfered.
[0006] In order to solve the above technical problems, the present invention provides a method for generating a navigation path for an intelligent ship based on navigation mark vision and spatial semantic enhancement, comprising the following steps:
[0007] Step S1: collecting real-time images of the ship during navigation, inputting the real-time images into a deep neural network, identifying navigation marks around the ship, and determining the current position of the ship according to the position of the navigation mark and the relative position of the ship and the navigation mark;
[0008] Step S2: According to the semantic information of the navigation mark, the dangerous area, the prohibited navigation area and the operation area around the ship are excluded to obtain the navigable area of the ship;
[0009] Step S3: Determine whether there is an encountering ship in the navigable area. If there is an encountering ship, obtain the relative speed, relative heading and relative distance between the ship and the encountering ship according to the real-time image, evaluate the collision risk of the ship, obtain the high-risk area for ship collision, and delete the part overlapping with the high-risk area from the navigable area; otherwise, directly execute step S4;
[0010] Step S4: Based on the historical arrival frequency of the ship, probability values are assigned to the position points in the navigable area that meet the requirements of the ship's navigation direction, and the position point with the highest probability is selected as the next position point of the ship;
[0011] Step S5: Repeat steps S1 to S4 to correct the navigation path of the ship in real time.
[0012] Preferably, the relative position between the ship and the navigation mark includes a relative azimuth, a relative pitch angle and a relative distance, and the expression for calculating the relative azimuth is:
[0013] ;
[0014] In the formula, is the angle between the shooting point of the real-time image and the horizontal line; yes The coordinate values of the axis, The axis is parallel to the width axis of the live image; for The sum of pixels in the axis direction;
[0015] The expression for calculating the relative pitch angle is:
[0016] ;
[0017] In the formula, is the angle between the shooting point of the real-time image and the vertical line; yes The coordinate values of the axis, The axis is parallel to the height axis of the live image; for The sum of pixels in the axis direction;
[0018] The expression for calculating the relative distance is:
[0019] ;
[0020] Where R is the radius of the earth, and Represents the real-time images collected continuously p 1 and p 2; rad() means converting degrees into radians.
[0021] Preferably, the step S3 of determining whether there is a ship to be encountered in the navigable area comprises the following steps: calculating the ship Other ships appearing in the live image The relative angle between and relative distance D , combined with the navigation speed of the ship, the relative speed of the ship and other ships is obtained, thereby obtaining the navigation speed of other ships;
[0022] The expression for calculating the relative angle between the ship and other ships is:
[0023] ;
[0024] In the formula, is the position coordinates of other ships; is the position coordinate of own ship;
[0025] The expression for calculating the relative distance between the ship and other ships is:
[0026] ;
[0027] Where R is the radius of the earth; rad() means converting degrees into radians;
[0028] If the relative distance is less than the set relative distance threshold, and or , then the encounter situation of the two ships is a crossing encounter; if the relative distance is less than the set relative distance threshold, and , and the navigation speed of the other ship is greater than the navigation speed of the ship, the encounter situation of the two ships is an overtaking encounter; if the relative distance is less than the set relative distance threshold, and or , then the encounter situation of the two ships is a head-on encounter; when the two ships are in an encounter situation, there is a risk of collision between the ships.
[0029] Preferably, step S3 constructs an image set by continuously acquiring real-time images, determines the relative heading and relative distance between the surrounding ships and the current ship according to the image set, and obtains the relative speed between the surrounding ships and the current ship in combination with the navigation speed of the current ship.
[0030] Preferably, the expression for calculating the collision risk in step S3 is:
[0031] ;
[0032] In the formula, , , Respectively represent the relative distance, relative speed and relative heading between the ship and surrounding ships; , , is a constant.
[0033] Preferably, obtaining the position point satisfying the navigation orientation of the ship in step S4 comprises the following steps:
[0034] Step S41: Calculate the current position of the ship and the said beacon The first angle between :
[0035] ;
[0036] Step S42: Randomly select a location point in the remaining area , calculate the second angle between the position point and the navigation mark :
[0037] ;
[0038] Step S43: taking the position point where the first angle is smaller than the second angle as the position point that satisfies the navigation direction of the ship.
[0039] Preferably, when the visibility of the ship during navigation is lower than a set visibility threshold, defogging and restoring the real-time image comprises the following steps:
[0040] Step S11: Calculate the variogram value of all pixels in the real-time image, take the pixels whose variogram value is less than the set variogram threshold as the bright part of the real-time image, and the remaining pixels as the dark part, calculate the transmittance of the bright part and the dark part respectively, and obtain the fused transmittance of the real-time image; the expression of the variogram value is:
[0041] ;
[0042] ;
[0043] In the formula, Represents pixel Pixel value at any channel; , , Represents pixel points Pixel values in the three channels r, g, and b; Represents pixel The average value of three channels in RGB color space; is the comparison coefficient;
[0044] Step S12: filtering the fused transmittance by a weighted guided filtering algorithm to obtain a refined transmittance of a real-time image; the expression of the refined transmittance is:
[0045] ;
[0046] ;
[0047] ;
[0048] ;
[0049] In the formula, is the guide image, i.e., the grayscale image of the real-time image; t To refine the transmittance; For local window The number of pixels within; For the i output pixels; , Local windows The mean and variance within ; is the mean value of the pixels in the window; is the penalty factor to prevent Too large; is the total number of pixels in the image; Indicates i The variance of the entire image centered at ; Indicates i The local window at the center Variance within is a fixed constant;
[0050] Step S13: Divide the real-time image into four regions on average, calculate the difference between the pixel mean and the standard deviation of each region as the region score, select the region with the highest regional score as the first candidate region, repeat the above operation until the number of pixels in the second candidate region is less than the set pixel threshold, and take the average pixel value in the second candidate region as the atmospheric light value;
[0051] Step S14: Substitute the refined transmittance and the atmospheric light value into an atmospheric scattering model to obtain a defogging image. The expression of the atmospheric scattering model is:
[0052] ;
[0053] In the formula, I(x)For real-time images; A is the atmospheric light value; To refine the transmittance; is the set transmittance threshold; max[] means taking the larger value of the two.
[0054] Preferably, the method for obtaining the variogram threshold in step S11 comprises the following steps:
[0055] The real-time image with visibility higher than the set visibility threshold is regarded as an image with better visibility, and the variance function of the real-time image with better visibility is calculated. , obtain real-time images collected continuously p1 and p2 , respectively calculate p1 and p2 The relative distance between the center point and the current ship RD p1 and RD p2 , when exactly one-half or three-quarters of the pixel values in the real-time image meet the value greater than , at this time As the critical value, the threshold △ is defined, p1 and p2 The relative distance between the center point and the current ship RD p1 and RD p2 The expression is:
[0056] ;
[0057] In the formula, α and β For current ships and p1 and p2 The relative orientation angle between the center points of γ yes p1 and p2 The relative angle between .
[0058] Preferably, an image enhancement operation is performed on the real-time image to expand the training set of the neural network; the image enhancement operation includes random cropping, random flipping, random color adjustment, random noise addition and random blurring;
[0059] The random cropping performs arbitrary cropping of the real-time image to change the size and content of the real-time image;
[0060] The random flipping randomly flips the real-time image up and down or left and right;
[0061] The random color adjustment randomly adjusts the contrast, brightness, saturation and retrograde of the real-time image;
[0062] The random noise addition randomly adds noise to the real-time image;
[0063] The random blurring uses Gaussian blurring or a median filter to randomly blur the real-time image.
[0064] Preferably, a loss function is set to evaluate the accuracy of the prediction of the deep neural network, and the expression of the loss function is:
[0065] ;
[0066] ;
[0067] ;
[0068] In the formula, is the suppression parameter; A and B are any two bounding boxes; , Represent the center points of the predicted box and the true box respectively; is the Euclidean distance between the center points of the predicted box and the true box; is the length of the diagonal of the bounding box; , are the width and height of the minimum bounding rectangle of the predicted box and the true box, respectively.
[0069] The benefits of the present invention include at least:
[0070] 1. By collecting real-time images of the ship sailing, identifying the navigation marks around the ship from the images, and calculating the exact position of the ship based on the relative position relationship between the navigation marks and the ship, the problem of inaccurate positioning of the traditional AIS system when the signal is interfered is avoided;
[0071] 2. Integrate the semantic information of navigation marks into the ship navigation system to help ships avoid potential dangers such as reefs and shoals, thereby improving the safety of navigation; and in complex sea conditions or low visibility, semantic information can help the navigation system better understand the surrounding environment and make more reasonable navigation decisions. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] Figure 1 is a flow chart of a method according to an embodiment of the present invention;
[0073] Figure 2 The figure is a schematic diagram of the navigation marks of the port selected in the embodiment of the present invention. DETAILED DESCRIPTION
[0074] The following is a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work belong to the protection scope of the present invention.
[0075] like Figure 1 As shown, an embodiment of the present invention provides a method for generating a navigation path for an intelligent ship based on navigation mark vision and spatial semantic enhancement, comprising the following steps:
[0076] Step S1: Annotate the positions and functional semantics of navigation marks in the real port scene map to obtain a training set.
[0077] The embodiment of the present invention selects a certain port as the scene of this study, makes a specific analysis of the real picture of the port, grasps the specific positions and functions of all navigation marks distributed in the port sea area, and clearly grasps the distribution of navigation marks in the port.
[0078] After having a clear understanding of the functions and distribution of the port's navigation marks, we began to mark the locations and functional semantics of the navigation marks. Figure 2 The positions and names of the aids to navigation in the port navigation area are obtained based on the mining of public websites. Further, the functional semantic information can be given to the aids to navigation according to the "Regulations on the Surface Color of Visual Aids to Navigation", "Water Aids to Navigation in China's Sea Areas", "Guidelines for the Distribution of Floating Aids to Navigation in Sea Areas", "Regulations on the Shape Display of Water Aids to Navigation in China's Sea Areas" and other rules.
[0079] Obtain the real-life image data of the port and mark the location of the navigation mark. Since navigation marks have various types, such as azimuth marks, dangerous goods marks, safe waters marks, prohibited waters, navigation operation areas, underwater structures, entertainment areas, and aquatic operation areas, when annotating images, not only the location of the navigation mark is marked, but also the type of the navigation mark is marked to facilitate the subsequent identification of different types of marks. After completing the marking of all images, export the navigation mark labels. Classify the data set, divide the image data and label data set of the custom test into: training set, verification set, and test set, respectively, put the pictures and labels in their respective folders, and the labels and pictures need to correspond one to one. Then start configuring the training file. After the training file is configured, you can start training.
[0080] The embodiment of the present invention adopts an improved image target detection YOLO algorithm to identify navigation marks in images. By performing data enhancement, changing the network structure, adding an attention module, and optimizing the loss function on the original YOLO algorithm, the YOLO algorithm is integrated into a comprehensive network, thereby realizing image recognition of navigation marks encountered during ship navigation.
[0081] Specifically, considering that the size of the navigation mark image captured when the ship is in different positions and the clarity of the images taken by different cameras are different, image enhancement is performed on the images in the training set, mainly including data enhancement through pixel-level affine transformation through cropping, shearing, random rotation and flipping, and color tone adjustment.
[0082] Random cropping: In the original input image, perform some arbitrary cropping operations to change the size and content of the image and use it as a new input; Random flipping: randomly flip the input image left and right or up and down; Random color adjustment: randomly adjust the contrast, brightness, and saturation of the input image; Random noise: randomly add noise to the input image; Random blur: randomly blur the input image with Gaussian blur or median filter. Through these methods, the data set can be expanded during training, making the model run more robustly.
[0083] In addition, it may happen that multiple navigation images are collected in the image of the same location, so the training set needs to be enhanced at the image level. Four pictures in the training set are randomly selected and spliced. Random processing is performed during splicing, so the sizes and shapes of different pictures are different. The spliced pictures are connected to the network for training, so that the picture background becomes richer. This splicing operation increases the batch_size of the number of pictures input for training each time, enhancing the universality and robustness of the network. In addition, the width and height ratios of the entire data set can be sorted, and four pictures of similar ratios can be combined in turn, which can reduce Flops operations and speed up data processing.
[0084] The original YOLO algorithm is subjected to channel compression and convolutional block fusion. In the channel compression stage, the number of output channels of the convolutional layer is adaptively adjusted to achieve the compression effect, reducing the number of parameters and the amount of calculation. In the convolutional block fusion stage, convolutional blocks with similar features are combined to form larger convolutional blocks, and the performance of the model is improved by reducing irrelevant information.
[0085] The existing YOLO algorithm measures the accuracy of prediction based on the ratio of the intersection and union of the detection box and the ground truth box. However, when the ground truth box and the detection box do not overlap at all, the evaluation value is always zero, which cannot correctly reflect the closeness of the two bounding boxes. When the intersection of the detection box and the ground truth box is completely different, object detection may also have certain errors, but the intersection and union ratio is the same, which is easy to cause misjudgment and misdetection. Therefore, a global intersection and union ratio loss is proposed, which adds a measurement standard for intersection, and is defined as follows:
[0086] ;
[0087] ;
[0088] Where A and B are any two bounding boxes; C is the smallest box that encloses A and B at the same time; when A and B are far apart, the numerator of the intersection-over-union loss function is closer to C, the larger the whole formula is, and the worse the classification effect is. When A and B are closer, the latter term is zero, the loss is less, and the function fit is good.
[0089] Furthermore, a normalized distance is introduced to optimize the loss by measuring the distance between the geometric center of the largest bounding box C and the corresponding bounding boxes A and B, which is called the distance intersection loss. The distance, overlap rate and scale of the target and the anchor box are taken into account to make the target box regression more stable.
[0090] ;
[0091] in, , Represent the center points of the predicted box and the true box respectively; Represents the Euclidean distance between these two center points; Represents the length of the diagonal of the largest box.
[0092] Considering the three important geometric factors of overlapping area, center point distance and aspect ratio, a complete intersection-over-union loss calculation method is proposed:
[0093] ;
[0094] ;
[0095] ;
[0096] In the above formula, is the weight function; , are the width and height of the real frame respectively; , are the width and height of the prediction box respectively.
[0097] Also consider The gradient is:
[0098] ;
[0099] ;
[0100] When the length and width of the gradient are [0,1], The value of is usually very small, which may cause gradient explosion during calculation, so in implementation Replace with 1.
[0101] Although the overlapping area, center point distance, and aspect ratio are all considered in bounding box regression, v It only reflects the aspect ratio of the box, and is not connected with the corresponding confidence level. Therefore, the above aspect ratio is disassembled and a more effective intersection-union ratio loss function is proposed:
[0102] ;
[0103] in, , are the width and height of the minimum bounding rectangle of the predicted box and the true box, respectively.
[0104] The difference in width and height between the target box and the real box is directly minimized, and the loss of the aspect ratio of the original box is changed, so that the predicted length and width are subtracted from the length and width of the maximum box respectively, so that the algorithm converges faster, the positioning result is better, and the regression accuracy is higher.
[0105] Since the sample imbalance phenomenon will occur in the regression process of the box, Focal Loss is added to solve this problem. Based on EIOU, Focal Loss is added to reduce the contribution of the boxes with poor effects to the results, so that the model can make more use of high-quality bounding boxes. The penalty term formula is as follows:
[0106] ;
[0107] in, It is a parameter that controls the degree of outlier suppression. Generally, the selection range is between 0.3 and 0.5.
[0108] in IOU The larger the value of , the greater the cumulative loss effect. At the same time, the loss of the high-quality bounding box is reduced more, which has a greater impact on the final regression effect. The smaller the loss function value, the more accurate the prediction.
[0109] At the same time, add the attention mechanism to the existing YOLO algorithm:
[0110] Compression operation: The convolution operation of the original algorithm is only performed locally, and the resulting feature map can only represent the relevant information of the previous layer and does not have global characteristics. In order to improve the direct correlation between related channels and avoid the loss of some features caused by separate convolution, the two-dimensional information of the original feature map is compressed and added to the global field of view. The output dimension is 1×1×C, that is, global average pooling, where C represents the number of channels in the image. Extract the features of each channel to obtain the corresponding importance coefficient:
[0111] ;
[0112] in For images Channel at location q The corresponding input feature map; For compressed images Channel at location q The characteristic value of , . represent the height and width of the image respectively.
[0113] After obtaining the 1×1×C global features through the compression operation, the feature maps on each channel are weighted, that is, a weight vector is obtained through a fully connected layer that learns the importance coefficient, and then the vector is applied to the feature maps corresponding to each channel. There are two fully connected layers designed. The first fully connected layer is for dimensionality reduction to facilitate subsequent processing, and the second fully connected layer is to prevent overfitting and improve generalization ability.
[0114] The weight vector is multiplied with the original feature vector W×H×C respectively to obtain the attention-enhanced marking result, thereby realizing the feature recalibration operation of the original feature map.
[0115] Step S2: Collect real-time images of the ship during navigation, input the real-time images into the deep neural network, identify the navigation marks around the ship, and determine the current position of the ship based on the position of the identified navigation marks and the relative position of the ship and the navigation marks.
[0116] Specifically, when the visibility in a port or maritime navigation environment is low, the image texture collected by the ship's imaging equipment will be blurred and the contrast will be lost, which will seriously affect the stability of the visual system of the water beacon, resulting in the inability to accurately obtain the location information of the beacon, making it impossible for the ship to accurately locate and thus unable to plan its path. Therefore, the image values of the same-name points in the image with good visibility are used as the guiding values, the images in the case of poor visibility are filtered, and the atmospheric light values are estimated, and then the transmittance is solved, and finally the defogging and restoration of the blurred image is achieved.
[0117] For navigation images with poor visibility, the transmittance is first estimated based on the variogram. The image is divided into bright and dark parts through the variogram, and then the transmittance of the two parts is calculated using the dark channel prior and the brightness model, and finally fused into a new transmittance. A variogram is defined to obtain the highlight area of the image. The formula is as follows:
[0118] ;
[0119] ;
[0120] In the formula, Represents pixel Pixel value at any channel; , , Represents pixel points Pixel values in the three channels r, g, and b; Represents pixel The average value of three channels in RGB color space; is the comparison coefficient.
[0121] According to the variation function, a threshold △ is designed to determine whether the pixel of the image is located in the bright or dark area. <△, the pixel is considered to belong to the bright part of the image; When ≥△, the pixel is considered to belong to the dark part of the image. The transmittance of the dark and bright parts of the image is calculated separately to obtain the fused transmittance of the variogram.
[0122] In order to define the threshold more accurately, the variogram is also calculated for the navigation mark image with better visibility. When half or three quarters of the pixels in the navigation mark image with poor visibility meet the value greater than , at this time The threshold △ is defined as the critical value, where and Continuously collected real-time images p1 and p2 The relative distance to the current ship.
[0123] The optimal threshold setting can be further demonstrated through experiments in the future.
[0124] Transmittance refinement can refine the details of the transmittance map and improve the quality of image restoration in poor visibility conditions. Therefore, the guided filtering algorithm is further used to convert the poor visibility image into a grayscale image as a guided map, and the rough transmittance is refined, which can effectively eliminate the blocky pixels in the rough transmittance and maintain good gradient information in the edge area of the image. In this way, the image edge is maintained and the noise is smoothed and reduced. The edge weight factor expression is defined as follows:
[0125] ;
[0126] In the formula, represents the edge weight factor; N represents the total number of pixels in the input image; Indicates i The variance of the entire image centered at ; Indicates i The local window at the center Variance within L; γ is a fixed constant, generally (0.001×L) 2 , L represents the grayscale range of the image. For an image with an 8-bit pixel range, L=256.
[0127] Weighted guided filtering uses local variance to adaptively adjust the regularization coefficient, which can improve the filtering effect. Therefore, the edge weight factor is introduced to construct the cost function of weighted filtering:
[0128] ;
[0129] ;
[0130] ;
[0131] ;
[0132] In the above formula, Represents a local rectangular window; , For windows The center is located at k The invariant coefficient when ; For the i output pixels; , Local windows The mean and variance within ; is the mean value of the pixels in the window; For local window The number of pixels within; is the guide image, i.e., the grayscale image of the real-time image; is the penalty factor to prevent Too large, generally take a fixed value greater than 0, then It is smaller in the edge area of the image and larger in the flat area of the image. It is larger in the edge area of the image and smaller in the flat area of the image, meeting the requirements of each area of the image.
[0133] The final expression of weighted guided filtering is as follows:
[0134] ;
[0135] in For the output image.
[0136] Refining the coarse transmittance by guided filtering and weighted guided filtering can not only solve the block effect of the coarse transmittance map, but also better retain the image detail information, greatly improving the recognition accuracy of the navigation mark.
[0137] The atmospheric light value A is an important parameter in image restoration and dehazing. A search algorithm can be used to divide the navigation mark image into four parts, calculate the difference between the pixel mean and standard deviation of each part as the score, select the area with the highest score as the candidate area, and repeat the above operation until the number of pixels in the candidate area of the selected atmospheric light value is less than 1% of the original image. The average pixel value in the area is taken as the atmospheric light value A.
[0138] Finally, the navigation mark image is restored and defogged. The required weighted guided filter refinement transmittance t(x) and atmospheric light value A are substituted into the atmospheric scattering model to obtain the final restored defogged image J(x), which is:
[0139] ;
[0140] In the formula, I(x) For poor visibility images; A is the atmospheric light value; To refine the transmittance; The lower limit of transmittance is set, which is usually 0.1; max[] means taking the larger value of the two.
[0141] When identifying navigation marks, there may be a situation where the navigation marks are blocked by the surrounding moving ships. For the continuously collected images, real-time detection and prediction of moving objects are performed. The predicted information is x, y, w, h, s, c. Among them, (x, y, w, h) represent the predicted values of the center point of the prediction box and the width and height respectively; s represents the prediction box score, that is, the possibility of a certain category on the prediction box; c represents the predicted category. The lower the prediction score of the target, the greater the possibility of occlusion of the target. After obtaining the predicted value of the candidate box, the threshold judgment is performed on its s. When s>σ, it is determined that the target is not blocked. σ is the empirical value of the experiment, which is obtained through experimental testing and can be set in combination with the above experimental results without occlusion. Otherwise, if the image is determined to be blocked, it is necessary to further confirm the target object from the image closest to it. Therefore, in the implementation process, a certain number of images preceding the current image need to be saved and updated to establish a cache mechanism.
[0142] With the ship as the center, the relationship between the navigation mark and the ship in relative space is deduced, including the relative azimuth angle relationship, relative pitch angle relationship and relative distance.
[0143] The calculation formula for the relative azimuth angle between the beacon and the beacon image shooting point is:
[0144] ;
[0145] In the formula, is the angle between the shooting point of the real-time image and the horizontal line; yes The coordinate values of the axis, The axis is parallel to the width axis of the live image; for The sum of pixels along the axis.
[0146] The relative elevation angle between the beacon and the beacon image shooting point can be obtained by using the equidistant cylindrical plane projection system. v The coordinate values of the axis are calculated:
[0147] ;
[0148] In the formula, is the angle between the shooting point of the real-time image and the vertical line; yes The coordinate values of the axis, The axis is parallel to the height axis of the live image; for The sum of pixels along the axis.
[0149] In order to further obtain the relative distance relationship between the navigation mark object and the current camera position in the continuous images collected by the camera, the center point of the navigation mark can be used as a matching point of the same name, and then the relative distance relationship between it and the camera position can be derived:
[0150] ;
[0151] Where D is the distance between the center points of the two images p1 and p2 containing the same beacon; R is the radius of the earth; and Represents the real-time images collected continuously p 1 and p 2; rad() means converting degrees into radians.
[0152] ;
[0153] in, Rdp1 and Rdp2 Represents the images collected continuously p1 and p2 Relative distance to the current ship; α and β is the relative azimuth angle relationship between the matching beacon position area and the corresponding two beacon images; γ is the relative angle between the two beacon images.
[0154] Step S3: According to the semantic information of the navigation mark, the dangerous area, the prohibited navigation area and the operation area around the ship are excluded to obtain the navigable area of the ship.
[0155] Specifically, based on the semantics of the navigation mark, directional signs, dangerous objects signs, safe waters signs, prohibited waters, navigation operation areas, underwater structures, entertainment areas, aquatic operation areas, etc., the navigable area from the current position of the ship to the next position is obtained, avoiding dangerous areas, prohibited waters, navigation operation areas, underwater structures, entertainment areas, aquatic operation areas, etc., to ensure that the ship navigates in a safe area.
[0156] Step S4: Determine whether there is an encountering ship in the navigable area. If there is an encountering ship, obtain the relative speed, relative distance and relative heading of the ship and the encountering ship based on the real-time image, evaluate the collision risk of the ships, obtain the high-risk area for ship collision, and delete the part overlapping with the high-risk area from the navigable area; otherwise, directly execute step S5.
[0157] Specifically, determine whether there are other ships in the navigable area, and set the position of other ships to , the ship's position is , calculate the relative angle between the two ships:
[0158] ;
[0159] A target image set with moving ships is established, and the relative heading and relative distance of the moving ship in each image from the current ship are determined in turn. The relative distance can be calculated by referring to the relative distance calculation formula in step S2, and then combined with the current navigation speed of the ship, the relative speed of the moving ship and the current ship can be calculated.
[0160] If the relative distance is less than a certain threshold, the threshold is generally set at 3-6 nautical miles, which can be adjusted according to the actual situation of the experimental waters. or , then the encounter situation of the two ships is a crossing encounter; if the relative distance is less than the set threshold, and , and the speed of the other ship is greater than that of the own ship, the encounter situation of the two ships is an overtaking encounter; if the relative distance is less than the set threshold, and or , then the encounter situation of the two ships is a head-on encounter. When the two ships are in an encounter situation, there is a risk of collision between the ships.
[0161] The ship collision risk is calculated based on relative speed, relative heading and relative distance. The calculation formula is:
[0162] ;
[0163] In the formula, , , Respectively represent the relative distance, relative speed and relative heading between the ship and surrounding ships; , , is a constant, which can be obtained based on the safety area of the ship in the experimental waters, or it can be obtained jointly based on the relative motion characteristics of the ship, such as the recognition of the ship encounter scene, when the ship ends the avoidance =0, when the ship has just violated the ship safety area =100 etc. to solve simultaneous equations , , ,The field of ship safety can be solved based on the ship length, ship width, speed and water characteristics.
[0164] After normalizing the collision risk, a risk value greater than 0.33 and less than or equal to 0.67 indicates that timely attention is needed to prevent collision; a risk value greater than 0.67 indicates that immediate avoidance is required; and a risk value less than 0.33 indicates that it is relatively safe. The specific threshold can also be adjusted according to the traffic conditions in the navigation area and the captain's navigation experience. After excluding high-risk areas, a safer feasible area for ships is obtained.
[0165] It is also possible to further combine the port's navigation rules to obtain the ship speed requirements for different channels, such as the regulations that "the maximum speed east of the No. *** light buoy in the main channel shall not exceed 15kn", "the maximum speed west of the No. *** light buoy in the main channel shall not exceed 13kn", "the minimum speed in the main channel shall not be less than 5kn", and another channel "ships of 100,000 tons or more and ships carrying special dangerous goods shall not exceed a maximum speed of 10 knots", "other ships shall not exceed a maximum speed of 13 knots", and "the minimum speed in the channel without permission shall not be less than 5 knots". According to the current location and optional positions It is possible to calculate whether the optional position is on the east or west side of the navigation mark in the channel. Taking "ships with a tonnage of 100,000 tons or more and ships carrying special dangerous goods shall not exceed a maximum speed of 10 knots", "other ships shall not exceed a maximum speed of 13 knots", and "the minimum speed in the channel without permission shall not be less than 5 knots" as examples, the achievable position of the ship at any time point can be calculated according to the following formula:
[0166] ;
[0167] in It indicates the 100,000-ton threshold specified for the waterway; Indicates the maximum speed limit for ships that do not exceed the 100,000-ton threshold and are not hazardous chemicals ships; Indicates the maximum speed limit for ships exceeding the 100,000-ton threshold or hazardous chemicals ships. The tonnage, draft, cargo type, etc. of a ship can be obtained from the ship name database information.
[0168] Step S5: Based on the historical arrival frequency of the ship, probability values are assigned to the position points in the remaining area that meet the requirements of the ship's navigation direction, and the position point with the highest probability is selected as the next position point of the ship.
[0169] Calculate the current position of the ship respectively and navigation marks The angle between and optional positions With navigation aids The angle between :
[0170] ;
[0171] ;
[0172] if Greater than The azimuth restriction of the ship's forward navigation is then met, thereby obtaining a set of optional next position points that are in a safe area and meet the azimuth requirements.
[0173] Step S5: Repeat the above steps to correct the navigation path of the ship in real time.
[0174] To further evaluate the accuracy of the generated navigation path, the AIS trajectories of ships of the same level in history can be combined to obtain the customary routes through clustering, and compared with the navigation path formed by this method, so as to evaluate the feasibility and robustness of the proposed method.
[0175] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. Only the preferred embodiments of the present invention are expressed. The description is more specific and detailed, but it cannot be understood as limiting the scope of the patent of the present invention. As long as there is no contradiction in the combination of these technical features, they should be considered as the scope recorded in this specification.
[0176] It should be noted that, for those skilled in the art, several modifications and improvements can be made without departing from the concept of the present invention, and these modifications and improvements all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
Claims
1. A method for generating a navigation path for an intelligent ship based on navigation mark vision and spatial semantic enhancement, characterized in that: The following steps are involved: Step S1: collecting real-time images of the ship during navigation, inputting the real-time images into a deep neural network, identifying navigation marks around the ship, and determining the current position of the ship according to the position of the navigation mark and the relative position of the ship and the navigation mark; The relative position between the ship and the navigation mark includes the relative azimuth, relative pitch angle and relative distance. The expression for calculating the relative azimuth is: In the formula, Ang azimuth is the relative azimuth between the ship and the navigation mark; μ is the coordinate value of the μ axis, which is parallel to the width axis of the real-time image; pixel μ_sum is the sum of pixels in the μ-axis direction; The expression for calculating the relative pitch angle is: In the formula, Ang elevation is the relative pitch angle between the ship and the navigation mark; ν is the coordinate value of the ν axis, which is parallel to the height axis of the real-time image; pixel ν_sum is the sum of pixels in the ν axis direction; The expression for calculating the relative distance is: Where R is the radius of the Earth; (lat p1 ,lon p1 ) and (lat p2 ,lon p2 ) represent the coordinates of the center points of the continuously acquired real-time images p1 and p2 respectively; rad() represents the conversion of divisions into radians; Step S2: According to the semantic information of the navigation mark, the dangerous area, the prohibited navigation area and the operation area around the ship are excluded to obtain the navigable area of the ship; Step S3: Determine whether there is an encountering ship in the navigable area. If there is an encountering ship, obtain the relative speed, relative heading and relative distance between the ship and the encountering ship according to the real-time image, evaluate the collision risk of the ship, obtain the high-risk area for ship collision, and delete the part overlapping with the high-risk area from the navigable area; otherwise, directly execute step S4; Step S4: Based on the historical arrival frequency of the ship, probability values are assigned to the position points in the navigable area that meet the requirements of the ship's navigation direction, and the position point with the highest probability is selected as the next position point of the ship; Step S5: Repeat steps S1 to S4 to correct the navigation path of the ship in real time.
2. The method for generating a navigation path for an intelligent ship based on navigation mark vision and spatial semantic enhancement according to claim 1, characterized in that: In step S3, judging whether there is a ship to be encountered in the navigable area includes the following steps: calculating the ship (x benchuan ,y benchuan ) and other ships appearing in the real-time image (x tachuan ,y tachuan ) relative angle θ tabenchuan and relative distance D, combined with the navigation speed of the ship, to obtain the relative speed of the ship and other ships, thereby obtaining the navigation speed of other ships; The expression for calculating the relative angle between the ship and other ships is: In the formula, (x tachuan ,y tachuan ) are the position coordinates of other ships; (x benchuan ,y benchuan ) are the position coordinates of own ship; The expression for calculating the relative distance between the ship and other ships is: Where R is the radius of the earth; rad() means converting degrees into radians; If the relative distance is less than the set relative distance threshold, and 6°<θ tabenchuan <112.5°or224.5°<θ tabenchuan <354°, the encounter situation of the two ships is a crossing encounter; if the relative distance is less than the set relative distance threshold, and 112.5°<θ tabenchuan <224.5°, and the navigation speed of the other ship is greater than the navigation speed of the ship, the encounter situation of the two ships is overtaking encounter; if the relative distance is less than the set relative distance threshold, and 0°<θ tabenchuan <6°or 354°<θ tabenchuan <360°, the encounter situation of the two ships is head-on encounter; when the two ships are in an encounter situation, there is a risk of collision between the ships.
3. The method for generating a navigation path for an intelligent ship based on navigation mark vision and spatial semantic enhancement according to claim 1, characterized in that: Step S3 constructs an image set by continuously collecting real-time images, determines the relative heading and relative distance between the surrounding ships and the current ship based on the image set, and obtains the relative speed of the surrounding ships and the current ship in combination with the navigation speed of the current ship.
4. The method for generating a navigation path for an intelligent ship based on navigation mark vision and spatial semantic enhancement according to claim 3 is characterized in that: The expression for calculating the collision risk in step S3 is: Risk(Rd,Rv,Rc)=(l1×Rd -1 ×Rv)(l2sin(Rc)+l3sin(2Rc)); Where Rd, Rv, and Rc represent the relative distance, relative speed, and relative heading between the ship and the surrounding ships, respectively; l1, l2, and l3 are constants.
5. The method for generating a navigation path for an intelligent ship based on navigation mark vision and spatial semantic enhancement according to claim 1, characterized in that: Obtaining the position point that meets the requirements of the ship's navigation direction in step S4 includes the following steps: Step S41: Calculate the current position (x, y) of the ship and the navigation mark (x nm ,y nm ) Step S42: Randomly select a position point (x t ,y t ), calculate the second angle between the position point and the navigation mark Step S43: taking the position point where the first angle is smaller than the second angle as the position point that satisfies the navigation direction of the ship.
6. The method for generating a navigation path for an intelligent ship based on navigation mark vision and spatial semantic enhancement according to claim 1, characterized in that: In step S1, when the visibility of the ship during navigation is lower than the set visibility threshold, defogging and restoration are performed on the real-time image, including the following steps: Step S11: Calculate the variogram value of all pixels in the real-time image, take the pixels whose variogram value is less than the set variogram threshold as the bright part of the real-time image, and the remaining pixels as the dark part, calculate the transmittance of the bright part and the dark part respectively, and obtain the fused transmittance of the real-time image; the expression of the variogram value is: In the formula, I d (x, y) represents the pixel value of the pixel point (x, y) in any channel; I r (x,y),I g (x,y),I b (x, y) represents the pixel value of the pixel point (x, y) in the three channels of r, g, and b respectively; v(x, y) represents the average value of the three channels of the pixel point (x, y) in the RGB color space; λ is the comparison coefficient; Step S12: filtering the fused transmittance by a weighted guided filtering algorithm to obtain a refined transmittance of a real-time image. The expression of the refined transmittance is: In the formula, I i is the guide image, i.e. the grayscale image of the real-time image; t is the refined transmittance; |ω| is the local window ω k The number of pixels within; p i is the i-th output pixel; μ k , σ k 2 They are local windows ω k The mean and variance within ; is the mean value of the pixels in the window; ε is the penalty factor to prevent a k Too large; N is the total number of pixels in the image; represents the variance of the entire image centered on i; represents the local window ω centered at i k The variance within ; γ is a fixed constant; Step S13: Divide the real-time image into four regions on average, calculate the difference between the pixel mean and the pixel standard deviation of each region as the regional score, select the region with the highest regional score as the candidate region, and if the number of pixels in the candidate region is less than the set pixel threshold, output the pixel average value of the candidate region as the atmospheric light value, otherwise, divide the candidate region and perform regional scoring again until the number of pixels in the selected candidate region is less than the set pixel threshold; Step S14: Substitute the refined transmittance and the atmospheric light value into an atmospheric scattering model to obtain a defogging image. The expression of the atmospheric scattering model is: Where J(x) is the restored dehazed image; I(x) is the real-time image; A is the atmospheric light value; t(x) is the refined transmittance; t0 is the set transmittance threshold; max[] means taking the larger value of the two.
7. The method for generating a navigation path for an intelligent ship based on navigation mark vision and spatial semantic enhancement according to claim 6, characterized in that: The method for obtaining the variogram threshold in step S11 includes the following steps: The real-time image with visibility higher than the set visibility threshold is regarded as the image with better visibility, and the variation function S(x, y)' of the real-time image with better visibility is calculated. The continuously collected real-time images p1 and p2 are obtained, and the relative distance RD between the center point of p1 and p2 and the current ship is calculated respectively. p1 and RD p2 , when exactly one-half or three-quarters of the pixel values in the real-time image meet the value greater than At this time, The threshold △ is defined as the critical value, and the relative distance RD between the center points of p1 and p2 and the current ship p1 and RD p2 The expression is: Where α and β are the relative azimuth angles between the current ship and the center points of p1 and p2; is the relative angle between p1 and p2.
8. The method for generating a navigation path for an intelligent ship based on navigation mark vision and spatial semantic enhancement according to claim 1, characterized in that: In step S1, an image enhancement operation is performed on the real-time image to expand the training set of the neural network; The image enhancement operations include random cropping, random flipping, random color adjustment, random noise addition and random blurring; The random cropping performs arbitrary cropping on the real-time image to change the size and content of the real-time image; The random flipping randomly flips the real-time image up and down or left and right; The random color adjustment randomly adjusts the contrast, brightness and saturation of the real-time image; The random noise addition randomly adds noise to the real-time image; The random blurring uses Gaussian blurring or a median filter to randomly blur the real-time image.
9. The method for generating a navigation path for an intelligent ship based on navigation mark vision and spatial semantic enhancement according to claim 1, characterized in that: The loss function is set to evaluate the accuracy of the prediction of the deep neural network. The expression of the loss function is: F=IOU γ L EIOU ; Where γ is the suppression parameter; A and B are any two bounding boxes; b and b gt Represent the center points of the predicted box and the real box respectively; ρ is the Euclidean distance between the center points of the predicted box and the real box; c is the length of the diagonal of the bounding box; C w , C h w are the width and height of the minimum bounding rectangle of the predicted box and the real box respectively; gt 、h gt are the width and height of the real box respectively; w and h are the width and height of the predicted box respectively.
