Train brake chain state identification method, device, equipment, and storage medium
Computer vision processing technology is used to automatically identify the status of train brake chains, solving the problem of low efficiency of manual inspections and improving train operating efficiency and safety.
Patent Information
- Application Number
- CN202011583368.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-28
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2040-12-28
AI Technical Summary
In the existing technology, the status inspection of train brake chains relies on manual inspection, which is inefficient and affects the efficiency and safety of train operation.
Computer vision processing technology is used to automatically identify the slack state of the train brake chain through image collection, feature extraction and prediction model processing, including image data collection, feature extraction, prediction model input, coordinate calculation and deduplication processing to determine the brake chain status.
It realizes the automatic identification of the train brake chain status, reduces the need for manual inspection, and improves the efficiency and safety of train operation.
Smart Images

Figure CN114758150B
Abstract
Description
Technical Field
[0001] The present application relates to the field of intelligent rail transit technology, and in particular to a method and device, equipment, and storage medium for identifying the state of a train brake chain. Background Art
[0002] As an important technology in the field of intelligent rail transit, computer vision processing technology has received more and more attention. Computer vision processing technology uses various imaging systems to replace visual senses as the input means of visual information, and computers replace the brain to complete processing and interpretation. Computer vision processing technology not only enables machines to perceive geometric information in the environment (for example, position, size, shape, movement, etc.), but also describes, interprets and understands this information. Therefore, computer vision processing technology can provide an intuitive and convenient analysis method for the field of intelligent rail transit.
[0003] Before the train runs, it is necessary to ensure that the brake chains between the carriages are in a relaxed state to avoid accidents during the operation of the train. When the brake chain is in a tight state, the carriages are in a brake state, and the train cannot start running at this time; when the brake chain is in a relaxed state, the carriages are in a normal state, and the train can start running. At present, the brake chains of each carriage are checked by manual inspection. This traditional method not only consumes manpower and is inefficient, but also seriously prolongs the departure time of the train, thereby affecting the operating efficiency of the entire rail transit. Summary of the invention
[0004] In order to solve the above technical problems or at least partially solve the above technical problems, the present application provides a method and device, equipment, and storage medium for identifying the state of a train brake chain.
[0005] In a first aspect, the present application provides a method for identifying the state of a train brake chain, comprising: collecting image data of the train brake chain;
[0006] Extracting features from the image data to obtain feature maps of multiple sizes;
[0007] Inputting each size of the feature map into the corresponding prediction model to obtain corresponding prediction data, the prediction data including first prediction data and second prediction data, the first prediction data including the classification probability of the brake chain corresponding to each pixel point in the feature map, and the second prediction data including the predicted coordinate offsets of multiple preset key points on the brake chain corresponding to the pixel point;
[0008] According to the classification probability and the predicted coordinate offset output by each prediction model, determine candidate predicted coordinates corresponding to a plurality of preset key points on the brake chain in the image data under the prediction model;
[0009] Deduplication processing is performed on candidate prediction coordinates corresponding to multiple preset key points on the brake chain in the image data under each prediction model to obtain optimal prediction coordinates corresponding to multiple preset key points on the brake chain in the image data;
[0010] The state of the brake chain in the image data is determined according to the optimal predicted coordinates corresponding to a plurality of preset key points on the brake chain in the image data.
[0011] In a second aspect, the present application provides a train brake chain state recognition device, comprising: an image acquisition module, for acquiring image data of the train brake chain;
[0012] A feature extraction module, used to extract features from the image data to obtain feature maps of multiple different sizes;
[0013] A model prediction model is used to input the feature map of each size into the corresponding prediction model to obtain corresponding prediction data, wherein the prediction data includes first prediction data and second prediction data, wherein the first prediction data includes the classification probability of the brake chain corresponding to each pixel point in the feature map, and the second prediction data includes the predicted coordinate offsets of multiple preset key points on the brake chain corresponding to the pixel point;
[0014] A coordinate calculation module, for determining candidate prediction coordinates corresponding to a plurality of preset key points on the brake chain in the image data under the prediction model according to the classification probability and the prediction coordinate offset output by each prediction model;
[0015] A chain deduplication module, used for deduplicating candidate prediction coordinates corresponding to multiple preset key points on the brake chain in the image data under each prediction model, to obtain the optimal prediction coordinates corresponding to multiple preset key points on the brake chain in the image data;
[0016] The state determination module is used to determine the state of the brake chain in the image data according to the optimal predicted coordinates corresponding to multiple preset key points on the brake chain in the image data.
[0017] In a third aspect, the present application provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.
[0018] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the above method when executed by a processor.
[0019] The state recognition method of the train brake chain provided in the present embodiment obtains feature graphs of various sizes after feature extraction of image data, and inputs the feature graphs of each size into the corresponding prediction model. It can be seen that in order to be applicable to brake chains of different sizes in the image data, the present application processes the image data into feature graphs of different sizes, and then processes them with the corresponding prediction model, thereby obtaining a variety of candidate prediction targets, selecting the optimal prediction target from the multiple candidate prediction targets, and improving the recognition accuracy of the brake chain state. Moreover, the present application realizes automatic recognition of the brake chain state based on the prediction model, does not require manual inspection, saves heavy and inefficient work, can effectively improve the operation efficiency of the train, and ensures the safety of the train operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0021] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0022] Figure 1 A flow chart of a method for identifying the state of a train brake chain provided in an embodiment of the present application;
[0023] Figure 2 Schematic diagram of the process of extracting features from the image data in an embodiment of the present application;
[0024] Figure 3 A schematic flow chart of an example of extracting features from the image data and outputting prediction data using a prediction model in an embodiment of the present application;
[0025] Figure 4 A schematic diagram of multiple key points selected on the brake chain in an embodiment of the present application;
[0026] Figure 5a This is a flow chart of step S140 in the embodiment of the present application;
[0027] Figure 5b This is a flow chart of step S142 in the embodiment of the present application;
[0028] Figure 6aA schematic diagram of a process for determining a priori chain width in an embodiment of the present application;
[0029] Figure 6b A schematic diagram of a process for determining a priori chain slack in an embodiment of the present application;
[0030] Figure 7 This is a flow chart of step S150 in the embodiment of the present application;
[0031] Figure 8 This is a flow chart of step S160 in the embodiment of the present application;
[0032] Fig. 9 Schematic diagram of the process of extracting positive samples in the embodiment of the present application;
[0033] Fig.10 This is a structural block diagram of a train brake chain status recognition device in an embodiment of the present application. DETAILED DESCRIPTION
[0034] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0035] Figure 1 A method for identifying the state of a train brake chain is provided in an embodiment of the present application, such as Figure 1 As shown, the method comprises the following steps:
[0036] S110, collecting image data of a train brake chain;
[0037] In specific implementation, a high-definition camera can be set up next to the train track, and the image containing the train brake chain can be captured by the high-definition camera, and then the image data can be collected from the high-definition camera.
[0038] It is understandable that the training samples adopted in the pre-training process of the prediction model used in the subsequent steps can also be images collected from a high-definition camera next to the train track, and the images are marked, specifically, the coordinates of multiple key points of the brake chain, whether the brake chain is in a loose or tight state, and other information can be marked.
[0039] S120, extracting features from the image data to obtain feature maps of multiple sizes;
[0040] It is understandable that the size may include multiple sizes such as 13*13, 26*26, 52*52, etc. For example, in this step, feature maps of four sizes are extracted, and four prediction models are required in the subsequent steps, and feature maps of one size are input into a corresponding prediction model.
[0041] In the specific implementation, it is assumed that the size of the feature map is N, and N is an integer greater than or equal to 2, such as Figure 2 As shown, the process of extracting features from the image data in step S120 may include the following steps:
[0042] S121, performing multiple downsampling processes on the image data to obtain a first feature map, where the size of the first feature map is a first size;
[0043] In specific implementation, a convolution module and / or a bottleneck module (i.e., a bottleneck module) may be used for feature extraction. Each extraction method has different advantages. The bottleneck module has low computational complexity and can improve the operating efficiency of the entire method flow.
[0044] For example, see Figure 3 , the input image of size 416x416 is downsampled 5 times to obtain the first feature map of size 13x13. After each downsampling, the size of the image becomes smaller. The image size after the first downsampling (i.e. conv2d_3x3(208x208) in the figure) is 208x208, the image size after the second downsampling (i.e. bottleneck(104x104) in the figure) is 104x104, the image size after the third downsampling (bottleneck(52x52) in the figure) is 52x52, the image size after the fourth downsampling (bottleneck(26x26) in the figure) is 26x26, and the image size after the fifth downsampling (bottleneck(13x13) in the figure) is 13x13.
[0045] S122. Based on the first feature map, determine any feature map from the second feature map to the Nth feature map; wherein the process of determining the i-th feature map includes: upsampling the i-1th feature map to obtain a feature map of an i-th size; concatenating the feature map of the i-th size with the feature map of the i-th size generated in the multiple downsampling processes to obtain the i-th feature map, the i-th feature map is of the i-th size, the larger i is, the larger the i-th size is; i is an integer greater than or equal to 2 and less than or equal to N.
[0046] For example, see Figure 3, N is 3, and the image of size 416x416 is subjected to one feature extraction by the convolution module (the convolution kernel size is 3x3) and four feature extractions by the bottleneck module to obtain the first feature map of size 13x13. Then the first feature map is upsampled to obtain a feature map of size 26x26, and then the feature map is spliced with the feature map of size 26x26 obtained after the third downsampling process of the bottleneck module to obtain the second feature map. The second feature map is upsampled to obtain a feature map of size 52x52, and the feature map is spliced with the feature map of size 52x52 obtained after the second downsampling process of the bottleneck module to obtain the third feature map. So far, feature maps of three sizes are obtained: the first feature map of size 13x13, the second feature map of size 26x26, and the third feature map of size 52x52. Of course, before each upsampling process, the feature map can be subjected to a certain convolution process to optimize the feature map.
[0047] S130, inputting the feature map of each size into the corresponding prediction model to obtain corresponding prediction data, wherein the prediction data includes first prediction data and second prediction data, wherein the first prediction data includes the classification probability of the brake chain corresponding to each pixel point in the feature map, and the second prediction data includes the predicted coordinate offsets of multiple preset key points on the brake chain corresponding to the pixel point;
[0048] The number of the prediction models is the same as the size and type of the feature maps;
[0049] For example, Figure 3 As shown, N is 3, the first feature map is input into the first prediction model, the second feature map is input into the second prediction model, and the third feature map is input into the third prediction model, and each prediction model outputs prediction data.
[0050] In specific implementation, multiple preset key points can be selected according to specific circumstances, for example, Figure 4 In the figure, select one endpoint A of the arc-shaped brake chain AB, the other endpoint B, and the intersection point D of the perpendicular bisector of the straight segment AB between the two endpoints and the brake chain. Point C in the figure is the midpoint of the straight segment AB, and the straight segment AB is perpendicular to the straight segment CD. Point E is the midpoint of the straight segment CD. Since the brake chain is an arc, point E is also the center of the smallest circumscribed rectangle of the brake chain, so point E can be used as an anchor point. The so-called anchor point is a point that can represent the entire chain. When the image data is continuously extracted for features, the entire chain will be reduced to one pixel or several pixels in the feature map. At this time, the center of this pixel or these pixels is used as the anchor point to represent the entire chain.
[0051] S140, determining candidate prediction coordinates corresponding to a plurality of preset key points on the brake chain in the image data under the prediction model according to the classification probability and the prediction coordinate offset output by each prediction model;
[0052] It is understandable that each pixel in the feature map represents the corresponding multiple pixels in the image data. In an image data, some pixels are pixels of the brake chain, and some pixels are pixels of other things. Each pixel in the feature map has a corresponding classification probability. If the classification probability corresponding to a pixel in the feature map is high, it means that the probability that the corresponding multiple pixels in the image data are pixels of the brake chain is very high; if the classification probability corresponding to a pixel in the feature map is low, it means that the corresponding multiple pixels in the image data are likely to be pixels of other things. For example, in a feature map, the classification probabilities corresponding to the four pixels at the intersection of the tenth and eleventh rows and the third and fourth columns are all greater than 80%, indicating that the multiple pixels corresponding to these four pixels in the image data are pixels of the brake chain, and the remaining pixels are not related to the brake chain. It can be seen that the position of the brake chain in the image data can be determined by the size of the classification probability in the feature map.
[0053] It can be understood that, in addition to corresponding to the classification probability, each pixel point in the feature map also corresponds to the predicted coordinate offset of multiple preset key points. Therefore, after determining the position of the brake chain in the image data based on the classification probability, the coordinates of multiple key points in the image data can be determined based on the predicted coordinate offsets of multiple preset key points.
[0054] Based on the above understanding, if Figure 5a As shown, step S140 may include the following steps:
[0055] S141, according to the classification probability output by each prediction model, determining the coordinates of the pixel points corresponding to the brake chain in the image data under the prediction model;
[0056] It is understandable that step S141 is the process of determining the position of the brake chain in the image data. The coordinates of the corresponding pixel points of the brake chain in the image data can be the centers of the multiple pixel points in the image data corresponding to the centers of the pixel points in the feature map whose classification probability is greater than the preset probability value, that is, the coordinates of the anchor point of the brake chain in the image data, so the coordinates determined in step S141 are the coordinates of the anchor point in the image data.
[0057] S142. Determine candidate prediction coordinates corresponding to multiple preset key points on the brake chain in the image data under the prediction model according to the coordinates of the corresponding pixel points of the brake chain in the image data under the prediction model and the prediction coordinate offsets of the multiple preset key points.
[0058] The predicted coordinate offset of the key point is the coordinate offset of the key point relative to the anchor point.
[0059] It can be understood that step S142 is the process of determining the coordinates of multiple key points in the image data. Here, the coordinates of multiple key points in the image data are calculated based on the prediction data output by each prediction model, and the coordinates are called candidate prediction coordinates under the prediction model.
[0060] In specific implementation, since the brake chain state includes a relaxed state and a tight state, in order to improve the recognition accuracy of the brake chain state, two states can be set for each prediction model: a relaxed state and a tight state, that is, each prediction model can output prediction data for these two states respectively, that is, a prediction model can output prediction data in a relaxed state and prediction data in a tight state, and the prediction data in each state includes the classification probability of each pixel point in the feature map as a brake chain and the predicted coordinate offsets of multiple preset key points on the brake chain corresponding to the pixel point, that is, the prediction data output by each prediction model includes the first prediction data and the second prediction data under each prior chain slack. For example, after the first feature map with a size of 13x13 is input into the first prediction model, the prediction data in the relaxed state (size of 13x13x7) and the prediction data in the tight state (size of 13x13x7) are obtained, and each pixel point in the feature map in each state corresponds to 7 values, and these 7 values can include 1 classification probability and 6 coordinate offsets (including the horizontal coordinate offset and the vertical coordinate offset of each of the three key points).
[0061] For the setting that a prediction model can output prediction data under two brake chain states, one pixel in the feature map corresponds to two classification probabilities, and the larger classification probability can be selected to determine whether the pixel in the feature map corresponds to the pixel of the brake chain in the image data, that is, when the larger classification probability of the two classification probabilities of a pixel in the feature map is very high, it means that the probability that the multiple pixels corresponding to the pixel in the image data are brake chains is very high. At this time, the brake chain state corresponding to the larger classification probability is used as the brake chain state of the corresponding multiple pixels in the image data, that is, the brake chain state corresponding to the larger classification probability is used as the state of the brake chain in the image data. When the larger classification probability of the two classification probabilities of a pixel in the feature map is very low, it means that the multiple pixels corresponding to the pixel in the image data are pixels of other things. It can be seen that in step S141, when determining the coordinates of the corresponding pixel of the brake chain in the image data under a prediction model (i.e. determining the position of the brake chain in the image data), the larger classification probability of the two classification probabilities corresponding to a pixel under the prediction model is used as the basis.
[0062] Based on the above understanding, see Figure 5b , step S142 may specifically include: determining the candidate prediction coordinates corresponding to the multiple preset key points on the brake chain in the image data under the prediction model according to the prior chain width pre-set for the prediction model, the prior chain slack corresponding to the larger classification probability, the prediction coordinate offsets of the multiple preset key points under the prior chain slack corresponding to the larger classification probability, and the coordinates of the corresponding pixel points of the brake chain in the image data under the prediction model.
[0063] Among them, the priori chain width is the priori value of the shortest distance between one end point and the other end point of the train brake chain, and the priori chain width corresponds to the prediction model one by one; the priori chain slack is the priori value that characterizes the degree of slack of the brake chain, and the priori chain slack preset for each prediction model includes a first priori chain slack corresponding to the slack state and a second priori chain slack corresponding to the taut state. For example, when the above-mentioned points A, B and D are used as the key points of the brake chain, the chain slack can be the ratio of the median segment length CD and the chain width AB.
[0064] Among them, the smaller the size of the feature map corresponding to a prediction model is, the larger the prior chain width pre-set for the prediction model can be.
[0065] It can be understood that the shortest distance between two points is the length of the straight line segment formed by the two points.
[0066] The larger classification probability is, for the same pixel point, a larger value of the classification probability corresponding to the first priori chain relaxation and the classification probability corresponding to the second priori chain relaxation.
[0067] For example, a pixel in the feature map has a classification probability of 60% in the two states, which corresponds to the first prior chain relaxation, and another classification probability of 90%, which corresponds to the second prior chain relaxation. Since 90% is very high, this pixel in the feature map corresponds to Figure 4 The prior chain slack corresponding to the larger classification probability when calculating the candidate prediction coordinates in step S142 is the second prior chain slack. Figure 4 All pixels of the brake chain generally correspond to the second prior chain slack.
[0068] In specific implementation, if endpoint A is selected as a key point, step S142 may use a first formula to calculate candidate prediction coordinates corresponding to an endpoint on the brake chain in the image data under a prediction model, wherein the first formula includes:
[0069] x A =x c -w×sigmoid(t xA )
[0070] y A =y c -w×s×sigmoid(t yA )
[0071] In the formula, (x A ,y A ) is the candidate predicted coordinate corresponding to an endpoint A on the brake chain in the image data, (x c ,y c ) is the coordinate of the corresponding pixel point of the brake chain in the image data, (t xA , t yA ) is the predicted coordinate offset of an endpoint A on the brake chain under the prior chain slack corresponding to the larger classification probability, w is the prior chain width corresponding to the prediction model, and s is the prior chain slack corresponding to the larger classification probability;
[0072] In specific implementation, if endpoint B is selected as another key point, step S142 may use a second formula to calculate the candidate prediction coordinates corresponding to another endpoint on the brake chain in the image data under a prediction model, and the second formula includes:
[0073] x B =x c+w×sigmoid(t xB )
[0074] y B =y c -w×s×sigmoid(t yB )
[0075] In the formula, (x B ,y B ) is the candidate predicted coordinate corresponding to the other end point B on the brake chain in the image data, (t xB , t yB ) is the predicted coordinate offset of the other end point B on the brake chain under the a priori chain slack corresponding to the larger classification probability;
[0076] In a specific implementation, if the intersection point D is selected as the third key point, step S142 may use a third formula to calculate the candidate prediction coordinates corresponding to the intersection point in the image data under a prediction model, and the third formula includes:
[0077] x D =x c +w×(sigmoid(t xD )-0.5)
[0078] y D =y c +w×s×sigmoid(t yD )
[0079] In the formula, ( xD ,y D ) is the candidate prediction coordinate corresponding to the intersection point D in the image data, (t xD , t yD ) is the predicted coordinate offset of the intersection point D under the prior chain relaxation corresponding to the larger classification probability.
[0080] In a specific implementation, the a priori chain width is predetermined, such as Figure 6a As shown, the specific determination process may include:
[0081] S001a, calculating the chain width corresponding to each training sample according to the coordinates of a plurality of preset key points in each training sample used to train the prediction model;
[0082] S002a. Clustering the chain widths corresponding to all training samples used to train the prediction model to obtain a priori chain widths consistent with the number of the prediction models.
[0083] Among them, the clustering method can adopt K-means clustering.
[0084] For example, if there are three prediction models, clustering is required to obtain three prior chain widths: w1, w2, and w3, where w1 is the largest and w3 is the smallest. w1 is assigned to the first prediction model corresponding to the first feature map of size 13x13, w2 is assigned to the second prediction model corresponding to the second feature map of size 26x26, and w3 is assigned to the third prediction model corresponding to the third feature map of size 52x52. Since the first feature map has the smallest size, a larger upsampling is required to restore it to the size of the image data, so the largest prior chain width is assigned to the first prediction model; the third feature map has the largest size, and a smaller upsampling is required to restore it to the size of the image data, so the smallest prior chain width is assigned to the third prediction model.
[0085] In a specific implementation, the a priori chain slack is also predetermined, such as Figure 6b As shown, the specific determination process may include:
[0086] S001b, calculating the chain slack corresponding to each training sample according to the coordinates of a plurality of preset key points in each training sample used to train the prediction model;
[0087] S002b. Clustering the chain relaxations corresponding to all training samples used to train the prediction model to obtain the first a priori chain relaxation and the second a priori chain relaxation.
[0088] The clustering method may also be K-means clustering.
[0089] It is understandable that, since the coordinates of each key point are marked in the training sample, the chain slack and chain width corresponding to each training sample can be calculated according to the marking information.
[0090] For example, the distribution of prior chain width and prior chain slack is shown in Table 1 below:
[0091] Table 1 Distribution table of prior chain width and prior chain slack
[0092]
[0093] In the above table, s1 is the first prior chain slack, and s2 is the second prior chain slack.
[0094] S150, performing deduplication processing on candidate prediction coordinates corresponding to the multiple preset key points on the brake chain in the image data under each prediction model to obtain optimal prediction coordinates corresponding to the multiple preset key points on the brake chain in the image data;
[0095] It is understandable that, based on each prediction model, corresponding candidate prediction coordinates can be obtained, and the problem solved by step S150 is to determine which prediction model is used as the optimal prediction coordinates. For example, N = 3, based on the first prediction model, the candidate prediction coordinates of multiple key points are obtained to form a first prediction coordinate set G1 = {(x1, y1), (x2, y2) ...}, based on the second prediction model, the candidate prediction coordinates of multiple key points are obtained to form a second prediction coordinate set G2 = {(x1, y1), (x2, y2) ...}, based on the third prediction model, the candidate prediction coordinates of multiple key points are obtained to form a third prediction coordinate set G3 = {(x1, y1), (x2, y2) ...}, and one prediction coordinate set needs to be selected as the optimal prediction coordinate set.
[0096] In specific implementation, Figure 7 As shown, the deduplication process in step S150 may include: for any two prediction models, determining whether any key point under one prediction model is within the area formed by multiple preset key points under another prediction model; if so, taking the candidate prediction coordinates corresponding to the larger classification probability as the optimal prediction coordinates.
[0097] For example, endpoints A, B and intersection D are selected as key points. For the first prediction model and the second prediction model, if any key point (A, B, or D) in the first prediction coordinate set G1 is located in the triangular area formed by the three key points in the second prediction coordinate set G2, it is considered that the first prediction coordinate set G1 and the second prediction coordinate set G2 correspond to the same brake chain. At this time, the candidate prediction coordinates corresponding to the larger classification probability (for example, the first prediction coordinate set G1) are retained and used as the optimal prediction coordinates, and the prediction data corresponding to the smaller classification probability are deleted.
[0098] It is understandable that when using a high-definition camera to capture images containing brake chains, some brake chains are relatively close to the high-definition camera, so the brake chains are relatively large in the image data; while some brake chains are relatively far from the high-definition camera, so the brake chains are relatively small in the image data. If various image data are processed into feature maps of only one size and predicted using one prediction model, the prediction coordinates of some image data will have large errors, affecting the recognition accuracy of the brake chain status. In order to be applicable to brake chains of different sizes in the image data, the image data is processed into feature maps of different sizes, and then processed using the corresponding prediction model, thereby obtaining a variety of candidate prediction targets, selecting the optimal prediction target from the multiple candidate prediction targets, and improving the recognition accuracy of the brake chain status.
[0099] S160: Determine the state of the brake chain in the image data according to the optimal predicted coordinates corresponding to a plurality of preset key points on the brake chain in the image data.
[0100] In specific implementation, when the endpoints A and B and the intersection point D are used as key points, step S160 may specifically include the following steps: Figure 8 Steps shown:
[0101] S161, calculating the chain slack in the image data according to the optimal predicted coordinates corresponding to the two end points and the intersection point on the brake chain in the image data, wherein the chain slack is the ratio of the length of the midline segment to the width of the chain;
[0102] The chain width is the shortest distance |AB| between the two endpoints of the brake chain in the image data, and the perpendicular bisector segment length is the shortest distance |CD| between the midpoint of the straight line segment between the two endpoints and the intersection in the image data.
[0103] S162: Determine whether the ratio is greater than a preset ratio threshold value; if so, the brake chain state in the image data is a loose state.
[0104] It is understandable that if the ratio |CD| / |AB| is less than or equal to the preset ratio threshold, the brake chain state in the image data is in a tight state.
[0105] In the specific implementation, the prediction model is pre-trained, see Figure 3 The specific structure of the prediction model may include two convolution modules. For example, the size of the convolution kernel of one convolution module is 3x3, and the size of the convolution kernel of another convolution module is 1x1. During the training process of the prediction model, the loss value of the prediction model may be calculated according to the loss function, and then the various parameters in the prediction model may be adjusted according to the loss value. The specific loss function may include:
[0106]
[0107] Where, L total is the total loss of the prediction model, is the preset balance parameter, N cls is the number of all training samples required to train the prediction model, L cls () is the classification loss function, y i and are the brake chain status pre-labeled for the i-th training sample and the classification probability output after the i-th training sample is input into the prediction model, N reg is the number of positive samples in all the training samples, L reg () is the regression loss function, tpi and are respectively the true coordinates of the key point P in the i-th training sample and the predicted coordinates output after the i-th training sample is input into the prediction model.
[0108] It is understandable that the brake chain state y i Including 0 (tight state) and 1 (relaxed state). If two prior chain relaxations are set for each prediction model, each prediction model needs to be trained separately for the two prior chain relaxations, so as to output prediction data for the two prior chain relaxations respectively. Therefore, for each prior chain relaxation, the prediction module can adjust the parameters in the prediction model according to the above loss function.
[0109] In the above loss function, positive samples are mentioned. The selection process of positive samples is as follows: Fig. 9 As shown, the following steps may be included:
[0110] S010, according to each prior chain slack, the prior chain width corresponding to the prediction model and the coordinates of an anchor point in a training sample, calculating the coordinates of a plurality of preset key points in the training sample under the prior chain slack, wherein the anchor point is the center of the minimum circumscribed rectangle of the brake chain;
[0111] For example, for a training sample, the key points are the two endpoints A and B and the intersection D. A priori chain slack s and a priori chain width |AB| are set for this training sample, and s is |CD| / |AB|. Therefore, according to s and |AB|, |CD| can be determined. When the coordinates of the midpoint of CD, that is, the anchor point, are known, the coordinates of the three key points can be determined according to the anchor point coordinates, |CD|, and |AB|.
[0112] S020, determining the sum of the distances between the calculated coordinates of the plurality of preset key points in the training sample under the priori chain slack and the real coordinates of the plurality of preset key points in the training sample;
[0113] For example, calculate the shortest distance d1 between the coordinates of point A calculated in step S010 and the true coordinates of point A in the training sample, the shortest distance d2 between the coordinates of point B calculated in step S010 and the true coordinates of point B in the training sample, and the shortest distance d3 between the coordinates of point D calculated in step S010 and the true coordinates of point D in the training sample, and then calculate the sum of distances d1, d2, and d3.
[0114] It can be understood that the sum of distances can be used to represent the overlap between the rectangular box determined based on the prior chain slack, the prior chain width and the anchor point coordinates (i.e., the minimum circumscribed rectangle of the brake chain) and the true rectangular box of the training sample. The smaller the sum of distances, the higher the overlap, and the larger the sum of distances, the lower the overlap.
[0115] S030. Determine whether the sum of the distances is less than a preset distance threshold. If so, use the training sample as a positive sample corresponding to the prior chain slack.
[0116] It is understandable that when the sum of the distances is small, the overlap is high, and the training sample is taken as a positive sample corresponding to the prior chain relaxation.
[0117] In a specific implementation, the above-mentioned preset distance threshold is called the first distance threshold, and a second distance threshold greater than the first distance threshold is set. When the sum of the distances is greater than the second distance threshold, the training sample can be used as a negative sample corresponding to the prior chain slack. If the sum of the distances is between the first distance threshold and the second distance threshold, the training sample is ignored.
[0118] Through the above steps S010 to S030, the positive samples and negative samples corresponding to each prior chain relaxation can be determined, and then used for calculating the above loss function.
[0119] The state recognition method of the train brake chain provided in the present embodiment obtains feature graphs of various sizes after feature extraction of image data, and inputs the feature graphs of each size into the corresponding prediction model. It can be seen that in order to be applicable to brake chains of different sizes in the image data, the present application processes the image data into feature graphs of different sizes, and then processes them with the corresponding prediction model, thereby obtaining a variety of candidate prediction targets, selecting the optimal prediction target from the multiple candidate prediction targets, and improving the recognition accuracy of the brake chain state. Moreover, the present application realizes automatic recognition of the brake chain state based on the prediction model, does not require manual inspection, saves heavy and inefficient work, can effectively improve the operation efficiency of the train, and ensures the safety of the train operation.
[0120] like Fig.10 As shown, the embodiment of the present application provides a train brake chain state recognition device, which may specifically include:
[0121] An image acquisition module 110 is used to acquire image data of a train brake chain;
[0122] A feature extraction module 120 is used to extract features from the image data to obtain feature maps of multiple sizes;
[0123] A model prediction model 130 is used to input the feature map of each size into the corresponding prediction model to obtain corresponding prediction data, wherein the prediction data includes first prediction data and second prediction data, wherein the first prediction data includes the classification probability of the brake chain corresponding to each pixel point in the feature map, and the second prediction data includes the predicted coordinate offsets of multiple preset key points on the brake chain corresponding to the pixel point;
[0124] A coordinate calculation module 140, for determining candidate prediction coordinates corresponding to a plurality of preset key points on the brake chain in the image data under the prediction model according to the classification probability and the prediction coordinate offset output by each prediction model;
[0125] A chain deduplication module 150 is used to perform deduplication processing on candidate prediction coordinates corresponding to multiple preset key points on the brake chain in the image data under each prediction model to obtain optimal prediction coordinates corresponding to multiple preset key points on the brake chain in the image data;
[0126] The state determination module 160 is used to determine the state of the brake chain in the image data according to the optimal predicted coordinates corresponding to a plurality of preset key points on the brake chain in the image data.
[0127] In a specific implementation, the size type of the feature map is N, where N is an integer greater than or equal to 2; the feature extraction module 120 includes:
[0128] A first extraction unit, configured to perform multiple downsampling processes on the image data to obtain a first feature map, wherein the size of the first feature map is a first size;
[0129] A second extraction unit is used to determine any feature map from the second feature map to the Nth feature map based on the first feature map; wherein the process of determining the i-th feature map includes: upsampling the i-1th feature map to obtain a feature map of an i-th size; splicing the feature map of the i-th size with the feature map of the i-th size generated in the multiple downsampling processes to obtain the i-th feature map, the i-th feature map is of the i-th size, the larger i is, the larger the i-th size is; i is an integer greater than or equal to 2 and less than or equal to N.
[0130] In specific implementation, the coordinate calculation module 140 specifically includes:
[0131] A position determination unit, configured to determine, according to the classification probability output by each prediction model, the coordinates of the corresponding pixel points of the brake chain in the image data under the prediction model;
[0132] A coordinate determination unit is used to determine the candidate predicted coordinates corresponding to multiple preset key points on the brake chain in the image data under the prediction model based on the coordinates of the corresponding pixel points of the brake chain in the image data under the prediction model and the predicted coordinate offsets of the multiple preset key points.
[0133] In a specific implementation, the prediction data output by each prediction model includes the first prediction data and the second prediction data under each prior chain slack; the coordinate determination unit is specifically used to: determine the candidate predictions corresponding to the multiple preset key points on the brake chain in the image data under the prediction model according to the prior chain width preset for the prediction model, the prior chain slack corresponding to the larger classification probability, the predicted coordinate offsets of the multiple preset key points under the prior chain slack corresponding to the larger classification probability, and the coordinates of the corresponding pixel points of the brake chain in the image data under the prediction model. Coordinates; wherein the prior chain width is a priori value of the shortest distance between one end point to the other end point of the train brake chain, and the prior chain width corresponds to the prediction model one by one; the prior chain slack is a priori value characterizing the degree of slack of the brake chain, and the prior chain slack pre-set for each prediction model includes a first prior chain slack corresponding to a relaxed state and a second prior chain slack corresponding to a tense state, and the larger classification probability is, for the same pixel point, the larger value of the classification probability corresponding to the first prior chain slack and the classification probability corresponding to the second prior chain slack.
[0134] In a specific implementation, the device further includes:
[0135] A priori width determination module, used to calculate the chain width corresponding to each training sample used to train the prediction model according to the coordinates of multiple preset key points in the training sample; clustering the chain widths corresponding to all training samples used to train the prediction model to obtain a priori chain widths consistent with the number of the prediction models; and / or
[0136] A priori slack determination module is used to calculate the chain slack corresponding to each training sample used to train the prediction model based on the coordinates of multiple preset key points in the training sample; cluster the chain slack corresponding to all training samples used to train the prediction model to obtain the first priori chain slack and the second priori chain slack.
[0137] In a specific implementation, the plurality of preset key points include two end points of the brake chain and an intersection point between a perpendicular bisector of a straight line segment between the two end points and the brake chain.
[0138] In a specific implementation, the coordinate determination unit uses a first formula to calculate the candidate prediction coordinates corresponding to an end point on the brake chain in the image data under a prediction model, and the first formula includes:
[0139] x A =x c -w×sigmoid(t xA )
[0140] y A =y c -w×s×sigmoid(t yA )
[0141] In the formula, (x A ,y A ) is the candidate predicted coordinate corresponding to an endpoint A on the brake chain in the image data, (x c ,y c ) is the coordinate of the corresponding pixel point of the brake chain in the image data, (t xA , t yA ) is the predicted coordinate offset of an endpoint A on the brake chain under the prior chain slack corresponding to the larger classification probability, w is the prior chain width corresponding to the prediction model, and s is the prior chain slack corresponding to the larger classification probability;
[0142] And / or, the coordinate determination unit uses a second formula to calculate the candidate prediction coordinates corresponding to another end point on the brake chain in the image data under a prediction model, and the second formula includes:
[0143] x B =x c +w×sigmoid(t xB )
[0144] y B =y c -w×s×sigmoid(t yB )
[0145] In the formula, (x B ,y B ) is the candidate predicted coordinate corresponding to the other end point B on the brake chain in the image data, (t xB , t yB ) is the predicted coordinate offset of the other end point B on the brake chain under the a priori chain slack corresponding to the larger classification probability;
[0146] And / or, the coordinate determination unit calculates the candidate prediction coordinates corresponding to the intersection point in the image data under a prediction model using a third formula, the third formula comprising:
[0147] x D =x c +w×(sigmoid(t xD )-0.5)
[0148] y D =y c +w×s×sigmoid(t yD )
[0149] In the formula, (x D ,y D ) is the candidate prediction coordinate corresponding to the intersection point D in the image data, (t xD , t yD ) is the predicted coordinate offset of the intersection point D under the prior chain relaxation corresponding to the larger classification probability.
[0150] In a specific implementation, the device further includes:
[0151] The model training module is used to pre-train the prediction model and use a preset loss function to calculate the loss of the training samples during the training process of the prediction model. The loss function includes:
[0152]
[0153] Where, L total is the total loss of the prediction model, is the preset balance parameter, N cls is the number of all training samples required to train the prediction model, L cls () is the classification loss function, y i and are the brake chain status pre-labeled for the i-th training sample and the classification probability output after the i-th training sample is input into the prediction model, N reg is the number of positive samples in all the training samples, L reg () is the regression loss function, t pi and are respectively the true coordinates of the key point P in the i-th training sample and the predicted coordinates output after the i-th training sample is input into the prediction model.
[0154] In specific implementation, the model training module includes:
[0155] The sample classification module is used to select positive samples, and the selection process includes: according to each prior chain slack, the prior chain width corresponding to the prediction model and the coordinates of an anchor point in a training sample, the coordinates of multiple preset key points in the training sample under the prior chain slack are calculated, and the anchor point is the center of the minimum circumscribed rectangle of the brake chain; the sum of the distances between the calculated coordinates of the multiple preset key points in the training sample under the prior chain slack and the real coordinates of the multiple preset key points in the training sample is determined; it is determined whether the sum of the distances is less than a preset distance threshold, and if so, the training sample is used as the positive sample corresponding to the prior chain slack.
[0156] In specific implementation, the chain deduplication module is specifically used to: for any two prediction models, determine whether any key point under one prediction model is within the area formed by multiple preset key points under another prediction model. If so, the candidate prediction coordinates corresponding to the larger classification probability are used as the optimal prediction coordinates.
[0157] In specific implementation, the state determination module is specifically used to: calculate the chain slack in the image data according to the optimal predicted coordinates corresponding to the two endpoints and the intersection on the brake chain in the image data, and the chain slack is the ratio of the length of the perpendicular bisector segment to the chain width; wherein the chain width is the shortest distance between the two endpoints on the brake chain in the image data, and the length of the perpendicular bisector segment is the shortest distance between the midpoint of the straight line segment between the two endpoints and the intersection in the image data; determine whether the ratio is greater than a preset ratio threshold, and if so, the brake chain state in the image data is a relaxed state.
[0158] An embodiment of the present application also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the steps of the above method when executing the computer program.
[0159] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon, and the computer program implements the steps of the above method when executed by a processor.
[0160] It is understandable that the apparatus, computer device, computer-readable storage medium provided in the embodiments of the present application, the explanations, examples, beneficial effects, etc. of the relevant contents may refer to the corresponding parts in the above-mentioned method and will not be repeated here.
[0161] It is understood that any reference to memory, storage, database or other media used in the embodiments provided herein may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0162] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0163] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0164] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0165] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the enlightenment of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the purpose of the present invention and the claims, which all fall within the protection of the present invention.
Claims
1. A method for identifying the state of a train brake chain, characterized in that: include: Collect image data of train brake chains; Extracting features from the image data to obtain feature maps of multiple sizes; Inputting each size of the feature map into the corresponding prediction model to obtain corresponding prediction data, the prediction data including first prediction data and second prediction data, the first prediction data including the classification probability of the brake chain corresponding to each pixel point in the feature map, and the second prediction data including the predicted coordinate offsets of multiple preset key points on the brake chain corresponding to the pixel point; According to the classification probability and the predicted coordinate offset output by each prediction model, determine candidate predicted coordinates corresponding to a plurality of preset key points on the brake chain in the image data under the prediction model; Deduplication processing is performed on candidate prediction coordinates corresponding to multiple preset key points on the brake chain in the image data under each prediction model to obtain optimal prediction coordinates corresponding to multiple preset key points on the brake chain in the image data; The state of the brake chain in the image data is determined according to the optimal predicted coordinates corresponding to a plurality of preset key points on the brake chain in the image data.
2. The method according to claim 1, characterized in that The size type of the feature map is N, where N is an integer greater than or equal to 2; the feature extraction of the image data is performed to obtain feature maps of multiple sizes, including: Performing multiple downsampling processes on the image data to obtain a first feature map, where the size of the first feature map is a first size; Based on the first feature map, determine any feature map from the second feature map to the Nth feature map; wherein the process of determining the i-th feature map includes: upsampling the i-1th feature map to obtain a feature map of an i-th size; splicing the feature map of the i-th size with the feature map of the i-th size generated in the multiple downsampling processes to obtain the i-th feature map, the i-th feature map is of the i-th size, the larger i is, the larger the i-th size is; i is an integer greater than or equal to 2 and less than or equal to N.
3. The method according to claim 1, characterized in that Determining candidate prediction coordinates corresponding to a plurality of preset key points on the brake chain in the image data under the prediction model according to the classification probability and the prediction coordinate offset output by each prediction model includes: According to the classification probability output by each prediction model, determine the coordinates of the corresponding pixel points of the brake chain in the image data under the prediction model; According to the coordinates of the corresponding pixel points of the brake chain in the image data under the prediction model and the predicted coordinate offsets of the multiple preset key points, the candidate predicted coordinates corresponding to the multiple preset key points on the brake chain in the image data under the prediction model are determined.
4. The method according to claim 3, characterized in that The prediction data output by each prediction model includes the first prediction data and the second prediction data under each prior chain slack; The method of determining candidate predicted coordinates corresponding to the plurality of preset key points on the brake chain in the image data under the prediction model according to the coordinates of the corresponding pixel points of the brake chain in the image data under the prediction model and the predicted coordinate offsets of the plurality of preset key points comprises: Determine candidate prediction coordinates corresponding to the plurality of preset key points on the brake chain in the image data under the prediction model according to the a priori chain width preset for the prediction model, the a priori chain slack corresponding to the larger classification probability, the prediction coordinate offsets of the plurality of preset key points under the a priori chain slack corresponding to the larger classification probability, and the coordinates of the corresponding pixel points of the brake chain in the image data under the prediction model; Among them, the prior chain width is the prior value of the shortest distance between one end point to the other end point of the train brake chain, and the prior chain width corresponds to the prediction model one by one; the prior chain slack is a prior value characterizing the degree of slackness of the brake chain, and the prior chain slack pre-set for each prediction model includes a first prior chain slack corresponding to a relaxed state and a second prior chain slack corresponding to a tense state; the larger classification probability is, for the same pixel point, the larger value of the classification probability corresponding to the first prior chain slack and the classification probability corresponding to the second prior chain slack.
5. The method according to claim 4, characterized in that The process of determining the prior chain width includes: calculating the chain width corresponding to each training sample used to train the prediction model according to the coordinates of a plurality of preset key points in the training sample; clustering the chain widths corresponding to all the training samples used to train the prediction model to obtain the prior chain widths consistent with the number of the prediction models; And / or, the process of determining the prior chain relaxation includes: calculating the chain relaxation corresponding to each training sample based on the coordinates of multiple preset key points in each training sample used to train the prediction model; clustering the chain relaxations corresponding to all training samples used to train the prediction model to obtain the first prior chain relaxation and the second prior chain relaxation.
6. The method according to claim 4, characterized in that The plurality of preset key points include two end points of the brake chain and an intersection point between a perpendicular bisector of a straight line segment between the two end points and the brake chain.
7. The method according to claim 6, characterized in that A first formula is used to calculate candidate predicted coordinates corresponding to an end point on the brake chain in the image data under a prediction model, wherein the first formula includes: x A =x c -w×sigmoid(t xA ) and A =and c -w×s×sigmoid(t yA ) In the formula, (x A ,y A ) is the candidate predicted coordinate corresponding to an endpoint A on the brake chain in the image data, (x c ,y c ) is the coordinate of the corresponding pixel point of the brake chain in the image data, (t xA , t yA ) is the predicted coordinate offset of an endpoint A on the brake chain under the prior chain slack corresponding to the larger classification probability, w is the prior chain width corresponding to the prediction model, and s is the prior chain slack corresponding to the larger classification probability; And / or, a second formula is used to calculate the candidate prediction coordinates corresponding to another end point on the brake chain in the image data under a prediction model, wherein the second formula includes: x B =x c +w×sigmoid(t xB ) and B =and c -w×s×sigmoid(t yB ) In the formula, (x B ,y B ) is the candidate predicted coordinate corresponding to the other end point B on the brake chain in the image data, (t xB , t yB ) is the predicted coordinate offset of the other end point B on the brake chain under the a priori chain slack corresponding to the larger classification probability; And / or, a third formula is used to calculate candidate prediction coordinates corresponding to the intersection point in the image data under a prediction model, the third formula comprising: x D =x c +w×(sigmoid(t xD )-0.5) and D =and c +w×s×sigmoid(t yD ) In the formula, (x D ,y D ) is the candidate prediction coordinate corresponding to the intersection point D in the image data, (t xD , t yD ) is the predicted coordinate offset of the intersection point D under the prior chain relaxation corresponding to the larger classification probability.
8. The method according to claim 4, characterized in that The prediction model is obtained by pre-training. During the training process of the prediction model, a preset loss function is used to calculate the loss of the training samples. The loss function includes: Where, L total is the total loss of the prediction model, is the preset balance parameter, N cls is the number of all training samples required to train the prediction model, L cls () is the classification loss function, y i and are the brake chain status pre-labeled for the i-th training sample and the classification probability output after the i-th training sample is input into the prediction model, N reg is the number of positive samples in all the training samples, L reg () is the regression loss function, t pi and are respectively the true coordinates of the key point P in the i-th training sample and the predicted coordinates output after the i-th training sample is input into the prediction model.
9. The method according to claim 8, characterized in that The positive sample selection process includes: According to each prior chain slack, the prior chain width corresponding to the prediction model and the coordinates of an anchor point in a training sample, the coordinates of a plurality of preset key points in the training sample under the prior chain slack are calculated, wherein the anchor point is the center of the minimum circumscribed rectangle of the brake chain; Determine the sum of the distances between the calculated coordinates of the plurality of preset key points in the training sample under the prior chain slack and the true coordinates of the plurality of preset key points in the training sample; It is determined whether the sum of the distances is less than a preset distance threshold. If so, the training sample is used as a positive sample corresponding to the prior chain slack.
10. The method according to claim 1, characterized in that The deduplication processing is performed on the candidate prediction coordinates corresponding to the multiple preset key points on the brake chain in the image data under each prediction model to obtain the optimal prediction coordinates corresponding to the multiple preset key points on the brake chain in the image data, including: For any two prediction models, it is determined whether any key point under one prediction model is within the area formed by multiple preset key points under another prediction model. If so, the candidate prediction coordinates corresponding to the larger classification probability are used as the optimal prediction coordinates.
11. The method according to claim 6, characterized in that The determining the brake chain state in the image data according to the optimal predicted coordinates corresponding to the plurality of preset key points on the brake chain in the image data comprises: According to the optimal predicted coordinates corresponding to the two endpoints and the intersection of the brake chain in the image data, the chain slack in the image data is calculated, and the chain slack is the ratio of the length of the perpendicular bisector segment to the chain width; wherein the chain width is the shortest distance between the two endpoints of the brake chain in the image data, and the length of the perpendicular bisector segment is the shortest distance between the midpoint of the straight line segment between the two endpoints and the intersection in the image data; It is determined whether the ratio is greater than a preset ratio threshold value. If so, the brake chain state in the image data is a loose state.
12. A train brake chain status recognition device, characterized in that: include: An image acquisition module, used to collect image data of the train brake chain; A feature extraction module, used to extract features from the image data to obtain feature maps of multiple different sizes; A model prediction model is used to input the feature map of each size into the corresponding prediction model to obtain corresponding prediction data, wherein the prediction data includes first prediction data and second prediction data, wherein the first prediction data includes the classification probability of the brake chain corresponding to each pixel point in the feature map, and the second prediction data includes the predicted coordinate offsets of multiple preset key points on the brake chain corresponding to the pixel point; A coordinate calculation module, for determining candidate prediction coordinates corresponding to a plurality of preset key points on the brake chain in the image data under the prediction model according to the classification probability and the prediction coordinate offset output by each prediction model; A chain deduplication module, used for deduplicating candidate prediction coordinates corresponding to multiple preset key points on the brake chain in the image data under each prediction model, to obtain the optimal prediction coordinates corresponding to multiple preset key points on the brake chain in the image data; The state determination module is used to determine the state of the brake chain in the image data according to the optimal predicted coordinates corresponding to multiple preset key points on the brake chain in the image data.
13. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 11 are implemented.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.
