A Deep Learning-Based Method and System for Printing Defect Detection
By combining ultrasonic probes and deep learning models, the problems of environmental interference and subtle defect identification in the inspection of printed fabrics have been solved, achieving defect detection with higher accuracy and reliability.
Patent Information
- Application Number
- CN202610824539.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-09
- Publication Date
- 2026-07-31
AI Technical Summary
Existing machine vision technology is easily affected by factors such as light fluctuations, fabric pattern color interference, moisture, and fiber fly in the defect detection of printed fabrics, making it difficult to accurately identify subtle structural abnormalities inside the fabric, such as shallow fiber knots and slight thickness unevenness.
Echo signals are acquired by scanning with an ultrasonic probe and defect detection is performed by combining a deep learning model. The accuracy of detection is improved by constructing a spatial detection baseline, dynamic compensation, time-frequency analysis and high-dimensional feature extraction.
It effectively reduces the impact of environmental interference, broadens the detection coverage, enhances the detection adaptability under complex working conditions, and improves the accuracy of defect classification.
Smart Images

Figure CN122492678A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a method and system for detecting printing defects based on deep learning. Background Technology
[0002] In the textile production process, defect detection of printed fabrics is a crucial step in ensuring product quality. Currently, machine vision technology is widely used as the mainstream inspection method in the industry. This technology uses industrial cameras to capture images of the fabric surface and combines image processing algorithms or basic pattern recognition technology to identify defects, which can play a certain role in conventional scenarios. However, this type of optical imaging-based inspection method still has some room for optimization in practical applications. On the one hand, its detection effect may be affected by factors such as light fluctuations, fabric pattern color interference, and moisture and fiber fly in the production environment. Under such complex conditions, the risk of false detection or missed detection may increase. On the other hand, for the subtle structural anomalies inside the printed fabric, or defect types that are difficult to judge directly from surface images, such as shallow fiber knots, slight thickness unevenness, or blurred patterns caused by thickness differences at the seams of the base fabric in roller printing, if the thickness difference at the seams is small, it is difficult to accurately identify the cause and extent of the blurred marks by surface imaging alone. The recognition effect of traditional visual inspection technology usually has room for improvement. Summary of the Invention
[0003] The technical problem to be solved by the present invention is to provide a printing defect detection method and system based on deep learning, which improves the accuracy and reliability of defect detection in printed fabrics and the efficiency of defect location and processing at the production end.
[0004] To solve the above-mentioned technical problems, the technical solution of the present invention is as follows:
[0005] Firstly, a deep learning-based method for detecting printing defects, the method comprising:
[0006] Step 1: Use an ultrasonic probe to scan the moving printed fabric to obtain the original ultrasonic echo signal sequence.
[0007] Step 2: Based on the scanning position information of the original ultrasonic echo signal sequence, a spatial detection baseline is constructed in the width direction of the printed fabric, using the two fixed positions of the fabric production guide edge and the operation edge as reference benchmarks; the spatial detection baseline is divided to generate independent detection areas, and the dynamic compensation coefficient is calculated.
[0008] Step 3: Preprocess the original ultrasonic echo signal according to the dynamic compensation coefficient to generate a preprocessed ultrasonic signal; perform time-frequency analysis on the preprocessed ultrasonic signal to obtain the corresponding time-frequency domain characterization.
[0009] Step 4: Input the time-frequency domain representation into the pre-trained deep learning model to extract a high-dimensional deep feature set;
[0010] Step 5: Use a deep learning model to determine the defect type of the high-dimensional deep feature set and obtain the defect type result;
[0011] Step 6: Based on the defect type results and combined with the scan location information, generate the final detection information.
[0012] Secondly, a deep learning-based printing defect detection system includes:
[0013] The acquisition module is used to scan the moving printed fabric with an ultrasonic probe to obtain the original ultrasonic echo signal sequence.
[0014] The calculation module is used to construct a spatial detection baseline in the width direction of the printed fabric, based on the scanning position information of the original ultrasonic echo signal sequence, using two fixed positions of the fabric production guide edge and the operation edge as reference benchmarks; the spatial detection baseline is divided to generate independent detection areas, and the dynamic compensation coefficient is calculated.
[0015] The processing module is used to preprocess the original ultrasonic echo signal according to the dynamic compensation coefficient to generate a preprocessed ultrasonic signal; and to perform time-frequency analysis on the preprocessed ultrasonic signal to obtain the corresponding time-frequency domain characterization.
[0016] The extraction module is used to input the time-frequency domain representation into a pre-trained deep learning model to extract a high-dimensional deep feature set;
[0017] The decision module is used to use a deep learning model to determine the defect type of a high-dimensional deep feature set and obtain the defect type result.
[0018] The generation module is used to generate the final detection information based on the defect type results and the scan location information.
[0019] The above-described solution of the present invention has at least the following beneficial effects:
[0020] By using an ultrasonic probe to scan and acquire echo signals, the influence of factors such as light fluctuations, fabric surface pattern and color interference, and moisture and fiber lint on the detection in the production environment can be effectively reduced. At the same time, it can capture subtle structural anomalies inside the fabric, such as shallow fiber knots and slight thickness unevenness, which are non-surface visible defects, thus broadening the coverage of defect detection and enhancing the detection adaptability under complex working conditions. The signal, after dynamic compensation preprocessing, is transformed into a richer time-frequency domain representation through time-frequency analysis. Then, high-dimensional deep features are extracted by a deep learning model and defect type judgment is performed, which can more accurately capture the subtle features of defects and improve the accuracy of defect classification. Attached Figure Description
[0021] Figure 1 This is a schematic diagram of a deep learning-based printing defect detection method provided by an embodiment of the present invention.
[0022] Figure 2 This is a schematic diagram of a printing defect detection system based on deep learning provided by an embodiment of the present invention. Detailed Implementation
[0023] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
[0024] like Figure 1 As shown, an embodiment of the present invention proposes a printing defect detection method based on deep learning, the method comprising the following steps:
[0025] Step 1: Use an ultrasonic probe to scan the moving printed fabric to obtain the original ultrasonic echo signal sequence.
[0026] Step 2: Based on the scanning position information of the original ultrasonic echo signal sequence, a spatial detection baseline is constructed in the width direction of the printed fabric, using the two fixed positions of the fabric production guide edge and the operation edge as reference benchmarks; the spatial detection baseline is divided to generate independent detection areas, and the dynamic compensation coefficient is calculated.
[0027] Step 3: Preprocess the original ultrasonic echo signal according to the dynamic compensation coefficient to generate a preprocessed ultrasonic signal; perform time-frequency analysis on the preprocessed ultrasonic signal to obtain the corresponding time-frequency domain characterization.
[0028] Step 4: Input the time-frequency domain representation into the pre-trained deep learning model to extract a high-dimensional deep feature set;
[0029] Step 5: Use a deep learning model to determine the defect type of the high-dimensional deep feature set and obtain the defect type result;
[0030] Step 6: Based on the defect type results and combined with the scan location information, generate the final detection information.
[0031] In this embodiment of the invention, the use of an ultrasonic probe to scan and acquire echo signals can effectively reduce the impact of factors such as light fluctuations, fabric surface pattern color interference, moisture, and fiber fly on the detection in the production environment. At the same time, it can capture subtle structural anomalies inside the fabric, such as shallow fiber knots and slight thickness unevenness, which are non-surface visible defects, thus broadening the coverage of defect detection and enhancing the detection adaptability under complex working conditions. The signal, after dynamic compensation preprocessing, is transformed into a richer time-frequency domain representation through time-frequency analysis. Then, high-dimensional deep features are extracted by a deep learning model and defect type judgment is performed, which can more accurately capture the subtle features of defects and improve the accuracy of defect classification.
[0032] In a preferred embodiment of the present invention, step 1, scanning the moving printed fabric with an ultrasonic probe to obtain the original ultrasonic echo signal sequence, may include:
[0033] Step 101: Arrange multiple ultrasonic probes in a fixed pattern along the width of the printed fabric to obtain the probe detection area. Each probe in the detection area emits ultrasonic pulses into the moving printed fabric to obtain the original echo analog signal. Specifically, this includes: measuring the actual width of the printed fabric, such as 1.8 meters or 2.4 meters; determining the number of probes based on the effective detection diameter of a single ultrasonic probe, such as 5 millimeters or 8 millimeters; ensuring a 5% to 10% overlap in the detection range of adjacent probes to avoid detection blind spots in the width direction; and fixing these probes to the same horizontal metal bracket with bolts, adjusting the bracket height to ensure the detection range of each probe is within the acceptable range. The probes move vertically downwards onto the surface of the printed fabric, forming a continuous detection area covering the entire width of the fabric. Based on the fabric's movement speed, such as 60 m / min or 80 m / min, a preset time interval is set for the probes to emit pulses, ensuring that the fabric's movement distance does not exceed 1 / 3 of the probe's detection diameter within the time interval between two adjacent pulses. Each probe emits ultrasonic pulses at a fixed frequency (e.g., 10 MHz or 15 MHz) at this time interval. The pulses are reflected after contacting the fabric surface and internal fiber structure. The receiving unit of each probe receives the reflected ultrasonic signals in real time; these received continuous waveform signals are the original echo analog signals.
[0034] Step 102: Digitally sample the original echo analog signal from each probe to obtain the initial echo data corresponding to each probe; arrange the initial echo data in chronological order to obtain an ordered echo signal sequence. Specifically, this includes: connecting the original echo analog signal output from each probe to an analog-to-digital converter; setting the sampling frequency according to the ultrasonic pulse frequency (usually 5 to 10 times the pulse frequency); the analog-to-digital converter collects the amplitude information of the analog signal point by point at the sampling frequency, converting the continuous analog waveform into discrete numerical signals. These discrete numerical signals are the initial echo data corresponding to each probe; arranging the initial echo data corresponding to each probe in chronological order of data acquisition time, marking each data point with an acquisition timestamp, forming a continuous signal sequence in the time dimension, i.e., an ordered echo signal sequence.
[0035] Step 103: Combine the ordered echo signal sequence of each probe with the fixed lateral position of the probe and the longitudinal displacement data of the fabric movement to obtain the echo signal sequence of a single probe. Specifically, this includes: pre-determining a fixed physical point on the fabric guide edge as the lateral coordinate origin; measuring the horizontal distance from the center of each probe to this origin using a tape measure with an accuracy of 0.1 mm; recording the lateral coordinate value of each probe (accurate to millimeters); and storing these coordinate values in the data acquisition system according to the probe number to form the fixed lateral position information of each probe; installing an incremental photoelectric encoder at one end of the fabric transfer roller shaft, with the encoder coaxially fixed to the roller shaft; setting the encoder to output 1024 pulse signals per revolution; measuring the actual circumference of the roller shaft (accurate to millimeters); and dividing the circumference value by 1024 to obtain... The longitudinal movement distance of the fabric corresponds to each pulse signal; the encoder outputs pulse signals in real time, and the data acquisition system accumulates the total number of pulses at each sampling moment. The total number of pulses is multiplied by the movement distance corresponding to a single pulse to obtain the longitudinal displacement data of the fabric at that moment (accurate to 0.1 mm); the ordered echo signal sequence of each probe is traversed, and the sampling timestamp and amplitude information of each data point in the sequence are extracted; the longitudinal displacement data output by the encoder at the time of acquisition of the data point is matched according to the timestamp, and the fixed lateral position information corresponding to the probe is retrieved; the amplitude information, corresponding lateral position information, longitudinal displacement data and sampling timestamp of each data point are bound together to form a single data unit containing four-dimensional information; all data units are arranged in the order of sampling timestamps to form the echo signal sequence of a single probe.
[0036] Step 104: Integrate and spatially align the echo signal sequences of all probes along the width direction to obtain the original ultrasonic echo signal sequence. Specifically, this includes: using the longitudinal displacement data of the fabric movement as a time reference, arranging the echo signal sequence of each probe sequentially from the guide edge to the operating edge along the width direction according to their respective lateral positions; transmitting ultrasonic pulses to a fixed mark point on the fabric, recording the time difference of each probe receiving the echo at that mark point, and performing time offset correction on the signals of each probe based on this time difference to ensure that the signals at different lateral positions at the same longitudinal displacement position are synchronized in the time dimension; after correction, a two-dimensional signal set covering the entire fabric width and movement length is formed, which is the original ultrasonic echo signal sequence.
[0037] This embodiment determines the number of probes and sets overlapping areas based on fabric width and probe detection range, which can completely cover the fabric width and avoid detection blind spots. By setting the pulse emission interval in combination with the fabric movement speed, it can ensure that there are no missed detections during fabric movement and comprehensively capture signals from different positions on the fabric. The analog signal is digitized by matching the sampling frequency with the pulse frequency, which can completely preserve the waveform details of the echo signal. By sorting by time and associating with spatial position, each signal data point carries spatiotemporal information, which facilitates the overall analysis of the spatial signal distribution of the fabric.
[0038] In a preferred embodiment of the present invention, step 2, based on the scanning position information of the original ultrasonic echo signal sequence, constructs a spatial detection baseline in the width direction of the printed fabric, using two fixed positions—the fabric production guide edge and the operation edge—as reference benchmarks; the spatial detection baseline is divided to generate independent detection areas, and a dynamic compensation coefficient is calculated, which may include:
[0039] Step 201: Extract the scanning position information contained in the original ultrasonic echo signal sequence to obtain the set of horizontal coordinates and the set of vertical coordinates for each data point. Specifically, this includes: traversing all signal data points in the original ultrasonic echo signal sequence in ascending order of fabric longitudinal displacement, where each data point is a four-dimensional data unit containing amplitude, horizontal position, longitudinal displacement, and timestamp; extracting horizontal position information from the horizontal position field of each data unit and extracting longitudinal displacement information from the longitudinal displacement field; summarizing all horizontal position information and arranging it in ascending order of value to form a set of horizontal coordinates, for example, arranged sequentially from 5mm to 1995mm; summarizing all longitudinal displacement information and arranging it in chronological order of acquisition time (corresponding to longitudinal displacement from smallest to largest) to form a set of vertical coordinates, for example, arranged sequentially from 0mm to 5000mm.
[0040] Step 202: Analyze the set of horizontal coordinates, identify the horizontal coordinate values corresponding to the fixed positions of the guide edge and the operation edge, and obtain the coordinate data of two reference points. Specifically, this includes: extracting the echo amplitude of each data point in ascending order of horizontal coordinates and observing the amplitude change trend; when the amplitude of five consecutive adjacent data points rapidly decreases from the normal range (e.g., 200 to 500 mV) to below 10 mV, it is determined that an amplitude mutation has occurred; in the set of horizontal coordinates, find the horizontal coordinate value corresponding to the first occurrence of this mutation (this is the starting point of the amplitude, i.e., the horizontal coordinate maximum). (Little end) This value is the horizontal coordinate value of the fixed position of the guide edge; continue traversing to the end with the largest horizontal coordinate, find the horizontal coordinate value corresponding to the last occurrence of this change, this value is the horizontal coordinate value of the fixed position of the operation edge; extract all longitudinal displacement data corresponding to the horizontal coordinate value of the guide edge, calculate their arithmetic mean as the longitudinal coordinate of the guide edge reference point; similarly calculate the average longitudinal displacement corresponding to the horizontal coordinate value of the operation edge, as the longitudinal coordinate of the operation edge reference point; combine the horizontal and vertical coordinates of the guide edge, and combine the horizontal and vertical coordinates of the operation edge to form the complete coordinate data of the two reference points respectively.
[0041] Step 203: Calculate the width direction based on the coordinate data of the two reference points to construct a spatial detection baseline. Divide the spatial detection baseline into segments according to a preset equal interval to generate independent detection areas. Specifically, this includes: subtracting the horizontal coordinate value of the guide edge reference point from the horizontal coordinate value of the operation edge reference point to obtain the actual length of the fabric width. For example, if the guide edge coordinate is 10mm and the operation edge is 1990mm, the actual width is 1990mm - 10mm = 1980mm. Establish a two-dimensional coordinate system with the horizontal coordinate as the X-axis and the vertical coordinate as the Y-axis, mark the two reference points in the coordinate system, and use a straight line... Connect these two marked points with a line; this straight line is the spatial detection baseline. Set the number of equal intervals according to the number of probes (e.g., 8 equal intervals for 8 probes). Divide the actual length of the fabric width by the number of intervals to obtain the width of each segment, such as 1980mm ÷ 8 ≈ 247.5mm. Starting from the lateral coordinate of the guide edge reference point, accumulate the segment widths sequentially to determine the lateral coordinate range of each independent detection area. For example, the first area is 10mm to 257.5mm, the second is 257.5mm to 505mm, and so on until the operating edge coordinate. The width area corresponding to each value range is the independent detection area.
[0042] Step 204: Collect amplitude data of all echo signals within each independent detection area, calculate the average amplitude of the echo signals in each independent detection area, and obtain the reference signal strength parameter for each area. Specifically, this includes: for each independent detection area, determining the starting and ending values of its lateral coordinates, such as 10mm to 257.5mm; traversing the original ultrasonic echo signal sequence, filtering out all signal data points whose lateral coordinates are greater than or equal to the starting value and less than the ending value, excluding abnormal data points with an amplitude of 0, and retaining valid data points; extracting the amplitude information of all valid data points, summing these amplitude values one by one to obtain the total amplitude of the area; counting the number of valid data points, dividing the total amplitude by the number of valid data points, and obtaining the result is the average amplitude of the echo signal in the independent detection area. This average amplitude is used as the reference signal strength parameter for the area. For example, if the total amplitude of a certain area is 10000mV, there are 50 valid data points, and the average amplitude is 200mV.
[0043] Step 205: Compare the difference between the reference signal strength parameters of each region and the overall reference signal strength, and calculate the dynamic compensation coefficient corresponding to each region. Specifically, this includes: adding the reference signal strength parameters of all independent detection regions one by one to obtain the total parameter sum; dividing the total parameter sum by the total number of independent detection regions to obtain the arithmetic mean, which is the overall reference signal strength. For example, if the total parameter sum of 8 regions is 1600mV, the overall reference is 200mV; for each independent detection region, dividing the overall reference signal strength by the reference signal strength parameter of that region to obtain the dynamic compensation coefficient corresponding to that region. The coefficient ranges from 0.5 to 2.0: when the regional reference signal strength parameter is greater than the overall reference (e.g., regional parameter 250mV, overall 200mV), the coefficient is 0.8 (between 0.5 and 1.0), indicating that the signal amplitude in this region needs to be reduced; when the regional reference signal strength parameter is less than the overall reference (e.g., regional parameter 100mV, overall 200mV), the coefficient is 2.0 (between 1.0 and 2.0), indicating that the signal amplitude in this region needs to be increased; the closer the coefficient is to 1.0, the smaller the difference between the signal strength in this region and the overall average level; the farther the coefficient deviates from 1.0, the greater the difference.
[0044] This embodiment identifies the coordinates of the guide edge and the operating edge based on the abrupt change characteristics of the edge echo amplitude, which can accurately determine the reference point and provide a reliable basis for the spatial detection baseline. It divides the probe detection range into independent regions at equal intervals to ensure consistent signal characteristics within the regions. It calculates the average amplitude of each region and compares it with the overall level to obtain a dynamic compensation coefficient, which can specifically eliminate signal deviations caused by differences in material and thickness in different regions of the fabric, reduce the interference of the fabric's own characteristics on the detection, and improve the reliability of the signal.
[0045] In a preferred embodiment of the present invention, step 3, preprocessing the original ultrasonic echo signal according to the dynamic compensation coefficient to generate a preprocessed ultrasonic signal; performing time-frequency analysis on the preprocessed ultrasonic signal to obtain the corresponding time-frequency domain characterization, may include:
[0046] Step 301: Multiply the dynamic compensation coefficient corresponding to each region with the original ultrasonic echo signal of the corresponding region to obtain the amplitude-compensated ultrasonic signal. Specifically, this includes: matching the lateral coordinate of each original ultrasonic echo signal data point with the lateral coordinate range of each independent detection region. For example, if the lateral coordinate of a data point is 150mm, it matches a region from 10mm to 257.5mm to determine the independent detection region to which the data point belongs; for each independent detection region, traverse all original signal data points within that region in ascending order of the fabric's longitudinal displacement; extract the amplitude value from each data point, such as 200mV or 150mV, and then... The range of lateral coordinate values for the detection area is defined, and the pre-calculated and stored dynamic compensation coefficients (such as 0.8 and 1.5) for that area are retrieved. The extracted amplitude values are multiplied point by point with the dynamic compensation coefficients, for example, 200mV×0.8=160mV, 150mV×1.5=225mV, to obtain the adjusted amplitude value for each data point. The adjusted amplitude values are used to replace the amplitude field in the original data point, while retaining other information such as the lateral coordinates, longitudinal displacement, and timestamp of the data point. After all data points in all areas have been processed, all data points are re-integrated according to the longitudinal displacement order of the fabric, and the resulting signal set is the amplitude-compensated ultrasonic signal.
[0047] Step 302: Preprocess the amplitude-compensated ultrasonic signal to obtain a preprocessed ultrasonic signal. Apply time-frequency analysis to the preprocessed ultrasonic signal to convert the time-domain signal into a joint time-frequency distribution, obtaining the initial time spectrum. Specifically, this includes: filtering high-frequency interference in the amplitude-compensated ultrasonic signal. Since the ultrasonic pulse frequency is typically 5 to 20 MHz, the high-frequency cutoff threshold is set to twice the pulse frequency, i.e., 10 to 40 MHz. This removes high-frequency interference (such as noise generated by electronic devices) by retaining components with frequencies below this threshold. Then, perform low-frequency interference filtering, setting the low-frequency cutoff threshold to 0.3 to 0.7 MHz (typically 0.5 MHz). This removes low-frequency interference (such as noise generated by slow changes in the overall thickness of the fabric) by retaining components with frequencies above this threshold. (Signal fluctuation); After two filtering steps, the signal is smoothed using a moving average method. The signal sampling frequency is 5 to 10 times the pulse frequency (i.e., 25 to 200 MHz), and the sliding window length is set to 5 to 10 sampling points, corresponding to a time range of 0.05 to 0.4 μs (e.g., 8 sampling points correspond to 0.16 μs when the sampling frequency is 50 MHz). Starting from the first data point of the signal, the window slides along the longitudinal displacement direction, sliding 1 sampling point at a time. The sum of the amplitudes of all data points in each window is calculated, and then the sum is divided by the number of data points in the window to obtain the arithmetic mean. This mean is used to replace the amplitude of the data point at the center of the window (when the window length is even, the amplitude of the first data point in the second half of the window is replaced). This reduces random fluctuations in the signal, and the processed signal is the pre-processed ultrasonic signal.
[0048] Short-time Fourier transform (SFT) was used to process the preprocessed ultrasonic signal. A Hanning window was selected as the time window to reduce spectral leakage. The window length was set to 50 to 100 sampling points based on the signal characteristics, corresponding to a time range of 0.25 to 4 μs (e.g., at a sampling frequency of 50 MHz, 50 sampling points correspond to 1 μs, and 100 sampling points correspond to 2 μs). The window overlap rate was fixed at 50% to balance time and frequency resolution. The time window was then slid along the signal's time axis, sliding 25 to 50 sampling points at a time, corresponding to a sliding time of 0.125 to 4 μs. 2μs; Perform Fourier transform on the signal within each window to calculate the frequency component corresponding to that window (range 0 to twice the pulse frequency), and the amplitude of each frequency component (range 0 to the maximum amplitude of the compensated signal); Integrate the processing results of all windows, with time as the horizontal axis (unit μs, range 0 to the total signal duration) and frequency as the vertical axis (unit MHz, range 0 to 40MHz), and use the amplitude to represent the gray level at the corresponding position, that is, the larger the amplitude, the darker the gray level, with the gray level value range from 0 to 255, and the resulting two-dimensional image is the initial time spectrum.
[0049] Step 303: Normalize the initial time spectrum to obtain a standardized time-frequency distribution, and perform feature enhancement processing to obtain a time-frequency domain representation. Specifically, this includes: starting from the first point on the time axis of the initial time spectrum, traversing each row from left to right, moving to the next row after each row is completed, until all grayscale data points are covered; during the traversal, comparing the grayscale values of all data points, recording the largest grayscale value (usually between 200 and 255) and the smallest grayscale value (usually between 0 and 50); for each grayscale data point... Point-by-point calculation begins by subtracting the minimum grayscale value from the grayscale value of the data point to obtain the numerical difference. For example, if a data point has a grayscale value of 120 and a minimum grayscale value of 30, the difference is 90. This numerical difference is then divided by the difference between the maximum and minimum grayscale values. For example, if the maximum grayscale value is 240 and the minimum is 30, the difference is 210, resulting in the normalized grayscale value (e.g., 90 ÷ 210 ≈ 0.43). After all data points have been processed, all grayscale values in the time-frequency spectrum are adjusted to the range of 0 to 1, and the resulting two-dimensional image is the standardized time-frequency distribution.
[0050] Contrast enhancement is performed on the standardized time-frequency distribution by uniformly dividing the grayscale range of 0 to 1 into 256 levels. The number of pixels corresponding to each level is counted, i.e., the frequency of occurrence of that grayscale level in the time-frequency spectrum. The cumulative number of pixels at each level is calculated, starting from the lowest level and accumulating. The cumulative number is then divided by the total number of pixels to obtain the cumulative ratio. Based on the cumulative ratio, the grayscale levels are redistributed so that pixels originally concentrated in a few levels are evenly distributed across the 256 levels, with a focus on increasing the grayscale difference between areas with significant amplitude changes (potentially corresponding to defects) and the surrounding background. After enhancement, background weakening is performed using a 3×3... The filter kernel (with values at 9 positions: 0.4 at the center, 0.1 at each of the four adjacent positions (top, bottom, left, and right), and 0.05 at each of the four corner positions, summing to 1) is applied to each pixel in the time-frequency domain. The filter kernel is then applied to each pixel in the time-frequency domain. The value at each position in the kernel is multiplied by the corresponding pixel's grayscale value, and these 9 products are summed to obtain a total value. This total value is then used to replace the grayscale value of the current pixel. Through this process, the grayscale of background areas with gentle amplitude changes (such as areas corresponding to normal fabric structures) becomes more uniform, and the defect-related feature areas become more prominent. The two-dimensional image formed after these two processes is the time-frequency domain representation.
[0051] In this embodiment, the normalization processing of the initial spectrum can adjust the gray values of different data points to a uniform range, eliminate the problem of uneven numerical span caused by the difference in the original amplitude, avoid the impact of numerical imbalance on subsequent feature extraction, and ensure that all data points are under the same analysis standard. During the feature enhancement process, contrast enhancement can amplify the gray value difference between the defect area and the surrounding background, making potential defect features easier to distinguish. Background weakening processing makes the gray value of normal fabric areas with gentle amplitude changes more uniform, reducing the interference of irrelevant background information on defect identification.
[0052] In a preferred embodiment of the present invention, step 4, inputting the time-frequency domain representation into a pre-trained deep learning model to extract a high-dimensional deep feature set, may include:
[0053] Step 401: Input the time-frequency domain representation into the input layer of the deep learning model to obtain standardized feature data; perform multi-scale feature extraction on the standardized feature data through convolutional layers to obtain a local feature set, specifically including: collecting fabric samples containing common printing defects such as missing prints, stains, misregistration, cracks, holes, and missing warp threads, collecting 500 to 800 samples of each defect type, and simultaneously collecting 1000 to 1500 samples of defect-free normal fabric; performing ultrasonic scanning on each sample, and sequentially performing amplitude compensation, preprocessing, time-frequency analysis, normalization, and feature enhancement processing to obtain the corresponding time-frequency domain representation, which is presented in the form of a two-dimensional image with pixel values ranging from 0 to 1; labeling each time-frequency domain representation with the corresponding defect type, without... Defects were labeled as normal. The training and validation datasets were divided in a 7:3 ratio. Data augmentation was performed on the training dataset, including horizontal flipping, vertical flipping, and rotation within 10 degrees, to ensure the model's generalization ability. During the model input layer processing, the time-frequency domain representation was input into the input layer, with a fixed size of 128×128 pixels. The input layer standardized each pixel value of the time-frequency domain representation, including calculating the arithmetic mean of all pixel values, and then calculating the arithmetic mean of the squares of the differences between all pixel values and the mean, i.e., the standard deviation. The mean was subtracted from each pixel value, and then divided by the standard deviation to obtain standardized feature data, making the data mean 0 and the variance 1, so as to avoid the difference in pixel values of different samples affecting model training.
[0054] When constructing the convolutional layer, three groups of convolutional kernels of different sizes are set: the first group has 32 kernels of 3×3 size, the second group has 64 kernels of 5×5 size, and the third group has 16 kernels of 7×7 size. The initial weight values of each convolutional kernel are randomly generated, ranging from -0.1 to 0.1. Each convolutional kernel corresponds to a bias value, which is initialized to a fixed value between 0.01 and 0.05. During convolution, each convolutional kernel slides on the standardized feature data with a stride of 1 pixel. During the slide, each element of the convolutional kernel is multiplied by the pixel value of the corresponding position in the standardized feature data. All multiplication results are summed, and the bias of the convolutional kernel is added to the sum of all multiplication results. The value is obtained by convolution to obtain the feature value at that position; edge detail features of fabric defects are extracted by 3×3 convolution kernel, such as the boundary texture of stains and the fine lines of cracks; medium-scale features are extracted by 5×5 convolution kernel, such as small areas of missing printing and small holes; and large-scale features are extracted by 7×7 convolution kernel, such as the overall offset trend of overprinting deviation and large areas of missing warp. All feature values output by the three convolution kernel groups are classified and summarized according to the convolution kernel scale. The 32 sets of feature values output by the 3×3 convolution kernel are classified into one category, the 64 sets of feature values output by the 5×5 convolution kernel are classified into one category, and the 16 sets of feature values output by the 7×7 convolution kernel are classified into one category, which together form a local feature set.
[0055] During model training, the Adam optimizer is used with an initial learning rate of 0.001. The learning rate is halved every 100 iterations; for example, after 100 iterations, it becomes 0.0005, and after 200 iterations, it becomes 0.00025. The cross-entropy loss function is used to calculate the loss value. The calculation process includes obtaining the true labels of the training samples. Taking a missing print sample as an example, its true label is a 7-dimensional vector, corresponding to seven categories: normal, missing print, stain, misregistration, crack, hole, and missing thread. The label vector for a missing print sample is 0, 1, 0, 0, 0, 0, 0. Next, the predicted probability distribution of the model's output for this sample is obtained. This distribution contains seven probability values, corresponding to the seven types of defects, and the sum of all probability values is 1. The value at each position in the true label (0 or 1) is multiplied by the natural logarithm of the predicted probability at the corresponding position. The result of multiplying the seven positions is then summed. Add the sum and take the negative of the sum to get the cross-entropy loss value of a single sample; calculate the arithmetic mean of the individual cross-entropy loss values of all samples in the current training batch to get the total cross-entropy loss value of the batch; calculate the gradient of each convolutional kernel weight and bias value based on the total cross-entropy loss value, which is the rate of change of the loss value with respect to the weight or bias value; the Adam optimizer adjusts the weights and bias values according to the gradient, and the adjustment range is controlled by the current learning rate; during training, the convolutional kernel weights are continuously optimized through gradient descent and eventually stabilized between -0.5 and 0.5 to avoid the model overfitting due to excessive weights; every 50 iterations, the model performance is verified using the validation dataset, and the cross-entropy loss value of the validation dataset is calculated. If the validation loss value increases for 3 consecutive times, training is stopped, and the optimal model parameters such as the convolutional kernel weights and bias values at this time are saved to ensure that the convolutional layer can stably extract local features of various defects.
[0056] Step 402 involves downsampling the local feature set using pooling layers to obtain a dimensionality-reduced feature set; recombining the dimensionality-reduced feature set using fully connected layers to obtain recombined deep features; and weighting the recombined deep features using feature weighting layers to obtain weighted features. Specifically, this includes: constructing pooling layers corresponding to convolutional layers in the model, with one pooling layer corresponding to each convolutional kernel group, all with a 2×2 kernel size and a stride of 2; downsampling the feature maps at each scale in the local feature set using max pooling, taking the largest feature value within the area covered by the 2×2 pooling kernel as the feature value of that area after pooling, and discarding the other three smaller values. This process reduces the size of the feature maps, for example, a 128×128 feature map becomes 64×64, removing redundant feature information, and summing the feature values output by the three pooling layers to obtain the dimensionality-reduced feature set.
[0057] A fully connected layer is constructed, consisting of two layers of neurons: the first layer has 256 neurons, and the second layer has 128 neurons. The initial weights of the neurons in the first layer are randomly generated, ranging from -0.05 to 0.05. Each neuron corresponds to a bias value, initialized to a fixed value between 0.01 and 0.03. The dimensionality-reduced feature set is expanded row-wise into a one-dimensional feature vector. For example, a 64×64×112 dimensionality-reduced feature set is expanded into a 45056-dimensional vector. This vector is input into the first layer of the fully connected layer. Each neuron receives all elements of the one-dimensional vector, and the calculation process multiplies each element by the weight value corresponding to that neuron. The first layer output is obtained by summing all the multiplication results and adding the bias value of the neuron, followed by ReLU activation. The initial weight values of the second layer neurons are also between -0.05 and 0.05, and the bias values are initialized to 0.01 to 0.03. The first layer output is input into the second layer neuron, and the same calculation process is repeated, that is, element-wise multiplication by weights, addition of bias, and ReLU activation, to obtain a 128-dimensional feature vector. This vector is the recombined deep feature, realizing the fusion and recombination of features of different dimensions. During training, the weights of the fully connected layer are optimized through backpropagation and eventually stabilized between -0.3 and 0.3 to avoid feature distortion caused by excessively large weights.
[0058] A feature weighting layer is constructed, assigning a learnable weight parameter to each dimension of the recombined deep features, resulting in 128 weight parameters with initial values between 0.05 and 0.15. The calculation process involves multiplying the value of each dimension of the recombined deep features by its corresponding weight parameter, summing all the multiplied values to obtain a comprehensive feature value, and retaining the value of each dimension multiplied by its weight, forming a feature vector containing the 128 weighted dimension values. This vector is the weighted feature. During training, the model adjusts the weight parameters based on the error in defect classification. For dimensions highly relevant to defect identification, the weight parameters are adjusted to between 0.2 and 0.8, while for irrelevant dimensions, the weight parameters are adjusted to between 0.01 and 0.1, thereby highlighting key features and weakening irrelevant features.
[0059] Step 403 involves fusing the local feature set, the dimensionality-reduced feature set, the recombined deep features, and the weighted features to obtain a high-dimensional deep feature set. Specifically, this includes: unifying the dimensions of the local feature set and the dimensionality-reduced feature set; expanding each scale feature map of the local feature set (3×3 convolution outputs 32 64×64 feature maps, 5×5 convolution outputs 64 64×64 feature maps, and 7×7 convolution outputs 16 64×64 feature maps) into a one-dimensional vector (3×3 convolution features expand to 32×4096=131072 dimensions, 5×5 convolution features expand to 64×4096=262144 dimensions, and 7×7 convolution features expand to 16×4096=65536 dimensions); similarly expanding the dimensionality-reduced feature set into a one-dimensional vector (e.g., 45056 dimensions); the recombined deep features are 128-dimensional vectors, and the weighted features are also 128-dimensional vectors.
[0060] During the fusion process, a feature concatenation method is adopted. The unfolded one-dimensional vector of the local feature set, the one-dimensional vector of the reduced-dimensional feature set, the recombined deep feature vector, and the weighted feature vector are concatenated in sequence to form a complete high-dimensional vector. The concatenation process is as follows: the one-dimensional vector of the local feature set is used as the first part of the high-dimensional vector; the one-dimensional vector of the reduced-dimensional feature set is used as the second part; the recombined deep feature vector is used as the third part; and finally, the weighted feature vector is used as the fourth part. The concatenated high-dimensional vector is then normalized by calculating the maximum and minimum values of all elements in the vector. Each element is subtracted from the minimum value and then divided by the difference between the maximum and minimum values to keep the vector elements between 0 and 1. This normalized high-dimensional vector is the high-dimensional deep feature set, which contains defect feature information at different levels and scales.
[0061] This embodiment extracts local features through multi-scale convolution kernels, which can comprehensively capture different levels of features of printing defects. It can capture both detailed features such as the edge of stains and overall features such as registration deviation, avoiding the omission of defect information caused by single-scale feature extraction. The downsampling process of the pooling layer can remove redundant information in the features, reduce the amount of subsequent calculations, and retain key defect features. The feature reorganization of the fully connected layer integrates the scattered features into a unified dimension of deep features. The feature weighting layer highlights the key features related to defect identification through weight allocation, thereby improving the effectiveness of the features.
[0062] In a preferred embodiment of the present invention, step 5, which uses a deep learning model to determine the defect type of the high-dimensional deep feature set and obtains the defect type result, may include:
[0063] Step 501: Input the high-dimensional deep feature set into the decision layer of the deep learning model to obtain preliminary defect classification data; calculate the probability distribution of the preliminary defect classification data to obtain the confidence parameters of each type of defect. Specifically, this includes: constructing a decision layer, where the number of neurons matches the number of defect types. If the defect types to be identified include normal, missing print, stain, overprinting deviation, crack, hole, and missing vein (7 types in total), then 7 neurons are set, using the softmax activation function; the initial weight value of each neuron is randomly generated, ranging from -0.1 to 0.1, and each neuron corresponds to a bias value, initialized to 0.01 to 0. Fixed values between 0.05; The high-dimensional deep feature set is input into the decision layer. The high-dimensional deep feature set is a one-dimensional vector (e.g., dimension 45056). Each neuron receives all elements of the vector. The calculation process is to take the value of each element in the vector, multiply it by the weight value of the corresponding position of the neuron, accumulate the results of multiplying all elements by their corresponding weights, and add the bias value of the neuron to obtain the original output value of the neuron. For example, if the value of an element in the high-dimensional deep feature set is 0.3, the weight of the corresponding neuron at that position is 0.06, the product is 0.018, the sum of all elements is 3.2, and the bias value of 0.04 is added, the original output value of the neuron is 3.24.
[0064] Softmax is calculated for the raw output values of all neurons. Taking 7 neurons as an example, assuming the 7 raw output values are 3.1, 2.2, 0.8, 0.5, 0.3, 0.2, and 0.1 respectively; first, each raw output value is used as the exponent of the exponential function, and the exponent result is calculated as: e 3.1 ≈22.198, e 2.2 ≈9.025, e 0.8 ≈2.225, e 0.5 ≈1.648, e 0.3 ≈1.349, e 0.2 ≈1.221, e 0.1≈1.105; Summing all the exponents gives the total: 22.198 + 9.025 + 2.225 + 1.648 + 1.349 + 1.221 + 1.105 ≈ 38.771; Dividing the exponent of each neuron by the sum gives the corresponding probability values: 22.198 ÷ 38.771 ≈ 0.572, 9.025 ÷ 38.771 ≈ 0.233, 2.225 ÷ 38.771 ≈ 0.057, 1.648 ÷ 38.771 ≈ 0.042, 1.349 ÷ 38.771 ≈ 0.035, 1.221 ÷ 38.771 ≈ 0.031, 1.105 ÷ 38. .771≈0.028; All probability values constitute the preliminary defect classification data, and each probability value represents the probability that the high-dimensional deep feature set belongs to the corresponding defect type; When calculating the probability distribution of the preliminary defect classification data, the probability value corresponding to each defect type is directly used as the confidence parameter of that type. The confidence parameter reflects the reliability of the model's judgment of the defect type; For example, in the above preliminary defect classification data, the probability value corresponding to missing print is 0.572, so the confidence parameter of missing print is 0.572; the probability value corresponding to stain is 0.233, so the confidence parameter of stain is 0.233; the probability value corresponding to normal is 0.028, so the confidence parameter of normal is 0.028.
[0065] Step 502: Compare the confidence parameters of various defects with preset thresholds to obtain a set of candidate defect types; sort the defect types in the candidate defect type set according to their confidence parameters to obtain the top-ranked defect types. Specifically, the preset threshold is determined based on the validation results during model training. Collect all correctly classified defect samples in the validation dataset, such as 200 missing print samples, 180 stain samples, and 150 misregistration samples. Calculate the confidence parameters of each correctly classified sample and the median of the confidence parameters for each type of sample. The median for missing print samples is 0.56, for stain samples 0.53, for misregistration samples 0.52, for crack samples 0.50, for hole samples 0.49, for missing warp threads 0.48, and for normal samples 0.09. Take the minimum value of the median of all defect types (excluding normal) of 0.48, adjust it upwards by 0.02, and determine the preset threshold as 0.5 to ensure that most correctly classified samples are covered while reducing the number of misclassified samples entering the candidate set.
[0066] During the comparison process, the confidence parameters of each type of defect are compared with the preset threshold of 0.5. If the confidence parameter of a certain defect type is greater than 0.5, then the defect type is included in the candidate defect type set. For example, in a sample, the confidence parameters for missing print are 0.63, stains are 0.36, and misregistration is 0.04. Only missing print is included in the candidate set. If the confidence parameters of all defect types are less than 0.5, such as missing print 0.49, stains 0.46, and misregistration is 0.05, then the missing print with the highest confidence parameter is included in the candidate defect type set to avoid the situation where there are no candidate types. When sorting, the candidate defect type sets are arranged in descending order of the confidence parameters of each type. If the candidate set contains missing print (0.63) and misregistration (0.54), then the sorting is missing print and misregistration, and the first two are taken as the defect types with the highest ranking. If the candidate set only contains stains (0.59), then stains are the defect types with the highest ranking.
[0067] Step 503: Match and verify the top-ranked defect types with a preset defect type library to obtain defect type results. Specifically, this includes: constructing a preset defect type library containing detailed feature descriptions for each printing defect type. For example, missing print is characterized by localized areas of unprinted areas on the fabric surface, with regularly shaped low-grayscale regions in the time-frequency domain representation, area ranging from 50 to 500 pixels, and ultrasonic echo signal amplitude more than 25% lower than normal areas; color stains are characterized by abnormal color patches on the surface, with irregular high-grayscale regions in the time-frequency domain representation, blurred edges, and echo signal amplitude more than 20% higher than normal areas; and overprinting deviation... The characteristics of a pattern misalignment are: multiple sets of parallel grayscale boundary offsets in the time-frequency domain representation, with offsets ranging from 3 to 10 pixels, and echo signal amplitude fluctuations of 15% to 30%; cracks are characterized by linear damage, with thin, elongated low-grayscale areas in the time-frequency domain representation, and echo signal amplitude dropping sharply before slowly recovering; holes are characterized by penetrating holes, with circular high-grayscale areas in the time-frequency domain representation, with clear edges, and echo signal amplitude close to 0; missing warp is characterized by missing warp yarns, with continuous low-grayscale stripes along the longitudinal direction in the time-frequency domain representation, and echo signal amplitude decreasing periodically; normal samples do not have the above characteristics, have uniform grayscale in the time-frequency domain, and stable echo signals.
[0068] During matching and verification, the time-frequency domain representation and echo signal associated with the high-dimensional deep feature set corresponding to the top-ranked defect types are first extracted. Key features are then extracted: for example, if the top-ranked type of a sample is a missing print, the shape (rectangle), area (200 pixels), gray value (0.2), and echo signal amplitude (30% lower than normal area) of its low gray-scale region are extracted. These key features are then compared with the feature descriptions of missing prints in the preset defect type library, and the number of matching features is counted. The matching features include regular shape, gray value 0.1 to 0.3, area 50 to 500 pixels, and echo amplitude 25% lower. If the percentage is above 90%, there are a total of 4 features, and all 4 match; the overlap is calculated by dividing the number of matching features by the total number of features (4÷4=1.0). If the overlap exceeds 0.9, the defect type is confirmed as a missing print. If the first defect type in the ranking fails to match, such as the first type of a sample being overprinting deviation, but the grayscale boundary in the extracted features is not offset and the overlap is only 0.3, then the same feature extraction and comparison are performed on the second defect type. If the overlap of both types is below 0.9, then it is determined as an unidentified defect type. The finally confirmed defect type is the defect type result.
[0069] In this embodiment, the probability distribution calculation and confidence parameter setting of the decision layer can quantify the reliability of the model in classifying defects. The preset threshold screening and the matching verification of the preset defect type library further eliminate incorrect classification results, ensure the accuracy of defect type judgment, reduce misjudgments caused by feature similarity, and avoid the omission of unidentified defects.
[0070] In a preferred embodiment of the present invention, step 6, generating final detection information based on the defect type result and in conjunction with the scan location information, may include:
[0071] Step 601: Associate and map the defect type result with the corresponding scanning position information to obtain defect data with position markers; spatially sort the defect data with position markers according to the scanning position information to obtain ordered defect distribution data. Specifically, this includes: during association and mapping, extracting the scanning position information corresponding to the defect type result from the original ultrasonic echo signal sequence, including not only the single lateral coordinate and longitudinal displacement of the defect area, but also extracting the coordinates of multiple feature points on the defect edge (each feature point includes lateral coordinates and longitudinal displacement), forming a set of polygon vertex coordinates for the defect area. For example, the vertex coordinates of a certain missing print defect are A(150, 300), B(180, 300), C(180, 330), and D(150, 330); using a polygon perimeter algorithm to calculate the perimeter of the defect area, specifically, determining the order of the vertex coordinate set (arranged clockwise or counterclockwise to ensure that adjacent vertices are adjacent points on the defect edge), and then calculating the side length between each pair of adjacent vertices using the distance formula between two points. )and( , The distance is Taking this missing print defect as an example, calculate the side length AB: =30 (unit: mm); Side length of BC: =30 (mm); CD side length: =30 (mm); Side length of DA: =30 (mm); Finally, add all the side lengths together (30 + 30 + 30 + 30 = 120 mm) to obtain the perimeter of the polygon in the defect area; bind the defect type result (such as missing print), the set of horizontal coordinates of the defect area, the set of vertical displacements, and the polygon perimeter to form a record containing the defect type, location range, and perimeter. All such records constitute defect data with location markers; during spatial sorting, first sort the defect data with location markers in ascending order of vertical displacement; under the same vertical displacement, sort in ascending order of horizontal coordinates from the guide edge to the operation edge (i.e., ascending order of horizontal coordinates); during the sorting process, if there are defects with overlapping vertical displacements and adjacent horizontal coordinates (the difference is less than the segment width of the independent detection area, such as when the segment width is 247.5 mm, the difference is less than 247.5 mm), The data is further compared with the polygon vertex coordinates of the two defects. If there is continuous overlap in the vertex coordinates (e.g., point D (150, 330) of defect A coincides with point A (150, 330) of defect B), then they are classified into the same defect area and marked as related defects in the ordered data. The perimeter of the polygon of the merged defect area is then recalculated (e.g., perimeter of A is 120mm, perimeter of B is 100mm, and the vertices after merging are A (150, 300), B (180, 300), C (180, 330), E (120, 330), F (120, 300), and the perimeter is calculated as AB30 + BC30 + CE30 + EF30 + FA30 = 150mm). After sorting, a defect data sequence containing defect perimeter information is formed according to the spatial location pattern. This sequence is the ordered defect distribution data.
[0072] Step 602: Perform regional statistical analysis on the ordered defect distribution data to obtain defect statistical information; integrate the defect statistical information with the defect type results to generate comprehensive inspection data; add timestamps and production batch information to the comprehensive inspection data to generate final inspection information, specifically including: during regional statistical analysis, using the independent inspection areas divided in step 203 as units, statistically analyze three pieces of information for each defect type in each independent inspection area, including: first, the number of defects, such as 5 missing prints and 3 color stains in a certain area; second, the total perimeter of each defect type, such as the perimeters of the 5 missing prints being 120mm, 150mm, and 130mm respectively. The total perimeter is 120+150+130+140+160=700mm, with 140mm and 160mm respectively. The average perimeter for each defect type is also calculated: the average perimeter of a missing print is 700÷5=140mm, and the total perimeter of a stain is 450mm, with an average perimeter of 450÷3=150mm. Simultaneously, the percentage of each defect type in the area is calculated: the percentage of a missing print is 5÷(5+3)=0.625, and the percentage of a stain is 3÷8=0.375. The total number of defects in all independent inspection areas, the total number of defects of each defect type, the total perimeter, and the total average perimeter are also calculated. These statistical results together constitute the defect statistics information.
[0073] During the integration process, defect type results, ordered defect distribution data, and defect statistics are associated according to the inspection object to form a comprehensive data record containing defect type, location distribution, perimeter information, and regional statistics. All such records constitute comprehensive inspection data. When adding a timestamp, the specific time when the comprehensive inspection data is generated is recorded. When adding production batch information, the production batch number corresponding to the fabric sample is entered. The timestamp and production batch information are added to each record of the comprehensive inspection data to form complete data containing defect type, location distribution, perimeter information, regional statistics, timestamp, and production batch. This complete data is the final inspection information.
[0074] In this embodiment, the association mapping between defect type results and scanning location information allows each defect to correspond to a specific spatial location on the fabric, facilitating the subsequent location of the specific area where the defect occurred and providing accurate location references for production line adjustments. Sorting defect data by spatial location can clearly present the distribution pattern of defects on the fabric, helping to identify areas of concentrated defects and analyze whether there are regional production problems.
[0075] like Figure 2 As shown, embodiments of the present invention also provide a deep learning-based printing defect detection system, comprising:
[0076] The acquisition module is used to scan the moving printed fabric with an ultrasonic probe to obtain the original ultrasonic echo signal sequence.
[0077] The calculation module is used to construct a spatial detection baseline in the width direction of the printed fabric, based on the scanning position information of the original ultrasonic echo signal sequence, using two fixed positions of the fabric production guide edge and the operation edge as reference benchmarks; the spatial detection baseline is divided to generate independent detection areas, and the dynamic compensation coefficient is calculated.
[0078] The processing module is used to preprocess the original ultrasonic echo signal according to the dynamic compensation coefficient to generate a preprocessed ultrasonic signal; and to perform time-frequency analysis on the preprocessed ultrasonic signal to obtain the corresponding time-frequency domain characterization.
[0079] The extraction module is used to input the time-frequency domain representation into a pre-trained deep learning model to extract a high-dimensional deep feature set;
[0080] The decision module is used to use a deep learning model to determine the defect type of a high-dimensional deep feature set and obtain the defect type result.
[0081] The generation module is used to generate the final detection information based on the defect type results and the scan location information.
[0082] It should be noted that this system is a system corresponding to the above method. All implementation methods in the above method embodiments are applicable to this embodiment and can achieve the same technical effect.
[0083] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A deep learning-based method for detecting printing defects, characterized in that, The method includes: Step 1: Use an ultrasonic probe to scan the moving printed fabric to obtain the original ultrasonic echo signal sequence. Step 2: Based on the scanning position information of the original ultrasonic echo signal sequence, a spatial detection baseline is constructed in the width direction of the printed fabric, using the two fixed positions of the fabric production guide edge and the operation edge as reference benchmarks; the spatial detection baseline is divided to generate independent detection areas, and the dynamic compensation coefficient is calculated. Step 3: Preprocess the original ultrasonic echo signal according to the dynamic compensation coefficient to generate a preprocessed ultrasonic signal; perform time-frequency analysis on the preprocessed ultrasonic signal to obtain the corresponding time-frequency domain characterization. Step 4: Input the time-frequency domain representation into the pre-trained deep learning model to extract a high-dimensional deep feature set; Step 5: Use a deep learning model to determine the defect type of the high-dimensional deep feature set and obtain the defect type result; Step 6: Based on the defect type results and combined with the scan location information, generate the final detection information.
2. The printing defect detection method based on deep learning according to claim 1, characterized in that, The moving printed fabric was scanned using an ultrasonic probe to obtain the original ultrasonic echo signal sequence, including: Multiple ultrasonic probes are fixedly arranged along the width of the printed fabric to obtain the probe detection area; each probe in the probe detection area emits an ultrasonic pulse into the moving printed fabric to obtain the original echo analog signal; The original echo analog signal of each probe is digitally sampled to obtain the initial echo data corresponding to each probe; the initial echo data is arranged in chronological order to obtain an ordered echo signal sequence. The ordered echo signal sequence of each probe is combined with the fixed lateral position of the probe and the longitudinal displacement data of the fabric movement to obtain the echo signal sequence of a single probe. The echo signal sequences from all probes are integrated and spatially aligned along the width direction to obtain the original ultrasonic echo signal sequence.
3. The printing defect detection method based on deep learning according to claim 2, characterized in that, Based on the scanning position information of the original ultrasonic echo signal sequence, a spatial detection baseline is constructed in the width direction of the printed fabric, using the two fixed positions of the fabric production guide edge and the operation edge as reference benchmarks. The spatial detection baseline is divided to generate independent detection areas, and the dynamic compensation coefficient is calculated, including: The scanning position information contained in the original ultrasonic echo signal sequence is extracted to obtain the set of horizontal coordinates and the set of vertical coordinates for each data point; By analyzing the set of horizontal coordinates, we can identify the horizontal coordinate values corresponding to the fixed positions of the guide edge and the operation edge, and obtain the coordinate data of the two reference points. Based on the coordinate data of two reference points, a spatial detection baseline is constructed by calculating in the width direction; the spatial detection baseline is then segmented according to a preset equal interval to generate independent detection areas. The amplitude data of all echo signals in each independent detection area are statistically analyzed, the average amplitude of the echo signals in each independent detection area is calculated, and the reference signal strength parameters of each area are obtained. By comparing the differences between the reference signal strength parameters of each region and the overall reference signal strength, the dynamic compensation coefficients corresponding to each region are calculated.
4. The printing defect detection method based on deep learning according to claim 3, characterized in that, The original ultrasonic echo signal is preprocessed according to the dynamic compensation coefficient to generate a preprocessed ultrasonic signal. Time-frequency analysis was performed on the preprocessed ultrasonic signal to obtain the corresponding time-frequency domain characterization, including: Multiply the dynamic compensation coefficient corresponding to each region with the original ultrasonic echo signal of the corresponding region to obtain the amplitude-compensated ultrasonic signal. The amplitude-compensated ultrasonic signal is preprocessed to obtain the preprocessed ultrasonic signal; the time-frequency analysis method is used on the preprocessed ultrasonic signal to convert the time-domain signal into a time-frequency joint distribution to obtain the initial time spectrum; The initial time spectrum is normalized to obtain a standardized time-frequency distribution, and then feature enhancement processing is performed to obtain a time-frequency domain representation.
5. The printing defect detection method based on deep learning according to claim 4, characterized in that, The time-frequency domain representation is input into a pre-trained deep learning model to extract a high-dimensional deep feature set, including: The time-frequency domain representation is input into the input layer of the deep learning model to obtain standardized feature data; multi-scale feature extraction is performed on the standardized feature data through convolutional layers to obtain a local feature set; The local feature set is downsampled by a pooling layer to obtain a dimensionality-reduced feature set; the dimensionality-reduced feature set is recombined by a fully connected layer to obtain recombined deep features; and the recombined deep features are weighted by a feature weighting layer to obtain weighted features. The local feature set, the dimensionality-reduced feature set, the recombined deep features, and the weighted features are fused to obtain a high-dimensional deep feature set.
6. The printing defect detection method based on deep learning according to claim 5, characterized in that, Using a deep learning model to determine the defect type of a high-dimensional deep feature set, the defect type results are obtained, including: The high-dimensional deep feature set is input into the decision layer of the deep learning model to obtain preliminary defect classification data; the probability distribution of the preliminary defect classification data is calculated to obtain the confidence parameters of each type of defect. The confidence parameters of various defects are compared with preset thresholds to obtain a set of candidate defect types; the defect types in the candidate defect type set are sorted according to the confidence parameters to obtain the defect types with the highest ranking. The defect types ranked first are matched and verified against the preset defect type library to obtain the defect type results.
7. The printing defect detection method based on deep learning according to claim 6, characterized in that, Based on the defect type results and combined with the scan location information, the final detection information is generated, including: The defect type results are associated and mapped with the corresponding scan location information to obtain defect data with location markers; the defect data with location markers are spatially sorted according to the scan location information to obtain ordered defect distribution data. Regional statistical analysis is performed on ordered defect distribution data to obtain defect statistical information; the defect statistical information is integrated with the defect type results to generate comprehensive inspection data; timestamps and production batch information are added to the comprehensive inspection data to generate final inspection information.
8. A deep learning-based printing defect detection system, wherein the system implements the method as described in any one of claims 1 to 7, characterized in that, include: The acquisition module is used to scan the moving printed fabric with an ultrasonic probe to obtain the original ultrasonic echo signal sequence. The calculation module is used to construct a spatial detection baseline in the width direction of the printed fabric, based on the scanning position information of the original ultrasonic echo signal sequence and using two fixed positions of the fabric production guide edge and the operation edge as reference benchmarks. The spatial detection baseline is divided to generate independent detection areas, and the dynamic compensation coefficient is calculated. The processing module is used to preprocess the original ultrasonic echo signal according to the dynamic compensation coefficient to generate a preprocessed ultrasonic signal. Time-frequency analysis was performed on the preprocessed ultrasonic signal to obtain the corresponding time-frequency domain characterization; The extraction module is used to input the time-frequency domain representation into a pre-trained deep learning model to extract a high-dimensional deep feature set; The decision module is used to use a deep learning model to determine the defect type of a high-dimensional deep feature set and obtain the defect type result. The generation module is used to generate the final detection information based on the defect type results and the scan location information.