Coupler deflection angle detection method and device
By using a residual neural network model to extract features and calculate angles from coupler images, the problem of low efficiency and poor robustness in coupler deflection angle detection in existing technologies is solved, and accurate and automated coupler deflection angle measurement is achieved.
Patent Information
- Application Number
- CN202411652533.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2026-05-19
AI Technical Summary
Existing methods for detecting coupler deflection angles are inefficient, subjective, and lack robustness, making it difficult to meet the requirements for efficient and accurate detection.
A residual neural network model is used to extract features and calculate angles from coupler images. By marking observation points and calculating the angle between connecting lines, the accurate measurement of coupler deflection angle is achieved. The model includes a combination of convolutional layers, pooling layers, flattening layers, and fully connected layers, and is trained and recognized using a ResNet50 structure.
It achieves accurate measurement of coupler deflection angle, has good robustness and strong generalization ability, and the automated measurement does not require manual intervention, thus improving detection efficiency.
Smart Images

Figure CN122066962A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of rail transit operation safety testing technology, and in particular to a method and device for detecting coupler deflection angle. Background Technology
[0002] Rail transit vehicles consist of a locomotive and multiple carriages, connected to each other via couplers. As a crucial component in rail vehicle connections, the coupler plays a vital role in the efficient and safe operation of the vehicle. The coupler's deflection angle, especially the maximum deflection angle, directly affects the vehicle's handling performance and ability to navigate curves. If the maximum deflection angle is too small, the vehicle will struggle to navigate curves, impacting its agility and efficiency; conversely, if the maximum deflection angle is too large, it will increase the vehicle's turning radius, limiting its maneuverability on narrow roads. When designing and manufacturing couplers, the vehicle's operating environment, functional requirements, and relevant safety standards and regulations must be considered. The maximum deflection angle of the coupler needs to be strictly controlled during the design and manufacturing process to ensure compliance with relevant safety standards and regulations, thereby guaranteeing the overall safety performance of the vehicle.
[0003] Currently, the main methods for testing the maximum deflection angle of couplers are manual visual measurement or deflection detection using traditional machine vision. However, manual visual measurement suffers from low efficiency, high subjectivity, and potential safety hazards; while deflection detection using traditional machine vision is highly dependent on the environment, lacks anti-interference capabilities, and has relatively poor system robustness. Therefore, there is an urgent need for a more efficient, accurate, and robust coupler deflection angle detection solution. Summary of the Invention
[0004] The purpose of this invention is to provide a method and apparatus for detecting the deflection angle of a train coupler, so as to solve the above-mentioned problems. It can achieve accurate measurement of the deflection angle of the train coupler, with good robustness, strong generalization ability and high testing efficiency.
[0005] This invention proposes a method for detecting the deflection angle of a coupler, comprising the following steps:
[0006] Acquire several images of couplers to be coupled, the images of couplers to be coupled include the fixed part of the coupler and the rotating part of the coupler;
[0007] Mark the first observation point on the fixed part of the coupler and mark the second observation point on the rotating part of the coupler;
[0008] Input the images of each coupler to be coupled into the trained coupler recognition model to identify the positions of the first and second observation points in the coupler images, as well as the positions of the first and second observation points when both are located at the center line of the train.
[0009] Calculate the coupler deflection angle in each coupler image to be coupled. The coupler deflection angle is the angle between the line connecting the first observation point and the second observation point in the coupler image to be coupled and the line connecting the first observation point and the second observation point when both are located at the center line of the train.
[0010] In one embodiment, the first observation point is the center point of the coupler fixed part, and the second observation point is the center point of the coupler rotating part.
[0011] In one embodiment, the coupler recognition model is a residual neural network model, which includes convolutional layers, pooling layers, flattening layers, and fully connected layers.
[0012] The convolutional layer is used to extract features from each image of the coupler to be coupled and output a feature map.
[0013] The pooling layer is used to reduce the dimension of the feature map output by the convolutional layer;
[0014] The Flatten layer is used to convert the output data of the pooling layer into a one-dimensional array;
[0015] The fully connected layer is used to summarize and map features, and output the positions of the first and second observation points in the image of the coupler to be coupled, as well as the positions of the first and second observation points when both are located at the center line of the train.
[0016] In one embodiment, the pooling layer uses average pooling to reduce the dimensionality of the output feature map of the convolutional layer.
[0017] In one embodiment, the residual neural network model is built based on the ResNet50 architecture and includes 49 convolutional layers, 1 pooling layer, 1 Flatten layer, and 1 fully connected layer.
[0018] In one embodiment, an activation function is provided after each convolutional layer and pooling layer, which is used to introduce nonlinear factors.
[0019] In one embodiment, the process of training the coupler recognition model includes:
[0020] Data annotation is performed on each image of a coupler to be coupled: the position of the first observation point is marked on the fixed part of the coupler in each image of a coupler to be coupled, the position of the second observation point is marked on the rotating part of the coupler, and the positions of the first and second observation points are marked when both the first and second observation points are located at the center line of the train.
[0021] Set the training parameters for the coupler recognition model, including setting the loss function and the optimization algorithm;
[0022] The coupler recognition model is trained using labeled images of the couplers to be coupled.
[0023] The loss function value is calculated based on the predicted positions of the first and second observation points and the pre-labeled positions of the first and second observation points. The parameters of the coupler recognition model are iteratively updated based on the optimization algorithm until the loss function value converges or the preset number of iterations is reached.
[0024] In one embodiment,
[0025] The process involves inputting images of each coupler to be coupled into a trained coupler recognition model to identify the positions of the first and second observation points in the coupler images, as well as the positions of the first and second observation points when both are located on the train centerline. The model outputs the coordinates (x1, y1) of the first observation point in the coupler images, the coordinates (x2, y2) of the second observation point in the coupler images, the coordinates (x1′, y1′) of the first observation point when both are located on the train centerline, and the coordinates (x2′, y2′) of the second observation point when both are located on the train centerline.
[0026] The formula for calculating the coupler deflection angle θ in the image of the coupler to be coupled is:
[0027] Where k is the slope of the straight line connecting the first and second observation points in the image of the coupler to be coupled.
[0028] k0 is the slope of the straight line connecting the first and second observation points when both are located at the train centerline.
[0029] This invention also proposes a coupler deflection angle detection device for implementing the coupler deflection angle detection method described above, comprising:
[0030] The input module is used to input an image of the coupler to be coupled, which includes a fixed part of the coupler and a rotating part of the coupler.
[0031] A custom setting module is used to mark a first observation point on the fixed part of the coupler and a second observation point on the rotating part of the coupler;
[0032] The coupler recognition module is used to identify the positions of the first observation point and the second observation point in the image of the coupler to be coupled, as well as the positions of the first observation point and the second observation point when both are located at the center line of the train.
[0033] The coupler deflection angle calculation module is used to calculate the coupler deflection angle based on the positions of the first observation point and the second observation point in the image of the coupler to be coupled, and when both the first observation point and the second observation point are located at the center line of the train.
[0034] The output module is used to output the coupler deflection angle.
[0035] In one embodiment, the coupler recognition module includes a feature extraction unit, a pooling unit, a data dimension conversion unit, and a position recognition unit;
[0036] The feature extraction unit is used to extract features from the images of each coupler to be coupled and output a feature map.
[0037] The pooling unit is used to reduce the dimension of the feature map output by the feature extraction unit;
[0038] The data dimension conversion unit is used to convert the output data of the pooling unit into a one-dimensional array;
[0039] The position recognition unit is used to summarize and map features, and output the positions of the first observation point and the second observation point in the image of the coupler to be coupled, as well as the positions of the first observation point and the second observation point when both are located at the center line of the train.
[0040] Compared with the prior art, the beneficial effects of the coupler deflection angle detection method and device of the present invention are as follows:
[0041] 1) This invention learns and extracts complex features from a large amount of data through a residual neural network, thereby enabling accurate measurement of the coupler deflection angle with good robustness.
[0042] 2) This invention can accurately identify coupler images of different shapes, sizes and backgrounds, and has a strong generalization ability.
[0043] 3) This invention can realize the automated measurement of coupler deflection angle without manual intervention, which greatly improves measurement efficiency. Attached Figure Description
[0044] Figure 1 This is a flowchart illustrating a coupler deflection angle detection method according to an embodiment of the present invention.
[0045] Figure 2 This is an architectural diagram of a coupler recognition model according to an embodiment of the present invention;
[0046] Figure 3 This is a schematic diagram illustrating the detection of the deflection angle of a pin-type coupler using a coupler deflection angle detection method according to an embodiment of the present invention.
[0047] Figure Labels
[0048] 1. Coupler fixing part; 2. Coupler rotating part. Detailed Implementation
[0049] To make the objectives, technical solutions, and advantages of this invention more readily understood, the invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that while many specific details are set forth in the following description to provide a thorough understanding of the invention, the invention can also be implemented in other ways different from those described herein. Those skilled in the art can make similar extensions without departing from the spirit of the invention; therefore, the invention is not limited to the specific embodiments disclosed below.
[0050] Secondly, the present invention is described in detail with reference to the schematic diagrams. When detailing the embodiments of the present invention, for ease of explanation, the cross-sectional views illustrating the device structure may be partially enlarged, not adhering to the usual scale. Furthermore, the schematic diagrams are merely examples and should not limit the scope of protection of the present invention. In addition, actual fabrication should include three-dimensional spatial dimensions of length, width, and depth.
[0051] Secondly, the phrase "an embodiment" or "an embodiment" in this application refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the invention. The phrases "in one embodiment" and "an embodiment" appearing in different places in this specification do not all refer to the same embodiment, nor are they embodiments that are mutually exclusive, either alone or selectively, with other embodiments. The terms "comprising" or "including" indicate the presence of the claimed feature but do not exclude the presence of one or more other features. The term "and / or" as used in this application includes any and all combinations of one or more of the related listed items.
[0052] This invention proposes a method for detecting the deflection angle of a coupler, see [link to relevant documentation]. Figure 1 It includes the following steps:
[0053] Acquire several images of couplers to be coupled, the images of couplers to be coupled include the fixed part of the coupler and the rotating part of the coupler;
[0054] Mark the first observation point on the fixed part of the coupler and mark the second observation point on the rotating part of the coupler;
[0055] Input the images of each coupler to be coupled into the trained coupler recognition model to identify the positions of the first and second observation points in the coupler images, as well as the positions of the first and second observation points when both the first and second observation points are located at the center line of the train (i.e., the coupler to be coupled is in the centering state). Output the coordinates (x1, y1) of the first observation point in the coupler image, the coordinates (x2, y2) of the second observation point in the coupler image, the coordinates (x1′, y1′) of the first observation point when both the first and second observation points are located at the center line of the train, and the coordinates (x2′, y2′) of the second observation point when both the first and second observation points are located at the center line of the train.
[0056] Calculate the coupler deflection angle in each coupler image to be coupled. The coupler deflection angle is the angle between the line connecting the first observation point and the second observation point in the coupler image to be coupled and the line connecting the first observation point and the second observation point when both are located at the center line of the train.
[0057] Specifically, the formula for calculating the coupler deflection angle θ in the image of the coupler to be coupled is:
[0058] Where k is the slope of the straight line connecting the first and second observation points in the image of the coupler to be coupled.
[0059] k0 is the slope of the straight line connecting the first and second observation points when both are located at the train centerline.
[0060] The maximum deflection angle of the coupler can be obtained by calculating the deflection angle of the coupler in each image of the coupler to be coupled.
[0061] The first observation point is the center point of the fixed part of the coupler, and the second observation point is the center point of the rotating part of the coupler. When the coupler is a pin-type coupler, the first observation point is the center point of the coupler body, and the second observation point is the center point of the coupler pin hole. Similarly, for different types of couplers, testers can mark observation points at different locations to accurately characterize the coupler deflection angle.
[0062] One embodiment of the coupler recognition model of the present invention is a residual neural network model, which includes convolutional layers, pooling layers, Flattening layers, and fully connected layers. See [link to relevant documentation]. Figure 2The system comprises several layers: convolutional layers extract features from the images of each coupler to be coupled, outputting feature maps; pooling layers reduce the dimensionality of the feature maps output by the convolutional layers; flattening layers convert the output data of the pooling layers into one-dimensional arrays; and fully connected layers summarize and map the features, mapping feature representations to labels on data samples, and outputting the positions of the first and second observation points in the images of the couplers to be coupled, as well as the positions of the first and second observation points when both are located at the train centerline. The pooling layers employ average pooling to reduce the dimensionality of the feature maps output by the convolutional layers. Each convolutional and pooling layer is followed by an activation function, such as Leaky ReLU, to introduce nonlinear factors, increase the model's fitting ability, and improve its generalization ability.
[0063] Before the coupler recognition model is put into use, it needs to be trained to obtain a residual neural network with high training accuracy as the coupler recognition model. The specific training process is as follows:
[0064] 1) Data annotation for each coupler image to be coupled: Mark the position of the first observation point on the fixed part of the coupler in each coupler image, mark the position of the second observation point on the rotating part of the coupler, and mark the position of the first and second observation points when both the first and second observation points are located at the center line of the train;
[0065] 2) Set the training parameters for the coupler recognition model. The training parameters include setting the loss function, optimization algorithm, maximum number of iterations, etc.
[0066] 3) Train the coupler recognition model using the labeled images of the couplers to be coupled;
[0067] 4) Calculate the loss function value based on the predicted positions of the first and second observation points and the pre-labeled positions of the first and second observation points. Iterate and update the parameters of the coupler recognition model based on the optimization algorithm until the loss function value converges or the preset maximum number of iterations is reached.
[0068] like Figure 3 As shown, taking the application of the above-mentioned coupler deflection angle detection method to the detection of the deflection angle of a pin-type coupler as an example, the method will be elaborated in detail:
[0069] 1. Collect images of the coupler to be coupled, and mark the first observation point A (center of the pin hole) on the fixed part of the coupler, and mark the second observation point B (center of the coupler body) on the rotating part of the coupler.
[0070] 2. Constructing a coupler recognition model based on a residual neural network. One embodiment of the residual neural network model of this invention is constructed based on the ResNet50 architecture, including 49 convolutional layers, 1 pooling layer, 1 Flatten layer, and 1 fully connected layer.
[0071] Specifically,
[0072] The first layer is a convolutional layer containing 64 kernels (7×7 in size) with a stride of 2.
[0073] The second layer is a maximum pooling layer with a window size of 3×3 and a step size of 2.
[0074] Layers 3 through 11 consist of one first residual block and two second residual blocks. The first residual block contains three convolutional layers: one with 64 kernels (1×1 size) and a stride of 1; one with 64 kernels (3×3 size) and a stride of 1; and one with 256 kernels (1×1 size) and a stride of 1. The second residual block also contains three convolutional layers: one with 64 kernels (1×1 size) and a stride of 1; one with 64 kernels (3×3 size) and a stride of 1; and one with 512 kernels (1×1 size) and a stride of 1.
[0075] Layers 12 through 23 consist of one third residual block and three fourth residual blocks. The third residual block contains three convolutional layers: one with 128 kernels (1×1 size) and a stride of 1; one with 128 kernels (3×3 size) and a stride of 2; and one with 512 kernels (1×1 size) and a stride of 1. The fourth residual block also contains three convolutional layers: one with 128 kernels (1×1 size) and a stride of 1; one with 128 kernels (3×3 size) and a stride of 1; and one with 512 kernels (1×1 size) and a stride of 1.
[0076] Layers 24 to 41 consist of one fifth residual block and five sixth residual blocks. The fifth residual block contains three convolutional layers: one with 256 kernels (1×1 size) and a stride of 1; one with 256 kernels (3×3 size) and a stride of 2; and one with 1024 kernels (1×1 size) and a stride of 1. The sixth residual blocks also contain three convolutional layers: one with 256 kernels (1×1 size) and a stride of 1; one with 256 kernels (3×3 size) and a stride of 1; and one with 1024 kernels (1×1 size) and a stride of 1.
[0077] Layers 42 to 50 consist of one seventh residual block and two eighth residual blocks. The seventh residual block contains three convolutional layers: one with 512 kernels (1×1 size) and a stride of 1; one with 512 kernels (3×3 size) and a stride of 2; and one with 2048 kernels (1×1 size) and a stride of 1. The eighth residual blocks also contain three convolutional layers: one with 512 kernels (1×1 size) and a stride of 1; one with 256 kernels (3×3 size) and a stride of 1; and one with 2048 kernels (1×1 size) and a stride of 1.
[0078] The 51st layer is the average pooling layer.
[0079] The 52nd layer is the Flatten layer, which converts 8×16×16 data into a vector of length 2048.
[0080] The 53rd layer is a fully connected layer with an output vector length of 4.
[0081] Each convolutional layer and pooling layer is followed by an activation function, Leaky ReLU, which is used to suppress nonlinearity and prevent neuron deactivation. The formula is: f(x) = max(ax,x), where a is the leakage coefficient and x is the input vector.
[0082] 3. Train the coupler recognition model using the labeled images of the couplers to be coupled: Set the training parameters of the coupler recognition model, including setting the loss function and optimizing the algorithm.
[0083] Specifically, the loss function L consists of the original loss L0, the regularization term L1, and the intensity scaling factor λ, and is formulated as: L = L0 + λL1. The original loss L0 is formulated as follows: Represents the true value, x i y i For the predicted value, the regularization term L1 formula is: ω j These are the model weight coefficients.
[0084] Then, based on the predicted positions of the first and second observation points and the pre-labeled positions of the first and second observation points, the loss function value is calculated. The model parameters are continuously updated iteratively using the adaptive momentum stochastic optimization method, and the loss function value is calculated until the loss function value converges or the preset number of iterations is reached.
[0085] 4. Input the real-time image of the coupler to be coupled into the trained coupler recognition model. After passing through each convolutional layer and pooling layer, the feature map is calculated by the activation function. Finally, after passing through the fully connected layer, the detection result is obtained.
[0086] Specifically, when using the residual neural network model based on the ResNet50 structure as the coupler recognition model, if the image size is 1×3×512×512, after extracting features through 49 convolutional layers, the output feature map size is 1×2048×16×16; after the pooling layer reduces the dimension of the feature map, the dimension becomes 1×8×16×16; then the Flatten layer converts the pooling layer output data into a one-dimensional array, i.e., 1×2048; finally, the fully connected layer outputs the position prediction result, which is a vector of length 4 (1×4), where the first and second values are the predicted coordinates of the first observation point A (pin hole center), and the third and fourth values are the predicted coordinates of the second observation point B (hook body center).
[0087] 5. Calculate the coupler deflection angle. The formula for calculating the coupler deflection angle θ is:
[0088] Where (x1, y1) are the coordinates of the first observation point A (pin hole center) in the image of the coupler to be coupled, (x2, y2) are the coordinates of the second observation point B (coupler center) in the image of the coupler to be coupled, (x1′, y1′) are the coordinates of the first observation point A (pin hole center) when both the first and second observation points are located at the center line of the train, and (x2′, y2′) are the coordinates of the second observation point B (coupler center) when both the first and second observation points are located at the center line of the train;
[0089] k represents the slope of the straight line connecting the first observation point A (center of the pin hole) and the second observation point B (center of the hook body) in the image of the coupler to be coupled.
[0090] k0 represents the slope of the straight line connecting the first observation point A (pin hole center) and the second observation point B (hook body center) when both the first and second observation points are located at the train centerline.
[0091] This invention also proposes a coupler deflection angle detection device to implement the coupler deflection angle detection method described above. The device includes an input module, a custom setting module, a coupler identification module, a coupler deflection angle calculation module, and an output module. The input module is used to input an image of the coupler to be coupled, which includes a fixed coupler portion and a rotating coupler portion. The custom setting module is used to mark a first observation point on the fixed coupler portion and a second observation point on the rotating coupler portion. The coupler identification module is used to identify the positions of the first and second observation points in the image of the coupler to be coupled, as well as the positions of the first and second observation points when both are located at the train centerline. The coupler deflection angle calculation module is used to calculate the coupler deflection angle based on the positions of the first and second observation points in the image of the coupler to be coupled, and the positions of the first and second observation points when both are located at the train centerline. The output module is used to output the coupler deflection angle.
[0092] Specifically, the coupler recognition module includes a feature extraction unit, a pooling unit, a data dimension conversion unit, and a position recognition unit. The feature extraction unit extracts features from each coupler image to be coupled and outputs a feature map. The pooling unit reduces the dimension of the feature map output by the feature extraction unit. The data dimension conversion unit converts the output data of the pooling unit into a one-dimensional array. The position recognition unit summarizes and maps the features, mapping the feature representations to labels on data samples, and outputs the positions of the first and second observation points in the coupler image to be coupled, as well as the positions of the first and second observation points when both are located at the train centerline.
[0093] It should be noted that, in this application, unless otherwise explicitly specified and limited, terms such as "connection" and "setup" should be interpreted broadly. For example, "connection" can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium; it can also refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances. Furthermore, the terms "first," "second," "third," "fourth," "fifth," "sixth," "seventh," and "eighth" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0094] The present invention has the following beneficial effects:
[0095] 1) This invention learns and extracts complex features from a large amount of data through a residual neural network, thereby enabling accurate measurement of the coupler deflection angle with good robustness.
[0096] 2) This invention can accurately identify coupler images of different shapes, sizes and backgrounds, and has a strong generalization ability.
[0097] 3) This invention can realize the automated measurement of coupler deflection angle without manual intervention, which greatly improves measurement efficiency.
[0098] Although the methods described above are illustrated and depicted as a series of actions for the sake of simplicity, it should be understood and appreciated that these methods are not limited by the order of the actions, as some actions may occur in a different order and / or concurrently with other actions from the illustrations and descriptions herein or not illustrated and described herein but which may be understood by those skilled in the art, according to one or more embodiments.
[0099] The constructions and arrangements of this application shown in several different exemplary embodiments are merely illustrative. Although only a few embodiments are described in detail in this disclosure, those who consult this disclosure will readily understand that many modifications are possible (e.g., changes in size, structure, shape, and proportions, as well as parameter values, installation arrangements, use of materials, color, orientation, etc.) without substantially departing from the novel teachings and advantages of the subject matter described in this application. For example, an element shown as integrally formed may be composed of multiple parts or elements, the position of the elements may be inverted or otherwise changed, and the nature or number or position of discrete elements may be altered or changed. Therefore, all such modifications are intended to be included within the scope of this invention. The order or sequence of any process or method steps may be changed or rearranged according to alternative embodiments. In the claims, any "device plus function" clause is intended to cover the structure described herein that performs the function, and not only structural equivalents but also equivalent structures. Various corresponding modifications and variations can be made by those skilled in the art according to this invention without departing from the spirit and essence of the invention, but such corresponding modifications and variations should fall within the protection scope of this invention.
Claims
1. A method for detecting the deflection angle of a coupler, characterized in that, Includes the following steps: Acquire several images of couplers to be coupled, the images of couplers to be coupled include the fixed part of the coupler and the rotating part of the coupler; Mark the first observation point on the fixed part of the coupler and mark the second observation point on the rotating part of the coupler; Input the images of each coupler to be coupled into the trained coupler recognition model to identify the positions of the first and second observation points in the coupler images, as well as the positions of the first and second observation points when both are located at the center line of the train. Calculate the coupler deflection angle in each coupler image to be coupled. The coupler deflection angle is the angle between the line connecting the first observation point and the second observation point in the coupler image to be coupled and the line connecting the first observation point and the second observation point when both are located at the center line of the train.
2. The method for detecting the deflection angle of the coupler according to claim 1, characterized in that, The first observation point is the center point on the fixed part of the coupler, and the second observation point is the center point on the rotating part of the coupler.
3. The method for detecting the deflection angle of the coupler according to claim 1, characterized in that, The coupler recognition model is a residual neural network model, which includes convolutional layers, pooling layers, flattening layers, and fully connected layers. The convolutional layer is used to extract features from each image of the coupler to be coupled and output a feature map. The pooling layer is used to reduce the dimension of the feature map output by the convolutional layer; The Flatten layer is used to convert the output data of the pooling layer into a one-dimensional array; The fully connected layer is used to summarize and map features, and output the positions of the first and second observation points in the image of the coupler to be coupled, as well as the positions of the first and second observation points when both are located at the center line of the train.
4. The method for detecting the deflection angle of the coupler according to claim 3, characterized in that, The pooling layer uses average pooling to reduce the dimensionality of the output feature map of the convolutional layer.
5. The method for detecting the deflection angle of the coupler according to claim 3, characterized in that, The residual neural network model is built on the ResNet50 architecture and includes 49 convolutional layers, 1 pooling layer, 1 Flatten layer, and 1 fully connected layer.
6. The method for detecting the deflection angle of the coupler according to claim 5, characterized in that, Each convolutional layer and pooling layer is followed by an activation function, which is used to introduce nonlinear factors.
7. The method for detecting the deflection angle of the coupler according to claim 1, characterized in that, The process of training the coupler recognition model includes: Data annotation is performed on each image of a coupler to be coupled: the position of the first observation point is marked on the fixed part of the coupler in each image of a coupler to be coupled, the position of the second observation point is marked on the rotating part of the coupler, and the positions of the first and second observation points are marked when both the first and second observation points are located at the center line of the train. Set the training parameters for the coupler recognition model, including setting the loss function and the optimization algorithm; The coupler recognition model is trained using labeled images of the couplers to be coupled. The loss function value is calculated based on the predicted positions of the first and second observation points and the pre-labeled positions of the first and second observation points. The parameters of the coupler recognition model are iteratively updated based on the optimization algorithm until the loss function value converges or the preset number of iterations is reached.
8. The method for detecting the deflection angle of the coupler according to claim 1, characterized in that, The process involves inputting images of each coupler to be coupled into a trained coupler recognition model to identify the positions of the first and second observation points in the coupler images, as well as the positions of the first and second observation points when both are located on the train centerline. The model outputs the coordinates (x1, y1) of the first observation point in the coupler images, the coordinates (x2, y2) of the second observation point in the coupler images, the coordinates (x1′, y1′) of the first observation point when both are located on the train centerline, and the coordinates (x2′, y2′) of the second observation point when both are located on the train centerline. The formula for calculating the coupler deflection angle θ in the image of the coupler to be coupled is: Where k is the slope of the straight line connecting the first and second observation points in the image of the coupler to be coupled. k0 is the slope of the straight line connecting the first and second observation points when both are located at the train centerline.
9. A coupler deflection angle detection device, characterized in that, The method for detecting the deflection angle of the coupler as described in any one of claims 1-8 includes: The input module is used to input an image of the coupler to be coupled, which includes a fixed part of the coupler and a rotating part of the coupler. A custom setting module is used to mark a first observation point on the fixed part of the coupler and a second observation point on the rotating part of the coupler; The coupler recognition module is used to identify the positions of the first observation point and the second observation point in the image of the coupler to be coupled, as well as the positions of the first observation point and the second observation point when both are located at the center line of the train. The coupler deflection angle calculation module is used to calculate the coupler deflection angle based on the positions of the first observation point and the second observation point in the image of the coupler to be coupled, and when both the first observation point and the second observation point are located at the center line of the train. The output module is used to output the coupler deflection angle.
10. The coupler deflection angle detection device according to claim 9, characterized in that, The coupler recognition module includes a feature extraction unit, a pooling unit, a data dimension conversion unit, and a position recognition unit; The feature extraction unit is used to extract features from the images of each coupler to be coupled and output a feature map. The pooling unit is used to reduce the dimension of the feature map output by the feature extraction unit; The data dimension conversion unit is used to convert the output data of the pooling unit into a one-dimensional array; The position recognition unit is used to summarize and map features, and output the positions of the first observation point and the second observation point in the image of the coupler to be coupled, as well as the positions of the first observation point and the second observation point when both are located at the center line of the train.