Road geometry physics supervision training method, device and equipment based on binary mask
By constructing a geometric physical supervision signal and a composite loss function, the problem of lack of geometric physical information in remote sensing road segmentation models is solved, achieving more efficient road segmentation results and stronger generalization ability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-20
- Publication Date
- 2026-04-10
AI Technical Summary
Existing road image segmentation models lack geometric and physical information in remote sensing scenes, leading to problems such as semantic drift, topological disconnection, and coarse boundary segmentation. Traditional supervision methods are insufficient to guide the model to learn road features that conform to physical laws.
By transforming the binary mask of real road segmentation into a continuous geometric-physical field containing direction field, width field and anisotropic weights, a composite loss function is constructed for iterative hybrid supervision training, generating a geometric-physical supervision signal containing a geometric topology truth library.
It improves the model's generalization ability on different sensors and regional remote sensing images, significantly improves the topological integrity and boundary accuracy of the segmentation results, reduces the training difficulty, and improves the model's stability and generalization ability.
Smart Images

Figure CN121544659B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of remote sensing image processing and deep learning, in particular to a road geometric and physical supervision training method, device and equipment based on a binary mask. BACKGROUND
[0002] Road extraction segmentation in remote sensing images is a key basic task for geographic information systems, intelligent transportation planning and emergency response applications. With the popularity of high-resolution remote sensing data, deep learning-based road image extraction segmentation methods have made significant progress.
[0003] However, the training of existing road image segmentation models relies on discrete binary masks (only distinguishing between roads and backgrounds, with road pixels being 1 and background being 0), and only optimizes pixel-level classification accuracy through segmentation loss. However, in the remote sensing scene, remote sensing roads have geometric characteristics such as elongated manifold, easy breaking and fuzzy boundary, and discrete binary masks lack continuous geometric and physical information (such as road direction, width, edge features), leading to problems such as semantic drift, topological disconnection and rough boundary segmentation during model training, making the model overfit local textures and lack physical understanding of road topological structure, and the generalization ability is limited, and traditional supervision methods are difficult to guide the model to learn road features that conform to physical laws.
[0004] In view of this, the present application is proposed. SUMMARY
[0005] The present application aims to provide a road geometric and physical supervision training method, device and equipment based on a binary mask, to solve the problems of traditional semantic segmentation models relying only on discrete binary mask supervision and lacking geometric and physical constraints.
[0006] To solve the above technical problems, the present application realizes the following technical scheme:
[0007] A road geometric and physical supervision training method based on a binary mask, comprising:
[0008] S1, obtaining a dataset of remote sensing road images; wherein the dataset contains remote sensing road images and corresponding real road segmentation binary masks;
[0009] S2, converting the real road segmentation binary mask into continuous geometric and physical fields containing direction fields, width fields and anisotropy weights, to complete the pre-generation of geometric supervision signals;
[0010] S3, based on the real road segmentation binary mask and the pre-generated geometric and physical fields, inputting the remote sensing road images of the dataset after preprocessing into a road image segmentation model to be trained for iterative hybrid supervision training, to obtain a trained road image segmentation model for road image segmentation.
[0011] wherein the real road segmentation binary mask is converted into continuous geometric-physical fields including a direction field, a width field, and an anisotropic weight, specifically:
[0012] Based on the real road segmentation binary mask, a skeletonization algorithm and a morphological dilation operation are used to generate a pipe mask;
[0013] Based on the pipe mask, a local principal component analysis is used to calculate the tangent vector of the road skeleton pixel to construct a continuous direction field;
[0014] A signed distance function is used to calculate the Euclidean distance of the pixels in the road region on the remote sensing road image to the boundary to construct a pixel-level width field;
[0015] A structure tensor is used to calculate the anisotropic feature index of the mask gradient on the remote sensing road image to construct an anisotropic weight map reflecting the edge strength of the road.
[0016] Preferably, the road image segmentation model is a semantic segmentation model based on deep learning, the input image extracts image features through the encoder of the road image segmentation model, restores the spatial resolution through the decoder, and finally outputs the predicted road segmentation binary mask through the Sigmoid activation function.
[0017] Preferably, a skeletonization algorithm and a morphological dilation operation are used to generate a pipe mask, specifically:
[0018] A morphological opening operation is performed on the real road segmentation binary mask, and isolated noise points and small area interference regions are removed to obtain a denoised road segmentation binary mask;
[0019] A skeletonization algorithm is used to extract the road centerline S from the denoised road segmentation binary mask;
[0020] Taking the road centerline S as a reference, a morphological dilation operation is performed on the denoised road segmentation binary mask to generate a pipe mask .
[0021] Preferably, based on the pipe mask, a local principal component analysis is used to calculate the tangent vector of the road skeleton pixel to construct a continuous direction field, specifically:
[0022] For each pixel point on the road centerline S, a local sliding window is constructed with the pixel point as the center;
[0023] Extract all pixel coordinates belonging to the centerline S in the local sliding window to form a local coordinate set;
[0024] Based on the local coordinate set, a covariance matrix is constructed;
[0025] Performing eigen decomposition on the covariance matrix, selecting the eigenvector corresponding to the largest eigenvalue as the tangent direction of the pixel point;
[0026] Integrating the tangent directions of all centerline pixels to generate a global ground truth direction field .
[0027] Preferably, the Euclidean distance of the pixel in the road region on the remote sensing road image to the boundary is calculated by using the signed distance function, and a pixel-level width field is constructed, specifically:
[0028] For any pixel point on the remote sensing road image , the minimum distance to the boundary pixel set is calculated, and the expression is:
[0029] ;
[0030] Wherein, is the minimum distance of the pixel point to the boundary pixel set ; is the boundary pixel point;
[0031] Based on the real road segmentation binary mask, the nearest distance of the road internal pixel to the background boundary is calculated ;
[0032] Based on the real road segmentation binary mask, the nearest distance of the background pixel to the road boundary is calculated ;
[0033] The signed distance field is constructed , and the formula is:
[0034] ;
[0035] In the pipe mask region, the absolute value of the signed distance field is taken as the ground truth width field of the corresponding position;
[0036] For pixels outside the pipe mask region, the ground truth width field is assigned as a preset background value, and in the loss calculation process, the region is shielded by the pipe mask , and only the pixels in the pipe mask region are calculated for the width field related loss.
[0037] Preferably, the anisotropy feature index of the mask gradient on the remote sensing road image is calculated by using the structure tensor, and an anisotropy weight map reflecting the road edge strength is constructed, specifically:
[0038] Gaussian blur is performed on the real road segmentation binary mask to obtain a continuous derivable smooth map;
[0039] The gradients of the smooth map in the x and y directions are calculated 、 ;
[0040] For each pixel point, a structure tensor matrix is constructed , and the expression is:
[0041] ;
[0042] Eigen decomposition is performed on the matrix to obtain two eigenvalues 、 , which are used to represent the maximum and minimum change rates of the local gradient, respectively;
[0043] An anisotropy weight map is calculated using the coherence formula , which is used for spatial weighting of the subsequent loss function, and the formula is:
[0044] ;
[0045] wherein is a minimum value to prevent the denominator from being zero;
[0046] The response value is close to 1 at the road edge and close to 0 at the flat interior.
[0047] Preferably, the road image segmentation model is trained using a composite loss function during geometric and physical supervision training to achieve collaborative training of geometric attribute supervision and segmentation accuracy optimization.
[0048] The composite loss function is a weighted combination of a geometric reasoning auxiliary loss and a structure segmentation main loss , and the expression is:
[0049] ;
[0050] wherein is the composite loss function; is the structure segmentation main loss; is the geometric reasoning auxiliary loss; 、 are global weighting coefficients of the segmentation loss and the geometric reasoning auxiliary loss, respectively;
[0051] The structure segmentation main loss combines binary cross entropy (BCE) and Dice loss to balance class imbalance and boundary accuracy, and the expression is:
[0052] ;
[0053] wherein, is binary cross-entropy loss; is predicted road segmentation binary mask; is real road segmentation binary mask; is Dice similarity coefficient, used to measure the overlap degree of prediction and real mask; , are weighting coefficients of BCE, Dice loss respectively;
[0054] The geometric reasoning auxiliary loss includes direction loss, width loss, and regularization loss, and the expression is:
[0055] ;
[0056] wherein, , , are weighting coefficients of direction loss , width loss , and regularization loss respectively;
[0057] The direction loss minimizes the difference between the predicted direction and the real direction by cosine similarity, and introduces anisotropy weight and supervision mask constraint effective pixels, and the expression is:
[0058] ;
[0059] wherein, is total number of effective pixels; is predicted direction field vector of the i-th pixel; is real direction field vector of the i-th pixel; is anisotropy weight of the i-th pixel; is pipeline mask of the i-th pixel, which is a refined supervision area based on , used to constrain the learning of direction field and width field; The width loss uses L1 loss to optimize the prediction accuracy of width information, and is only calculated for pixels within the supervision mask, and the expression is:
[0060]
[0061] ;
[0062] wherein, , respectively, the prediction width value, the real width value of the i-th pixel;
[0063] The regularization loss By constraining the spatial continuity of the direction field and the width field, overfitting of features is avoided, and only the effective pixel positions are calculated, and the expression is:
[0064]
[0065] wherein, is the direction gradient of the direction field at the position ; is the direction gradient of the direction field at the position ; is the direction gradient of the width field at the position , ; is the direction gradient of the width field at the position , ; is the effective pixel mask of the position .
[0066] The application also provides a road geometry and physics supervision training device based on a binary mask, comprising:
[0067] A data acquisition unit is configured to acquire a data set of a remote sensing road image; wherein the data set comprises a remote sensing road image and a corresponding real road segmentation binary mask;
[0068] A supervision signal pre-generation unit is configured to convert the real road segmentation binary mask into continuous geometry and physics fields comprising a direction field, a width field and an anisotropy weight, and complete pre-generation of a geometry supervision signal;
[0069] A supervision training unit is configured to input a remote sensing road image of the data set after preprocessing into a road image segmentation model to be trained for iterative hybrid supervision training based on a real road segmentation binary mask and a pre-generated geometry and physics field, so as to obtain a trained road image segmentation model for road image segmentation.
[0070] The supervision signal pre-generation unit is specifically configured as:
[0071] Based on the real road segmentation binary mask, a skeletonization algorithm and a morphological dilation operation are used to generate a pipe mask;
[0072] Based on the pipe mask, a local principal component analysis is used to calculate the tangent vector of the road skeleton pixel, and a continuous direction field is constructed.
[0073] The pixel-level width field is constructed by calculating the Euclidean distance of pixels in the road region on the remote sensing road image to the boundary by using a symbolic distance function;
[0074] The anisotropy weight map reflecting the road edge intensity is constructed by calculating the anisotropy feature index of the mask gradient on the remote sensing road image by using a structure tensor.
[0075] The application further provides a binary mask-based road geometric and physical supervision training device, comprising a processor and a memory, wherein the memory stores a computer program, and the computer program can be executed by the processor to realize the binary mask-based road geometric and physical supervision training method.
[0076] The application further provides a computer readable storage medium, wherein the computer readable storage medium stores computer readable instructions, and the computer readable instructions are executed by a processor of a device where the computer readable storage medium is located to realize the binary mask-based road geometric and physical supervision training method.
[0077] Compared with the prior art, the application has the following beneficial effects:
[0078] The application generates the geometric supervision signal comprising the true value direction field, the true value width field and the anisotropy weight map by constructing the geometric topology true value library and performing offline physical field transformation on the original true road segmentation binary mask.
[0079] The application constructs the composite loss function comprising the geometric and physical constraints, performs explicit supervision on the geometric field by using the direction cosine loss and the width regression loss, and optimizes the network parameters jointly.
[0080] The application forces the model to learn the essential geometric properties of the road instead of overfitting specific textures by using the constructed physical field true value and the geometric constraint loss, and improves the generalization ability of the model on remote sensing images of different sensors and different regions. BRIEF DESCRIPTION OF DRAWINGS
[0081] In order to more clearly illustrate the technical solutions of the embodiments of the application, the following will briefly introduce the drawings needed to be used in the embodiments. It should be understood that the following drawings only show some embodiments of the application, and therefore should not be regarded as a limitation to the scope, and other related drawings can also be obtained by those skilled in the art without paying creative labor on the premise of not deviating from the concept of the application.
[0082] Figure 1 A binary mask-based road geometric and physical supervision training method provided for the first embodiment.
[0083] Figure 2 A schematic diagram of a binary mask-based road geometry physics supervision training device provided for the embodiment two.
[0084] The application will be described in further detail below in connection with the drawings and specific embodiments. DETAILED DESCRIPTION
[0085] For the purpose, technical solutions and advantages of the embodiments of the present application to be clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below in connection with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without making creative efforts fall within the scope of protection of the present application. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the claimed present application, but only represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without making creative efforts fall within the scope of protection of the present application.
[0086] Embodiment one
[0087] The embodiment one of the present application provides a binary mask-based road geometry physics supervision training method, which can be implemented by a binary mask-based road geometry physics supervision training device (hereinafter referred to as a supervision training device), in particular, by one or more processors in the supervision training device.
[0088] In the embodiment, the supervision training device can be an electronic device equipped with a processor, the processor is provided with a computer program of the binary mask-based road geometry physics supervision training method and the computer program can be executed, for example, a computer, a smart phone, a smart tablet, a workstation, etc., which are not limited here.
[0089] As shown in FIG. 1, a binary mask-based road geometry physics supervision training method includes steps S1-S3. Figure 1
[0090] S1, obtaining a dataset of remote sensing road images; wherein the dataset contains remote sensing road images and corresponding real road segmentation binary masks.
[0091] Collect remote sensing road images of different resolutions (such as 0.5m-2m), different terrains (plain, mountain, city, countryside), and different weather conditions (sunny, cloudy, foggy), each image needs to be matched with a manually annotated real road segmentation binary mask, the road pixel value is 1 and the background pixel value is 0, forming a “image-real mask” paired dataset.
[0092] Dataset division: the dataset can be divided into training set, validation set and test set in the ratio of 8:1:1, ensuring the consistency of scene distribution of each subset and avoiding model overfitting.
[0093] This step provides basic data support for subsequent preprocessing and model training by constructing a multi-scene data set with accurate annotations.
[0094] S2, convert the real road segmentation binary mask into continuous geometric and physical fields containing direction field, width field and anisotropy weight, and complete the pre-generation of geometric supervision signals.
[0095] This step extracts continuous geometric and physical information from discrete binary masks to generate three major supervision signals: direction field, width field, and anisotropy weight map, providing structural constraints beyond pixel level for model training.
[0096] The specific process is as follows:
[0097] S21, based on the real road segmentation binary mask, use skeletonization algorithm and morphological dilation operation to generate pipe mask.
[0098] To avoid background noise interference in geometric calculation, first define the core effective area of the road.
[0099] First, perform morphological opening operation on the real road segmentation binary mask, and remove isolated noise points and small area interference area to obtain the denoised road segmentation binary mask;
[0100] Use skeletonization algorithm to extract road centerline S from the denoised road segmentation binary mask;
[0101] Take the road centerline S as the reference, perform morphological dilation operation on the denoised road segmentation binary mask to generate pipe mask .
[0102] Only in the pipe mask area to perform subsequent geometric calculation, ensuring that the supervision signal focuses on the main body of the road and its neighborhood.
[0103] S22, based on the pipe mask, calculate the tangent vector of the road skeleton pixel using local principal component analysis to construct a continuous direction field.
[0104] The direction field represents the local extension direction of the road, guiding the model to learn the consistency of the road direction. The specific process is as follows:
[0105] For each pixel point on the road centerline S, construct a local sliding window centered on the pixel point;
[0106] Extract all the pixel coordinates belonging to the centerline S within the local sliding window, and form a local coordinate set;
[0107] Based on the local coordinate set, a covariance matrix is constructed. First, all the centerline pixel coordinates within the window are collected, and the coordinate mean is calculated. Then, the covariance matrix is calculated based on the coordinate mean.
[0108] Perform eigenvalue decomposition on the covariance matrix, and select the eigenvector corresponding to the largest eigenvalue as the tangent direction of the pixel point;
[0109] Integrate the tangent directions of all centerline pixels and extend them to the pipeline mask to generate a global true value direction field Each pixel is a two-dimensional vector containing horizontal and vertical components.
[0110] S23, using the signed distance function to calculate the Euclidean distance from the pixels in the road region of the remote sensing road image to the boundary, and constructing a pixel-level width field.
[0111] For any pixel point on the remote sensing road image, calculate its minimum distance to the boundary pixel set (itself as a road pixel, and the neighborhood containing background pixels), expressed as:
[0112] ;
[0113] where, is the minimum distance from the pixel point to the boundary pixel set ; is the boundary pixel point; is the L2 norm.
[0114] Based on the true road segmentation binary mask, calculate the nearest distance from the road interior pixels to the background boundary .
[0115] Based on the true road segmentation binary mask, calculate the nearest distance from the background pixels to the road boundary .
[0116] In this embodiment, the Euclidean distance from the road interior pixels to the background boundary and the distance from the background pixels to the road boundary can be calculated by the distance transform function of OpenCV.
[0117] Construct a signed distance field , the formula is:
[0118] ;
[0119] SDF value: negative for road interior, positive for background, and 0 for boundary.
[0120] In the pipe mask region, take the absolute value of the signed distance field as the true value width field of the position . .
[0121] For pixels outside the pipe mask region, assign its true value width field to a preset background value, and in the loss calculation process, shield the region through the pipe mask , and only calculate the width field related loss for pixels in the pipe mask region.
[0122] S24, use the structure tensor to calculate the anisotropy feature index of the mask gradient on the remote sensing road image, and construct the anisotropy weight map reflecting the road edge intensity.
[0123] Gaussian blur the true road segmentation binary mask to obtain a continuous and differentiable smooth map;
[0124] Calculate the gradient of the smooth map in the x and y directions 、 ;
[0125] For each pixel point, construct a 2*2 structure tensor matrix , the expression is:
[0126] ;
[0127] Eigenvalue decomposition is performed on the matrix , two eigenvalues 、 are obtained, which are used to represent the maximum and minimum change rates of local gradient respectively, and correspond to the road edge and road extension direction respectively;
[0128] Anisotropy weight map is calculated using the coherence formula , which is used for spatial weighting of subsequent loss function, the formula is:
[0129] ;
[0130] Where, is a small value to prevent the denominator from being zero.
[0131] The response value is close to 1 at the road edge, and the response value is close to 0 at the flat inside.
[0132] S3, based on the real road segmentation binary mask and the pre-generated geometric physical field, the remote sensing road image of the data set is preprocessed and input into the road image segmentation model to be trained for iterative mixed supervised training, to obtain a trained road image segmentation model for road image segmentation.
[0133] This step optimizes the segmentation accuracy and geometric structure consistency through end-to-end training of the composite loss function.
[0134] This step inputs the remote sensing road image of the data set after preprocessing into the pre-trained road image segmentation model, and outputs the predicted road segmentation binary mask.
[0135] Preprocessing operations such as size normalization, scaling all remote sensing images and corresponding binary masks to a fixed resolution (such as 512x512 pixels), and using bilinear interpolation to ensure that image details are not lost.
[0136] Such as pixel normalization, mapping image pixel values from [0, 255] to [0, 1] interval, or using Z-Score standardization to eliminate the influence of pixel value magnitude difference on model training.
[0137] Such as data augmentation, random augmentation operations are performed on the training set, including horizontal / vertical flipping, 90° / 180° / 270° rotation, ±10% scale, and slight Gaussian noise addition to improve the adaptability of the model to road posture and environmental changes; The validation set and test set only perform size normalization and pixel normalization to ensure the objectivity of the evaluation.
[0138] The road image segmentation model is a semantic segmentation model based on deep learning, which can select a semantic segmentation model with strong multi-scale feature extraction capability as the basic framework, and preferably use S-LSKNet, ResNet-50 or Vision Transformer U-Net, SegNet variant as the backbone network to adapt to the slender structure features of remote sensing roads.
[0139] The preprocessed training set images are input into the initial untrained / semi-trained segmentation model, the image features are extracted through the encoder of the road image segmentation model, the spatial resolution is restored through the decoder, and finally the predicted road segmentation binary mask is output through the Sigmoid activation function.
[0140] The road image segmentation model is trained using a composite loss function to achieve collaborative training of geometric attribute supervision and segmentation accuracy optimization.
[0141] The composite loss function is a weighted combination of geometric reasoning auxiliary loss and structure segmentation main loss The expression is:
[0142] ;
[0143] in, The loss function is the summation function. The main loss is segmented into structural components; Auxiliary loss for geometric reasoning; , These are the global weighting coefficients for the segmentation loss and the geometric inference auxiliary loss, respectively.
[0144] The structural segmentation main loss combines binary cross-entropy (BCE) and Dice loss to balance class imbalance and boundary accuracy, and its expression is:
[0145] ;
[0146] in, For binary cross-entropy loss; To predict the binary mask for road segmentation; A binary mask for segmenting the real road; is the Dice similarity coefficient, used to measure the degree of overlap between the prediction and the true mask; , These are the weighting coefficients for BCE and Dice losses, respectively.
[0147] The geometric inference auxiliary loss comprises three parts: orientation loss, width loss, and regularization loss, expressed as follows:
[0148] ;
[0149] in, , , Directional loss Width loss Regularization loss Weighting coefficients;
[0150] The direction loss By minimizing the difference between the predicted and true directions using cosine similarity, anisotropic weights and a supervised mask are introduced to constrain effective pixels. The expression is as follows:
[0151] ;
[0152] in, Total number of valid pixels; For the first The predicted orientation field vector of each pixel; For the first The true orientation field vector of each pixel; For the first Anisotropic weights for each pixel; For the first The pipe mask of 1 pixel is based on The expanded refined supervision area It is used to constrain the learning of the direction field and the width field.
[0153] The width loss The L1 loss function is used to optimize the prediction accuracy of width information. The calculation is performed only on pixels within the supervised mask, and the expression is:
[0154] ;
[0155] in, , The first The predicted width value and the actual width value of each pixel.
[0156] The regularization loss By constraining the spatial continuity of the orientation and width fields to avoid feature overfitting, only valid pixel locations are considered. The calculation is expressed as:
[0157] ;
[0158] in, For direction field exist place Orientation gradient; For direction field exist place Orientation gradient; , They are respectively the width field exist place , Orientation gradient; for The effective pixel mask for the location.
[0159] In summary, compared with the prior art, the present invention has the following beneficial effects:
[0160] This invention addresses the core shortcomings of existing road segmentation models, which rely on real discrete binary masks for training and lack geometric and physical constraints. By mining continuous geometric and physical information from binary masks to construct a dedicated supervision signal, it achieves breakthroughs in several aspects, with the following specific benefits:
[0161] (1) Break through the limitations of discrete supervision, and the supervision signal is more in line with the physical law of the road: the existing technology only provides "road / background" classification supervision through a binary mask, which cannot guide the model to learn the inherent geometric characteristics such as the direction and width of the road. The direction field and width field generated by the present application are continuous value supervision signals, which accurately represent the extension direction and scale distribution of the road, so that the model not only learns pixel-level classification during training, but also masters the physical law conforming to the real road structure, thereby essentially improving the rationality of feature expression.
[0162] (2) Significantly improve the topological integrity and boundary accuracy of the segmentation result: the model trained by the existing technology is prone to problems such as road breakage, semantic drift, and boundary ambiguity in complex scenes (such as narrow roads, curves, and vegetation sheltered areas). The present application constrains the consistency of road direction through the direction field, reduces the segmentation breakage of curves and long-distance roads, and improves the boundary segmentation accuracy through the anisotropic weight map. At the same time, the width field can guide the model to accurately distinguish parallel roads and adjacent backgrounds, effectively suppressing semantic drift.
[0163] (3) Stronger training stability and generalization ability: the single segmentation loss of the existing technology is prone to cause the model to deviate to the background class due to data imbalance (low road pixel ratio), resulting in poor generalization ability. The composite loss function constructed by the present application combines the main loss and geometric auxiliary loss of segmentation, which not only balances the class imbalance problem, but also avoids model overfitting through geometric regularization constraints, so that the model can stably perform in remote sensing images with different resolutions, different terrains, and different weather conditions, and the generalization ability is significantly improved.
[0164] (4) Strong universality and easy to land engineering: some existing geometric guided segmentation methods need to modify the core structure of the model or rely on additional labeled data (such as road width and direction annotation), which have poor adaptability and high landing cost. The present application does not require additional labeling, and can generate geometric physical fields based on existing binary masks, which are suitable for various mainstream segmentation model frameworks such as U-Net and SegNet without significantly modifying the model structure. At the same time, the geometric physical field conversion module can be processed offline in batches, and the training and reasoning process is clear, which is easy to deploy and scale application.
[0165] (5) Reduce the difficulty of model training and improve the optimization efficiency: the model in the existing technology needs to learn road geometric features independently, which has high learning difficulty and slow convergence speed. The present application provides clear geometric constraints for the model through geometric physical supervision signals, reduces the difficulty of feature learning, makes the model converge to the optimal solution faster, shortens the training period, and improves the training efficiency.
[0166] Embodiment Two
[0167] As Figure 2As shown, the second embodiment of the present application also provides a binary mask-based road geometric and physical supervision training device, comprising:
[0168] a data acquisition unit configured to acquire a data set of a remote sensing road image; wherein the data set comprises the remote sensing road image and a corresponding real road segmentation binary mask;
[0169] a supervision signal pre-generation unit configured to convert the real road segmentation binary mask into continuous geometric and physical fields comprising a direction field, a width field and an anisotropic weight, and complete pre-generation of a geometric supervision signal;
[0170] a supervision training unit configured to input the remote sensing road image of the data set after preprocessing into a road image segmentation model to be trained based on the real road segmentation binary mask and the pre-generated geometric and physical fields, and perform iterative hybrid supervision training to obtain a trained road image segmentation model for road image segmentation;
[0171] wherein the supervision signal pre-generation unit is specifically configured as:
[0172] based on the real road segmentation binary mask, a skeletonization algorithm and a morphological dilation operation are used to generate a pipe mask;
[0173] based on the pipe mask, a local principal component analysis is used to calculate a tangent vector of a road skeleton pixel to construct a continuous direction field;
[0174] a signed distance function is used to calculate the Euclidean distance of pixels in a road region on the remote sensing road image to the boundary to construct a pixel-level width field;
[0175] a structure tensor is used to calculate an anisotropic feature index of a mask gradient on the remote sensing road image to construct an anisotropic weight map reflecting the edge strength of the road.
[0176] Embodiment three
[0177] The third embodiment of the present application also provides a binary mask-based road geometric and physical supervision training device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer program can be executed by the processor to implement the binary mask-based road geometric and physical supervision training method as described above.
[0178] Embodiment four
[0179] The fourth embodiment of the present application also provides a computer readable storage medium, wherein the computer readable storage medium stores computer readable instructions, and the computer readable instructions are executed by a processor of a device where the computer readable storage medium is located to implement the binary mask-based road geometric and physical supervision training method as described above.
[0180] In several embodiments provided by the embodiments of the present application, it should be understood that the disclosed apparatus and method can also be implemented by other manners. The apparatus and method embodiments described above are only illustrative, for example, the flowchart in the drawings shows the possible implementation architecture, function and operation of the apparatus, method and computer program product according to the embodiments of the present application. In this regard, each block in the flowchart or block diagram can represent a module, a program segment or a part of code, which includes one or more executable instructions for implementing the specified logic function. It should also be noted that in some alternative implementation manners, the functions noted in the blocks can also occur in different order from that noted in the drawings. For example, two consecutive blocks can actually be executed substantially in parallel, and sometimes they can also be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for executing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.
[0181] In addition, each functional module in the embodiments of the present application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0182] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the part of the prior art that makes a contribution or the part of the technical solutions can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, an electronic device, or a network device, etc.) to execute all or part of the steps of the methods described in the embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes. It should be noted that in this document, the terms "include", "contain" or any other variant thereof are intended to cover non-exclusive inclusion, so that the processes, methods, articles or devices that include a series of elements not only include those elements, but also include other elements not explicitly listed or inherent to such processes, methods, articles or devices. Without more limitations, the element defined by the statement "includes a" does not exclude the presence of another identical element in the process, method, article or device that includes the element.
[0183] The terminology used in the embodiments of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the present application. As used in the description of the embodiments of the present application, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
[0184] It should be understood that the term "and / or" as used herein merely describes associated objects, and can exist in three forms, for example, A and / or B can mean that A exists alone, A and B exist together, and B exists alone. In addition, the character " / " herein generally represents an "or" relationship between the front and rear associated objects.
[0185] Depending on context, the word "if" as used herein can be interpreted to mean "when" or "upon" or "in response to determining" or "in response to detecting." Similarly, the phrase "if it is determined" or "if [a stated condition or event] is detected" can be interpreted to mean "upon determining" or "in response to determining" or "upon detecting [the stated condition or event]" or "in response to detecting [the stated condition or event]."
[0186] The "first\second" mentioned in the embodiments is only to distinguish similar objects, and does not represent a specific order of the objects. Understandably, the "first\second" can be interchanged in a specific order or sequence as allowed. It should be understood that the objects distinguished by "first\second" can be interchanged under appropriate circumstances, so that the embodiments described herein can be implemented in an order other than those illustrated or described herein.
[0187] The above only describes the preferred embodiments of the present application and is not intended to limit the present application. For those skilled in the art, the present application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A road geometry-physical supervised training method based on binary masks, characterized in that, include: A dataset of remotely sensed road images is obtained; wherein the dataset contains remotely sensed road images and corresponding binary masks for real road segmentation; The binary mask of real road segmentation is transformed into a continuous geometric physical field containing direction field, width field, and anisotropic weights, thus completing the pre-generation of geometric supervision signal; Based on the real road segmentation binary mask and the pre-generated geophysical field, the remote sensing road images of the dataset are preprocessed and then input into the road image segmentation model to be trained for iterative hybrid supervised training to obtain a trained road image segmentation model for road image segmentation. Specifically, the binary mask for real road segmentation is transformed into a continuous geometric-physical field containing direction field, width field, and anisotropic weights, as follows: Based on the binary mask of real road segmentation, a skeletonization algorithm and morphological dilation operation are used to generate a pipeline mask; Based on the pipeline mask, the tangent vectors of the road skeleton pixels are calculated using local principal component analysis to construct a continuous orientation field; The Euclidean distance from pixels to boundaries within a road region on a remotely sensed road image is calculated using the signed distance function, and a pixel-level width field is constructed. An anisotropic feature index of mask gradient on remotely sensed road images is calculated using the structure tensor, and an anisotropic weight map reflecting the intensity of road edges is constructed. When the road image segmentation model to be trained is subjected to iterative hybrid supervised training, a composite loss function is used for training to achieve collaborative training of geometric attribute supervision and segmentation accuracy optimization; The composite loss function is a weighted combination of geometric reasoning auxiliary loss and structural segmentation main loss. The structural segmentation master loss combines binary cross-entropy (BCE) and Dice loss to balance class imbalance with boundary accuracy. The geometric reasoning auxiliary loss consists of three parts: orientation loss, width loss, and regularization loss. The orientation loss minimizes the difference between the predicted and true orientations using cosine similarity, and introduces anisotropic weights and a supervised mask to constrain effective pixels. The expression is as follows: ; in, Loss due to direction; Total number of valid pixels; For the first The predicted orientation field vector of each pixel; For the first The true orientation field vector of each pixel; For the first Anisotropic weights for each pixel; For the first The pipe mask of 1 pixel is based on the real road segmentation binary mask. The expanded, refined monitoring area , used to constrain the learning of the direction field and width field; The width loss uses L1 loss to optimize the prediction accuracy of width information, and is calculated only for pixels within the supervised mask. The regularization loss constrains the spatial continuity of the orientation and width fields to avoid feature overfitting, and applies only to valid pixel locations. calculate.
2. The road geometry-physical supervised training method based on binary masks according to claim 1, characterized in that... The road image segmentation model is a semantic segmentation model based on deep learning. The input image is processed by the encoder of the road image segmentation model to extract image features, the spatial resolution is restored by the decoder, and finally the predicted road segmentation binary mask is output by the Sigmoid activation function.
3. The road geometry-physical supervised training method based on binary masks according to claim 2, characterized in that... The pipeline mask is generated using a skeletonization algorithm and morphological dilation operation, specifically as follows: A morphological opening operation is performed on the real road segmentation binary mask, and isolated noise points and small interference areas are removed to obtain the denoised road segmentation binary mask. The skeletonization algorithm is used to extract the road centerline S from the denoised road segmentation binary mask; Using the road centerline S as a reference, perform a morphological dilation operation on the denoised road segmentation binary mask to generate a pipeline mask. .
4. The road geometry-physical supervised training method based on binary masks according to claim 3, characterized in that... Based on the pipeline mask, local principal component analysis is used to calculate the tangent vectors of the road skeleton pixels, constructing a continuous direction field, specifically: For each pixel on the road centerline S, construct a local sliding window centered on that pixel; Extract the pixel coordinates of all pixels belonging to the center line S within the local sliding window to form a local coordinate set; Based on the local coordinate set, construct the covariance matrix; Perform eigenvalue decomposition on the covariance matrix and select the eigenvector corresponding to the largest eigenvalue as the tangent direction of the pixel. By integrating the tangent directions of all centerline pixels, a global ground truth orientation field is generated. .
5. The road geometry-physical supervised training method based on binary masks according to claim 4, characterized in that... The Euclidean distance from pixels to boundaries within a road region on a remotely sensed road image is calculated using the signed distance function, and a pixel-level width field is constructed as follows: For any pixel in a remotely sensed road image Calculate the minimum distance from it to the boundary pixel set, expressed as: ; in, For pixels To the boundary pixel set The minimum distance; For boundary pixels; Based on the real road segmentation binary mask, calculate the nearest distance from the internal pixels of the road to the background boundary. ; Based on the real road segmentation binary mask, calculate the nearest distance from the background pixel to the road boundary. ; Constructing the symbolic distance field The formula is: ; In the pipe mask Within the region, take the sign distance field The absolute value is used as the true value width field at the corresponding position. ; For pipe masks For pixels outside the region, their ground truth width field is assigned the preset background value, and this value is then passed through a pipeline mask during the loss calculation process. For pipe mask Pixels outside the region are masked, only the pipe mask is masked. Calculate the width field correlation loss for pixels within the region.
6. The road geometry-physical supervised training method based on binary masks according to claim 5, characterized in that... The anisotropic feature index of the mask gradient on the remotely sensed road image is calculated using the structure tensor, and an anisotropic weight map reflecting the intensity of the road edge is constructed, specifically as follows: Gaussian blurring is applied to the binary mask of the real road segmentation to obtain a continuously differentiable smooth image; Calculate the gradient of the smoothed map in the x and y directions. , ; For each pixel, construct the structure tensor matrix. The expression is: ; For matrix Perform eigenvalue decomposition to obtain two eigenvalues. , , are used to represent the maximum rate of change and the minimum rate of change of the local gradient, respectively; Calculate the anisotropy weights using the coherence formula This is used for the spatial weighting of the subsequent loss function, and the formula is: ; in, To prevent the minimum value where the denominator is zero; The response value is close to 1 at the edge of the road and close to 0 in the flat interior.
7. A road geometry-physical supervised training method based on binary masks according to claim 6, characterized in that... The expression for the composite loss function is: ; in, It is a composite loss function; The main loss is for structural segmentation; Auxiliary loss for geometric reasoning; , These are the global weighting coefficients for the structural segmentation main loss and the geometric inference auxiliary loss, respectively. The expression for the main loss of the structural segmentation is: ; in, For binary cross-entropy loss; To predict the binary mask for road segmentation; A binary mask for segmenting real roads; is the Dice similarity coefficient, used to measure the degree of overlap between the prediction and the true mask; , These are the weighting coefficients for BCE and Dice losses, respectively; The expression for the geometric inference auxiliary loss is: ; in, , , Directional loss Width loss Regularization loss Weighting coefficients; The expression for the width loss is: ; in, , The first The predicted width value and the actual width value of each pixel; The expression for the regularization loss is: ; in, For direction field exist place Orientation gradient; For direction field exist place Orientation gradient; , They are respectively the width field exist place , Orientation gradient; for The effective pixel mask for the location.
8. A road geometry-physical supervision training device based on binary masks, used to implement the road geometry-physical supervision training method based on binary masks as described in any one of claims 1-7, characterized in that, include: A data acquisition unit is used to acquire a dataset of remotely sensed road images; wherein, the dataset includes remotely sensed road images and corresponding binary masks for real road segmentation; The supervision signal pre-generation unit is used to convert the real road segmentation binary mask into a continuous geometric physical field containing direction field, width field, and anisotropic weights, thereby completing the pre-generation of geometric supervision signals. The supervised training unit is used to preprocess the remote sensing road images in the dataset based on the real road segmentation binary mask and the pre-generated geophysical field, and then input them into the road image segmentation model to be trained for iterative hybrid supervised training to obtain a trained road image segmentation model for road image segmentation. Specifically, the supervision signal pre-generation unit is: Based on the binary mask of real road segmentation, a skeletonization algorithm and morphological dilation operation are used to generate a pipeline mask; Based on the pipeline mask, the tangent vectors of the road skeleton pixels are calculated using local principal component analysis to construct a continuous orientation field; The Euclidean distance from pixels to boundaries within a road region on a remotely sensed road image is calculated using the signed distance function, and a pixel-level width field is constructed. An anisotropic feature index of the mask gradient on remotely sensed road images is calculated using the structure tensor, and an anisotropic weight map reflecting the intensity of road edges is constructed.
9. A road geometry-physical supervised training device based on binary masks, characterized in that, It includes a processor and a memory, wherein the memory stores a computer program that can be executed by the processor to implement a road geometry-physical supervision training method based on a binary mask as described in any one of claims 1-7.
Citation Information
Patent Citations
Road-based segmentation model processing method and apparatus, and electronic device
CN117745740A
Semantic segmentation-based road extraction method and system
CN120823384A