A method and device for identifying the types of cargo on coal mine vehicles based on an improved YOLOv5.
By improving the network structure and loss function of the YOLOv5 model, the problem of inaccurate detection of small and dense targets was solved, enabling efficient identification and management of coal mine vehicle cargo and improving transportation safety and efficiency.
Patent Information
- Application Number
- CN202410887393.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-03
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2044-07-03
AI Technical Summary
The existing YOLOv5 model is not sensitive enough to the detection of small and dense targets when detecting coal mine cargo, resulting in low detection performance.
By introducing principal component analysis to amplify image features, improving the YOLOv5 backbone network structure, adding an SE attention mechanism, and optimizing model parameters by combining the Focal-loss and center point loss functions during training, detection accuracy is improved.
It improves the accuracy of identifying the types of goods transported by coal mine vehicles, ensures safety and efficiency during transportation, reduces the occurrence of accidents, and enables rapid and accurate classification and recording of goods.
Smart Images

Figure CN119418084B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of intelligent coal mining industry and machine vision technology, and in particular to a method and device for identifying the types of goods transported in coal mines based on an improved YOLOv5. Background Technology
[0002] AI-powered cargo identification for coal mine vehicles utilizes artificial intelligence to identify and classify cargo on these vehicles, enabling automated management and optimized transportation. First, AI identification accurately monitors and identifies cargo on coal mine vehicles, ensuring that no contraband or hazardous materials are carried during transport. This helps protect miners and equipment, reduces accidents, and enhances safety. Second, AI identification quickly and accurately classifies cargo on coal mine vehicles, avoiding the time-consuming and error-prone nature of traditional manual inventory checks, significantly improving work efficiency. Simultaneously, real-time monitoring and data analysis allow for optimization of the transportation process, reducing empty load rates and transportation costs. Finally, the identification and recording of cargo on coal mine vehicles enables refined resource management and traceability, accurately calculating the workload of each miner and vehicle, improving resource utilization efficiency, and providing a scientific basis for decision-making through the analysis of various data during coal mine transportation.
[0003] In 2016, Joseph et al. proposed YOLO, the first formal single-stage object detector in the deep learning era. This method completely abandoned the "region proposal + regression" detection mode in two-stage detection. It scales the image to be tested to a uniform size and divides it into multiple grids, then predicts the object category based on the grid where the object center is located, and outputs the detection result on the last convolutional layer. With continuous optimization and adjustment of the network structure, YOLOv5 was launched, embedding anchor box operation function in the network input, which can adaptively calculate the optimal anchor box value on each training set as needed. The backbone network incorporates a focus structure and uses slicing operation to reduce the amount of computation and parameters.
[0004] Because some coal mine vehicle cargo targets are small, dense, and lack distinctive features, such as coking coal, lump coal, and coal slime, YOLOv5 is not sensitive enough for small target detection and not strong enough for dense target detection, resulting in insufficient performance in detecting different types of vehicle cargo. Therefore, to address these issues, this invention first collected data on seven types of coal mine vehicle cargo using an AI camera: coking coal, lump coal, gangue, machine cloth, tarpaulin, coal slime, and empty vehicles. Before model training, images were magnified using principal component analysis to extract key image features more comprehensively. Secondly, YOLOv5 was selected as the pre-weighted model for coal mine vehicle cargo type recognition, and the YOLOv5 backbone network structure was improved: the input feature groups were separated, and an SE attention mechanism was added to the convolutional transformation before the separation mechanism, making the network layers richer and more comprehensive. Simultaneously, during training, parameters such as the learning rate, number of iterations, batch size, and optimization function were continuously iteratively optimized to find the model with the best accuracy. Finally, the Focal-loss and centroid loss functions were combined to jointly evaluate the model performance. Summary of the Invention
[0005] This invention addresses the problem that coal mine vehicle-borne cargo targets are small, dense, and lack distinctive features, leading to reduced model detection performance. It provides a coal mine vehicle-borne cargo type identification method and device based on an improved YOLOv5, which deeply integrates computer vision technology with video surveillance rules to meet the real-time video recognition needs of coal mines.
[0006] This application is achieved through the following technical solution: a method for identifying the type of cargo on coal mine vehicles based on an improved YOLOv5, comprising:
[0007] Acquire video data of each mining truck at the loading point;
[0008] The video data of each mining truck at the loading point is preprocessed to obtain the image data of each mining truck at the loading point;
[0009] To construct a training set, the obtained image data is manually standardized to obtain the training set.
[0010] Construct a network model that includes a separation input feature unit, an intermediate representation transformation unit, a separation mechanism transformation unit, and a convolutional unit;
[0011] Model training involves using the constructed training set to train the network model, resulting in a trained network model.
[0012] The trained network model is used to identify the types of goods on each mining truck at the loading point.
[0013] Preferably, the loss function of the network model includes:
[0014] In the formula: L is the loss function of the network model, L b For the center loss function, L pt FocalLoss loss L = L b +δL pt
[0015] The loss function, δ, is the balance scalar between the center loss function and the FocalLoss loss function;
[0016] in,
[0017]
[0018] x i For i category features, Let y be the i-th feature center, k represent the number of categories, and y be the label value.
[0019]
[0020] In the formula: y is the label value, where y is 1 when the sample is positive and 0 when the sample is negative. To balance the weights of positive and negative samples, the value range is [0,1]; P t This represents the probability that the model predicts for a certain category.
[0021] Preferably, the method for obtaining image data of each mining truck at the loading point includes:
[0022] Acquire frame image data from the video data of each mining truck at the loading point, and perform vector transformation on each frame image to obtain a sequence matrix;
[0023] The obtained sequence matrix is centered to obtain a new sequence matrix;
[0024] The feature matrix is obtained by decomposing the new sequence matrix.
[0025] The new sequence matrix is projected onto the feature matrix to obtain a new dataset;
[0026] Decoding the new dataset yields new frame images, resulting in an image dataset of each mining truck at the loading point.
[0027] Preferably, the network model is an improved YOLOv5 network model.
[0028] Preferably, the separation input feature unit divides the input image into K groups based on the number of channels, obtaining K groups of images, and then splits each group of images to obtain multiple input feature groups.
[0029] Preferably, the intermediate representation change unit performs 1×1 convolution on each feature group and then performs attention processing, and finally performs 3×3 convolution to complete the intermediate feature change.
[0030] Preferably, the separation mechanism transformation unit fuses the feature groups processed by the intermediate representation unit to obtain the basis array of each K groups. After performing global average pooling on the obtained basis array of each K groups, attention weighting is applied to the channels corresponding to each basis array. Finally, the data is concatenated to obtain the concatenated data. The concatenated data is then convolved by the convolution unit to obtain the final feature image.
[0031] A coal mine vehicle cargo type identification device based on an improved YOLOv5, comprising,
[0032] The video data acquisition module is used to acquire video data of each mining truck at the loading point;
[0033] The image processing module is used to preprocess the video data of each mining truck at the loading point to obtain image data of each mining truck at the loading point;
[0034] The network training module is used to obtain a training set by manually standardizing the acquired image data;
[0035] Construct a network model that includes a separation input feature unit, an intermediate representation transformation unit, a separation mechanism transformation unit, and a convolutional unit;
[0036] Model training involves using the constructed training set to train the network model, resulting in a trained network model.
[0037] The identification module is used to identify the type of goods on each mining truck at the loading point using the trained network model.
[0038] The beneficial effects of this application are:
[0039] Seven types of coal mine vehicle cargo data were collected using cameras. Before model training, images were magnified using principal component analysis (PCA) to extract key features more comprehensively. YOLOv5 was selected as the pre-weighted model for coal mine vehicle cargo type recognition. The YOLOv5 backbone network structure was improved by separating the input feature groups and adding an SE attention mechanism to the convolutional transformation before the separation mechanism, resulting in a richer and more comprehensive network. During training, parameters such as the learning rate, number of iterations, batch size, and optimization function were continuously iterated and optimized to find the model with the best accuracy. Finally, the Focal-loss and center point loss functions were combined to jointly evaluate the model performance. Attached Figure Description
[0040] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0041] Figure 1 This is a flowchart of a coal mine vehicle cargo type identification method based on an improved YOLOv5 according to the present invention;
[0042] Figure 2 This is a schematic diagram of the network model in an embodiment of the present invention;
[0043] Figure 3 This is a schematic diagram of the cargo carried by the mining car in this embodiment;
[0044] Figure 4 This is a block diagram of a coal mine vehicle cargo type identification device based on an improved YOLOv5 in an embodiment of the present invention. Detailed Implementation
[0045] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0046] In the following description, when referring to the accompanying drawings, the same numbers in different drawings denote the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0047] Example
[0048] like Figure 1 The method for identifying the types of cargo transported on coal mine vehicles based on an improved YOLOv5 is shown, including:
[0049] Step S1: Acquire video data of each mining truck at the loading point; acquiring video data requires using an AI camera, including...
[0050] S101, Install the camera. Ideally, the camera should be installed directly above the loading point. This way, the collected data will be suitable for later image annotation. If there are already cameras in the actual coal mine application scenario and some cameras cannot be moved, then normal image collection is sufficient. The annotation method can be changed according to the image situation and adjusted to a method that is suitable for the image data obtained under the installation angle of the camera.
[0051] S102, Configure video recording and storage. Add the camera configuration information to the local AI inference server via the camera manufacturer's proprietary protocol, ONVI F open protocol, or GB28181 national standard protocol. Enable NVR service for video storage, stream forwarding, and stream recognition functions. Set the local hard drive as the storage path. Specific parameters are: storage directory path and disk full coverage ratio: Set the full coverage ratio; if this ratio is reached, the full coverage strategy will be executed.
[0052] S103, configure the recording plan, set the recording time template to 24-hour monitoring, and then set the recording plan template, which mainly includes the bit rate, bit rate and recording retention period when the recording is saved. After setting, associate the time template and the corresponding recording monitoring point to realize the recording monitoring of specific monitoring points at specific times.
[0053] S104, Set up the video stream capture task, and pre-set the video stream storage parameters: video save format, video stream capture time period, video stream frame rate, etc. Based on a specific time of coal mine cargo loading, capture the video stream one minute before and after the cargo on the truck passes the camera for loading, in order to ensure data integrity and obtain video data of the mine truck loading point.
[0054] S2, preprocess the video data of each mining truck at the loading point to obtain image data of each mining truck at the loading point; in this embodiment, preprocessing refers to data augmentation of the raw data collected in step S1. Since some of the cargo on the trucks is small and dense, this embodiment uses principal component analysis to decompose the video sequence, and then amplifies the amplitude of the decomposed low-frequency components. After a series of processing steps, the video stream is framed to obtain image data; including:
[0055] S201. Convert the video sequence into a matrix;
[0056] Convert each frame of the video sequence into a vector, and arrange these vectors into a matrix in chronological order: Assume the video sequence contains N frames, and the vector representation of each image is x. i Where i is the frame index (i = 1...N), the operation of converting a video sequence into a matrix can be represented as:
[0057] X = [x1, x2, x3, ..., x] N ]
[0058] Thus, X is a matrix of size M×N, where M is the dimension of each image vector.
[0059] S202. Matrix centralization;
[0060] Xcenter is obtained by subtracting the mean of all elements in each column from the element value of that column:
[0061] Xcenter = X-mean N
[0062] mean N = (1 / N)*sum(X,axis=0)
[0063] Where, mean N is the mean of each column in matrix X, axis = 0 for the vertical direction, and N is the number of columns in matrix X.
[0064] S203. Calculate the covariance matrix and decompose its eigenvalues. The eigenvalues represent the variance of the dataset in the direction of the eigenvector, and the eigenvectors represent the main direction of change of the dataset in the corresponding direction.
[0065] C = (1 / N-1) * Xcenter * Xcenter T
[0066] C = V * A * V T
[0067] Where A is the diagonal matrix after eigenvalue decomposition, and V is the eigenvector matrix. T Xcenter is the transpose of the eigenvectors, and Xcenter is the result of matrix centering in S202.
[0068] S204. Select principal components, arrange the eigenvalues in ascending order, and select the top K eigenvectors corresponding to the eigenvalues to form the feature matrix V = [V1, V2, ..., V...]. K ].
[0069] S205. Low-frequency component amplification processing can be achieved by adjusting the principal component coefficients; larger coefficients will result in a more obvious amplification effect.
[0070] S206. Projection: Projecting the original matrix through the eigenvectors to obtain the new dataset after dimensionality reduction of the original dataset. Projecting the original matrix Xcenter through the eigenvector matrix V yields the dimensionality-reduced dataset Q.
[0071] Q = V T *Xcenter
[0072] Where V is the eigenvector matrix, and Xcenter is the result obtained by centering the S202 matrix.
[0073] After completing all the above steps, the video stream is imported into the OpenCV library for compilation to obtain frame images, which are then saved to the corresponding file directory on the server. The image data is then filtered to ultimately retain the image data of the cargo on the vehicle.
[0074] S207. Further enhance the magnified image data.
[0075] By calling specific functions in the Torchvision.transforms module, a series of operations are performed to adjust the image's hue, saturation, rotation angle, scaling, cropping, and perspective transformation, making the enlarged image data more suitable for data training. Specifically, the input image is first cropped using a random cropping function, rotated using a random rotation function, and then randomly transformed using a color transformation function. Finally, manual selection is used to exclude images of particularly poor quality, thereby improving the model's ability to recognize new data.
[0076] S3, Construct the training set by manually standardizing the obtained image data;
[0077] Use the labelimg tool to annotate, for example... Figure 3 The image shown is labeled with rectangles to represent data on clean coal, lump coal, gangue, and coal slime. Due to the camera installation angle in real-world scenarios, using `labelimg` rectangles for empty vehicles, machine-made cloth, and cover cloth data would result in redundant and irrelevant features in the image data. Considering that the annotation method can affect the model's extraction of key features later, this invention addresses this issue by using `labelme` polygons to annotate machine-made cloth, cover cloth, and empty vehicle data. Finally, the annotated data format is converted to a unified txt format compatible with the YOLOv5 model.
[0078] S4. Construct the network model, which includes a feature separation unit, an intermediate representation transformation unit, a separation mechanism transformation unit, and a convolution unit. In this embodiment, because some coal mine vehicle cargo targets are small, dense, and lack obvious features, such as coking coal, lump coal, and coal slime, YOLOv5 is not sensitive enough for small target detection and not strong enough for dense target detection. Therefore, based on the YOLOv5 model structure, this invention improves the YOLOv5 backbone network structure as follows, and the improved backbone network structure diagram is shown below. Figure 2 As shown, the specific processing includes:
[0079] S401, Separate input feature groups
[0080] like Figure 2 As shown, the input feature map is divided into K groups based on the channel dimension, each group being designated as the k-th group. These feature maps serve as the input basis array. After this initial division, a new parameter D is introduced to further split the basis array, where D represents the number of divisions within the basis array, and each split group is denoted as d. Therefore, based on the settings of the two parameters and the channel dimension, the total number of input feature groups becomes G = KD.
[0081] S402. Intermediate representation transformation;
[0082] Each individual feature group can undergo a separate series of transformations {F1, F2, ..., F...} G}, and then the intermediate representation of each group is U i =F i (x)i∈{1,2···G}, in this embodiment, the intermediate representation mainly involves adding an SE module to each split basis array after the 1x1 convolution to adaptively handle the channel dimension of the convolutional feature map. This hybrid attention mechanism enhances the model's ability to learn key feature points. The channel attention module first performs average pooling on the input feature map to obtain the average feature value of each channel. Then, it learns the weights of each channel through two fully connected layers, ultimately obtaining a channel attention vector. This vector is multiplied by the input feature map to weight the feature maps of different channels. These weighted feature maps are then input into the subsequent 3x3 convolution operation to better describe the features of the input image, thereby improving the model's performance.
[0083] S403. Separation Mechanism Transformation: Split-Attention
[0084] After convolution, within a single basis array, the features from the intermediate representations are fused. Then, fusion is performed by summing elements across multiple segments to obtain a combined representation for each basis array. According to S401: the input feature map is divided according to the channel dimension, forming k input feature map basis arrays. The k-th basis array is represented as... Specifically, it can be expressed as the following formula:
[0085]
[0086] Where H, W, and C are the feature map dimensions, specifically the image height, width, and number of channels; G = KD, where K is the total number of input feature map basis arrays, each basis array being the k-th array; D is the number of internal splits within the input feature map basis array; and U... m An intermediate representation for each basis array.
[0087] The c-th component is then obtained through global average pooling. To reduce the dimensionality of the feature maps output by the convolutional layers:
[0088]
[0089] Then, an attention weighting mechanism is applied to each channel using channel-based soft attention, with the c-th channel... The calculation formula is as follows:
[0090]
[0091] in, This represents the attention weight of the corresponding channel after softmax normalization, with a weight range of (0,1). V represents the feature components after global average pooling, k represents the number of basis array groups, and D represents the number of internal splits within the basis array. The basis arrays are then concatenated to obtain V.
[0092] V = concat{V 1 V 2 ···V K}
[0093] Then, the current input and output are concatenated using a standard residual structure and output as a new feature Q;
[0094] Q = V + θ(X)
[0095] Where θ(x) is the skip connection mapping in the residual block. After further convolution operations, the final feature map is obtained.
[0096] S5 model training uses a constructed training set to train the network model, resulting in a trained network model.
[0097] During model training, the original images in the constructed training set are used as input and the labeled images are used as output for training. Before training, hyperparameters such as learning rate, batch size, and number of iterations need to be set in advance. During the training process, the main purpose is to introduce the activation function and loss function in the network training architecture.
[0098] In one embodiment, the network structure is YOLOv5, and the activation function used internally is the Mish function. Its main function is to introduce non-linear elements into neurons to increase their learning ability; otherwise, each output would be a linear function of the input from the upper layer.
[0099] S501, Selecting the optimizer and loss function
[0100] The optimization process is essentially about minimizing the loss function. A smaller loss function indicates better model performance. A model using only one loss function performs poorly. Therefore, this algorithm compares the effects of multiple loss functions, selects suitable ones, assigns weights to them, and collectively evaluates the model's performance. The continuous parameter adjustment during model training aims to minimize the loss function, thereby achieving optimal model performance. To prevent gradient vanishing or exploding during training, an L2 regularization term is added to the loss function.
[0101] S502, Model Evaluation
[0102] Accuracy was used as the basic parameter for evaluation. The loss function was mainly used during the model training phase. After each batch of training data was fed into the model, the predicted values were obtained through forward propagation. Then, the difference between the predicted values and the true values was calculated to optimize and adjust the model parameters so that the loss value was minimized, thereby achieving the purpose of learning.
[0103] Focal loss is a loss function used to address class imbalance. It adjusts the weights of positive and negative samples, giving greater attention to hard-to-classify samples during training. Center loss predicts the center point of the bounding box, helping the model more accurately regress the box's location and thus improving object detection accuracy. This embodiment combines the center loss function with the Focal-loss function to jointly supervise network training, thereby finding the optimal parameters.
[0104] The following formula defines the center loss function:
[0105]
[0106] Among them, L b For center loss, x i For category features, Let k be the feature center of the i-th class, and k represent the batch size. The Focal Loss function is defined as:
[0107]
[0108] Among them, L pt Here, y represents the Focal Loss function, where y is the label value, with positive samples having a label value of 1 and negative samples having a label value of 0. To balance the weights of positive and negative samples, the value range is [0,1]; P t This represents the probability (i.e., confidence level) that the model predicts for a certain category.
[0109] The loss function for the entire network is:
[0110] L = L b +δL pt
[0111] Here, δ is a scalar that balances the two loss functions. During retraining, the scalar value is continuously optimized to minimize L.
[0112] S6. Use the trained network model to identify the type of goods on each mining truck at the loading point. Specifically, the images captured by the camera are input into the network model, which automatically identifies the goods in the input images and outputs the identification results.
[0113] This embodiment is a coal mine vehicle cargo type identification algorithm trained based on an improved YOLOv5 model. Compared with traditional algorithms, this algorithm has better robustness and accuracy by adjusting the training parameters and network architecture. The improved model is more accurate than other trained models. Moreover, the combined Focal-loss loss function and center function during training are more accurate than a single loss function.
[0114] This technology improves the accuracy of identifying the types of goods on coal mine vehicles, which has certain guiding significance for improving the coal mine management system. It enables the rapid and accurate classification and recording of goods on coal mine vehicles, avoiding the time-consuming and error-prone traditional manual inventory, and greatly improving work efficiency. It also accurately monitors and identifies the goods on coal mine vehicles to ensure that no prohibited or dangerous items are carried during transportation. This helps to protect the safety of miners and equipment, reduce the occurrence of accidents, and enhance safety.
[0115] like Figure 4 As shown, this embodiment provides a coal mine vehicle cargo type identification device based on an improved YOLOv5, including:
[0116] The video data acquisition module is used to acquire video data of each mining truck at the loading point;
[0117] The image processing module is used to preprocess the video data of each mining truck at the loading point to obtain image data of each mining truck at the loading point;
[0118] The network training module is used to obtain a training set by manually standardizing the acquired image data;
[0119] Construct a network model that includes a separation input feature unit, an intermediate representation transformation unit, a separation mechanism transformation unit, and a convolutional unit;
[0120] Model training involves using the constructed training set to train the network model, resulting in a trained network model.
[0121] The identification module is used to identify the type of goods on each mining truck at the loading point using the trained network model.
[0122] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in the various alternative implementations described above.
[0123] In another aspect, this application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiments; or it may exist independently and not assembled into the electronic device. The computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the methods described in the above embodiments.
[0124] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0125] Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, touch terminal, or network device, etc.) to execute the method according to the embodiments of this application.
[0126] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein.
[0127] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A method for identifying the types of cargo transported in coal mines based on an improved YOLOv5 system, characterized in that, include: Acquire video data of each mining truck at the loading point; The video data of each mining truck at the loading point is preprocessed to obtain the image data of each mining truck at the loading point; To construct a training set, the obtained image data is manually standardized to obtain the training set. Construct a network model that includes a separation input feature unit, an intermediate representation transformation unit, a separation mechanism transformation unit, and a convolutional unit; The separate input feature unit divides the input image into K groups based on the number of channels, resulting in K groups of images. Then, each group of images is split to obtain multiple input feature groups. The intermediate representation transformation unit performs a 1×1 convolution on each feature group and then performs attention processing, and finally performs a 3×3 convolution to complete the intermediate feature transformation. The separation mechanism transformation unit fuses the feature groups processed by the intermediate representation unit to obtain the basis array of each K groups. After global average pooling is performed on each K group of basis arrays, attention weighting is applied to the channels corresponding to each basis array. Finally, the data is concatenated to obtain the concatenated data. The concatenated data is then convolved by the convolution unit to obtain the final feature image. Model training involves using the constructed training set to train the network model, resulting in a trained network model. The trained network model is used to identify the types of goods on each mining truck at the loading point.
2. The method for identifying the type of cargo on a coal mine vehicle based on an improved YOLOv5 according to claim 1, characterized in that; The loss function of the network model includes: ; In the formula: L is the loss function of the network model, For the center loss function, Focal Loss function A scalar that balances the center loss function and the Focal Loss function; in, ; For i category features, Let y be the i-th feature center, k represent the number of categories, and y be the label value. ; ; ; In the formula: y is the label value, where y is 1 when the sample is positive and 0 when the sample is negative. To balance the weights of positive and negative samples, the value range is [0,1]. This represents the probability that the model predicts for a certain category.
3. The method for identifying the type of cargo on coal mine vehicles based on an improved YOLOv5 according to claim 1, characterized in that, Methods for obtaining image data of each mining truck at the loading point include: Acquire frame image data from the video data of each mining truck at the loading point, and perform vector transformation on each frame image to obtain a sequence matrix; The obtained sequence matrix is centered to obtain a new sequence matrix; The feature matrix is obtained by decomposing the new sequence matrix. The new sequence matrix is projected onto the feature matrix to obtain a new dataset; Decoding the new dataset yields new frame images, resulting in an image dataset of each mining truck at the loading point.
4. The method for identifying the type of cargo on coal mine vehicles based on an improved YOLOv5 according to claim 1, characterized in that, The network model described is an improved YOLOv5 network model.
5. A coal mine vehicle-mounted cargo type identification device based on an improved YOLOv5, characterized in that, include, The video data acquisition module is used to acquire video data of each mining truck at the loading point; The image processing module is used to preprocess the video data of each mining truck at the loading point to obtain image data of each mining truck at the loading point; The network training module is used to obtain a training set by manually standardizing the acquired image data; Construct a network model that includes a separation input feature unit, an intermediate representation transformation unit, a separation mechanism transformation unit, and a convolutional unit; The separate input feature unit divides the input image into K groups based on the number of channels, resulting in K groups of images. Then, each group of images is split to obtain multiple input feature groups. The intermediate representation transformation unit performs a 1×1 convolution on each feature group and then performs attention processing, and finally performs a 3×3 convolution to complete the intermediate feature transformation. The separation mechanism transformation unit fuses the feature groups processed by the intermediate representation unit to obtain the basis array of each K groups. After global average pooling is performed on each K group of basis arrays, attention weighting is applied to the channels corresponding to each basis array. Finally, the data is concatenated to obtain the concatenated data. The concatenated data is then convolved by the convolution unit to obtain the final feature image. Model training involves using the constructed training set to train the network model, resulting in a trained network model. The identification module is used to identify the type of goods on each mining truck at the loading point using the trained network model.
Citation Information
Patent Citations
Method and device for image recognition
CN110458107A
Improved YOLOv5-based face mask recognition method and system
CN116311417A