Unsupervised polygonal structural member shape fitting method

By employing an unsupervised polygonal structural component shape fitting method and utilizing neural networks to optimize slope and translation parameters, the accuracy and efficiency issues in railway infrastructure monitoring are resolved. This method achieves high-precision, real-time polygonal fitting and is applicable to multiple application scenarios.

CN121616596AActive Publication Date: 2026-03-06HANGZHOU HUIJING TECH
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202610147390.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-02-03
Publication Date
2026-03-06
Estimated Expiration
2046-02-03

AI Technical Summary

Technical Problem

In railway infrastructure monitoring, existing technologies suffer from several drawbacks. Traditional polygon fitting methods suffer from accuracy loss, low efficiency, and incompatibility with dynamic changes in sparse/dense point sets. Supervised learning methods require large-scale labeled data and have poor robustness, making it difficult to meet the needs of unattended, all-weather monitoring.

Method used

An unsupervised polygonal structural component shape fitting method is adopted. The slope and translation parameters are optimized through a neural network model to construct an objective function for polygon fitting. The contour point set is processed by combining farthest point sampling and linear interpolation, and the optimal straight line is generated using a multilayer perceptron to achieve accurate fitting of the polygonal structural component.

Benefits of technology

It achieves high-precision, real-time polygonal structural component shape fitting in railway infrastructure, is compatible with 2D images and 3D point cloud data, and is applicable to scenarios such as industrial parts quality inspection, intelligent security and building inspection, providing a general technical framework for high-precision contour analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121616596A_ABST
    Figure CN121616596A_ABST
Patent Text Reader

Abstract

The invention discloses an unsupervised polygonal structural member profile fitting method, which belongs to the technical field of railway infrastructure intelligent monitoring and computer vision, and comprises the following steps: acquiring a profile contour point set of a structural member in an image, and describing a straight line where the edge of the structural member is located by a slope parameter and a translation parameter corresponding to the slope parameter; constructing an objective function based on the distance between the contour point and the straight line, optimizing a slope parameter and a translation parameter, minimizing the objective function to train a neural network model, generating a slope parameter and a translation parameter corresponding to the predicted optimal straight line, and obtaining a contour point set corresponding to the contour image of the to-be-detected structural member. And generating an optimal slope parameter and an optimal translation parameter through the trained neural network model, generating an optimal straight line, and obtaining the appearance of the polygonal structural member through the intersection points between the straight lines. According to the invention, accurate fitting and state detection can be carried out on the appearance of the polygonal structural member, so that accurate and efficient real-time monitoring of railway infrastructures is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of intelligent monitoring and computer vision technology for railway infrastructure, and specifically relates to a method for fitting the shape of polygonal structural components based on unsupervised methods. Background Technology

[0002] In current intelligent monitoring of railway infrastructure, computer vision technology is used to collect the shapes of railway signaling equipment (triangular teeth of dense detectors, notches of switch machines, etc.), track structures (rail bolts, sleepers), and railway vehicle components (brake shoes, flanges), and polygon fitting is performed on the shapes to detect the equipment status. However, traditional polygon fitting techniques (such as the Douglas-Peucker algorithm and the least squares method) suffer from accuracy loss (too small a threshold leads to redundant edges, too large a threshold loses key features) and low efficiency (processing 5000 points takes 0.5-2 seconds) when dealing with dense point sets on site. They also cannot accommodate dynamic changes in sparse / dense point sets and rely on manual parameter tuning. On the other hand, supervised learning-based methods require large-scale labeled data, and retraining is required when changing targets. They also have poor robustness under on-site interference such as strong light and rain. These shortcomings seriously restrict the monitoring accuracy and real-time performance of railway infrastructure, making it difficult to meet the needs of unattended, all-weather monitoring. Summary of the Invention

[0003] To overcome the shortcomings of existing technologies and achieve accurate, efficient, and real-time monitoring of railway infrastructure, this invention adopts the following technical solution:

[0004] An unsupervised polygonal structural component shape fitting method is proposed, the process of which is as follows:

[0005] Obtain the set of points representing the outline of the structural components in the image;

[0006] A neural network model is constructed to describe the straight line where the edge of the structural component is located using slope parameters and their corresponding translation parameters. An objective function is constructed based on the distance between the contour point and the straight line. The neural network model is trained by optimizing the slope parameters and translation parameters and minimizing the objective function to generate the slope parameters and translation parameters corresponding to the predicted optimal straight line.

[0007] Obtain an ordered set of contour points corresponding to the shape image of the structural component to be tested. Generate the optimal slope and translation parameters through a trained neural network model to generate the optimal straight line. Obtain the shape of the polygonal structural component through the intersection points between the straight lines.

[0008] Furthermore, the objective function is constructed by scaling the slope parameter to (0, ... The slope of the contour point is calculated by multiplying the x-coordinate of the contour point by the sine of the slope and the y-coordinate by the cosine of the slope. The distance from the contour point to the line is described by summing the two products with the translation parameter. The influence of the contour point on the line is described by the distance and a preset distance parameter. The objective function is obtained by summing the products of the distance and the influence of each contour point and each line.

[0009] Furthermore, the degree of influence is calculated by using one as the numerator and adding one to the ratio of the square of the distance to the distance parameter as the denominator to obtain the influence weight.

[0010] Furthermore, in the objective function, a regularization term is used to control the dispersion of the slope of the straight line. The regularization term is combined with the product of the distance and the degree of influence, and then the summation is performed based on each contour point and each straight line to obtain the final objective function.

[0011] Furthermore, the regularization term is based on the square of the difference between the slope and the mean slope, plus a regularization parameter, and is accumulated over all straight lines. The negative logarithm of the accumulated value is then taken as the regularization term.

[0012] Furthermore, if the number of contour points is greater than the point count threshold, a new contour point set with the point count threshold is obtained from the outside to the inside by sampling the farthest point.

[0013] Furthermore, the sampling of the farthest point first initializes an empty new contour point set, performs a first traversal of the contour point set, selects some contour points to move to the new contour point set, and starts from the second traversal of the contour point set, finds the contour point farthest from each point in the new contour point set from the contour point set, and moves it to the new contour point set, until the new contour point set reaches the number of points threshold.

[0014] Furthermore, if the number of contour points is less than the point count threshold, a linear interpolation method is used to insert new points sequentially from largest to smallest according to the point spacing, until the new contour point set reaches the point count threshold.

[0015] Furthermore, the linear interpolation method first initializes a new contour point set identical to the original contour point set; it then calculates the distance from each point in the contour point set to every other point to construct a distance matrix; a new point is inserted between the two points with the largest distance, and this new point is also inserted into the new contour set; subsequently, the distance from the new point in the contour point set to all other points is calculated, and the distance matrix is ​​updated, with both its length and width increasing by one dimension. This process is repeated until the new contour point set reaches the specified number of points. By pre-storing the distances using a distance matrix, the need to arbitrarily calculate the distance between two points during each linear interpolation is avoided, thereby reducing the computational load.

[0016] Furthermore, since training directly with an unordered set of contour points can lead to poor training results and difficulty in model convergence, it is necessary to order the new set of contour points. By constructing a binary tree of the new set of contour points and traversing it in inorder, an ordered new set of contour points is obtained for use in the neural network model.

[0017] The advantages and beneficial effects of this invention are as follows:

[0018] This invention proposes an unsupervised polygonal structural component shape fitting method, which can accurately fit the shape and detect the state of polygonal structural components. It is compatible with 2D images and 3D point cloud data, and its potential applications cover polygonal object contour fitting in scenarios such as industrial parts quality inspection, intelligent security, and building inspection, providing a general technical framework for high-precision contour analysis. Attached Figure Description

[0019] Figure 1 This is a flowchart of the method in an embodiment of the present invention. Detailed Implementation

[0020] The specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.

[0021] like Figure 1 As shown, an unsupervised polygonal structural component shape fitting method is applied to railway infrastructure shape monitoring, including the following steps:

[0022] Step S1: Obtain the set of outline points of the structural components in the original image.

[0023] In this embodiment of the invention, original images of railway infrastructure are acquired, and the YOLO segmentation model is used to obtain the contour point set of the target. The objective of the task is to fit the target triangle.

[0024] In another embodiment, Harris corner detection can also be used to obtain the target contour point set.

[0025] Step S2: If the number of contour points is greater than the point count threshold, a new contour point set with the threshold number of points is obtained by sampling from the farthest point from the outside to the inside; if the number of contour points is less than the point count threshold, a linear interpolation method is used to insert new points in the point spacing from large to small to obtain a new contour point set with the threshold number of points.

[0026] In this embodiment of the invention, the capacity of the set of points is set to X = 128, for the contour point set. If the capacity is greater than 128 points, then the farthest point sampling is used to reduce the number of points in the contour point set, so as to ensure downsampling under the condition that the contour points are evenly distributed. The specific steps include the following:

[0027] Step S211: Initialize a new set of contour points , Empty;

[0028] Step S212: First traversal of the contour point set At that time, due to the new contour point set If empty, then the contour point set will be... A random point in the set is moved to the new contour point set. From the second traversal Initially, if the new contour point set If the capacity is less than 128, then traverse the contour point set. From the set of contour points Find the new contour point set at the distance The farthest contour point of each point in the map Remove it from the contour point set Move to the new contour point set Until the new contour point set Its capacity is 128.

[0029] For the contour point set If the number of points is less than 128, linear interpolation is used to increase the number of points in the contour point set. Linear interpolation helps maintain the smoothness of the original contour point set and ensures the uniform distribution of points, which conforms to the angular shape of railway infrastructure. This is very beneficial to the convergence and accuracy of the model. The specific steps include the following:

[0030] Step S221: Initialize a new contour set and the contour point set All content is assigned to the new contour point set ;

[0031] Step S222: Calculate the contour point set The distances from each point to every other point are used to construct a distance matrix. ;

[0032] Step S223: If the new contour set If the capacity is less than 128 points, then find the distance matrix. Find the maximum distance between the two points with the maximum distance, and insert a new point at the midpoint between the two points with the maximum distance, then insert the new point into the new contour point set. Then, the distances from the new point to all other points are calculated, and these distances are inserted into the distance matrix. In the middle, the updated distance matrix Each dimension will increase by one, and this step is repeated until a new set of contour points is created. The capacity is 128. (This is achieved through a distance matrix.) Pre-storing the distance can avoid arbitrarily calculating the distance between two points for each linear interpolation, thereby reducing the amount of computation.

[0033] Step S3: Since training directly with an unordered set of contour points will result in poor training performance and difficulty in model convergence, it is necessary to order the new set of contour points.

[0034] In this embodiment of the invention, the new contour point set Construct a kd-tree and rearrange the new contour point set according to the order obtained by inorder traversal. ;

[0035] Step S4: Construct a multilayer perceptron F based on the new contour point set. Generate the slope parameters of the edges of the polygon structure and the corresponding translation parameters of the edges;

[0036] In this embodiment of the invention, a multilayer perceptron F is initialized, with the input being a new set of contour points. Size is 128, output The size is 2N = 2 * 3, meaning there are two sets of parameters, each with N values. One set represents the slope parameters of the triangle's sides. , , The other set consists of translation parameters corresponding to the sides of the triangle. , , For slope parameter , , Scaling to (0, ) using the sigmoid function The formula for the sigmoid function is as follows:

[0037]

[0038] make , , .

[0039] Using the predicted lines formed by the slope and translation parameters, a self-supervised objective function is constructed based on the distance between the new contour points and the predicted edges. By optimizing the slope and translation parameters to minimize the objective function, the optimal set of predicted lines is obtained. The objective function formula is as follows:

[0040]

[0041]

[0042]

[0043]

[0044] Where n represents the number of output lines, which is the number of perceptron outputs divided by 2; m represents the number of all points (after sampling from the farthest point); This represents the degree of influence of the j-th point on the i-th line. According to the formula, the farther away the point is, the smaller its impact on the model optimization. This represents the perpendicular distance between the j-th point and the i-th line, expressed as a function of the slope parameter (0, ...). Scaling makes able to pass To describe a straight line; Indicates the weight of the regularization term; This represents a regularization term, the purpose of which is to control the slope of the line to be as dispersed as possible. This indicates the preset distance parameter for control. The degree of impact; This represents the x-coordinate of the j-th point; This represents the y-coordinate of the j-th point. Indicates all The average value, This represents the regular expression parameter.

[0045] For all input images and corresponding contour point sets, the Adam optimization algorithm is used to optimize the objective function. In this embodiment of the invention, the training is stopped if the training period reaches 30.

[0046] Step S5: Obtain an ordered new set of contour points corresponding to the shape image of the structural component under test, and then use a trained multilayer perceptron. The optimal slope and translation parameters are generated for line transformation, and the shape of the polygonal structure is obtained through the intersection of the lines.

[0047] In this embodiment of the invention, the trained multilayer perceptron acquires an ordered set of line contour points corresponding to a new structural component image and generates slope parameters. Translation parameters any pair of slope parameters Translation parameters The resulting straight line is called an edge. The specific transformation method is to calculate... , Finally, use a straight line. This means that the cut-off length can be controlled by the intersection of the straight lines.

[0048] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. An unsupervised polygon structure fitting method, characterized in that: obtaining a contour point set of a structure in an image; constructing a neural network model to describe a straight line where a structure edge is located by a slope parameter and a corresponding translation parameter, constructing a target function based on a distance between a contour point and a straight line, and minimizing the target function by optimizing the slope parameter and the translation parameter to train the neural network model to generate a predicted optimal slope parameter and a translation parameter corresponding to a straight line; obtaining a contour point set corresponding to a structure image to be measured, generating an optimal slope parameter and a translation parameter by using the trained neural network model, and generating an optimal straight line, and obtaining a polygon structure contour by using intersection points between straight lines. The influence degree is an influence weight obtained by taking one as a numerator and a ratio of a square of the distance to the distance parameter plus one as a denominator. In the target function, a regularization term is used to control the dispersion degree of the slope of the straight line, and the regularization term is combined with the product of the distance and the influence degree, and then summed based on each contour point and each straight line to obtain the final target function. The regularization term is based on the square of the difference between the slope and the average slope, plus a regularization parameter, and then accumulated for all straight lines, and the logarithm of the accumulated value is taken as the regularization term.

2. The unsupervised-based polygonal structure fitting method of claim 1, wherein: The construction of the objective function is to scale the slope parameter to (0, The distance of the contour point to the straight line is described by the sum of the two products and the translation parameter; the influence degree of the contour point on the straight line is described by the distance and a preset distance parameter; the product of the distance and the influence degree formed by each contour point and each straight line is summed up to obtain the objective function.

3. The unsupervised-based polygonal structure fitting method of claim 2, wherein: If the number of the contour point set is greater than a point threshold, the farthest point sampling is used to obtain a new contour point set with the point threshold from the outside to the inside.

4. The unsupervised-based polygonal structure fitting method of claim 2, wherein: The farthest point sampling first initializes an empty new contour point set, performs a first traversal on the contour point set, selects part of the contour points to move to the new contour point set, and then performs a second traversal on the contour point set, finds the contour point farthest from each point in the new contour point set, and moves it to the new contour point set until the new contour point set reaches the point threshold.

5. The unsupervised-based polygonal structure fitting method of claim 4, wherein: If the number of the contour point set is less than the point threshold, a linear interpolation method is used to insert new points in order from large to small according to the distance between points until the new contour point set reaches the point threshold.

6. The unsupervised-based polygonal structure fitting method of claim 1, wherein: The linear interpolation method first initializes a new contour point set which is the same as the contour point set; 7. The unsupervised-based polygonal structure fitting method of claim 6, wherein: The distance between each point in the contour point set and other points is calculated to construct a distance square matrix, a new point is inserted between the two points with the maximum distance, and the new point is also inserted into the new contour set, then the distance between the new point in the contour point set and all other points is calculated, and the distance square matrix is updated until the new contour point set reaches the point threshold.

8. The unsupervised-based polygonal structure fitting method of claim 1, wherein: The contour point set is ordered, and an ordered contour point set is obtained by constructing a binary tree of the contour point set and performing in-order traversal, which is used for the neural network model.

9. The unsupervised-based polygonal structure outline fitting method of claim 8, wherein: ​ ​ 10. The unsupervised-based polygonal structure fitting method of claim 1, wherein: ​

Citation Information

Patent Citations

  • Method and device for detecting regular polygonal seal in bill

    CN103425984A

  • Method and device for identifying and detecting working equipment in underground coal mine

    CN114091520A

  • Binocular vision different-plane round hole detection method based on cross laser

    CN114119553A

  • Pineapple detection method and system based on weak supervision and storage medium

    CN118038452A

  • Image content recognition system based on deep learning

    CN119273998A