Coal mine underground mechanical watch recognition and detection method based on improved yoV8

Through the improved yoloV8 algorithm and angle recognition technology, the problem of light dependence and angle recognition range in underground mechanical table recognition of coal mines is solved, and 360° angle recognition and high-accuracy mechanical table detection are achieved, compatible with light source changes and avoiding glass Reflection improves recognition effect.

CN119273882APending Publication Date: 2025-01-07TIANDI CHANGZHOU AUTOMATION +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410957869.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-17
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

The prior art has problems in the identification of underground mechanical tables of coal mines, limited angle recognition range and glass reflection, resulting in low recognition accuracy and cannot meet the needs of 360° pointing recognition and multi-dial interference.

Method used

Using the improved yoloV8 algorithm, add angle recognition and recognition confidence, with an angle recognition range of 0-360°, and offset the camera from the mechanical watch surface to avoid reflection problems, using angled rolabelImg and angleless labelImg for labeling , train deep learning models to obtain mechanical table reading information, and add error correction logic to the model to improve accuracy.

Benefits of technology

It realizes the 360° angle recognition and high accuracy recognition of mechanical watches, is compatible with changes in external light sources, avoids the impact of glass reflection on recognition, and improves the accuracy and reliability of underground mechanical watch inspection of coal mines.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119273882A_ABST
    Figure CN119273882A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of intelligent identification of instruments and meters, and particularly relates to an underground coal mine mechanical meter identification and detection method based on improved yoV8, which comprises the following steps: S1, collecting mechanical meter pictures of different readings and angles shot by different light source brightness; s2, marking the dial plate, the center, the types of pointers, a target frame and angle information of the mechanical watch; s3, the marked angle information is normalized; s4, training a mechanical watch identification detection model; s5, inputting a mechanical watch picture collected in real time into the mechanical watch identification detection model to obtain minute hand information and second hand information; and S6, integrating the minute hand information and the second hand information to obtain the numerical value of the mechanical watch. According to the method, firstly, the marked angle range is within 0-360 degrees, then, angle information is added in the aspect of head output based on the improved yoloV8 model, 0-360-degree detection output of a dial plate can be achieved through the improved yoloV8 network, and finally, through logic judgment of pointer error correction, the overall recognition detection method is good in recognition effect and high in accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of intelligent identification of instruments and meters, and specifically relates to an identification and detection method for mechanical meters in underground coal mines based on improved yoloV8. Background Art

[0002] In coal mines, underground anemometers are used to monitor wind speed in the tunnels to ensure the safety of miners and stable production of coal mines. According to China's Coal Mine Safety Regulations, underground wind speed must be controlled within a certain range to reduce the risk of coal dust explosions and asphyxiation accidents. Accurate identification and application of anemometers can help prevent serious accidents such as gas explosions.

[0003] There are currently two methods for identifying mechanical meter readings. One is based on the traditional algorithm. First, the dial is detected using template matching, then the center of the dial is detected using Hough circle matching, and then the pointer is fitted by straight line fitting. This method requires stable lighting conditions. In addition, Hough circle detection requires the center of the mechanical meter to be a relatively regular circle, so the camera needs to be facing the center of the dial. For smart cameras with integrated camera and light source, reflection problems will occur when the light source is facing the glass dial. Another method is based on the deep learning target with angle target detection algorithm, which is insensitive to lighting and angle deviation. However, the angle recognition range is only 180°, so it cannot meet the recognition range of the 360° pointing of the mechanical meter. In addition, in actual applications, in order to meet the accuracy requirements of wind measurement underground in coal mines, anemometers often require multiple dials, and the recognition of multiple dials and needles will interfere with each other. Summary of the invention

[0004] The purpose of the present invention is to provide a method for identifying and detecting mechanical meters in underground coal mines based on improved yoloV8 to solve the technical problems existing in the background technology.

[0005] In order to solve the above technical problems, the present invention provides a method for identifying and detecting mechanical meters in coal mines based on improved yoloV8, adding angle recognition and recognition confidence to the HEAD head part, and the angle recognition range is 0-360°, so as to obtain the mechanical meter reading information. This method is based on a deep learning algorithm and has higher compatibility with changes in external light sources; in addition, in order to solve the problem of glass reflection, the camera face is offset from the surface of the mechanical watch by a certain angle when the camera is installed, that is, the two planes are not parallel, so that the reflective point can be adjusted outside the range of the mechanical watch, and at the same time, it also causes the center of the dial and a certain range of the dial to be deformed. Using this method can effectively avoid the influence of deformation on the recognition accuracy.

[0006] The present invention provides a method for identifying and detecting a mechanical meter in an underground coal mine based on an improved yoloV8, comprising the following steps:

[0007] S1. Collect pictures of mechanical watches with different readings and angles taken with different light source brightness;

[0008] S2, marking the type, target frame and angle information of the dial, center and pointer of the mechanical watch;

[0009] S3, normalizing the marked angle information;

[0010] S4, training a mechanical watch recognition and detection model;

[0011] S5, inputting the real-time collected mechanical watch picture into the mechanical watch recognition detection model to obtain minute hand information and second hand information;

[0012] S6. Combining the minute hand information and the second hand information, the mechanical watch value is obtained.

[0013] Furthermore, in step S2, the angled rolabelImg is used for labeling, including the following steps:

[0014] S21, obtain the center coordinates (x0, y0) of the center of the dial;

[0015] S22, obtain the center coordinates of the needle (x1, y1);

[0016] S23, obtain the angle information of the rectangular frame angle, ranging from 0 to 180°;

[0017] S24, judging whether the angle information angle needs to be increased by 180° according to the center of the dial and the coordinates of the needle; when the center of the needle is to the left of the center of the dial, that is, the center of the needle points to the left half of the needle, the angle of the needle needs to be increased by 180°;

[0018] Optionally, in step S2, labeling is performed using labelImg software without angle, including the following steps:

[0019] S2a, obtain the center rectangle of the dial, and calculate the center coordinates (x0, y0) according to the coordinates of the center rectangle; obtain the center rectangle of the dial, the upper left corner (x0_min, y0_min), the lower right corner (x0_max, y0_max), and calculate the center coordinates (x0, y0), where x0 = (x0_min + x0_max) / 2, y0 = (y0_min + y0_max) / 2;

[0020] S2b, obtain the rectangular frame of the needle, and calculate the coordinates of the center of the needle (x1, y1) according to the coordinates of the rectangular frame of the needle; obtain the upper left corner (x1_min, y1_min) and the lower right corner (x1_max, y1_max) of the rectangular frame of the needle, and calculate the coordinates of the center of the needle (x1, y1), where x1 = (x1_min + x1_max) / 2, y1 = (y1_min + y1_max) / 2;

[0021] S2c, calculate the angle information of the watch hand angle, the range is 0-90°;

[0022] S2d, judging the angle information angle according to the relationship between the center of the dial and the coordinates of the needle, judging whether angle is 0-90°, 90-180°, 180-270° or 270-360°;

[0023] Further, in step S4, the backbone network optimization process of training the mechanical watch recognition and detection model includes the following steps:

[0024] S41, forward propagating data points through the network to obtain output;

[0025] S42, using the loss function to calculate the total error;

[0026] S43, using the back propagation algorithm to calculate the gradient of the loss function relative to the weights and biases of each layer;

[0027] S44, update the weights and biases of each layer using gradient descent;

[0028] S45, repeat steps S41-S44, and stop the cycle when the preset number of times is reached.

[0029] Furthermore, the backbone network outputs the type of the detected target, the target rectangle and the angle information angle. The type of the detected target is discrete and is calculated using a classification loss function. The classification loss function is Formula 1.

[0030]

[0031] Where, N: sample size; L: i : i-th sample loss; y i : The true label of the i-th sample; p i : The predicted value of the i-th sample;

[0032] The target rectangle and angle information angle are continuous, and CIOU+DFLloss is used to calculate the loss function. The formula for calculating the loss function using CIOU is:

[0033] IOU is the intersection-over-union ratio of the predicted box and the real box, α is the weight function, and v is used to measure the consistency of the aspect ratio. α can be expressed as

[0034] v can be expressed as

[0035] The formula for calculating the loss function using DFLloss is:

[0036]

[0037] in, The probability distribution of the difference between the left side of the predicted bounding box and the true value, Probability distribution of the difference between the right side of the predicted border and the true value, y: the true value of the target box of the i-th sample, y i : The value of the target frame rounded up, y i+1 : The value of the target frame rounded up.

[0038] Furthermore, in step S6, the following steps are included:

[0039] S61, detection result conversion: the mechanical watch recognition detection model outputs a value between 0 and 1, which is represented by angle. The second hand reading of the mechanical watch is represented by seconds, and the minute hand reading of the mechanical watch is represented by minute. The second hand reading of the mechanical watch is seconds = angle * 100, and the minute hand reading of the mechanical watch is minute = angle * 10, and the minute hand value is rounded down;

[0040] S62. Calculation of mechanical watch readings: The readings of mechanical watches are expressed in value, value = minute*100+seconds.

[0041] 6. The method for identifying and detecting a mechanical meter in underground coal mines based on the improved yoloV8 as claimed in claim 5, wherein in step S61, the error correction of the pointer reading comprises the following steps:

[0042] S611, let the reading of the decimal part of the minute hand be fm, and the reading of the integer part of the minute hand be im;

[0043] S612, if fm ≥ 0.8 and seconds ≤ 20, the minute hand reading is im + 1;

[0044] S613. If fm≤0.2 and seconds≥80, the minute hand reading is im-1.

[0045] Furthermore, in step S4, the image data is enhanced, including: random rotation, random scaling, random cropping, color transformation, affine transformation and heat map enhancement.

[0046] The beneficial effects of the present invention are:

[0047] The invention discloses an underground coal mine mechanical meter recognition and detection method based on improved yoloV8. Firstly, it provides a method for quickly obtaining the marked angle information based on the currently open source marking software, so that the range of the marked angle information is within 0-360°. Then, based on the improved yoloV8 model, angle recognition and recognition confidence are added to the HEAD part, and the angle range is 0-360°, so as to obtain the mechanical meter reading information according to the angle. Finally, the invention also provides a logical judgment method for pointer error correction, so that the whole mechanical meter recognition and detection method has good recognition effect and high accuracy.

[0048] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0050] Figure 1 It is a flow chart of the coal mine underground mechanical meter recognition and detection method based on improved yoloV8 of the present invention;

[0051] Figure 2 Taking pictures of mechanical watches with different readings and angles for different light source brightness collected by the present invention;

[0052] Figure 3 It is a schematic diagram of the labeling form of the present invention using rolabelImg with an angle;

[0053] Figure 4 This is a schematic diagram of the labeling form without angle labelImg of the present invention;

[0054] Figure 5 This is a schematic diagram of the pointer pointing angle of the present invention;

[0055] Figure 6 It is the structural diagram of the improved YoloV8 of the present invention;

[0056] Figure 7 It is a detailed structural diagram of the improved YoloV8 network of the present invention;

[0057] Figure 8 It is a schematic diagram of the overall structure of the deep learning network of the present invention;

[0058] Fig. 9 It is a schematic diagram of the intersection-over-union ratio of the predicted frame and the real frame of the present invention;

[0059] Fig.10 It is a schematic diagram of mechanical meter reading of the present invention;

[0060] Fig.11 It is a schematic diagram of the detection results of the present invention. DETAILED DESCRIPTION

[0061] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0062] like Figure 1 As shown, the present invention provides a method for identifying and detecting a mechanical meter in an underground coal mine based on an improved yoloV8, comprising the following steps:

[0063] S1. Collect pictures of mechanical watches with different readings and angles taken with different light source brightness. This can be done by taking pictures with a camera, such as Figure 2 As shown;

[0064] S2. Label the dial, center, pointer type, target frame and angle information of the mechanical watch. The present invention provides two software data labeling methods, rolabelImg software with angle or labelImg software without angle.

[0065] Optionally, use angled rolabelImg for labeling, the labeling format is as follows Figure 3 As shown, the following steps are included:

[0066] S21, obtain the center coordinates (x0, y0) of the center of the dial;

[0067] S22, obtain the center coordinates of the needle (x1, y1);

[0068] S23, obtain the angle information of the rectangular frame angle, ranging from 0 to 180°;

[0069] S24, judging whether the angle information angle needs to be increased by 180° according to the relationship between the center of the dial and the coordinates of the needle, and the range is expanded to 0-360°;

[0070] When the center of the needle is to the left of the center of the dial, that is, the center of the needle points to the left half of the needle, the angle of the needle needs to be added 180°;

[0071] If x1 <x0:

[0072] angle=angle+180°

[0073] Optionally, use the labelImg software without angle for labeling, the labeling format is as follows Figure 4 As shown, the following steps are included:

[0074] S2a, obtain the center rectangle of the dial, and calculate the center coordinates (x0, y0) according to the coordinates of the center rectangle;

[0075] Get the center rectangle of the dial, the upper left corner A (x0_min, y0_min), the lower right corner B (x0_max, y0_max), and calculate the center coordinates (x0, y0), where x0 = (x0_min + x0_max) / 2, y0 = (y0_min + y0_max) / 2;

[0076] S2b, obtain the rectangular frame of the needle, and calculate the coordinates of the center of the needle (x1, y1) according to the coordinates of the rectangular frame of the needle;

[0077] Get the pointer rectangle, the upper left corner (x1_min, y1_min), the lower right corner (x1_max, y1_max), and calculate the center coordinates of the pointer (x1, y1), where x1 = (x1_min + x1_max) / 2, y1 = (y1_min + y1_max) / 2;

[0078] S2c, calculate the pointer angle information angle, the pointer angle information angle, such as Figure 5 As shown;

[0079] angle = argsin((y1-y0) / (x1-x0)), angle range 0-90°;

[0080] S2d, according to the relationship between the center of the dial and the coordinates of the needle, determine the angle information angle according to the relationship between the center of the dial and the coordinates of the needle, and determine whether angle is 0-90°, 90-180°, 180-270° or 270-360°, the specific method is as follows;

[0081] S2e. When the center of the needle is in the upper right corner of the center of the dial, the angle is between 0 and 90°. When the center of the needle is in the lower right corner of the center of the dial, the angle is between 90 and 180°. When the center of the needle is in the lower left corner of the center of the dial, the angle is between 180 and 270°. When the center of the needle is in the upper left corner of the center of the dial, the angle is between 270 and 360°, that is:

[0082] if x1>x0 and y1>y0:

[0083] angle=90-angle

[0084] elifx1>x0 and y1 <y0:

[0085] angle=90+angle

[0086] elifx1 <x0 and y1<y0:

[0087] angle=270-angle

[0088] else:

[0089] angle=270+angle

[0090] S3. Normalize the angle information angle, that is, angle=angle / 360°.

[0091] S4. Train the mechanical watch recognition detection model. The detection model is trained using a deep learning network and an improved YoloV8. The structure diagram is as follows: Figure 6 As shown, it includes three convolutional layers: Backbone, Neck and Head. Specifically:

[0092] Backbone: It uses a series of convolution and deconvolution layers to extract features, and also uses residual connections and bottleneck structures to reduce the size of the network and improve performance. This part uses the C2f module as the basic building block. Compared with the C3 module of YOLOv5, the C2f module has fewer parameters and better feature extraction capabilities.

[0093] Neck: It uses multi-scale feature fusion technology to fuse feature maps from different stages of Backbone to enhance feature representation capabilities. Specifically, the Neck part of YOLOv8 includes an SPPF module, a PAA module, and two PAN modules.

[0094] Head: It is responsible for the final target detection and classification tasks, including a detection head, a classification head, and an angle recognition head. The detection head contains a series of convolutional layers and deconvolutional layers to generate detection results; the classification head uses global average pooling to classify each feature map, and the angle recognition head is used to identify the angle of the minute hand.

[0095] The detailed structure of the improved YoloV8 network is as follows Figure 7 As shown, the present invention adds angle information in the head output, so that the improved YoloV8 network can detect and output the dial 0-360°.

[0096] Deep learning network training Figure 8 As shown, it mainly includes the following five parts:

[0097] Training Data: refers to the data set used to train the model, which usually contains input samples and corresponding labels (if it is a supervised learning task). The quality and quantity of training data directly affect the performance and generalization ability of the model.

[0098] Loss Function: It is used to measure the difference between the model's prediction results on the training data and the true label. The loss function is designed to enable the model to minimize the prediction error. Common loss functions include Mean Squared Error, Cross Entropy, etc.

[0099] Learning Algorithm: refers to the algorithm used to update model parameters to minimize the loss function. In deep learning, the commonly used learning algorithm is Gradient Descent and its variants, which calculates the gradient of the loss function to the model parameters and updates the parameters in the opposite direction of the gradient to gradually reduce the value of the loss function.

[0100] Error: refers to the difference between the model's prediction results on the training data and the true label, usually measured using a loss function.

[0101] Optimizer: In the gradient descent algorithm, the optimizer is responsible for updating the model parameters according to the gradient of the loss function. Common optimizers include Stochastic Gradient Descent (SGD), Adam, RMSProp, etc., which have different optimization performance and convergence speed.

[0102] The backbone network optimization process for training the mechanical watch recognition and detection model includes the following steps:

[0103] S41, forward propagation of data points through the network to obtain output; S42, using the loss function to calculate the total error; S43, using the back propagation algorithm to calculate the gradient of the loss function relative to the weights and biases of each layer; S44, using gradient descent to update the weights and biases of each layer; S45, repeating steps S41-S44, stopping the loop when the preset number of times is reached or the loss function has reached the minimum value. Preferably, the preset number of times is 300 times, the total error is propagated backward layer by layer through the connections in the network, the contribution (gradient) of each weight and bias in each layer to the total error is calculated, and then the gradient descent algorithm is used to optimize the weights and biases, and finally minimize the total error of the neural network.

[0104] The backbone network outputs the type of detected target, the target rectangle and the angle information angle. The type of detected target is discrete and is calculated using the classification loss function. The classification loss function is formula 1. BCE (binary cross entropy) is used as the classification loss. Each category is judged as "whether it is of this type" and the confidence L is output.

[0105]

[0106] Where, N: sample size; L: i : i-th sample loss; y i : The true label of the i-th sample; p i : The predicted value of the i-th sample;

[0107] The target rectangle and angle information angle are continuous, and CIOU+DFLloss is used to calculate the loss function. The formula for calculating the loss function using CIOU is:

[0108] IOU is the intersection-over-union ratio of the predicted box and the true box, such as Fig. 9 As shown, α is the weight function, v is used to measure the consistency of the aspect ratio, and α can be expressed as

[0109] v can be expressed as

[0110] The formula for calculating the loss function using DFLloss is:

[0111]

[0112] in, The probability distribution of the difference between the left side of the predicted bounding box and the true value, Probability distribution of the difference between the right side of the predicted border and the true value, y: the true value of the target box of the i-th sample, y i : The value of the target frame rounded up, y i+1 : The value of the target frame rounded up.

[0113] S5, inputting the real-time collected mechanical watch picture into the mechanical watch recognition detection model to obtain minute hand information and second hand information;

[0114] S6. Combining the minute hand information and the second hand information, the mechanical watch value is obtained.

[0115] S61, detection result conversion: the mechanical watch recognition detection model outputs a value between 0 and 1, which is represented by angle. The second hand reading of the mechanical watch is represented by seconds, and the minute hand reading of the mechanical watch is represented by minute. The second hand reading of the mechanical watch is seconds = angle * 100, and the minute hand reading of the mechanical watch is minute = angle * 10, and the minute hand value is rounded down;

[0116] S62. Calculation of mechanical watch readings: The readings of mechanical watches are expressed in value, value = minute*100+seconds.

[0117] like Fig.10 As shown: the second hand reading is seconds = 7.5, the minute hand reading is minut = 1, and the final mechanical watch reading result is value = 1*100+7.5 = 107.5.

[0118] The recognition results of the minute hand and second hand of a mechanical watch are not isolated. Fig.10 As shown, the minute hand result is around 1, so the minute hand result may be a value around 1. When it is less than 1, it is rounded down to 0, and when it is greater than 1, it is rounded down to 1. Therefore, the minute hand recognition is prone to errors. Based on this, a correction method is proposed based on the rounding of the minute hand, including the following steps:

[0119] S611, let the reading of the decimal part of the minute hand be fm, and the reading of the integer part of the minute hand be im;

[0120] S612, if fm ≥ 0.8 and seconds ≤ 20, the minute hand reading is im + 1;

[0121] S613. If fm≤0.2 and seconds≥80, the minute hand reading is im-1.

[0122] For example: seconds = 98.78, minute = 2.04, the normal minute hand reading is rounded down to 2, and is corrected to 1 at this time.

[0123] seconds=2.12,minute=1.98. Normally the minute hand reading is rounded down to 1, but it is corrected to 2.

[0124] In step S4, the image data is enhanced, including random rotation, random scaling, random cropping, color transformation, affine transformation, and heat map enhancement. Data enhancement is an important technique in the field of machine learning to improve the generalization ability of models, especially in computer vision tasks such as target detection. The YOLO series of models, as a popular real-time target detection system, can significantly improve its performance by using data enhancement during training. YOLOv8, as the latest version of this series, inherits this tradition and may use a variety of data enhancement techniques to improve its accuracy, stability, and speed.

[0125] In specific implementation, the following data enhancement methods are used:

[0126] Random rotation: By rotating the image, you can increase the model's ability to recognize objects at different angles.

[0127] Random Scaling: Resizing the image can simulate, to some extent, the changing size of objects in the field of view.

[0128] Random cropping: Randomly crop parts of the image to train the model's ability to handle incomplete information.

[0129] Color transformation: Change the brightness, contrast, and saturation of the image to make the model more adaptable to lighting changes.

[0130] Affine transformation: including translation, flipping, etc., to increase the diversity of objects in the image.

[0131] Heatmap enhancement: Use the heatmap of the target object as input during training to enhance the model's recognition of the target's contour and texture.

[0132] Use mixed sample techniques such as Mixup and CutMix: Increase the generalization ability of the model by mixing two or more images.

[0133] Random Masking: Randomly mask a portion of the image and train the model to ignore the occluded portion and focus on key features.

[0134] In summary, the coal mine underground mechanical meter recognition and detection method based on improved yoloV8 of the present invention, first, provides a method for quickly obtaining the marked angle information based on the current open source marking software, so that the range of the marked angle information is within 0-360°, and then based on the improved yoloV8 model, angle recognition and recognition confidence are added to the HEAD header part to obtain the mechanical meter reading information, finally, the present invention also provides a logical judgment method for pointer error correction, so that the entire mechanical meter recognition and detection method has good recognition effect and high accuracy.

[0135] The detection results of the coal mine underground mechanical meter recognition detection method based on the improved yoloV8 of the present invention are as follows: Fig.11 As shown, the result data show that the detection result of the present invention is accurate and reliable.

[0136] The various devices selected in this application are all universal standard parts or parts known to those skilled in the art, and their structures and principles can be known to those skilled in the art through technical manuals or conventional experimental methods.

[0137] In the description of the embodiments of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it 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, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0138] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.

[0139] Based on the above ideal embodiments of the present invention, the relevant staff can make various changes and modifications without departing from the technical concept of the present invention through the above description. The technical scope of the present invention is not limited to the contents of the specification, and its technical scope must be determined according to the scope of the claims.

Claims

1. A method for identifying and detecting mechanical meters in underground coal mines based on improved yoloV8, characterized in that: The following steps are involved: S1. Collect pictures of mechanical watches with different readings and angles taken with different light source brightness; S2, marking the type, target frame and angle information of the dial, center and pointer of the mechanical watch; S3, normalizing the marked angle information; S4, training a mechanical watch recognition and detection model; S5, inputting the real-time collected mechanical watch picture into the mechanical watch recognition detection model to obtain minute hand information and second hand information; S6. Combining the minute hand information and the second hand information, the mechanical watch value is obtained.

2. The coal mine underground mechanical meter recognition and detection method based on improved yoloV8 as claimed in claim 1, characterized in that, In step S2, the angled rolabelImg is used for labeling, including the following steps: S21, obtain the center coordinates (x0, y0) of the center of the dial; S22, obtain the center coordinates of the needle (x1, y1); S23, obtain the angle information of the rectangular frame angle, ranging from 0 to 180°; S24, judging whether the angle information angle needs to be increased by 180° according to the relationship between the center of the dial and the coordinates of the needle, and the range is expanded to 0-360°.

3. The coal mine underground mechanical meter recognition and detection method based on improved yoloV8 as claimed in claim 1, characterized in that, In step S2, labeling is performed using the labelImg software without angle, including the following steps: S2a, obtain the center rectangle of the dial, and calculate the center coordinates (x0, y0) according to the coordinates of the center rectangle; S2b, obtain the rectangular frame of the needle, and calculate the coordinates of the center of the needle (x1, y1) according to the coordinates of the rectangular frame of the needle; S2c, calculate the angle information of the watch hand angle, the range is 0-90°; S2d. Determine the angle information angle according to the relationship between the center of the dial and the coordinates of the needle, and determine whether angle is 0-90°, 90-180°, 180-270° or 270-360°.

4. The coal mine underground mechanical meter recognition and detection method based on improved yoloV8 as claimed in claim 1, characterized in that, In step S4, the backbone network optimization process of training the mechanical watch recognition and detection model includes the following steps: S41, forward propagating data points through the network to obtain output; S42, using the loss function to calculate the total error; S43, using the back propagation algorithm to calculate the gradient of the loss function relative to the weights and biases of each layer; S44, update the weights and biases of each layer using gradient descent; S45, repeat steps S41-S44, and stop the cycle when the preset number of times is reached.

5. The coal mine underground mechanical meter recognition and detection method based on improved yoloV8 as claimed in claim 4, characterized in that, The backbone network outputs the type of detected target, the target rectangle and the angle information angle. The type of detected target is discrete and is calculated using the classification loss function. The classification loss function is Formula 1. Where, N: sample size; L: i : i-th sample loss; y i : The true label of the i-th sample; p i : The predicted value of the i-th sample; The target rectangle and angle information angle are continuous, and CIOU+DFLloss is used to calculate the loss function. The formula for calculating the loss function using CIOU is: IOU is the intersection-over-union ratio of the predicted box and the real box, α is the weight function, and v is used to measure the consistency of the aspect ratio. α can be expressed as v can be expressed as The formula for calculating the loss function using DFLloss is: in, The probability distribution of the difference between the left side of the predicted bounding box and the true value, Probability distribution of the difference between the right side of the predicted border and the true value, y: the true value of the target box of the i-th sample, y i : The value of the target frame rounded up, y i+1 : The value of the target frame rounded up.

6. The coal mine underground mechanical meter recognition and detection method based on improved yoloV8 as claimed in claim 1, characterized in that, In step S6, the following steps are included: S61, detection result conversion: the mechanical watch recognition detection model outputs a value between 0 and 1, which is represented by angle. The second hand reading of the mechanical watch is represented by seconds, and the minute hand reading of the mechanical watch is represented by minute. The second hand reading of the mechanical watch is seconds = angle * 100, and the minute hand reading of the mechanical watch is minute = angle * 10, and the minute hand value is rounded down; S62. Calculation of mechanical watch readings: The readings of mechanical watches are expressed in value, value = minute*100+seconds.

7. The coal mine underground mechanical meter recognition and detection method based on improved yoloV8 as claimed in claim 6, characterized in that, In step S61, error correction for pointer reading includes the following steps: S611, let the reading of the decimal part of the minute hand be fm, and the reading of the integer part of the minute hand be im; S612, if fm ≥ 0.8 and seconds ≤ 20, the minute hand reading is im + 1; S613. If fm≤0.2 and seconds≥80, the minute hand reading is im-1.

8. The coal mine underground mechanical meter recognition and detection method based on improved yoloV8 as claimed in claim 1, characterized in that, In step S4, the image data is enhanced, including: random rotation, random scaling, random cropping, color transformation, affine transformation and heat map enhancement.