Method, device, terminal, storage medium and product for detecting polyacrylonitrile filaments
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANXI GANGKE CARBON MATERIAL CO LTD
- Filing Date
- 2026-05-07
- Publication Date
- 2026-08-04
AI Technical Summary
[0005]本发明的目的在于,提供一种聚丙烯腈原丝的检测方法、装置、计算机终端、计算机可读存储介质和计算机程序产品,以解决相关方案中对于聚丙烯腈原丝的截面直径的检测主要依赖人工检测,但人工检测的效率低且精准性差,不利于聚丙烯腈(PAN)原丝纤维的生产调控的问题,达到通过基于聚丙烯腈原丝的截面图像,利用训练得到的YOLOv8目标检测模型实现聚丙烯腈原丝的截面检测,提高检测效率和精准性,有利于聚丙烯腈原丝纤维的生产调控的效果
[0018] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention.
Smart Images

Figure CN122510187A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of fiber material performance testing technology, specifically relating to a method, apparatus, computer terminal, computer-readable storage medium, and computer program product for testing polyacrylonitrile precursor fibers. More specifically, it relates to an automatic analysis method, apparatus, computer terminal, computer-readable storage medium, and computer program product for the microscopic cross-sectional morphology of polyacrylonitrile precursor fibers. In particular, it relates to a method, apparatus, computer terminal, computer-readable storage medium, and computer program product for detecting the cross-sectional diameter and number of polyacrylonitrile precursor fibers based on the YOLOv8 target detection model. Background Technology
[0002] Carbon fiber, as a high-performance material, is widely used in aerospace, defense, and automotive manufacturing. The performance of polyacrylonitrile (PAN)-based carbon fiber largely depends on the quality of its precursor—the precursor fiber (i.e., PAN precursor yarn). PAN precursor yarn is composed of a large number of monofilaments (i.e., PAN monofilaments), forming a bundle of PAN precursor yarn. During the production of PAN precursor yarn, several indicators need to be monitored, among which the cross-sectional morphology of the monofilaments (including diameter distribution, shape, and number of strands) is an important parameter characterizing the discreteness of the monofilaments and the stability of the process. By detecting these parameters (such as the diameter distribution, shape, and number of strands in the cross-sectional morphology of the monofilaments in PAN precursor yarn), the coagulation bath temperature, draw ratio, spinneret condition, and other process conditions of the PAN precursor yarn can be reflected, providing guidance for the production control of PAN precursor yarn.
[0003] Regarding the detection of the cross-sectional diameter of polyacrylonitrile precursor fibers, the relevant schemes mainly rely on manual detection. However, manual detection is inefficient and inaccurate, which is not conducive to the production control of polyacrylonitrile (PAN) precursor fibers.
[0004] The above content is only used to help understand the technical solution of the present invention and does not represent an admission that the above content is prior art. Summary of the Invention
[0005] The purpose of this invention is to provide a method, apparatus, computer terminal, computer-readable storage medium, and computer program product for detecting polyacrylonitrile (PAN) precursor fibers. This addresses the problem that in related solutions, the detection of the cross-sectional diameter of PAN precursor fibers mainly relies on manual inspection, which is inefficient and inaccurate, hindering the production control of PAN precursor fibers. The invention achieves cross-sectional detection of PAN precursor fibers by using a trained YOLOv8 target detection model based on cross-sectional images of the PAN precursor fibers, thereby improving detection efficiency and accuracy and facilitating the production control of PAN precursor fibers.
[0006] This invention provides a method for detecting polyacrylonitrile precursor fibers, comprising: acquiring cross-sectional images of each sample in a pre-selected sample group of polyacrylonitrile precursor fibers, thereby obtaining cross-sectional images of all samples in the sample group, forming a sample cross-sectional image set of the sample group; preprocessing each sample cross-sectional image in the sample cross-sectional image set of the sample group, thereby obtaining a preprocessed image of each sample cross-sectional image; thereby obtaining preprocessed images of all sample cross-sectional images in the sample cross-sectional image set of the sample group, forming a sample cross-sectional preprocessed image set of the sample group; and segmenting local regions with preset features based on the sample cross-sectional preprocessed image set of the sample group. A predetermined number of sub-images are obtained as the sample cross-sectional image sample set of the sample group. For the pre-selected YOLOv8 network, the cross-sectional image of the polyacrylonitrile precursor fiber is used as input and the cross-sectional detection result of the polyacrylonitrile precursor fiber is used as output. The network is trained and tested based on the sample cross-sectional preprocessed image set of the sample group to obtain the cross-sectional detection model of the polyacrylonitrile precursor fiber. For the polyacrylonitrile precursor fiber to be detected, the cross-sectional image of the polyacrylonitrile precursor fiber to be detected is obtained. Using the cross-sectional detection model of the polyacrylonitrile precursor fiber, the cross-sectional detection of the polyacrylonitrile precursor fiber to be detected is realized based on the cross-sectional image of the polyacrylonitrile precursor fiber to be detected.
[0007] In some embodiments, the cross-sectional inspection results of the polyacrylonitrile precursor fiber include at least one of the following: the diameter of the monofilament, the number of monofilaments, and the classification result in the cross-section of the polyacrylonitrile precursor fiber; the classification result includes at least one of the following: a first judgment result indicating whether the cross-section of the polyacrylonitrile precursor fiber is an intact cross-section or a damaged cross-section; the number of polyacrylonitrile precursor fibers with intact cross-sections; the number of polyacrylonitrile precursor fibers with damaged cross-sections; a second judgment result indicating whether the diameter of the monofilament in the cross-section of the polyacrylonitrile precursor fiber is too large, too small, or acceptable compared to the standard diameter when the cross-section of the polyacrylonitrile precursor fiber is an intact cross-section; the number of polyacrylonitrile precursor fibers with a diameter too large compared to the standard diameter; the number of polyacrylonitrile precursor fibers with a diameter too small compared to the standard diameter; and the number of polyacrylonitrile precursor fibers with a diameter acceptable compared to the standard diameter.
[0008] In some embodiments, preprocessing is performed on each sample cross-sectional image in the sample cross-sectional image set of the sample group to obtain a preprocessed image for each sample cross-sectional image, including: for each sample cross-sectional image in the sample cross-sectional image set of the sample group, using an adaptive binarization algorithm, calculating the mean pixel grayscale value in the local neighborhood of each pixel in each sample cross-sectional image; thereby obtaining the mean pixel grayscale value in the local neighborhood of all pixels in each sample cross-sectional image; calculating an adaptive threshold for each pixel in each sample cross-sectional image based on the mean pixel grayscale value in the local neighborhood of each pixel in each sample cross-sectional image and a preset threshold adjustment value; thereby obtaining the adaptive threshold for all pixels in each sample cross-sectional image; and performing binarization processing on the local neighborhood of each pixel in each sample cross-sectional image based on the adaptive threshold of each pixel in each sample cross-sectional image to obtain the binary image of the local neighborhood of each pixel in each sample cross-sectional image. The image is converted into a binary image. This yields a binarized image of the local neighborhood of all pixels in each sample cross-section image, which serves as the preprocessed image for each sample cross-section image. Alternatively, for each sample cross-section image in the sample cross-section image set of the sample group, an integral image algorithm is used to calculate the gray-level integral image of each sample cross-section image. Using the gray-level integral image of each sample cross-section image, the average gray-level value of pixels in the local neighborhood of each pixel in each sample cross-section image is calculated. This yields the average gray-level value of pixels in the local neighborhood of all pixels in each sample cross-section image. An adaptive binarization algorithm is used to binarize the local neighborhood of each pixel in each sample cross-section image according to an adaptive threshold, resulting in a binarized image of the local neighborhood of each pixel in each sample cross-section image. This yields a binarized image of the local neighborhood of all pixels in each sample cross-section image, which serves as the preprocessed image for each sample cross-section image.
[0009] In some embodiments, based on the sample cross-section preprocessed image set of the sample group, local region images with preset features are segmented as sub-images to obtain a preset number of sub-images as the sample cross-section image sample set of the sample group. This includes: based on the sample cross-section preprocessed image set of the sample group, segmenting local region images with preset features as sub-images according to at least one of the following preset rules; marking the obtained preset number of sub-images to distinguish between complete cross-sections and damaged cross-sections in the preset number of sub-images, thereby obtaining the sample cross-section image sample set of the sample group; wherein, at least one preset rule includes at least one of the following: First preset rule: at least one of the cross-sectional shape, cross-sectional diameter, and monofilament distribution in the cross-section of the sample cross-section preprocessed image can represent the sample corresponding to the sample. The corresponding characteristics of the fiber; the second preset rule: the sample cross-section image corresponding to the sample cross-section preprocessing image has a case of unclear focus; the third preset rule: there are monofilaments with a diameter greater than or less than the standard diameter in the sample cross-section preprocessing image; the fourth preset rule: at least one of the distribution density of monofilaments and the tightness of the adhesion between adjacent monofilaments in the sample cross-section preprocessing image is different from other sample cross-section preprocessing images or other areas; the fifth preset rule: the case where there is a gap in the outline of the monofilament cross-section in the sample cross-section preprocessing image or the case where the monofilament cross-section is separated into at least two parts is defined as a damaged cross-section, and the damaged cross-section in the sample cross-section preprocessing image is removed if the cross-section detection result of the polyacrylonitrile precursor fiber includes the diameter of the monofilament in the cross-section of the polyacrylonitrile precursor fiber.
[0010] In some implementations, for a pre-selected YOLOv8 network, using the cross-sectional image of the polyacrylonitrile precursor fiber as input and the cross-sectional detection result of the polyacrylonitrile precursor fiber as output, training and testing are performed based on the sample cross-section preprocessed image set of the sample group to obtain the cross-sectional detection model of the polyacrylonitrile precursor fiber. This includes: dividing the sample cross-section preprocessed image set of the sample group into a training set and a test set; for the pre-selected YOLOv8 network, using the training set, using the cross-sectional image of the polyacrylonitrile precursor fiber as input and the cross-sectional detection result of the polyacrylonitrile precursor fiber as output, training is performed according to a preset training objective to obtain a training model of the YOLOv8 network; using the test set, according to a preset testing objective, the training model of the YOLOv8 network is tested and updated to obtain a test model of the YOLOv8 network, which serves as the cross-sectional detection model of the polyacrylonitrile precursor fiber.
[0011] In some implementations, the cross-sectional detection model of the polyacrylonitrile precursor fiber is used to detect the cross-section of the polyacrylonitrile precursor fiber based on the cross-sectional image of the fiber to be detected. This includes: inputting the cross-sectional image of the polyacrylonitrile precursor fiber to be detected into the cross-sectional detection model of the polyacrylonitrile precursor fiber under the PyTorch architecture to output the cross-sectional detection result of the polyacrylonitrile precursor fiber to be detected; and visualizing and / or displaying the cross-sectional detection result of the polyacrylonitrile precursor fiber to be detected in a preset display mode.
[0012] In conjunction with the above method, another aspect of the present invention provides a detection device for polyacrylonitrile precursor fibers, comprising: an acquisition unit configured to acquire a cross-sectional image of each sample in a pre-selected sample group of polyacrylonitrile precursor fibers, thereby obtaining cross-sectional images of all samples in the sample group, forming a sample cross-sectional image set of the sample group; a control unit configured to preprocess each sample cross-sectional image in the sample cross-sectional image set of the sample group, thereby obtaining a preprocessed image of each sample cross-sectional image, thereby obtaining a preprocessed image of all sample cross-sectional images in the sample cross-sectional image set of the sample group, forming a sample cross-sectional preprocessed image set of the sample group; the control unit is further configured to segment local regions with preset features based on the sample cross-sectional preprocessed image set of the sample group. The domain image is used as a sub-image, and a preset number of sub-images are obtained as the sample cross-sectional image sample set of the sample group. The control unit is further configured to train and test a pre-selected YOLOv8 network based on the cross-sectional image of the polyacrylonitrile precursor fiber as input and the cross-sectional detection result of the polyacrylonitrile precursor fiber as output, to obtain the cross-sectional detection model of the polyacrylonitrile precursor fiber. The acquisition unit is further configured to acquire the cross-sectional image of the polyacrylonitrile precursor fiber to be detected. The control unit is further configured to use the cross-sectional detection model of the polyacrylonitrile precursor fiber to realize the cross-sectional detection of the polyacrylonitrile precursor fiber to be detected based on the cross-sectional image of the polyacrylonitrile precursor fiber to be detected.
[0013] In conjunction with the above-described device, the present invention further provides a computer terminal, comprising: the detection device for polyacrylonitrile precursor fibers described above.
[0014] In conjunction with the above method, the present invention further provides a computer-readable storage medium comprising a stored program, wherein, when the program is executed, it controls the device on which the computer-readable storage medium is located to perform the steps of the above-described method for detecting polyacrylonitrile precursor fibers.
[0015] In conjunction with the above method, the present invention further provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described method for detecting polyacrylonitrile precursor fibers.
[0016] The present invention involves acquiring cross-sectional images of each sample in a pre-selected group of polyacrylonitrile precursor fibers, thereby obtaining cross-sectional images of all samples in the group, forming a sample cross-sectional image set; preprocessing each sample cross-sectional image in the sample cross-sectional image set to obtain a preprocessed image of each sample cross-sectional image; thereby obtaining preprocessed images of all sample cross-sectional images in the sample cross-sectional image set, forming a sample cross-sectional preprocessed image set; and segmenting local regions with preset features as sub-images based on the sample cross-sectional preprocessed image set to obtain a pre-processed image. A set of sample cross-sectional images of a certain number of samples is used as the sample set for the sample group. For a pre-selected YOLOv8 network, the cross-sectional image of the polyacrylonitrile (PA) precursor fiber is used as input, and the cross-sectional detection result of the PA is used as output. Training and testing are performed based on the pre-processed sample cross-sectional image set of the sample group to obtain the cross-sectional detection model for the PA. For the PA to be detected, the cross-sectional image of the PA to be detected is obtained. Using the cross-sectional detection model of the PA to be detected, the cross-section of the PA to be detected is detected based on the cross-sectional image of the PA to be detected. Therefore, by using the trained YOLOv8 target detection model based on the cross-sectional image of the PA to be detected, the cross-sectional detection of PA to be detected is achieved, improving detection efficiency and accuracy, and facilitating the production control of PA fibers.
[0017] Specifically, in the present invention, for the cross-sectional inspection of polyacrylonitrile precursor fibers, polyacrylonitrile precursor fiber samples with different parameters (such as different strength grades, different fiber bundle specifications, different spinning processes, etc.) are selected as a sample group; the cross-section of each polyacrylonitrile precursor fiber sample in the sample group is photographed using a microscope to obtain a cross-sectional image of each polyacrylonitrile precursor fiber sample, thereby obtaining cross-sectional images of all polyacrylonitrile precursor fiber samples in the sample group, as a sample cross-sectional image set; each sample cross-sectional image in the sample cross-sectional image set is preprocessed, such as by using an adaptive binarization algorithm, or by using an integral image algorithm and adaptive binarization. The algorithm is used for preprocessing to obtain a preprocessed image of each sample cross-section (i.e., a preprocessed image of each sample cross-section image). This yields preprocessed cross-section images of all samples in the sample cross-section image set, forming a sample cross-section preprocessed image set. Based on this sample cross-section preprocessed image set, local regions with preset features (such as differential features) are segmented to obtain a preset number of sub-images as a dataset (i.e., a sample set). Regions in each sub-image of the dataset that meet the preset features are labeled, and the labeled dataset is used as the sample set. The sample set is then divided into a training set and a test set. YOLOv8 object detection is used. The model (i.e., the YOLOv8 network) uses the training set, taking cross-sectional images of polyacrylonitrile precursor fibers as input and the cross-sectional detection results of polyacrylonitrile precursor fibers as output, and is trained with preset training objectives (such as input image size, batch size, number of training epochs, and loss function and mAP metrics during training) to obtain the trained model. The trained model is then tested using the test set with preset testing objectives (such as mAP, accuracy, and recall) to obtain the tested model, which serves as the cross-sectional detection model for polyacrylonitrile precursor fibers. The cross-sectional detection results of polyacrylonitrile precursor fibers include the cross-sections of the polyacrylonitrile precursor fibers. The method involves analyzing the diameter and number of monofilaments, as well as classification results. These classification results include determining whether the cross-section of the polyacrylonitrile (PAN) precursor fiber is intact or damaged, and determining whether the diameter of the monofilaments in the cross-section is too large, too small, or acceptable compared to the standard diameter when the cross-section is intact. Therefore, by using an adaptive binarization algorithm and an integral image algorithm to preprocess the cross-section image of the PAN precursor fiber, and then employing the trained YOLOv8 target detection model, the cross-section detection of the PAN precursor fiber is achieved. This improves detection efficiency and accuracy, and is beneficial for the production control of PAN precursor fibers.
[0018] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention.
[0019] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0020] Figure 1 This is a schematic flowchart of an embodiment of the method for detecting polyacrylonitrile precursor fibers according to the present invention;
[0021] Figure 2 This is a schematic flowchart of an embodiment of the first preprocessing process in the method of the present invention, which preprocesses each sample cross-section image in the sample cross-section image set of the sample group.
[0022] Figure 3 This is a schematic flowchart of an embodiment of the second preprocessing process in the method of the present invention, which preprocesses each sample cross-section image in the sample cross-section image set of the sample group;
[0023] Figure 4 This is a flowchart illustrating an embodiment of the method of the present invention, which segments a local region image with preset features as a sub-image.
[0024] Figure 5 This is a schematic flowchart of an embodiment of the method of the present invention for training and testing based on a preprocessed image set of sample cross sections of the sample group;
[0025] Figure 6 This is a schematic flowchart of an embodiment of the method of the present invention for detecting the cross-section of the polyacrylonitrile precursor fiber to be tested.
[0026] Figure 7 This is a schematic diagram of an embodiment of the polyacrylonitrile precursor fiber detection device of the present invention;
[0027] Figure 8 This is a schematic diagram of the overall process of a method for detecting the cross-sectional diameter and number of polyacrylonitrile precursor fibers based on the YOLOv8 target detection model according to the present invention.
[0028] Figure 9 A schematic diagram of a region for calculating the sum of pixels using an integral image algorithm;
[0029] Figure 10 The images show a comparison of the effects of using the adaptive binarization algorithm. The left image is the original image before processing with the adaptive binarization algorithm, and the right image is the binarized image after processing with the adaptive binarization algorithm.
[0030] Figure 11Examples of different feature samples in the dataset are shown. The left side is the original image, and the right side is the binarized image processed by the adaptive binarization algorithm. The images on the left and right sides, from top to bottom, are: (1) an image that can represent the diameter, single filament distribution and contour features of this type of polyacrylonitrile precursor fiber; (2) an image in this sub-image that has a broken cross section, a gap in the contour, or separation at the interface; (3) an image in this sub-image where the original image is not in focus; (4) an image in this sub-image where the single filament distribution is different from other images.
[0031] Figure 12 This is a schematic diagram of the detection software interface and detection results of a method for detecting the cross-sectional diameter and number of polyacrylonitrile precursor fibers based on the YOLOv8 target detection model according to the present invention.
[0032] Figure 13 for Figure 12 A partial schematic diagram of the right side of the software cross-section is shown;
[0033] Figure 14 Images of the original filaments taken under a microscope in a case study of total filament bundle counting;
[0034] Figure 15 This is a screenshot of the software detection results in the case of total filament counting;
[0035] Figure 16 for Figure 15 A partial schematic diagram of the right side of the software cross-section is shown;
[0036] Figure 17 This is an exploded view of the fiber slicer used.
[0037] Figure 18 A comparison table of diameter detection errors;
[0038] Figure 19 This is a table showing the statistical error of the number of roots in a local area at 400x magnification.
[0039] Referring to the accompanying drawings, the reference numerals in the embodiments of the present invention are as follows:
[0040] 1—Fixing block; 1-1—Slide groove; 1-2—Slide groove opening; 2—Clamping surface; 2-1—Wire feeding channel; 2-2—Wire feeding channel inlet; 3—Pressure block; 3-1—Protruding ridge; 3-2—Bottom surface of protruding ridge; 3-3—Bottom surface of pressure block; 4—Pressure block locking screw; 5—Anti-tipping base; 5-1—Fixing groove; 6—Slicer locking screw; 7—Clamping surface fixing screw; 102—Acquisition unit; 104—Control unit. Detailed Implementation
[0041] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0042] Considering that the detection of the cross-sectional diameter of polyacrylonitrile (PAN) precursor fibers in the relevant schemes mainly relies on manual inspection, which is inefficient and inaccurate, hindering the production control of PAN precursor fibers. Specifically, in the relevant schemes, the detection of the cross-sectional diameter of PAN fibers (i.e., PAN precursor fibers) mainly relies on manual inspection. The process of manually detecting the cross-sectional diameter of PAN precursor fibers is as follows: First, a fiber cross-sectional sample of the PAN precursor fiber is prepared. The sample is observed under a microscope and an image is acquired. Based on the acquired image of the fiber cross-sectional sample, the diameter is manually counted and measured by the inspector. However, this method has some drawbacks, such as:
[0043] (1) Large workload and low efficiency: Especially for large tow polyacrylonitrile precursors (such as the number of single filaments in the tow of polyacrylonitrile precursors being 12K, 24K or even 60K, where K represents thousands), the image of a single polyacrylonitrile precursor fiber cross-section sample contains thousands of single filaments, and manual counting is extremely time-consuming.
[0044] (2) High subjectivity and poor consistency: Different testing personnel have different judgments on the fiber edges in the images of polyacrylonitrile precursor fiber cross-section samples, resulting in poor repeatability of measurement results;
[0045] (3) Insufficient representativeness: Current national standards (such as GB / T 3364-2008) only require the measurement of 25 monofilaments, which is difficult to fully characterize the dispersion of the entire bundle of polyacrylonitrile precursor fibers.
[0046] (4) High sample preparation requirements: The slices are prone to uneven cross-sections and uneven light transmission, which further increases the difficulty of manual interpretation.
[0047] Furthermore, considering the superior performance of deep learning technology, especially object detection models, in image recognition, YOLOv8 achieves a good balance between detection accuracy and speed. YOLOv8 is a real-time object detection model released by Ultralytics. Building upon previous versions of YOLO, YOLOv8 introduces improvements such as an anchor-free design and a decoupled head structure. Applying YOLOv8 to the automatic recognition of polyacrylonitrile precursor fiber cross-sectional images could potentially solve the aforementioned problems.
[0048] Therefore, the present invention proposes a method for detecting polyacrylonitrile precursor fibers, more specifically an automatic analysis method for the microscopic cross-sectional morphology of polyacrylonitrile precursor fibers, and especially a method for detecting the cross-sectional diameter and number of polyacrylonitrile precursor fibers based on the YOLOv8 target detection model. By processing and analyzing the fiber cross-sectional images acquired by the microscope through computer vision technology and neural network model, the method achieves rapid and batch detection of the cross-sectional diameter and number of polyacrylonitrile precursor fibers, improves detection efficiency and accuracy, and is beneficial to the production control of polyacrylonitrile (PAN) precursor fibers.
[0049] According to embodiments of the present invention, a method for detecting polyacrylonitrile precursor fibers is provided, such as... Figure 1 The diagram shows a flowchart of an embodiment of the method of the present invention. The method for detecting polyacrylonitrile precursor fibers may include steps S110 to S160.
[0050] In step S110, for a pre-selected sample group of polyacrylonitrile precursor fibers, a cross-sectional image of each sample in the sample group is obtained, thereby obtaining cross-sectional images of all samples in the sample group, forming a sample cross-sectional image set of the sample group.
[0051] In step S120, each sample cross-section image in the sample cross-section image set of the sample group is preprocessed to obtain a preprocessed image of each sample cross-section image; thus, the preprocessed images of all sample cross-section images in the sample cross-section image set of the sample group are obtained, forming the sample cross-section preprocessed image set of the sample group.
[0052] In step S130, based on the sample cross-section preprocessed image set of the sample group, local region images with preset features are segmented as sub-images, and a preset number of sub-images are obtained as the sample cross-section image sample set of the sample group.
[0053] In step S140, for the pre-selected YOLOv8 network, the cross-sectional image of the polyacrylonitrile precursor fiber is used as input and the cross-sectional detection result of the polyacrylonitrile precursor fiber is used as output. The network is trained and tested based on the sample cross-sectional preprocessed image set of the sample group to obtain the cross-sectional detection model of the polyacrylonitrile precursor fiber.
[0054] In step S150, a cross-sectional image of the polyacrylonitrile precursor fiber to be tested is obtained.
[0055] In step S160, the cross-section detection model of the polyacrylonitrile precursor fiber is used to detect the cross-section of the polyacrylonitrile precursor fiber to be detected based on the cross-sectional image of the polyacrylonitrile precursor fiber to be detected.
[0056] The present invention aims to provide an efficient, accurate, and automated method for detecting the cross-sectional diameter and number of polyacrylonitrile (PAN) precursor fibers. This method utilizes computer vision technology and neural network models to process and analyze fiber cross-sectional images acquired through a microscope. This overcomes the problems of low efficiency, strong subjectivity, and insufficient representativeness inherent in manual detection methods in related solutions. It also overcomes microscope imaging defects (such as uneven brightness of the fiber cross-section and blurred edges due to varying brightness and focusing conditions). This enables rapid, batch detection of PAN precursor fiber cross-sections, improving detection efficiency and accuracy, and facilitating the production control of PAN precursor fibers.
[0057] In some embodiments, the cross-sectional test results of the polyacrylonitrile precursor fiber include at least one of the following: the diameter of the monofilament, the number of monofilaments, and the classification result in the cross-section of the polyacrylonitrile precursor fiber.
[0058] The classification results include at least one of the following: a first judgment result that the cross-section of the polyacrylonitrile precursor fiber is an intact cross-section or a damaged cross-section; the number of polyacrylonitrile precursor fibers with intact cross-sections; the number of polyacrylonitrile precursor fibers with damaged cross-sections; a second judgment result that, when the cross-section of the polyacrylonitrile precursor fiber is an intact cross-section, whether the diameter of the single filament in the cross-section is too large, too small, or acceptable compared to the standard diameter; the number of polyacrylonitrile precursor fibers with a diameter too large compared to the standard diameter; the number of polyacrylonitrile precursor fibers with a diameter too small compared to the standard diameter; and the number of polyacrylonitrile precursor fibers with a diameter acceptable compared to the standard diameter.
[0059] In the monofilament cross-sectional morphology (including diameter distribution, shape, and number of strands) of polyacrylonitrile precursor fibers, diameter distribution refers to the difference in diameter between monofilaments within the same bundle of polyacrylonitrile precursor fibers. The present invention addresses this by setting diameter standards for corresponding types of precursor fibers in the testing software. The software automatically distinguishes monofilaments with diameters exceeding or below the standard using different colored markings based on the test results and counts them separately, allowing process engineers to determine the bundle condition. The present invention distinguishes between intact and damaged monofilaments. Ideally, a monofilament cross-sectional profile should be circular or approximately circular, and its diameter can be measured to determine the production status. However, during production, transportation, and testing, process issues, collisions during transport, and testing operations may cause some monofilament cross-sections to not be classified as circular or approximately circular, defining them as damaged cross-sections. The diameter of such cross-sections is not of reference value and should be excluded during diameter statistics. Simultaneously, the inspector analyzes the distribution of damaged cross-sections to determine the cause of the damage.
[0060] This invention proposes an automatic analysis method for the microscopic cross-sectional morphology of polyacrylonitrile (PAN) precursor fibers, specifically a detection scheme for the cross-sectional diameter and number of PAN precursor fibers based on the YOLOv8 target detection model. Specifically, this scheme uses computer vision technology and a neural network model to process and analyze fiber cross-sectional images acquired by a microscope, enabling rapid, batch detection of the cross-sectional diameter and number of PAN precursor fibers. This improves detection efficiency and accuracy, and is beneficial for the production control of PAN precursor fibers.
[0061] In some embodiments, each sample cross-sectional image in the sample cross-sectional image set of the sample group is preprocessed to obtain a preprocessed image of each sample cross-sectional image, including: a first preprocessing process for preprocessing each sample cross-sectional image in the sample cross-sectional image set of the sample group, or a second preprocessing process for preprocessing each sample cross-sectional image in the sample cross-sectional image set of the sample group.
[0062] The specific process of the first preprocessing procedure in step S120, which preprocesses each sample cross-section image in the sample cross-section image set of the sample group, is described in the following exemplary description.
[0063] The following is combined with Figure 2 The diagram shows an embodiment of the first preprocessing process for preprocessing each sample cross-sectional image in the sample cross-sectional image set of the sample group in the method of the present invention. The specific process of the first preprocessing process for preprocessing each sample cross-sectional image in the sample cross-sectional image set of the sample group in step S120 is further explained, including steps S210 to S230.
[0064] Step S210: For each sample cross-section image in the sample cross-section image set of the sample group, an adaptive binarization algorithm is used to calculate the local neighborhood pixel grayscale mean of each pixel in each sample cross-section image; thereby, the local neighborhood pixel grayscale mean of all pixels in each sample cross-section image is obtained; the local neighborhood pixel grayscale mean of each pixel in each sample cross-section image is as shown by the grayscale value L.
[0065] Step S220: Calculate the adaptive threshold for each pixel in each sample cross-sectional image based on the mean grayscale value of each pixel in its local neighborhood and a preset threshold adjustment value; thereby obtaining the adaptive threshold for all pixels in each sample cross-sectional image; the preset threshold adjustment value is such as the threshold adjustment constant C, and the adaptive threshold for each pixel in each sample cross-sectional image is such as the adaptive threshold T.
[0066] Step S230: Based on the adaptive threshold of each pixel in each sample cross-sectional image, binarize the local neighborhood of each pixel in each sample cross-sectional image to obtain a binarized image of the local neighborhood of each pixel in each sample cross-sectional image; thereby obtaining a binarized image of the local neighborhood of all pixels in each sample cross-sectional image, which serves as the preprocessed image of each sample cross-sectional image; the binarized image of the local neighborhood of all pixels in each sample cross-sectional image is, for example, the binarized fiber cross-sectional image of each sample cross-sectional image.
[0067] Alternatively, the specific process of the second preprocessing procedure in step S120, which preprocesses each sample cross-section image in the sample cross-section image set of the sample group, can be found in the following exemplary description.
[0068] The following is combined with Figure 3 The schematic diagram shows an embodiment of the second preprocessing process for preprocessing each sample cross-sectional image in the sample cross-sectional image set of the sample group in the method of the present invention. It further illustrates the specific process of the second preprocessing process for preprocessing each sample cross-sectional image in the sample cross-sectional image set of the sample group in step S120, including steps S310 to S330.
[0069] Step S310: For each sample cross-section image in the sample cross-section image set of the sample group, calculate the grayscale integral image of each sample cross-section image using the integral image algorithm.
[0070] Step S320: Using the grayscale integral image of each sample cross-section image, calculate the mean grayscale value of each pixel in the local neighborhood of each pixel in each sample cross-section image; thereby obtaining the mean grayscale value of all pixels in the local neighborhood of each pixel in each sample cross-section image; the mean grayscale value of each pixel in the local neighborhood of each pixel in each sample cross-section image is as shown by the grayscale value L.
[0071] Step S330: Using an adaptive binarization algorithm, based on an adaptive threshold for each pixel in each sample cross-sectional image, binarization processing is performed on the local neighborhood of each pixel in each sample cross-sectional image to obtain a binarized image of the local neighborhood of each pixel in each sample cross-sectional image; thus, binarized images of the local neighborhoods of all pixels in each sample cross-sectional image are obtained, serving as the preprocessed image of each sample cross-sectional image. Examples of binarized images of the local neighborhoods of all pixels in each sample cross-sectional image include the binarized fiber cross-sectional image of each sample cross-sectional image.
[0072] In the embodiments of the present invention, the process of detecting the cross-section of polyacrylonitrile (PAN) precursor fibers based on the YOLOv8 target detection model can be found in [reference needed]. Figure 8 The example shown.
[0073] Figure 8 This is a schematic diagram illustrating the overall process of a method for detecting the cross-sectional diameter and number of polyacrylonitrile precursor fibers based on the YOLOv8 target detection model, according to the present invention. Figure 8 As shown, a method for detecting the cross-sectional diameter and number of polyacrylonitrile precursor fibers based on the YOLOv8 target detection model includes:
[0074] Step 1: Image acquisition, then proceed to Step 2.
[0075] In step 1, a polyacrylonitrile precursor sample is selected, and the cross-section of the selected polyacrylonitrile precursor sample is photographed using a microscope to obtain a cross-sectional image of the polyacrylonitrile precursor sample.
[0076] In step 1, the selected polyacrylonitrile precursor samples include samples with different strength grades (such as the mechanical property grades of polyacrylonitrile-based carbon fibers produced from polyacrylonitrile precursors, such as T300, T700, T800, etc.), different tow specifications (the number of single filaments in the tow of polyacrylonitrile precursors is 3K, 6K, 12K, etc.), and different spinning processes of polyacrylonitrile precursors (such as wet spinning, dry-jet wet spinning, etc.).
[0077] In step 1, the cross-section of the selected polyacrylonitrile precursor fiber sample is photographed using a microscope. For example, using a Nikon E100 trinocular microscope with a back-illuminated light source, 50 BMP format images with a size of 2560 pixels × 1536 pixels are acquired for the selected polyacrylonitrile precursor fiber sample (i.e., images of 50 polyacrylonitrile precursor fiber samples) as cross-sectional images of the polyacrylonitrile precursor fiber sample.
[0078] For the cross-sectional image of the polyacrylonitrile precursor fiber sample obtained in step 1, since the image covers different brightness and focus conditions, there will inevitably be uneven brightness of the fiber cross-section and blurred edges of some cross-sections in the image.
[0079] Step 2: Image preprocessing, followed by step 3.
[0080] To address the issue of inconsistent fiber cross-section brightness and blurred edges in the acquired images due to uneven fiber cross-section and uneven light transmission during the preparation of polyacrylonitrile precursor samples, an adaptive binarization algorithm is used to enhance the images, resulting in binarized fiber cross-section images with uniform brightness and clear edges.
[0081] In step 2, an adaptive binarization algorithm is used to enhance the image, specifically including:
[0082] Step 21: Adaptive Binarization Algorithm. This algorithm uses local neighborhood statistical grayscale values L to calculate a local threshold (i.e., adaptive threshold T) to adapt to the brightness of local areas. After calculating the local threshold (i.e., adaptive threshold T), the image is enhanced based on it. For example, pixels in areas with pixel values greater than the local threshold (i.e., adaptive threshold T) have their pixel values reduced; pixels in areas with pixel values less than the local threshold (i.e., adaptive threshold T) have their pixel values increased; and pixels in areas with pixel values equal to the local threshold (i.e., adaptive threshold T) have their pixel values preserved. For instance, pixels with pixel values greater than or equal to the local threshold (i.e., adaptive threshold T) are changed to pure white pixels, and pixels with pixel values less than the local threshold (i.e., adaptive threshold T) are changed to pure black pixels, resulting in a binarized image where the fiber cross-section area is white and the gaps between fibers are black.
[0083] Specifically, in step 21, for each pixel (x, y) in the cross-sectional image of the polyacrylonitrile precursor sample, a local neighborhood of size P pixels × P pixels is defined centered on that pixel, and the average gray value of the pixels within this region is calculated. Let the average brightness within a certain neighborhood be L, then the adaptive threshold T = LC, where C is a threshold adjustment constant used to control the sensitivity of the binarization operation to brightness. Experimentally, it is preferable to set the neighborhood size P = 71 pixels, and the threshold adjustment constant C is determined through multiple tests (e.g., 2.0) to ensure clear separation between the fiber cross-section and the background.
[0084] Processing each pixel in an image using the above method requires reading the grayscale values of all pixels in its neighborhood, resulting in a large computational load. To accelerate processing, the grayscale integral image of the cross-sectional image of the polyacrylonitrile precursor sample is pre-calculated.
[0085] Therefore, in step 2, the adaptive binarization algorithm is used to enhance the image, which specifically includes:
[0086] Step 20: Using the integral image algorithm, pre-calculate the grayscale integral image of the cross-sectional image of the polyacrylonitrile precursor sample, and then proceed to step 21.
[0087] Step 20 specifically includes: for each pixel (x, y) in the cross-sectional image of the polyacrylonitrile precursor sample, the integral image at position (x, y) contains the sum of all pixels located at position (x, y) and to its upper left, which serves as the calculated grayscale integral image of the cross-sectional image of the polyacrylonitrile precursor sample.
[0088] (1).
[0089] Where ii(x,y) is the value of the pixel at position (x,y) in the integral image, which is the sum of the gray values of all pixels at the top left corner of position (x,y) in the original image, i.e., the gray-level integral image of the cross-sectional image of the polyacrylonitrile precursor sample obtained by calculation; i(x,y) is the value of the pixel at position (x,y) in the original image. In the original image The value of the position in pixels.
[0090] The integral image is calculated using formulas (2) and (3) below, where s(x,y) is the row cumulative sum, s(x,-1)=0, and ii(-1,y)=0). The integral image only needs to be traversed once to calculate the integral image.
[0091] (2);
[0092] (3).
[0093] Formula (1) defines the pixel value (ii(x,y)) at position (x,y) in the integral image as the sum of the gray values of the pixel at position (x,y) in the original image and all pixels to its upper left.
[0094] According to formula (1), a direct integral image algorithm can be derived: when calculating ii(x,y), the gray values of all pixels in the upper left corner of that position in the original image are summed, which is the value of the integral image at that position. This method requires calculation to start from i(0,0) when calculating the value of each pixel in the integral image, resulting in a lot of repetitive work.
[0095] Formulas (2) and (3) provide the recursive calculation method for the integral image. Through the calculation method of the integral image, it can be found that when calculating the value of ii(x,y), the value of ii(x-1,y) is already obtained, that is, the sum of the gray values of i(x-1,y) and the pixel above and to the left of it in the original image is known. To calculate the value of ii(x,y), it is only necessary to obtain the cumulative row sum s(x,y) from the column i(x,0) to i(x,y), and then add it to ii(x-1,y) to obtain ii(x,y), which is Formula (3); Formula (2) provides the recursive algorithm for the cumulative row sum: the cumulative row sum (s(x,y)) of column x in row y is equal to the cumulative row sum (s(x,y-1)) of column x in row y-1 plus i(x,y). The recursive termination condition of formulas (2) and (3) is defined as follows: when calculating the cumulative sum of the row in row 0, the cumulative sum of the row in row -1 is set to 0; when calculating ii(0,y) in column 0, the integral value of column -1 is set to 0.
[0096] The starting position of the image pixel is (0, 0), and the (0, 0) position is determined according to the encoding method of different image formats and the specific algorithm implementation. In the scheme of this invention, the upper left corner of the image is (0, 0), that is, the top row is row 0, the leftmost column is row 0, the row number increases downwards, and the column number increases to the right. Row 0 and column 0 are extended outwards by one row and one column to become row -1 and column -1. Formulas (2) and (3) use a recursive algorithm. When calculating the integral image value of row 0 and column 0, the values of row -1 and column -1 are needed as the termination condition.
[0097] To calculate the pixel sum of any rectangular region in a cross-sectional image of a polyacrylonitrile precursor sample, simply refer to the values of the four corner points of that region in the integral image. Figure 9 This is a schematic diagram of a region for calculating the sum of pixels using an integral image algorithm. Figure 9 Any rectangular region in the array, such as region A, region B, region C, and region D. Figure 9 As shown, the integral image value at position 1 is the sum of the pixels in region A (i.e., the sum of the grayscale values of all pixels in region A in the original region), the integral image value at position 2 is A+B, the integral image value at position 3 is A+C, and the integral image value at position 4 is A+B+C+D. Therefore, the sum of the pixels in region D is the integral image value at position 4 + the integral image value at position 1 - (the integral image value at position 2 + the integral image value at position 3).
[0098] In step 20, by introducing an integral image, the average grayscale value of pixels within the neighborhood (P) can be obtained in step 21 by calculating the values at the four corners of the neighborhood (e.g., region D) when processing each pixel during image processing, regardless of the size of the neighborhood (P). This greatly reduces the computational load. After obtaining the grayscale integral image of the original image in advance, for any rectangular neighborhood D centered on the image to be processed, let its upper left corner coordinates be (x1, y1) and its lower right corner coordinates be (x2, y2). Then the sum of the grayscale values of all pixels within neighborhood D is... The value can be quickly obtained by simply looking up the values of the four corner points in the integral graph and using the following formula:
[0099] (4).
[0100] Here, ii(x,y) represents the value of the integral image at coordinates (x,y), and takes the value of 0 when the coordinates exceed the image boundary. Subsequently, the neighboring pixels and I... D Dividing by the total number of pixels in the region D (i.e., (x2-x1+1)×(y2-y1+1)) gives the average grayscale value L of the pixels in that region.
[0101] Taking a 2048-pixel × 1536-pixel image as an example, with P=71, the unoptimized image requires accessing approximately 1.58 × 10 pixels.10 After optimization, the subpixel size is only about 1.57×10. 7 Each time, the speed is increased by approximately 1000 times.
[0102] In step 2, the original image obtained in step 1 (such as the cross-sectional image of the polyacrylonitrile precursor sample obtained in step 1) is converted into a binary image (such as the cross-sectional binary image of the polyacrylonitrile precursor sample obtained after enhancing the cross-sectional image of the polyacrylonitrile precursor sample with an adaptive binarization algorithm in step 2) through an image preprocessing step. In this process, an adaptive algorithm is used to calculate local thresholds for regions with different brightness to extract the fiber cross-section within the region, thereby overcoming the sample preparation problems of uneven cross-section and uneven light transmission.
[0103] In the solution of this invention, overcoming the brightness of local areas and calculating local thresholds to adapt to the brightness of local areas is a problem that needs to be solved in extracting fiber cross-sections. When the brightness of fiber cross-sections in an image is uneven, the gray level between fiber gaps in brighter areas may be higher than the gray level of fiber cross-sections in darker areas. If a local adaptive method is not used, applying a global threshold to the entire image will cause the fiber cross-sections in dark areas to be processed as black, resulting in information loss.
[0104] Furthermore, the fiber cross-sectional image obtained by the above method distinguishes between fibers and gaps by the difference in light transmittance between them, resulting in variations in brightness on the image. For example... Figure 10 As shown, by setting appropriate parameters (neighborhood size P and threshold adjustment constant C) in the adaptive binarization method, the brighter areas of the fiber cross-section and the darker areas of the adjacent gaps can be set to pure white and pure black pixels, respectively. In the binarized image, white represents the fiber portion, and black represents the fiber gap portion. After clearly distinguishing the fiber cross-section using the binary image, it is input into the YOLOv8 model for model training and detection.
[0105] In some embodiments, the specific process of segmenting local region images with preset features as sub-images based on the sample cross-section preprocessed image set of the sample group in step S130, and obtaining a preset number of sub-images as the sample cross-section image sample set of the sample group, is described in the following exemplary description.
[0106] The following is combined with Figure 4 The flowchart shown is a schematic diagram of an embodiment of the method of the present invention in which a local region image with preset features is segmented as a sub-image. The specific process of segmenting a local region image with preset features as a sub-image in step S130 is further explained, including steps S410 to S420.
[0107] Step S410: Based on the sample cross-section preprocessed image set of the sample group, segment local region images with preset features as sub-images according to at least one preset rule.
[0108] Step S420: Mark the obtained preset number of sub-images to distinguish between complete cross-sections and damaged cross-sections in the preset number of sub-images, thereby obtaining the sample cross-section image sample set of the sample group.
[0109] In step S410, at least one preset rule includes at least one of the following:
[0110] The first preset rule is that at least one of the following in the sample cross-section preprocessing image—the cross-sectional shape, cross-sectional diameter, and the distribution of monofilaments in the cross-section—can represent the corresponding characteristics of the fiber in the sample.
[0111] The second preset rule: The sample cross-section image corresponding to the preprocessed sample cross-section image has a problem with unclear focus;
[0112] The third preset rule: The sample cross-section preprocessed image contains a single filament with a diameter greater than or less than the standard diameter;
[0113] The fourth preset rule: at least one of the following in the sample cross-section preprocessed image is different from other sample cross-section preprocessed images or other areas: the density of monofilament distribution and the tightness of adhesion between adjacent monofilaments.
[0114] The fifth preset rule is to define a broken section as a case where the profile of a single filament cross section in the sample cross section preprocessing image has a gap or is separated into at least two parts at the single filament cross section. If the cross section detection result of the polyacrylonitrile precursor includes the diameter of the single filament in the cross section of the polyacrylonitrile precursor, the broken section in the sample cross section preprocessing image will be removed.
[0115] like Figure 8 As shown, a method for detecting the cross-sectional diameter and number of polyacrylonitrile precursor fibers based on the YOLOv8 target detection model further includes:
[0116] Step 3: Dataset construction and model training, followed by step 4.
[0117] While the morphology of fiber cross-sections shows relatively small differences in a single polyacrylonitrile (PA) filament sample, significant differences exist in the diameter, roundness, and monofilament distribution patterns among PAC filament samples of different grades, specifications, batches, and spinning processes. To enable the YOLOv8 target detection model to fully learn the cross-sectional morphologies of fibers generated from different grades, specifications, batches, and spinning processes, ensuring the generalization ability of the YOLOv8 target detection model, and avoiding overfitting caused by labeling a large number of duplicate or similar targets in the same PAC filament sample cross-sectional image, the present invention segments local regions with differentiated features from the aforementioned images (such as the binarized cross-sectional image of the PAC filament sample obtained in step 2). The dimensions of these differentiated features include filament specifications, brightness, focus level, fiber adhesion level, and damage type.
[0118] Regarding the specific differences in cross-sectional images of polyacrylonitrile (PAN)-based carbon fibers, the selection criteria for segmenting local regions with differentiated characteristics from the binarized cross-sectional images of the polyacrylonitrile precursor samples obtained in step 2 should include the following:
[0119] 1) The cross-sectional shape, diameter, and distribution of fibers in the region can represent the characteristics of this type of fiber;
[0120] 2) The original image of the fiber cross-section in the region is out of focus;
[0121] 3) The fiber cross-section in the region contains monofilaments with diameters greater or smaller than the standard;
[0122] 4) The density of monofilament distribution and the tightness of bonding between monofilaments in the fiber cross-section of the region are different from other images;
[0123] Ideally, the fiber cross-section should be circular or nearly circular, randomly distributed, with each filament independent of the others. In some fiber cross-sectional images, the filaments are compressed together, resulting in a hexagonal dense packing, with adjacent filaments tightly adhered and their boundaries difficult to distinguish. See [reference needed] for details. Figure 11 The example shown illustrates this. Morphological erosion methods struggle to find suitable parameters for separation. When using visual models for detection, the fused morphology between monofilaments can easily lead the model to identify adhered monofilaments as a single monofilament, or cause falsely inflated diameters and missed detections due to significant differences in features compared to learned samples. Due to the depth-of-field limitations of microscopes, uneven cross-sections, or slight stage tilt, some fiber sections may lie outside the focal plane in the field of view, resulting in blurred imaging and a fuzzy monofilament outline. If this is not included in the dataset during model training, it will lead to missed detections and counting errors during actual detection. Figure 11Examples of different feature samples in the dataset are shown. The left side is the original image, and the right side is the binarized image processed by the adaptive binarization algorithm. The images on the left and right sides, from top to bottom, are: (1) The image that can represent the diameter, single filament distribution and contour features of this type of polyacrylonitrile precursor fiber; (2) The image that has a broken single filament, a gap in the contour or separation at the interface; (3) The original image of this sub-image has a blurry focus; (4) The image that has a single filament distribution that is different from other images.
[0124] 5) In the fiber cross-section of the region, there are monofilament targets with gaps in the cross-sectional profile or those separated into two parts at the cross-section due to production, transportation, or sample preparation processes. These monofilament targets are defined as damaged cross-sections. During counting, the YOLOv8 target detection model should identify the damaged or separated parts as a single monofilament to avoid double counting. Since the cross-sectional profile of the damaged or separated parts cannot reflect the true monofilament diameter, the YOLOv8 target detection model needs to identify the damaged or separated parts as a separate category and discard them when detecting the diameter. In the solution of this invention, based on the image being inspected and the performance conditions of the deployed computer, the YOLOv8m model is preferred as the benchmark model.
[0125] During the model training phase, images with these features were manually selected. Following the selection criteria described above for segmenting local regions with differentiated features from the cross-sectional binarized images of the polyacrylonitrile precursor samples obtained in step 2, images with differentiated features were selected as sub-images from 50 cross-sectional binarized images of the polyacrylonitrile precursor samples obtained in step 2. For example, a total of 100 sub-images were selected as the dataset. LabelImg (an image annotation tool) software was used to annotate the 100 sub-images, labeling complete cross-sections as "circle" and damaged cross-sections as "break". A total of 17759 complete cross-sections and 4524 damaged cross-sections were annotated. For details, please refer to [link to relevant documentation]. Figures 12 to 16 The example shown. Figure 12 This is a schematic diagram of the detection software interface and detection results of a method for detecting the cross-sectional diameter and number of polyacrylonitrile precursor fibers based on the YOLOv8 target detection model according to the present invention. Figure 13 for Figure 12 A partial schematic diagram of the right side of the software cross-section is shown; Figure 14 Images of the original filaments taken under a microscope in a case study of total filament bundle counting; Figure 15 This is a screenshot of the software detection results in the case of total filament counting; Figure 16 for Figure 15 A partial schematic diagram of the right side of the software cross-section is shown.
[0126] In the automated inspection of polyacrylonitrile precursor fiber cross-sectional images, the single filament cross-section can be divided into two categories based on its morphological integrity: intact cross-section and damaged cross-section.
[0127] During counting: Both intact and damaged sections represent actual existing filaments and should be included in the total number of filaments in the bundle. However, the visual characteristics of intact and damaged sections differ significantly. An intact section presents a closed outline that is approximately circular or elliptical, while a damaged section may appear as a torn outline, missing edges, or even split into multiple discrete fragments. If only intact sections are labeled during model training, the model may misidentify damaged sections as background, resulting in missed counts; the model may also misidentify the same damaged section, which has split into multiple fragments, as multiple independent targets, resulting in duplicate counts.
[0128] When measuring diameter: The diameter of a single filament is a key indicator for evaluating the quality of the raw filament, but it is only statistically significant for intact cross-sections. The contour measurement value of a damaged cross-section cannot reflect the true diameter of the single filament. If it is included in the diameter statistics, it will introduce systematic errors and seriously affect the accuracy of process judgment.
[0129] Therefore, if intact cross-sections and damaged cross-sections are not categorized and distinguished during model training, the model will be unable to automatically perceive the semantic differences between the two, leading to both missed and false detections in the counting task, and unreliable root count statistics; in the diameter measurement task, damaged data contaminates the statistical results, significantly reducing measurement accuracy. Based on this, the solution of this invention explicitly divides the monofilament cross-sections into two independent categories, "intact cross-sections" and "damaged cross-sections," during dataset construction. This allows the model to combine the total number of detections from both categories during the counting phase of inference, ensuring complete root counts; and during diameter measurement, the damaged cross-section category is automatically removed, and only the diameter is calculated and its distribution analyzed for intact cross-sections.
[0130] The present invention enables the complete detection of the diameter and number of all single filaments in the cross-section of polyacrylonitrile precursor fibers within a microscope field of view. This can replace manual counting and measurement, and does not rely on the experience and judgment of the testing personnel. The test results can be obtained quickly by simply setting parameters through the software interface. At the same time, the dispersion of single filaments within the polyacrylonitrile precursor fiber bundle can be analyzed based on the diameter distribution of the polyacrylonitrile precursor fiber cross-section within the microscope field of view, which not only significantly improves the detection efficiency but also improves the accuracy and consistency of the detection data.
[0131] In some embodiments, in step S140, for a pre-selected YOLOv8 network, the cross-sectional image of the polyacrylonitrile precursor is used as input and the cross-sectional detection result of the polyacrylonitrile precursor is used as output. The network is trained and tested based on the sample cross-sectional preprocessed image set of the sample group to obtain the specific process of the cross-sectional detection model of the polyacrylonitrile precursor. See the following exemplary description.
[0132] The following is combined with Figure 5 The diagram illustrates an embodiment of the method of the present invention, which involves training and testing based on the sample cross-section preprocessed image set of the sample group. It further explains the specific process of training and testing based on the sample cross-section preprocessed image set of the sample group in step S140, including steps S510 to S530.
[0133] Step S510: Divide the sample cross-section preprocessed image set of the sample group into a training set and a test set.
[0134] Step S520: For the pre-selected YOLOv8 network, using the training set, with the cross-sectional image of the polyacrylonitrile precursor fiber as input and the cross-sectional detection result of the polyacrylonitrile precursor fiber as output, train according to the preset training objective to obtain the training model of the YOLOv8 network; the preset training objective includes, for example, the input image size, batch size, number of training rounds, and loss function index and mAP index during training.
[0135] Step S530: Using the test set, the training model of the YOLOv8 network is tested and updated according to the preset test target to obtain the test model of the YOLOv8 network, which serves as the cross-sectional detection model of the polyacrylonitrile precursor fiber.
[0136] like Figure 8 As shown, a method for detecting the cross-sectional diameter and number of polyacrylonitrile precursor fibers based on the YOLOv8 target detection model further includes:
[0137] For each of the 100 sub-images, the training and test sets are randomly allocated in a ratio of approximately 6:1.
[0138] Training was performed using the training set, and testing was performed using the test set. Training environment: Windows 11 system, Intel i9-14900HX CPU, RTX 5060 GPU (8GB VRAM), Python 3.12, CUDA 13.0. The YOLOv8 object detection model was used, with input image size of 640×640, batch size of 12, and 150 training epochs. During training, the loss function and mean average accuracy (mAP) were monitored. The final mAP 50 on the test set reached 0.868, indicating good accuracy and recall, and no overfitting was observed. Batch size is a core hyperparameter in deep learning training, representing the number of samples used to calculate gradients and update model weights in each iteration.
[0139] This invention proposes a detection scheme for the cross-sectional diameter and number of polyacrylonitrile (PAN) precursor fibers based on the YOLOv8 target detection model. The scheme involves acquiring cross-sectional images of PAN precursor fibers using a microscope, preprocessing them with an integral image-optimized adaptive binarization algorithm to enhance fiber edges and eliminate the effects of uneven illumination, and then using the YOLOv8 target detection model to identify the preprocessed images. The scheme automatically outputs the total number of fibers, single filament diameter, and classification statistics for the PAN precursor fiber cross-section, enabling rapid, batch detection of the cross-sectional diameter and number of PAN precursor fibers. This improves detection efficiency and accuracy, and is beneficial for the production control of PAN precursor fibers.
[0140] In some embodiments, in step S160, the specific process of detecting the cross-section of the polyacrylonitrile precursor fiber is realized based on the cross-sectional image of the polyacrylonitrile precursor fiber to be detected using the cross-sectional detection model of the polyacrylonitrile precursor fiber to be detected. See the following exemplary description.
[0141] The following is combined with Figure 6 The diagram shows a schematic flowchart of an embodiment of the method of the present invention for detecting the cross-section of the polyacrylonitrile precursor fiber to be tested. The specific process of detecting the cross-section of the polyacrylonitrile precursor fiber to be tested in step S160 is further explained, including steps S610 to S620.
[0142] Step S610: Under the PyTorch architecture, input the cross-sectional image of the polyacrylonitrile precursor fiber to be detected into the cross-sectional detection model of the polyacrylonitrile precursor fiber to output the cross-sectional detection result of the polyacrylonitrile precursor fiber to be detected.
[0143] Step S620: Visualize and / or display the cross-sectional inspection results of the polyacrylonitrile precursor fiber to be inspected using a preset display method. The preset display method may use different colors and shapes to display different inspection results.
[0144] like Figure 8 As shown, a method for detecting the cross-sectional diameter and number of polyacrylonitrile precursor fibers based on the YOLOv8 target detection model further includes:
[0145] Step 4: Software implementation.
[0146] A hybrid programming strategy is adopted: the image processing module is implemented in C++ to improve preprocessing speed; the graphical interface is implemented in Python Tkinter, calling the pre-trained PyTorch model, namely the YOLOv8 object detection model trained in step 3. The main functional modules of the software include:
[0147] Parameter settings area: Select fiber specification standard, input the pixel equivalent (μm / pixel) corresponding to the microscope magnification, and adjust the sliders for neighborhood size P and threshold constant C.
[0148] Operation area: The "Select Image" button loads an image; the "Process Image" button performs preprocessing and model detection; the "View Results" button displays the visualization results.
[0149] Display area: Switches between displaying the original image and the visualization result image, and supports clicking on the target to view detailed information.
[0150] Output area: Displays detection statistics (total number of filaments, number of each category, average diameter, and coefficient of variation for diameter of each category, etc.). The coefficient of variation (CV) measures the dispersion of the filament diameter within each category.
[0151] For example: Let a set of data represent the diameter of a single filament: x1, x2, x3, ..., x n Then the coefficient of variation (CV):
[0152] ;
[0153] in:
[0154] ; ;
[0155] .
[0156] During the inspection, the user loads the original image, adjusts the preprocessing parameters (such as those set in the parameter settings area) to the optimal effect, and clicks "Process Image". The software sequentially performs binarization, model inference, and result statistics, and displays the results in the output area. After clicking "View Results", color markers are drawn on the image: complete and qualified sections are represented by a first set color (such as green) box or dot; sections with a larger single filament diameter are represented by a second set color (such as red) box; sections with a smaller single filament diameter are represented by a third set color (such as purple) box; and damaged sections are represented by a fourth set color (such as blue) box.
[0157] Experiments were conducted using the scheme of this invention, and the results are as follows: Cross-sectional images of 20 different samples were selected for verification and compared with the results of manual detection:
[0158] Fiber count identification: A total of 17,264 fibers were identified, with 34 missed (missed detection rate of 0.20%) and 86 false positives (false detection rate of 0.49%). Missed detections mainly occurred in areas where fibers were tightly bonded or where the edges were blurred, while false positives mainly occurred when intact damaged sections were mistakenly identified as damaged sections.
[0159] Diameter measurement: Compared with manual measurement, the software measurement error is 3.61%, and the software detection results are more stable and consistent in judging the contour edge of the single filament than manual measurement.
[0160] The solution of the present invention can achieve at least the following beneficial effects:
[0161] (1) Significantly improves detection efficiency: The image processing time for a single polyacrylonitrile filament cross-section sample is only about 20 seconds (taking 2048 pixels × 1536 pixels as an example), which can process a large number of images in batches, much faster than manual detection;
[0162] (2) Improved detection accuracy and consistency: The YOLOv8 target detection model has stable judgment of fiber edges, eliminating human differences, with a false detection rate of less than 0.3%, a false detection rate of less than 0.6%, and a diameter measurement error of less than 4%;
[0163] (3) Achieve full detection and enhance representativeness: All filaments in the image of the fiber cross-section sample of the whole polyacrylonitrile precursor can be counted and measured, comprehensively characterizing the filament bundle dispersion of polyacrylonitrile precursor, and providing a more reliable basis for adjusting the production process of polyacrylonitrile (PAN) precursor fiber.
[0164] Figure 18 A comparison table of diameter detection errors; Figure 19 This is a table showing the error in counting the number of fibers in a local area at 400x magnification. In this example, the number of fibers in the entire bundle was counted manually from the individual filaments in the image, and the error between the count count and the number detected by the software was 0.42%.
[0165] In the present invention, a method for detecting the cross-sectional diameter and number of polyacrylonitrile precursor fibers based on the YOLOv8 target detection model includes the following steps: image acquisition, adaptive binarization preprocessing (using integral image optimization), YOLOv8 target detection model detection, result statistics and visualization output; the YOLOv8 target detection model is a version of the YOLOv8 target detection model, and during training, a dataset construction method using local region segmentation and annotation is adopted for dense fiber cross-sectional features. A system for detecting the cross-sectional diameter and number of polyacrylonitrile precursor fibers based on the YOLOv8 target detection model includes an image acquisition module, an image preprocessing module, a target detection module, a result statistics module and a display interaction module; the result statistics include: counting the total number of fibers, calculating the diameter of a single filament based on the bounding box size and pixel equivalent, classifying it as small, qualified, or large after comparison with preset standard specifications, and marking the damaged cross-section; the image preprocessing module uses C++ to implement adaptive binarization and integral image optimization, and the display interaction module uses Python.
[0166] After identifying several monofilament targets, the model outputs bounding boxes identifying these targets. These bounding boxes are rectangular, with all four sides tangent to the monofilament outline. Simultaneously, the model outputs a list in normalized form, including the bounding box's category label, center point coordinates, width, height, and confidence score. The coordinate positions and height / width values are relative to the image's height and width. By reading this list and multiplying it by the height and width pixel values of the input image, the pixel coordinates of a single target in the image, as well as the pixel values of the bounding box's height and width, can be obtained. The pixel equivalent is calculated by taking images of a calibrated micrometer at different magnifications using a microscope in this embodiment. Dividing the actual length on the micrometer by the corresponding number of pixels in the image yields the size corresponding to one pixel, which is the pixel equivalent. Multiplying the aforementioned bounding box's pixel height and width values by the pixel equivalent yields the actual height and width of the monofilament. Since the monofilament's shape is approximately circular, its height and width values are used as its diameter during detection.
[0167] For example, after a certain monofilament is identified by the model, its bounding box data is as follows: 0, 0.509768, 0.772439, 0.027045, 0.035513, and 0.96. Each value represents the target category, the x-coordinate of the center point, the y-coordinate of the center point, the bounding box width, the bounding box height, and the confidence level, respectively. Given that the image size is 2560 pixels × 1536 pixels (as in the example), the height of the monofilament is approximately 0.03551 × 1536 pixels ≈ 55 pixels (rounded to the nearest integer), and the width is approximately 0.027045 × 2560 pixels ≈ 69 pixels. Measuring the length of 100µm on the micrometer at the magnification of this image occupies 602 pixels in the image, and the pixel equivalent is approximately 100µm ÷ 602 pixels ≈ 0.166µm / pixel. The actual dimensions of the monofilament are: longitudinal diameter: 55 pixels × 0.166 um / pixel = 9.13 um, and transverse diameter: 69 pixels × 0.166 um / pixel = 11.45 um.
[0168] This invention addresses the problems of manual labor, low efficiency, and high subjectivity in PAN precursor fiber cross-section detection in related methods by proposing an automated detection scheme: a method and system for detecting the diameter and number of polyacrylonitrile precursor fibers based on the YOLOv8 target detection model. First, microscopic images of the precursor fiber cross-section are acquired and preprocessed using adaptive binarization combined with integral image optimization to enhance fiber edges and reduce computational complexity. Then, a dataset is constructed to train the YOLOv8 target detection model, enabling the identification of intact and damaged cross-sections. Finally, detection software with a graphical user interface is developed, integrating the preprocessing algorithm and the detection model to automatically output the fiber count, diameter measurements, and classification statistics. Experiments show that using this invention, the processing time for a single image is approximately 40ms, the false negative rate is less than 0.3%, the false positive rate is less than 0.6%, and the diameter measurement error is less than 4%, significantly improving detection efficiency and accuracy, and providing a new technical means for the quality control of carbon fiber precursor fibers.
[0169] Furthermore, in the sample preparation methods for the cross-section of polyacrylonitrile precursor fibers in related schemes, when using a slicer, due to the large fiber feeding hole, it is necessary to fold a bundle of fibers multiple times to fill the slicer, or to spread short fiber filaments onto a glass slide using a sample spreader. Both of these methods have drawbacks: they cannot observe the entire fiber bundle, or it is impossible to confirm whether the observed fiber defect is a defect occurring within a single fiber bundle or due to multiple observations of the same defect caused by bundle folding, and they cannot count the number of individual filaments in a fiber bundle. While the embedding method can obtain a complete cross-section of a fiber bundle, this method is complex and time-consuming. To solve this problem, the present invention also proposes a fiber slicer that can clamp a bundle of fibers and cut its cross-section, enabling the microscopic examination of a bundle of polyacrylonitrile precursor fibers. Figure 17 This is an exploded view of the fiber slicer used. The main improvements to this fiber slicer are optimizing the previously large fiber feeding channel size to match the size of the polyacrylonitrile precursor fiber, achieving stable clamping of a bundle of fibers, and adding locking screws to the fixed slider.
[0170] like Figure 17As shown, the fiber slicer consists of two parts: an anti-tipping base 5 and a clamp. The anti-tipping base 5 is used to fix the clamp during cutting, facilitating the cutting tool to create a smooth cut. The clamp is used to hold the polyacrylonitrile filaments on the microscope stage for observation. The anti-tipping base 5 has a fixing groove 5-1 and locking screws (such as the slicer locking screw 6) to fix the clamp. The clamp mainly consists of four parts: a clamping surface 2, a fixing block 1, a pressure block 3, a clamping surface fixing screw 7, and a locking screw (such as the pressure block locking screw 4). The main feature of the clamping surface 2 is that it has a slit matching the microscope's field of view and the cross-sectional area of the polyacrylonitrile filament bundle as a fiber feeding channel 2-1, which can restrict a bundle of polyacrylonitrile filaments and ensure that it is within the microscope's field of view. The front is a cutting plane with a smooth surface to guide the cutting tool to cut the fiber. The cutting plane is a complete and continuous plane, preventing the cutting tool from getting stuck or vibrating during movement, which could lead to uneven fiber cross-sections or damage to the cutting tool, causing fiber cross-section breakage during the inspection operation. The fixing block 1 has a groove 1-1 for fixing and guiding the movement of the pressure block 3. A locking screw is installed on the side, using the screw pressure and friction between the screw and the groove 1-1 to fix the pressure block 3. The pressure block 3 has a protruding ridge 3-1 that matches the fiber feeding channel 2-1. The bottom surface 3-1 of the protruding ridge and the bottom surface 3-3 of the pressure block together exert a constraint on the fiber. This protruding ridge 3-1 is used to solve the problem that after the clamp enters and compacts the fiber along the fiber feeding channel 2-1, the fiber on the side of the fiber feeding channel 2-1 entrance (i.e., fiber feeding channel entrance 2-2) is not completely constrained, causing the fiber on this side to be deflected under the pressure between the fiber filaments, making it impossible to observe this part of the fiber under a microscope, and thus impossible to count the filaments in the fiber bundle. By adding this protruding ridge 3-1 to the pressure block 3, after the fiber is compacted, a complete constraint can be formed on the cutting plane, and the entire fiber bundle is fixed in a direction perpendicular to the observation axis, creating conditions for subsequent counting of the entire fiber bundle.
[0171] For example, when counting the total number of monofilaments in a fiber bundle, a polyacrylonitrile raw filament of about 50cm in length is taken. To avoid wear during insertion into the slit and to prevent the fiber bundle from being cut neatly due to the small gap between the slit edge and the cutter, a layer of Xuan paper is used to wrap the section to be tested, and it is placed flat into the fiber feeding channel 2-1 of the clamp. The pressure block is inserted from the top opening of the slide groove 1-1 on the fixing block 1 (i.e., the slide groove opening 1-2). The pressure block applies appropriate pressure to prevent the fiber bundle from sliding under external force, and the pressure block locking screw is tightened to lock the pressure block. Then, the clamp is placed into the anti-tipping base 5 and the clamp is fixed with the locking screw. Using a scalpel, the blade is pressed against the cutting plane on the front of the clamping surface 2 to cut out a complete plane of the fiber bundle. The locking screw of the anti-tipping base 5 is loosened, the clamp is removed and placed under a microscope at an appropriate magnification (100x in this embodiment) to take a complete plane image of the entire fiber bundle. After obtaining the fiber image, the image is input into the aforementioned detection software, the corresponding specification standard and magnification are selected, and the model detection is called to complete the counting of monofilaments in the fiber. The software will output the number of identified monofilaments and mark the identified targets with dots in the image. Inspectors can review the statistical results of the software by viewing the result image.
[0172] Some methods are designed to detect surface defects (fuzz, filaments) in carbon fibers. The method of this invention detects the diameter and number of single filaments in the cross section of polyacrylonitrile precursor fibers. The sample and the test items are completely different.
[0173] Some other solutions use an improved ResNet-50 to classify SEM cross-sectional images as whole images (qualified / unqualified) and employ sub-image partitioning and voting mechanisms. Essentially, this is an image-level binary classification task, and the output is only a qualitative conclusion of "qualified / unqualified". It cannot locate and quantify the diameter, number and distribution of each filament. Furthermore, the model architecture (ResNet-50 classification network) used is fundamentally different from the YOLOv8 target detection model selected in the solution of this invention.
[0174] The solution of this invention defines the problem as a target detection task and uses the YOLOv8 network to locate, identify and classify each filament cross section in the cross-sectional image, realizing the transformation from "overall qualitative evaluation" to "individual quantitative analysis". It can not only count the total number of filaments, but also output the precise coordinates, diameter value and morphological category (intact / damaged) of each filament, and analyze the discreteness within the filament bundle.
[0175] Regarding the dataset construction strategy: Based on the local region segmentation of differential features, and considering the characteristics of microscopic images of polyacrylonitrile filaments or other composite fiber cross-sections, a method is proposed to construct the training set by segmenting local sub-images with differential features from the original image when training the visual model. This effectively improves the generalization ability and robustness of the model, avoids overfitting of the model on a single repetitive texture, reduces the complexity of preparing the dataset for the fiber detection visual model, and enables the model to adapt to the cross-sectional morphology variations caused by different spinning processes and different batches of filaments.
[0176] Regarding the integration and classification of multidimensional detection results: The YOLOv8 model output includes: number of monofilaments, monofilament diameter value, identification and removal of damaged sections, and diameter qualification classification (too large / qualified / too small), which fills the gap in the processing of "damaged sections" in related schemes. By identifying and removing damaged sections, the authenticity and validity of diameter statistics are ensured, and misjudgments caused by sample preparation damage are avoided.
[0177] By using computer vision recognition and proposing a complete automated detection process, a fully automated chain from image acquisition to report generation has been established, which greatly reduces the operational threshold and makes the detection results no longer dependent on the operator's experience and judgment, thus ensuring the repeatability and consistency of the detection data.
[0178] The present invention addresses the specific technical problem of microscopic detection of polyacrylonitrile precursor fiber cross-sections by making systematic technical improvements in task definition (target detection), data processing (adaptive binarization + differential sampling), model application, and result analysis (damage removal + multidimensional classification). These improvements work together to not only solve the problems of low efficiency and high subjectivity in manual detection but also overcome the limitation of deep learning classification schemes in related solutions, which cannot perform quantitative analysis at the single-filament level. This enables high-precision, complete, and automated quantitative evaluation of the cross-sectional morphology of polyacrylonitrile precursor fibers.
[0179] Using the technical solution of this embodiment, cross-sectional images of each sample in a pre-selected group of polyacrylonitrile precursor fibers are obtained, thus obtaining cross-sectional images of all samples in the group, forming a sample cross-sectional image set. Each sample cross-sectional image in the sample cross-sectional image set is preprocessed to obtain a preprocessed image; thus, preprocessed images of all sample cross-sectional images in the sample cross-sectional image set are obtained, forming a sample cross-sectional preprocessed image set. Based on the sample cross-sectional preprocessed image set, local regions with preset features are segmented as sub-images. A predetermined number of sub-images are obtained as the sample cross-sectional image sample set for the sample group. For a pre-selected YOLOv8 network, using the cross-sectional image of the polyacrylonitrile (PA) precursor fiber as input and the cross-sectional detection result of the PA is the output, the network is trained and tested based on the pre-processed sample cross-sectional image set of the sample group to obtain the cross-sectional detection model for the PA. For the PA to be detected, the cross-sectional image of the PA to be detected is obtained. Using the cross-sectional detection model of the PA to be detected, the cross-sectional detection of the PA to be detected is achieved based on the cross-sectional image of the PA to be detected. Therefore, by using the cross-sectional image of the PA to be detected and the trained YOLOv8 target detection model, the cross-sectional detection of PA to be detected is achieved, improving detection efficiency and accuracy, and facilitating the production control of PA fibers.
[0180] Specifically, in the present invention, by conducting cross-sectional inspection of polyacrylonitrile (PA) precursor fibers, PA sample samples with different parameters (such as different strength grades, different fiber bundle specifications, different spinning processes, etc.) are selected as a sample group; the cross-section of each PA sample in the sample group is photographed using a microscope to obtain a cross-sectional image of each PA sample, thereby obtaining cross-sectional images of all PA samples in the sample group, which are used as a sample cross-sectional image set; each sample cross-sectional image in the sample cross-sectional image set is preprocessed, such as by using an adaptive binarization algorithm, or by using an integral image algorithm and adaptive binarization. A binarization algorithm is used for preprocessing to obtain a preprocessed image of each sample cross-section (i.e., a preprocessed image of each sample cross-section image). This yields preprocessed cross-section images of all samples in the sample cross-section image set, forming a sample cross-section preprocessed image set. Based on this sample cross-section preprocessed image set, local regions with preset features (such as differential features) are segmented to obtain a preset number of sub-images as a dataset (i.e., a sample set). Regions in each sub-image of the dataset that meet the preset features are labeled, and the labeled dataset is used as a sample set. The sample set is then divided into a training set and a test set. YOLOv8 object detection is used. The test model (i.e., the YOLOv8 network) is trained using the training set, with cross-sectional images of polyacrylonitrile precursor fibers as input and cross-sectional detection results of polyacrylonitrile precursor fibers as output, according to preset training objectives (such as input image size, batch size, number of training epochs, and loss function and mAP metrics during training). The trained model is then tested using the test set with preset testing objectives (such as mAP, accuracy, and recall) to obtain the tested model, which serves as the cross-sectional detection model for polyacrylonitrile precursor fibers. The cross-sectional detection results of polyacrylonitrile precursor fibers include the cross-sections of the polyacrylonitrile precursor fibers. The method involves analyzing the diameter and number of monofilaments, as well as classification results. These classification results include determining whether the cross-section of the polyacrylonitrile (PAN) precursor fiber is intact or damaged, and determining whether the diameter of the monofilaments in the cross-section is too large, too small, or acceptable compared to the standard diameter when the cross-section is intact. Therefore, by using an adaptive binarization algorithm and an integral image algorithm to preprocess the cross-section image of the PAN precursor fiber, and then employing the trained YOLOv8 target detection model, the cross-section detection of the PAN precursor fiber is achieved. This improves detection efficiency and accuracy, and is beneficial for the production control of PAN precursor fibers.
[0181] According to embodiments of the present invention, a detection device for polyacrylonitrile precursor fibers corresponding to a detection method for polyacrylonitrile precursor fibers is also provided. See also Figure 7The diagram shows a structural schematic of an embodiment of the device of the present invention. The detection device for the polyacrylonitrile precursor fiber may include: an acquisition unit 102 and a control unit 104.
[0182] The acquisition unit 102 is configured to acquire cross-sectional images of each sample in a pre-selected sample group of polyacrylonitrile precursor fibers, thereby obtaining cross-sectional images of all samples in the sample group and forming a sample cross-sectional image set of the sample group. The specific functions and processing of the acquisition unit 102 are described in step S110.
[0183] The control unit 104 is configured to preprocess each sample cross-section image in the sample cross-section image set of the sample group to obtain a preprocessed image of each sample cross-section image; thereby obtaining preprocessed images of all sample cross-section images in the sample cross-section image set of the sample group, forming the sample cross-section preprocessed image set of the sample group. The specific functions and processing of the control unit 104 are described in step S120.
[0184] The control unit 104 is further configured to segment local region images with preset features as sub-images based on the sample cross-section preprocessed image set of the sample group, and obtain a preset number of sub-images as the sample cross-section image sample set of the sample group. The specific functions and processing of the control unit 104 are further described in step S130.
[0185] The control unit 104 is further configured to train and test a pre-selected YOLOv8 network, using the cross-sectional image of the polyacrylonitrile precursor fiber as input and the cross-sectional detection result of the polyacrylonitrile precursor fiber as output, based on the sample cross-sectional preprocessed image set of the sample group, to obtain a cross-sectional detection model of the polyacrylonitrile precursor fiber. The specific functions and processing of this control unit 104 are further described in step S140.
[0186] The acquisition unit 102 is further configured to acquire a cross-sectional image of the polyacrylonitrile precursor fiber to be detected. The specific functions and processing of the acquisition unit 102 are further described in step S150.
[0187] The control unit 104 is further configured to utilize the cross-sectional detection model of the polyacrylonitrile precursor fiber to perform cross-sectional detection of the polyacrylonitrile precursor fiber currently to be detected, based on the cross-sectional image of the polyacrylonitrile precursor fiber to be detected. The specific functions and processing of this control unit 104 are further described in step S160.
[0188] In the present invention, computer vision technology and neural network models are used to process and analyze the fiber cross-section images acquired by the microscope, so as to overcome the problems of low efficiency, strong subjectivity and insufficient representativeness of the manual detection method in related solutions. At the same time, it overcomes the defects of microscope imaging (such as uneven brightness of fiber cross-sections and blurred edges of some cross-sections in the image due to different brightness and focusing conditions), realizes rapid and batch detection of polyacrylonitrile precursor fiber cross-sections, improves detection efficiency and accuracy, and is beneficial to the production control of polyacrylonitrile (PAN) precursor fibers.
[0189] Since the processing and functions implemented by the device in this embodiment are basically the same as the embodiments, principles and examples of the aforementioned methods, any details not covered in the description of this embodiment can be found in the relevant descriptions in the aforementioned embodiments, and will not be repeated here.
[0190] According to an embodiment of the present invention, a computer terminal corresponding to a detection device for polyacrylonitrile precursor fibers is also provided. This computer terminal may include the detection device for polyacrylonitrile precursor fibers described above.
[0191] Since the processing and functions implemented by the computer terminal in this embodiment are basically the same as the embodiments, principles and examples of the aforementioned device, any details not covered in the description of this embodiment can be found in the relevant descriptions in the aforementioned embodiments, and will not be repeated here.
[0192] According to an embodiment of the present invention, a computer program product corresponding to the detection method for polyacrylonitrile precursor fibers is also provided, comprising a computer program that, when executed by a processor, implements the steps of the detection method for polyacrylonitrile precursor fibers described above.
[0193] Since the processing and functions implemented by the product in this embodiment are basically the same as the embodiments, principles and examples of the aforementioned methods, any details not covered in the description of this embodiment can be found in the relevant descriptions in the aforementioned embodiments, and will not be repeated here.
[0194] According to an embodiment of the present invention, a computer-readable storage medium corresponding to a method for detecting polyacrylonitrile precursor fibers is also provided. The computer-readable storage medium includes a stored program, wherein, when the program is executed, it controls the device where the computer-readable storage medium is located to perform the steps of the method for detecting polyacrylonitrile precursor fibers described above.
[0195] Since the processing and functions implemented by the computer-readable storage medium in this embodiment are basically the same as the embodiments, principles and examples of the aforementioned methods, any details not covered in the description of this embodiment can be found in the relevant descriptions in the aforementioned embodiments, and will not be repeated here.
[0196] In summary, it is readily understood by those skilled in the art that, without conflict, the aforementioned advantageous methods can be freely combined and superimposed.
[0197] The above description is merely an embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of the claims of the present invention.
Claims
1. A method for detecting polyacrylonitrile precursor fibers, characterized in that, include: For a pre-selected sample group of polyacrylonitrile precursor fibers, a cross-sectional image of each sample in the sample group is obtained, thereby obtaining cross-sectional images of all samples in the sample group, forming a sample cross-sectional image set of the sample group. Each sample cross-section image in the sample cross-section image set of the sample group is preprocessed to obtain a preprocessed image of each sample cross-section image; In this way, preprocessed images of all sample cross-section images in the sample cross-section image set of the sample group are obtained, forming the sample cross-section preprocessed image set of the sample group; Based on the sample cross-section preprocessed image set of the sample group, local region images with preset features are segmented as sub-images, and a preset number of sub-images are obtained as the sample cross-section image sample set of the sample group. For a pre-selected YOLOv8 network, the cross-sectional image of the polyacrylonitrile precursor fiber is used as input and the cross-sectional detection result of the polyacrylonitrile precursor fiber is used as output. The network is trained and tested based on the sample cross-sectional preprocessed image set of the sample group to obtain the cross-sectional detection model of the polyacrylonitrile precursor fiber. For the polyacrylonitrile precursor fiber to be tested, obtain a cross-sectional image of the polyacrylonitrile precursor fiber to be tested. Using the cross-sectional detection model of the polyacrylonitrile precursor fiber, the cross-sectional detection of the polyacrylonitrile precursor fiber to be detected is realized based on the cross-sectional image of the polyacrylonitrile precursor fiber to be detected.
2. The method for detecting polyacrylonitrile precursor fiber according to claim 1, characterized in that, in, The cross-sectional test results of the polyacrylonitrile precursor fiber include at least one of the following: the diameter of the single filament, the number of single filaments, and the classification result in the cross-section of the polyacrylonitrile precursor fiber; The classification results include at least one of the following: a first judgment result that the cross-section of the polyacrylonitrile precursor fiber is an intact cross-section or a damaged cross-section; the number of polyacrylonitrile precursor fibers with intact cross-sections; the number of polyacrylonitrile precursor fibers with damaged cross-sections; a second judgment result that, when the cross-section of the polyacrylonitrile precursor fiber is an intact cross-section, whether the diameter of the single filament in the cross-section is too large, too small, or acceptable compared to the standard diameter; the number of polyacrylonitrile precursor fibers with a diameter too large compared to the standard diameter; the number of polyacrylonitrile precursor fibers with a diameter too small compared to the standard diameter; and the number of polyacrylonitrile precursor fibers with a diameter acceptable compared to the standard diameter.
3. The method for detecting polyacrylonitrile precursor fibers according to claim 1 or 2, characterized in that, Each sample cross-sectional image in the sample cross-sectional image set of the sample group is preprocessed to obtain a preprocessed image of each sample cross-sectional image, including: For each sample cross-section image in the sample cross-section image set of the sample group, an adaptive binarization algorithm is used to calculate the mean gray value of the local neighborhood of each pixel in each sample cross-section image; in this way, the mean gray value of the local neighborhood of all pixels in each sample cross-section image is obtained. Based on the mean gray value of each pixel in the local neighborhood of each pixel in each sample cross-sectional image and the preset threshold adjustment value, the adaptive threshold of each pixel in each sample cross-sectional image is calculated; in this way, the adaptive threshold of all pixels in each sample cross-sectional image is obtained. Based on the adaptive threshold of each pixel in each sample cross-sectional image, the local neighborhood of each pixel in each sample cross-sectional image is binarized to obtain the binarized image of the local neighborhood of each pixel in each sample cross-sectional image; thus, the binarized image of the local neighborhood of all pixels in each sample cross-sectional image is obtained, which serves as the preprocessed image of each sample cross-sectional image. or, For each sample cross-section image in the sample cross-section image set of the sample group, the gray-level integral image of each sample cross-section image is calculated using the integral image algorithm. Using the grayscale integral image of each sample cross-section image, calculate the mean grayscale value of each pixel in the local neighborhood of each sample cross-section image; thus, obtain the mean grayscale value of all pixels in the local neighborhood of each sample cross-section image. Using an adaptive binarization algorithm, the local neighborhood of each pixel in each sample cross-sectional image is binarized according to an adaptive threshold, resulting in a binarized image of the local neighborhood of each pixel in each sample cross-sectional image. Thus, the binarized images of the local neighborhoods of all pixels in each sample cross-sectional image are obtained, serving as the preprocessed image of each sample cross-sectional image.
4. The method for detecting polyacrylonitrile precursor fibers according to any one of claims 1 to 3, characterized in that, Based on the preprocessed image set of the sample cross-sections of the sample group, local region images with preset features are segmented as sub-images, resulting in a preset number of sub-images as the sample cross-section image sample set of the sample group, including: Based on the sample cross-section preprocessed image set of the sample group, local region images with preset features are segmented as sub-images according to at least one of the following preset rules; The obtained sub-images are marked to distinguish between complete cross-sections and damaged cross-sections in the sub-images, thereby obtaining the sample cross-section image sample set of the sample group; Wherein, at least one preset rule includes at least one of the following: The first preset rule is that at least one of the following in the sample cross-section preprocessing image—the cross-sectional shape, cross-sectional diameter, and the distribution of monofilaments in the cross-section—can represent the corresponding characteristics of the fiber in the sample. The second preset rule: The sample cross-section image corresponding to the preprocessed sample cross-section image has a problem with unclear focus; The third preset rule: The sample cross-section preprocessed image contains a single filament with a diameter greater than or less than the standard diameter; The fourth preset rule: at least one of the following in the sample cross-section preprocessed image is different from other sample cross-section preprocessed images or other areas: the density of monofilament distribution and the tightness of adhesion between adjacent monofilaments. The fifth preset rule is to define a broken section as a case where the profile of a single filament cross section in the sample cross section preprocessing image has a gap or is separated into at least two parts at the single filament cross section. If the cross section detection result of the polyacrylonitrile precursor includes the diameter of the single filament in the cross section of the polyacrylonitrile precursor, the broken section in the sample cross section preprocessing image will be removed.
5. The method for detecting polyacrylonitrile precursor fibers according to any one of claims 1 to 4, characterized in that, For a pre-selected YOLOv8 network, using the cross-sectional image of the polyacrylonitrile precursor fiber as input and the cross-sectional detection result of the polyacrylonitrile precursor fiber as output, training and testing are performed based on the pre-processed image set of the sample cross-sections of the sample group to obtain the cross-sectional detection model of the polyacrylonitrile precursor fiber, including: The preprocessed image set of sample cross sections of the sample group is divided into a training set and a test set; For the pre-selected YOLOv8 network, using the training set, with the cross-sectional image of the polyacrylonitrile precursor fiber as input and the cross-sectional detection result of the polyacrylonitrile precursor fiber as output, the network is trained according to the preset training objective to obtain the training model of the YOLOv8 network. Using the test set, the training model of the YOLOv8 network is tested and updated according to the preset test target to obtain the test model of the YOLOv8 network, which serves as the cross-sectional detection model for the polyacrylonitrile precursor fiber.
6. The method for detecting polyacrylonitrile precursor fibers according to any one of claims 1 to 5, characterized in that, Using the cross-sectional detection model of the polyacrylonitrile precursor fiber, based on the cross-sectional image of the polyacrylonitrile precursor fiber to be detected, the cross-sectional detection of the polyacrylonitrile precursor fiber to be detected is realized, including: Under the PyTorch architecture, the cross-sectional image of the polyacrylonitrile precursor fiber to be detected is input into the cross-sectional detection model of the polyacrylonitrile precursor fiber to output the cross-sectional detection result of the polyacrylonitrile precursor fiber to be detected. The cross-sectional inspection results of the polyacrylonitrile precursor fiber to be inspected are displayed visually and / or displayed in a preset display mode.
7. A detection device for polyacrylonitrile precursor fibers using the detection method for polyacrylonitrile precursor fibers as described in any one of claims 1 to 6, characterized in that, include: The acquisition unit is configured to acquire a cross-sectional image of each sample in a pre-selected sample group of polyacrylonitrile precursor fibers, thereby obtaining cross-sectional images of all samples in the sample group and forming a sample cross-sectional image set of the sample group. The control unit is configured to preprocess each sample cross-section image in the sample cross-section image set of the sample group to obtain a preprocessed image of each sample cross-section image. In this way, preprocessed images of all sample cross-section images in the sample cross-section image set of the sample group are obtained, forming the sample cross-section preprocessed image set of the sample group; The control unit is further configured to segment local region images with preset features as sub-images based on the sample cross-section preprocessed image set of the sample group, and obtain a preset number of sub-images as the sample cross-section image sample set of the sample group. The control unit is further configured to train and test a pre-processed image set of sample cross-sections of the polyacrylonitrile precursor fiber for a pre-selected YOLOv8 network, taking the cross-sectional image of the polyacrylonitrile precursor fiber as input and the cross-sectional detection result of the polyacrylonitrile precursor fiber as output, to obtain a cross-sectional detection model of the polyacrylonitrile precursor fiber. The acquisition unit is further configured to acquire a cross-sectional image of the polyacrylonitrile precursor fiber to be detected. The control unit is further configured to utilize the cross-sectional detection model of the polyacrylonitrile precursor fiber to perform cross-sectional detection of the polyacrylonitrile precursor fiber currently to be detected, based on the cross-sectional image of the polyacrylonitrile precursor fiber currently to be detected.
8. A computer terminal, characterized in that, include: The detection device for polyacrylonitrile precursor fibers as described in claim 7.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein, when the program is executed, it controls the device containing the computer-readable storage medium to perform the detection method for polyacrylonitrile precursor fiber as described in any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the steps of the method for detecting polyacrylonitrile precursor fibers as described in any one of claims 1 to 6.