Method and device for rapidly identifying and positioning zircon in thin sheet in real time through improved YOLO
By improving the YOLO-zircon algorithm, combined with C3ECA and SPFFCSPC modules, the problem of low efficiency and accuracy of traditional rock sheet identification is solved, and the high-precision and high-efficiency real-time recognition of zircon is achieved, which is suitable for rapid originality in the context of big data bit analysis.
Patent Information
- Application Number
- CN202411404864.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2024-12-20
AI Technical Summary
The traditional rock sheet microscopic identification method has low efficiency, low accuracy, and is time-consuming, making it difficult to meet the needs of rapid in-situ analysis in the context of big data, and is greatly affected by personal experience and complex background characteristics.
The improved YOLO-zircon algorithm is adopted, combined with the C3ECA module and the SPFFCSPC module, and the small object detection layer and receptive field are added, and the real-time video recognition and positioning zircon is realized through deep learning. The C3ECA module and SPPFCSPC module are introduced based on YOLOv5s to optimize the model to improve the Detection accuracy and efficiency.
It realizes high-precision and high-efficiency real-time identification and positioning of zircons, and can quickly and accurately identify zircons in thin film videos, reducing the misjudgment rate and improving the generalization ability of the model.
Smart Images

Figure CN119169276A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of geological rock thin section identification and analysis, and in particular to a method and device for improving YOLO to quickly and in real time identify and locate zircons in thin sections. Background Art
[0002] Zircon is an important mineral used in geological research and production applications such as mineral exploration and development. It records important information such as the age, origin, formation temperature and subsequent evolution of rocks. However, its particle size is at the micron level and its content in rocks is extremely small. For a long time, the method of obtaining zircon is to crush the rock and use the density difference between zircon and other minerals to sort out the zircon. However, as zircon becomes more and more important in scientific research and production applications, cutting the rock into thin slices and locating the zircon in the thin slices can provide more meaningful information for exploring the formation of zircon, the genesis of rocks and the genesis of corresponding minerals.
[0003] Thin-section rock microscopic identification is a traditional mineral identification and classification technology that relies on manual identification and classification based on the crystal properties and optical properties of minerals in thin sections through a polarizing microscope. Since different minerals may show similar characteristics under a polarizing microscope, and due to the long history and complexity of geological evolution, the same mineral may show different characteristics under a polarizing microscope, which can easily lead to misjudgment by the experimenter. Therefore, this traditional identification method requires a high level of geological experience from the experimenter, is highly subjective, and is time-consuming. Zircon has a small particle size and is present in very small quantities in rocks, and its identification characteristics are easily confused with those of other accessory minerals, making the use of traditional rock thin section identification methods to find zircons inefficient and inaccurate, and not conducive to further expansion and application of the method. The high cost and long time required for traditional rock thin section microscopic identification technology make it difficult to meet the data volume requirements in the context of big data, and is not conducive to rapid in-situ analysis. Summary of the invention
[0004] In order to overcome or alleviate one or more of the above technical problems, the purpose of the present invention is to provide a method and device for improving YOLO to quickly and real-time identify and locate zircon in thin slices. The YOLO algorithm series, as a deep learning algorithm for primary target detection, has the characteristics of extremely fast speed and high precision. The present invention adopts YOLO-zircon to add a small target detection layer on the basis of YOLOv5s to adapt to the characteristics of small zircon particle size. At the same time, the C3ECA module combining the C3 module and the ECA attention mechanism is introduced to suppress the negative impact of the complex background of the thin slice and thus improve the detection accuracy. The SPPCSPC module is optimized to the SPPFCSPC module by reference to the SPFF spatial pyramid pooling module. While maintaining the characteristic information of the zircon small target as much as possible, the receptive field is increased to improve the accuracy and efficiency of the model. The training weight file after YOLO-zircon training is introduced into the screen real-time monitoring code to realize the function of real-time video recognition and positioning of zircon in thin slices. After experimental analysis, YOLO-zircon is confirmed to have high effect indicators and can carry out high-precision and high-efficiency real-time recognition and positioning of zircon based on thin slice videos.
[0005] The present invention provides the following technical solutions:
[0006] In a first aspect, the present invention provides a method for improving YOLO to quickly and in real time identify and locate zircon in a thin slice, which comprises the following steps:
[0007] S1: Obtain zircon thin slice images under the microscope, including orthogonal light images and single polarization images, pre-process the images and mark the zircons to produce a zircon detection data set;
[0008] S2: setting the zircon detection data set described in step S1 as a training set and a verification set according to a preset ratio, and storing them in a specified zircon file path;
[0009] S3: Build the YOLO-zircon grid model;
[0010] S4: Put the training set and validation set of step S2 into the YOLO-zircon grid model described in step S3 for training, obtain the grid model training weight file and effect index, continuously optimize the training weight file through back propagation, gradually improve the effect index, and stop training when the effect index is stable; finally, obtain the best training weight file of the YOLO-zircon grid model;
[0011] S5: Load the optimal training weight file in step S4 into the screen real-time monitoring code to achieve real-time video recognition and positioning of zircon in the slice.
[0012] According to some implementation modes, the step S1 is specifically:
[0013] A large number of polarizing microscope images of zircons from different matrix rocks were obtained. For each zircon, at least one single polarization image and at least two orthogonal polarization images with different rotation angles were taken. The zircon positions in each image were first recorded through txt tags to make a label file. Each image was then uniformly cropped, and then preprocessed by rotation, flipping, and translation to make an image file. Finally, the image files and corresponding label files were made into a zircon detection dataset.
[0014] According to some embodiments, in step S2, the zircon detection data set is divided into a training set and a validation set in a ratio of 8:2.
[0015] According to some implementation modes, the step S3 is specifically:
[0016] The YOLO-zircon grid model is built based on PYTHON code. The YOLO-zircon network model adds a 10*10 small target detection layer and introduces a C3ECA module and a SPFFCSPC module.
[0017] The YOLO-zircon network model includes a backbone network, a neck and a head, wherein the backbone network includes a first Conv module, a second Conv module, a first C3 module, a third Conv module, a second C3 module, a fourth Conv module, a first C3ECA module, a fifth Conv module, a second C3ECA module and a first SPFFCSPC module which are linked in sequence;
[0018] The neck includes a sixth Conv module, a first Upsample module, a first Concat module, a third C3 module, a seventh Conv module, a second Upsample module, a second Concat module, a fourth C3 module, an eighth Conv module, a third Upsample module, a third Concat module, a fifth C3 module, a ninth Conv module, a fourth Concat module, a third C3ECA module, a tenth Conv module, a fifth Concat module, a fourth C3ECA module, an eleventh Conv module, a sixth Concat module and a fifth C3ECA module, which are linked in sequence;
[0019] The head includes a first Detect module, a second Detect module, a third Detect module and a fourth Detect module which are independent of each other;
[0020] The first C3 module is linked to the third Concat module, the second C3 module is linked to the second Concat module, the first C3ECA module is linked to the first Concat module, the first SPFFCSPC module is linked to the sixth Conv module, the sixth Conv module is linked to the sixth Concat module, the seventh Conv module is linked to the fifth Concat module, the eighth Conv module is linked to the fourth Concat module, the fifth C3 module is linked to the first Detect module, the third C3ECA module is linked to the second Detect module, the fourth C3ECA module is linked to the third Detect module, and the fifth C3ECA module is linked to the fourth Detect module.
[0021] According to some implementation modes, step S5 is specifically:
[0022] The real-time screen monitoring code is built based on PYTHON code. First, the mss module is introduced to take a screenshot of the specified position on the screen; then the optimal training weight file of the YOLO-zircon grid model in step S4 is introduced through the torch module to detect zircon in the screenshot; finally, the detection result is presented through the cv2 module. The above process is repeated continuously to realize real-time video recognition and positioning of zircon in the thin slice.
[0023] In a second aspect, the present invention provides an improved YOLO device for quickly and in real time identifying and locating zircon in a thin slice, comprising:
[0024] The data set collection module is used to obtain zircon thin-section images under the microscope, including orthogonal light images and single polarization images, pre-process the images and mark the zircons to produce zircon detection data sets;
[0025] A data set division module, used to set the zircon detection data set into a training set and a validation set according to a preset ratio, and store them in a specified zircon file path;
[0026] Building module for building YOLO-zircon grid model;
[0027] A training module is used to put the training set and the validation set into the YOLO-zircon grid model for training, obtain a grid model training weight file and an effect index, continuously optimize the training weight file through back propagation, gradually improve the effect index, stop training when the effect index is stable, and finally obtain the best training weight file of the YOLO-zircon grid model;
[0028] The real-time identification and positioning module loads the optimal training weight file into the screen real-time monitoring code to realize real-time video identification and positioning of zircon in the slice.
[0029] According to some embodiments, the data set collection module collects zircon images under a zircon microscope, collects at least one single polarization image and at least two orthogonal polarization images at different rotation angles for each zircon, and after marking the zircon, performs cropping, flipping, rotation, and translation preprocessing to produce a zircon detection data set.
[0030] According to some embodiments, the data set division module divides the zircon detection data set into a training set and a validation set in a ratio of 8:2.
[0031] According to some embodiments, the building module is used to build a YOLO-zircon grid model; the YOLO-zircon grid model is built based on PYTHON code, and the YOLO-zircon network model is to add a 10*10 small target detection layer and introduce a C3ECA module and a SPFFCSPC module;
[0032] The YOLO-zircon network model includes a backbone network, a neck and a head, wherein the backbone network includes a first Conv module, a second Conv module, a first C3 module, a third Conv module, a second C3 module, a fourth Conv module, a first C3ECA module, a fifth Conv module, a second C3ECA module and a first SPFFCSPC module which are linked in sequence;
[0033] The neck includes a sixth Conv module, a first Upsample module, a first Concat module, a third C3 module, a seventh Conv module, a second Upsample module, a second Concat module, a fourth C3 module, an eighth Conv module, a third Upsample module, a third Concat module, a fifth C3 module, a ninth Conv module, a fourth Concat module, a third C3ECA module, a tenth Conv module, a fifth Concat module, a fourth C3ECA module, an eleventh Conv module, a sixth Concat module and a fifth C3ECA module, which are linked in sequence;
[0034] The head includes a first Detect module, a second Detect module, a third Detect module and a fourth Detect module which are independent of each other;
[0035] The first C3 module is linked to the third Concat module, the second C3 module is linked to the second Concat module, the first C3ECA module is linked to the first Concat module, the first SPFFCSPC module is linked to the sixth Conv module, the sixth Conv module is linked to the sixth Concat module, the seventh Conv module is linked to the fifth Concat module, the eighth Conv module is linked to the fourth Concat module, the fifth C3 module is linked to the first Detect module, the third C3ECA module is linked to the second Detect module, the fourth C3ECA module is linked to the third Detect module, and the fifth C3ECA module is linked to the fourth Detect module.
[0036] According to some embodiments, the real-time screen monitoring code is constructed based on PYTHON code, and the real-time identification and positioning module first introduces the mss module to take a screenshot of the specified position on the screen; then introduces the best training weight file of the YOLO-zircon grid model through the torch module to detect zircon in the screenshot; finally, the detection results are presented through the cv2 module, and the above process is repeated continuously to realize real-time video identification and positioning of zircon in the thin slice.
[0037] Compared with the prior art, the present invention has the following beneficial effects:
[0038] 1. In the method for improving YOLO to quickly and in real time identify and locate zircons in thin slices provided by the present invention, the zircon detection data set of step S1 collects zircon polarized images to obtain excellent zircon contour data, collects zircon orthogonal light images to obtain excellent zircon color data, and collects orthogonal polarized images of the same zircon at different rotation angles to effectively improve the generalization ability of the model. This combination of data sets can effectively improve the final effect index of the model.
[0039] 2. In step S1 of the present invention, the zircon detection data set images are cropped to a uniform size to facilitate subsequent training. By preprocessing the zircon detection data set images by cropping, flipping, rotating, and translating, the number of data sets is effectively increased and overfitting is prevented.
[0040] 3. In step S3 of the present invention, the YOLO-zircon grid model introduces a small target detection layer to adapt to the small particle size of zircon, introduces a C3ECA attention mechanism module to suppress the negative impact of the complex background of the thin slice and thus improve the detection accuracy of zircon, and introduces an SPPFCSPC pyramid pooling module to maintain the small target feature information of zircon while increasing the receptive field and improving the model efficiency.
[0041] 4. Step S3 of the present invention is based on the extremely fast detection speed of YOLO-zircon. By using PYTHON code, the selected area of the screen is repeatedly captured, identified, and presented by introducing the YOLO-zircon optimal training weight file and mss and torch modules, so as to achieve the real-time video recognition and positioning function. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 A schematic flow chart of a method for improving YOLO to quickly and in real time identify and locate zircon in a thin slice provided in an embodiment of the present invention.
[0043] Figure 2 A schematic diagram of the grid structure of YOLO-zircon provided in an embodiment of the present invention.
[0044] Figure 3 A schematic diagram of the structure of an improved YOLO device for quickly and in real time identifying and locating zircon in a thin slice provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0045] The present invention is described in detail below in conjunction with the embodiments and drawings, but it should be understood that the embodiments and drawings are only used to exemplify the present invention and do not constitute any limitation on the protection scope of the present invention. All reasonable changes and combinations within the scope of the inventive concept of the present invention fall within the protection scope of the present invention.
[0046] The present invention will be further described below in conjunction with the accompanying drawings.
[0047] Example 1
[0048] Please refer to Figure 1 This embodiment provides a better method for quickly and in real time identifying and locating zircon in a thin slice based on improved YOLO, comprising the following steps:
[0049] Step 1, obtaining zircon thin slice images under the microscope, including orthogonal light images and single polarization images, pre-processing the images and marking the zircons to produce a zircon detection data set;
[0050] Specifically, a large number of polarized microscope images of zircons from different parent rocks were obtained. For each zircon, one single polarized image and two or three orthogonal polarized images with different rotation angles were taken. The zircon positions in each image were first recorded through txt tags to make a label file, and then each image was uniformly cropped to a size of 640*640, and rotated, flipped, and translated to make an image file. Finally, the image file and the corresponding label file were made into a zircon detection data set.
[0051] The advantage of step 1 is that the zircon detection dataset collects zircon polarized images to obtain excellent zircon contour data, collects zircon orthogonal light images to obtain excellent zircon color data, and collects orthogonal polarized images of the same zircon at different rotation angles to effectively improve the generalization ability of the model. This dataset combination can effectively improve the final effect index of the model.
[0052] Step 2: Set the zircon detection data set in step 1 as a training set and a validation set according to a preset ratio, and store them in a specified zircon file path;
[0053] Specifically, the zircon detection data set is divided into a training set and a validation set in a ratio of 8:2. The training set is stored in the specified zircon file train, and the validation set is stored in the specified zircon file val. The mineral type, name, training set and test set file path are marked in the yaml file;
[0054] The advantage of step 2 is that the images of the zircon detection dataset are cropped to a uniform size, which is convenient for subsequent training. By preprocessing the images of the zircon detection dataset by cropping, flipping, rotating, and translating, the number of datasets can be effectively increased and overfitting can be prevented.
[0055] Step 3, please refer to Figure 2 , build the YOLO-zircon grid model;
[0056] Specifically, the YOLO-zircon network model includes a backbone network, a neck, and a head. The backbone network includes a first Conv module, a second Conv module, a first C3 module, a third Conv module, a second C3 module, a fourth Conv module, a first C3ECA module, a fifth Conv module, a second C3ECA module, and a first SPFFCSPC module, which are linked in sequence.
[0057] The neck comprises a sixth Conv module, a first Upsample module, a first Concat module, a third C3 module, a seventh Conv module, a second Upsample module, a second Concat module, a fourth C3 module, an eighth Conv module, a third Upsample module, a third Concat module, a fifth C3 module, a ninth Conv module, a fourth Concat module, a third C3ECA module, a tenth Conv module, a fifth Concat module, a fourth C3ECA module, an eleventh Conv module, a sixth Concat module, and a fifth C3ECA module, which are linked in sequence;
[0058] The head includes a first Detect module, a second Detect module, a third Detect module, and a fourth Detect module, each of which is independent;
[0059] The first C3 module is linked to the third Concat module, the second C3 module is linked to the second Concat module, the first C3ECA module is linked to the first Concat module, the first SPFFCSPC module is linked to the sixth Conv module, the sixth Conv module is linked to the sixth Concat module, the seventh Conv module is linked to the fifth Concat module, the eighth Conv module is linked to the fourth Concat module, the fifth C3 module is linked to the first Detect module, the third C3ECA module is linked to the second Detect module, the fourth C3ECA module is linked to the third Detect module, and the fifth C3ECA module is linked to the fourth Detect module.
[0060] The advantage of step 3 is that the YOLO-zircon grid model introduces a 10*10 small target detection layer to adapt to the small particle size of zircon, introduces the C3ECA attention mechanism module to suppress the negative impact of the complex background of the thin slice and thus improve the detection accuracy of zircon, and introduces the SPPFCSPC pyramid pooling module to maintain the characteristic information of the small target of zircon while increasing the receptive field and improving the model efficiency;
[0061] Step 4: Put the training set and validation set in step 2 into the YOLO-zircon grid model in step 3 for training, obtain the grid model training weight file and effect index, continuously optimize the training weight file through back propagation, and gradually improve the effect index. Stop training when the effect index is stable. Finally, get the best training weight file of the YOLO-zircon grid model;
[0062] Specifically, the performance indicators are mainly precision, recall, and Ap50. The definition of precision is precision =
[0063] TP / (TP+FP). TP is the actual positive example of the predicted positive example, and FP is the actual negative example of the predicted positive example. The higher the accuracy, the better the effect index;
[0064] The definition of recall is: recall = TP / (TP+FN). TP is the actual positive example of the predicted positive example, and FN is the actual positive example of the predicted negative example. The higher the recall rate, the better the effect index;
[0065] The definition of Ap50 is to calculate the AP of all images in each category when IoU is set to 0.5, and then average all categories. IoU is defined as the intersection area of the predicted box and the true box / the union area of the predicted box and the true box. AP refers to the area under the PR curve on the PR curve. The higher the Ap50, the better the effect index.
[0066] Step 5, put the best training weight file in step 4 into the screen real-time monitoring code to achieve the function of real-time video recognition and positioning of zircon in the slice;
[0067] Specifically, the real-time screen monitoring code is built based on PYTHON code. The core idea is to introduce the mss module to take a screenshot of the specified position on the screen, and then introduce the best training weight file of the YOLO-zircon grid model in step 4 through the torch module to detect zircon in the screenshot. Finally, the detection results are presented through the cv2 module. The above process is repeated continuously to achieve the function of real-time video recognition and positioning of zircon in thin slices.
[0068] The advantage of step 5 is that based on the fast detection speed of YOLO-zircon, the Python code is used to repeatedly capture, identify, and present the selected area of the screen by introducing the YOLO-zircon optimal training weight file and the mss and torch modules, thereby achieving real-time video recognition and positioning functions.
[0069] Experimental analysis is performed. The results of the experiment on the YOLO-zircon network model of this embodiment on a detection data set consisting of 471 test images and 81 verification images are shown in Table 1. The YOLO-zircon of this embodiment has good performance in terms of precision, recall rate, and Ap50 effect indicators.
[0070] Table 1. YOLO-zircon grid model prediction effect indicators
[0071] Mesh Model Accuracy Recall Ap50 YOLO-zircon 0.94 0.89 0.95
[0072] Example 2
[0073] Please refer to Figure 3 This embodiment provides a device for improving YOLO to quickly and in real time identify and locate zircon in a thin slice. Please refer to Figure 3 , the device comprises:
[0074] The data set collection module is used to collect zircon images under a polarized microscope. For each zircon, one single polarized image and two or three orthogonal polarized images with different rotation angles are collected. After marking the zircon, cropping, flipping, rotation, and translation preprocessing are performed.
[0075] The data set division module is used to divide the zircon detection data set into a training set and a validation set in a ratio of 8:2, store them in the specified file path, and create a YAML file record;
[0076] Building module, building YOLO-zircon grid model;
[0077] The training module continuously optimizes the training weight parameters through back propagation to improve the performance indicators until the best training weight file with the best performance indicators is obtained;
[0078] The real-time identification and positioning module puts the best training weight file into the real-time screen monitoring code to realize the real-time video recognition and positioning of zircon in the thin slice. The real-time screen monitoring code is built based on the PYTHON code. Specifically, the mss module is introduced to take a screenshot of the specified position of the screen, and then the best training weight file of the YOLO-zircon grid model in step 4 is introduced through the torch module to detect zircon in the screenshot. Finally, the detection results are presented through the cv2 module. The above process is repeated continuously to achieve the function of real-time video recognition and positioning of zircon in the thin slice.
[0079] The above embodiments are only preferred implementations of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.
Claims
1. A method for improving YOLO to quickly and in real time identify and locate zircon in thin slices, characterized in that: The following steps are involved: S1: Obtain zircon thin slice images under the microscope, including orthogonal light images and single polarization images, pre-process the images and mark the zircons to produce a zircon detection data set; S2: setting the zircon detection data set described in step S1 as a training set and a verification set according to a preset ratio, and storing them in a specified zircon file path; S3: Build the YOLO-zircon grid model; S4: Put the training set and validation set of step S2 into the YOLO-zircon grid model described in step S3 for training, obtain the grid model training weight file and effect index, continuously optimize the training weight file through back propagation, gradually improve the effect index, and stop training when the effect index is stable; finally, obtain the best training weight file of the YOLO-zircon grid model; S5: Load the optimal training weight file in step S4 into the screen real-time monitoring code to achieve real-time video recognition and positioning of zircon in the slice.
2. According to claim 1, the method for improving YOLO to quickly and in real time identify and locate zircon in thin slices is characterized in that: The step S1 is specifically as follows: A large number of polarizing microscope images of zircons from different matrix rocks were obtained. For each zircon, at least one single polarization image and at least two orthogonal polarization images with different rotation angles were taken. The zircon positions in each image were first recorded through txt tags to make a label file. Each image was then uniformly cropped, and then preprocessed by rotation, flipping, and translation to make an image file. Finally, the image files and corresponding label files were made into a zircon detection dataset.
3. According to claim 2, the method for improving YOLO to quickly and in real time identify and locate zircon in thin slices is characterized in that: In the step S2, the zircon detection data set is divided into a training set and a validation set in a ratio of 8:
2.
4. According to claim 3, the method for improving YOLO to quickly and in real time identify and locate zircon in thin slices is characterized in that: The step S3 is specifically: The YOLO-zircon grid model is built based on PYTHON code. The YOLO-zircon network model adds a 10*10 small target detection layer and introduces a C3ECA module and a SPFFCSPC module. The YOLO-zircon network model includes a backbone network, a neck and a head, wherein the backbone network includes a first Conv module, a second Conv module, a first C3 module, a third Conv module, a second C3 module, a fourth Conv module, a first C3ECA module, a fifth Conv module, a second C3ECA module and a first SPFFCSPC module which are linked in sequence; The neck includes a sixth Conv module, a first Upsample module, a first Concat module, a third C3 module, a seventh Conv module, a second Upsample module, a second Concat module, a fourth C3 module, an eighth Conv module, a third Upsample module, a third Concat module, a fifth C3 module, a ninth Conv module, a fourth Concat module, a third C3ECA module, a tenth Conv module, a fifth Concat module, a fourth C3ECA module, an eleventh Conv module, a sixth Concat module and a fifth C3ECA module, which are linked in sequence; The head includes a first Detect module, a second Detect module, a third Detect module and a fourth Detect module which are independent of each other; The first C3 module is linked to the third Concat module, the second C3 module is linked to the second Concat module, the first C3ECA module is linked to the first Concat module, the first SPFFCSPC module is linked to the sixth Conv module, the sixth Conv module is linked to the sixth Concat module, the seventh Conv module is linked to the fifth Concat module, the eighth Conv module is linked to the fourth Concat module, the fifth C3 module is linked to the first Detect module, the third C3ECA module is linked to the second Detect module, the fourth C3ECA module is linked to the third Detect module, and the fifth C3ECA module is linked to the fourth Detect module.
5. According to claim 4, the method for improving YOLO to quickly and in real time identify and locate zircon in thin slices is characterized in that: The step S5 is specifically: The real-time screen monitoring code is built based on PYTHON code. First, the mss module is introduced to take a screenshot of the specified position on the screen; then the optimal training weight file of the YOLO-zircon grid model in step S4 is introduced through the torch module to detect zircon in the screenshot; finally, the detection result is presented through the cv2 module. The above process is repeated continuously to realize real-time video recognition and positioning of zircon in the thin slice.
6. An improved YOLO device for rapid real-time identification and positioning of zircon in thin slices, characterized in that: include: The data set collection module is used to obtain zircon thin-section images under the microscope, including orthogonal light images and single polarization images, pre-process the images and mark the zircons to produce zircon detection data sets; A data set division module, used to set the zircon detection data set into a training set and a validation set according to a preset ratio, and store them in a specified zircon file path; Building module for building YOLO-zircon grid model; A training module is used to put the training set and the validation set into the YOLO-zircon grid model for training, obtain a grid model training weight file and an effect index, continuously optimize the training weight file through back propagation, gradually improve the effect index, stop training when the effect index is stable, and finally obtain the best training weight file of the YOLO-zircon grid model; The real-time identification and positioning module is used to load the optimal training weight file into the screen real-time monitoring code to realize real-time video identification and positioning of zircon in the thin slice.
7. The device for improving YOLO to quickly and real-time identify and locate zircon in a thin slice according to claim 6, characterized in that: The data set collection module collects zircon images under a zircon microscope, collects at least one single polarization image and at least two orthogonal polarization images at different rotation angles for each zircon, and after marking the zircon, performs cropping, flipping, rotation, and translation preprocessing to produce a zircon detection data set.
8. The device for improving YOLO to quickly and real-time identify and locate zircon in a thin slice according to claim 7, characterized in that: The data set division module divides the zircon detection data set into a training set and a validation set in a ratio of 8:
2.
9. The device for improving YOLO for fast and real-time identification and positioning of zircon in thin slices according to claim 8, characterized in that: The building module is used to build a YOLO-zircon grid model; The YOLO-zircon grid model is built based on PYTHON code. The YOLO-zircon network model adds a 10*10 small target detection layer and introduces a C3ECA module and a SPFFCSPC module. The YOLO-zircon network model includes a backbone network, a neck and a head, wherein the backbone network includes a first Conv module, a second Conv module, a first C3 module, a third Conv module, a second C3 module, a fourth Conv module, a first C3ECA module, a fifth Conv module, a second C3ECA module and a first SPFFCSPC module which are linked in sequence; The neck includes a sixth Conv module, a first Upsample module, a first Concat module, a third C3 module, a seventh Conv module, a second Upsample module, a second Concat module, a fourth C3 module, an eighth Conv module, a third Upsample module, a third Concat module, a fifth C3 module, a ninth Conv module, a fourth Concat module, a third C3ECA module, a tenth Conv module, a fifth Concat module, a fourth C3ECA module, an eleventh Conv module, a sixth Concat module and a fifth C3ECA module, which are linked in sequence; The head includes a first Detect module, a second Detect module, a third Detect module and a fourth Detect module which are independent of each other; The first C3 module is linked to the third Concat module, the second C3 module is linked to the second Concat module, the first C3ECA module is linked to the first Concat module, the first SPFFCSPC module is linked to the sixth Conv module, the sixth Conv module is linked to the sixth Concat module, the seventh Conv module is linked to the fifth Concat module, the eighth Conv module is linked to the fourth Concat module, the fifth C3 module is linked to the first Detect module, the third C3ECA module is linked to the second Detect module, the fourth C3ECA module is linked to the third Detect module, and the fifth C3ECA module is linked to the fourth Detect module.
10. The device for improving YOLO to quickly and in real time identify and locate zircon in a thin slice according to claim 9, characterized in that: The real-time screen monitoring code is built based on PYTHON code. The real-time identification and positioning module first introduces the mss module to take a screenshot of the specified position on the screen; then the best training weight file of the YOLO-zircon grid model is introduced through the torch module to detect zircon in the screenshot; finally, the detection results are presented through the cv2 module, and the above process is repeated continuously to realize real-time video recognition and positioning of zircon in the thin slice.
Citation Information
Cited By
Method and system for automatically identifying and segmenting zircon-quartz artifacts and quantitatively characterizing
CN120564167A
