A method and system for detecting the warp and weft density of fabrics based on image recognition
Through the combination of a high-resolution camera and a deep-dense fabric intelligent detection model, the problem of insufficient accuracy of high-dense dark fabric detection is solved, automatic and accurate detection of fuselage density is realized, abnormal samples are eliminated, and the comprehensiveness and reliability of the detection is improved.
Patent Information
- Application Number
- CN202411134771.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-19
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2044-08-19
AI Technical Summary
In the prior art, in the detection of warp and weft density of high-density dark-colored fabrics, there are problems such as difficult detection and insufficient accuracy. Especially when the fabric is prone to wrinkles and complex textures, it is difficult to accurately distinguish warp and weft yarns from image recognition, resulting in inconsistent and inaccurate detection results.
A high-resolution camera is used to collect images under a uniform light source, combined with self-supervised learning pre-trained feature extraction and feature pyramid network layer, defect detection and longitude and latitude density calculation are performed through the multi-task learning head layer, abnormal samples are eliminated, global longitude and latitude density is calculated, and the deep-density fabric intelligent detection model is used for automated detection.
It improves the accuracy and efficiency of the flange density detection of high-density dark fabrics, reduces external operation errors, enhances the comprehensiveness and reliability of detection, and ensures the accuracy and representativeness of global density calculations.
Smart Images

Figure CN119130924B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image recognition, and specifically to a method and system for detecting the warp and weft density of fabrics based on image recognition. Background Art
[0002] The warp and weft density of a fabric refers to the number of warp and weft yarns per unit length of the fabric, also known as the warp density and the weft density. Specifically, the warp density represents the number of warp yarns per unit length along the warp direction, and the weft density represents the number of weft yarns per unit length along the weft direction in the fabric. The warp and weft density of a fabric is one of the important indicators for measuring the quality of the fabric. The accurate detection of the warp and weft density is of great significance for product quality control and consumer selection. Using a density mirror to read the warp and weft density is a traditional detection method, which is relatively easy for fabrics such as low-density light-colored low-count fabrics. However, when encountering high-density dark-colored high-count fabrics, the detection difficulty increases. At the same time, the fabric is prone to wrinkling, resulting in inaccurate detection results. In addition, the contrast between the fibers of the dark-colored fabric and the background is low, making it difficult to accurately distinguish the warp and weft yarns. In practice, the fabric is often held up under a light source, and then the density mirror is placed on the fabric to observe and count the warp and weft yarns through the light transmission of the light source. However, this method is relatively cumbersome to operate and the readings are also easily affected by subjective factors, resulting in inconsistent and inaccurate detection results, and it is difficult to meet the requirements of modern warp and weft density detection.
[0003] In existing research, the Chinese patent with the application number CN202311549683.1 proposed a method and system for detecting the warp and weft density of fabrics based on image recognition and AI algorithms. First, the parameters of a high-resolution and high-speed scanner were configured, and fabric image data was collected under uniform illumination to ensure that the fabric was flat and wrinkle-free during scanning. Then, the collected image data was preprocessed, and an adaptive thresholding technique was used to segment the warp and weft lines of the fabric. After that, key features were extracted and a detection model for the warp and weft density of fabrics based on a convolutional neural network was constructed. This model was trained using a large number of labeled fabric sample images until a preset accuracy threshold was reached. Although this method improves the accuracy and efficiency of fabric warp and weft density detection, it is difficult to meet the detection requirements for non-standard fabrics. The Chinese patent with the application number CN202310128716.9 proposed an automatic determination method for the density of printed woven fabrics. First, the collected fabric specimen images were grayscaled, denoised, and brightness equalized; then, Hough line detection was used to correct the image in the warp and weft directions; the maximum inter-class variance method was used to process the image into a binary image to segment the printed pattern area; after marking the printed area, the printing texture was filtered out and the fabric tissue texture was restored using the method of iterative completion with peripheral information; subsequently, the image was transformed into the frequency domain, and the Morlet wavelet transform was used to locate the yarn positions and perform density statistics and measurements, which were optimized by calculating the optimal wavelet scale; finally, based on the imaging physical length and the number of yarns obtained by decomposition, the number of yarns within 100 mm was calculated to obtain the warp density and weft density of the woven fabric, realizing the automatic determination of the density of printed woven fabrics. However, the accuracy of the results depends on the quality of the input image. If the image quality is poor, it may affect the accuracy of density determination. The Chinese patent with the application number CN201910011360.4 proposed an intelligent detection device and method for the warp and weft density of fabrics. Its computer system was connected to the imaging system and the fabric conveying system respectively, controlling the fabric conveying system to smoothly convey the fabric to be measured to the effective imaging area of the imaging system. The imaging system obtained the fabric image and generated a fabric node digital matrix, and then relevant elements were extracted according to the detection requirements to construct a knitting density detection line graph. The imaging system included a light source, a lens, and an image sensor. The fabric image was processed through filtering and gray projection, and a fabric node digital matrix was generated using color clustering and edge intensity analysis. The computer system generated a virtual variable constant grating image, which was superimposed on the knitting density detection line graph to generate an interference fringe image, and the fabric knitting density was determined by the peak position of the projected image, thus intelligently detecting the warp and weft density of the fabric. However, in actual operation, especially for fabrics that are prone to wrinkling, it is difficult for the fabric conveying system to convey the fabric completely flat to the imaging area, which will affect the imaging quality and the accuracy of the detection results.
[0004] Although there are already some fabric warp and weft density detection methods based on image recognition, these methods still have problems with insufficient recognition accuracy when faced with the wrinkle-proneness and special textures of high-density fabrics. For example, the fine fiber structure and thin texture of high-density fabrics make them more likely to wrinkle, and these wrinkled areas will interfere with the accuracy of image recognition. In addition, the special textures and colors of high-density fabrics also increase the difficulty of image recognition. These methods still have certain limitations in solving the accuracy problem of warp and weft density detection of high-count and high-density fabrics.
[0005] Therefore, a fabric warp and weft density detection method and system based on image recognition are proposed. Summary of the Invention
[0006] The purpose of the present invention is to provide a fabric warp and weft density detection method and system based on image recognition. First, obtain a high-density dark fabric sample to be detected, fix it on a platform, and use a high-resolution camera to collect images under uniform light to obtain M high-density dark fabric images. Then, preprocess the M high-density dark fabric images, including brightness equalization, super-resolution processing, denoising, and color correction, to obtain preprocessed fabric images. Next, input the preprocessed images into a trained deep and dense fabric intelligent detection model to obtain M defect detection results and M local warp and weft density calculation results. By judging whether the specified conditions are met in these results, determine the status of the sample: if the specified conditions are met, determine the sample as an abnormal sample, give an early warning, record the relevant information of the abnormal sample, generate an abnormal report, and conduct a review and precise annotation, and store the reviewed and annotated samples in the database. When the cumulative number of reviewed and annotated samples in the database reaches the specified quantity and / or it is detected that the model performance drops by more than a preset threshold, use the reviewed and annotated samples to fine-tune the model. If the specified conditions are not met, determine the sample as a normal sample. For normal samples, calculate the global warp and weft density based on their M local warp and weft density calculation results, improving the accuracy of the overall warp and weft density detection of dark high-density fabrics.
[0007] To achieve the above purpose, the present invention provides the following technical solutions:
[0008] A fabric warp and weft density detection method based on image recognition, including:
[0009] Obtain a high-density dark fabric sample to be detected to get a first sample to be detected;
[0010] Fix the first sample to be detected flat on a platform;
[0011] Use a high-resolution camera to collect images of the first sample to be detected under uniform light to obtain M high-density dark fabric images; M is the number of targets automatically photographed by the high-resolution camera;
[0012] Preprocess the M high-density dark fabric images to obtain M preprocessed fabric images; input the M preprocessed fabric images into the trained deep and dense fabric intelligent detection model to obtain M defect detection results and M local warp and weft density calculation results; the defect detection results are divided into having defects and having no defects, and the local warp and weft density calculation results include the local warp density and local weft density of each high-density dark fabric image;
[0013] When at least one of the local warp and weft density calculation results is not within the preset range and / or at least one of the defect detection results is having defects, determine that the first sample to be inspected is an abnormal sample; otherwise, determine that the first sample to be inspected is a normal sample;
[0014] Warn about the abnormal sample;
[0015] Calculate the global warp and weft density according to the M local warp and weft density calculation results of the normal sample;
[0016] The deep and dense fabric intelligent detection model is used for defect detection and warp and weft density detection of high-density dark fabrics. The structure of the deep and dense fabric intelligent detection model includes: an input layer, a pre-trained backbone network layer, a feature pyramid network layer, a multi-task learning head layer, and an output layer.
[0017] Furthermore, the platform surface is smooth and flat and has a constant temperature heating function.
[0018] Furthermore, the platform is specifically:
[0019] The platform uses high-strength aluminum alloy as the material; a layer of silicone pad with a specified thickness is laid on the platform surface;
[0020] The bottom of the platform is evenly covered with an electrothermal film as a heating element, and the electrothermal film is installed at a specified spacing;
[0021] A plurality of high-precision temperature sensors are embedded in the platform surface to monitor the temperature in real time and obtain the first real-time temperature;
[0022] The platform is connected to a PID temperature control system, and the PID temperature control system is used to achieve temperature control;
[0023] The temperature control process includes the following steps: setting a target temperature, and the PID temperature control system adjusts the power output of the electrothermal film according to the feedback signal of the high-precision temperature sensor to maintain the target temperature; using a thermal imager to comprehensively scan the surface of the platform, obtaining a temperature distribution image, and analyzing each pixel point in the temperature distribution image to obtain the first temperature value of each pixel point; calculating the temperature difference between the first temperature value of each pixel point and the target temperature to generate a temperature difference distribution map; judging whether there is an area where the temperature difference exceeds a preset threshold according to the temperature difference distribution map to obtain a temperature uniformity detection result; when there is an area where the temperature difference exceeds the preset threshold, the temperature uniformity detection result is negative; calculating the error between the first real-time temperature and the target temperature to obtain a first error set; if any one of the errors in the first error set is greater than a preset error threshold and / or the temperature uniformity detection result is negative, stop the warp and weft density detection, give an alarm, and perform temperature adjustment.
[0024] Further, the specific operation of using the high-resolution camera to collect images of the first sample to be inspected under a uniform light source is as follows:
[0025] Install the high-resolution camera on a movable bracket and move it along the length and width of the first sample to be inspected to capture images of different regions;
[0026] Obtain the size of the first sample to be inspected to get the sample length and the sample width;
[0027] Obtain the field of view of the high-resolution camera to get the field of view length and the field of view width;
[0028] Set the overlap length and the overlap width; wherein, the overlap length represents the length of the overlapping area between adjacent images in the vertical direction, and the overlap width represents the width of the overlapping area between adjacent images in the horizontal direction;
[0029] Calculate the horizontal shooting quantity and the vertical shooting quantity, and the calculation formula is:
[0030]
[0031] where, N h represents the horizontal shooting quantity; N v represents the vertical shooting quantity; L s represents the sample length; L v represents the field of view length; O l represents the overlap length; W s represents the sample width; W v represents the field of view width; O v represents the overlap width, Denotes rounding up;
[0032] Calculate the target quantity, and the calculation formula is:
[0033] M = N h ·N v ;
[0034] where M represents the target quantity;
[0035] Determine the moving step size and path of the high-resolution camera in the horizontal and vertical directions according to the horizontal shooting quantity and the vertical shooting quantity; Program-control the movable bracket so that the high-resolution camera automatically shoots according to the preset moving step size and the path, and obtain M high-density dark fabric images.
[0036] Furthermore, the preprocessing of the M high-density dark fabric images is specifically as follows:
[0037] Use the multi-scale Retinex algorithm to perform brightness equalization on the high-density dark fabric image to obtain a first preprocessed image;
[0038] Perform super-resolution processing on the first preprocessed image through the SRCNN model to obtain a second preprocessed image;
[0039] Apply the non-local means denoising algorithm to denoise the second preprocessed image to obtain a third preprocessed image;
[0040] Use the gray world assumption and white balance correction technology to perform color correction on the third preprocessed image to obtain the preprocessed fabric image.
[0041] Furthermore, the deep and dense fabric intelligent detection model is specifically as follows:
[0042] The input layer is used to receive the preprocessed fabric image;
[0043] The pre-trained backbone network layer includes a self-supervised learning pre-trained feature extraction layer and a pre-trained model feature extraction layer; The self-supervised learning pre-trained feature extraction layer uses SimCLR to perform pre-training on a specified quantity of data collected in advance; The pre-trained model feature extraction layer adopts the pre-trained DenseNet network structure and is fine-tuned on a dataset of high-density dark fabric images collected in advance and with annotations to further extract basic features;
[0044] The feature pyramid network layer extracts and fuses multi-level features through convolutional kernels of different scales to capture details and global information at different scales in the image;
[0045] The multi-task learning head layer includes a defect detection head layer and a warp and weft density calculation head layer; the defect detection head layer includes an attention mechanism layer, a classification layer, and a localization layer; the attention mechanism layer uses a self-attention mechanism; the classification layer is used to classify the extracted features to identify different types of defects; the localization layer is used to localize the extracted features and mark the specific position of the defects in the image; the warp and weft density calculation head layer includes a CNN feature extraction layer, an RNN sequence modeling layer, and a warp and weft density calculation layer; the CNN feature extraction layer uses a convolutional neural network to extract the warp and weft yarn features in the image; the RNN sequence modeling layer uses a recurrent neural network to capture the sequence information of the yarns to analyze the arrangement and density of the yarns; the warp and weft density calculation layer is used to count the number of warp and weft yarns per unit length and calculate the warp and weft density of the image;
[0046] The output layer includes a defect detection output layer and a warp and weft density output layer.
[0047] Further, in addition to warning the abnormal samples, the subsequent processing also includes:
[0048] Recording the relevant information of the abnormal samples to obtain sample abnormal information including detection time, operating conditions, and abnormal descriptions;
[0049] Generating a report containing the sample abnormal information;
[0050] Conducting a review and precise annotation of the abnormal samples to obtain review-annotated samples;
[0051] Storing the review-annotated samples in a database;
[0052] When the accumulated review-annotated samples in the database reach a specified quantity and / or it is detected that the performance of the deep and dense fabric intelligent detection model drops by more than a preset threshold, using the review-annotated samples in the database to fine-tune the deep and dense fabric intelligent detection model.
[0053] Further, calculating the global warp and weft density according to the M local warp and weft density calculation results of the normal samples is specifically:
[0054] The global warp and weft density includes global warp density and global weft density, and the calculation formula is:
[0055]
[0056] Wherein, represents the global warp density; represents the global weft density; i represents the index of the local warp and weft density calculation result; represents the local warp density in the i-th local warp and weft density calculation result; It represents the local weft density in the calculation result of the local warp and weft density of the i-th one, and M represents the target quantity.
[0057] A fabric warp and weft density detection system based on image recognition, comprising:
[0058] A sample preparation module, configured to obtain a high-density dark fabric sample to be detected to obtain a first sample to be detected; and fix the first sample to be detected flat on a platform;
[0059] An image acquisition module, configured to use a high-resolution camera to perform image acquisition on the first sample to be detected under a uniform light source to obtain M high-density dark fabric images; M is the target quantity automatically photographed by the high-resolution camera;
[0060] An image preprocessing module, configured to preprocess the M high-density dark fabric images to obtain M preprocessed fabric images;
[0061] An intelligent detection module, configured to input the M preprocessed fabric images into a trained deep-density fabric intelligent detection model to obtain M defect detection results and M local warp and weft density calculation results; M is the target quantity automatically photographed by the high-resolution camera; the defect detection results are divided into having defects and having no defects, and the local warp and weft density calculation results include the local warp density and the local weft density of each high-density dark fabric image;
[0062] An anomaly detection module, configured to determine that the first sample to be detected is an abnormal sample when at least one of the local warp and weft density calculation results is not within a preset range and / or at least one of the defect detection results is having a defect; otherwise, determine that the first sample to be detected is a normal sample;
[0063] An early warning module, configured to give an early warning to the abnormal sample;
[0064] A global density calculation module, configured to calculate the global warp and weft density according to the M local warp and weft density calculation results of the normal sample;
[0065] The deep-density fabric intelligent detection model is used for defect detection and warp and weft density detection of high-density dark fabrics, and the structure of the deep-density fabric intelligent detection model includes: an input layer, a pre-trained backbone network layer, a feature pyramid network layer, a multi-task learning head layer, and an output layer.
[0066] Furthermore, the surface of the platform is smooth and flat and has a constant temperature heating function.
[0067] Compared with the prior art, the beneficial effects of the present invention are:
[0068] 1. The present invention acquires images by using a high - resolution camera under a uniform light source and realizes automated data acquisition through a movable bracket. By calculating the number of horizontal and vertical shots, it ensures full coverage of all areas of the sample to be inspected, avoiding missed shots and duplicate shots, and guaranteeing the comprehensiveness and integrity of the detection. By setting the overlapping length and width, it reduces the image stitching error and improves the detection accuracy. Automatically controlling the movement and shooting process of the high - resolution camera significantly improves the image acquisition efficiency and reduces external operation errors. The uniform light source ensures consistent illumination for each image, reduces the influence of illumination changes, and improves the accuracy of image recognition and analysis. The high - resolution camera captures the fine features of the fabric, providing high - quality image data for defect detection and warp - weft density calculation. The overall method has a high degree of automation, reduces external intervention, and through precise calculation of the camera movement step size and path, ensures the high accuracy and reliability of the acquired image data, which helps to improve the accuracy of subsequent warp - weft density detection.
[0069] 2. The present invention proposes an intelligent detection model for deep - density fabrics, specifically targeting the detection requirements of high - density dark fabrics. The self - supervised learning pre - trained feature extraction layer uses SimCLR for pre - training on a specified amount of pre - collected data, combined with fine - tuning on the labeled data using the DenseNet structure to extract high - quality features, improving the generalization ability and accuracy of the model. The Feature Pyramid Network layer extracts and fuses multi - level features through multi - scale convolutional kernels, enhancing the parsing ability for complex images. The multi - task learning head layer combines defect detection and warp - weft density calculation, uses the attention mechanism to enhance the attention to key features, and accurately calculates the warp - weft density of high - density dark fabrics through the method of combining CNN and RNN. The overall method has a high degree of automation, and eliminates samples with obvious defects and uneven warp - weft density distribution, significantly improving the detection accuracy and reliability, and enhancing the accuracy of warp - weft density detection for high - density dark fabrics.
[0070] 3. The method for calculating the global warp - weft density according to the local warp - weft density calculation results of normal samples in the present invention, by eliminating abnormal samples and only calculating the global warp - weft density for normal samples, ensures that the selected sample data is more representative and can more accurately reflect the overall quality of the entire fabric. By integrating the warp - weft density data of multiple local regions, it can accurately calculate the global warp - weft density of the entire fabric sample, providing a comprehensive assessment of the fabric quality and avoiding the influence of individual local data anomalies on the overall judgment. The average processing method of multiple local data can smooth out some local accidental errors, making the global warp - weft density calculation result more accurate and reliable. It helps to improve the accuracy of warp - weft density detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] Figure 1 It is a flowchart of a method for detecting the warp - weft density of fabrics based on image recognition provided by an embodiment of the present invention;
[0072] Figure 2 Schematic diagram of the high-density dark fabric image provided by the embodiment of the present invention;
[0073] Figure 3 Structural diagram of the intelligent detection model for deep and dense fabrics provided by the embodiment of the present invention;
[0074] Figure 4 Schematic diagram of the training process of the intelligent detection model for deep and dense fabrics provided by the embodiment of the present invention;
[0075] Figure 5 Structural diagram of a fabric warp and weft density detection system based on image recognition provided by the embodiment of the present invention. Detailed implementation manners
[0076] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0077] Embodiment 1:
[0078] In fabric production, the warp and weft density of the fabric is a key indicator. For example, a fabric marked as "100×80" means that there are 100 warp threads and 80 weft threads per unit length. The higher the warp and weft density, the better the sealing and smoothness of the fabric usually are, but this may also lead to a decrease in the softness of the fabric. For different types of fabrics, such as cotton, silk, wool, etc., their ideal warp and weft densities will also vary to adapt to their specific uses and requirements. Factory A is an enterprise specializing in the production of high-density dark fabrics. In the fabric factory inspection link, in order to ensure the quality of high-density dark fabrics, Factory A introduced a warp and weft density detection method based on image recognition, including:
[0079] Refer to Figure 1 in S10, obtain a high-density dark fabric sample to be detected to obtain a first sample to be detected;
[0080] As an implementation manner of the present invention, obtain a high-density black fabric sample to be detected. The standard density (number of roots / 10 cm) of the high-density black fabric sample is 700 (±15) × 500 (±15); the standard density refers to the density value specified by the warp and weft yarn manufacturer.
[0081] In this embodiment, the first sample to be detected is a high-density plain weave fabric.
[0082] Refer to Figure 1 in S20, fix the first sample to be detected flat on the platform;
[0083] Furthermore, the surface of the platform is smooth and flat and has a constant-temperature heating function.
[0084] The smooth and flat surface of the platform ensures that the fabric sample remains flat and wrinkle-free during the detection process, thus avoiding image acquisition errors caused by uneven surfaces. The constant-temperature heating function can prevent the fabric from stretching and deforming due to temperature changes during the detection process, further improving the detection accuracy and stability. It helps to achieve higher-quality fabric detection.
[0085] The platform is made of high-strength aluminum alloy as the material; a layer of silicone pad with a specified thickness is laid on the surface of the platform; an electric heating film is evenly covered at the bottom of the platform as the heating element, and the electric heating film is installed at a specified spacing; a plurality of high-precision temperature sensors are embedded in the surface of the platform to monitor the temperature in real time and obtain the first real-time temperature; the platform is connected to a PID temperature control system, and the PID temperature control system is used to achieve temperature control;
[0086] The temperature control process includes the following steps: setting the target temperature, and the PID temperature control system adjusts the power output of the electric heating film according to the feedback signal of the high-precision temperature sensor to maintain the target temperature; using a thermal imager to comprehensively scan the surface of the platform, obtaining a temperature distribution image, and analyzing each pixel point in the temperature distribution image to obtain the first temperature value of each pixel point; calculating the temperature difference between the first temperature value of each pixel point and the target temperature to generate a temperature difference distribution map; according to the temperature difference distribution map, determining whether there is an area where the temperature difference exceeds a preset threshold to obtain a temperature uniformity detection result; when there is an area where the temperature difference exceeds the preset threshold, the temperature uniformity detection result is no; calculating the error between the first real-time temperature and the target temperature to obtain a first error set; if any error in the first error set is greater than a preset error threshold and / or the temperature uniformity detection result is no, stop the warp and weft density detection, give an alarm, and perform temperature adjustment.
[0087] As an implementation manner of the present invention, a 5-mm silicone pad is laid on the surface of the platform, and 5 high-precision temperature sensors are embedded in the surface of the platform, which are distributed at the four corners and the center of the platform. Before using the thermal imager, the platform also needs to be preheated at the target temperature for a period of time (such as 30 minutes) to ensure temperature stability.
[0088] By selecting high-strength aluminum alloy and silicone pads as the platform materials and using an electrothermal film for uniform heating, combined with an embedded high-precision temperature sensor and a PID temperature control system, constant temperature control of the platform surface can be achieved. A thermal imager and temperature distribution image analysis further ensure temperature uniformity. This design effectively guarantees the stability and uniformity of the platform temperature during the detection process, avoiding fabric stretching deformation and detection errors caused by uneven temperature, thereby greatly improving the accuracy and reliability of fabric warp and weft density detection. When the detected temperature difference exceeds the preset threshold, the system can give an early warning in a timely manner, stop the detection, and perform temperature adjustment to ensure the continuity and accuracy of the entire detection process.
[0089] Refer to Figure 1 In S30 of , use a high-resolution camera to collect images of the first sample to be detected under a uniform light source, obtaining M high-density dark fabric images; M is the number of targets automatically photographed by the high-resolution camera;
[0090] In this embodiment, as Figure 2 shown, a schematic diagram of a high-density dark fabric image is provided.
[0091] Furthermore, the specific operation of using the high-resolution camera to collect images of the first sample to be detected under a uniform light source is as follows:
[0092] Install the high-resolution camera on a movable bracket and move it along the length and width of the first sample to be detected to capture images of different regions;
[0093] Obtain the size of the first sample to be detected to get the sample length and sample width;
[0094] Obtain the field of view of the high-resolution camera to get the field of view length and field of view width;
[0095] Set the overlap length and overlap width; where the overlap length represents the length of the overlapping area between adjacent images in the vertical direction, and the overlap width represents the width of the overlapping area between adjacent images in the horizontal direction;
[0096] Calculate the horizontal shooting quantity and the vertical shooting quantity, and the calculation formula is:
[0097]
[0098] where N h represents the horizontal shooting quantity; N v represents the vertical shooting quantity; L s represents the sample length; L v represents the field of view length; O l represents the overlap length; W s represents the sample width; Wv represents the field of view width; O v represents the overlap width, represents rounding up;
[0099] Calculate the number of the targets, and the calculation formula is:
[0100] M = N h ·N v ;
[0101] wherein, M represents the number of the targets;
[0102] Determine the moving step size and path of the high-resolution camera in the horizontal and vertical directions according to the horizontal shooting quantity and the vertical shooting quantity; Program-control the movable bracket to enable the high-resolution camera to perform automatic shooting according to the preset moving step size and the path, so as to obtain M high-density dark fabric images.
[0103] As an implementation manner of the present invention, the following is an example calculation:
[0104] Fabric size (specified size) of the first sample to be inspected: 2 m (width) × 3 m (length);
[0105] Camera field of view: 0.5 m (width) × 0.5 m (length);
[0106] Overlap area: 10% (both length and width are 0.05 m);
[0107]
[0108] T = N h ·N v = 5 × 7 = 35;
[0109] Then the horizontal shooting quantity is 5, the vertical shooting quantity is 7, and M (number of targets) is 35.
[0110] Refer to Figure 1 S40 in, preprocess the M high-density dark fabric images to obtain M preprocessed fabric images; Input the M preprocessed fabric images into the trained deep and dense fabric intelligent detection model to obtain M defect detection results and M local warp and weft density calculation results; The defect detection results are divided into having defects and having no defects, and the local warp and weft density calculation results include the local warp density and the local weft density of each high-density dark fabric image;
[0111] When M is 35, the high-resolution camera is made to automatically take pictures according to the preset moving step size and path, obtaining 35 high-density dark fabric images. The 35 high-density dark fabric images are preprocessed to obtain 35 preprocessed fabric images. The 35 preprocessed fabric images are input into the trained deep and dense fabric intelligent detection model to obtain 35 defect detection results and 35 local warp and weft density calculation results. That is, each preprocessed fabric image outputs a defect detection result and a local warp and weft density calculation result.
[0112] This image acquisition method lays a foundation for the comprehensive and accurate detection of high-density black fabric samples. The high-resolution camera is installed on a movable bracket and moves along the length and width of the sample to ensure that every area is photographed, avoiding detection blind spots. An overlapping area is set to ensure the continuity and consistency of adjacent images and improve the overall accuracy. Image acquisition is carried out under a uniform light source to provide a consistent detection environment and ensure image clarity and detail performance. By calculating the number of shots and the path, the moving step size and path of the camera are programmed to control to achieve automated shooting, reducing external interference and operation errors. Using parameters such as the field of view size and the overlapping area, the number of shots and the moving path of the camera are accurately calculated. This method can quickly identify and locate defects and density unevenness in the fabric, promptly feedback to the production line, improve the accuracy and efficiency of product detection, and effectively reduce the possibility of missed detection.
[0113] Further, the preprocessing of the M high-density dark fabric images is specifically as follows:
[0114] The multi-scale Retinex algorithm is used to perform brightness equalization on the high-density dark fabric image to obtain a first preprocessed image;
[0115] The SRCNN model is used to perform super-resolution processing on the first preprocessed image to obtain a second preprocessed image;
[0116] The non-local means denoising algorithm is applied to denoise the second preprocessed image to obtain a third preprocessed image;
[0117] The gray world assumption and white balance correction technology are used to perform color correction on the third preprocessed image to obtain the preprocessed fabric image.
[0118] This image preprocessing method performs brightness equalization using the multi-scale Retinex algorithm, effectively solving the problem of insufficient brightness during the image acquisition of dark fabrics, enhancing the contrast and detail performance of the image. The super-resolution processing of the SRCNN model further improves the resolution of the image, making the fine defects and textures of high-density fabrics more clearly visible. The non-local means denoising algorithm removes the noise in the image, ensuring the image quality of high-density dark fabrics under low-light conditions and improving the accuracy of the detection results. The gray world assumption and white balance correction technology perform color correction on the image, making the image colors of high-density dark fabrics more real and consistent, and reducing the impact of light changes on the detection results. Combining these preprocessing steps not only improves the overall quality and stability of the image, but also significantly improves the accuracy and reliability of defect detection and warp and weft density calculation for high-density dark fabrics.
[0119] Refer to Figure 1 In S50, when at least one of the local warp and weft density calculation results is not within the preset range and / or at least one of the defect detection results indicates a defect, it is determined that the first sample to be inspected is an abnormal sample; otherwise, it is determined that the first sample to be inspected is a normal sample.
[0120] Obtain 5 samples to be detected and perform Figure 1 S20 - S70 in; specifically, the samples to be detected are 5 samples randomly selected from high-density black fabrics produced in the same batch. The size, material, and specifications of each high-density black fabric are the same, and each sample to be detected is of a specified size. The preset range (per 10 cm) is 700 (±15) × 500 (±15). The target quantity M is 35.
[0121] Table 1. Classification and discrimination table for samples to be inspected
[0122]
[0123] As shown in Table 1, the local warp density (maximum value) represents the maximum value among 35 local warp densities, and the local warp density (minimum value) represents the minimum value among 35 local warp densities; the local weft density (maximum value) represents the maximum value among 35 local weft densities, and the local weft density (minimum value) represents the minimum value among 35 local weft densities. The above four indicators can all be obtained from the 35 local warp and weft density calculation results.
[0124] Furthermore, the intelligent detection model for deep-density fabrics is specifically:
[0125] The input layer is used to receive the preprocessed fabric image;
[0126] The pre-trained backbone network layer includes a self-supervised learning pre-trained feature extraction layer and a pre-trained model feature extraction layer; the self-supervised learning pre-trained feature extraction layer uses SimCLR to perform pre-training on a specified number of pre-collected data; the pre-trained model feature extraction layer adopts a pre-trained DenseNet network structure and is fine-tuned on a pre-collected and labeled high-density dark fabric image dataset to further extract basic features; in this embodiment, the self-supervised learning pre-trained feature extraction layer uses SimCLR to perform pre-training on 10,000 pre-collected data.
[0127] The feature pyramid network layer extracts and fuses multi-level features through convolutional kernels of different scales to capture details and global information of different scales in the image;
[0128] The multi-task learning head layer includes a defect detection head layer and a warp and weft density calculation head layer; the defect detection head layer includes an attention mechanism layer, a classification layer, and a localization layer; the attention mechanism layer uses a self-attention mechanism; the classification layer is used to classify the extracted features to identify different types of defects; the localization layer is used to localize the extracted features to mark the specific position of the defect in the image; the warp and weft density calculation head layer includes a CNN feature extraction layer, an RNN sequence modeling layer, and a warp and weft density calculation layer; the CNN feature extraction layer uses a convolutional neural network to extract the warp and weft yarn features in the image; the RNN sequence modeling layer uses a recurrent neural network to capture the sequence information of the yarns to analyze the arrangement and density of the yarns; the warp and weft density calculation layer is used to count the number of warp and weft yarns per unit length and calculate the warp and weft density of the image;
[0129] The output layer includes a defect detection output layer and a warp and weft density output layer.
[0130] First, the input layer receives the preprocessed fabric image. By using the SimCLR of the self-supervised learning pre-trained feature extraction layer and the DenseNet network structure of the pre-trained model feature extraction layer, it can learn and extract high-quality features from the high-density dark fabric data, ensuring that the model has strong feature representation ability. The Feature Pyramid Network layer extracts and fuses multi-level features through convolutional kernels of different scales, which can capture details and global information at different scales in the image, improving the recognition ability for complex fabric images. The multi-task learning head layer combines defect detection and warp and weft density calculation, significantly improving the comprehensiveness and accuracy of detection. The defect detection head layer can accurately identify and locate different types of defects through the attention mechanism, classification, and localization layers. The warp and weft density calculation head layer uses the combination of CNN and RNN to efficiently capture yarn features and sequence information, accurately calculating the warp and weft density. The attention mechanism layer in the defect detection head layer enhances the ability to focus on details and key features, enabling the model to better identify subtle defects when processing complex images of high-density dark fabrics. The RNN sequence modeling layer in the warp and weft density calculation head layer effectively captures the arrangement and density information of yarns, ensuring the accuracy and reliability of warp and weft density calculation. The output layer includes a defect detection output layer and a warp and weft density output layer, which can provide defect detection results and warp and weft density calculation results. Combining the above advantages, when processing high-density dark fabrics, this intelligent detection model not only significantly improves the accuracy and efficiency of defect detection and warp and weft density calculation, but also greatly reduces the possibility of missed detection and false detection, enhancing the automation level and reliability of fabric quality control.
[0131] Refer to Figure 1 S60 in it to give an early warning for the abnormal sample;
[0132] Further, in addition to giving an early warning for the abnormal sample, the subsequent processing also includes:
[0133] Recording the relevant information of the abnormal sample to obtain sample abnormal information including detection time, operating conditions, and abnormal description; generating a report containing the sample abnormal information; conducting a review and precise annotation on the abnormal sample to obtain a reviewed and annotated sample; storing the reviewed and annotated sample in the database; when the cumulative number of the reviewed and annotated samples in the database reaches a specified quantity and / or it is detected that the performance of the intelligent detection model for deep-density fabrics drops by more than a preset threshold, using the reviewed and annotated samples in the database to fine-tune the intelligent detection model for deep-density fabrics.
[0134] By warning and recording abnormal samples, details such as the detection time, operating conditions, and abnormal descriptions are recorded in detail, and a report containing this information is generated, providing complete tracking and traceability for quality control. The abnormal samples are reviewed and accurately labeled, and the reviewed and labeled samples are stored in the database to ensure data integrity and traceability. When the number of reviewed and labeled samples in the database reaches a specified quantity or a decrease in model performance is detected, these samples are used to fine-tune the model to maintain its high efficiency and accuracy. By integrating these subsequent processing steps, the self-optimization ability of the detection model is enhanced, ensuring stability and reliability during long-term operation, effectively reducing the possibility of missed detections and false detections, and improving the overall efficiency and accuracy of fabric warp and weft density detection.
[0135] Refer to Figure 1 S70 in, calculate the global warp and weft density according to the calculation results of the M local warp and weft densities of the normal samples;
[0136] Furthermore, calculating the global warp and weft density according to the calculation results of the M local warp and weft densities of the normal samples is specifically:
[0137] The global warp and weft density includes the global warp density and the global weft density, and the calculation formula is:
[0138]
[0139] Among them, represents the global warp density; represents the global weft density; i represents the index of the calculation results of the local warp and weft densities; represents the local warp density in the i-th calculation result of the local warp and weft densities; represents the local weft density in the i-th calculation result of the local warp and weft densities, and M represents the target quantity.
[0140] This calculation method can obtain the global warp and weft density of a piece of fabric by averaging the local warp and weft densities of normal samples, providing accurate basic data for overall quality assessment. Measurement errors in individual local areas may affect the density calculation of a single sample. By averaging multiple detection areas, the influence of these errors on the overall result can be effectively reduced, improving the accuracy of the calculation. This calculation method not only improves the comprehensiveness and accuracy of the warp and weft density detection method but also enhances the reliability and stability of fabric quality assessment.
[0141] The deep-density fabric intelligent detection model is used for defect detection and warp and weft density detection of high-density dark-colored fabrics. The structure of the deep-density fabric intelligent detection model is as Figure 3 shown, including: an input layer, a pre-trained backbone network layer, a feature pyramid network layer, a multi-task learning head layer, and an output layer.
[0142] As an implementation manner of the present invention, with reference to Figure 4 , the training process of the intelligent detection model for deep and dense fabric involves multiple steps including data preparation, data preprocessing, model design, model training, model verification, and model fine-tuning. The following is the detailed training process: In the data preparation stage, a large number of images of high-density dark fabrics are first collected, covering various types of fabrics and quality problems, and the defect positions, defect types, and warp and weft densities of each high-density dark fabric image are labeled. Then, the data set is divided into a training set, a validation set, and a test set, with a division ratio of 70% for the training set, 15% for the validation set, and 15% for the test set. In the data preprocessing process, the image size is uniformly adjusted to 256×256 pixels, and the multi-scale Retinex algorithm is used to perform brightness equalization on the image to obtain a first image; the first image is subjected to super-resolution processing through the SRCNN model to obtain a second image; the non-local means denoising algorithm is applied to denoise the second image to obtain a third image; the gray world assumption and white balance correction technology are used to perform color correction on the third image to obtain a fourth image.
[0143] In terms of label processing, the defect labels and warp and weft density labels are formatted into the specified model input form. The model design is as shown in Figure 3 . Define the defect detection classification loss, defect detection localization loss, and warp and weft density calculation loss. For the defect detection classification loss, the cross-entropy loss is adopted to measure the performance of the model in the classification task; for the defect detection localization loss, the L2 loss is used to evaluate the performance of the model in accurately locating the defect positions; for the warp and weft density calculation loss, the mean square error (MSE) is adopted to measure the error of the model in calculating the warp and weft densities. Select the Adam optimizer and set the corresponding parameters as shown in Table 2. Among them, β1 is used to control the smoothness of the first-order moment estimation, which helps to accelerate convergence and reduce oscillations. β2 is used to control the smoothness of the second-order moment estimation, which helps to stabilize the update and prevent overly large step sizes.
[0144] Table 2. Parameter setting table
[0145] Parameter Value Learning rate 0.0001 <![CDATA[β1]]> 0.9 <![CDATA[β2]]> 0.999 Weight decay 0.00001
[0146] Forward propagation is performed through the input image and label data to calculate the loss, the weights are updated by backpropagation, the performance of the model is evaluated on the validation set and the hyperparameters are adjusted. The learning rate scheduler is adopted to adjust the learning rate according to the performance of the validation set, and the training cycle is 100 epochs. If the performance of the validation set no longer improves, the training is stopped in advance.
[0147] During the model fine-tuning phase, abnormal samples are collected and labeled, and the database is updated. When the database contains a specified number of reviewed and labeled samples (such as 100) or the model performance is detected to have dropped by more than a preset threshold, the model is fine-tuned, and new abnormal samples are used for incremental training. The model performance is re-evaluated to ensure that the model adapts to the new data distribution and abnormal patterns.
[0148] In order to verify the advancedness of the deep and dense fabric intelligent detection model proposed in the present invention, a comparison was made with the existing image recognition method. The grayscale projection method, the multi-scale convolutional network (MSNet) and the detection method based on the deep and dense fabric intelligent detection model proposed in the present invention were used for comparative tests.
[0149] Get 5 samples to be tested and execute Figure 1 In S20-S70, only the image recognition models used are different, and the rest of the operations are the same; specifically, the samples to be tested are 5 high-density dark fabrics produced in the same batch, each of which has the same size, material and specification, and each sample to be tested is of a specified size.
[0150] In this embodiment, the fabric decomposition method is used as the arbitration method, mainly based on the test method A of GB / T 4668-1995 "Determination of density of woven fabrics". First, remove the yarn at the edge of the sample, measure the length slightly larger than the specified size with a steel ruler, and cut it with scissors. Mark the specified size with a pick needle, remove it one by one from the edge, and count it.
[0151] Table 3. Comparison of results between image recognition method and fabric decomposition method
[0152]
[0153] The calculation formula of the relative error rate in Table 3 is:
[0154]
[0155] Among them, B represents the relative error rate, R image Represents the detection result of the image recognition method, R fabric Indicates the test results of the fabric decomposition method.
[0156] The relative error rates were calculated by comparing the detection results of the three groups of image recognition methods for warp and weft density with the warp and weft density results of the fabric decomposition method respectively, and two decimal places were reserved after the decimal point of the relative error rate results. The calculation results are shown in Table 3. Taking the warp and weft density obtained by the fabric decomposition method as the standard value, the data obtained by detecting the density of 5 fabrics based on the intelligent detection model for deep and dense fabrics were compared with the standard value, and the difference ratio between the two was ≤ 0.99%. The intelligent detection model for deep and dense fabrics based on the present invention is significantly superior to the existing gray projection method and multi-scale convolutional network (MSNet) in terms of detection accuracy and reliability. This model shows the lowest relative error rate in the detection of different samples.
[0157] This method for detecting the warp and weft density of fabrics based on image recognition collects images under a uniform light source using a high-resolution camera. A constant-temperature heating platform is designed to effectively avoid the problem of fabric wrinkles and ensure a high-quality image source. Combining preprocessing and the intelligent detection model for deep and dense fabrics, comprehensive and accurate detection of high-density dark fabric samples is achieved. This method can not only accurately identify defects in fabrics but also precisely calculate the local and global warp and weft densities of fabrics. When an abnormal sample is detected, the system will give an early warning. Since the local density in the defective sample may be significantly different from that in the normal sample, if the defective sample is not excluded, it will affect the representativeness of the overall data. The method of the present invention excludes samples with obvious defects and uneven warp and weft density distributions and calculates the global warp and weft density, which helps to avoid the influence of calculation results being deviated and ensure the reliability of the global warp and weft density. Overall, this detection method significantly improves the accuracy of fabric warp and weft density detection.
[0158] Example Two:
[0159] Factory B is an enterprise engaged in fabric production. In the fabric factory inspection link, in order to ensure the quality of high-density dark fabrics, Factory B applies a warp and weft density detection system based on image recognition, as Figure 5 shown, including:
[0160] A sample preparation module, used to obtain a high-density dark fabric sample to be detected and obtain a first sample to be detected; fix the first sample to be detected flat on the platform;
[0161] In this embodiment, the first sample to be detected is a high-density twill fabric.
[0162] An image acquisition module, used to use a high-resolution camera to collect images of the first sample to be detected under a uniform light source to obtain M high-density dark fabric images; M is the number of targets automatically photographed by the high-resolution camera;
[0163] An image preprocessing module, used to preprocess the M high-density dark fabric images to obtain M preprocessed fabric images;
[0164] An intelligent detection module, configured to input M preprocessed fabric images into a trained deep and dense fabric intelligent detection model to obtain M defect detection results and M local warp and weft density calculation results; M is the number of targets automatically photographed by the high-resolution camera; the defect detection results are divided into having defects and having no defects, and the local warp and weft density calculation results include the local warp density and the local weft density of each high-density dark fabric image;
[0165] An anomaly detection module, configured to determine that the first sample to be inspected is an abnormal sample when at least one of the local warp and weft density calculation results is not within a preset range and / or at least one of the defect detection results is having defects; otherwise, determine that the first sample to be inspected is a normal sample;
[0166] An early warning module, configured to give an early warning for the abnormal sample;
[0167] A global density calculation module, configured to calculate the global warp and weft density according to the M local warp and weft density calculation results of the normal samples;
[0168] The deep and dense fabric intelligent detection model is used for defect detection and warp and weft density detection of high-density dark fabrics. The structure of the deep and dense fabric intelligent detection model includes: an input layer, a pre-trained backbone network layer, a feature pyramid network layer, a multi-task learning head layer, and an output layer.
[0169] Furthermore, the surface of the platform is smooth and flat and has a constant temperature heating function.
[0170] To verify the effectiveness of the detection system proposed in the present invention, a comparison was made with the fabric decomposition method detection method.
[0171] Obtain 3 samples to be detected, and respectively execute S20-S70 in Figure 1 ; specifically, the samples to be detected are 3 high-density dark fabrics produced in the same batch, the size, material, and specifications of each high-density dark fabric are the same, and each sample to be detected is of a specified size.
[0172] In this embodiment, the specific operation of using the fabric decomposition method is the same as that in Embodiment 1.
[0173] Table 4. Comparison of warp and weft density results between system detection and fabric decomposition method detection
[0174]
[0175] As can be seen from Table 4, for samples of the twill fabric type, the test results of system detection and fabric decomposition method detection are basically the same, and the relative error rates are both within 2.50%, which indicates that the detection system can provide objective and accurate detection results.
[0176] Although embodiments of the present invention have been shown and described, it will be understood by those of ordinary skill in the art that various changes, modifications, substitutions and variations can be made to these embodiments without departing from the principles and spirit of the present invention, and the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for detecting the warp and weft density of fabrics based on image recognition, characterized in that, Including: Obtain a high-density dark fabric sample to be detected to get a first sample to be detected; Fix the first sample to be detected flat on a platform; Use a high-resolution camera to collect images of the first sample to be detected under a uniform light source to obtain M high-density dark fabric images; M is the number of targets automatically photographed by the high-resolution camera; The specific process of the image collection is: install the high-resolution camera on a movable bracket and move along the length and width of the first sample to be detected to photograph images of different areas; Obtain the size of the first sample to be detected to get the sample length and sample width; Obtain the field of view of the high-resolution camera to get the field of view length and field of view width; Set the overlapping length and overlapping width; wherein, the overlapping length represents the length of the overlapping area between adjacent images in the vertical direction, and the overlapping width represents the width of the overlapping area between adjacent images in the horizontal direction; Calculate the horizontal shooting quantity and the vertical shooting quantity, and the calculation formula is: ; ; Among them, represents the horizontal shooting quantity; represents the vertical shooting quantity; represents the sample length; represents the field of view length; represents the overlapping length; represents the sample width; represents the field of view width; represents the overlapping width, represents rounding up. Calculate the number of targets, and the calculation formula is: ; Wherein, M represents the number of targets; Determine the moving step size and path of the high-resolution camera in the horizontal and vertical directions according to the horizontal shooting quantity and the vertical shooting quantity; Program-control the movable bracket to make the high-resolution camera automatically shoot according to the preset moving step size and the path to obtain M high-density dark fabric images; Preprocess the M high-density dark fabric images to obtain M preprocessed fabric images; Input the M preprocessed fabric images into a trained deep and dense fabric intelligent detection model to obtain M defect detection results and M local warp and weft density calculation results; The defect detection results are divided into having defects and having no defects, and the local warp and weft density calculation results include the local warp density and local weft density of each high-density dark fabric image; When at least one of the local warp and weft density calculation results is not within the preset range and / or at least one of the defect detection results is having defects, determine that the first sample to be detected is an abnormal sample; Otherwise, determine that the first sample to be detected is a normal sample; Warn the abnormal sample; Calculate the global warp and weft density according to the M local warp and weft density calculation results of the normal sample; The global warp and weft density includes the global warp density and global weft density, and the calculation formula is: ; ; Among them, represents the global warp density; represents the global weft density; represents the index of the local warp and weft density calculation result; represents the th local warp density in the local warp and weft density calculation results; represents the th local weft density in the local warp and weft density calculation results, represents the target quantity; The deep and dense fabric intelligent detection model is used for defect detection and warp and weft density detection of high-density dark fabrics, and the structure of the deep and dense fabric intelligent detection model includes: an input layer, a pre-trained backbone network layer, a feature pyramid network layer, a multi-task learning head layer and an output layer.
2. The method for detecting the warp and weft density of a fabric based on image recognition according to claim 1, wherein The surface of the platform is smooth and flat and has a constant temperature heating function.
3. The method for detecting the warp and weft density of a fabric based on image recognition according to claim 2, wherein, The platform is specifically: The platform uses high-strength aluminum alloy as the material; A layer of silicone pad with a specified thickness is laid on the surface of the platform; The bottom of the platform is evenly covered with an electric heating film as a heating element, and the electric heating film is installed at a specified interval; A plurality of high-precision temperature sensors are embedded on the surface of the platform to monitor the temperature in real time to obtain the first real-time temperature; The platform is connected with a PID temperature control system, and the PID temperature control system is used to realize temperature control; The temperature control process includes the following steps: setting a target temperature, and the PID temperature control system adjusts the power output of the electrothermal film according to the feedback signal of the high-precision temperature sensor to maintain the target temperature; using a thermal imager to comprehensively scan the surface of the platform, obtaining a temperature distribution image, and analyzing each pixel point in the temperature distribution image to obtain the first temperature value of each pixel point; calculating the temperature difference between the first temperature value of each pixel point and the target temperature to generate a temperature difference distribution map; judging whether there is an area where the temperature difference exceeds a preset threshold according to the temperature difference distribution map to obtain a temperature uniformity detection result; when there is an area where the temperature difference exceeds the preset threshold, the temperature uniformity detection result is no; calculating the error between the first real-time temperature and the target temperature to obtain a first error set; if any one of the errors in the first error set is greater than a preset error threshold and / or the temperature uniformity detection result is no, stop the warp and weft density detection, give an alarm, and perform temperature adjustment.
4. A method for detecting the warp and weft density of a fabric based on image recognition according to claim 1, characterized in that, The preprocessing of all the high-density dark fabric images is specifically as follows: Using the multi-scale Retinex algorithm to perform brightness equalization on the high-density dark fabric image to obtain a first preprocessed image; Performing super-resolution processing on the first preprocessed image through the SRCNN model to obtain a second preprocessed image; Applying the non-local mean denoising algorithm to denoise the second preprocessed image to obtain a third preprocessed image; Using the gray world assumption and white balance correction technology to perform color correction on the third preprocessed image to obtain the preprocessed fabric image.
5. A method for detecting the warp and weft density of a fabric based on image recognition according to claim 1, characterized in that, The intelligent detection model for the deep and dense fabric is specifically as follows: The input layer is used to receive the preprocessed fabric image; The pre-trained backbone network layer includes a self-supervised learning pre-trained feature extraction layer and a pre-trained model feature extraction layer; the self-supervised learning pre-trained feature extraction layer uses SimCLR to perform pre-training on a specified number of pre-collected data; the pre-trained model feature extraction layer adopts a pre-trained DenseNet network structure and is fine-tuned on a pre-collected high-density dark fabric image dataset with annotations to further extract basic features; The feature pyramid network layer extracts and fuses multi-level features through convolutional kernels of different scales to capture details and global information at different scales in the image; The multi-task learning head layer includes a defect detection head layer and a warp and weft density calculation head layer; the defect detection head layer includes an attention mechanism layer, a classification layer, and a localization layer; the attention mechanism layer uses a self-attention mechanism; the classification layer is used to classify the extracted features to identify different types of defects; the localization layer is used to localize the extracted features and mark the specific position of the defect in the image; the warp and weft density calculation head layer includes a CNN feature extraction layer, an RNN sequence modeling layer, and a warp and weft density calculation layer; the CNN feature extraction layer uses a convolutional neural network to extract the warp and weft yarn features in the image; the RNN sequence modeling layer uses a recurrent neural network to capture the sequence information of the yarns to analyze the arrangement and density of the yarns; the warp and weft density calculation layer is used to count the number of warp and weft yarns per unit length and calculate the warp and weft density of the image; The output layer includes a defect detection output layer and a warp and weft density output layer.
6. The method for detecting the warp and weft density of a fabric based on image recognition according to claim 1, wherein In addition to warning about the abnormal samples, subsequent processing further includes: Recording the relevant information of the abnormal samples to obtain sample abnormal information including detection time, operating conditions, and abnormal descriptions; Generating a report containing the sample abnormal information; Conducting a review and precise annotation of the abnormal samples to obtain review-annotated samples; Storing the review-annotated samples in a database; When the accumulated review-annotated samples in the database reach a specified quantity and / or it is detected that the performance of the intelligent detection model for high-density dark fabrics has decreased by more than a preset threshold, using the review-annotated samples in the database to fine-tune the intelligent detection model for high-density dark fabrics.
7. A fabric warp and weft density detection system based on image recognition, characterized in that, Including: A sample preparation module, which is used to obtain high-density dark fabric samples to be detected to obtain a first sample to be detected; Fixing the first sample to be detected flat on a platform; An image acquisition module, which is used to use a high-resolution camera to acquire images of the first sample to be detected under a uniform light source to obtain M high-density dark fabric images; M is the number of targets automatically photographed by the high-resolution camera; the specific process of the image acquisition is: installing the high-resolution camera on a movable bracket and moving along the length and width of the first sample to be detected to photograph images of different regions; Obtaining the size of the first sample to be detected to obtain the sample length and the sample width; Obtaining the field of view of the high-resolution camera to obtain the field of view length and the field of view width; Setting an overlap length and an overlap width; wherein, the overlap length represents the length of the overlapping area between adjacent images in the vertical direction, and the overlap width represents the width of the overlapping area between adjacent images in the horizontal direction; Calculating the horizontal shooting quantity and the vertical shooting quantity, and the calculation formula is: ; ; Among them, represents the horizontal shooting quantity; represents the vertical shooting quantity; represents the sample length; represents the field of view length; represents the overlap length; represents the sample width; represents the field of view width; represents the overlap width, represents rounding up. Calculating the number of targets, and the calculation formula is: ; Among them, represents the target quantity; Determining the moving step size and path of the high-resolution camera in the horizontal and vertical directions according to the horizontal shooting quantity and the vertical shooting quantity; programming and controlling the movable bracket to enable the high-resolution camera to automatically shoot according to the preset moving step size and path to obtain M high-density dark fabric images; An image preprocessing module for preprocessing the M high-density dark fabric images to obtain M preprocessed fabric images; An intelligent detection module for inputting the M preprocessed fabric images into a trained deep and dense fabric intelligent detection model to obtain M defect detection results and M local warp and weft density calculation results; the defect detection results are divided into having defects and having no defects, and the local warp and weft density calculation results include the local warp density and the local weft density of each high-density dark fabric image; An anomaly detection module for determining that the first sample to be inspected is an abnormal sample when at least one of the local warp and weft density calculation results is not within a preset range and / or at least one of the defect detection results is having defects; otherwise, determining that the first sample to be inspected is a normal sample; An early warning module for giving an early warning to the abnormal sample; A global density calculation module for calculating the global warp and weft density according to the M local warp and weft density calculation results of the normal samples; the global warp and weft density includes the global warp density and the global weft density, and the calculation formula is: ; ; Among them, represents the global warp density; represents the global weft density; represents the index of the local warp and weft density calculation result; represents the local warp density in the th local warp and weft density calculation result; represents the target quantity. The deep and dense fabric intelligent detection model is used for defect detection and warp and weft density detection of high-density dark fabrics, and the structure of the deep and dense fabric intelligent detection model includes: an input layer, a pre-trained backbone network layer, a feature pyramid network layer, a multi-task learning head layer and an output layer.
8. The fabric warp and weft density detection system based on image recognition according to claim 7, characterized in that, The surface of the platform is smooth and flat and has a constant temperature heating function.
Citation Information
Patent Citations
Intelligent detection device and method for fabric count
CN109594319A
Method for automatically measuring fabric density of printing machine
CN116309358A
Fabric warp and weft density detection method and system based on image recognition and AI algorithm
CN117495839A